Big renaming. Uses the bp namespace everywhere
[SXSI/libbp.git] / bp-darray.h
diff --git a/bp-darray.h b/bp-darray.h
new file mode 100644 (file)
index 0000000..23d44a4
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef BP_DARRAY_H_
+#define BP_DARRAY_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef unsigned char byte;
+typedef unsigned short word;
+typedef unsigned int dword;
+
+#define OPT_NO_RANK (1<<30)
+
+
+typedef dword pb;
+
+
+typedef struct {
+  int n,m;
+  int size;
+  pb *buf;
+  dword *lp;
+  dword *sl;
+  word *ss;
+  dword *p;
+
+  dword *rl;
+  word *rm;
+  byte *rs;
+
+  int idx_size;
+} darray;
+
+
+darray * bp_darray_construct(int n, pb *buf,int opt);
+void bp_darray_free(darray *da);
+
+int bp_darray_select(darray *da, int i,int f);
+int bp_darray_rank(darray *da, int i);
+darray * bp_darray_pat_construct(int n, pb *buf, int k, pb pat, int opt);
+int bp_darray_pat_select(darray *da, int i, pb (*getpat)(pb *));
+int bp_darray_pat_rank(darray *da, int i, pb (*getpat)(pb *));
+
+int bp_darray_select_bsearch(darray *da, int i, pb (*getpat)(pb *));
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif