28static inline struct clause *cdb_handler(
struct cdb *
p,
unsigned cref)
30 return cref != 0xFFFFFFFF ? (
struct clause *)(
p->data + cref) : NULL;
33static inline unsigned cdb_cref(
struct cdb *
p,
unsigned *
clause)
35 return (
unsigned)(
clause - &(
p->data[0]));
38static inline void cdb_grow(
struct cdb *
p,
unsigned cap)
40 unsigned prev_cap =
p->cap;
44 while (
p->cap < cap) {
45 unsigned delta = ((
p->cap >> 1) + (
p->cap >> 3) + 2) & (
unsigned)(~1);
53static inline struct cdb *cdb_alloc(
unsigned cap)
62static inline void cdb_free(
struct cdb *
p)
68static inline unsigned cdb_append(
struct cdb *
p,
unsigned size)
72 cdb_grow(
p,
p->size +
size);
84static inline void cdb_clear(
struct cdb *
p)
90static inline unsigned cdb_capacity(
struct cdb *
p)
95static inline unsigned cdb_size(
struct cdb *
p)
100static inline unsigned cdb_wasted(
struct cdb *
p)
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define satoko_calloc(type, n_elements)
#define satoko_realloc(type, ptr, n_elements)