Optimize the common cases (init == NULL or init == "") a bit. replace uses
[platform/upstream/glib.git] / gobject / gclosure.h
index 39531d2..ecb5e3f 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
 #ifndef __G_CLOSURE_H__
 #define __G_CLOSURE_H__
 
-
 #include        <gobject/gtype.h>
 
 G_BEGIN_DECLS
 
 /* --- defines --- */
 #define        G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL)
+#define        G_CLOSURE_N_NOTIFIERS(cl)        ((cl)->meta_marshal + ((cl)->n_guards << 1L) + \
+                                          (cl)->n_fnotifiers + (cl)->n_inotifiers)
 #define        G_CCLOSURE_SWAP_DATA(cclosure)   (((GClosure*) (closure))->derivative_flag)
 #define        G_CALLBACK(f)                    ((GCallback) (f))
 
@@ -33,7 +38,7 @@ G_BEGIN_DECLS
 /* -- typedefs --- */
 typedef struct _GClosure                GClosure;
 typedef struct _GClosureNotifyData      GClosureNotifyData;
-typedef        gpointer                         GCallback;
+typedef void  (*GCallback)              (void);
 typedef void  (*GClosureNotify)                (gpointer        data,
                                         GClosure       *closure);
 typedef void  (*GClosureMarshal)       (GClosure       *closure,
@@ -61,7 +66,7 @@ struct _GClosure
   /*< private >*/      guint    in_inotify : 1;
   /*< private >*/      guint    floating : 1;
   /*< protected >*/    guint    derivative_flag : 1;
-  /*< puplic >*/       guint    in_marshal : 1;
+  /*< public >*/       guint    in_marshal : 1;
   /*< public >*/       guint    is_invalid : 1;
 
   /*< private >*/      void   (*marshal)  (GClosure       *closure,
@@ -141,7 +146,6 @@ void          g_closure_invoke                      (GClosure       *closure,
                                                 const GValue   *param_values,
                                                 gpointer        invocation_hint);
 
-
 /* FIXME:
    OK:  data_object::destroy           -> closure_invalidate();
    MIS:        closure_invalidate()            -> disconnect(closure);