Last change
on this file since 3158 was
2821,
checked in by Sam Hocevar, 12 years ago
|
Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.
|
-
Property svn:eol-style set to
native
|
File size:
2.0 KB
|
Line | |
---|
1 | #ifndef __COMMON_H__ |
---|
2 | #define __COMMON_H__ |
---|
3 | |
---|
4 | #define _SELF (DATA_PTR(self)) |
---|
5 | |
---|
6 | #define get_singleton_double_list(x) \ |
---|
7 | static VALUE x##_list(void) \ |
---|
8 | { \ |
---|
9 | VALUE ary, ary2; \ |
---|
10 | char const* const* list; \ |
---|
11 | \ |
---|
12 | list = caca_get_##x##_list(); \ |
---|
13 | ary = rb_ary_new(); \ |
---|
14 | while (*list != NULL) \ |
---|
15 | { \ |
---|
16 | ary2 = rb_ary_new(); \ |
---|
17 | rb_ary_push(ary2, rb_str_new2(*list)); \ |
---|
18 | list++; \ |
---|
19 | rb_ary_push(ary2, rb_str_new2(*list)); \ |
---|
20 | list++; \ |
---|
21 | rb_ary_push(ary, ary2); \ |
---|
22 | } \ |
---|
23 | \ |
---|
24 | return ary; \ |
---|
25 | } |
---|
26 | |
---|
27 | #define get_double_list(x) \ |
---|
28 | static VALUE x##_list(VALUE self) \ |
---|
29 | { \ |
---|
30 | VALUE ary, ary2; \ |
---|
31 | char const* const* list; \ |
---|
32 | \ |
---|
33 | list = caca_get_##x##_list(_SELF); \ |
---|
34 | ary = rb_ary_new(); \ |
---|
35 | while (*list != NULL) \ |
---|
36 | { \ |
---|
37 | ary2 = rb_ary_new(); \ |
---|
38 | rb_ary_push(ary2, rb_str_new2(*list)); \ |
---|
39 | list++; \ |
---|
40 | rb_ary_push(ary2, rb_str_new2(*list)); \ |
---|
41 | list++; \ |
---|
42 | rb_ary_push(ary, ary2); \ |
---|
43 | } \ |
---|
44 | \ |
---|
45 | return ary; \ |
---|
46 | } |
---|
47 | |
---|
48 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.