diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-07-02 19:57:12 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-07-02 19:57:12 +0200 |
commit | 96ffb2fe97c3e77879e7a4f6f7457397a18bf233 (patch) | |
tree | 597d46bcd32108f18e69a67cf4034b9e81c93d73 /src/intset.h | |
parent | 3688d7f308877dd2e2c0c786ffa1e46d6bb34a13 (diff) | |
parent | 400aea2b1343232e45a0b7a9435a69d0fe8a0956 (diff) | |
download | redis-96ffb2fe97c3e77879e7a4f6f7457397a18bf233.tar.gz |
merged intset code into the split files
Diffstat (limited to 'src/intset.h')
-rw-r--r-- | src/intset.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/intset.h b/src/intset.h new file mode 100644 index 000000000..25afc18d1 --- /dev/null +++ b/src/intset.h @@ -0,0 +1,19 @@ +#ifndef __INTSET_H +#define __INTSET_H +#include <stdint.h> + +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); +intset *intsetRemove(intset *is, int64_t value, uint8_t *success); +uint8_t intsetFind(intset *is, int64_t value); +int64_t intsetRandom(intset *is); +uint8_t intsetGet(intset *is, uint32_t pos, int64_t *value); +uint32_t intsetLen(intset *is); + +#endif // __INTSET_H |