void range_want_warnings(int c_want) { CAMLparam0(); CAMLlocal1(caml_result); caml_result = callback_exn(*cb_range_want_warnings, Val_bool(c_want)); range_set_exception(caml_result); CAMLreturn0; }
void range_clear_caches() { CAMLparam0(); CAMLlocal1(caml_result); caml_result = callback_exn(*cb_range_clear_caches, Val_unit); range_set_exception(caml_result); CAMLreturn0; }
static void ml_activate_link_func (GtkAboutDialog *about, const gchar *link, gpointer data) { value v_link, *closure; closure = data; v_link = copy_string (link); callback_exn (*closure, v_link); }
static void clipboard_text_received_func (GtkClipboard *clipboard, const gchar *text, gpointer data) { value arg = (text != NULL ? ml_some(copy_string(text)) : Val_unit); callback_exn (*(value*)data, arg); ml_global_root_destroy (data); }
static void clipboard_received_func (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) { value arg = Val_pointer (selection_data); callback_exn (*(value*)data, arg); ml_global_root_destroy (data); }
static int putc_callback(int c) { CAMLparam0(); CAMLlocal1(ret); AWB(ret); ret=callback_exn(putc_function,Val_int(c&255)); CAMLreturn(Is_exception_result(ret)?-1:0); }
static gboolean ml_gtk_text_char_predicate(gunichar ch, gpointer user_data) { value res, *clos = user_data; res = callback_exn (*clos, Val_int(ch)); if (Is_exception_result (res)) { CAML_EXN_LOG ("ml_gtk_text_char_predicate"); return FALSE; } return Bool_val(res); }
void range_set_altpath(const char * c_path) { CAMLparam0(); CAMLlocal2(caml_result, caml_path); caml_path = caml_copy_string(c_path); caml_result = callback_exn(*cb_range_set_altpath, caml_path); range_set_exception(caml_result); CAMLreturn0; }
static void timer_proc(ClientData cdata) { timerhandler *h; value r; h = (timerhandler *) cdata; r = callback_exn(h->callback_fn, Val_int(0)); if (Is_exception_result(r)) { fprintf(stderr, "In timer_proc: Uncaught Ocaml exception\n"); }; }
static void file_proc(ClientData cdata, int mask) { filehandler *h; value r; h = (filehandler *) cdata; r = callback_exn(h->callback_fn, Val_int(0)); if (Is_exception_result(r)) { fprintf(stderr, "In file_proc: Uncaught Ocaml exception\n"); }; }
char * range_parse(const char * c_range) { CAMLparam0(); CAMLlocal2(caml_result, caml_range); caml_range = caml_copy_string(c_range); caml_result = callback_exn(*cb_range_parse, caml_range); if (range_set_exception(caml_result)) CAMLreturn(NULL); else CAMLreturn(strdup(String_val(caml_result))); }
static void tag_foreach_func (GtkTextTag* t, gpointer user_data) { value arg = Val_GtkTextTag(t); callback_exn (*(value*)user_data, arg); }
static void ml_gtk_simple_callback (GtkWidget *w, gpointer data) { value val, *clos = (value*)data; val = Val_GtkWidget(w); callback_exn (*clos, val); }