68 #define SOL_STR_TABLE_ITEM(_key, _val) \
69 { .key = SOL_STR_STATIC_ASSERT_LITERAL(_key), .len = sizeof(_key) - 1, .val = _val }
111 #define SOL_STR_TABLE_NOT_FOUND INT16_MAX
131 #define sol_str_table_lookup(_table, _key, _pval) ({ \
132 int16_t _v = sol_str_table_lookup_fallback(_table, _key, INT16_MAX); \
133 if (_v != INT16_MAX) \
155 #define SOL_STR_TABLE_PTR_ITEM(_key, _val) \
156 { .key = SOL_STR_STATIC_ASSERT_LITERAL(_key), \
158 .len = sizeof(_key) - 1 }
177 const void *fallback)
217 #define sol_str_table_ptr_lookup(_table_ptr, _key, _pval) ({ \
218 const void *_v = sol_str_table_ptr_lookup_fallback(_table_ptr, \
242 #define SOL_STR_TABLE_INT64_ITEM(_key, _val) \
243 { .key = SOL_STR_STATIC_ASSERT_LITERAL(_key), \
244 .len = sizeof(_key) - 1, \
291 #define SOL_STR_TABLE_INT64_NOT_FOUND INT64_MAX
308 #define sol_str_table_int64_lookup(_table_int64, _key, _pval) ({ \
309 int64_t _v = sol_str_table_int64_lookup_fallback(_table_int64, \
310 _key, SOL_STR_TABLE_INT64_NOT_FOUND); \
311 if (_v != SOL_STR_TABLE_INT64_NOT_FOUND) \
313 _v != SOL_STR_TABLE_INT64_NOT_FOUND; \
int64_t sol_str_table_int64_lookup_fallback(const struct sol_str_table_int64 *table_int64, const struct sol_str_slice key, int64_t fallback)
Retrieves the value associated with a given key from the string/int64_t table.
struct sol_str_table_ptr sol_str_table_ptr
String/Pointer table type.
int16_t val
Value (16 bits integer)
Definition: sol-str-table.h:54
size_t len
Key string length.
Definition: sol-str-table.h:230
String/int64_t table type.
Definition: sol-str-table.h:228
String table element type.
Definition: sol-str-table.h:51
String slice type.
Definition: sol-str-slice.h:84
static struct sol_cert * key
Definition: server-https.c:51
struct sol_str_table sol_str_table
String table element type.
int64_t val
Value (int64_t)
Definition: sol-str-table.h:231
int16_t sol_str_table_lookup_fallback(const struct sol_str_table *table, const struct sol_str_slice key, int16_t fallback)
Retrieves the value associated with a given key from the string table.
const struct sol_str_table * sol_str_table_entry_lookup(const struct sol_str_table *table, const struct sol_str_slice key)
Retrieves the table entry associated with a given key from the string/integer table.
#define SOL_ATTR_NON_NULL(...)
Specifies that some function parameters should be non-null pointers.
Definition: sol-macros.h:193
String/Pointer table type.
Definition: sol-str-table.h:141
const void * val
Value (pointer)
Definition: sol-str-table.h:143
const char * key
Key string.
Definition: sol-str-table.h:142
These are routines that Soletta provides for its string slice implementation.
const struct sol_str_table_ptr * sol_str_table_ptr_entry_lookup(const struct sol_str_table_ptr *table, const struct sol_str_slice key)
Retrieves the table entry associated with a given key from the string/pointer table.
const char * key
Key string.
Definition: sol-str-table.h:52
const void * sol_str_table_ptr_lookup_fallback(const struct sol_str_table_ptr *table_ptr, const struct sol_str_slice key, const void *fallback)
Retrieves the value associated with a given key from the string/pointer table.
const struct sol_str_table_int64 * sol_str_table_int64_entry_lookup(const struct sol_str_table_int64 *table, const struct sol_str_slice key)
Retrieves the table entry associated with a given key from the string/pointer table.
const char * key
Key string.
Definition: sol-str-table.h:229
size_t len
Key string length.
Definition: sol-str-table.h:144
struct sol_str_table_int64 sol_str_table_int64
String/int64_t table type.
uint16_t len
Key string length.
Definition: sol-str-table.h:53