Groonga 3.0.9 Source Code Document
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
groonga
vendor
mruby-eeac4be
include
mruby
proc.h
Go to the documentation of this file.
1
/*
2
** mruby/proc.h - Proc class
3
**
4
** See Copyright Notice in mruby.h
5
*/
6
7
#ifndef MRUBY_PROC_H
8
#define MRUBY_PROC_H
9
10
#include "
mruby/irep.h
"
11
12
#if defined(__cplusplus)
13
extern
"C"
{
14
#endif
15
16
struct
REnv
{
17
MRB_OBJECT_HEADER
;
18
mrb_value
*
stack
;
19
mrb_sym
mid
;
20
int
cioff
;
21
};
22
23
struct
RProc
{
24
MRB_OBJECT_HEADER
;
25
union
{
26
mrb_irep
*
irep
;
27
mrb_func_t
func
;
28
}
body
;
29
struct
RClass
*
target_class
;
30
struct
REnv
*
env
;
31
};
32
33
/* aspec access */
34
#define MRB_ASPEC_REQ(a) (((a) >> 18) & 0x1f)
35
#define MRB_ASPEC_OPT(a) (((a) >> 13) & 0x1f)
36
#define MRB_ASPEC_REST(a) ((a) & (1<<12))
37
#define MRB_ASPEC_POST(a) (((a) >> 7) & 0x1f)
38
#define MRB_ASPEC_KEY(a) (((a) >> 2) & 0x1f)
39
#define MRB_ASPEC_KDICT(a) ((a) & (1<<1))
40
#define MRB_ASPEC_BLOCK(a) ((a) & 1)
41
42
#define MRB_PROC_CFUNC 128
43
#define MRB_PROC_CFUNC_P(p) (((p)->flags & MRB_PROC_CFUNC) != 0)
44
#define MRB_PROC_STRICT 256
45
#define MRB_PROC_STRICT_P(p) (((p)->flags & MRB_PROC_STRICT) != 0)
46
47
#define mrb_proc_ptr(v) ((struct RProc*)(mrb_ptr(v)))
48
49
struct
RProc
*
mrb_proc_new
(
mrb_state
*,
mrb_irep
*);
50
struct
RProc
*
mrb_proc_new_cfunc
(
mrb_state
*,
mrb_func_t
);
51
struct
RProc
*
mrb_closure_new
(
mrb_state
*,
mrb_irep
*);
52
struct
RProc
*
mrb_closure_new_cfunc
(
mrb_state
*mrb,
mrb_func_t
func
,
int
nlocals);
53
void
mrb_proc_copy
(
struct
RProc
*a,
struct
RProc
*
b
);
54
55
#include "
mruby/khash.h
"
56
KHASH_DECLARE
(mt,
mrb_sym
,
struct
RProc
*, 1)
57
58
#if defined(__cplusplus)
59
}
/* extern "C" { */
60
#endif
61
62
#endif
/* MRUBY_PROC_H */
Generated on Sun Nov 10 2013 09:49:04 for Groonga 3.0.9 Source Code Document by
1.8.1.2