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)  

proc.c File Reference
#include <mruby.h>
#include <mruby/class.h>
#include <mruby/proc.h>
#include <mruby/opcode.h>
#include <mruby/data.h>
#include <mruby/presym.h>
Include dependency graph for proc.c:

Go to the source code of this file.

Functions

struct RProcmrb_proc_new (mrb_state *mrb, const mrb_irep *irep)
 
struct REnvmrb_env_new (mrb_state *mrb, struct mrb_context *c, mrb_callinfo *ci, int nstacks, mrb_value *stack, struct RClass *tc)
 
static void closure_setup (mrb_state *mrb, struct RProc *p)
 
struct RProcmrb_closure_new (mrb_state *mrb, const mrb_irep *irep)
 
struct RProcmrb_proc_new_cfunc (mrb_state *mrb, mrb_func_t func)
 
struct RProcmrb_proc_new_cfunc_with_env (mrb_state *mrb, mrb_func_t func, mrb_int argc, const mrb_value *argv)
 
struct RProcmrb_closure_new_cfunc (mrb_state *mrb, mrb_func_t func, int nlocals)
 
mrb_value mrb_proc_cfunc_env_get (mrb_state *mrb, mrb_int idx)
 
void mrb_proc_copy (struct RProc *a, struct RProc *b)
 
static mrb_value mrb_proc_s_new (mrb_state *mrb, mrb_value proc_class)
 
static mrb_value mrb_proc_init_copy (mrb_state *mrb, mrb_value self)
 
static mrb_value proc_arity (mrb_state *mrb, mrb_value self)
 
static mrb_value proc_lambda (mrb_state *mrb, mrb_value self)
 
mrb_int mrb_proc_arity (const struct RProc *p)
 
void mrb_init_proc (mrb_state *mrb)
 

Variables

static const mrb_code call_iseq []
 
static const mrb_irep call_irep
 

Function Documentation

◆ closure_setup()

◆ mrb_closure_new()

struct RProc* mrb_closure_new ( mrb_state mrb,
const mrb_irep irep 
)

Definition at line 109 of file proc.c.

References closure_setup(), RProc::irep, mrb_proc_new(), and p.

Referenced by mrb_vm_exec().

◆ mrb_closure_new_cfunc()

struct RProc* mrb_closure_new_cfunc ( mrb_state mrb,
mrb_func_t  func,
int  nlocals 
)

Definition at line 160 of file proc.c.

References func, mrb_proc_new_cfunc_with_env(), and NULL.

◆ mrb_env_new()

struct REnv* mrb_env_new ( mrb_state mrb,
struct mrb_context c,
mrb_callinfo ci,
int  nstacks,
mrb_value stack,
struct RClass tc 
)

◆ mrb_init_proc()

◆ mrb_proc_arity()

mrb_int mrb_proc_arity ( const struct RProc p)

◆ mrb_proc_cfunc_env_get()

◆ mrb_proc_copy()

void mrb_proc_copy ( struct RProc a,
struct RProc b 
)

Definition at line 187 of file proc.c.

References a, b, mrb_irep_incref(), MRB_PROC_CFUNC_P, and NULL.

Referenced by mrb_mod_define_method_m(), mrb_proc_init_copy(), mrb_proc_s_new(), and proc_lambda().

◆ mrb_proc_init_copy()

static mrb_value mrb_proc_init_copy ( mrb_state mrb,
mrb_value  self 
)
static

Definition at line 224 of file proc.c.

References E_ARGUMENT_ERROR, mrb_get_arg1(), mrb_proc_copy(), mrb_proc_p, mrb_proc_ptr, and mrb_raise().

Referenced by mrb_init_proc().

◆ mrb_proc_new()

◆ mrb_proc_new_cfunc()

struct RProc* mrb_proc_new_cfunc ( mrb_state mrb,
mrb_func_t  func 
)

◆ mrb_proc_new_cfunc_with_env()

◆ mrb_proc_s_new()

◆ proc_arity()

static mrb_value proc_arity ( mrb_state mrb,
mrb_value  self 
)
static

Definition at line 237 of file proc.c.

References mrb_int_value(), mrb_proc_arity(), and mrb_proc_ptr.

Referenced by mrb_init_proc().

◆ proc_lambda()

Variable Documentation

◆ call_irep

const mrb_irep call_irep
static
Initial value:
= {
0,
2,
0,
1 | 2 ,
NULL,
NULL,
NULL,
NULL,
NULL,
1,
0,
0,
1,
0,
}
#define NULL
Definition: ftobjs.h:61
static const mrb_code call_iseq[]
Definition: proc.c:14

Definition at line 18 of file proc.c.

Referenced by mrb_init_proc().

◆ call_iseq

const mrb_code call_iseq[]
static
Initial value:
= {
}
@ OP_CALL
Definition: lopcodes.h:216

Definition at line 14 of file proc.c.