#include "ks_array.h"
Go to the source code of this file.
Data Structures | |
| struct | _ks_bucket_t |
| bucket used to hold keys & values in ks_assoc_t associative arrays. More... | |
| struct | _ks_assoc_t |
| libkarmaclient associative array type. More... | |
Typedefs | |
| typedef _ks_bucket_t | ks_bucket_t |
| bucket used to hold keys & values in ks_assoc_t associative arrays. | |
| typedef _ks_assoc_t | ks_assoc_t |
| libkarmaclient associative array type. | |
Functions | |
| ks_type_t * | ks_assoc_type (void) |
| ks_assoc_t * | ks_assoc_new (void) |
| void | ks_assoc_init (ks_assoc_t *) |
| void | ks_assoc_free (ks_assoc_t *) |
| void | ks_assoc_fini (ks_assoc_t *) |
| void | ks_assoc_put (ks_assoc_t *, const char *, size_t klen, ks_base_t *) |
| ks_base_t * | ks_assoc_get (ks_assoc_t *, const char *, size_t klen) |
| int | ks_assoc_size (ks_assoc_t *) |
| ks_array_t * | ks_assoc_keys (ks_assoc_t *) |
Type and function declarations for the functions defined in ks_assoc.c. Do not include this file directly in your client. Instead, include the application header, ks.h, which will include all the libkarmaclient header files for you.
Definition in file ks_assoc.h.
|
|
libkarmaclient associative array type.
|
|
|
bucket used to hold keys & values in ks_assoc_t associative arrays.
|
|
|
Clear the state of a ks_assoc_t, leaving in the ks_assoc_t in a suitable state for ks_assoc_init() to reinitialise.
Definition at line 238 of file ks_assoc.c. References _ks_assoc_t::array, and ks_array_fini(). Referenced by ks_assoc_free(). |
|
|
Destroy a ks_assoc_t, freeing all memory used by it.
Definition at line 251 of file ks_assoc.c. References ks_assoc_fini(), and ks_free(). Referenced by ks_response_free(). |
|
||||||||||||||||
|
Retrieve the data associated with a given key from a ks_assoc_t.
Definition at line 319 of file ks_assoc.c. References _ks_bucket_t::data. Referenced by ks_combination_data(), ks_combination_score(), ks_fact_data(), ks_fact_feed(), ks_fact_identity(), ks_fact_value(), ks_response_combination(), ks_response_combinations(), ks_response_error(), ks_response_id(), ks_response_message(), and ks_response_time(). |
|
|
Initialise a ks_assoc_t. This will have been done for you by ks_assoc_new() for each new ks_assoc_t. If you need to reinitialise a ks_assoc_t, then you should first clear its state using ks_assoc_fini(), or your application could leak memory.
Definition at line 210 of file ks_assoc.c. References _ks_assoc_t::array, _ks_assoc_t::base, ks_array_init(), and _ks_base_t::type. Referenced by ks_assoc_new(). |
|
|
Return the list of keys stored in a ks_assoc_t
Definition at line 350 of file ks_assoc.c. References _ks_assoc_t::array, _ks_bucket_t::key, _ks_bucket_t::klen, ks_array_add(), ks_array_get(), ks_array_length(), ks_array_new(), KS_CAST, and ks_string_new(). |
|
|
Create a new, initialised ks_assoc_t.
Definition at line 222 of file ks_assoc.c. References ks_assoc_init(), and ks_malloc(). |
|
||||||||||||||||||||
|
Put new data in a ks_assoc_t, and associate it with a given key. If the key already exists, the existing data associated with that key is destroyed and the new data inserted in its place, otherwise a new bucket is created for the key and data.
Definition at line 295 of file ks_assoc.c. References _ks_assoc_t::array, _ks_bucket_t::data, and ks_array_add(). Referenced by ks_fact_feed(). |
|
|
Find the number of entries in a ks_assoc_t
Definition at line 335 of file ks_assoc.c. References _ks_assoc_t::array, and ks_array_length(). Referenced by ks_response_combinations_size(). |
|
|
Retrieve the metaclass for ks_assoc_t objects.
Definition at line 172 of file ks_assoc.c. Referenced by ks_response_bparse(). |
1.4.4