libweed
2.0.0
|
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <weed/weed.h>
#include <pthread.h>
Macros | |
#define | __LIBWEED__ |
#define | WEED_MAGIC_HASH 0xB82E802F |
#define | WEED_FLAG_OP_DELETE WEED_FLAG_RESERVED_0 |
#define | GNU_FLATTEN |
#define | GNU_CONST |
#define | GNU_HOT |
#define | GNU_PURE |
#define | EXPORTED |
#define | NOT_EXPORTED |
#define | is_plant(leaf) (leaf->key_hash == WEED_MAGIC_HASH) |
#define | get_data_lock(leaf) |
#define | get_chain_lock(leaf) |
#define | get_data_mutex(leaf) |
#define | get_structure_mutex(plant) (&(((plant_priv_data_t *)((plant)->private_data))->structure_mutex)) |
#define | get_count_lock(plant) (&(((plant_priv_data_t *)((plant)->private_data))->reader_count)) |
#define | data_lock_unlock(obj) |
#define | data_lock_writelock(obj) |
#define | data_lock_readlock(obj) |
#define | chain_lock_unlock(obj) |
#define | chain_lock_writelock(obj) |
#define | chain_lock_readlock(obj) |
#define | chain_lock_try_writelock(obj) (pthread_rwlock_trywrlock(get_chain_lock((obj)))) |
#define | chain_lock_try_readlock(obj) (pthread_rwlock_tryrdlock(get_chain_lock((obj)))) |
#define | structure_mutex_trylock(obj) (pthread_mutex_trylock(get_structure_mutex((obj)))) |
#define | structure_mutex_lock(obj) |
#define | structure_mutex_unlock(obj) |
#define | reader_count_add(obj) |
#define | reader_count_sub(obj) |
#define | reader_count_wait(obj) |
#define | return_unlock(obj, val) |
#define | weed_malloc malloc |
#define | weed_malloc_sizeof(t) malloc(sizeof(t)) |
#define | weed_unmalloc_sizeof(t, ptr) free(ptr) |
#define | weed_unmalloc_and_copy(size, ptr) free(ptr) |
#define | weed_malloc_and_copy(size, src) memcpy(malloc(size), src, size) |
#define | weed_strdup(oldstring, size) |
#define | IS_VALID_SEED_TYPE(seed_type) ((seed_type >=64 || (seed_type >= 1 && seed_type <= 5) ? 1 : 0)) |
#define | weed_strlen(s) ((s) ? strlen((s)) : 0) |
#define | weed_strcmp(s1, s2) ((!(s1) || !(s2)) ? (s1 != s2) : strcmp(s1, s2)) |
#define | get16bits(d) (*((const uint16_t *) (d))) |
#define | HASHROOT 5381 |
#define | weed_seed_is_ptr(seed_type) (seed_type >= 64 ? 1 : 0) |
#define | weed_seed_get_size(seed_type, size) |
Functions | |
EXPORTED int32_t | weed_get_abi_version (void) |
EXPORTED weed_error_t | weed_init (int32_t abi, uint64_t init_flags) |
#define __LIBWEED__ |
#define chain_lock_readlock | ( | obj | ) |
#define chain_lock_try_readlock | ( | obj | ) | (pthread_rwlock_tryrdlock(get_chain_lock((obj)))) |
#define chain_lock_try_writelock | ( | obj | ) | (pthread_rwlock_trywrlock(get_chain_lock((obj)))) |
#define chain_lock_unlock | ( | obj | ) |
#define chain_lock_writelock | ( | obj | ) |
#define data_lock_readlock | ( | obj | ) |
#define data_lock_unlock | ( | obj | ) |
#define data_lock_writelock | ( | obj | ) |
#define EXPORTED |
#define get16bits | ( | d | ) | (*((const uint16_t *) (d))) |
#define get_chain_lock | ( | leaf | ) |
#define get_count_lock | ( | plant | ) | (&(((plant_priv_data_t *)((plant)->private_data))->reader_count)) |
#define get_data_lock | ( | leaf | ) |
#define get_data_mutex | ( | leaf | ) |
#define get_structure_mutex | ( | plant | ) | (&(((plant_priv_data_t *)((plant)->private_data))->structure_mutex)) |
#define GNU_CONST |
#define GNU_FLATTEN |
#define GNU_HOT |
#define GNU_PURE |
#define HASHROOT 5381 |
#define is_plant | ( | leaf | ) | (leaf->key_hash == WEED_MAGIC_HASH) |
#define IS_VALID_SEED_TYPE | ( | seed_type | ) | ((seed_type >=64 || (seed_type >= 1 && seed_type <= 5) ? 1 : 0)) |
#define NOT_EXPORTED |
#define reader_count_add | ( | obj | ) |
#define reader_count_sub | ( | obj | ) |
#define reader_count_wait | ( | obj | ) |
#define return_unlock | ( | obj, | |
val | |||
) |
#define structure_mutex_lock | ( | obj | ) |
#define structure_mutex_trylock | ( | obj | ) | (pthread_mutex_trylock(get_structure_mutex((obj)))) |
#define structure_mutex_unlock | ( | obj | ) |
#define WEED_FLAG_OP_DELETE WEED_FLAG_RESERVED_0 |
#define WEED_MAGIC_HASH 0xB82E802F |
#define weed_malloc malloc |
#define weed_malloc_and_copy | ( | size, | |
src | |||
) | memcpy(malloc(size), src, size) |
#define weed_malloc_sizeof | ( | t | ) | malloc(sizeof(t)) |
#define weed_seed_get_size | ( | seed_type, | |
size | |||
) |
#define weed_seed_is_ptr | ( | seed_type | ) | (seed_type >= 64 ? 1 : 0) |
#define weed_strcmp | ( | s1, | |
s2 | |||
) | ((!(s1) || !(s2)) ? (s1 != s2) : strcmp(s1, s2)) |
#define weed_strdup | ( | oldstring, | |
size | |||
) |
#define weed_strlen | ( | s | ) | ((s) ? strlen((s)) : 0) |
#define weed_unmalloc_and_copy | ( | size, | |
ptr | |||
) | free(ptr) |
#define weed_unmalloc_sizeof | ( | t, | |
ptr | |||
) | free(ptr) |
EXPORTED int32_t weed_get_abi_version | ( | void | ) |
EXPORTED weed_error_t weed_init | ( | int32_t | abi, |
uint64_t | init_flags | ||
) |