index a92fb53945676f65fbbada4bfe4f680d22427093..19d6cc33799c68eeefa3a7e72f322fdf2522201c 100644 (file)
#define SDB_OBJECT_INIT { SDB_TYPE_INIT, 1, NULL }
#define SDB_OBJECT_TYPED_INIT(t) { (t), 1, NULL }
+#define SDB_OBJECT_STATIC(name) { \
+ /* type */ { sizeof(sdb_object_t), NULL, NULL }, \
+ /* ref-cnt */ 1, (name) }
+
typedef struct {
sdb_object_t super;
void *data;
/*
* Callback types for comparing objects or performing object lookup.
+ * Any function of type sdb_object_cmp_cb shall return a negative value, zero,
+ * or a positive value if the first object compares less than, equal to, or
+ * greater than the second object respectively.
+ * Any function of type sdb_object_lookup_cb shall return zero for all
+ * matching objects.
*/
typedef int (*sdb_object_cmp_cb)(const sdb_object_t *, const sdb_object_t *);
typedef int (*sdb_object_lookup_cb)(const sdb_object_t *, const void *user_data);