GVariant: add internal tree-form locking helper
[platform/upstream/glib.git] / glib / glib-private.h
1 /* glib-private.h - GLib-internal private API, shared between glib, gobject, gio
2  * Copyright (C) 2011 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library 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.
8  *
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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #ifndef __GLIB_PRIVATE_H__
19 #define __GLIB_PRIVATE_H__
20
21 #include <glib.h>
22 #include "gwakeup.h"
23
24 #if defined(__GNUC__)
25 # define _g_alignof(type) (__alignof__ (type))
26 #else
27 # define _g_alignof(type) (G_STRUCT_OFFSET (struct { char a; type b; }, b))
28 #endif
29
30 GMainContext *          g_get_worker_context            (void);
31 gboolean                g_check_setuid                  (void);
32 GMainContext *          g_main_context_new_with_next_id (guint next_id);
33
34 #ifdef G_OS_WIN32
35 gchar *_glib_get_dll_directory (void);
36 GLIB_AVAILABLE_IN_ALL
37 gchar *_glib_get_locale_dir    (void);
38 #endif
39
40 GDir * g_dir_open_with_errno (const gchar *path, guint flags);
41 GDir * g_dir_new_from_dirp (gpointer dirp);
42
43 #define GLIB_PRIVATE_CALL(symbol) (glib__private__()->symbol)
44
45 typedef struct {
46   /* See gwakeup.c */
47   GWakeup *             (* g_wakeup_new)                (void);
48   void                  (* g_wakeup_free)               (GWakeup *wakeup);
49   void                  (* g_wakeup_get_pollfd)         (GWakeup *wakeup,
50                                                         GPollFD *poll_fd);
51   void                  (* g_wakeup_signal)             (GWakeup *wakeup);
52   void                  (* g_wakeup_acknowledge)        (GWakeup *wakeup);
53
54   /* See gmain.c */
55   GMainContext *        (* g_get_worker_context)        (void);
56
57   gboolean              (* g_check_setuid)              (void);
58   GMainContext *        (* g_main_context_new_with_next_id) (guint next_id);
59
60   GDir *                (* g_dir_open_with_errno)       (const gchar *path,
61                                                          guint        flags);
62   GDir *                (* g_dir_new_from_dirp)         (gpointer dirp);
63
64   /* Add other private functions here, initialize them in glib-private.c */
65 } GLibPrivateVTable;
66
67 GLIB_AVAILABLE_IN_ALL
68 GLibPrivateVTable *glib__private__ (void);
69
70 #endif /* __GLIB_PRIVATE_H__ */