X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Flexindex_stub.cpp;fp=src%2Flexindex_stub.cpp;h=a09216ef0096fee40110a870752928d614a0d273;hb=7d26a502050836784010cabae6acedee8aa9a46c;hp=0000000000000000000000000000000000000000;hpb=a05cf380a8b16c742dbb1e005e96600e6f727436;p=SXSI%2Fxpathcomp.git diff --git a/src/lexindex_stub.cpp b/src/lexindex_stub.cpp new file mode 100644 index 0000000..a09216e --- /dev/null +++ b/src/lexindex_stub.cpp @@ -0,0 +1,76 @@ +#include +#include +#include +#include +#include "xml-tree.hpp" +#include "utils_stub.hpp" + + +//define a type for the lexicographic index + +class lex_index { +public: + //The tag ID + xml_tree::tag_t tag; + //The text data + std::vector > data; +}; + + + +using namespace SXSI; + + +static xml_tree*& XMLTREE(value v) +{ + return Obj_val(v); +} + +static lex_index*& LEXINDEX(value v) +{ + return Obj_val(v); +} + +static xml_tree::node_t TREENODE(value i) +{ + return static_cast(Int_val(i)); +} + +static xml_tree::tag_t TAG(value i) +{ + return static_cast(Int_val(i)); +} + + + + +extern "C" value caml_build_lex_index(value vtree, value vtag) +{ + CAMLparam2(vtree, vtag); + CAMLlocal1(vindex); + vindex = sxsi_alloc_custom(); + xml_tree * tree = XMLTREE(vtree); + xml_tree::tag_t tag = TAG(vtag); + + //Uncomment the following and comment the failwith line + //LEXINDEX(vindex) = ... return a lex_index* .... + + + caml_failwith("build_lex_index not implemented"); + + + CAMLreturn (vindex); +} + +extern "C" value caml_print_lex_index(value vindex) +{ + CAMLparam1(vindex); + lex_index* index = LEXINDEX(vindex); + + //Print the index to the terminal + + caml_failwith("print_lex_index not implemented"); + + + CAMLreturn (Val_unit); +}