dictionary.h
Go to the documentation of this file.
1 /******************************************************************************/
35 /******************************************************************************/
36 
37 #if !defined(DICTIONARY_H_)
38 #define DICTIONARY_H_
39 
40 #if defined(__cplusplus)
41 extern "C" {
42 #endif
43 
44 #include <stdarg.h>
45 #include "../key_value/kv_system.h"
46 #include "dictionary_types.h"
47 
60 int
63  char *ext,
64  char *filename
65 );
66 
92  ion_dictionary_handler_t *handler,
95  ion_key_type_t key_type,
96  ion_key_size_t key_size,
97  ion_value_size_t value_size,
98  ion_dictionary_size_t dictionary_size
99 );
100 
115  ion_key_t key,
116  ion_value_t value
117 );
118 
133  ion_key_t key,
134  ion_value_t value
135 );
136 
148  ion_key_t key
149 );
150 
164  ion_key_t key,
165  ion_value_t value
166 );
167 
175 ion_err_t
178 );
179 
189 ion_err_t
191  ion_dictionary_handler_t *handler,
193 );
194 
219 char
221  ion_key_t first_key,
222  ion_key_t second_key,
223  ion_key_size_t key_size
224 );
225 
246 char
248  ion_key_t first_key,
249  ion_key_t second_key,
250  ion_key_size_t key_size
251 );
252 
264 ion_err_t
266  ion_dictionary_handler_t *handler,
269 );
270 
277 ion_err_t
280 );
281 
300 ion_err_t
304  ...
305 );
306 
322 ion_err_t
326  ion_dict_cursor_t **cursor
327 );
328 
346  ion_dict_cursor_t *cursor,
347  ion_key_t key
348 );
349 
350 #if defined(__cplusplus)
351 }
352 #endif
353 
354 #endif
char ion_predicate_type_t
A type for storing predicate type data.
enum ION_KEY_TYPE ion_key_type_t
This is the available key types for ION_DB. All types will be based on system defines.
ion_err_t dictionary_find(ion_dictionary_t *dictionary, ion_predicate_t *predicate, ion_dict_cursor_t **cursor)
Uses the given predicate and cursor to search the dictionary.
Definition: dictionary.c:562
ion_status_t dictionary_update(ion_dictionary_t *dictionary, ion_key_t key, ion_value_t value)
Update all records with a given key.
Definition: dictionary.c:169
int ion_value_size_t
The size (length) of a dictionary value in bytes.
Definition: kv_system.h:256
char dictionary_compare_unsigned_value(ion_key_t first_key, ion_key_t second_key, ion_key_size_t key_size)
Compares two unsigned integer numeric keys.
Definition: dictionary.c:207
ion_status_t dictionary_delete(ion_dictionary_t *dictionary, ion_key_t key)
Delete a value given a key.
Definition: dictionary.c:199
ion_boolean_t test_predicate(ion_dict_cursor_t *cursor, ion_key_t key)
Tests the supplied key against the predicate registered in the cursor. If the supplied cursor if of t...
Definition: dictionary.c:571
Types used for dictionaries.
ion_err_t dictionary_create(ion_dictionary_handler_t *handler, ion_dictionary_t *dictionary, ion_dictionary_id_t id, ion_key_type_t key_type, ion_key_size_t key_size, ion_value_size_t value_size, ion_dictionary_size_t dictionary_size)
Creates as instance of a specific type of dictionary.
Definition: dictionary.c:125
unsigned int ion_dictionary_id_t
A type used to identify dictionaries, specifically in the master table.
unsigned int ion_dictionary_size_t
The implementation specific size of the dictionary.
Definition: kv_system.h:264
Struct containing details for opening a dictionary previously created.
ion_err_t dictionary_delete_dictionary(ion_dictionary_t *dictionary)
Destroys dictionary.
Definition: dictionary.c:178
char dictionary_compare_signed_value(ion_key_t first_key, ion_key_t second_key, ion_key_size_t key_size)
Compares two signed integer numeric keys.
Definition: dictionary.c:239
ion_err_t dictionary_close(ion_dictionary_t *dictionary)
Closes a dictionary.
Definition: dictionary.c:372
#define key(k)
Definition: bpp_tree.c:75
ion_err_t dictionary_build_predicate(ion_predicate_t *predicate, ion_predicate_type_t type,...)
Builds a predicate based on the type given.
Definition: dictionary.c:512
char ion_err_t
The error type used to store error codes.
Definition: kv_system.h:226
void * ion_key_t
A dictionary key.
Definition: kv_system.h:241
void * ion_value_t
A dictionary value.
Definition: kv_system.h:246
A dictionary contains information regarding an instance of the storage element and the associated han...
A supertype for dictionary cursor objects.
ion_err_t dictionary_open(ion_dictionary_handler_t *handler, ion_dictionary_t *dictionary, ion_dictionary_config_info_t *config)
Opens a dictionary, given the desired config.
Definition: dictionary.c:287
A supertype for cursor predicate objects.
int ion_key_size_t
The size (length) of a dictionary key in bytes.
Definition: kv_system.h:251
int dictionary_get_filename(ion_dictionary_id_t id, char *ext, char *filename)
Given the ID, implementation specific extension, and a buffer to write to, writes back the formatted ...
Definition: dictionary.c:41
char ion_boolean_t
A boolean type.
Definition: kv_system.h:269
ion_err_t dictionary_destroy_dictionary(ion_dictionary_handler_t *handler, ion_dictionary_id_t id)
Destroys dictionary.
Definition: dictionary.c:185
ion_status_t dictionary_get(ion_dictionary_t *dictionary, ion_key_t key, ion_value_t value)
Retrieve a value given a key.
Definition: dictionary.c:160
A dictionary_handler is responsible for dealing with the specific interface for an underlying diction...
A status object that describes the result of a dictionary operation.
Definition: kv_system.h:290
ion_status_t dictionary_insert(ion_dictionary_t *dictionary, ion_key_t key, ion_value_t value)
Insert a value into a dictionary.
Definition: dictionary.c:151