user_data argument to a signal's class_closure which is a class function pointer member



hi,

While trying some GSignal code, I started using g_signal_new which
creates a signal whose default handler is a function pointer, member of
a structure.

While doing this, I actually tried reading the user_data argument of
this default handler even though none is explicitely provided in the API
and was surprised to see something not zero come out of it. 

Some source code reading in gsignal.c shows the function named
g_signal_type_cclosure_new which calls  closure = g_closure_new_simple
(sizeof (GClosure), (gpointer) itype);

Here, the itype argument to the g_closure_new_simple function is indeed
an arbitrary value for the user_data argument of my signal's default
handler. So, the question is: is this special value part of the
officially exported API ? If not, would it be possible to set it to zero
(or something like 0xdeadbeef) instead ?

regards,
Mathieu
-- 
Mathieu Lacage <mathieu gnu org>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]