omap-iter-impl.h 941 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
/*
 * (C) 2017 The University of Chicago
 * 
 * See COPYRIGHT in top-level directory.
 */
#ifndef __MOBJECT_OMAP_ITER_H
#define __MOBJECT_OMAP_ITER_H

#include "libmobject-store.h"

11 12 13 14
#ifdef __cplusplus
extern "C" {
#endif

15 16 17 18 19
typedef struct omap_iter_node* omap_iter_node_t;

struct omap_iter_node {
	char*            key;
	char*            value;
20
	size_t           key_size;
21 22 23 24 25
	size_t           value_size;
	omap_iter_node_t prev, next; 
};

struct mobject_store_omap_iter {
26
	size_t           num_items;
27
	size_t           ref_count;
28 29 30 31 32 33
	omap_iter_node_t head;
	omap_iter_node_t current;
};

void omap_iter_create(mobject_store_omap_iter_t* iter);

34 35
void omap_iter_incr_ref(mobject_store_omap_iter_t iter);

36 37 38 39 40 41
void omap_iter_free(mobject_store_omap_iter_t iter);

void omap_iter_append(mobject_store_omap_iter_t iter, 
                      const char* key, const char* val, 
                      size_t val_size);

42 43 44 45
#ifdef __cplusplus
}
#endif

46
#endif