static inline NVEntry * nv_table_get_entry_at_ofs(NVTable *self, guint32 ofs) { if (!ofs) return NULL; return (NVEntry *) (nv_table_get_top(self) - ofs); }
/* return the offset to a newly allocated payload string */ static inline NVEntry * nv_table_alloc_value(NVTable *self, gsize alloc_size) { NVEntry *entry; alloc_size = NV_TABLE_BOUND(alloc_size); /* alloc error, NVTable should be realloced */ if (!nv_table_alloc_check(self, alloc_size)) return NULL; self->used += alloc_size; entry = (NVEntry *) (nv_table_get_top(self) - (self->used)); entry->alloc_len = alloc_size; entry->indirect = FALSE; entry->referenced = FALSE; return entry; }
static inline gchar * nv_table_get_bottom(NVTable *self) { return nv_table_get_top(self) - self->used; }