Inserting a key-value pair into a DB. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include "odb.h"
Defines | |
| #define | _GNU_SOURCE |
Functions | |
| int | odb_update_node (odb_t *odb, odb_key_t key) |
| update info at key by incrementing its associated value by one, if the key does not exist a new node is created and the value associated is set to one. | |
| int | odb_update_node_with_offset (odb_t *odb, odb_key_t key, unsigned long int offset) |
| odb_update_node_with_offset | |
| int | odb_add_node (odb_t *odb, odb_key_t key, odb_value_t value) |
| Add a new node w/o regarding if a node with the same key already exists. | |
Inserting a key-value pair into a DB.
| #define _GNU_SOURCE |
| int odb_add_node | ( | odb_t * | odb, | |
| odb_key_t | key, | |||
| odb_value_t | value | |||
| ) |
Add a new node w/o regarding if a node with the same key already exists.
returns EXIT_SUCCESS on success, EXIT_FAILURE on failure
References odb_t::data.
Referenced by import_from_abi(), and main().
update info at key by incrementing its associated value by one, if the key does not exist a new node is created and the value associated is set to one.
returns EXIT_SUCCESS on success, EXIT_FAILURE on failure
References odb_update_node_with_offset().
Referenced by opd_put_image_sample(), and operf_sfile_log_arc().
odb_update_node_with_offset
| odb | the data base object to setup | |
| key | the hash key | |
| offset | the offset to be added |
update info at key by adding the specified offset to its associated value, if the key does not exist a new node is created and the value associated is set to offset.
returns EXIT_SUCCESS on success, EXIT_FAILURE on failure
References odb_t::data, odb_data::hash_base, odb_node_t::key, odb_node_t::next, odb_data::node_base, and odb_node_t::value.
Referenced by odb_update_node(), operf_sfile_log_sample_count(), and sfile_log_sample_count().
1.6.1