Added spec:commit task to commit changes to spec/ruby sources.
[rbx.git] / shotgun / lib / list.h
blob4c6ec05cfae80d50788ebcc5d6a05893902f3210
2 void Init_list(STATE);
3 OBJECT list_new(STATE);
4 void list_append(STATE, OBJECT self, OBJECT obj);
5 OBJECT list_shift(STATE, OBJECT self);
6 int list_delete(STATE, OBJECT self, OBJECT obj);
8 #define ListFields 3
9 #define ListNodeFields 2
11 #define list_set_count(obj, val) SET_FIELD(obj, 0, val)
12 #define list_set_first(obj, val) SET_FIELD(obj, 1, val)
13 #define list_set_last(obj, val) SET_FIELD(obj, 2, val)
15 #define list_get_count(obj) NTH_FIELD(obj, 0)
16 #define list_get_first(obj) NTH_FIELD(obj, 1)
17 #define list_get_last(obj) NTH_FIELD(obj, 2)
20 #define list_node_set_object(obj, val) SET_FIELD(obj, 0, val)
21 #define list_node_set_next(obj, val) SET_FIELD(obj, 1, val)
23 #define list_node_get_object(obj) NTH_FIELD(obj, 0)
24 #define list_node_get_next(obj) NTH_FIELD(obj, 1)
26 #define list_empty_p(lst) (list_get_count(lst) == I2N(0))