Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
sol-str-table.h File Reference

These are routines that Soletta provides for its string table implementation. More...

#include <inttypes.h>
#include <sol-str-slice.h>

Go to the source code of this file.

Data Structures

struct  sol_str_table
 String table element type. More...
 
struct  sol_str_table_int64
 String/int64_t table type. More...
 
struct  sol_str_table_ptr
 String/Pointer table type. More...
 

Macros

#define SOL_STR_TABLE_INT64_ITEM(_key, _val)
 Helper macro to make easier to declare a <key, value> pair. More...
 
#define sol_str_table_int64_lookup(_table_int64, _key, _pval)
 Similar to sol_str_table_int64_lookup_fallback, but returning true/false. More...
 
#define SOL_STR_TABLE_INT64_NOT_FOUND   INT64_MAX
 flag to detect key 'misses' in sol_str_table_int64_lookup. More...
 
#define SOL_STR_TABLE_ITEM(_key, _val)   { .key = SOL_STR_STATIC_ASSERT_LITERAL(_key), .len = sizeof(_key) - 1, .val = _val }
 Helper macro to make easier to declare a <key, int16_t> pair. More...
 
#define sol_str_table_lookup(_table, _key, _pval)
 Similar to sol_str_table_lookup_fallback, but returning true/false. More...
 
#define SOL_STR_TABLE_NOT_FOUND   INT16_MAX
 flag to detect key 'misses' in sol_str_table_lookup. More...
 
#define SOL_STR_TABLE_PTR_ITEM(_key, _val)
 Helper macro to make easier to declare a <key, value> pair. More...
 
#define sol_str_table_ptr_lookup(_table_ptr, _key, _pval)
 Similar to sol_str_table_ptr_lookup_fallback, but returning true/false. More...
 

Typedefs

typedef struct sol_str_table sol_str_table
 String table element type. More...
 
typedef struct sol_str_table_int64 sol_str_table_int64
 String/int64_t table type. More...
 
typedef struct sol_str_table_ptr sol_str_table_ptr
 String/Pointer table type. More...
 

Functions

const struct sol_str_tablesol_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. More...
 
const struct sol_str_table_int64sol_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. More...
 
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. More...
 
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. More...
 
const struct sol_str_table_ptrsol_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. More...
 
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. More...
 

Detailed Description

These are routines that Soletta provides for its string table implementation.