r3937 - in trunk: beast-gtk beast-gtk/gxk bse bse/tests sfi sfi/tests shell slowtests tests/bse tools
- From: timj svn gnome org
- To: svn-commits-list gnome org
- Subject: r3937 - in trunk: beast-gtk beast-gtk/gxk bse bse/tests sfi sfi/tests shell slowtests tests/bse tools
- Date: Fri, 6 Oct 2006 12:55:52 -0400 (EDT)
Author: timj
Date: 2006-10-06 12:55:46 -0400 (Fri, 06 Oct 2006)
New Revision: 3937
Added:
trunk/sfi/sfimsg.c
trunk/sfi/sfimsg.h
Modified:
trunk/beast-gtk/bstapp.c
trunk/beast-gtk/bstmain.c
trunk/beast-gtk/bstusermessage.c
trunk/beast-gtk/bstusermessage.h
trunk/beast-gtk/gxk/gxktexttools.c
trunk/beast-gtk/testgui.c
trunk/bse/bse.h
trunk/bse/bseautodoc.c
trunk/bse/bsebiquadfilter.c
trunk/bse/bseengine.c
trunk/bse/bseenginemaster.c
trunk/bse/bseengineschedule.c
trunk/bse/bsejanitor.proc
trunk/bse/bseladspa.c
trunk/bse/bseloader-aiff.c
trunk/bse/bseloader-bsewave.c
trunk/bse/bseloader-guspatch.cc
trunk/bse/bseloader-wav.c
trunk/bse/bsemain.c
trunk/bse/bsemain.h
trunk/bse/bsemididecoder.c
trunk/bse/bsemididevice-null.c
trunk/bse/bsemididevice-oss.c
trunk/bse/bsemidifile.c
trunk/bse/bsemidireceiver.cc
trunk/bse/bseobject.c
trunk/bse/bsepcmdevice-null.c
trunk/bse/bsepcmdevice-oss.c
trunk/bse/bseplugin.c
trunk/bse/bseprocedure.c
trunk/bse/bsequery.c
trunk/bse/bseresamplerimpl.hh
trunk/bse/bsesequencer.cc
trunk/bse/bseserver.c
trunk/bse/bsetrack.c
trunk/bse/bseundostack.c
trunk/bse/gsldatahandle-mad.c
trunk/bse/gslosctable.c
trunk/bse/gslvorbis-cutter.c
trunk/bse/gslvorbis-enc.c
trunk/bse/gslwaveosc.c
trunk/bse/tests/blocktests.cc
trunk/bse/tests/loophandle.c
trunk/bse/tests/resamplehandle.cc
trunk/sfi/ChangeLog
trunk/sfi/Makefile.am
trunk/sfi/sfi.h
trunk/sfi/sficomport.c
trunk/sfi/sficxx.cc
trunk/sfi/sficxx.hh
trunk/sfi/sfifilecrawler.c
trunk/sfi/sfiglue.c
trunk/sfi/sfigluecodec.c
trunk/sfi/sfiglueproxy.c
trunk/sfi/sfistore.c
trunk/sfi/sfitypes.h
trunk/sfi/tests/ring.c
trunk/shell/bsescminterp.c
trunk/slowtests/perftest.cc
trunk/slowtests/testresampler.cc
trunk/slowtests/testwavechunk.c
trunk/tests/bse/cxxbinding.cc
trunk/tools/bsefextract.cc
trunk/tools/bsewavetool.cc
trunk/tools/cutvorbis.c
trunk/tools/magictest.c
trunk/tools/mathtool.c
Log:
Fri Oct 6 18:53:35 2006 Tim Janik <timj gtk org>
* sfimsg.h, sfimsg.c: renamed and moved here from birnet/.
changed callers.
* sficxx.cc: don't shadow "sfi_init" symbol.
* sfitypes.h: removed portions covered by sfimsg.h.
Modified: trunk/beast-gtk/bstapp.c
===================================================================
--- trunk/beast-gtk/bstapp.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/beast-gtk/bstapp.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -1094,7 +1094,7 @@
if (docs_url)
{
gchar *local_url = g_strconcat ("file://", BST_PATH_DOCS, "/", docs_url, NULL);
- birnet_url_show_with_cookie (local_url, docs_title, self->cookie);
+ sfi_url_show_with_cookie (local_url, docs_title, self->cookie);
g_free (local_url);
}
break;
@@ -1102,19 +1102,19 @@
beast_show_about_box ();
break;
case ACTION_URL_HELP_DESK:
- birnet_url_show ("http://beast.gtk.org/wiki:HelpDesk");
+ sfi_url_show ("http://beast.gtk.org/wiki:HelpDesk");
break;
case ACTION_URL_BEAST_SITE:
- birnet_url_show ("http://beast.gtk.org/");
+ sfi_url_show ("http://beast.gtk.org/");
break;
case ACTION_URL_REPORT_BUG:
- birnet_url_show ("http://bugzilla.gnome.org/simple-bug-guide.cgi?product=beast");
+ sfi_url_show ("http://bugzilla.gnome.org/simple-bug-guide.cgi?product=beast");
break;
case ACTION_URL_ONLINE_SYNTHESIZERS:
- birnet_url_show ("http://beast.gtk.org/sound-browser");
+ sfi_url_show ("http://beast.gtk.org/sound-browser");
break;
case ACTION_URL_ONLINE_DEMOS:
- birnet_url_show ("http://beast.gtk.org/sound-browser");
+ sfi_url_show ("http://beast.gtk.org/sound-browser");
break;
case ACTION_DEMO_DIALOG_FATAL:
case ACTION_DEMO_DIALOG_ERROR:
@@ -1135,13 +1135,13 @@
case ACTION_DEMO_DIALOG_DEBUG: demo_type = BST_MSG_DEBUG; break;
}
bst_msg_dialog (demo_type,
- BIRNET_MSG_TEXT0 ("Demonstration Dialog"),
- BIRNET_MSG_TEXT1 ("This is a demonstrative dialog"),
- BIRNET_MSG_TEXT2 ("To help with dialog layout, and to test message display, dialogs may be "
+ SFI_MSG_TEXT0 ("Demonstration Dialog"),
+ SFI_MSG_TEXT1 ("This is a demonstrative dialog"),
+ SFI_MSG_TEXT2 ("To help with dialog layout, and to test message display, dialogs may be "
"fired up for pure demonstration purposes. This is such a dialog, so if you "
"are currently looking at a prominent warning or error message, there's no "
"real merit to it."),
- BIRNET_MSG_TEXT3 ("Demo-Dialog-Type: %s", birnet_msg_type_label (demo_type)));
+ SFI_MSG_TEXT3 ("Demo-Dialog-Type: %s", sfi_msg_type_label (demo_type)));
break;
default:
g_assert_not_reached ();
Modified: trunk/beast-gtk/bstmain.c
===================================================================
--- trunk/beast-gtk/bstmain.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/beast-gtk/bstmain.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -28,6 +28,7 @@
#include "bstparam.h"
#include "bstpreferences.h"
#include "topconfig.h"
+#include "birnet/birnetcpu.h"
#include "data/beast-images.h"
#include <unistd.h>
#include <string.h>
@@ -85,7 +86,7 @@
gchar *string;
GSource *source;
char debugbool[2] = "0";
- BirnetInitValue config[] = {
+ SfiInitValue config[] = {
{ "debug-extensions", debugbool },
{ NULL },
};
@@ -109,8 +110,8 @@
g_type_init ();
/* initialize Birnet/Sfi */
- birnet_init (&argc, &argv, _("BEAST")); /* application name is user visible */
- birnet_msg_allow ("misc");
+ sfi_init (&argc, &argv, _("BEAST"), NULL); /* application name is user visible */
+ sfi_msg_allow ("misc");
/* ensure SFI can wake us up */
birnet_thread_set_name ("Beast GUI");
birnet_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup,
@@ -257,7 +258,7 @@
_bst_init_radgets ();
/* install message dialog handler */
- birnet_msg_set_thread_handler (bst_message_log_handler);
+ sfi_msg_set_thread_handler (bst_message_log_handler);
/* open files given on command line */
if (argc > 1)
@@ -402,7 +403,7 @@
}
/* take down GUI */
- birnet_msg_set_thread_handler (NULL);
+ sfi_msg_set_thread_handler (NULL);
bst_message_dialogs_popdown ();
/* perform necessary cleanup cycles */
@@ -455,16 +456,16 @@
envar = getenv ("BST_DEBUG");
if (envar)
- birnet_msg_allow (envar);
+ sfi_msg_allow (envar);
envar = getenv ("BST_NO_DEBUG");
if (envar)
- birnet_msg_deny (envar);
+ sfi_msg_deny (envar);
envar = getenv ("BEAST_DEBUG");
if (envar)
- birnet_msg_allow (envar);
+ sfi_msg_allow (envar);
envar = getenv ("BEAST_NO_DEBUG");
if (envar)
- birnet_msg_deny (envar);
+ sfi_msg_deny (envar);
gboolean initialize_bse_and_exit = FALSE;
for (i = 1; i < argc; i++)
@@ -521,9 +522,9 @@
guint j;
g_print ("BEAST debug keys: all");
for (j = 0; mids[j].ident; j++)
- if (mids[j].type >= BIRNET_MSG_DEBUG && mids[j].label)
+ if (mids[j].type >= SFI_MSG_DEBUG && mids[j].label)
g_print (", %s (%s)", mids[j].ident, mids[j].label);
- else if (mids[j].type >= BIRNET_MSG_DEBUG)
+ else if (mids[j].type >= SFI_MSG_DEBUG)
g_print (", %s", mids[j].ident);
g_print ("\n");
exit (0);
@@ -535,11 +536,11 @@
gchar *equal = argv[i] + 7;
if (*equal == '=')
- birnet_msg_allow (equal + 1);
+ sfi_msg_allow (equal + 1);
else if (i + 1 < argc)
{
argv[i++] = NULL;
- birnet_msg_allow (argv[i]);
+ sfi_msg_allow (argv[i]);
}
argv[i] = NULL;
}
@@ -549,11 +550,11 @@
gchar *equal = argv[i] + 7;
if (*equal == '=')
- birnet_msg_deny (equal + 1);
+ sfi_msg_deny (equal + 1);
else if (i + 1 < argc)
{
argv[i++] = NULL;
- birnet_msg_deny (argv[i]);
+ sfi_msg_deny (argv[i]);
}
argv[i] = NULL;
}
Modified: trunk/beast-gtk/bstusermessage.c
===================================================================
--- trunk/beast-gtk/bstusermessage.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/beast-gtk/bstusermessage.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -320,7 +320,7 @@
g_free (mbit);
}
-BirnetMsgBit*
+SfiMsgBit*
bst_message_bit_appoint (guint id,
const gchar *name,
const gchar *stock_icon,
@@ -331,7 +331,7 @@
mbit->name = g_strdup (name);
mbit->stock_icon = g_strdup (stock_icon);
mbit->options = g_strdup (options);
- return birnet_msg_bit_appoint (bst_message_bit_appoint, mbit, bst_msg_bit_free);
+ return sfi_msg_bit_appoint (bst_message_bit_appoint, mbit, bst_msg_bit_free);
}
static void
@@ -514,8 +514,8 @@
{
msg->log_domain = NULL;
msg->type = mtype;
- msg->ident = (char*) birnet_msg_type_ident (msg->type);
- msg->label = (char*) birnet_msg_type_label (msg->type);
+ msg->ident = (char*) sfi_msg_type_ident (msg->type);
+ msg->label = (char*) sfi_msg_type_label (msg->type);
const gchar *proc_title = NULL;
if (hastext (proc_name))
{
@@ -643,13 +643,13 @@
}
void
-bst_message_log_handler (const BirnetMessage *lmsg)
+bst_message_log_handler (const SfiMessage *lmsg)
{
BstMessage msg = { 0, };
msg.log_domain = lmsg->log_domain;
msg.type = lmsg->type;
- msg.ident = (char*) birnet_msg_type_ident (msg.type);
- msg.label = (char*) birnet_msg_type_label (msg.type);
+ msg.ident = (char*) sfi_msg_type_ident (msg.type);
+ msg.label = (char*) sfi_msg_type_label (msg.type);
msg.config_check = lmsg->config_check;
msg.title = lmsg->title;
msg.primary = lmsg->primary;
@@ -669,8 +669,8 @@
BstMessage msg = { 0, };
msg.log_domain = umsg->log_domain;
msg.type = bst_msg_type_from_user_msg_type (umsg->type);
- msg.ident = (char*) birnet_msg_type_ident (msg.type);
- msg.label = (char*) birnet_msg_type_label (msg.type);
+ msg.ident = (char*) sfi_msg_type_ident (msg.type);
+ msg.label = (char*) sfi_msg_type_label (msg.type);
msg.config_check = umsg->config_check;
msg.title = umsg->title;
msg.primary = umsg->primary;
@@ -712,26 +712,26 @@
guint
bst_message_dialog_elist (const char *log_domain,
BstMsgType type, /* BST_MSG_DEBUG is not really useful here */
- BirnetMsgBit *lbit1,
- BirnetMsgBit *lbit2,
+ SfiMsgBit *lbit1,
+ SfiMsgBit *lbit2,
...)
{
gint saved_errno = errno;
guint n = 0;
- BirnetMsgBit **bits = NULL;
+ SfiMsgBit **bits = NULL;
/* collect msg bits */
if (lbit1)
{
- bits = g_renew (BirnetMsgBit*, bits, n + 1);
+ bits = g_renew (SfiMsgBit*, bits, n + 1);
bits[n++] = lbit1;
- BirnetMsgBit *lbit = lbit2;
+ SfiMsgBit *lbit = lbit2;
va_list args;
va_start (args, lbit2);
while (lbit)
{
- bits = g_renew (BirnetMsgBit*, bits, n + 1);
+ bits = g_renew (SfiMsgBit*, bits, n + 1);
bits[n++] = lbit;
- lbit = va_arg (args, BirnetMsgBit*);
+ lbit = va_arg (args, SfiMsgBit*);
}
va_end (args);
}
@@ -741,13 +741,13 @@
for (i = 0; i < n; i++)
if (bits[i]->owner == bst_message_bit_appoint)
{
- bits = g_renew (BirnetMsgBit*, bits, n + 1);
- bits[n++] = birnet_msg_bit_appoint (bst_message_dialog_elist, &dialog_result, NULL);
+ bits = g_renew (SfiMsgBit*, bits, n + 1);
+ bits[n++] = sfi_msg_bit_appoint (bst_message_dialog_elist, &dialog_result, NULL);
break;
}
- bits = g_renew (BirnetMsgBit*, bits, n + 1);
+ bits = g_renew (SfiMsgBit*, bits, n + 1);
bits[n] = NULL;
- birnet_msg_log_trampoline (log_domain, type, bits, bst_message_log_handler);
+ sfi_msg_log_trampoline (log_domain, type, bits, bst_message_log_handler);
g_free (bits);
errno = saved_errno;
return dialog_result;
@@ -819,15 +819,15 @@
{
BstMsgID *msg_ids = NULL;
guint i = 0;
- const gchar *ident = birnet_msg_type_ident (i);
+ const gchar *ident = sfi_msg_type_ident (i);
while (ident)
{
msg_ids = g_renew (BstMsgID, msg_ids, i + 1);
msg_ids[i].type = i;
msg_ids[i].ident = ident;
- msg_ids[i].label = birnet_msg_type_label (msg_ids[i].type);
+ msg_ids[i].label = sfi_msg_type_label (msg_ids[i].type);
i++;
- ident = birnet_msg_type_ident (i);
+ ident = sfi_msg_type_ident (i);
}
msg_ids = g_renew (BstMsgID, msg_ids, i + 1);
msg_ids[i].type = 0;
Modified: trunk/beast-gtk/bstusermessage.h
===================================================================
--- trunk/beast-gtk/bstusermessage.h 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/beast-gtk/bstusermessage.h 2006-10-06 16:55:46 UTC (rev 3937)
@@ -24,14 +24,14 @@
/* --- structures --- */
typedef enum {
- BST_MSG_NONE = BIRNET_MSG_NONE,
- BST_MSG_FATAL = BIRNET_MSG_FATAL,
- BST_MSG_ERROR = BIRNET_MSG_ERROR,
- BST_MSG_WARNING = BIRNET_MSG_WARNING,
- BST_MSG_SCRIPT = BIRNET_MSG_SCRIPT,
- BST_MSG_INFO = BIRNET_MSG_INFO,
- BST_MSG_DIAG = BIRNET_MSG_DIAG,
- BST_MSG_DEBUG = BIRNET_MSG_DEBUG,
+ BST_MSG_NONE = SFI_MSG_NONE,
+ BST_MSG_FATAL = SFI_MSG_FATAL,
+ BST_MSG_ERROR = SFI_MSG_ERROR,
+ BST_MSG_WARNING = SFI_MSG_WARNING,
+ BST_MSG_SCRIPT = SFI_MSG_SCRIPT,
+ BST_MSG_INFO = SFI_MSG_INFO,
+ BST_MSG_DIAG = SFI_MSG_DIAG,
+ BST_MSG_DEBUG = SFI_MSG_DEBUG,
} BstMsgType;
typedef struct {
@@ -48,7 +48,7 @@
gchar *process;
guint pid;
guint n_msg_bits;
- BirnetMsgBit **msg_bits;
+ SfiMsgBit **msg_bits;
} BstMessage;
typedef struct {
guint type;
@@ -60,25 +60,25 @@
void bst_message_connect_to_server (void);
void bst_message_dialogs_popdown (void);
void bst_message_handler (const BstMessage *message);
-void bst_message_log_handler (const BirnetMessage *lmsg);
+void bst_message_log_handler (const SfiMessage *lmsg);
void bst_message_synth_msg_handler (const BseMessage *umsg);
const BstMsgID* bst_message_list_types (guint *n_types);
guint bst_message_dialog_elist (const char *log_domain,
BstMsgType type,
- BirnetMsgBit *lbit1,
- BirnetMsgBit *lbit2,
+ SfiMsgBit *lbit1,
+ SfiMsgBit *lbit2,
...);
-BirnetMsgBit* bst_message_bit_appoint (guint id,
+SfiMsgBit* bst_message_bit_appoint (guint id,
const gchar *name,
const gchar *stock_icon,
const gchar *options);
#define bst_msg_dialog(level, ...) bst_message_dialog_elist (BIRNET_LOG_DOMAIN, level, __VA_ARGS__, NULL)
/* SFI message bit equivalents */
-#define BST_MSG_TEXT0(...) BIRNET_MSG_TEXT0 (__VA_ARGS__)
-#define BST_MSG_TEXT1(...) BIRNET_MSG_TEXT1 (__VA_ARGS__)
-#define BST_MSG_TEXT2(...) BIRNET_MSG_TEXT2 (__VA_ARGS__)
-#define BST_MSG_TEXT3(...) BIRNET_MSG_TEXT3 (__VA_ARGS__)
-#define BST_MSG_CHECK(...) BIRNET_MSG_CHECK (__VA_ARGS__)
+#define BST_MSG_TEXT0(...) SFI_MSG_TEXT0 (__VA_ARGS__)
+#define BST_MSG_TEXT1(...) SFI_MSG_TEXT1 (__VA_ARGS__)
+#define BST_MSG_TEXT2(...) SFI_MSG_TEXT2 (__VA_ARGS__)
+#define BST_MSG_TEXT3(...) SFI_MSG_TEXT3 (__VA_ARGS__)
+#define BST_MSG_CHECK(...) SFI_MSG_CHECK (__VA_ARGS__)
#define BST_MSG_TITLE BST_MSG_TEXT0 /* alias */
#define BST_MSG_PRIMARY BST_MSG_TEXT1 /* alias */
#define BST_MSG_SECONDARY BST_MSG_TEXT2 /* alias */
Modified: trunk/beast-gtk/gxk/gxktexttools.c
===================================================================
--- trunk/beast-gtk/gxk/gxktexttools.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/beast-gtk/gxk/gxktexttools.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -19,7 +19,7 @@
#include "gxktexttools.h"
#include "gxkstock.h"
#include "gxkradget.h"
-#include "birnet/birnet.h" /* for birnet_url_show() */
+#include "sfi/sfiwrapper.h" /* for sfi_url_show() */
#include <gdk/gdkkeysyms.h>
#include <unistd.h>
#include <stdlib.h>
@@ -2301,7 +2301,7 @@
strncmp (uri, "https:", 6) == 0 ||
strncmp (uri, "mailto:", 7) == 0)
{
- birnet_url_show (uri);
+ sfi_url_show (uri);
return TRUE;
}
else
Modified: trunk/beast-gtk/testgui.c
===================================================================
--- trunk/beast-gtk/testgui.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/beast-gtk/testgui.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -100,7 +100,7 @@
/* initialize Sfi */
birnet_init (&argc, &argv, "TestGUI");
- birnet_msg_allow ("misc");
+ sfi_msg_allow ("misc");
/* ensure SFI can wake us up */
birnet_thread_set_name ("TestGUI");
birnet_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup, g_main_context_default (), NULL);
Modified: trunk/bse/bse.h
===================================================================
--- trunk/bse/bse.h 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bse.h 2006-10-06 16:55:46 UTC (rev 3937)
@@ -27,7 +27,7 @@
void bse_init_async (gint *argc,
gchar ***argv,
const char *app_name,
- BirnetInitValue values[]);
+ SfiInitValue values[]);
/* provide SFI glue layer context for BSE */
SfiGlueContext* bse_init_glue_context (const gchar *client);
Modified: trunk/bse/bseautodoc.c
===================================================================
--- trunk/bse/bseautodoc.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseautodoc.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -559,14 +559,14 @@
gboolean gen_objects = FALSE;
char pluginbool[2] = "0";
char scriptbool[2] = "0";
- BirnetInitValue config[] = {
+ SfiInitValue config[] = {
{ "load-core-plugins", pluginbool },
{ "load-core-scripts", scriptbool },
{ NULL },
};
g_thread_init (NULL);
- birnet_init (&argc, &argv, "BseAutoDoc");
+ sfi_init (&argc, &argv, "BseAutoDoc", NULL);
boxed_type_tag = g_quark_from_static_string ("bse-auto-doc-boxed-type-tag");
guint i;
Modified: trunk/bse/bsebiquadfilter.c
===================================================================
--- trunk/bse/bsebiquadfilter.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsebiquadfilter.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -21,7 +21,7 @@
#include <bse/bseengine.h>
#include <bse/bsemathsignal.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_biquadfilter, "biquadfilter", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_biquadfilter, "biquadfilter", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_biquadfilter, __VA_ARGS__)
#define FREQ_DELTA 0.1
Modified: trunk/bse/bseengine.c
===================================================================
--- trunk/bse/bseengine.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseengine.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -24,7 +24,7 @@
#include <unistd.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_engine, "engine", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_engine, "engine", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_engine, __VA_ARGS__)
/* some systems don't have ERESTART (which is what linux returns for system
Modified: trunk/bse/bseenginemaster.c
===================================================================
--- trunk/bse/bseenginemaster.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseenginemaster.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -29,9 +29,9 @@
#include <sys/time.h>
#include <errno.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_job, "job", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_job, "job", SFI_MSG_DEBUG, NULL);
#define JOB_DEBUG(...) sfi_debug (debug_job, __VA_ARGS__)
-static BIRNET_MSG_TYPE_DEFINE (debug_tjob, "tjob", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_tjob, "tjob", SFI_MSG_DEBUG, NULL);
#define TJOB_DEBUG(...) sfi_debug (debug_tjob, __VA_ARGS__)
#define NODE_FLAG_RECONNECT(node) G_STMT_START { /*(node)->needs_reset = TRUE*/; } G_STMT_END
@@ -1132,7 +1132,7 @@
void
bse_engine_master_thread (EngineMasterData *mdata)
{
- birnet_msg_set_thread_handler (bse_msg_handler);
+ sfi_msg_set_thread_handler (bse_msg_handler);
/* assert pollfd equality, since we're simply casting structures */
g_static_assert (sizeof (struct pollfd) == sizeof (GPollFD));
Modified: trunk/bse/bseengineschedule.c
===================================================================
--- trunk/bse/bseengineschedule.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseengineschedule.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -18,7 +18,7 @@
#include "bseengineschedule.h"
#include "bseengineutils.h"
-static BIRNET_MSG_TYPE_DEFINE (debug_sched, "sched", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_sched, "sched", SFI_MSG_DEBUG, NULL);
/* --- prototypes --- */
static void schedule_node (EngineSchedule *schedule,
@@ -304,7 +304,7 @@
sched->secured = TRUE;
sched->cur_leaf_level = sched->leaf_levels;
- if (birnet_msg_check (debug_sched))
+ if (sfi_msg_check (debug_sched))
_engine_schedule_debug_dump (sched);
}
Modified: trunk/bse/bsejanitor.proc
===================================================================
--- trunk/bse/bsejanitor.proc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsejanitor.proc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -394,7 +394,7 @@
const gchar *text2 = sfi_value_get_string (in_values++);
const gchar *text3 = sfi_value_get_string (in_values++);
const gchar *check = sfi_value_get_string (in_values++);
- BirnetMsgType type = mtype ? birnet_msg_type_lookup (mtype) : 0;
+ SfiMsgType type = mtype ? sfi_msg_type_lookup (mtype) : 0;
/* check parameters */
if (!mtype || !(text1 || text2))
Modified: trunk/bse/bseladspa.c
===================================================================
--- trunk/bse/bseladspa.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseladspa.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -23,7 +23,7 @@
#include "ladspa.h"
-static BIRNET_MSG_TYPE_DEFINE (debug_ladspa, "ladspa", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_ladspa, "ladspa", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_ladspa, __VA_ARGS__)
#define LADSPA_TYPE_NAME "BseLadspaModule_"
Modified: trunk/bse/bseloader-aiff.c
===================================================================
--- trunk/bse/bseloader-aiff.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseloader-aiff.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -33,7 +33,7 @@
*/
/* --- macros --- */
-static BIRNET_MSG_TYPE_DEFINE (debug_aiff, "aiff", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_aiff, "aiff", SFI_MSG_DEBUG, NULL);
#define AIFF_DEBUG(...) sfi_debug (debug_aiff, __VA_ARGS__)
#define AIFF_ULONG(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
#define AIFF_ID(str4) AIFF_ULONG (str4[0], str4[1], str4[2], str4[3])
Modified: trunk/bse/bseloader-bsewave.c
===================================================================
--- trunk/bse/bseloader-bsewave.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseloader-bsewave.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -32,7 +32,7 @@
if (g_scanner_get_next_token (scanner) != _t) \
return _t; \
}
-static BIRNET_MSG_TYPE_DEFINE (debug_bsewave, "bsewave", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_bsewave, "bsewave", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_bsewave, __VA_ARGS__)
Modified: trunk/bse/bseloader-guspatch.cc
===================================================================
--- trunk/bse/bseloader-guspatch.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseloader-guspatch.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -24,7 +24,7 @@
#include <string>
#undef WITH_GUSPATCH_XINFOS
-static BIRNET_MSG_TYPE_DEFINE (debug_guspatch, "guspatch", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_guspatch, "guspatch", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_guspatch, __VA_ARGS__)
using std::vector;
Modified: trunk/bse/bseloader-wav.c
===================================================================
--- trunk/bse/bseloader-wav.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseloader-wav.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -46,7 +46,7 @@
/* --- debugging and errors --- */
-static BIRNET_MSG_TYPE_DEFINE (debug_wav, "wav", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_wav, "wav", SFI_MSG_DEBUG, NULL);
#define WAV_DEBUG(...) sfi_debug (debug_wav, __VA_ARGS__)
Modified: trunk/bse/bsemain.c
===================================================================
--- trunk/bse/bsemain.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsemain.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -32,14 +32,14 @@
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
-#include <birnet/birnettests.h> /* birnet_test_setup() */
+#include <sfi/sfitests.h> /* sfti_test_init() */
/* --- prototypes --- */
static void bse_main_loop (gpointer data);
static void bse_async_parse_args (gint *argc_p,
gchar ***argv_p,
BseMainArgs *margs,
- BirnetInitValue values[]);
+ SfiInitValue values[]);
/* --- variables --- */
@@ -88,7 +88,7 @@
bse_init_async (gint *argc,
gchar ***argv,
const char *app_name,
- BirnetInitValue values[])
+ SfiInitValue values[])
{
BirnetThread *thread;
@@ -106,7 +106,7 @@
g_assert (G_BYTE_ORDER == G_LITTLE_ENDIAN || G_BYTE_ORDER == G_BIG_ENDIAN);
/* initialize submodules */
- birnet_init_extended (argc, argv, app_name, values);
+ sfi_init (argc, argv, app_name, values);
bse_main_args = &default_main_args;
bse_main_args->birnet = *birnet_init_settings;
@@ -213,7 +213,7 @@
bse_main_context = g_main_context_new ();
birnet_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup,
bse_main_context, NULL);
- birnet_msg_set_thread_handler (bse_msg_handler);
+ sfi_msg_set_thread_handler (bse_msg_handler);
/* initialize basic components */
bse_globals_init ();
@@ -290,7 +290,7 @@
bse_init_intern (gint *argc,
gchar ***argv,
const char *app_name,
- BirnetInitValue values[],
+ SfiInitValue values[],
bool as_test)
{
bse_init_textdomain_only();
@@ -305,7 +305,10 @@
g_assert (G_BYTE_ORDER == G_LITTLE_ENDIAN || G_BYTE_ORDER == G_BIG_ENDIAN);
/* initialize submodules */
- birnet_init_extended (argc, argv, app_name, values);
+ if (as_test)
+ sfi_init_test (argc, argv, values);
+ else
+ sfi_init (argc, argv, app_name, values);
bse_main_args = &default_main_args;
bse_main_args->birnet = *birnet_init_settings;
@@ -316,9 +319,6 @@
g_set_prgname (**argv);
bse_async_parse_args (argc, argv, bse_main_args, values);
}
- /* readily setup for test programs */
- if (as_test)
- birnet_test_setup();
bse_init_core ();
@@ -356,7 +356,7 @@
bse_init_inprocess (gint *argc,
gchar ***argv,
const char *app_name,
- BirnetInitValue values[])
+ SfiInitValue values[])
{
bse_init_intern (argc, argv, app_name, values, false);
}
@@ -364,7 +364,7 @@
void
bse_init_test (gint *argc,
gchar ***argv,
- BirnetInitValue values[])
+ SfiInitValue values[])
{
bse_init_intern (argc, argv, NULL, values, true);
}
@@ -413,11 +413,11 @@
}
/**
- * BSE log handler, suitable for birnet_msg_set_thread_handler().
+ * BSE log handler, suitable for sfi_msg_set_thread_handler().
* This function is MT-safe and may be called from any thread.
*/
void
-bse_msg_handler (const BirnetMessage *lmsg)
+bse_msg_handler (const SfiMessage *lmsg)
{
/* this functions is called from multiple threads */
if (!lmsg->primary && !lmsg->secondary)
@@ -425,14 +425,14 @@
BseMessage *umsg = bse_message_new();
g_free (umsg->log_domain);
umsg->log_domain = g_strdup (lmsg->log_domain);
- g_static_assert (BSE_MSG_NONE == BIRNET_MSG_NONE);
- g_static_assert (BSE_MSG_FATAL == BIRNET_MSG_FATAL);
- g_static_assert (BSE_MSG_ERROR == BIRNET_MSG_ERROR);
- g_static_assert (BSE_MSG_WARNING == BIRNET_MSG_WARNING);
- g_static_assert (BSE_MSG_SCRIPT == BIRNET_MSG_SCRIPT);
- g_static_assert (BSE_MSG_INFO == BIRNET_MSG_INFO);
- g_static_assert (BSE_MSG_DIAG == BIRNET_MSG_DIAG);
- g_static_assert (BSE_MSG_DEBUG == BIRNET_MSG_DEBUG);
+ g_static_assert (BSE_MSG_NONE == SFI_MSG_NONE);
+ g_static_assert (BSE_MSG_FATAL == SFI_MSG_FATAL);
+ g_static_assert (BSE_MSG_ERROR == SFI_MSG_ERROR);
+ g_static_assert (BSE_MSG_WARNING == SFI_MSG_WARNING);
+ g_static_assert (BSE_MSG_SCRIPT == SFI_MSG_SCRIPT);
+ g_static_assert (BSE_MSG_INFO == SFI_MSG_INFO);
+ g_static_assert (BSE_MSG_DIAG == SFI_MSG_DIAG);
+ g_static_assert (BSE_MSG_DEBUG == SFI_MSG_DEBUG);
umsg->type = lmsg->type;
g_free (umsg->config_check);
umsg->config_check = g_strdup (lmsg->config_check);
@@ -470,7 +470,7 @@
bse_async_parse_args (gint *argc_p,
gchar ***argv_p,
BseMainArgs *margs,
- BirnetInitValue values[])
+ SfiInitValue values[])
{
guint argc = *argc_p;
gchar **argv = *argv_p;
@@ -481,10 +481,10 @@
gchar *envar = getenv ("BSE_DEBUG");
if (envar)
- birnet_msg_allow (envar);
+ sfi_msg_allow (envar);
envar = getenv ("BSE_NO_DEBUG");
if (envar)
- birnet_msg_deny (envar);
+ sfi_msg_deny (envar);
guint i;
for (i = 1; i < argc; i++)
@@ -501,11 +501,11 @@
{
gchar *equal = argv[i] + 11;
if (*equal == '=')
- birnet_msg_allow (equal + 1);
+ sfi_msg_allow (equal + 1);
else if (i + 1 < argc)
{
argv[i++] = NULL;
- birnet_msg_allow (argv[i]);
+ sfi_msg_allow (argv[i]);
}
argv[i] = NULL;
}
@@ -514,11 +514,11 @@
{
gchar *equal = argv[i] + 14;
if (*equal == '=')
- birnet_msg_deny (equal + 1);
+ sfi_msg_deny (equal + 1);
else if (i + 1 < argc)
{
argv[i++] = NULL;
- birnet_msg_deny (argv[i]);
+ sfi_msg_deny (argv[i]);
}
argv[i] = NULL;
}
@@ -634,29 +634,29 @@
if (values)
{
- BirnetInitValue *value = values;
+ SfiInitValue *value = values;
while (value->value_name)
{
if (strcmp (value->value_name, "debug-extensions") == 0)
- margs->debug_extensions |= birnet_init_value_bool (value);
+ margs->debug_extensions |= sfi_init_value_bool (value);
else if (strcmp (value->value_name, "force-fpu") == 0)
- margs->force_fpu |= birnet_init_value_bool (value);
+ margs->force_fpu |= sfi_init_value_bool (value);
else if (strcmp (value->value_name, "load-core-plugins") == 0)
- margs->load_core_plugins |= birnet_init_value_bool (value);
+ margs->load_core_plugins |= sfi_init_value_bool (value);
else if (strcmp (value->value_name, "load-core-scripts") == 0)
- margs->load_core_scripts |= birnet_init_value_bool (value);
+ margs->load_core_scripts |= sfi_init_value_bool (value);
else if (strcmp ("wave-chunk-padding", value->value_name) == 0)
- margs->wave_chunk_padding = birnet_init_value_int (value);
+ margs->wave_chunk_padding = sfi_init_value_int (value);
else if (strcmp ("wave-chunk-big-pad", value->value_name) == 0)
- margs->wave_chunk_big_pad = birnet_init_value_int (value);
+ margs->wave_chunk_big_pad = sfi_init_value_int (value);
else if (strcmp ("dcache-cache-memory", value->value_name) == 0)
- margs->dcache_cache_memory = birnet_init_value_int (value);
+ margs->dcache_cache_memory = sfi_init_value_int (value);
else if (strcmp ("dcache-block-size", value->value_name) == 0)
- margs->dcache_block_size = birnet_init_value_int (value);
+ margs->dcache_block_size = sfi_init_value_int (value);
else if (strcmp ("midi-kammer-note", value->value_name) == 0)
- margs->midi_kammer_note = birnet_init_value_int (value);
+ margs->midi_kammer_note = sfi_init_value_int (value);
else if (strcmp ("kammer-freq", value->value_name) == 0)
- margs->kammer_freq = birnet_init_value_double (value);
+ margs->kammer_freq = sfi_init_value_double (value);
value++;
}
}
Modified: trunk/bse/bsemain.h
===================================================================
--- trunk/bse/bsemain.h 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsemain.h 2006-10-06 16:55:46 UTC (rev 3937)
@@ -29,7 +29,7 @@
void bse_init_async (gint *argc,
gchar ***argv,
const char *app_name,
- BirnetInitValue values[]);
+ SfiInitValue values[]);
SfiGlueContext* bse_init_glue_context (const gchar *client);
gchar* bse_check_version (guint required_major,
guint required_minor,
@@ -39,16 +39,16 @@
void bse_init_inprocess (gint *argc,
gchar ***argv,
const char *app_name,
- BirnetInitValue values[]);
+ SfiInitValue values[]);
void bse_init_test (gint *argc,
gchar ***argv,
- BirnetInitValue values[]);
+ SfiInitValue values[]);
/* BSE thread pid (or 0) */
guint bse_main_getpid (void);
/* MT-safe log handler */
-void bse_msg_handler (const BirnetMessage *message);
+void bse_msg_handler (const SfiMessage *message);
/* --- global macros --- */
#define BSE_THREADS_ENTER() // bse_main_global_lock ()
Modified: trunk/bse/bsemididecoder.c
===================================================================
--- trunk/bse/bsemididecoder.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsemididecoder.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -20,7 +20,7 @@
#include "bseengine.h"
#include <string.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_midi_decoder, "midi-decoder", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_midi_decoder, "midi-decoder", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_midi_decoder, __VA_ARGS__)
/* --- prototypes --- */
Modified: trunk/bse/bsemididevice-null.c
===================================================================
--- trunk/bse/bsemididevice-null.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsemididevice-null.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -19,7 +19,7 @@
#include "bseserver.h"
-static BIRNET_MSG_TYPE_DEFINE (debug_midi, "midi", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_midi, "midi", SFI_MSG_DEBUG, NULL);
#define MIDI_DEBUG(...) sfi_debug (debug_midi, __VA_ARGS__)
/* --- structs --- */
Modified: trunk/bse/bsemididevice-oss.c
===================================================================
--- trunk/bse/bsemididevice-oss.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsemididevice-oss.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -39,7 +39,7 @@
#include <string.h>
#include <fcntl.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_midi, "midi", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_midi, "midi", SFI_MSG_DEBUG, NULL);
#define MIDI_DEBUG(...) sfi_debug (debug_midi, __VA_ARGS__)
Modified: trunk/bse/bsemidifile.c
===================================================================
--- trunk/bse/bsemidifile.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsemidifile.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -26,7 +26,7 @@
#include <string.h>
#include <errno.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_midi_file, "midi-file", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_midi_file, "midi-file", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_midi_file, __VA_ARGS__)
typedef struct {
Modified: trunk/bse/bsemidireceiver.cc
===================================================================
--- trunk/bse/bsemidireceiver.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsemidireceiver.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -33,9 +33,9 @@
using namespace Birnet;
using namespace std;
-static BIRNET_MSG_TYPE_DEFINE (debug_midi_receiver, "midi-receiver", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_midi_receiver, "midi-receiver", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_midi_receiver, __VA_ARGS__)
-static BIRNET_MSG_TYPE_DEFINE (debug_midi_events, "midi-events", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_midi_events, "midi-events", SFI_MSG_DEBUG, NULL);
#define DEBUG_EVENTS(...) sfi_debug (debug_midi_events, __VA_ARGS__)
/* --- variables --- */
Modified: trunk/bse/bseobject.c
===================================================================
--- trunk/bse/bseobject.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseobject.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -25,7 +25,7 @@
#include "bsesource.h" /* debug hack */
#include <string.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_leaks, "leaks", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_leaks, "leaks", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_leaks, __VA_ARGS__)
enum
@@ -64,7 +64,7 @@
void
bse_object_debug_leaks (void)
{
- if (birnet_msg_check (debug_leaks))
+ if (sfi_msg_check (debug_leaks))
{
GList *list, *objects = bse_objects_list (BSE_TYPE_OBJECT);
Modified: trunk/bse/bsepcmdevice-null.c
===================================================================
--- trunk/bse/bsepcmdevice-null.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsepcmdevice-null.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -20,7 +20,7 @@
#include "bseengine.h"
#include <string.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_pcm, "pcm", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_pcm, "pcm", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_pcm, __VA_ARGS__)
typedef struct
Modified: trunk/bse/bsepcmdevice-oss.c
===================================================================
--- trunk/bse/bsepcmdevice-oss.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsepcmdevice-oss.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -47,7 +47,7 @@
#error unsupported byte order in G_BYTE_ORDER
#endif
-static BIRNET_MSG_TYPE_DEFINE (debug_pcm, "pcm", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_pcm, "pcm", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_pcm, __VA_ARGS__)
Modified: trunk/bse/bseplugin.c
===================================================================
--- trunk/bse/bseplugin.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseplugin.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -22,6 +22,7 @@
#include "bseobject.h"
#include "bseenums.h"
#include "bsemain.h"
+#include <birnet/birnetcpu.h>
#include <gmodule.h>
#include <string.h>
#include <fcntl.h>
@@ -29,7 +30,7 @@
#include <unistd.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_plugins, "plugins", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_plugins, "plugins", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_plugins, __VA_ARGS__)
Modified: trunk/bse/bseprocedure.c
===================================================================
--- trunk/bse/bseprocedure.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseprocedure.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -24,7 +24,7 @@
#include "bseexports.h"
#include <string.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_procs, "procs", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_procs, "procs", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_procs, __VA_ARGS__)
/* --- macros --- */
@@ -266,7 +266,7 @@
error = BSE_ERROR_PROC_PARAM_INVAL;
else
{
- if (birnet_msg_check (debug_procs))
+ if (sfi_msg_check (debug_procs))
{
if (proc->n_in_pspecs && G_TYPE_IS_OBJECT (G_PARAM_SPEC_VALUE_TYPE (proc->in_pspecs[0])))
DEBUG ("executing procedure \"%s\" on object %s",
Modified: trunk/bse/bsequery.c
===================================================================
--- trunk/bse/bsequery.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsequery.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -217,7 +217,7 @@
gchar *iindent = "";
char pluginbool[2] = "0";
char scriptbool[2] = "0";
- BirnetInitValue config[] = {
+ SfiInitValue config[] = {
{ "load-core-plugins", pluginbool },
{ "load-core-scripts", scriptbool },
{ NULL },
@@ -227,7 +227,7 @@
g_thread_init (NULL);
- birnet_init (&argc, &argv, "BseQuery");
+ sfi_init (&argc, &argv, "BseQuery", NULL);
guint i;
for (i = 1; i < argc; i++)
Modified: trunk/bse/bseresamplerimpl.hh
===================================================================
--- trunk/bse/bseresamplerimpl.hh 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseresamplerimpl.hh 2006-10-06 16:55:46 UTC (rev 3937)
@@ -21,7 +21,7 @@
#include <vector>
#include <bse/bseresampler.hh>
-#include <birnet/birnet.h>
+#include <birnet/birnet.hh>
#include <math.h>
#ifdef __SSE__
#include <xmmintrin.h>
@@ -162,7 +162,7 @@
allocate_aligned_data()
{
g_assert ((ALIGN % sizeof (T)) == 0);
- data = reinterpret_cast<T *> (birnet_malloc_aligned (n_elements * sizeof (T), ALIGN, &unaligned_mem));
+ data = reinterpret_cast<T *> (Birnet::malloc_aligned (n_elements * sizeof (T), ALIGN, &unaligned_mem));
}
/* no copy constructor and no assignment operator */
BIRNET_PRIVATE_CLASS_COPY (AlignedArray);
Modified: trunk/bse/bsesequencer.cc
===================================================================
--- trunk/bse/bsesequencer.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsesequencer.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -39,7 +39,7 @@
using namespace std;
-static BIRNET_MSG_TYPE_DEFINE (debug_sequencer, "sequencer", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_sequencer, "sequencer", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_sequencer, __VA_ARGS__)
#define BSE_SEQUENCER_FUTURE_BLOCKS (7)
@@ -406,7 +406,7 @@
{
DEBUG ("SST: start\n");
birnet_thread_set_wakeup (sequencer_wake_up, NULL, NULL);
- birnet_msg_set_thread_handler (bse_msg_handler);
+ sfi_msg_set_thread_handler (bse_msg_handler);
BSE_SEQUENCER_LOCK ();
do
{
Modified: trunk/bse/bseserver.c
===================================================================
--- trunk/bse/bseserver.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseserver.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -449,19 +449,19 @@
{
server->pcm_input_checked = TRUE;
if (!BSE_DEVICE_READABLE (server->pcm_device))
- birnet_msg_log (BIRNET_MSG_WARNING,
- BIRNET_MSG_TITLE (_("Recording Audio Input")),
- BIRNET_MSG_TEXT1 (_("Failed to start recording from audio device.")),
- BIRNET_MSG_TEXT2 (_("An audio project is in use which processes an audio input signal, but the audio device "
+ sfi_msg_log (SFI_MSG_WARNING,
+ SFI_MSG_TITLE (_("Recording Audio Input")),
+ SFI_MSG_TEXT1 (_("Failed to start recording from audio device.")),
+ SFI_MSG_TEXT2 (_("An audio project is in use which processes an audio input signal, but the audio device "
"has not been opened in recording mode. "
"An audio signal of silence will be used instead of a recorded signal, "
"so playback operation may produce results not actually intended "
"(such as a silent output signal).")),
- BIRNET_MSG_TEXT3 (_("Audio device \"%s\" is not open for input, audio driver: %s=%s"),
+ SFI_MSG_TEXT3 (_("Audio device \"%s\" is not open for input, audio driver: %s=%s"),
BSE_DEVICE (server->pcm_device)->open_device_name,
BSE_DEVICE_GET_CLASS (server->pcm_device)->driver_name,
BSE_DEVICE (server->pcm_device)->open_device_args),
- BIRNET_MSG_CHECK (_("Show messages about audio input problems")));
+ SFI_MSG_CHECK (_("Show messages about audio input problems")));
}
}
@@ -502,13 +502,13 @@
bse_main_args->pcm_drivers,
pcm_request_callback, &pr, error ? NULL : &error);
if (!server->pcm_device)
- birnet_msg_log (BIRNET_MSG_ERROR,
- BIRNET_MSG_TITLE (_("No Audio")),
- BIRNET_MSG_TEXT1 (_("No available audio device was found.")),
- BIRNET_MSG_TEXT2 (_("No available audio device could be found and opened successfully. "
+ sfi_msg_log (SFI_MSG_ERROR,
+ SFI_MSG_TITLE (_("No Audio")),
+ SFI_MSG_TEXT1 (_("No available audio device was found.")),
+ SFI_MSG_TEXT2 (_("No available audio device could be found and opened successfully. "
"Sorry, no fallback selection can be made for audio devices, giving up.")),
- BIRNET_MSG_TEXT3 (_("Failed to open PCM devices: %s"), bse_error_blurb (error)),
- BIRNET_MSG_CHECK (_("Show messages about PCM device selections problems")));
+ SFI_MSG_TEXT3 (_("Failed to open PCM devices: %s"), bse_error_blurb (error)),
+ SFI_MSG_CHECK (_("Show messages about PCM device selections problems")));
server->pcm_input_checked = FALSE;
return server->pcm_device ? BSE_ERROR_NONE : error;
}
@@ -526,13 +526,13 @@
server->midi_device = (BseMidiDevice*) bse_device_open_best (BSE_TYPE_MIDI_DEVICE_NULL, TRUE, FALSE, ring, NULL, NULL, NULL);
sfi_ring_free (ring);
if (server->midi_device)
- birnet_msg_log (BIRNET_MSG_WARNING,
- BIRNET_MSG_TITLE (_("No MIDI")),
- BIRNET_MSG_TEXT1 (_("MIDI input or oputput is not available.")),
- BIRNET_MSG_TEXT2 (_("No available MIDI device could be found and opened successfully. "
+ sfi_msg_log (SFI_MSG_WARNING,
+ SFI_MSG_TITLE (_("No MIDI")),
+ SFI_MSG_TEXT1 (_("MIDI input or oputput is not available.")),
+ SFI_MSG_TEXT2 (_("No available MIDI device could be found and opened successfully. "
"Reverting to null device, no MIDI events will be received or sent.")),
- BIRNET_MSG_TEXT3 (_("Failed to open MIDI devices: %s"), bse_error_blurb (error)),
- BIRNET_MSG_CHECK (_("Show messages about MIDI device selections problems")));
+ SFI_MSG_TEXT3 (_("Failed to open MIDI devices: %s"), bse_error_blurb (error)),
+ SFI_MSG_CHECK (_("Show messages about MIDI device selections problems")));
}
return server->midi_device ? BSE_ERROR_NONE : error;
}
@@ -582,13 +582,13 @@
error = bse_pcm_writer_open (self->pcm_writer, self->wave_file, 2, bse_engine_sample_freq ());
if (error)
{
- birnet_msg_log (BIRNET_MSG_ERROR,
- BIRNET_MSG_TITLE (_("Start Disk Recording")),
- BIRNET_MSG_TEXT1 (_("Failed to start recording to disk.")),
- BIRNET_MSG_TEXT2 (_("An error occoured while opening the recording file, selecting a different "
+ sfi_msg_log (SFI_MSG_ERROR,
+ SFI_MSG_TITLE (_("Start Disk Recording")),
+ SFI_MSG_TEXT1 (_("Failed to start recording to disk.")),
+ SFI_MSG_TEXT2 (_("An error occoured while opening the recording file, selecting a different "
"file might fix this situation.")),
- BIRNET_MSG_TEXT3 (_("Failed to open file \"%s\" for output: %s"), self->wave_file, bse_error_blurb (error)),
- BIRNET_MSG_CHECK (_("Show recording file errors")));
+ SFI_MSG_TEXT3 (_("Failed to open file \"%s\" for output: %s"), self->wave_file, bse_error_blurb (error)),
+ SFI_MSG_CHECK (_("Show recording file errors")));
g_object_unref (self->pcm_writer);
self->pcm_writer = NULL;
}
@@ -761,7 +761,7 @@
g_signal_emit (self, signal_message, 0, umsg);
if (self->log_messages)
{
- BirnetMessage lmsg = { 0, };
+ SfiMessage lmsg = { 0, };
lmsg.log_domain = umsg->log_domain;
lmsg.type = umsg->type;
lmsg.title = umsg->title;
@@ -769,7 +769,7 @@
lmsg.secondary = umsg->secondary;
lmsg.details = umsg->details;
lmsg.config_check = umsg->config_check;
- birnet_msg_default_handler (&lmsg);
+ sfi_msg_default_handler (&lmsg);
}
}
@@ -792,8 +792,8 @@
BseMessage umsg = { 0, };
umsg.log_domain = (char*) log_domain;
umsg.type = msg_type;
- umsg.ident = (char*) birnet_msg_type_ident (msg_type);
- umsg.label = (char*) birnet_msg_type_label (msg_type);
+ umsg.ident = (char*) sfi_msg_type_ident (msg_type);
+ umsg.label = (char*) sfi_msg_type_label (msg_type);
umsg.title = (char*) title;
umsg.primary = (char*) primary;
umsg.secondary = (char*) secondary;
Modified: trunk/bse/bsetrack.c
===================================================================
--- trunk/bse/bsetrack.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bsetrack.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -33,7 +33,7 @@
#include "bsewaverepo.h"
#include <string.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_xref, "xref", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_xref, "xref", SFI_MSG_DEBUG, NULL);
#define XREF_DEBUG(...) sfi_debug (debug_xref, __VA_ARGS__)
#define upper_power2(uint_n) sfi_alloc_upper_power2 (MAX ((uint_n), 4))
Modified: trunk/bse/bseundostack.c
===================================================================
--- trunk/bse/bseundostack.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/bseundostack.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -20,7 +20,7 @@
#include "bsecontainer.h"
#include <string.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_undo, "undo", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_undo, "undo", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_undo, __VA_ARGS__)
/* --- variables --- */
@@ -332,7 +332,7 @@
self->n_undo_groups--;
self->dirt_counter--;
DEBUG ("EXECUTE UNDO: %s", group->name);
- if (birnet_msg_check (debug_undo))
+ if (sfi_msg_check (debug_undo))
{
SfiRing *ring = group->undo_steps;
for (ring = group->undo_steps; ring; ring = sfi_ring_walk (ring, group->undo_steps))
Modified: trunk/bse/gsldatahandle-mad.c
===================================================================
--- trunk/bse/gsldatahandle-mad.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/gsldatahandle-mad.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -38,7 +38,7 @@
/* --- debugging and errors --- */
-static BIRNET_MSG_TYPE_DEFINE (debug_mad, "mad", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_mad, "mad", SFI_MSG_DEBUG, NULL);
#define MAD_DEBUG(...) sfi_debug (debug_mad, __VA_ARGS__)
Modified: trunk/bse/gslosctable.c
===================================================================
--- trunk/bse/gslosctable.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/gslosctable.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -24,7 +24,7 @@
#include <sfi/gbsearcharray.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_osc, "osc", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_osc, "osc", SFI_MSG_DEBUG, NULL);
#define OSC_DEBUG(...) sfi_debug (debug_osc, __VA_ARGS__)
#define OSC_FREQ_EPSILON (1e-3) /* range within which frequencies are "equal" */
Modified: trunk/bse/gslvorbis-cutter.c
===================================================================
--- trunk/bse/gslvorbis-cutter.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/gslvorbis-cutter.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -22,7 +22,7 @@
#include <string.h>
#include <errno.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_vorbis, "vorbis", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_vorbis, "vorbis", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_vorbis, __VA_ARGS__)
#define DIAG(...) sfi_diag (__VA_ARGS__)
Modified: trunk/bse/gslvorbis-enc.c
===================================================================
--- trunk/bse/gslvorbis-enc.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/gslvorbis-enc.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -24,7 +24,7 @@
#include <string.h>
#include <errno.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_vorbisenc, "vorbisenc", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_vorbisenc, "vorbisenc", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_vorbisenc, __VA_ARGS__)
/* --- structures --- */
Modified: trunk/bse/gslwaveosc.c
===================================================================
--- trunk/bse/gslwaveosc.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/gslwaveosc.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -23,7 +23,7 @@
#include "bsemain.h"
#include <string.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_waveosc, "waveosc", BIRNET_MSG_DEBUG, NULL);
+static SFI_MSG_TYPE_DEFINE (debug_waveosc, "waveosc", SFI_MSG_DEBUG, NULL);
#define DEBUG(...) sfi_debug (debug_waveosc, __VA_ARGS__)
#define FRAC_SHIFT (16)
Modified: trunk/bse/tests/blocktests.cc
===================================================================
--- trunk/bse/tests/blocktests.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/tests/blocktests.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -584,7 +584,7 @@
run_tests(); /* run tests on FPU */
/* load plugins */
- BirnetInitValue config[] = {
+ SfiInitValue config[] = {
{ "load-core-plugins", "1" },
{ NULL },
};
Modified: trunk/bse/tests/loophandle.c
===================================================================
--- trunk/bse/tests/loophandle.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/tests/loophandle.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -208,7 +208,7 @@
/* init bse */
bse_init_test (&argc, &argv, NULL);
- birnet_msg_allow ("misc");
+ sfi_msg_allow ("misc");
/* test loophandle against the reference implementation */
GslDataHandle *mem_handle = gsl_data_handle_new_mem (n_channels, 32, 44100, 440, n_values, values, NULL /* don't free */);
Modified: trunk/bse/tests/resamplehandle.cc
===================================================================
--- trunk/bse/tests/resamplehandle.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/bse/tests/resamplehandle.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -281,7 +281,7 @@
run_tests ("FPU");
/* load plugins */
- BirnetInitValue config[] = {
+ SfiInitValue config[] = {
{ "load-core-plugins", "1" },
{ NULL },
};
Modified: trunk/sfi/ChangeLog
===================================================================
--- trunk/sfi/ChangeLog 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/ChangeLog 2006-10-06 16:55:46 UTC (rev 3937)
@@ -1,3 +1,12 @@
+Fri Oct 6 18:53:35 2006 Tim Janik <timj gtk org>
+
+ * sfimsg.h, sfimsg.c: renamed and moved here from birnet/.
+ changed callers.
+
+ * sficxx.cc: don't shadow "sfi_init" symbol.
+
+ * sfitypes.h: removed portions covered by sfimsg.h.
+
Tue Oct 3 18:44:43 2006 Tim Janik <timj gtk org>
* moved remaining sfi/ tests to sfi/tests.
Modified: trunk/sfi/Makefile.am
===================================================================
--- trunk/sfi/Makefile.am 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/Makefile.am 2006-10-06 16:55:46 UTC (rev 3937)
@@ -10,7 +10,7 @@
sfi_public_headers = $(strip \
sfistore.h sficomwire.h sfifilecrawler.h \
- glib-extra.h \
+ glib-extra.h sfimsg.h sfiwrapper.h \
sfivmarshal.h sfiglue.h sfigluecodec.h sfiglueproxy.h \
sfinote.h sfiparams.h sfiprimitives.h sfiserial.h \
sfitime.h sfitypes.h sfivalues.h sfiustore.h \
@@ -19,7 +19,7 @@
)
sfi_all_sources = $(strip \
sfistore.c sficomwire.c sfifilecrawler.c \
- glib-extra.c \
+ glib-extra.c sfimsg.c sfiwrapper.cc \
sfivmarshal.c sfiglue.c sfigluecodec.c sfiglueproxy.c \
sfinote.c sfiparams.c sfiprimitives.c sfiserial.c \
sfitime.c sfitypes.c sfivalues.c sfiustore.c \
Modified: trunk/sfi/sfi.h
===================================================================
--- trunk/sfi/sfi.h 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sfi.h 2006-10-06 16:55:46 UTC (rev 3937)
@@ -26,6 +26,7 @@
#include <sfi/sfigluecodec.h>
#include <sfi/sfiglueproxy.h>
#include <sfi/sfimemory.h>
+#include <sfi/sfimsg.h>
#include <sfi/sfinote.h>
#include <sfi/sfiparams.h>
#include <sfi/sfiprimitives.h>
@@ -38,6 +39,7 @@
#include <sfi/sfiustore.h>
#include <sfi/sfivalues.h>
#include <sfi/sfivmarshal.h>
+#include <sfi/sfiwrapper.h>
#endif /* __SFI_H__ */
Modified: trunk/sfi/sficomport.c
===================================================================
--- trunk/sfi/sficomport.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sficomport.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -20,6 +20,7 @@
#include "sfiprimitives.h"
#include "sfiserial.h"
#include "sfistore.h"
+#include "sfimsg.h"
#include <errno.h>
#include <unistd.h>
#include <string.h>
@@ -30,8 +31,8 @@
#include <sys/types.h>
#include <sys/wait.h>
-static BIRNET_MSG_TYPE_DEFINE (debug_comport, "comport", BIRNET_MSG_DEBUG, NULL);
-#define DEBUG(...) birnet_debug (debug_comport, __VA_ARGS__)
+static SFI_MSG_TYPE_DEFINE (debug_comport, "comport", SFI_MSG_DEBUG, NULL);
+#define DEBUG(...) sfi_debug (debug_comport, __VA_ARGS__)
#define MASS_DEBUG(...) // DEBUG (__VA_ARGS__) // log every communicated value
/* define the io bottle neck (for writes) to a small value
Modified: trunk/sfi/sficxx.cc
===================================================================
--- trunk/sfi/sficxx.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sficxx.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -22,7 +22,7 @@
namespace Sfi {
static void
-sfi_init (void)
+sfi_init_cxx (void)
{
g_type_init (); /* just in case this hasn't been called already */
@@ -33,7 +33,7 @@
_sfi_init_file_crawler ();
}
-static Birnet::InitHook sfi_init_hook (sfi_init);
+static Birnet::InitHook sfi_init_hook (sfi_init_cxx);
} // Sfi
Modified: trunk/sfi/sficxx.hh
===================================================================
--- trunk/sfi/sficxx.hh 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sficxx.hh 2006-10-06 16:55:46 UTC (rev 3937)
@@ -19,7 +19,7 @@
#ifndef __SFI_CXX_H__
#define __SFI_CXX_H__
-#include <birnet/birnet.h>
+#include <birnet/birnet.hh>
#include <sfi/sfi.h>
#include <string>
#include <new>
Modified: trunk/sfi/sfifilecrawler.c
===================================================================
--- trunk/sfi/sfifilecrawler.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sfifilecrawler.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -18,6 +18,7 @@
*/
#include "sfifilecrawler.h"
#include "sfiprimitives.h"
+#include "sfiwrapper.h"
#include "topconfig.h"
#include <string.h>
#include <sys/types.h>
Modified: trunk/sfi/sfiglue.c
===================================================================
--- trunk/sfi/sfiglue.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sfiglue.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -20,6 +20,7 @@
#include "sfiparams.h"
#include "sfiglueproxy.h"
#include "sfiustore.h"
+#include "sfimsg.h"
#include <string.h>
#include <gobject/gvaluecollector.h>
Modified: trunk/sfi/sfigluecodec.c
===================================================================
--- trunk/sfi/sfigluecodec.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sfigluecodec.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -20,7 +20,7 @@
#define G_LOG_DOMAIN "SFI-GLUE"
#include "sfigluecodec.h"
#include "sfiglueproxy.h"
-#include <string.h>
+#include "sfimsg.h"
/* --- prototypes --- */
Modified: trunk/sfi/sfiglueproxy.c
===================================================================
--- trunk/sfi/sfiglueproxy.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sfiglueproxy.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -19,6 +19,7 @@
#include <string.h>
#include "sfiglueproxy.h"
#include "sfiglue.h"
+#include "sfimsg.h"
#include "sfiustore.h"
#include "sfivmarshal.h"
#include <gobject/gvaluecollector.h>
@@ -26,9 +27,9 @@
/* --- macros --- */
-static BIRNET_MSG_TYPE_DEFINE (debug_signals, "signals", BIRNET_MSG_DEBUG, NULL);
-#define SIGNAL_DEBUG(...) birnet_debug (debug_signals, __VA_ARGS__)
-#define sfi_proxy_warn_inval(where,proxy) birnet_diag ("%s: invalid proxy id (%lu)", (where), (proxy))
+static SFI_MSG_TYPE_DEFINE (debug_signals, "signals", SFI_MSG_DEBUG, NULL);
+#define SIGNAL_DEBUG(...) sfi_debug (debug_signals, __VA_ARGS__)
+#define sfi_proxy_warn_inval(where,proxy) sfi_diag ("%s: invalid proxy id (%lu)", (where), (proxy))
/* --- structures --- */
Copied: trunk/sfi/sfimsg.c (from rev 3931, trunk/birnet/birnetmsg.c)
===================================================================
--- trunk/birnet/birnetmsg.c 2006-10-03 17:04:26 UTC (rev 3931)
+++ trunk/sfi/sfimsg.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -0,0 +1,820 @@
+/* SfiMsg
+ * Copyright (C) 2002-2006 Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "sfimsg.h"
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <syslog.h>
+
+#ifndef _ // FIXME
+#define _(x) x
+#endif
+
+typedef struct {
+ gchar *ident;
+ gchar *label;
+ SfiMsgType default_type;
+ SfiMsgLogFlags log_flags : 16;
+ guint disabled : 1;
+} MsgType;
+
+
+/* --- variables --- */
+static BirnetMutex logging_mutex;
+static GQuark quark_log_handler = 0;
+static GQuark quark_msg_bits = 0;
+static guint n_msg_types = 0;
+static MsgType *msg_types = NULL;
+guint8 * volatile sfi_msg_flags = NULL;
+volatile guint sfi_msg_flags_max = 0;
+static guint stdlog_syslog_priority = 0; // LOG_USER | LOG_INFO;
+static bool stdlog_to_stderr = TRUE;
+static FILE *stdlog_file = NULL;
+
+/* --- prototypoes --- */
+static void sfi_log_msg_process (const SfiMessage *msgp);
+static void sfi_msg_type_set (SfiMsgType mtype,
+ SfiMsgLogFlags log_flags,
+ bool enabled);
+
+/* --- functions --- */
+static void
+sfi_msg_type_init_internals (void)
+{
+ static volatile guint initialized = FALSE;
+ if (initialized || !birnet_atomic_uint_compare_and_swap (&initialized, FALSE, TRUE))
+ return;
+ guint mtype;
+ /* SFI_MSG_NONE (always disabled) */
+ mtype = sfi_msg_type_register ("none", 0, NULL);
+ g_assert (mtype == SFI_MSG_NONE);
+ sfi_msg_type_set (SFI_MSG_NONE, 0, FALSE);
+ /* SFI_MSG_FATAL (always enabled) */
+ mtype = sfi_msg_type_register ("fatal", 1, _("Fatal Error"));
+ g_assert (mtype == SFI_MSG_FATAL);
+ sfi_msg_type_set (SFI_MSG_FATAL, SFI_MSG_TO_STDERR | SFI_MSG_TO_STDLOG | SFI_MSG_TO_HANDLER, TRUE);
+ /* SFI_MSG_ERROR (enabled) */
+ mtype = sfi_msg_type_register ("error", 1, _("Error"));
+ g_assert (mtype == SFI_MSG_ERROR);
+ sfi_msg_type_set (SFI_MSG_ERROR, SFI_MSG_TO_STDERR | SFI_MSG_TO_STDLOG | SFI_MSG_TO_HANDLER, TRUE);
+ /* SFI_MSG_WARNING (enabled) */
+ mtype = sfi_msg_type_register ("warning", 1, _("Warning"));
+ g_assert (mtype == SFI_MSG_WARNING);
+ sfi_msg_type_set (SFI_MSG_WARNING, SFI_MSG_TO_STDERR | SFI_MSG_TO_STDLOG | SFI_MSG_TO_HANDLER, TRUE);
+ /* SFI_MSG_SCRIPT (enabled) */
+ mtype = sfi_msg_type_register ("script", 1, _("Script"));
+ g_assert (mtype == SFI_MSG_SCRIPT);
+ sfi_msg_type_set (SFI_MSG_SCRIPT, SFI_MSG_TO_STDERR | SFI_MSG_TO_STDLOG | SFI_MSG_TO_HANDLER, TRUE);
+ /* SFI_MSG_INFO (enabled) */
+ mtype = sfi_msg_type_register ("info", 1, _("Information"));
+ g_assert (mtype == SFI_MSG_INFO);
+ sfi_msg_type_set (SFI_MSG_INFO, SFI_MSG_TO_STDERR | SFI_MSG_TO_STDLOG | SFI_MSG_TO_HANDLER, TRUE);
+ /* SFI_MSG_DIAG (enabled) */
+ mtype = sfi_msg_type_register ("diag", 1, _("Diagnostic"));
+ g_assert (mtype == SFI_MSG_DIAG);
+ sfi_msg_type_set (SFI_MSG_DIAG, SFI_MSG_TO_STDERR | SFI_MSG_TO_STDLOG, TRUE);
+ /* SFI_MSG_DEBUG (disabled) */
+ mtype = sfi_msg_type_register ("debug", 0, "Debug");
+ g_assert (mtype == SFI_MSG_DEBUG);
+ sfi_msg_type_set (SFI_MSG_DEBUG, SFI_MSG_TO_STDERR, FALSE);
+}
+
+void
+_sfi_init_logging (void)
+{
+ g_assert (quark_log_handler == 0);
+ quark_log_handler = g_quark_from_static_string ("SfiMsgHandler");
+ quark_msg_bits = g_quark_from_static_string ("SfiMsgBit-threadlist");
+ birnet_mutex_init (&logging_mutex);
+ sfi_msg_type_init_internals();
+}
+
+static inline void
+msg_type_set_intern (SfiMsgType mtype,
+ SfiMsgLogFlags log_flags,
+ bool enabled,
+ bool uncouple_default)
+{
+ if (mtype < n_msg_types)
+ {
+ msg_types[mtype].log_flags = log_flags;
+ msg_types[mtype].disabled = !enabled;
+ enabled = msg_types[mtype].log_flags && !msg_types[mtype].disabled;
+ if (enabled)
+ sfi_msg_flags[mtype / 8] |= 1 << mtype % 8;
+ else
+ sfi_msg_flags[mtype / 8] &= ~(1 << mtype % 8);
+ if (uncouple_default)
+ msg_types[mtype].default_type = mtype;
+ }
+}
+
+static void
+sfi_msg_type_set (SfiMsgType mtype,
+ SfiMsgLogFlags log_flags,
+ bool enabled)
+{
+ msg_type_set_intern (mtype, log_flags, enabled, TRUE);
+ guint i;
+ for (i = mtype + 1; i < n_msg_types; i++)
+ if (msg_types[i].default_type == mtype)
+ msg_type_set_intern (mtype, log_flags, enabled, FALSE);
+}
+
+/**
+ * @param ident message identifier
+ * @param default_ouput an existing SfiMsgType or FALSE or TRUE
+ * @param label a translated version of @a ident
+ * @return message type id
+ *
+ * Register a new message type with identifier @a ident and user digestible
+ * name @a label. If this function is called multiple times with the same
+ * identifier, the type id acquired by the first call will be returned
+ * and the other arguments are ignored.
+ * As long as the new message type isn't configured individually via
+ * sfi_msg_enable(), sfi_msg_allow() or their complements, it shares
+ * the configuration of @a default_ouput. If FALSE or TRUE is passed as
+ * @a default_ouput, this corresponds to SFI_MSG_NONE or SFI_MSG_FATAL
+ * respectively which are unconfigrable and always have their output
+ * disabled or enabled respectively.
+ * As an exception to the rest of the message API, this function may be
+ * called before sfi_init(). However note, that MT-safety is only ensured
+ * for calls occouring after sfi_init().
+ * This function is MT-safe and may be called from any thread.
+ */
+SfiMsgType
+sfi_msg_type_register (const gchar *ident,
+ SfiMsgType default_ouput, /* FALSE, TRUE, SFI_MSG_* */
+ const gchar *label)
+{
+ /* ensure standard types are registered */
+ sfi_msg_type_init_internals();
+ /* check arguments */
+ g_return_val_if_fail (ident != NULL, 0);
+ if (default_ouput >= n_msg_types)
+ default_ouput = 0;
+ /* support concurrency after _sfi_init_logging() */
+ bool need_unlock = FALSE;
+ if (quark_log_handler)
+ {
+ birnet_mutex_lock (&logging_mutex);
+ need_unlock = TRUE;
+ }
+ /* allow duplicate registration */
+ guint i;
+ for (i = SFI_MSG_LAST; i < n_msg_types; i++)
+ if (strcmp (ident, msg_types[i].ident) == 0)
+ {
+ /* found duplicate */
+ if (need_unlock)
+ birnet_mutex_unlock (&logging_mutex);
+ return i;
+ }
+ /* add new message type */
+ guint mtype = n_msg_types++;
+ msg_types = g_renew (MsgType, msg_types, n_msg_types);
+ memset (&msg_types[mtype], 0, sizeof (msg_types[mtype]));
+ guint old_flags_size = (mtype + 7) / 8;
+ guint new_flags_size = (n_msg_types + 7) / 8;
+ if (old_flags_size < new_flags_size)
+ {
+ guint8 *msg_flags = g_new (guint8, new_flags_size);
+ memcpy (msg_flags, (guint8*) sfi_msg_flags, sizeof (msg_flags[0]) * old_flags_size);
+ msg_flags[new_flags_size - 1] = 0;
+ guint8 *old_msg_flags = sfi_msg_flags;
+ /* we are holding a lock in the multi-threaded case so no need for compare_and_swap */
+ typedef guint8* X;
+ birnet_atomic_pointer_set ((void*) &sfi_msg_flags, msg_flags);
+ // FIXME: sfi_msg_flags should be registered as hazard pointer so we don't g_free() while other threads read old_msg_flags[*]
+ g_free (old_msg_flags);
+ }
+ msg_types[mtype].ident = g_strdup (ident);
+ msg_types[mtype].label = g_strdup (label);
+ sfi_msg_type_set (mtype, msg_types[default_ouput].log_flags, !msg_types[default_ouput].disabled);
+ msg_types[mtype].default_type = default_ouput;
+ birnet_atomic_uint_set (&sfi_msg_flags_max, mtype); /* only ever grows */
+ /* out of here */
+ if (need_unlock)
+ birnet_mutex_unlock (&logging_mutex);
+ return mtype;
+}
+
+static void
+key_list_change (const char *string,
+ bool flag_value)
+{
+ guint i, n;
+ /* ensure all keywords are enclosed in ':' */
+ char *s = g_strconcat (":", string, ":", NULL);
+ /* allow ',' seperation and collapse spaces */
+ for (i = 0, n = 0; s[i]; i++)
+ if (s[i] == ',')
+ s[n++] = ':';
+ else if (s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r')
+ s[n++] = s[i];
+ s[n] = 0;
+ /* handle :all: special case */
+ if (strstr (s, ":all:"))
+ {
+ g_free (s);
+ for (i = SFI_MSG_DEBUG; i < n_msg_types; i++)
+ sfi_msg_type_set (i, msg_types[i].log_flags, flag_value);
+ return;
+ }
+
+ /* walk all kyes */
+ char *k = s + 1;
+ char *p = strchr (k, ':');
+ while (p)
+ {
+ if (k < p)
+ {
+ *p = 0;
+ for (i = SFI_MSG_DEBUG; i < n_msg_types; i++)
+ if (strcmp (k, msg_types[i].ident) == 0)
+ break;
+ if (i < n_msg_types)
+ sfi_msg_type_set (i, msg_types[i].log_flags, flag_value);
+ }
+ k = p + 1;
+ p = strchr (k, ':');
+ }
+ g_free (s);
+}
+
+void
+sfi_msg_allow (const char *key)
+{
+ birnet_mutex_lock (&logging_mutex);
+ if (key)
+ key_list_change (key, TRUE);
+ birnet_mutex_unlock (&logging_mutex);
+
+#if 0
+ guint i;
+ for (i = 0; i < n_msg_types; i++)
+ g_printerr ("% 2d) %s: disabled=%d log_flags=0x%x label=%s cache=%d\n", i,
+ msg_types[i].ident, msg_types[i].disabled,
+ msg_types[i].log_flags, msg_types[i].label,
+ sfi_msg_check (i));
+#endif
+}
+
+void
+sfi_msg_deny (const char *key)
+{
+ birnet_mutex_lock (&logging_mutex);
+ if (key)
+ key_list_change (key, FALSE);
+ birnet_mutex_unlock (&logging_mutex);
+}
+
+void
+sfi_msg_enable (SfiMsgType mtype)
+{
+ birnet_mutex_lock (&logging_mutex);
+ if (mtype > 1 && mtype < n_msg_types)
+ sfi_msg_type_set (mtype, msg_types[mtype].log_flags, TRUE);
+ birnet_mutex_unlock (&logging_mutex);
+}
+
+void
+sfi_msg_disable (SfiMsgType mtype)
+{
+ birnet_mutex_lock (&logging_mutex);
+ if (mtype > 1 && mtype < n_msg_types)
+ sfi_msg_type_set (mtype, msg_types[mtype].log_flags, FALSE);
+ birnet_mutex_unlock (&logging_mutex);
+}
+
+void
+sfi_msg_type_configure (SfiMsgType mtype,
+ SfiMsgLogFlags channel_mask,
+ const gchar *dummy_filename)
+{
+ birnet_mutex_lock (&logging_mutex);
+ if (mtype > 1 && mtype < n_msg_types)
+ sfi_msg_type_set (mtype, channel_mask, !msg_types[mtype].disabled);
+ birnet_mutex_unlock (&logging_mutex);
+}
+
+void
+sfi_msg_configure_stdlog (bool stdlog_to_stderr_bool,
+ const char *stdlog_filename,
+ guint syslog_priority) /* if != 0, stdlog to syslog */
+{
+ birnet_mutex_lock (&logging_mutex);
+ stdlog_to_stderr = stdlog_to_stderr_bool != 0;
+ stdlog_syslog_priority = syslog_priority;
+ if (stdlog_file && stdlog_file != stdout)
+ fclose (stdlog_file);
+ stdlog_file = NULL;
+ if (stdlog_filename && strcmp (stdlog_filename, "-") == 0)
+ stdlog_file = stdout;
+ else if (stdlog_filename)
+ stdlog_file = fopen (stdlog_filename, "a");
+ birnet_mutex_unlock (&logging_mutex);
+}
+
+/**
+ * @param type message type, e.g. SFI_MSG_ERROR, SFI_MSG_WARNING, SFI_MSG_INFO, etc...
+ * @return message identifier
+ *
+ * Retrive the string identifying the message type @a type. For invalid
+ * (non registered) message types, NULL is returned.
+ * This function is MT-safe and may be called from any thread.
+ */
+const gchar*
+sfi_msg_type_ident (SfiMsgType mtype)
+{
+ const gchar *string = NULL;
+ birnet_mutex_lock (&logging_mutex);
+ if (mtype >= 0 && mtype < n_msg_types)
+ string = msg_types[mtype].ident;
+ birnet_mutex_unlock (&logging_mutex);
+ return string;
+}
+
+/**
+ * @param type message type, e.g. SFI_MSG_ERROR, SFI_MSG_WARNING, SFI_MSG_INFO, etc...
+ * @return translated message identifier or NULL
+ *
+ * Retrive the label identifying the message type @a type. Usually,
+ * this is a translated version of sfi_msg_type_ident() or NULL
+ * if non was registered with the message type.
+ * This function is MT-safe and may be called from any thread.
+ */
+const gchar*
+sfi_msg_type_label (SfiMsgType mtype)
+{
+ const gchar *string = NULL;
+ birnet_mutex_lock (&logging_mutex);
+ if (mtype >= 0 && mtype < n_msg_types)
+ string = msg_types[mtype].label;
+ birnet_mutex_unlock (&logging_mutex);
+ return string;
+}
+
+/**
+ * @param ident message identifier, e.g. "error", "warning", "info", etc...
+ * @return corresponding SfiMsgType or 0
+ *
+ * Find the message type correspondign to @a ident. If no message
+ * type was found 0 is returned (note that 0 is also the value of
+ * SFI_MSG_NONE).
+ * This function is MT-safe and may be called from any thread.
+ */
+SfiMsgType
+sfi_msg_type_lookup (const gchar *ident)
+{
+ g_return_val_if_fail (ident != NULL, 0);
+ guint i;
+ birnet_mutex_lock (&logging_mutex);
+ for (i = 0; i < n_msg_types; i++)
+ if (strcmp (ident, msg_types[i].ident) == 0)
+ break;
+ if (i >= n_msg_types)
+ i = 0;
+ birnet_mutex_unlock (&logging_mutex);
+ return i;
+}
+
+/**
+ * @param handler a valid SfiMsgHandler or NULL
+ *
+ * Set the handler function for messages logged in the current
+ * thread. If NULL is specified as handler, the standard handler
+ * will be used. For handler implementations that require an extra
+ * data argument, see birnet_thread_set_qdata().
+ * This function is MT-safe and may be called from any thread.
+ */
+void
+sfi_msg_set_thread_handler (SfiMsgHandler handler)
+{
+ birnet_thread_set_qdata (quark_log_handler, handler);
+}
+
+/**
+ * @param message a valid SfiMessage
+ *
+ * This is the standard message handler, it produces @a message
+ * in a prominent way on stderr.
+ * This function is MT-safe and may be called from any thread.
+ */
+void
+sfi_msg_default_handler (const SfiMessage *msg)
+{
+ const gchar *level_name = sfi_msg_type_label (msg->type);
+ g_printerr ("********************************************************************************\n");
+ if (msg->log_domain)
+ g_printerr ("** %s-%s: %s\n", msg->log_domain, level_name, msg->title ? msg->title : "");
+ else
+ g_printerr ("** %s: %s\n", level_name, msg->title ? msg->title : "");
+ if (msg->primary)
+ g_printerr ("** %s\n", msg->primary);
+ if (msg->secondary)
+ {
+ GString *gstring = g_string_new (msg->secondary);
+ guint i;
+ for (i = 0; i < gstring->len; i++)
+ if (gstring->str[i] == '\n')
+ g_string_insert (gstring, i + 1, "** ");
+ g_printerr ("** %s\n", gstring->str);
+ g_string_free (gstring, TRUE);
+ }
+ if (msg->details)
+ {
+ GString *gstring = g_string_new (msg->details);
+ guint i;
+ for (i = 0; i < gstring->len; i++)
+ if (gstring->str[i] == '\n')
+ g_string_insert (gstring, i + 1, "** > ");
+ g_printerr ("** > %s\n", gstring->str);
+ g_string_free (gstring, TRUE);
+ }
+ if (msg->config_check)
+ g_printerr ("** [X] %s\n", msg->config_check);
+ g_printerr ("********************************************************************************\n");
+}
+
+typedef struct LogBit LogBit;
+struct LogBit {
+ SfiMsgBit bit;
+ void (*data_free) (void*);
+ LogBit *next;
+};
+
+static void
+free_lbits (LogBit *first)
+{
+ while (first)
+ {
+ LogBit *current = first;
+ first = current->next;
+ if (current->data_free)
+ current->data_free (current->bit.data);
+ g_free (current);
+ }
+}
+
+/**
+ * @param log_domain log domain
+ * @param level one of SFI_MSG_ERROR, SFI_MSG_WARNING, SFI_MSG_INFO, SFI_MSG_DIAG or SFI_MSG_DEBUG
+ * @param format printf-like format
+ * @param ... printf-like arguments
+ *
+ * Log a message through SFIs logging mechanism. The current
+ * value of errno is preserved around calls to this function.
+ * Usually this function isn't used directly, but through one
+ * of sfi_debug(), sfi_diag(), sfi_info(), sfi_warn() or sfi_error().
+ * The @a log_domain indicates the calling module and relates to
+ * G_LOG_DOMAIN as used by g_log().
+ * This function is MT-safe and may be called from any thread.
+ */
+void
+sfi_msg_log_printf (const char *log_domain,
+ SfiMsgType mtype,
+ const char *format,
+ ...)
+{
+ gint saved_errno = errno;
+ /* construct message */
+ SfiMessage msg = { 0, };
+ msg.type = mtype;
+ msg.log_domain = (char*) log_domain;
+ va_list args;
+ va_start (args, format);
+ msg.primary = g_strdup_vprintf (format, args);
+ va_end (args);
+ msg.config_check = NULL;
+ /* handle message */
+ LogBit *lbit_list = birnet_thread_steal_qdata (quark_msg_bits);
+ sfi_log_msg_process (&msg);
+ g_free (msg.primary);
+ free_lbits (lbit_list); /* purge thread local msg bit list */
+ errno = saved_errno;
+}
+
+/**
+ * @param log_domain log domain
+ * @param mtype one of SFI_MSG_ERROR, SFI_MSG_WARNING, SFI_MSG_INFO, SFI_MSG_DIAG
+ * @param lbit1 msg bit
+ * @param lbit2 msg bit
+ * @param ... list of more msg bits, NULL terminated
+ *
+ * Log a message through SFIs logging mechanism. The current value of errno
+ * is preserved around calls to this function. Usually this function isn't
+ * used directly, but sfi_log_msg() is called instead which does not require
+ * NULL termination of its argument list and automates the @a log_domain argument.
+ * The @a log_domain indicates the calling module and relates to G_LOG_DOMAIN
+ * as used by g_log().
+ * The msg bit arguments passed in form various parts of the log message, the
+ * following macro set is provided to construct the parts from printf-style
+ * argument lists:
+ * - SFI_MSG_TITLE(): format message title
+ * - SFI_MSG_TEXT1(): format primary message (also SFI_MSG_PRIMARY())
+ * - SFI_MSG_TEXT2(): format secondary message, optional (also SFI_MSG_SECONDARY())
+ * - SFI_MSG_TEXT3(): format details of the message, optional (also SFI_MSG_DETAIL())
+ * - SFI_MSG_CHECK(): format configuration check statement to enable/disable log messages of this type.
+ * This function is MT-safe and may be called from any thread.
+ */
+void
+sfi_msg_log_elist (const char *log_domain,
+ SfiMsgType mtype, /* SFI_MSG_DEBUG is not really useful here */
+ SfiMsgBit *lbit1,
+ SfiMsgBit *lbit2,
+ ...)
+{
+ gint saved_errno = errno;
+ guint n = 0;
+ SfiMsgBit **bits = NULL;
+ /* collect msg bits */
+ if (lbit1)
+ {
+ bits = g_renew (SfiMsgBit*, bits, n + 1);
+ bits[n++] = lbit1;
+ SfiMsgBit *lbit = lbit2;
+ va_list args;
+ va_start (args, lbit2);
+ while (lbit)
+ {
+ bits = g_renew (SfiMsgBit*, bits, n + 1);
+ bits[n++] = lbit;
+ lbit = va_arg (args, SfiMsgBit*);
+ }
+ va_end (args);
+ }
+ bits = g_renew (SfiMsgBit*, bits, n + 1);
+ bits[n] = NULL;
+ sfi_msg_log_trampoline (log_domain, mtype, bits, sfi_log_msg_process);
+ g_free (bits);
+ errno = saved_errno;
+}
+
+static inline char*
+log_msg_concat (char *former,
+ const char *next)
+{
+ if (former && !next)
+ return former;
+ if (!former && next)
+ return g_strdup (next);
+ char *result = g_strconcat (former, "\n", next, NULL);
+ g_free (former);
+ return result;
+}
+
+static inline void
+msg_apply_bit (SfiMessage *msg,
+ SfiMsgBit *lbit)
+{
+ gsize ltype = (gsize) lbit->owner;
+ if (ltype < 256)
+ {
+ switch (ltype)
+ {
+ case '0': msg->title = log_msg_concat (msg->title, lbit->data); break;
+ case '1': msg->primary = log_msg_concat (msg->primary, lbit->data); break;
+ case '2': msg->secondary = log_msg_concat (msg->secondary, lbit->data); break;
+ case '3': msg->details = log_msg_concat (msg->details, lbit->data); break;
+ case 'c': msg->config_check = log_msg_concat (msg->config_check, lbit->data); break;
+ }
+ }
+ else
+ {
+ guint i = msg->n_msg_bits++;
+ msg->msg_bits = g_renew (SfiMsgBit*, msg->msg_bits, msg->n_msg_bits);
+ msg->msg_bits[i] = lbit;
+ }
+}
+
+/**
+ * @param log_domain log domain
+ * @param mtype one of SFI_MSG_ERROR, SFI_MSG_WARNING, SFI_MSG_INFO, SFI_MSG_DIAG
+ * @param lbit1 msg bit
+ * @param lbit2 msg bit
+ * @param lbitargs va_list list of more msg bits, NULL terminated
+ * @param handler message handler
+ * @param vbitlist NULL terminated array of msg bits
+ *
+ * Construct a log message from the arguments given and let @a handler process
+ * it. This function performs no logging on its own, it is used internally by
+ * sfi_log_msg_elist() to collect arguments and construct a message. All logging
+ * functionality has to be implemented by @a handler. Note that all thread-local
+ * msg bits are deleted after invokation of this funtcion, so all msg bits
+ * created in the current thread are invalid after calling this function.
+ * Direct use of this function is not recommended except for implementations
+ * of logging mechanisms.
+ * This function is MT-safe and may be called from any thread.
+ */
+void
+sfi_msg_log_trampoline (const char *log_domain,
+ SfiMsgType mtype, /* SFI_MSG_DEBUG is not really useful here */
+ SfiMsgBit **lbits,
+ SfiMsgHandler handler)
+{
+ gint saved_errno = errno;
+ /* construct message */
+ SfiMessage msg = { 0, };
+ msg.type = mtype;
+ msg.log_domain = (char*) log_domain;
+ /* apply msg bits */
+ if (lbits)
+ {
+ guint j;
+ for (j = 0; lbits[j]; j++)
+ msg_apply_bit (&msg, lbits[j]);
+ }
+ /* reset thread local msg bit list */
+ LogBit *lbit_list = birnet_thread_steal_qdata (quark_msg_bits);
+ /* handle message */
+ if (!handler)
+ handler = sfi_log_msg_process;
+ handler (&msg);
+ /* clean up */
+ g_free (msg.title);
+ g_free (msg.primary);
+ g_free (msg.secondary);
+ g_free (msg.details);
+ g_free (msg.config_check);
+ g_free (msg.msg_bits);
+ free_lbits (lbit_list);
+ /* restore errno */
+ errno = saved_errno;
+}
+
+SfiMsgBit*
+sfi_msg_bit_appoint (gconstpointer owner,
+ gpointer data,
+ void (*data_free) (gpointer))
+{
+ gint saved_errno = errno;
+ LogBit *lbit = g_new0 (LogBit, 1);
+ lbit->bit.owner = owner;
+ lbit->bit.data = data;
+ lbit->data_free = data_free;
+ lbit->next = birnet_thread_steal_qdata (quark_msg_bits);
+ birnet_thread_set_qdata_full (quark_msg_bits, lbit, (GDestroyNotify) free_lbits);
+ errno = saved_errno;
+ return &lbit->bit;
+}
+
+SfiMsgBit*
+sfi_msg_bit_printf (guint8 msg_bit_type,
+ const char *format,
+ ...)
+{
+ gint saved_errno = errno;
+ va_list args;
+ va_start (args, format);
+ gchar *string = g_strdup_vprintf (format, args);
+ va_end (args);
+ errno = saved_errno;
+ return sfi_msg_bit_appoint ((void*) (gsize) msg_bit_type, string, g_free);
+}
+
+static const gchar*
+prgname (bool maystrip)
+{
+ const gchar *pname = g_get_prgname();
+ if (pname && maystrip)
+ {
+ const gchar *p = strrchr (pname, '/');
+ pname = p ? p + 1 : pname;
+ }
+ return pname;
+}
+
+static char*
+log_prefix (const char *prg_name,
+ guint pid,
+ const char *log_domain,
+ const char *label,
+ const char *ident)
+{
+ GString *gstring = g_string_new (prg_name);
+ if (pid)
+ g_string_append_printf (gstring, "[%u]", pid);
+ if (gstring->len)
+ g_string_append (gstring, ":");
+ if (log_domain)
+ g_string_append (gstring, log_domain);
+ if (log_domain && label)
+ g_string_append (gstring, "-");
+ if (label)
+ g_string_append (gstring, label);
+ if (ident)
+ {
+ if (log_domain || label)
+ g_string_append_printf (gstring, "(%s)", ident);
+ else
+ g_string_append (gstring, ident);
+ }
+ if (log_domain || label || ident)
+ g_string_append (gstring, ":");
+ /* more components can come here */
+ /* ... */
+ if (gstring->str[gstring->len - 1] == ':') /* strip final ':' */
+ gstring->str[gstring->len - 1] = 0;
+ return g_string_free (gstring, FALSE);
+}
+
+static guint
+sfi_msg_type_actions (SfiMsgType mtype)
+{
+ guint actions = 0;
+ birnet_mutex_lock (&logging_mutex);
+ if (mtype >= 0 && mtype < n_msg_types &&
+ !msg_types[mtype].disabled)
+ actions = msg_types[mtype].log_flags;
+ birnet_mutex_unlock (&logging_mutex);
+ return actions;
+}
+
+static void
+sfi_log_msg_process (const SfiMessage *msgp)
+{
+ const SfiMessage msg = *msgp;
+ /* determine log actions */
+ guint actions = sfi_msg_type_actions (msg.type);
+ const char *ident = sfi_msg_type_ident (msg.type);
+ const char *label = sfi_msg_type_label (msg.type);
+ /* log to syslog */
+ if ((msg.primary || msg.secondary) && stdlog_syslog_priority && (actions & SFI_MSG_TO_STDLOG))
+ {
+ char *prefix = log_prefix (NULL, 0, msg.log_domain, NULL, ident);
+ if (msg.title && FALSE) // skip title in syslog
+ syslog (stdlog_syslog_priority, "%s:0: %s\n", prefix, msg.title);
+ if (msg.primary)
+ syslog (stdlog_syslog_priority, "%s:1: %s\n", prefix, msg.primary);
+ if (msg.secondary)
+ syslog (stdlog_syslog_priority, "%s:2: %s\n", prefix, msg.secondary);
+ if (msg.details && FALSE) // skip details in syslog
+ syslog (stdlog_syslog_priority, "%s:3: %s\n", prefix, msg.details);
+ g_free (prefix);
+ }
+ /* log to stderr */
+ bool tostderr = (actions & SFI_MSG_TO_STDERR) != 0;
+ tostderr |= (actions & SFI_MSG_TO_STDLOG) && stdlog_to_stderr;
+ if ((msg.primary || msg.secondary) && tostderr)
+ {
+ bool is_debug = msg.type == SFI_MSG_DEBUG, is_diag = msg.type == SFI_MSG_DIAG;
+ gchar *prefix = log_prefix (prgname (is_debug), /* strip prgname path for debugging */
+ birnet_thread_self_pid(), /* always print pid */
+ is_debug ? NULL : msg.log_domain, /* print domain except when debugging */
+ is_debug || is_diag ? NULL : label, /* print translated message type execpt for debug/diagnosis */
+ is_debug ? ident : NULL); /* print identifier if debugging */
+ if (msg.title)
+ fprintf (stderr, "%s:0: %s\n", prefix, msg.title);
+ if (msg.primary)
+ fprintf (stderr, "%s:1: %s\n", prefix, msg.primary);
+ if (msg.secondary)
+ fprintf (stderr, "%s:2: %s\n", prefix, msg.secondary);
+ if (msg.details)
+ fprintf (stderr, "%s:3: %s\n", prefix, msg.details);
+ g_free (prefix);
+ }
+ /* log to logfile */
+ if (stdlog_file && (actions & SFI_MSG_TO_STDLOG))
+ {
+ char *prefix = log_prefix (prgname (FALSE), /* printf fully qualified program name */
+ birnet_thread_self_pid(), /* always print pid */
+ msg.log_domain, /* always print log domain */
+ NULL, /* skip translated message type */
+ ident); /* print machine readable message type */
+ if (msg.title)
+ fprintf (stdlog_file, "%s:0: %s\n", prefix, msg.title);
+ if (msg.primary)
+ fprintf (stdlog_file, "%s:1: %s\n", prefix, msg.primary);
+ if (msg.secondary)
+ fprintf (stdlog_file, "%s:2: %s\n", prefix, msg.secondary);
+ if (msg.details)
+ fprintf (stdlog_file, "%s:3: %s\n", prefix, msg.details);
+ g_free (prefix);
+ }
+ /* log to log handler */
+ if (actions & SFI_MSG_TO_HANDLER)
+ {
+ SfiMsgHandler log_handler = birnet_thread_get_qdata (quark_log_handler);
+ if (!log_handler)
+ log_handler = sfi_msg_default_handler;
+ log_handler (&msg);
+ }
+}
Copied: trunk/sfi/sfimsg.h (from rev 3931, trunk/birnet/birnetmsg.h)
===================================================================
--- trunk/birnet/birnetmsg.h 2006-10-03 17:04:26 UTC (rev 3931)
+++ trunk/sfi/sfimsg.h 2006-10-06 16:55:46 UTC (rev 3937)
@@ -0,0 +1,154 @@
+/* SfiMsg
+ * Copyright (C) 2002-2006 Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __SFI_MSG_H__
+#define __SFI_MSG_H__
+
+#include <sfi/sfitypes.h>
+
+BIRNET_EXTERN_C_BEGIN();
+
+typedef enum {
+ SFI_MSG_NONE = 0, /* always off */
+ SFI_MSG_FATAL, /* always on */
+ SFI_MSG_ERROR,
+ SFI_MSG_WARNING,
+ SFI_MSG_SCRIPT,
+ SFI_MSG_INFO,
+ SFI_MSG_DIAG,
+ SFI_MSG_DEBUG,
+ SFI_MSG_LAST
+} SfiMsgType;
+
+/* --- standard logging --- */
+#define sfi_fatal( ...) sfi_msg_checked (SFI_LOG_DOMAIN, SFI_MSG_FATAL, __VA_ARGS__)
+#define sfi_error( ...) sfi_msg_checked (SFI_LOG_DOMAIN, SFI_MSG_ERROR, __VA_ARGS__)
+#define sfi_warning( ...) sfi_msg_checked (SFI_LOG_DOMAIN, SFI_MSG_WARNING, __VA_ARGS__)
+#define sfi_info( ...) sfi_msg_checked (SFI_LOG_DOMAIN, SFI_MSG_INFO, __VA_ARGS__)
+#define sfi_diag( ...) sfi_msg_checked (SFI_LOG_DOMAIN, SFI_MSG_DIAG, __VA_ARGS__)
+#define sfi_debug( lvl, ...) sfi_msg_checked (SFI_LOG_DOMAIN, lvl, __VA_ARGS__)
+#define sfi_nodebug( lvl, ...) do { /* nothing */ } while (0)
+
+/* --- user interface messages --- */
+#define sfi_msg_log(level, ...) sfi_msg_log_elist (SFI_LOG_DOMAIN, level, __VA_ARGS__, NULL)
+#define SFI_MSG_TEXT0(...) sfi_msg_bit_printf ('0', __VA_ARGS__) /* message title */
+#define SFI_MSG_TEXT1(...) sfi_msg_bit_printf ('1', __VA_ARGS__) /* primary message */
+#define SFI_MSG_TEXT2(...) sfi_msg_bit_printf ('2', __VA_ARGS__) /* secondary message */
+#define SFI_MSG_TEXT3(...) sfi_msg_bit_printf ('3', __VA_ARGS__) /* message details */
+#define SFI_MSG_CHECK(...) sfi_msg_bit_printf ('c', __VA_ARGS__) /* user switch */
+#define SFI_MSG_TITLE SFI_MSG_TEXT0 /* alias */
+#define SFI_MSG_PRIMARY SFI_MSG_TEXT1 /* alias */
+#define SFI_MSG_SECONDARY SFI_MSG_TEXT2 /* alias */
+#define SFI_MSG_DETAIL SFI_MSG_TEXT3 /* alias */
+
+/* --- config and handler API --- */
+typedef enum {
+ SFI_MSG_TO_STDERR = 1,
+ SFI_MSG_TO_STDLOG = 2,
+ SFI_MSG_TO_HANDLER = 4,
+} SfiMsgLogFlags;
+typedef struct SfiMessage SfiMessage;
+typedef void (*SfiMsgHandler) (const SfiMessage *message);
+static inline
+bool sfi_msg_check (SfiMsgType mtype);
+void sfi_msg_enable (SfiMsgType mtype);
+void sfi_msg_disable (SfiMsgType mtype);
+void sfi_msg_allow (const gchar *ident_list);
+void sfi_msg_deny (const gchar *ident_list);
+void sfi_msg_set_thread_handler (SfiMsgHandler handler);
+void sfi_msg_default_handler (const SfiMessage *message);
+SfiMsgType sfi_msg_type_lookup (const gchar *ident);
+const gchar* sfi_msg_type_ident (SfiMsgType mtype);
+const gchar* sfi_msg_type_label (SfiMsgType mtype);
+void sfi_msg_type_configure (SfiMsgType mtype,
+ SfiMsgLogFlags channel_mask,
+ const gchar *dummy_filename);
+void sfi_msg_configure_stdlog (bool stdlog_to_stderr,
+ const char *stdlog_filename,
+ guint syslog_priority); /* if != 0, stdlog to syslog */
+SfiMsgType sfi_msg_type_register (const gchar *ident,
+ SfiMsgType default_ouput, /* FALSE, TRUE, ... */
+ const gchar *label);
+/* automatic registration */
+#define SFI_MSG_TYPE_DEFINE(variable, ident, default_ouput, label) SFI_MSG_TYPE__DEF (variable, ident, default_ouput, label)
+
+/* --- logging internals --- */
+typedef struct SfiMsgBit SfiMsgBit;
+struct SfiMessage {
+ gchar *log_domain;
+ SfiMsgType type;
+ char *title; /* translated */
+ char *primary; /* translated */
+ char *secondary; /* translated */
+ char *details; /* translated */
+ char *config_check; /* translated */
+ guint n_msg_bits;
+ SfiMsgBit **msg_bits;
+};
+struct SfiMsgBit {
+ gconstpointer owner;
+ gpointer data;
+};
+
+void sfi_msg_log_printf (const char *log_domain,
+ SfiMsgType mtype,
+ const char *format,
+ ...) G_GNUC_PRINTF (3, 4);
+void sfi_msg_log_elist (const char *log_domain,
+ SfiMsgType mtype,
+ SfiMsgBit *lbit1,
+ SfiMsgBit *lbit2,
+ ...);
+void sfi_msg_log_trampoline (const char *log_domain,
+ SfiMsgType mtype,
+ SfiMsgBit **lbits,
+ SfiMsgHandler handler);
+SfiMsgBit* sfi_msg_bit_appoint (gconstpointer owner,
+ gpointer data,
+ void (*data_free) (void*));
+SfiMsgBit* sfi_msg_bit_printf (guint8 msg_bit_type,
+ const char *format,
+ ...) G_GNUC_PRINTF (2, 3);
+void _sfi_init_logging (void);
+static inline bool
+sfi_msg_check (SfiMsgType mtype)
+{
+ extern guint8 * volatile sfi_msg_flags;
+ extern volatile guint sfi_msg_flags_max;
+ if (mtype >= 0 && (unsigned) mtype <= sfi_msg_flags_max)
+ return 0 != (sfi_msg_flags[mtype / 8] & (1 << mtype % 8));
+ return 0;
+}
+
+/* --- internal macros --- */
+#ifndef SFI_LOG_DOMAIN
+#define SFI_LOG_DOMAIN G_LOG_DOMAIN
+#endif
+#define sfi_msg_checked( dom, lvl, ...) \
+ do { SfiMsgType __mt = lvl; if (sfi_msg_check (__mt)) sfi_msg_log_printf (dom, __mt, __VA_ARGS__); } while (0)
+#define SFI_MSG_TYPE__DEF(variable, identifier, default_ouput, label) \
+ SfiMsgType variable = (SfiMsgType) 0; \
+ static void BIRNET_CONSTRUCTOR \
+ BIRNET_CPP_PASTE4 (__sfi_msg_type__init, __LINE__, __, variable) (void) \
+ { variable = sfi_msg_type_register (identifier, default_ouput, label); }
+
+BIRNET_EXTERN_C_END();
+
+#endif /* __SFI_MSG_H__ */
+
+/* vim:set ts=8 sts=2 sw=2: */
Modified: trunk/sfi/sfistore.c
===================================================================
--- trunk/sfi/sfistore.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sfistore.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -20,6 +20,7 @@
#include "sfiprimitives.h"
#include "sfiserial.h"
#include "sfiparams.h"
+#include "sfimsg.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
Modified: trunk/sfi/sfitypes.h
===================================================================
--- trunk/sfi/sfitypes.h 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/sfitypes.h 2006-10-06 16:55:46 UTC (rev 3937)
@@ -19,7 +19,7 @@
#ifndef __SFI_TYPES_H__
#define __SFI_TYPES_H__
-#include <birnet/birnet.h>
+#include <birnet/birnetthread.h>
#include <sfi/glib-extra.h>
G_BEGIN_DECLS
@@ -63,16 +63,6 @@
typedef struct _SfiUPool SfiUPool;
typedef struct _SfiPPool SfiPPool;
-
-/* --- logging shorthands --- */
-#define sfi_fatal(...) birnet_fatal (__VA_ARGS__)
-#define sfi_error(...) birnet_error (__VA_ARGS__)
-#define sfi_warning(...) birnet_warning (__VA_ARGS__)
-#define sfi_info(...) birnet_info (__VA_ARGS__)
-#define sfi_diag(...) birnet_diag (__VA_ARGS__)
-#define sfi_debug(lvl, ...) birnet_debug (lvl, __VA_ARGS__)
-#define sfi_nodebug(lvl, ...) birnet_nodebug (lvl, __VA_ARGS__)
-
/* --- FIXME: hacks! --- */
void sfi_set_error (GError **errorp, // do nothing if *errorp is set already
GQuark domain,
Modified: trunk/sfi/tests/ring.c
===================================================================
--- trunk/sfi/tests/ring.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/sfi/tests/ring.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -17,7 +17,7 @@
* Boston, MA 02111-1307, USA.
*/
// #define TEST_VERBOSE
-#include <birnet/birnettests.h>
+#include <sfi/sfitests.h>
#include <sfi/sfi.h>
static void
@@ -222,7 +222,7 @@
main (int argc,
char *argv[])
{
- birnet_init_test (&argc, &argv);
+ sfi_init_test (&argc, &argv, NULL);
test_sfi_ring();
Modified: trunk/shell/bsescminterp.c
===================================================================
--- trunk/shell/bsescminterp.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/shell/bsescminterp.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -719,12 +719,12 @@
}
static void
-scm_script_send_message_handler (const BirnetMessage *msg)
+scm_script_send_message_handler (const SfiMessage *msg)
{
SfiSeq *args = sfi_seq_new ();
/* keep arguments in sync with bsejanitor.proc */
sfi_seq_append_string (args, msg->log_domain);
- sfi_seq_append_string (args, birnet_msg_type_ident (msg->type));
+ sfi_seq_append_string (args, sfi_msg_type_ident (msg->type));
sfi_seq_append_string (args, msg->title);
sfi_seq_append_string (args, msg->primary);
sfi_seq_append_string (args, msg->secondary);
@@ -765,7 +765,7 @@
/* figure message level */
BSE_SCM_DEFER_INTS();
gchar *strtype = g_strndup (SCM_ROCHARS (s_type), SCM_LENGTH (s_type));
- guint mtype = birnet_msg_type_lookup (strtype);
+ guint mtype = sfi_msg_type_lookup (strtype);
g_free (strtype);
BSE_SCM_ALLOW_INTS();
if (!mtype)
@@ -781,7 +781,7 @@
/* build message bit list */
BSE_SCM_DEFER_INTS();
- BirnetMsgBit **mbits = g_new0 (BirnetMsgBit*, i / 2 + 1);
+ SfiMsgBit **mbits = g_new0 (SfiMsgBit*, i / 2 + 1);
sfi_glue_gc_add (mbits, g_free); /* free mbits automatically */
BSE_SCM_ALLOW_INTS();
guint n = 0;
@@ -814,12 +814,12 @@
scm_wrong_type_arg ("bse-script-message", i, arg2);
/* add message bit from string */
BSE_SCM_DEFER_INTS();
- mbits[n++] = birnet_msg_bit_appoint ((void*) tag, g_strndup (SCM_ROCHARS (arg2), SCM_LENGTH (arg2)), g_free);
+ mbits[n++] = sfi_msg_bit_appoint ((void*) tag, g_strndup (SCM_ROCHARS (arg2), SCM_LENGTH (arg2)), g_free);
BSE_SCM_ALLOW_INTS();
}
BSE_SCM_DEFER_INTS ();
- birnet_msg_log_trampoline (BIRNET_LOG_DOMAIN, mtype, mbits, scm_script_send_message_handler);
+ sfi_msg_log_trampoline (BIRNET_LOG_DOMAIN, mtype, mbits, scm_script_send_message_handler);
BSE_SCM_ALLOW_INTS ();
bse_scm_destroy_gc_plateau (gcplateau);
Modified: trunk/slowtests/perftest.cc
===================================================================
--- trunk/slowtests/perftest.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/slowtests/perftest.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -40,7 +40,7 @@
{
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
bse_init_async (&argc, &argv, "Perftest", NULL);
- birnet_msg_allow ("misc");
+ sfi_msg_allow ("misc");
bse_context = bse_init_glue_context (argv[0]);
sfi_glue_context_push (bse_context);
Modified: trunk/slowtests/testresampler.cc
===================================================================
--- trunk/slowtests/testresampler.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/slowtests/testresampler.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -627,7 +627,7 @@
argv[i] = g_strdup ("--bse-force-fpu"); /* leak, but we don't care */
/* load plugins */
- BirnetInitValue config[] = {
+ SfiInitValue config[] = {
{ "load-core-plugins", "1" },
{ NULL },
};
Modified: trunk/slowtests/testwavechunk.c
===================================================================
--- trunk/slowtests/testwavechunk.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/slowtests/testwavechunk.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -196,7 +196,7 @@
gchar *argv[])
{
/* init */
- BirnetInitValue values[] = {
+ SfiInitValue values[] = {
{ "stand-alone", "true" }, /* no rcfiles etc. */
{ "wave-chunk-padding", NULL, 1, },
{ "wave_chunk_big_pad", NULL, 2, },
Modified: trunk/tests/bse/cxxbinding.cc
===================================================================
--- trunk/tests/bse/cxxbinding.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/tests/bse/cxxbinding.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -39,7 +39,7 @@
{
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
bse_init_async (&argc, &argv, "CxxBindingTest", NULL);
- birnet_msg_allow ("misc");
+ sfi_msg_allow ("misc");
bse_context = bse_init_glue_context (argv[0]);
sfi_glue_context_push (bse_context);
Modified: trunk/tools/bsefextract.cc
===================================================================
--- trunk/tools/bsefextract.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/tools/bsefextract.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -1172,7 +1172,7 @@
main (int argc, char **argv)
{
/* init */
- BirnetInitValue values[] = {
+ SfiInitValue values[] = {
{ "stand-alone", "true" }, /* no rcfiles etc. */
{ "wave-chunk-padding", NULL, 1, },
{ "dcache-block-size", NULL, 8192, },
Modified: trunk/tools/bsewavetool.cc
===================================================================
--- trunk/tools/bsewavetool.cc 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/tools/bsewavetool.cc 2006-10-06 16:55:46 UTC (rev 3937)
@@ -57,9 +57,9 @@
/* --- main program --- */
static void
-wavetool_log_handler (const BirnetMessage *msg)
+wavetool_log_handler (const SfiMessage *msg)
{
- if (msg->type == BIRNET_MSG_INFO)
+ if (msg->type == SFI_MSG_INFO)
{
if (!quiet_infos)
{
@@ -72,7 +72,7 @@
}
}
else
- birnet_msg_default_handler (msg);
+ sfi_msg_default_handler (msg);
}
extern "C" int
@@ -83,7 +83,7 @@
/* initialization */
int orig_argc = argc;
- BirnetInitValue values[] = {
+ SfiInitValue values[] = {
{ "stand-alone", "true" }, /* no rcfiles etc. */
{ "wave-chunk-padding", NULL, 1, },
{ "dcache-block-size", NULL, 8192, },
@@ -91,9 +91,9 @@
{ NULL }
};
bse_init_inprocess (&argc, &argv, "BseWaveTool", values);
- birnet_msg_allow ("main"); // FIXME
- birnet_msg_set_thread_handler (wavetool_log_handler);
- birnet_msg_type_configure (BIRNET_MSG_INFO, BIRNET_MSG_TO_HANDLER, NULL);
+ sfi_msg_allow ("main"); // FIXME
+ sfi_msg_set_thread_handler (wavetool_log_handler);
+ sfi_msg_type_configure (SFI_MSG_INFO, SFI_MSG_TO_HANDLER, NULL);
/* pre-parse argument list to decide command */
wavetool_parse_args (&argc, &argv);
@@ -309,10 +309,10 @@
envar = getenv ("BSEWAVETOOL_DEBUG");
if (envar)
- birnet_msg_allow (envar);
+ sfi_msg_allow (envar);
envar = getenv ("BSEWAVETOOL_NO_DEBUG");
if (envar)
- birnet_msg_deny (envar);
+ sfi_msg_deny (envar);
for (i = 1; i < argc; i++)
{
@@ -329,9 +329,9 @@
exit (0);
}
else if (parse_str_option (argv, i, "--debug", &str, argc))
- birnet_msg_allow (str);
+ sfi_msg_allow (str);
else if (parse_str_option (argv, i, "--no-debug", &str, argc))
- birnet_msg_deny (str);
+ sfi_msg_deny (str);
else if (parse_bool_option (argv, i, "-h") ||
parse_bool_option (argv, i, "--help"))
{
@@ -931,8 +931,8 @@
}
if (error)
{
- birnet_msg_log (continue_on_error ? BIRNET_MSG_WARNING : BIRNET_MSG_ERROR,
- BIRNET_MSG_PRIMARY (_("failed to add wave chunk from file \"%s\": %s"),
+ sfi_msg_log (continue_on_error ? SFI_MSG_WARNING : SFI_MSG_ERROR,
+ SFI_MSG_PRIMARY (_("failed to add wave chunk from file \"%s\": %s"),
ochunk.sample_file, bse_error_blurb (error)));
if (!continue_on_error)
exit (1);
Modified: trunk/tools/cutvorbis.c
===================================================================
--- trunk/tools/cutvorbis.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/tools/cutvorbis.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -89,7 +89,7 @@
gint ifd, ofd;
/* initialization */
- BirnetInitValue values[] = {
+ SfiInitValue values[] = {
{ "stand-alone", "true" }, /* no rcfiles etc. */
{ "wave-chunk-padding", NULL, 1, },
{ "dcache-block-size", NULL, 8192, },
Modified: trunk/tools/magictest.c
===================================================================
--- trunk/tools/magictest.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/tools/magictest.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -62,7 +62,7 @@
gboolean test_open = FALSE;
/* initialization */
- BirnetInitValue values[] = {
+ SfiInitValue values[] = {
{ "stand-alone", "true" }, /* no rcfiles etc. */
{ NULL }
};
Modified: trunk/tools/mathtool.c
===================================================================
--- trunk/tools/mathtool.c 2006-10-06 16:54:11 UTC (rev 3936)
+++ trunk/tools/mathtool.c 2006-10-06 16:55:46 UTC (rev 3937)
@@ -75,7 +75,7 @@
shift_argv = (const gchar**) argv;
/* init */
- BirnetInitValue values[] = {
+ SfiInitValue values[] = {
{ "stand-alone", "true" }, /* no rcfiles etc. */
{ "wave-chunk-padding", NULL, 1, },
{ "dcache-block-size", NULL, 8192, },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]