Lines Matching refs:name

36 #define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope)          \
37 scope const char *name##_to_string(type i) { \
38 if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
40 return name##_table[i]; \
43 #define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \
44 scope type name##_from_string(const char *s) { \
45 return (type) string_table_lookup(name##_table, ELEMENTSOF(name##_table), s); \
48 #define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes,scope) \
49 scope type name##_from_string(const char *s) { \
56 return (type) string_table_lookup(name##_table, ELEMENTSOF(name##_table), s); \
59 #define _DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \
60 _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
61 _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \
64 #define _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes,scope) \
65 _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
66 _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes,scope) \
69 #define DEFINE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,)
70 #define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,static)
71 #define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,static)
72 #define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,static)
74 #define DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes) _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes,)
77 #define DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name,type,max) \
78 int name##_to_string_alloc(type i, char **str) { \
82 if (i < (type) ELEMENTSOF(name##_table)) { \
83 s = strdup(name##_table[i]); \
93 type name##_from_string(const char *s) { \
98 for (i = 0; i < (type) ELEMENTSOF(name##_table); i++) \
99 if (streq_ptr(name##_table[i], s)) \