omap-iter-impl.h 797 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/*
 * (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"

#define OMAP_ITER_OWNS_KEY    0x1
#define OMAP_ITER_OWNS_VALUE  0x2

typedef struct omap_iter_node* omap_iter_node_t;

struct omap_iter_node {
	char*            key;
	char*            value;
	size_t           value_size;
	omap_iter_node_t prev, next; 
};

struct mobject_store_omap_iter {
	omap_iter_node_t head;
	omap_iter_node_t current;
};

void omap_iter_create(mobject_store_omap_iter_t* iter);

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);

#endif