root/libswish3/trunk/bindings/perl/macros.h

Revision 2161, 1.9 kB (checked in by karpet, 3 weeks ago)

yank old wordlist in favor of token_iterator -- TODO still some ref_cnt issues

Line 
1 /* global debug var -- set with swish_init() */
2 extern int SWISH_DEBUG;
3
4 #define CONFIG_CLASS        "SWISH::3::Config"
5 #define CONFIG_CLASS_KEY    "sp_config_class"
6 #define ANALYZER_CLASS      "SWISH::3::Analyzer"
7 #define ANALYZER_CLASS_KEY  "sp_analyzer_class"
8 #define PARSER_CLASS        "SWISH::3::Parser"
9 #define PARSER_CLASS_KEY    "sp_parser_class"
10 #define DATA_CLASS          "SWISH::3::Data"
11 #define DATA_CLASS_KEY      "sp_data_class"
12 #define TOKEN_CLASS         "SWISH::3::Token"
13 #define TOKENITERATOR_CLASS "SWISH::3::TokenIterator"
14 #define DOC_CLASS           "SWISH::3::Doc"
15 #define PROPERTY_CLASS      "SWISH::3::Property"
16 #define METANAME_CLASS      "SWISH::3::MetaName"
17 #define PROPERTY_HASH_CLASS "SWISH::3::PropertyHash"
18 #define METANAME_HASH_CLASS "SWISH::3::MetaNameHash"
19 #define XML2_HASH_CLASS     "SWISH::3::xml2Hash"
20 #define SELF_KEY            "sp_self"
21 #define CONFIG_KEY          "sp_config"
22 #define ANALYZER_KEY        "sp_analyzer"
23 #define HANDLER_KEY         "sp_handler"
24 #define TOKENIZER_KEY       "sp_tokenizer"
25 #define PARSER_KEY          "sp_parser"
26 #define SELF_CLASS_KEY      "sp_self_class"
27
28
29 /* some nice XS macros from KS - thanks Marvin! */
30 #define START_SET_OR_GET_SWITCH \
31     RETVAL = &PL_sv_undef; \
32     /* if called as a setter, make sure the extra arg is there */ \
33     if (ix % 2 == 1) { \
34         if (items < 2) \
35             croak("usage: $object->set_xxxxxx($val)"); \
36         \
37         if (!SvTRUE(ST(1))) \
38             croak("usage: requires true value"); \
39     } \
40     else { \
41         if (items > 2) \
42             croak("usage: $object->get_xxxxx()"); \
43     } \
44     switch (ix) {
45
46 #define END_SET_OR_GET_SWITCH \
47     default: croak("Internal error. ix: %d", ix); \
48              break; /* probably unreachable */ \
49     } \
50     if (ix % 2 == 0) { \
51         XPUSHs( RETVAL ); \
52         XSRETURN(1); \
53     } \
54     else { \
55         XSRETURN(0); \
56     }
Note: See TracBrowser for help on using the browser.