Add _out_str, _in_str & _get_str to OA dict.

This commit is contained in:
Patrick Pelissier committed 2017-07-06 23:14:26 +02:00
1 parent 172df98c0d
commit d3038cc758
1 file changed
+11 -1
+11 -1
View File
@@ -79,7 +79,8 @@
(DICTI_OPLIST(__VA_ARGS__, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST ), \
DICTI_OPLIST(__VA_ARGS__ , M_RET_ARG2 (__VA_ARGS__, ) ))
/* Open Addressing implementation. Same oplist
/* Open Addressing implementation. Same oplist.
Need OOR_EQUAL & OOR_SET as methods of the key */
#define DICT_OA_DEF2(name, key_type, key_oplist, value_type, value_oplist) \
DICTI_OA_DEFI(name, key_type, key_oplist, value_type, value_oplist, \
@@ -89,6 +90,7 @@
/********************************** INTERNAL ************************************/
/* Define a chained dictionnary */
#define DICTI_DEF2_FUNC(name, key_type, key_oplist, value_type, value_oplist, isSet, dict_t, dict_it_t) \
\
typedef struct M_C3(dict_, name, _s) { \
@@ -428,6 +430,13 @@
} \
, /* no value equal */ ) \
\
DICTI_DEF2_FUNC_ADDITIONAL(name, key_type, key_oplist, value_type, value_oplist, isSet, dict_t, dict_it_t)
/* Define additional functions for dictionnary.
Do not used any fields of the dictionnary */
#define DICTI_DEF2_FUNC_ADDITIONAL(name, key_type, key_oplist, value_type, value_oplist, isSet, dict_t, dict_it_t) \
\
M_IF_METHOD_BOTH(GET_STR, key_oplist, value_oplist)( \
static inline void \
M_C3(dict_, name, _get_str)(string_t str, dict_t dict, \
@@ -1130,6 +1139,7 @@ typedef enum {
return &it->dict->data[i]; \
} \
\
DICTI_DEF2_FUNC_ADDITIONAL(name, key_type, key_oplist, value_type, value_oplist, isSet, dict_t, dict_it_t)
#endif