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)  

etc.c File Reference
#include <mruby.h>
#include <mruby/string.h>
#include <mruby/data.h>
#include <mruby/class.h>
#include <mruby/numeric.h>
Include dependency graph for etc.c:

Go to the source code of this file.

Macros

#define MakeID2(p, t)   (mrb_int)(((intptr_t)(p))^(t))
 
#define MakeID(p)   MakeID2(p,tt)
 
#define mrb_xxx_boxing_cptr_value   mrb_word_boxing_cptr_value
 

Functions

struct RDatamrb_data_object_alloc (mrb_state *mrb, struct RClass *klass, void *ptr, const mrb_data_type *type)
 
void mrb_data_check_type (mrb_state *mrb, mrb_value obj, const mrb_data_type *type)
 
voidmrb_data_check_get_ptr (mrb_state *mrb, mrb_value obj, const mrb_data_type *type)
 
voidmrb_data_get_ptr (mrb_state *mrb, mrb_value obj, const mrb_data_type *type)
 
mrb_sym mrb_obj_to_sym (mrb_state *mrb, mrb_value name)
 
static mrb_int make_num_id (const char *p, size_t len)
 
mrb_int mrb_int_id (mrb_int n)
 
mrb_int mrb_float_id (mrb_float f)
 
mrb_int mrb_obj_id (mrb_value obj)
 
mrb_value mrb_word_boxing_float_value (mrb_state *mrb, mrb_float f)
 
mrb_value mrb_word_boxing_int_value (mrb_state *mrb, mrb_int n)
 
mrb_value mrb_word_boxing_cptr_value (mrb_state *mrb, void *p)
 

Macro Definition Documentation

◆ MakeID

#define MakeID (   p)    MakeID2(p,tt)

◆ MakeID2

#define MakeID2 (   p,
  t 
)    (mrb_int)(((intptr_t)(p))^(t))

◆ mrb_xxx_boxing_cptr_value

#define mrb_xxx_boxing_cptr_value   mrb_word_boxing_cptr_value

Definition at line 153 of file etc.c.

Function Documentation

◆ make_num_id()

static mrb_int make_num_id ( const char *  p,
size_t  len 
)
static

Definition at line 74 of file etc.c.

References id, len, and p.

Referenced by mrb_float_id(), and mrb_int_id().

◆ mrb_data_check_get_ptr()

void* mrb_data_check_get_ptr ( mrb_state mrb,
mrb_value  obj,
const mrb_data_type type 
)

Definition at line 46 of file etc.c.

References DATA_PTR, DATA_TYPE, mrb_data_p, NULL, and type.

Referenced by mrb_unpack_backtrace().

◆ mrb_data_check_type()

void mrb_data_check_type ( mrb_state mrb,
mrb_value  obj,
const mrb_data_type type 
)

Definition at line 26 of file etc.c.

References DATA_TYPE, E_TYPE_ERROR, mrb_check_type(), mrb_data_p, mrb_raisef(), MRB_TT_DATA, t2, and type.

Referenced by mrb_data_get_ptr().

◆ mrb_data_get_ptr()

void* mrb_data_get_ptr ( mrb_state mrb,
mrb_value  obj,
const mrb_data_type type 
)

Definition at line 58 of file etc.c.

References DATA_PTR, mrb_data_check_type(), and type.

Referenced by io_get_open_fptr(), mrb_get_args(), mrb_io_closed(), and mrb_stat0().

◆ mrb_data_object_alloc()

struct RData* mrb_data_object_alloc ( mrb_state mrb,
struct RClass klass,
void ptr,
const mrb_data_type type 
)

Definition at line 14 of file etc.c.

References data, mrb_obj_alloc(), MRB_TT_DATA, ptr, and type.

Referenced by mrb_io_s_pipe(), mrb_io_s_popen_args(), and packed_backtrace().

◆ mrb_float_id()

mrb_int mrb_float_id ( mrb_float  f)

Definition at line 95 of file etc.c.

References f, and make_num_id().

Referenced by mrb_obj_id().

◆ mrb_int_id()

mrb_int mrb_int_id ( mrb_int  n)

Definition at line 88 of file etc.c.

References make_num_id(), and n.

Referenced by mrb_obj_id().

◆ mrb_obj_id()

◆ mrb_obj_to_sym()

mrb_sym mrb_obj_to_sym ( mrb_state mrb,
mrb_value  name 
)

◆ mrb_word_boxing_cptr_value()

mrb_value mrb_word_boxing_cptr_value ( mrb_state mrb,
void p 
)

Definition at line 185 of file etc.c.

References mrb_obj_alloc(), MRB_TT_CPTR, mrb_state::object_class, p, SET_OBJ_VALUE, and v.

◆ mrb_word_boxing_float_value()

mrb_value mrb_word_boxing_float_value ( mrb_state mrb,
mrb_float  f 
)

Definition at line 157 of file etc.c.

References f, mrb_state::float_class, mrb_obj_alloc(), MRB_SET_FROZEN_FLAG, MRB_TT_FLOAT, and v.

◆ mrb_word_boxing_int_value()

mrb_value mrb_word_boxing_int_value ( mrb_state mrb,
mrb_int  n 
)