From f379a2c91a5b172f036fbcfb11e9c0c6cd1c27b9 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 15 Sep 2007 17:19:45 +0000 Subject: [PATCH] New API function burn_set_messenger() --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/init.c | 15 ++++++++++++++- libburn/libburn.h | 11 +++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 10d89eb..0d8216d 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.09.15.171844" +#define Cdrskin_timestamP "2007.09.15.172141" diff --git a/libburn/init.c b/libburn/init.c index 2947651..de010da 100644 --- a/libburn/init.c +++ b/libburn/init.c @@ -25,6 +25,8 @@ #include "libdax_msgs.h" struct libdax_msgs *libdax_messenger= NULL; +static int libdax_messenger_is_own = 1; + int burn_running = 0; @@ -292,7 +294,7 @@ void burn_set_signal_handling(void *handle, burn_abort_handler_t handler, strncpy(abort_message_prefix, (char *) handle, sizeof(abort_message_prefix)-1); abort_message_prefix[sizeof(abort_message_prefix)-1] = 0; - abort_control_pid= getpid(); + abort_control_pid = getpid(); Cleanup_set_handlers(handle, (Cleanup_app_handler_T) handler, mode|4); } @@ -303,3 +305,14 @@ void burn_allow_untested_profiles(int yes) burn_support_untested_profiles = !!yes; } + +/* ts A70915 : API */ +int burn_set_messenger(void *messenger) +{ + if (libdax_messenger_is_own) + libdax_msgs_destroy(&libdax_messenger, 0); + libdax_messenger = (struct libdax_msgs *) messenger; + libdax_messenger_is_own = 0; + return 1; +} + diff --git a/libburn/libburn.h b/libburn/libburn.h index bd4d44a..d89de68 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -1875,6 +1875,17 @@ int burn_msgs_obtain(char *minimum_severity, char severity[]); +/* ts A70915 */ +/** Replace the messenger object handle of libburn by a compatible handle + obtained from a related library. The own message object gets destroyed, + so it is IMPORTANT to shut down libburn BEFORE the library which provides + the messenger object. See also: libisofs, API function iso_get_messenger(). + @param messenger The foreign but compatible message handle. + @return 1 : success, <=0 : failure +*/ +int burn_set_messenger(void *messenger); + + /* ts A61002 */ /** The prototype of a handler function suitable for burn_set_abort_handling(). Such a function has to return -2 if it does not want the process to