Merge branch 'local-ocamlbuild' into local-trunk
[SXSI/xpathcomp.git] / src / results.h
diff --git a/src/results.h b/src/results.h
new file mode 100644 (file)
index 0000000..c504894
--- /dev/null
@@ -0,0 +1,29 @@
+
+typedef struct
+  { int n,lgn;
+    int *tree;
+  } results;
+
+       // creates empty results data structure for n nodes numbered 0..n-1
+results createResults (int n);
+
+       // frees R
+void freeResults (results R);
+
+       // returns 0/1 telling whether result p is not/is present in R
+int readResult (results R, int p);
+
+unsigned int countResult (results R);
+
+       // inserts result p into R
+void setResult (results R, int p);
+
+       // clears all results p1..p2 in R
+void clearRange (results R, int p1, int p2);
+
+       // returns pos of next(p) in R, or -1 if none
+int nextResult (results R, int p);
+
+       // for debugging, prints the data structure
+void printTree (results R);
+