Kestrel Interface
Loading...
Searching...
No Matches
kest_dictionary.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  kest_dictionary_entry
struct  kest_dictionary_bucket
struct  kest_dictionary

Macros

#define DICT_ENTRY_TYPE_NOT_FOUND   22222
#define DICT_ENTRY_TYPE_NOTHING   22221
#define DICT_ENTRY_TYPE_INT   0
#define DICT_ENTRY_TYPE_FLOAT   1
#define DICT_ENTRY_TYPE_STR   2
#define DICT_ENTRY_TYPE_EXPR   3
#define DICT_ENTRY_TYPE_SUBDICT   4
#define DICT_ENTRY_TYPE_LIST   5
#define KEST_DICTIONARY_N_BUCKETS   8
#define ERR_NOT_FOUND   10
#define ERR_WRONG_TYPE   11
#define DECLARE_PTR_DICT(X)
#define IMPLEMENT_PTR_DICT(X)

Functions

 DECLARE_LIST (kest_dictionary_entry)
const char * kest_dict_entry_type_to_string (int type)
const char * kest_dict_entry_type_to_string_nice (int type)
kest_stringkest_dict_entry_to_string (kest_dictionary_entry *entry)
int kest_dictionary_bucket_add_entry (kest_dictionary_bucket *dict, kest_dictionary_entry entry)
int kest_dictionary_bucket_add_entry_str (kest_dictionary_bucket *dict, const char *name, const char *value)
int kest_dictionary_bucket_add_entry_int (kest_dictionary_bucket *dict, const char *name, int value)
int kest_dictionary_bucket_add_entry_float (kest_dictionary_bucket *dict, const char *name, float value)
int kest_dictionary_bucket_add_entry_expr (kest_dictionary_bucket *dict, const char *name, kest_expression *value)
int kest_dictionary_bucket_add_entry_dict (kest_dictionary_bucket *dict, const char *name, struct kest_dictionary *value)
int kest_dictionary_bucket_lookup_str (kest_dictionary_bucket *dict, const char *name, const char **result)
int kest_dictionary_bucket_lookup_float (kest_dictionary_bucket *dict, const char *name, float *result)
int kest_dictionary_bucket_lookup_int (kest_dictionary_bucket *dict, const char *name, int *result)
int kest_dictionary_bucket_lookup_expr (kest_dictionary_bucket *dict, const char *name, kest_expression **result)
int kest_dictionary_bucket_lookup_dict (kest_dictionary_bucket *dict, const char *name, struct kest_dictionary **result)
kest_dictionarykest_new_dictionary ()
int kest_dictionary_add_entry (kest_dictionary *dict, kest_dictionary_entry entry)
int kest_dictionary_add_entry_str (kest_dictionary *dict, const char *name, const char *value)
int kest_dictionary_add_entry_int (kest_dictionary *dict, const char *name, int value)
int kest_dictionary_add_entry_float (kest_dictionary *dict, const char *name, float value)
int kest_dictionary_add_entry_expr (kest_dictionary *dict, const char *name, kest_expression *value)
int kest_dictionary_add_entry_dict (kest_dictionary *dict, const char *name, kest_dictionary *value)
int kest_dictionary_lookup_str (kest_dictionary *dict, const char *name, const char **result)
int kest_dictionary_lookup_float (kest_dictionary *dict, const char *name, float *result)
int kest_dictionary_lookup_int (kest_dictionary *dict, const char *name, int *result)
int kest_dictionary_lookup_expr (kest_dictionary *dict, const char *name, kest_expression **result)
int kest_dictionary_lookup_list (kest_dictionary *dict, const char *name, kest_dictionary_entry_list **result)
int kest_dictionary_lookup_dict (kest_dictionary *dict, const char *name, kest_dictionary **result)
void print_dict (kest_dictionary *dict)
int kest_parse_dict_val (struct kest_eff_parsing_state *ps, kest_dictionary *dict, kest_dictionary_entry *result)
int kest_parse_dictionary (struct kest_eff_parsing_state *ps, kest_dictionary **result, const char *name)

Macro Definition Documentation

◆ DECLARE_PTR_DICT

#define DECLARE_PTR_DICT ( X)
Value:
typedef struct {\
const char *key; \
X *data; \
} X##_ptr_dict_entry; \
\
DECLARE_LIST(X##_ptr_dict_entry);\
typedef X##_ptr_dict_entry_list X##_ptr_dict_bucket;\
\
typedef struct {\
X##_ptr_dict_bucket *buckets;\
size_t n_buckets;\
} X##_ptr_dict;\
\
int X##_ptr_dict_init(X##_ptr_dict *dict, size_t n_buckets);\
int X##_ptr_dict_init_with_allocator(X##_ptr_dict *dict, size_t n_buckets, kest_allocator *alloc);\
int X##_ptr_dict_insert(X##_ptr_dict *dict, char *key, X *x);\
X *X##_ptr_dict_lookup(X##_ptr_dict *dict, const char *key);\
size_t X##_ptr_dict_count(X##_ptr_dict *dict);\
X *X##_ptr_dict_index(X##_ptr_dict *dict, size_t n);\
void X##_ptr_dict_destroy(X##_ptr_dict *dict, void (*destructor)(X *x));

Definition at line 97 of file kest_dictionary.h.

◆ DICT_ENTRY_TYPE_EXPR

◆ DICT_ENTRY_TYPE_FLOAT

◆ DICT_ENTRY_TYPE_INT

◆ DICT_ENTRY_TYPE_LIST

◆ DICT_ENTRY_TYPE_NOT_FOUND

#define DICT_ENTRY_TYPE_NOT_FOUND   22222

Definition at line 4 of file kest_dictionary.h.

◆ DICT_ENTRY_TYPE_NOTHING

#define DICT_ENTRY_TYPE_NOTHING   22221

Definition at line 5 of file kest_dictionary.h.

Referenced by kest_parse_dict_val().

◆ DICT_ENTRY_TYPE_STR

◆ DICT_ENTRY_TYPE_SUBDICT

◆ ERR_NOT_FOUND

#define ERR_NOT_FOUND   10

Definition at line 87 of file kest_dictionary.h.

Referenced by kest_dictionary_bucket_lookup().

◆ ERR_WRONG_TYPE

#define ERR_WRONG_TYPE   11

Definition at line 88 of file kest_dictionary.h.

Referenced by kest_dictionary_bucket_lookup().

◆ IMPLEMENT_PTR_DICT

#define IMPLEMENT_PTR_DICT ( X)

Definition at line 120 of file kest_dictionary.h.

◆ KEST_DICTIONARY_N_BUCKETS

Function Documentation

◆ DECLARE_LIST()

DECLARE_LIST ( kest_dictionary_entry )

◆ kest_dict_entry_to_string()

kest_string * kest_dict_entry_to_string ( kest_dictionary_entry * entry)

Definition at line 44 of file kest_dictionary.c.

Referenced by kest_dict_entry_to_string(), kest_extract_filter_coefs_from_dict(), kest_parse_dict_list(), kest_parse_dict_val(), and print_dict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dict_entry_type_to_string()

const char * kest_dict_entry_type_to_string ( int type)

Definition at line 16 of file kest_dictionary.c.

Referenced by kest_defs_section_extract().

Here is the caller graph for this function:

◆ kest_dict_entry_type_to_string_nice()

const char * kest_dict_entry_type_to_string_nice ( int type)

Definition at line 30 of file kest_dictionary.c.

Referenced by kest_extract_filter_coefs_from_dict().

Here is the caller graph for this function:

◆ kest_dictionary_add_entry()

int kest_dictionary_add_entry ( kest_dictionary * dict,
kest_dictionary_entry entry )

Definition at line 436 of file kest_dictionary.c.

Referenced by kest_parse_dict_list(), and kest_parse_dictionary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_add_entry_dict()

int kest_dictionary_add_entry_dict ( kest_dictionary * dict,
const char * name,
kest_dictionary * value )

Definition at line 553 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_add_entry_expr()

int kest_dictionary_add_entry_expr ( kest_dictionary * dict,
const char * name,
kest_expression * value )

Definition at line 529 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_add_entry_float()

int kest_dictionary_add_entry_float ( kest_dictionary * dict,
const char * name,
float value )

Definition at line 505 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_add_entry_int()

int kest_dictionary_add_entry_int ( kest_dictionary * dict,
const char * name,
int value )

Definition at line 481 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_add_entry_str()

int kest_dictionary_add_entry_str ( kest_dictionary * dict,
const char * name,
const char * value )

Definition at line 457 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_bucket_add_entry()

int kest_dictionary_bucket_add_entry ( kest_dictionary_bucket * dict,
kest_dictionary_entry entry )

Definition at line 175 of file kest_dictionary.c.

Referenced by kest_dictionary_add_entry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_bucket_add_entry_dict()

int kest_dictionary_bucket_add_entry_dict ( kest_dictionary_bucket * dict,
const char * name,
struct kest_dictionary * value )

Definition at line 282 of file kest_dictionary.c.

Referenced by kest_dictionary_add_entry_dict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_bucket_add_entry_expr()

int kest_dictionary_bucket_add_entry_expr ( kest_dictionary_bucket * dict,
const char * name,
kest_expression * value )

Definition at line 260 of file kest_dictionary.c.

Referenced by kest_dictionary_add_entry_expr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_bucket_add_entry_float()

int kest_dictionary_bucket_add_entry_float ( kest_dictionary_bucket * dict,
const char * name,
float value )

Definition at line 238 of file kest_dictionary.c.

Referenced by kest_dictionary_add_entry_float().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_bucket_add_entry_int()

int kest_dictionary_bucket_add_entry_int ( kest_dictionary_bucket * dict,
const char * name,
int value )

Definition at line 216 of file kest_dictionary.c.

Referenced by kest_dictionary_add_entry_int().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_bucket_add_entry_str()

int kest_dictionary_bucket_add_entry_str ( kest_dictionary_bucket * dict,
const char * name,
const char * value )

Definition at line 194 of file kest_dictionary.c.

Referenced by kest_dictionary_add_entry_str().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_bucket_lookup_dict()

int kest_dictionary_bucket_lookup_dict ( kest_dictionary_bucket * dict,
const char * name,
struct kest_dictionary ** result )

Definition at line 377 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_bucket_lookup_expr()

int kest_dictionary_bucket_lookup_expr ( kest_dictionary_bucket * dict,
const char * name,
kest_expression ** result )

Definition at line 372 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_bucket_lookup_float()

int kest_dictionary_bucket_lookup_float ( kest_dictionary_bucket * dict,
const char * name,
float * result )

Definition at line 362 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_bucket_lookup_int()

int kest_dictionary_bucket_lookup_int ( kest_dictionary_bucket * dict,
const char * name,
int * result )

Definition at line 367 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_bucket_lookup_str()

int kest_dictionary_bucket_lookup_str ( kest_dictionary_bucket * dict,
const char * name,
const char ** result )

Definition at line 357 of file kest_dictionary.c.

Here is the call graph for this function:

◆ kest_dictionary_lookup_dict()

int kest_dictionary_lookup_dict ( kest_dictionary * dict,
const char * name,
kest_dictionary ** result )

Definition at line 607 of file kest_dictionary.c.

Referenced by kest_dictionary_section_lookup_dict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_lookup_expr()

int kest_dictionary_lookup_expr ( kest_dictionary * dict,
const char * name,
kest_expression ** result )

Definition at line 602 of file kest_dictionary.c.

Referenced by kest_dictionary_section_lookup_expr(), kest_extract_delay_buffer_from_dict(), kest_extract_filter_from_dict(), kest_extract_int_setting_from_dict(), kest_extract_mem_from_dict(), kest_extract_parameter_from_dict(), and kest_extract_setting_from_dict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_lookup_float()

int kest_dictionary_lookup_float ( kest_dictionary * dict,
const char * name,
float * result )

Definition at line 592 of file kest_dictionary.c.

Referenced by kest_dictionary_section_lookup_float().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_lookup_int()

int kest_dictionary_lookup_int ( kest_dictionary * dict,
const char * name,
int * result )

Definition at line 597 of file kest_dictionary.c.

Referenced by kest_dictionary_section_lookup_int().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_lookup_list()

int kest_dictionary_lookup_list ( kest_dictionary * dict,
const char * name,
kest_dictionary_entry_list ** result )

Definition at line 612 of file kest_dictionary.c.

Referenced by kest_extract_filter_coefs_from_dict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_dictionary_lookup_str()

int kest_dictionary_lookup_str ( kest_dictionary * dict,
const char * name,
const char ** result )

Definition at line 587 of file kest_dictionary.c.

Referenced by kest_dictionary_section_lookup_str(), kest_extract_bool_setting_from_dict(), kest_extract_parameter_from_dict(), kest_extract_resource_from_dict(), and kest_extract_setting_from_dict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_new_dictionary()

kest_dictionary * kest_new_dictionary ( )

Definition at line 388 of file kest_dictionary.c.

Referenced by kest_parse_dictionary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_parse_dict_val()

int kest_parse_dict_val ( struct kest_eff_parsing_state * ps,
kest_dictionary * dict,
kest_dictionary_entry * result )

Definition at line 799 of file kest_dictionary.c.

Referenced by kest_parse_dict_list(), and kest_parse_dictionary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_parse_dictionary()

int kest_parse_dictionary ( struct kest_eff_parsing_state * ps,
kest_dictionary ** result,
const char * name )

Definition at line 938 of file kest_dictionary.c.

◆ print_dict()

void print_dict ( kest_dictionary * dict)

Definition at line 650 of file kest_dictionary.c.

Referenced by kest_parse_dictionary_section().

Here is the call graph for this function:
Here is the caller graph for this function: