+extern "C" CAMLprim value caml_cpp_traversal(value tree){
+ CAMLparam1(tree);
+ traversal_rec(XMLTREE(tree),XMLTREE(tree)->Root());
+ CAMLreturn(Val_unit);
+}
+
+
+extern "C" CAMLprim value caml_text_collection_get_text(value tc, value id){
+ CAMLparam2(tc,id);
+
+ const char* txt = (const char*) ((TextCollection*) tc)->GetText((DocID) Int_val(id));
+ CAMLreturn (caml_copy_string(txt));
+}
+extern "C" CAMLprim value caml_text_collection_empty_text(value tc,value id){
+ CAMLparam2(tc,id);
+ CAMLreturn ( Val_int(((TextCollection*) tc)->EmptyText((DocID) Int_val(id))));
+}
+
+extern "C" CAMLprim value caml_text_collection_is_contains(value tc,value str){
+ CAMLparam2(tc,str);
+ uchar * cstr = (uchar *) String_val(str);
+ CAMLreturn ( Val_bool((int) ((TextCollection*) tc)->IsContains(cstr)));
+}
+
+extern "C" CAMLprim value caml_text_collection_count_contains(value tc,value str){
+ CAMLparam2(tc,str);
+ uchar * cstr = (uchar *) String_val(str);
+ CAMLreturn ( Val_int(((TextCollection*) tc)->CountContains(cstr)));
+