+
+value ml_saveResultToChannel(value channel,
+ value result,
+ value stylesheet)
+{
+ CAMLparam3(channel, result, stylesheet);
+
+ saveResultToFd((Channel(channel))->fd,
+ Document_val(result),
+ XsltStylesheetPtr_val(stylesheet));
+
+ 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);
+}
+