API

struct ds;

struct ds_conf {
    uint32_t (hash_function *) (void *, size_t);
    size_t max_key_size;
    size_t max_data_size;
    size_t max_record_count; // max entries
/*
    size_t max_attribute_size;
    size_t max_attribute_count;
*/
}

struct ds_record_opaque;

struct ds_record {
    void * key;
    size_t  key_size;
    void * data;
    size_t data_size;
    ds_record_opaque * opaque;
/*
    size_t attribute_count;
    void * * attributes;
    size_t * attribute_sizes;
*/
}

size_t ds_new_size (ds_conf_t *);

ds_t * ds_new (ds_conf_t *, void * block);
ds_destroy (ds_t *);

bool ds_include (ds_t *, ds_record_t *);
  // keeps internally a FIFO structure with the records;

bool ds_exclude (ds_t *, ds_record_t *);
  // removes the record both from the hash, but also from the queue;

bool ds_select (ds_t *, ds_record_t *);

bool ds_update (ds_t *, ds_record_t *);
  // for the moment it is a nop;

bool ds_dequeue_peek (ds_t *, ds_record_t *);
  // returns the first record in the queue, but doesn't update the queue

bool ds_dequeue (ds_t *, ds_record_t *);
  // returns the first record in the queue, and also removes it from the queue;
  // the map is not touched;