X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fgdome_xslt%2Focaml%2Fgdome_xslt%2Fml_gdome_xslt.c;h=225698a7900ef6f43617fcd96f3727490792c09f;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=b6330868f99077805710a162459e80d38938a921;hpb=54c2dc43bd9a12dca1d4edacc4324acd7bd07f0d;p=helm.git diff --git a/helm/DEVEL/gdome_xslt/ocaml/gdome_xslt/ml_gdome_xslt.c b/helm/DEVEL/gdome_xslt/ocaml/gdome_xslt/ml_gdome_xslt.c index b6330868f..225698a79 100644 --- a/helm/DEVEL/gdome_xslt/ocaml/gdome_xslt/ml_gdome_xslt.c +++ b/helm/DEVEL/gdome_xslt/ocaml/gdome_xslt/ml_gdome_xslt.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -115,9 +116,11 @@ value ml_applyStylesheet(value source, value style, value params) i+=2; } c_params[i] = NULL; + enter_blocking_section(); res = applyStylesheet(Document_val(source), XsltStylesheetPtr_val(style), c_params); + leave_blocking_section(); free(c_params); if (res == NULL) { value* excp; @@ -141,3 +144,43 @@ value ml_saveResultToChannel(value channel, CAMLreturn0; } + /* error callback handling */ + +static void ml_gdomeXsltErrorCallback(const char *msg) { + callback(*caml_named_value("error_callback"), copy_string(msg)); + + return; +} + +value ml_enableErrorCallback(value unit) { + CAMLparam1(unit); + setErrorCallback(ml_gdomeXsltErrorCallback); + CAMLreturn(Val_unit); +} + +value ml_disableErrorCallback(value unit) { + CAMLparam1(unit); + setErrorCallback(NULL); + CAMLreturn(Val_unit); +} + + /* debug callback handling */ + +static void ml_gdomeXsltDebugCallback(const char *msg) { + callback(*caml_named_value("debug_callback"), copy_string(msg)); + + return; +} + +value ml_enableDebugCallback(value unit) { + CAMLparam1(unit); + setDebugCallback(ml_gdomeXsltDebugCallback); + CAMLreturn(Val_unit); +} + +value ml_disableDebugCallback(value unit) { + CAMLparam1(unit); + setDebugCallback(NULL); + CAMLreturn(Val_unit); +} +