qbhdb.h.3 | qbhdb.h.3 | |||
---|---|---|---|---|
qbhdb.h(3) libqb qbhdb .h(3) | qbhdb.h(3) libqb qbhdb .h(3) | |||
NAME | NAME | |||
qbhdb.h - | qbhdb.h - | |||
The handle database is for reference counting objects. | The handle database is for reference counting objects'. | |||
SYNOPSIS | SYNOPSIS | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <stdint.h> | #include <stdint.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <qb/qbarray.h> | #include <qb/qbarray.h> | |||
Data Structures | Data Structures | |||
struct qb_hdb_handle | struct qb_hdb_handle | |||
struct qb_hdb | struct qb_hdb | |||
Defines | Defines | |||
#define _GNU_SOURCE | #define _GNU_SOURCE | |||
#define QB_HDB_D_FORMAT '%'PRIu64 | #define QB_HDB_D_FORMAT '%'PRIu64 | |||
#define QB_HDB_X_FORMAT '%'PRIx64 | #define QB_HDB_X_FORMAT '%'PRIx64 | |||
#define QB_HDB_DECLARE(database_name, destructor_function) | #define QB_HDB_DECLARE(database_name, destructor_function) | |||
Convience macro for declaring a file scoped handle database. | Convience macro for declaring a file scoped handle database'. | |||
Typedefs | Typedefs | |||
typedef uint64_t qb_handle_t | typedef uint64_t qb_handle_t | |||
Generic handle type is 64 bits. | Generic handle type is 64 bits'. | |||
Functions | Functions | |||
void qb_hdb_create (struct qb_hdb *hdb) | void qb_hdb_create (struct qb_hdb *hdb) | |||
Create a new database. | Create a new database'. | |||
void qb_hdb_destroy (struct qb_hdb *hdb) | void qb_hdb_destroy (struct qb_hdb *hdb) | |||
Destroy a handle database. | Destroy a handle database'. | |||
int32_t qb_hdb_handle_create (struct qb_hdb *hdb, int32_t instance_s ize, qb_handle_t *handle_id_out) | int32_t qb_hdb_handle_create (struct qb_hdb *hdb, int32_t instance_s ize, qb_handle_t *handle_id_out) | |||
Create a new handle. | Create a new handle'. | |||
int32_t qb_hdb_handle_get (struct qb_hdb *hdb, qb_handle_t handle_in , void **instance) | int32_t qb_hdb_handle_get (struct qb_hdb *hdb, qb_handle_t handle_in , void **instance) | |||
Get the instance associated with this handle and increase it's r efcount. | Get the instance associated with this handle and increase it's r efcount'. | |||
int32_t qb_hdb_handle_get_always (struct qb_hdb *hdb, qb_handle_t ha ndle_in, void **instance) | int32_t qb_hdb_handle_get_always (struct qb_hdb *hdb, qb_handle_t ha ndle_in, void **instance) | |||
Get the instance associated with this handle and increase it's r efcount. | Get the instance associated with this handle and increase it's r efcount'. | |||
int32_t qb_hdb_handle_put (struct qb_hdb *hdb, qb_handle_t handle_in ) | int32_t qb_hdb_handle_put (struct qb_hdb *hdb, qb_handle_t handle_in ) | |||
Put the instance associated with this handle and decrease it's r efcount. | Put the instance associated with this handle and decrease it's r efcount'. | |||
int32_t qb_hdb_handle_destroy (struct qb_hdb *hdb, qb_handle_t handl e_in) | int32_t qb_hdb_handle_destroy (struct qb_hdb *hdb, qb_handle_t handl e_in) | |||
Request the destruction of the object. | Request the destruction of the object'. | |||
int32_t qb_hdb_handle_refcount_get (struct qb_hdb *hdb, qb_handle_t handle_in) | int32_t qb_hdb_handle_refcount_get (struct qb_hdb *hdb, qb_handle_t handle_in) | |||
Get the current refcount. | Get the current refcount'. | |||
void qb_hdb_iterator_reset (struct qb_hdb *hdb) | void qb_hdb_iterator_reset (struct qb_hdb *hdb) | |||
Reset the iterator. | Reset the iterator'. | |||
int32_t qb_hdb_iterator_next (struct qb_hdb *hdb, void **instance, q b_handle_t *handle) | int32_t qb_hdb_iterator_next (struct qb_hdb *hdb, void **instance, q b_handle_t *handle) | |||
Get the next object and increament it's refcount. | Get the next object and increament it's refcount'. | |||
uint32_t qb_hdb_base_convert (qb_handle_t handle) | uint32_t qb_hdb_base_convert (qb_handle_t handle) | |||
uint64_t qb_hdb_nocheck_convert (uint32_t handle) | uint64_t qb_hdb_nocheck_convert (uint32_t handle) | |||
Detailed Description | Detailed Description | |||
The handle database is for reference counting objects. | The handle database is for reference counting objects'. | |||
Define Documentation | Define Documentation | |||
#define _GNU_SOURCE | #define _GNU_SOURCE | |||
#define QB_HDB_D_FORMAT '%'PRIu64 | #define QB_HDB_D_FORMAT '%'PRIu64 | |||
#define QB_HDB_DECLARE(database_name, destructor_function) Value: | #define QB_HDB_DECLARE(database_name, destructor_function) Value: | |||
static struct qb_hdb (database_name) = { .handle_count = 0, .handles = NULL, .iterator = 0, .d estructor = destructor_function, .firs t_run = 1 }; .fi | static struct qb_hdb (database_name) = { .handle_count = 0, .handles = NULL, .iter ator = 0, .destru ctor = destructor_function, .first_ru n = 1 }; .fi | |||
Convience macro for declaring a file scoped handle database. .PP | Convience macro for declaring a file scoped handle database'. .PP | |||
QB_HDB_DECLARE(my_handle_database, NULL); | QB_HDB_DECLARE(my_handle_database, NULL); | |||
#define QB_HDB_X_FORMAT '%'PRIx64 | #define QB_HDB_X_FORMAT '%'PRIx64 | |||
Typedef Documentation | Typedef Documentation | |||
typedef uint64_t qb_handle_t | typedef uint64_t qb_handle_t | |||
Generic handle type is 64 bits. | Generic handle type is 64 bits'. | |||
Function Documentation | Function Documentation | |||
uint32_t qb_hdb_base_convert (qb_handle_t handle) | uint32_t qb_hdb_base_convert (qb_handle_thandle) | |||
void qb_hdb_create (struct qb_hdb * hdb) | void qb_hdb_create (struct qb_hdb *hdb) | |||
Create a new database. Parameters: | Create a new database'. Parameters: | |||
hdb the database to init. | hdb the database to init'. | |||
void qb_hdb_destroy (struct qb_hdb * hdb) | void qb_hdb_destroy (struct qb_hdb *hdb) | |||
Destroy a handle database. Parameters: | Destroy a handle database'. Parameters: | |||
hdb the database to destroy. | hdb the database to destroy'. | |||
int32_t qb_hdb_handle_create (struct qb_hdb * hdb, int32_t instance_size | int32_t qb_hdb_handle_create (struct qb_hdb *hdb, int32_tinstance_size, | |||
, qb_handle_t * handle_id_out) | qb_handle_t *handle_id_out) | |||
Create a new handle. Parameters: | Create a new handle'. Parameters: | |||
hdb the database instance | hdb the database instance | |||
instance_size size of the object to malloc | instance_size size of the object to malloc | |||
handle_id_out new handle | handle_id_out new handle | |||
Returns: | Returns: | |||
(0 == ok, -errno faliure) | (0 == ok, -errno faliure) | |||
int32_t qb_hdb_handle_destroy (struct qb_hdb * hdb, qb_handle_t handle_i | int32_t qb_hdb_handle_destroy (struct qb_hdb *hdb, qb_handle_thandle_in) | |||
n) | Request the destruction of the object'. When the refcount is 0, it w | |||
Request the destruction of the object. When the refcount is 0, it wi | ill be destroyed'. | |||
ll be destroyed. | ||||
Parameters: | Parameters: | |||
handle_in the handle | handle_in the handle | |||
hdb the database instance | hdb the database instance | |||
Returns: | Returns: | |||
(0 == ok, -errno faliure) | (0 == ok, -errno faliure) | |||
int32_t qb_hdb_handle_get (struct qb_hdb * hdb, qb_handle_t handle_in, v | int32_t qb_hdb_handle_get (struct qb_hdb *hdb, qb_handle_thandle_in, voi | |||
oid ** instance) | d **instance) | |||
Get the instance associated with this handle and increase it's refco | Get the instance associated with this handle and increase it's refco | |||
unt. Parameters: | unt'. Parameters: | |||
handle_in the handle | handle_in the handle | |||
hdb the database instance | hdb the database instance | |||
instance (out) pointer to the desired object. | instance (out) pointer to the desired object'. | |||
Returns: | Returns: | |||
(0 == ok, -errno faliure) | (0 == ok, -errno faliure) | |||
int32_t qb_hdb_handle_get_always (struct qb_hdb * hdb, qb_handle_t handl | int32_t qb_hdb_handle_get_always (struct qb_hdb *hdb, qb_handle_thandle_ | |||
e_in, void ** instance) | in, void **instance) | |||
Get the instance associated with this handle and increase it's refco | Get the instance associated with this handle and increase it's refco | |||
unt. Parameters: | unt'. Parameters: | |||
handle_in the handle | handle_in the handle | |||
hdb the database instance | hdb the database instance | |||
instance (out) pointer to the desired object. | instance (out) pointer to the desired object'. | |||
Returns: | Returns: | |||
(0 == ok, -errno faliure) | (0 == ok, -errno faliure) | |||
int32_t qb_hdb_handle_put (struct qb_hdb * hdb, qb_handle_t handle_in) | int32_t qb_hdb_handle_put (struct qb_hdb *hdb, qb_handle_thandle_in) | |||
Put the instance associated with this handle and decrease it's refco | Put the instance associated with this handle and decrease it's refco | |||
unt. Parameters: | unt'. Parameters: | |||
handle_in the handle | handle_in the handle | |||
hdb the database instance | hdb the database instance | |||
Returns: | Returns: | |||
(0 == ok, -errno faliure) | (0 == ok, -errno faliure) | |||
int32_t qb_hdb_handle_refcount_get (struct qb_hdb * hdb, qb_handle_t han | int32_t qb_hdb_handle_refcount_get (struct qb_hdb *hdb, qb_handle_thandl | |||
dle_in) | e_in) | |||
Get the current refcount. Parameters: | Get the current refcount'. Parameters: | |||
handle_in the handle | handle_in the handle | |||
hdb the database instance | hdb the database instance | |||
Returns: | Returns: | |||
(>= 0 is the refcount, -errno faliure) | (>= 0 is the refcount, -errno faliure) | |||
int32_t qb_hdb_iterator_next (struct qb_hdb * hdb, void ** instance, qb_ | int32_t qb_hdb_iterator_next (struct qb_hdb *hdb, void **instance, qb_ha | |||
handle_t * handle) | ndle_t *handle) | |||
Get the next object and increament it's refcount. Remember to call q | Get the next object and increament it's refcount'. Remember to call | |||
b_hdb_handle_put() | qb_hdb_handle_put() | |||
Parameters: | Parameters: | |||
hdb the database instance | hdb the database instance | |||
handle (out) the handle | handle (out) the handle | |||
instance (out) pointer to the desired object. | instance (out) pointer to the desired object'. | |||
Returns: | Returns: | |||
(0 == ok, -errno faliure) | (0 == ok, -errno faliure) | |||
void qb_hdb_iterator_reset (struct qb_hdb * hdb) | void qb_hdb_iterator_reset (struct qb_hdb *hdb) | |||
Reset the iterator. Parameters: | Reset the iterator'. Parameters: | |||
hdb the database instance | hdb the database instance | |||
uint64_t qb_hdb_nocheck_convert (uint32_t handle) | uint64_t qb_hdb_nocheck_convert (uint32_thandle) | |||
Author | Author | |||
Generated automatically by Doxygen for libqb from the source code. | Generated automatically by Doxygen for libqb from the source code'. | |||
Version 0.4.1 Mon Jan 31 2011 qbhdb .h(3) | Version 0.8.1 Thu Jan 5 2012 qbhdb .h(3) | |||
End of changes. 32 change blocks. | ||||
57 lines changed or deleted | 56 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |