-#include <unordered_set>
#include "xml-tree.hpp"
-#include "common_stub.hpp"
+#include "utils_stub.hpp"
#include <cstdio>
using namespace SXSI;
return static_cast<xml_tree::tag_t>(Int_val(i));
}
-static std::unordered_set<xml_tree::tag_t>*& HSET(value x)
-{
- return Obj_val<std::unordered_set<xml_tree::tag_t>*>(x);
-}
-
-
-NoAlloc extern "C" value caml_unordered_set_length(value hset)
-{
- return (Val_int((HSET(hset))->size()));
-}
-
-extern "C" value caml_unordered_set_alloc(value unit)
-{
- CAMLparam1(unit);
- CAMLlocal1(hset);
- hset = sxsi_alloc_custom<std::unordered_set<xml_tree::tag_t>*>();
- HSET(hset) = new std::unordered_set<xml_tree::tag_t>();
- CAMLreturn (hset);
-}
-
-NoAlloc extern "C" value caml_unordered_set_set(value set, value v)
-{
- HSET(set)->insert(TAG(v));
- return (Val_unit);
-}
-
extern "C" value caml_xml_tree_save(value tree, value fd, value prefix)
{
CAMLparam3(tree, fd, prefix);
NoAlloc extern "C" value
caml_xml_tree_select_child(value tree, value node, value tags)
{
- return (Val_int(XMLTREE(tree)->select_child(TREENODE(node), HSET(tags))));
+ return (Val_int(XMLTREE(tree)->select_child(TREENODE(node), TAGLIST(tags))));
}
NoAlloc extern "C" value
caml_xml_tree_select_sibling(value tree, value node, value tags)
{
return (Val_int(XMLTREE(tree)->select_sibling(TREENODE(node),
- HSET(tags))));
+ TAGLIST(tags))));
}
NoAlloc extern "C" value
caml_xml_tree_select_descendant(value tree, value node, value tags)
{
return (Val_int(XMLTREE(tree)->select_descendant(TREENODE(node),
- HSET(tags))));
+ TAGLIST(tags))));
}
NoAlloc extern "C" value caml_xml_tree_tagged_following_before(value tree,
value closing)
{
return (Val_int(XMLTREE(tree)->select_following_before(TREENODE(node),
- HSET(tags),
+ TAGLIST(tags),
TREENODE(closing))));
}