5 #include "xml-tree.hpp"
6 #include "utils_stub.hpp"
9 //define a type for the lexicographic index
16 std::vector<std::pair<std::string, xml_tree::node_t> > data;
24 static xml_tree*& XMLTREE(value v)
26 return Obj_val<xml_tree*>(v);
29 static lex_index*& LEXINDEX(value v)
31 return Obj_val<lex_index*>(v);
34 static xml_tree::node_t TREENODE(value i)
36 return static_cast<xml_tree::node_t>(Int_val(i));
39 static xml_tree::tag_t TAG(value i)
41 return static_cast<xml_tree::tag_t>(Int_val(i));
47 extern "C" value caml_build_lex_index(value vtree, value vtag)
49 CAMLparam2(vtree, vtag);
52 vindex = sxsi_alloc_custom<lex_index*>();
53 xml_tree * tree = XMLTREE(vtree);
54 xml_tree::tag_t tag = TAG(vtag);
55 //Uncomment the following and comment the failwith line
56 //LEXINDEX(vindex) = ... return a lex_index* ....
59 caml_failwith("build_lex_index not implemented");
65 extern "C" value caml_print_lex_index(value vindex)
68 lex_index* index = LEXINDEX(vindex);
70 //Print the index to the terminal
72 caml_failwith("print_lex_index not implemented");
75 CAMLreturn (Val_unit);