2010-06-03 16:06:18 +02:00
|
|
|
#ifndef __INTSET_H
|
|
|
|
#define __INTSET_H
|
2010-06-11 19:22:27 +02:00
|
|
|
#include <stdint.h>
|
2010-06-03 16:06:18 +02:00
|
|
|
|
|
|
|
typedef struct intset {
|
|
|
|
uint32_t encoding;
|
|
|
|
uint32_t length;
|
|
|
|
int8_t contents[];
|
|
|
|
} intset;
|
|
|
|
|
|
|
|
intset *intsetNew(void);
|
|
|
|
intset *intsetAdd(intset *is, int64_t value, uint8_t *success);
|
2010-12-09 10:21:02 +01:00
|
|
|
intset *intsetRemove(intset *is, int64_t value, int *success);
|
2010-06-03 16:06:18 +02:00
|
|
|
uint8_t intsetFind(intset *is, int64_t value);
|
|
|
|
int64_t intsetRandom(intset *is);
|
2010-06-12 22:25:22 +02:00
|
|
|
uint8_t intsetGet(intset *is, uint32_t pos, int64_t *value);
|
|
|
|
uint32_t intsetLen(intset *is);
|
2011-02-28 14:48:49 +01:00
|
|
|
size_t intsetBlobLen(intset *is);
|
2010-06-03 16:06:18 +02:00
|
|
|
|
|
|
|
#endif // __INTSET_H
|