1 /* Common Lisp bindings for GTK+ v2.0
2 * Copyright (C) 1999-2002 Espen S. Johnsen <espen@users.sourceforge.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 /* $Id: callback.c,v 1.3 2004-11-01 00:08:50 espen Exp $ */
21 #include <glib-object.h>
26 void (*log_handler
) (gchar
*, guint
, gchar
*);
32 clg_callback_closure_new (gpointer callback_id
, gpointer callback
,
33 gpointer destroy_notify
)
37 closure
= g_closure_new_simple (sizeof (GClosure
), (gpointer
)callback_id
);
38 g_closure_set_meta_marshal (closure
, callback_id
, callback
);
39 g_closure_add_finalize_notifier (closure
, callback_id
, destroy_notify
);
46 g_logv (const gchar
*log_domain
,
47 GLogLevelFlags log_level
,
51 gchar
*msg
= g_strdup_vprintf (format
, args1
);
52 log_handler (log_domain
, log_level
, msg
);
54 /* Normally log_handler won't return, so we will be leaking this memory */