Add an mmap() wrapper called GMappedFile. (#148218, David Schleef, Behdad
[platform/upstream/glib.git] / glib / gmain.h
index 49e8acc..2bbf607 100644 (file)
@@ -32,7 +32,9 @@ typedef struct _GSourceCallbackFuncs  GSourceCallbackFuncs;
 typedef struct _GSourceFuncs           GSourceFuncs;
 
 typedef gboolean (*GSourceFunc)       (gpointer data);
-
+typedef void     (*GChildWatchFunc)   (GPid     pid,
+                                      gint     status,
+                                      gpointer data);
 struct _GSource
 {
   /*< private >*/
@@ -52,6 +54,9 @@ struct _GSource
   
   GSource *prev;
   GSource *next;
+
+  gpointer reserved1;
+  gpointer reserved2;
 };
 
 struct _GSourceCallbackFuncs
@@ -69,7 +74,7 @@ typedef void (*GSourceDummyMarshal) (void);
 struct _GSourceFuncs
 {
   gboolean (*prepare)  (GSource    *source,
-                       gint       *timeout);
+                       gint       *timeout_);
   gboolean (*check)    (GSource    *source);
   gboolean (*dispatch) (GSource    *source,
                        GSourceFunc callback,
@@ -97,8 +102,7 @@ struct _GSourceFuncs
  * WSAEventSelect to signal events when a SOCKET is readable).
  *
  * On Win32, fd can also be the special value G_WIN32_MSG_HANDLE to
- * indicate polling for messages. These message queue GPollFDs should
- * be added with the g_main_poll_win32_msg_add function.
+ * indicate polling for messages.
  *
  * But note that G_WIN32_MSG_HANDLE GPollFDs should not be used by GDK
  * (GTK) programs, as GDK itself wants to read messages and convert them
@@ -112,7 +116,7 @@ struct _GSourceFuncs
 typedef struct _GPollFD GPollFD;
 typedef gint   (*GPollFunc)    (GPollFD *ufds,
                                 guint    nfsd,
-                                gint     timeout);
+                                gint     timeout_);
 
 struct _GPollFD
 {
@@ -132,7 +136,7 @@ struct _GPollFD
 /* GMainContext: */
 
 GMainContext *g_main_context_new       (void);
-void          g_main_context_ref       (GMainContext *context);
+GMainContext *g_main_context_ref       (GMainContext *context);
 void          g_main_context_unref     (GMainContext *context);
 GMainContext *g_main_context_default   (void);
 
@@ -163,7 +167,7 @@ gboolean g_main_context_prepare  (GMainContext *context,
                                  gint         *priority);
 gint     g_main_context_query    (GMainContext *context,
                                  gint          max_priority,
-                                 gint         *timeout,
+                                 gint         *timeout_,
                                  GPollFD      *fds,
                                  gint          n_fds);
 gint     g_main_context_check    (GMainContext *context,
@@ -184,6 +188,8 @@ void g_main_context_add_poll      (GMainContext *context,
 void g_main_context_remove_poll   (GMainContext *context,
                                   GPollFD      *fd);
 
+int g_main_depth (void);
+
 /* GMainLoop: */
 
 GMainLoop *g_main_loop_new        (GMainContext *context,
@@ -241,8 +247,9 @@ void     g_source_get_current_time (GSource        *source,
 
 /* Specific source types
  */
-GSource *g_idle_source_new    (void);
-GSource *g_timeout_source_new (guint         interval);
+GSource *g_idle_source_new        (void);
+GSource *g_child_watch_source_new (GPid pid);
+GSource *g_timeout_source_new     (guint interval);
 
 /* Miscellaneous functions
  */
@@ -276,37 +283,36 @@ gboolean g_source_remove_by_user_data        (gpointer       user_data);
 gboolean g_source_remove_by_funcs_user_data  (GSourceFuncs  *funcs,
                                              gpointer       user_data);
 
-/* Idles and timeouts */
-guint          g_timeout_add_full      (gint           priority,
-                                        guint          interval, 
-                                        GSourceFunc    function,
-                                        gpointer       data,
-                                        GDestroyNotify notify);
-guint          g_timeout_add           (guint          interval,
-                                        GSourceFunc    function,
-                                        gpointer       data);
-guint          g_idle_add              (GSourceFunc    function,
-                                        gpointer       data);
-guint          g_idle_add_full         (gint           priority,
-                                        GSourceFunc    function,
-                                        gpointer       data,
-                                        GDestroyNotify notify);
-gboolean       g_idle_remove_by_data   (gpointer       data);
+/* Idles, child watchers and timeouts */
+guint    g_timeout_add_full     (gint            priority,
+                                guint           interval,
+                                GSourceFunc     function,
+                                gpointer        data,
+                                GDestroyNotify  notify);
+guint    g_timeout_add          (guint           interval,
+                                GSourceFunc     function,
+                                gpointer        data);
+guint    g_child_watch_add_full (gint            priority,
+                                GPid            pid,
+                                GChildWatchFunc function,
+                                gpointer        data,
+                                GDestroyNotify  notify);
+guint    g_child_watch_add      (GPid            pid,
+                                GChildWatchFunc function,
+                                gpointer        data);
+guint    g_idle_add             (GSourceFunc     function,
+                                gpointer        data);
+guint    g_idle_add_full        (gint            priority,
+                                GSourceFunc     function,
+                                gpointer        data,
+                                GDestroyNotify  notify);
+gboolean g_idle_remove_by_data  (gpointer        data);
 
 /* Hook for GClosure / GSource integration. Don't touch */
 GLIB_VAR GSourceFuncs g_timeout_funcs;
+GLIB_VAR GSourceFuncs g_child_watch_funcs;
 GLIB_VAR GSourceFuncs g_idle_funcs;
 
-#ifdef G_OS_WIN32
-
-/* This is used to add polling for Windows messages. GDK (GTK+) programs
- * should *not* use this.
- */
-void        g_main_poll_win32_msg_add (gint        priority,
-                                      GPollFD    *fd,
-                                      guint       hwnd);
-#endif /* G_OS_WIN32 */
-
 G_END_DECLS
 
 #endif /* __G_MAIN_H__ */