extra argument checking because users can be careless
[lwes-ruby.git] / ext / lwes / lwes_ruby.h
blob0657fcfb3947a9b6e07a501ed46744a2deac56ff
1 #ifndef LWES_RUBY_H
2 #define LWES_RUBY_H
4 #include <lwes.h>
5 #include <ruby.h>
6 #include <assert.h>
7 #include <stdint.h>
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 int lwesrb_event_set_numeric(
23 struct lwes_event *event,
24 LWES_CONST_SHORT_STRING name,
25 VALUE array);
27 int lwesrb_event_set_num(
28 struct lwes_event *event,
29 LWES_CONST_SHORT_STRING name,
30 LWES_TYPE type,
31 VALUE val);
33 #ifndef RSTRING_PTR
34 # define RSTRING_PTR(s) (RSTRING(s)->ptr)
35 # define RSTRING_LEN(s) (RSTRING(s)->len)
36 #endif
38 #ifndef RARRAY_PTR
39 # define RARRAY_PTR(s) (RARRAY(s)->ptr)
40 # define RARRAY_LEN(s) (RARRAY(s)->len)
41 #endif
43 #endif /* LWES_RUBY_H */