Added callback for PrevSibling
[SXSI/xpathcomp.git] / OCamlDriver.cpp
index e20a749..e1ddf83 100644 (file)
@@ -132,6 +132,25 @@ extern "C" CAMLprim value caml_text_collection_get_text(value tree, value id){
   delete (txt);
   CAMLreturn (str);
 }
+
+extern "C" CAMLprim value caml_text_collection_get_cached_text(value tree, value id){
+  CAMLparam2(tree,id);
+  CAMLlocal1(str);
+  char* txt = (char*) XMLTREE(tree)->GetCachedText((DocID) Int_val(id));
+  str = caml_copy_string(txt);
+  free(txt);
+  CAMLreturn (str);
+}
+
+extern "C" CAMLprim value caml_text_collection_size(value tree){
+  CAMLparam1(tree);
+  //  CAMLreturn (Val_int( XMLTREE(tree)->CachedText.size()));
+  NOT_IMPLEMENTED("text_collection_size");
+  CAMLreturn (Val_unit);
+}
+
+
+
 extern "C" CAMLprim value caml_text_collection_empty_text(value tree,value id){
   CAMLparam2(tree,id);
   CAMLreturn ( Val_int((XMLTREE(tree))->EmptyText((DocID) Int_val(id))));
@@ -148,6 +167,13 @@ extern "C" CAMLprim value caml_text_collection_count_contains(value tree,value s
   uchar * cstr = (uchar *) String_val(str);  
   CAMLreturn (Val_int((XMLTREE(tree)->CountContains(cstr))));
   
+}
+extern "C" CAMLprim value caml_text_collection_count(value tree,value str){
+  CAMLparam2(tree,str);
+  //uchar * cstr = (uchar *) String_val(str);
+  NOT_IMPLEMENTED("text_collection_count");
+  CAMLreturn (Val_unit);
+  
 }
 
 extern "C" CAMLprim value caml_text_collection_contains(value tree,value str){
@@ -235,6 +261,11 @@ extern "C" CAMLprim value caml_xml_tree_next_sibling(value tree, value id){
   CAMLreturn(Val_int (XMLTREE(tree)->NextSibling(TREENODEVAL(id))));
 }
 
+extern "C" CAMLprim value caml_xml_tree_prev_sibling(value tree, value id){
+  CAMLparam2(tree,id);
+  CAMLreturn(Val_int (XMLTREE(tree)->PrevSibling(TREENODEVAL(id))));
+}
+
 extern "C" CAMLprim value caml_xml_tree_prev_text(value tree, value id){
   CAMLparam2(tree,id);
   CAMLlocal1(res);