cuoo/hcobj.h: Hash-consed Object Headers
[cuoo: Dynamic Objects and Operations]

Data Structures

struct  cuooP_hcobj

Defines

#define CUOO_HC_GENERATION   0
#define CUOO_HCOBJ_NEEDED   1
#define CUOO_HCOBJ   CUOO_OBJ cu_inherit (cuooP_hcobj);
#define CUOO_HCOBJ_SHIFT   sizeof(struct cuooP_hcobj)
#define CUOO_HCOBJ_INIT   CUOO_OBJ_INIT { 0 },
#define CUOO_HCOBJ_SHIFTW   (CUOO_HCOBJ_SHIFT/CU_WORD_SIZE)
#define CUOO_HCOBJ_KEY(obj)   ((void *)((char *)(obj) + CUOO_HCOBJ_SHIFT))

Typedefs

typedef struct cuooP_hcobjcuooP_hcobj_t

Detailed Description

This header defines a macro CUOO_HCOBJ to put right after the opening brace of a hash-consed object struct:

 struct my_obj {
     CUOO_HCOBJ
     // key fields
     // value fields
 };

Note that there is no semicolon after the macro. A macro is used here, because the need for the header depends on the configuration.


Define Documentation

#define CUOO_HCOBJ   CUOO_OBJ cu_inherit (cuooP_hcobj);

Put this, without semicolon, at the beginning of struct bodies which are used for hash-consed objects.

#define CUOO_HCOBJ_SHIFT   sizeof(struct cuooP_hcobj)

The offset of the key-part of hash-consed object struct.

Referenced by cudyn_to_bool(), cuex_opn_by_arr(), cuoo_halloc(), cuoo_hxalloc_clear(), cuoo_hxalloc_init(), and cuoo_hxalloc_setao().

Generated 2009-12-08 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.