9 #define LWESRB_MKSYM(SYM) sym_##SYM = ID2SYM(rb_intern(#SYM))
10 #define LWESRB_MKID(NAME) id_##NAME = rb_intern(#NAME)
12 extern VALUE cLWES_TypeDB
;
14 struct lwes_event_type_db
* lwesrb_get_type_db(VALUE self
);
16 void lwesrb_init_type_db(void);
18 void lwesrb_init_emitter(void);
20 void lwesrb_init_numeric(void);
22 void lwesrb_init_event(void);
24 void lwesrb_init_listener(void);
26 VALUE
lwesrb_wrap_event(VALUE klass
, struct lwes_event
*e
);
28 void lwesrb_dump_type(LWES_BYTE type
, LWES_BYTE_P buf
, size_t *off
);
30 void lwesrb_dump_num(LWES_BYTE type
, VALUE val
, LWES_BYTE_P buf
, size_t *off
);
32 void lwesrb_dump_num_ary(VALUE array
, LWES_BYTE_P buf
, size_t *off
);
35 # define RSTRING_PTR(s) (RSTRING(s)->ptr)
36 # define RSTRING_LEN(s) (RSTRING(s)->len)
40 # define RARRAY_PTR(s) (RARRAY(s)->ptr)
41 # define RARRAY_LEN(s) (RARRAY(s)->len)
44 #define RAISE_INSPECT(v) RSTRING_PTR(raise_inspect = rb_inspect(v))
46 extern VALUE cLWES_Event
;
48 struct lwes_event
* lwesrb_get_event(VALUE self
);
50 LWES_U_INT_16
lwesrb_uint16(VALUE val
);
51 LWES_INT_16
lwesrb_int16(VALUE val
);
52 LWES_U_INT_32
lwesrb_uint32(VALUE val
);
53 LWES_INT_32
lwesrb_int32(VALUE val
);
54 LWES_U_INT_64
lwesrb_uint64(VALUE val
);
55 /* NUM2LL can raise RangeError */
56 #define lwesrb_int64(VAL) (LWES_INT_64)NUM2LL((VAL))
57 LWES_IP_ADDR
lwesrb_ip_addr(VALUE val
);
58 LWES_BOOLEAN
lwesrb_boolean(VALUE val
);
60 #endif /* LWES_RUBY_H */