w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

range.c File Reference
#include <mruby.h>
#include <mruby/class.h>
#include <mruby/range.h>
#include <mruby/string.h>
#include <mruby/array.h>
#include <mruby/presym.h>
Include dependency graph for range.c:

Go to the source code of this file.

Macros

#define RANGE_INITIALIZED_MASK   1
 
#define RANGE_INITIALIZED(p)   ((p)->flags |= RANGE_INITIALIZED_MASK)
 
#define RANGE_INITIALIZED_P(p)   ((p)->flags & RANGE_INITIALIZED_MASK)
 

Functions

static void r_check (mrb_state *mrb, mrb_value a, mrb_value b)
 
static mrb_bool r_le (mrb_state *mrb, mrb_value a, mrb_value b)
 
static mrb_bool r_gt (mrb_state *mrb, mrb_value a, mrb_value b)
 
static mrb_bool r_ge (mrb_state *mrb, mrb_value a, mrb_value b)
 
static void range_ptr_alloc_edges (mrb_state *mrb, struct RRange *r)
 
static struct RRangerange_ptr_init (mrb_state *mrb, struct RRange *r, mrb_value beg, mrb_value end, mrb_bool excl)
 
static void range_ptr_replace (mrb_state *mrb, struct RRange *r, mrb_value beg, mrb_value end, mrb_bool excl)
 
static mrb_value range_beg (mrb_state *mrb, mrb_value range)
 
static mrb_value range_end (mrb_state *mrb, mrb_value range)
 
static mrb_value range_excl (mrb_state *mrb, mrb_value range)
 
static mrb_value range_initialize (mrb_state *mrb, mrb_value range)
 
static mrb_value range_eq (mrb_state *mrb, mrb_value range)
 
static mrb_value range_include (mrb_state *mrb, mrb_value range)
 
static mrb_value range_to_s (mrb_state *mrb, mrb_value range)
 
static mrb_value range_inspect (mrb_state *mrb, mrb_value range)
 
static mrb_value range_eql (mrb_state *mrb, mrb_value range)
 
static mrb_value range_initialize_copy (mrb_state *mrb, mrb_value copy)
 
mrb_value mrb_get_values_at (mrb_state *mrb, mrb_value obj, mrb_int olen, mrb_int argc, const mrb_value *argv, mrb_value(*func)(mrb_state *, mrb_value, mrb_int))
 
void mrb_gc_mark_range (mrb_state *mrb, struct RRange *r)
 
struct RRangemrb_range_ptr (mrb_state *mrb, mrb_value range)
 
mrb_value mrb_range_new (mrb_state *mrb, mrb_value beg, mrb_value end, mrb_bool excl)
 
enum mrb_range_beg_len mrb_range_beg_len (mrb_state *mrb, mrb_value range, mrb_int *begp, mrb_int *lenp, mrb_int len, mrb_bool trunc)
 
void mrb_init_range (mrb_state *mrb)
 

Macro Definition Documentation

◆ RANGE_INITIALIZED

#define RANGE_INITIALIZED (   p)    ((p)->flags |= RANGE_INITIALIZED_MASK)

Definition at line 15 of file range.c.

◆ RANGE_INITIALIZED_MASK

#define RANGE_INITIALIZED_MASK   1

Definition at line 14 of file range.c.

◆ RANGE_INITIALIZED_P

#define RANGE_INITIALIZED_P (   p)    ((p)->flags & RANGE_INITIALIZED_MASK)

Definition at line 16 of file range.c.

Function Documentation

◆ mrb_gc_mark_range()

void mrb_gc_mark_range ( mrb_state mrb,
struct RRange r 
)

Definition at line 375 of file range.c.

References mrb_gc_mark_value, r, RANGE_BEG, RANGE_END, and RANGE_INITIALIZED_P.

Referenced by gc_mark_children().

◆ mrb_get_values_at()

◆ mrb_init_range()

◆ mrb_range_beg_len()

enum mrb_range_beg_len mrb_range_beg_len ( mrb_state mrb,
mrb_value  range,
mrb_int begp,
mrb_int lenp,
mrb_int  len,
mrb_bool  trunc 
)

Definition at line 396 of file range.c.

References end, RRange::excl, mrb_range_value, NULL, r, and range_ptr_init().

Referenced by mrb_get_values_at().

◆ mrb_range_new()

mrb_value mrb_range_new ( mrb_state mrb,
mrb_value  beg,
mrb_value  end,
mrb_bool  excl 
)

Definition at line 396 of file range.c.

Referenced by mrb_vm_exec().

◆ mrb_range_ptr()

◆ r_check()

static void r_check ( mrb_state mrb,
mrb_value  a,
mrb_value  b 
)
static

Definition at line 19 of file range.c.

References a, b, E_ARGUMENT_ERROR, mrb_cmp(), mrb_nil_p, mrb_raise(), MRB_TT_FLOAT, MRB_TT_INTEGER, mrb_type(), and n.

Referenced by range_ptr_init().

◆ r_ge()

static mrb_bool r_ge ( mrb_state mrb,
mrb_value  a,
mrb_value  b 
)
static

Definition at line 60 of file range.c.

References a, b, FALSE, mrb_cmp(), n, and TRUE.

Referenced by range_include().

◆ r_gt()

static mrb_bool r_gt ( mrb_state mrb,
mrb_value  a,
mrb_value  b 
)
static

Definition at line 54 of file range.c.

References a, b, and mrb_cmp().

Referenced by range_include().

◆ r_le()

static mrb_bool r_le ( mrb_state mrb,
mrb_value  a,
mrb_value  b 
)
static

Definition at line 45 of file range.c.

References a, b, FALSE, mrb_cmp(), n, and TRUE.

Referenced by range_include().

◆ range_beg()

static mrb_value range_beg ( mrb_state mrb,
mrb_value  range 
)
static

Definition at line 118 of file range.c.

References mrb_range_beg, and range.

Referenced by mrb_init_range().

◆ range_end()

static mrb_value range_end ( mrb_state mrb,
mrb_value  range 
)
static

◆ range_eq()

◆ range_eql()

◆ range_excl()

static mrb_value range_excl ( mrb_state mrb,
mrb_value  range 
)
static

Definition at line 146 of file range.c.

References mrb_bool_value(), mrb_range_excl_p, and range.

Referenced by mrb_init_range().

◆ range_include()

static mrb_value range_include ( mrb_state mrb,
mrb_value  range 
)
static

◆ range_initialize()

static mrb_value range_initialize ( mrb_state mrb,
mrb_value  range 
)
static

Definition at line 160 of file range.c.

References end, FALSE, mrb_get_args(), mrb_obj_freeze(), mrb_range_raw_ptr, range, and range_ptr_replace().

Referenced by mrb_init_range().

◆ range_initialize_copy()

◆ range_inspect()

static mrb_value range_inspect ( mrb_state mrb,
mrb_value  range 
)
static

◆ range_ptr_alloc_edges()

static void range_ptr_alloc_edges ( mrb_state mrb,
struct RRange r 
)
static

Definition at line 69 of file range.c.

References mrb_malloc(), and r.

Referenced by range_ptr_init().

◆ range_ptr_init()

◆ range_ptr_replace()

static void range_ptr_replace ( mrb_state mrb,
struct RRange r,
mrb_value  beg,
mrb_value  end,
mrb_bool  excl 
)
static

Definition at line 104 of file range.c.

References end, RRange::excl, mrb_write_barrier(), r, and range_ptr_init().

Referenced by range_initialize(), and range_initialize_copy().

◆ range_to_s()

static mrb_value range_to_s ( mrb_state mrb,
mrb_value  range 
)
static