summaryrefslogtreecommitdiff
path: root/src/intset.h
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-07-02 19:57:12 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-07-02 19:57:12 +0200
commit96ffb2fe97c3e77879e7a4f6f7457397a18bf233 (patch)
tree597d46bcd32108f18e69a67cf4034b9e81c93d73 /src/intset.h
parent3688d7f308877dd2e2c0c786ffa1e46d6bb34a13 (diff)
parent400aea2b1343232e45a0b7a9435a69d0fe8a0956 (diff)
downloadredis-96ffb2fe97c3e77879e7a4f6f7457397a18bf233.tar.gz
merged intset code into the split files
Diffstat (limited to 'src/intset.h')
-rw-r--r--src/intset.h19
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