Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 17 gadiem
pirms 17 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __COMMON_H__
  2. #define __COMMON_H__
  3. #define _SELF (DATA_PTR(self))
  4. #define get_singleton_double_list(x) \
  5. static VALUE x##_list(void) \
  6. { \
  7. VALUE ary, ary2; \
  8. char const* const* list; \
  9. \
  10. list = caca_get_##x##_list(); \
  11. ary = rb_ary_new(); \
  12. while (*list != NULL) \
  13. { \
  14. ary2 = rb_ary_new(); \
  15. rb_ary_push(ary2, rb_str_new2(*list)); \
  16. list++; \
  17. rb_ary_push(ary2, rb_str_new2(*list)); \
  18. list++; \
  19. rb_ary_push(ary, ary2); \
  20. } \
  21. \
  22. return ary; \
  23. }
  24. #define get_double_list(x) \
  25. static VALUE x##_list(VALUE self) \
  26. { \
  27. VALUE ary, ary2; \
  28. char const* const* list; \
  29. \
  30. list = caca_get_##x##_list(_SELF); \
  31. ary = rb_ary_new(); \
  32. while (*list != NULL) \
  33. { \
  34. ary2 = rb_ary_new(); \
  35. rb_ary_push(ary2, rb_str_new2(*list)); \
  36. list++; \
  37. rb_ary_push(ary2, rb_str_new2(*list)); \
  38. list++; \
  39. rb_ary_push(ary, ary2); \
  40. } \
  41. \
  42. return ary; \
  43. }
  44. #endif