\r
#ifndef XMLTREE_H_\r
#define XMLTREE_H_\r
-extern "C" {\r
-#define CAML_NAME_SPACE\r
-#include <caml/mlvalues.h>\r
-#include <caml/custom.h>\r
-#define XMLTREE(x) ((XMLTree *)(* (XMLTree**) Data_custom_val(x)))\r
- //#define XMLTREE(x) ((XMLTree*) (x))\r
-}\r
+\r
+\r
#include <unordered_set>\r
#include <unordered_map>\r
#include <sstream>\r
#include "TextCollection/TextCollectionBuilder.h"\r
\r
-#include <cstdio>\r
-#include <cstdlib>\r
-#include <cstring>\r
-\r
-\r
#undef W\r
#undef WW\r
#undef Wminusone\r
using SXSI::TextCollectionBuilder;\r
\r
\r
-\r
// this constant is used to efficiently compute the child operation in the tree\r
#define OPTD 10\r
\r
\r
\r
typedef std::unordered_set<int> TagIdSet;\r
-typedef std::unordered_map<string,int> TagIdMap;\r
+typedef std::unordered_map<std::string,int> TagIdMap;\r
typedef TagIdMap::const_iterator TagIdMapIT;\r
\r
#define REGISTER_TAG(v,h,t) do { (h)->insert(std::make_pair((t),(v)->size()));\\r
bp *Par;\r
\r
/** Mapping from tag identifer to tag name */ \r
- vector<string> *TagName;\r
+ std::vector<std::string> *TagName;\r
TagIdMap * tIdMap;\r
\r
/** Bit vector indicating with a 1 the positions of the non-empty texts. */\r
\r
FILE* stream;\r
int stream_fd; \r
- string * buffer;\r
+ std::string * buffer;\r
void myfputs(const char* s, FILE * fp){\r
buffer->append(s);\r
if (buffer->size() >= 100000){\r
XMLTree(){ buffer = 0;};\r
\r
// non const pointer are freed by this method.\r
- XMLTree( pb * const par, uint npar, vector<string> * const TN, TagIdMap * const tim, uint *empty_texts_bmp, TagType *tags,\r
+ XMLTree( pb * const par, uint npar, std::vector<std::string> * const TN, TagIdMap * const tim, uint *empty_texts_bmp, TagType *tags,\r
TextCollection * const TC, bool dis_tc);\r
\r
public: \r
* if none.\r
*/\r
treeNode FirstElement(treeNode x);\r
- value CamlFirstElement(value x);\r
+\r
/** LastChild(x): returns the last child of node x. */\r
treeNode LastChild(treeNode x);\r
\r
* if none.\r
*/\r
treeNode NextElement(treeNode x);\r
- value CamlNextElement(value x);\r
+\r
/** PrevSibling(x): returns the previous sibling of node x, assuming it \r
* exists. */\r
\r
\r
};\r
\r
-extern "C" value caml_cpp_fast_first_element(value xmltree, value node);\r
-extern "C" value caml_cpp_fast_next_element(value xmltree, value node);\r
\r
\r
\r