if (our_type == 0)
our_type = g_boxed_type_register_static ("GIOChannel",
- NULL,
(GBoxedCopyFunc) g_io_channel_ref,
- (GBoxedFreeFunc) g_io_channel_unref,
- FALSE);
+ (GBoxedFreeFunc) g_io_channel_unref);
return our_type;
}
*data = cb_data;
}
-GSourceCallbackFuncs closure_callback_funcs = {
+static GSourceCallbackFuncs closure_callback_funcs = {
(void (*) (gpointer)) g_closure_ref,
(void (*) (gpointer)) g_closure_unref,
closure_callback_get
};
/**
- * g_source_set_callback:
+ * g_source_set_closure:
* @source: the source
- * @func: a #GClosure
+ * @closure: a #GClosure
*
* Set the callback for a source as a #GClosure.
*
- * If the source is not one of the standard GLib types, the closure_callback
- * and closure_marshal fields of the GSourceFuncs structure must have been
+ * If the source is not one of the standard GLib types, the @closure_callback
+ * and @closure_marshal fields of the GSourceFuncs structure must have been
* filled in with pointers to appropriate functions.
**/
void
g_source_set_closure (GSource *source,
GClosure *closure)
{
+ g_return_if_fail (source != NULL);
+ g_return_if_fail (closure != NULL);
+
if (!source->source_funcs->closure_callback &&
source->source_funcs != &g_io_watch_funcs &&
source->source_funcs != &g_timeout_funcs &&