Commits

Anonymous committed 82437aa

BHandler class added

  • Participants
  • Parent commits 71de661

Comments (0)

Files changed (6)

File BHandlerML.cpp

-#include BHandlerML.h
+#include "BHandlerML.hpp"
 BHandlerML::BHandlerML(const char * name)
 	:BHandler(name)
 {
+	unsetHooks();
 }
 BHandlerML::BHandlerML(BMessage* archive)
 	:BHandler(archive)
 {
+	unsetHooks();
+}
+void
+BHandlerML::unsetHooks()
+{
+	closure_MessageReceived = 0;
 }
 void
 BHandlerML::MessageReceived(BMessage* message)
 {
 	if (closure_MessageReceived)
 	{
-		value arglist = { (value)message };
-		return caml_callbackN(closure_MessageReceived, 1, arglist);
+		value arglist [] = { (value)message };
+		caml_callbackN(closure_MessageReceived, 1, arglist);
 	} else
 	{
 		BHandler::MessageReceived(message);
 	((BHandlerML*)v_self)->setMessageReceived(v_cb);
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bhandlerGetSupportedSuites(value v_self, value v_message)
+CAMLprim value bhandler_GetSupportedSuites(value v_self, value v_message)
 {
 	CAMLparam2(v_self, v_message);
 	status_t res = ((BHandler*)v_self)->GetSupportedSuites((BMessage*)v_message);
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerLockLooper(value v_self)
+CAMLprim value bhandler_LockLooper(value v_self)
 {
 	CAMLparam1(v_self);
 	bool res = ((BHandler*)v_self)->LockLooper();
 	CAMLreturn(Val_bool(res));
 }
-CAMLprim value bhandlerLockLooperWithTimeout(value v_self, value v_timeout)
+CAMLprim value bhandler_LockLooperWithTimeout(value v_self, value v_timeout)
 {
 	CAMLparam2(v_self, v_timeout);
 	status_t res = ((BHandler*)v_self)->LockLooperWithTimeout((bigtime_t)v_timeout);
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerUnlockLooper(value v_self)
+CAMLprim value bhandler_UnlockLooper(value v_self)
 {
 	CAMLparam1(v_self);
 	((BHandler*)v_self)->UnlockLooper();
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bhandlerLooper(value v_self)
+CAMLprim value bhandler_Looper(value v_self)
 {
 	CAMLparam1(v_self);
 	BLooper* res = ((BHandler*)v_self)->Looper();
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerResolveSpecifier_native(value v_self, value v_message, value v_index, value v_specifier, value v_what, value v_property)
+CAMLprim value bhandler_ResolveSpecifier_native(value v_self, value v_message, value v_index, value v_specifier, value v_what, value v_property)
 {
 	CAMLparam5(v_self, v_message, v_index, v_specifier, v_what);
 	CAMLxparam1(v_property);
 	BHandler* res = ((BHandler*)v_self)->ResolveSpecifier((BMessage*)v_message, Int_val(v_index), (BMessage*)v_specifier, Int_val(v_what), String_val(v_property));
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerResolveSpecifier_bytecode(value* argv, int argn)
+CAMLprim value bhandler_ResolveSpecifier_bytecode(value* argv, int argn)
 {
-	return bhandlerResolveSpecifier_native(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
+	return bhandler_ResolveSpecifier_native(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
 }
-CAMLprim value bhandlerSetFilterList(value v_self, value v_list)
+CAMLprim value bhandler_SetFilterList(value v_self, value v_list)
 {
 	CAMLparam2(v_self, v_list);
 	((BHandler*)v_self)->SetFilterList((BList*)v_list);
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bhandlerFilterList(value v_self)
+CAMLprim value bhandler_FilterList(value v_self)
 {
 	CAMLparam1(v_self);
 	BList* res = ((BHandler*)v_self)->FilterList();
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerAddFilter(value v_self, value v_filter)
+CAMLprim value bhandler_AddFilter(value v_self, value v_filter)
 {
 	CAMLparam2(v_self, v_filter);
 	((BHandler*)v_self)->AddFilter((BMessageFilter*)v_filter);
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bhandlerRemoveFilter(value v_self, value v_filter)
+CAMLprim value bhandler_RemoveFilter(value v_self, value v_filter)
 {
 	CAMLparam2(v_self, v_filter);
 	bool res = ((BHandler*)v_self)->RemoveFilter((BMessageFilter*)v_filter);
 	CAMLreturn(Val_bool(res));
 }
-CAMLprim value bhandlerSetName(value v_self, value v_string)
+CAMLprim value bhandler_SetName(value v_self, value v_string)
 {
 	CAMLparam2(v_self, v_string);
 	((BHandler*)v_self)->SetName(String_val(v_string));
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bhandlerName(value v_self)
+CAMLprim value bhandler_Name(value v_self)
 {
 	CAMLparam1(v_self);
 	const char * res = ((BHandler*)v_self)->Name();
-	CAMLreturn(Val_string(res));
+	CAMLreturn(caml_copy_string(res));
 }
-CAMLprim value bhandlerSetNextHandler(value v_self, value v_handler)
+CAMLprim value bhandler_SetNextHandler(value v_self, value v_handler)
 {
 	CAMLparam2(v_self, v_handler);
 	((BHandler*)v_self)->SetNextHandler((BHandler*)v_handler);
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bhandlerNextHandler(value v_self)
+CAMLprim value bhandler_NextHandler(value v_self)
 {
 	CAMLparam1(v_self);
 	BHandler* res = ((BHandler*)v_self)->NextHandler();
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerSendNotices(value v_self, value v_what, value v_msg)
+CAMLprim value bhandler_SendNotices(value v_self, value v_what, value v_msg)
 {
 	CAMLparam3(v_self, v_what, v_msg);
 	((BHandler*)v_self)->SendNotices(Int_val(v_what), (BMessage*)v_msg);
 	CAMLreturn(Val_unit);
 }
-CAMLprim value bhandlerStartWatching_1(value v_self, value v_watcher, value v_what)
+CAMLprim value bhandler_StartWatching_1(value v_self, value v_watcher, value v_what)
 {
 	CAMLparam3(v_self, v_watcher, v_what);
-	status_t res = ((BHandler*)v_self)->StartWatching((BMessenger)v_watcher, Int_val(v_what));
+	status_t res = ((BHandler*)v_self)->StartWatching(*(BMessenger*)v_watcher, Int_val(v_what));
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerStartWatching_2(value v_self, value v_watcher, value v_what)
+CAMLprim value bhandler_StartWatching_2(value v_self, value v_watcher, value v_what)
 {
 	CAMLparam3(v_self, v_watcher, v_what);
 	status_t res = ((BHandler*)v_self)->StartWatching((BHandler*)v_watcher, Int_val(v_what));
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerStartWatchingAll_1(value v_self, value v_watcher)
+CAMLprim value bhandler_StartWatchingAll_1(value v_self, value v_watcher)
 {
 	CAMLparam2(v_self, v_watcher);
-	status_t res = ((BHandler*)v_self)->StartWatchingAll((BMessenger)v_watcher);
+	status_t res = ((BHandler*)v_self)->StartWatchingAll(*(BMessenger*)v_watcher);
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerStartWatchingAll_2(value v_self, value v_watcher)
+CAMLprim value bhandler_StartWatchingAll_2(value v_self, value v_watcher)
 {
 	CAMLparam2(v_self, v_watcher);
 	status_t res = ((BHandler*)v_self)->StartWatchingAll((BHandler*)v_watcher);
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerStopWatching_1(value v_self, value v_watcher, value v_what)
+CAMLprim value bhandler_StopWatching_1(value v_self, value v_watcher, value v_what)
 {
 	CAMLparam3(v_self, v_watcher, v_what);
-	status_t res = ((BHandler*)v_self)->StopWatching((BMessenger)v_watcher, Int_val(v_what));
+	status_t res = ((BHandler*)v_self)->StopWatching(*(BMessenger*)v_watcher, Int_val(v_what));
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerStopWatching_2(value v_self, value v_watcher, value v_what)
+CAMLprim value bhandler_StopWatching_2(value v_self, value v_watcher, value v_what)
 {
 	CAMLparam3(v_self, v_watcher, v_what);
 	status_t res = ((BHandler*)v_self)->StopWatching((BHandler*)v_watcher, Int_val(v_what));
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerStopWatchingAll_1(value v_self, value v_watcher)
+CAMLprim value bhandler_StopWatchingAll_1(value v_self, value v_watcher)
 {
 	CAMLparam2(v_self, v_watcher);
-	status_t res = ((BHandler*)v_self)->StopWatchingAll((BMessenger)v_watcher);
+	status_t res = ((BHandler*)v_self)->StopWatchingAll(*(BMessenger*)v_watcher);
 	CAMLreturn((value)res);
 }
-CAMLprim value bhandlerStopWatchingAll_2(value v_self, value v_watcher)
+CAMLprim value bhandler_StopWatchingAll_2(value v_self, value v_watcher)
 {
 	CAMLparam2(v_self, v_watcher);
 	status_t res = ((BHandler*)v_self)->StopWatchingAll((BHandler*)v_watcher);
 	CAMLreturn((value)res);
 }
-}
+}

File BHandlerML.hpp

 #ifndef BHANDLERML_H
 #define BHANDLERML_H
-extern "C" { #include "HaikuML.h" }
+#include "BeapiML.hpp"
+#include <app/Handler.h>
+extern "C" {
+#include "HaikuML.h"
+}
 class BHandlerML : public BHandler
 {
 public:
 	BHandlerML(BMessage* archive);
 	void MessageReceived(BMessage* message);
 	void setMessageReceived(value cb_MessageReceived);
+	void unsetHooks();
 private:
 	value closure_MessageReceived;
 };
 
-#endif
+#endif
 all : ApplicationKit InterfaceKit
 
-ApplicationKit : bapplication bmessage
+ApplicationKit : bapplication bhandler bmessage
 InterfaceKit : balignment bbutton bgrouplayout brect bslider btab btabview btextview bview bwindow
 
 beapi :
 	ocamlmklib -o bApplication haikuml_bapplication.o
 	ocamlmklib -o bApplication bApplication.cmx
 
+bhandler : beapi
+	g++ -o haikuml_bhandler.o -I/boot/common/lib/ocaml -c BHandlerML.cpp
+	ocamlopt -c bHandler.ml
+	ocamlmklib -o bHandler haikuml_bhandler.o
+	ocamlmklib -o bHandler bHandler.cmx
+
 bmessage : beapi
 	g++ -o haikuml_bmessage.o -I/boot/common/lib/ocaml -c BMessageML.cpp
 	ocamlopt -c bMessage.ml
+external bhandler_constructor_1 :
+	string -> Beapi.bhandler =
+	"bhandler_constructor_1"
+external bhandler_constructor_2 :
+	Beapi.bmessage -> Beapi.bhandler =
+	"bhandler_constructor_2"
+external bhandler_setMessageReceived :
+	Beapi.bhandler -> (Beapi.bmessage -> unit) -> unit =
+	"bhandler_setMessageReceived"
+external bhandler_GetSupportedSuites :
+	Beapi.bhandler -> Beapi.bmessage -> Beapi.status_t =
+	"bhandler_GetSupportedSuites"
+external bhandler_LockLooper :
+	Beapi.bhandler -> bool =
+	"bhandler_LockLooper"
+external bhandler_LockLooperWithTimeout :
+	Beapi.bhandler -> Beapi.bigtime_t -> Beapi.status_t =
+	"bhandler_LockLooperWithTimeout"
+external bhandler_UnlockLooper :
+	Beapi.bhandler -> unit =
+	"bhandler_UnlockLooper"
+external bhandler_Looper :
+	Beapi.bhandler -> Beapi.blooper =
+	"bhandler_Looper"
+external bhandler_ResolveSpecifier :
+	Beapi.bhandler -> Beapi.bmessage -> int -> Beapi.bmessage -> int -> string -> Beapi.bhandler =
+	"bhandler_ResolveSpecifier_native"
+	"bhandler_ResolveSpecifier_bytecode"
+external bhandler_SetFilterList :
+	Beapi.bhandler -> Beapi.blist -> unit =
+	"bhandler_SetFilterList"
+external bhandler_FilterList :
+	Beapi.bhandler -> Beapi.blist =
+	"bhandler_FilterList"
+external bhandler_AddFilter :
+	Beapi.bhandler -> Beapi.bmessagefilter -> unit =
+	"bhandler_AddFilter"
+external bhandler_RemoveFilter :
+	Beapi.bhandler -> Beapi.bmessagefilter -> bool =
+	"bhandler_RemoveFilter"
+external bhandler_SetName :
+	Beapi.bhandler -> string -> unit =
+	"bhandler_SetName"
+external bhandler_Name :
+	Beapi.bhandler -> string =
+	"bhandler_Name"
+external bhandler_SetNextHandler :
+	Beapi.bhandler -> Beapi.bhandler -> unit =
+	"bhandler_SetNextHandler"
+external bhandler_NextHandler :
+	Beapi.bhandler -> Beapi.bhandler =
+	"bhandler_NextHandler"
+external bhandler_SendNotices :
+	Beapi.bhandler -> int -> Beapi.bmessage -> unit =
+	"bhandler_SendNotices"
+external bhandler_StartWatching_1 :
+	Beapi.bhandler -> Beapi.bmessenger -> int -> Beapi.status_t =
+	"bhandler_StartWatching_1"
+external bhandler_StartWatching_2 :
+	Beapi.bhandler -> Beapi.bhandler -> int -> Beapi.status_t =
+	"bhandler_StartWatching_2"
+external bhandler_StartWatchingAll_1 :
+	Beapi.bhandler -> Beapi.bmessenger -> Beapi.status_t =
+	"bhandler_StartWatchingAll_1"
+external bhandler_StartWatchingAll_2 :
+	Beapi.bhandler -> Beapi.bhandler -> Beapi.status_t =
+	"bhandler_StartWatchingAll_2"
+external bhandler_StopWatching_1 :
+	Beapi.bhandler -> Beapi.bmessenger -> int -> Beapi.status_t =
+	"bhandler_StopWatching_1"
+external bhandler_StopWatching_2 :
+	Beapi.bhandler -> Beapi.bhandler -> int -> Beapi.status_t =
+	"bhandler_StopWatching_2"
+external bhandler_StopWatchingAll_1 :
+	Beapi.bhandler -> Beapi.bmessenger -> Beapi.status_t =
+	"bhandler_StopWatchingAll_1"
+external bhandler_StopWatchingAll_2 :
+	Beapi.bhandler -> Beapi.bhandler -> Beapi.status_t =
+	"bhandler_StopWatchingAll_2"
+
+
+
+	let bhandler ?archive ?name () =
+		match archive, name with
+		| None, Some name -> bhandler_constructor_1 name
+		| Some archive, None -> bhandler_constructor_2 archive
+		| _, _ -> invalid_arg "Wrong arg in BHandler.constructor"
+
+
+	let setMessageReceived ~self ~cb () =
+		bhandler_setMessageReceived self cb
+
+	let get_supported_suites ~self ~message () =
+		bhandler_GetSupportedSuites self message
+
+	let lock_looper ~self () =
+		bhandler_LockLooper self
+
+	let lock_looper_with_timeout ~self ~timeout () =
+		bhandler_LockLooperWithTimeout self timeout
+
+	let unlockLooper ~self () =
+		bhandler_UnlockLooper self
+
+	let looper ~self () =
+		bhandler_Looper self
+
+	let resolve_specifier ~self ~message ~index ~specifier ~what ~property () =
+		bhandler_ResolveSpecifier self message index specifier what property
+
+	let set_filter_list ~self ~list () =
+		bhandler_SetFilterList self list
+
+	let filter_list ~self () =
+		bhandler_FilterList self
+
+	let add_filter ~self ~filter () =
+		bhandler_AddFilter self filter
+
+	let remove_filter ~self ~filter () =
+		bhandler_RemoveFilter self filter
+
+	let set_name ~self ~string () =
+		bhandler_SetName self string
+
+	let name ~self () =
+		bhandler_Name self
+
+	let set_next_handler ~self ~handler () =
+		bhandler_SetNextHandler self handler
+
+	let next_handler ~self () =
+		bhandler_NextHandler self
+
+	let send_notices ~self ~what ~msg () =
+		bhandler_SendNotices self what msg
+
+	let start_watching ~self ?observer ?target ?what () =
+		match observer, target, what with
+		| None, Some watcher, Some what -> bhandler_StartWatching_1 self watcher what
+		| Some watcher, None, Some what -> bhandler_StartWatching_2 self watcher what
+		| _, _, _ -> invalid_arg "Wrong arg in BHandler.StartWatching"
+
+
+	let start_watching_all ~self ?observer ?target () =
+		match observer, target with
+		| None, Some watcher -> bhandler_StartWatchingAll_1 self watcher
+		| Some watcher, None -> bhandler_StartWatchingAll_2 self watcher
+		| _, _ -> invalid_arg "Wrong arg in BHandler.StartWatchingAll"
+
+
+	let stop_watching ~self ?observer ?target ?what () =
+		match observer, target, what with
+		| None, Some watcher, Some what -> bhandler_StopWatching_1 self watcher what
+		| Some watcher, None, Some what -> bhandler_StopWatching_2 self watcher what
+		| _, _, _ -> invalid_arg "Wrong arg in BHandler.StopWatching"
+
+
+	let stop_watching_all ~self ?observer ?target () =
+		match observer, target with
+		| None, Some watcher -> bhandler_StopWatchingAll_1 self watcher
+		| Some watcher, None -> bhandler_StopWatchingAll_2 self watcher
+		| _, _ -> invalid_arg "Wrong arg in BHandler.StopWatchingAll"
+
+
+class bhandler ?archive ?name ?external_pointer () =
+  object (self)
+    val pointer =
+      match external_pointer with
+      | Some p -> p
+      | None ->
+          match archive, name with
+          | None, Some name -> bhandler_constructor_1 name
+          | Some archive, None -> bhandler_constructor_2 archive
+          | _, _ -> invalid_arg "Wrong arg in BHandler.constructor"
+
+    method get_pointer = pointer
+
+    method setMessageReceived cb =
+		bhandler_setMessageReceived pointer cb
+
+    method get_supported_suites ~message =
+		bhandler_GetSupportedSuites pointer message
+
+    method lock_looper =
+		bhandler_LockLooper pointer
+
+    method lock_looper_with_timeout ~timeout =
+		bhandler_LockLooperWithTimeout pointer timeout
+
+    method unlockLooper =
+		bhandler_UnlockLooper pointer
+
+    method looper =
+		bhandler_Looper pointer
+
+    method resolve_specifier ~message ~index ~specifier ~what ~property =
+		bhandler_ResolveSpecifier pointer message index specifier what property
+
+    method set_filter_list ~list =
+		bhandler_SetFilterList pointer list
+
+    method filter_list =
+		bhandler_FilterList pointer
+
+    method add_filter ~filter =
+		bhandler_AddFilter pointer filter
+
+    method remove_filter ~filter =
+		bhandler_RemoveFilter pointer filter
+
+    method set_name ~string =
+		bhandler_SetName pointer string
+
+    method name =
+		bhandler_Name pointer
+
+    method set_next_handler ~handler =
+		bhandler_SetNextHandler pointer handler
+
+    method next_handler =
+		bhandler_NextHandler pointer
+
+    method send_notices ~what ~msg =
+		bhandler_SendNotices pointer what msg
+
+    method start_watching ?observer ?target ?what () =
+		match observer, target, what with
+		| None, Some watcher, Some what -> bhandler_StartWatching_1 pointer watcher what
+		| Some watcher, None, Some what -> bhandler_StartWatching_2 pointer watcher what
+		| _, _, _ -> invalid_arg "Wrong arg in BHandler.StartWatching"
+
+
+    method start_watching_all ?observer ?target () =
+		match observer, target with
+		| None, Some watcher -> bhandler_StartWatchingAll_1 pointer watcher
+		| Some watcher, None -> bhandler_StartWatchingAll_2 pointer watcher
+		| _, _ -> invalid_arg "Wrong arg in BHandler.StartWatchingAll"
+
+
+    method stop_watching ?observer ?target ?what () =
+		match observer, target, what with
+		| None, Some watcher, Some what -> bhandler_StopWatching_1 pointer watcher what
+		| Some watcher, None, Some what -> bhandler_StopWatching_2 pointer watcher what
+		| _, _, _ -> invalid_arg "Wrong arg in BHandler.StopWatching"
+
+
+    method stop_watching_all ?observer ?target () =
+		match observer, target with
+		| None, Some watcher -> bhandler_StopWatchingAll_1 pointer watcher
+		| Some watcher, None -> bhandler_StopWatchingAll_2 pointer watcher
+		| _, _ -> invalid_arg "Wrong arg in BHandler.StopWatchingAll"
+
+end
 type bhandler
 type blayout
 type blayoutitem
+type blist
+type blooper
 type bmenu
 type bmenubar
 type bmessage
+type bmessagefilter
 type bmessenger
 type bpoint
 type brect

File bhandler.ml

-external bhandler_constructor_1 :
-	string -> bhandler =
-	"bhandler_constructor_1"
-external bhandler_constructor_2 :
-	bmessage -> bhandler =
-	"bhandler_constructor_2"
-external bhandler_setMessageReceived :
-	bhandler -> 'a -> unit =
-	"bhandler_setMessageReceived"
-external bhandler_GetSupportedSuites :
-	bhandler -> bmessage -> status_t =
-	"bhandler_GetSupportedSuites"
-external bhandler_LockLooper :
-	bhandler -> bool =
-	"bhandler_LockLooper"
-external bhandler_LockLooperWithTimeout :
-	bhandler -> bigtime_t -> status_t =
-	"bhandler_LockLooperWithTimeout"
-external bhandler_UnlockLooper :
-	bhandler -> unit =
-	"bhandler_UnlockLooper"
-external bhandler_Looper :
-	bhandler -> blooper =
-	"bhandler_Looper"
-external bhandler_ResolveSpecifier :
-	bhandler -> bmessage -> int -> bmessage -> int -> string -> bhandler =
-	"bhandler_ResolveSpecifier_native"
-	"bhandler_ResolveSpecifier_bytecode"
-external bhandler_SetFilterList :
-	bhandler -> blist -> unit =
-	"bhandler_SetFilterList"
-external bhandler_FilterList :
-	bhandler -> blist =
-	"bhandler_FilterList"
-external bhandler_AddFilter :
-	bhandler -> bmessagefilter -> unit =
-	"bhandler_AddFilter"
-external bhandler_RemoveFilter :
-	bhandler -> bmessagefilter -> bool =
-	"bhandler_RemoveFilter"
-external bhandler_SetName :
-	bhandler -> string -> unit =
-	"bhandler_SetName"
-external bhandler_Name :
-	bhandler -> string =
-	"bhandler_Name"
-external bhandler_SetNextHandler :
-	bhandler -> bhandler -> unit =
-	"bhandler_SetNextHandler"
-external bhandler_NextHandler :
-	bhandler -> bhandler =
-	"bhandler_NextHandler"
-external bhandler_SendNotices :
-	bhandler -> int -> bmessage -> unit =
-	"bhandler_SendNotices"
-external bhandler_StartWatching_1 :
-	bmessenger -> int -> status_t =
-	"bhandler_StartWatching_1"
-external bhandler_StartWatching_2 :
-	bhandler -> int -> status_t =
-	"bhandler_StartWatching_2"
-external bhandler_StartWatchingAll_1 :
-	bmessenger -> status_t =
-	"bhandler_StartWatchingAll_1"
-external bhandler_StartWatchingAll_2 :
-	bhandler -> status_t =
-	"bhandler_StartWatchingAll_2"
-external bhandler_StopWatching_1 :
-	bmessenger -> int -> status_t =
-	"bhandler_StopWatching_1"
-external bhandler_StopWatching_2 :
-	bhandler -> int -> status_t =
-	"bhandler_StopWatching_2"
-external bhandler_StopWatchingAll_1 :
-	bmessenger -> status_t =
-	"bhandler_StopWatchingAll_1"
-external bhandler_StopWatchingAll_2 :
-	bhandler -> status_t =
-	"bhandler_StopWatchingAll_2"
-module BHandler =
-struct
-	let constructor ?archive ?name () =
-		match archive, name with
-		| None, Some name -> bhandler_constructor_1 name
-		| Some archive, None -> bhandler_constructor_2 archive
-		| None, None -> invalid_arg "Wrong arg in BHandler.constructor"
-
-
-	let setMessageReceived ~self ~cb () =
-		bhandler_setMessageReceived self cb
-
-	let bhandler_GetSupportedSuites ~self ~message () =
-		bhandler_GetSupportedSuites self message
-
-	let bhandler_LockLooper ~self () =
-		bhandler_LockLooper self
-
-	let bhandler_LockLooperWithTimeout ~self ~timeout () =
-		bhandler_LockLooperWithTimeout self timeout
-
-	let bhandler_UnlockLooper ~self () =
-		bhandler_UnlockLooper self
-
-	let bhandler_Looper ~self () =
-		bhandler_Looper self
-
-	let bhandler_ResolveSpecifier ~self ~message ~index ~specifier ~what ~property () =
-		bhandler_ResolveSpecifier self message index specifier what property
-
-	let bhandler_SetFilterList ~self ~list () =
-		bhandler_SetFilterList self list
-
-	let bhandler_FilterList ~self () =
-		bhandler_FilterList self
-
-	let bhandler_AddFilter ~self ~filter () =
-		bhandler_AddFilter self filter
-
-	let bhandler_RemoveFilter ~self ~filter () =
-		bhandler_RemoveFilter self filter
-
-	let bhandler_SetName ~self ~string () =
-		bhandler_SetName self string
-
-	let bhandler_Name ~self () =
-		bhandler_Name self
-
-	let bhandler_SetNextHandler ~self ~handler () =
-		bhandler_SetNextHandler self handler
-
-	let bhandler_NextHandler ~self () =
-		bhandler_NextHandler self
-
-	let bhandler_SendNotices ~self ~what ~msg () =
-		bhandler_SendNotices self what msg
-
-	let StartWatching ?watcher ?watcher ?what () =
-		match watcher, watcher, what with
-		| None, Some watcher, Some what -> bhandler_StartWatching_1 watcher what
-		| Some watcher, None, Some what -> bhandler_StartWatching_2 watcher what
-		| None, None, None -> invalid_arg "Wrong arg in BHandler.StartWatching"
-
-
-	let StartWatchingAll ?watcher ?watcher () =
-		match watcher, watcher with
-		| None, Some watcher -> bhandler_StartWatchingAll_1 watcher
-		| Some watcher, None -> bhandler_StartWatchingAll_2 watcher
-		| None, None -> invalid_arg "Wrong arg in BHandler.StartWatchingAll"
-
-
-	let StopWatching ?watcher ?watcher ?what () =
-		match watcher, watcher, what with
-		| None, Some watcher, Some what -> bhandler_StopWatching_1 watcher what
-		| Some watcher, None, Some what -> bhandler_StopWatching_2 watcher what
-		| None, None, None -> invalid_arg "Wrong arg in BHandler.StopWatching"
-
-
-	let StopWatchingAll ?watcher ?watcher () =
-		match watcher, watcher with
-		| None, Some watcher -> bhandler_StopWatchingAll_1 watcher
-		| Some watcher, None -> bhandler_StopWatchingAll_2 watcher
-		| None, None -> invalid_arg "Wrong arg in BHandler.StopWatchingAll"
-
-
-end