summaryrefslogtreecommitdiff
path: root/include/glib
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-08-03 21:02:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-08-03 21:02:36 +0300
commit5323a782c4e8c42781f22ce2f488962a18f82554 (patch)
treef71537197b16f0f8fd0d6937f7120d018d220814 /include/glib
parent50acf9d37183f86f6f623aad410003392b0af41f (diff)
Jabber: initial version of Jingle support
Diffstat (limited to 'include/glib')
-rw-r--r--include/glib/gio/gaction.h98
-rw-r--r--include/glib/gio/gactiongroup.h161
-rw-r--r--include/glib/gio/gactiongroupexporter.h45
-rw-r--r--include/glib/gio/gactionmap.h95
-rw-r--r--include/glib/gio/gappinfo.h347
-rw-r--r--include/glib/gio/gapplication.h252
-rw-r--r--include/glib/gio/gapplicationcommandline.h122
-rw-r--r--include/glib/gio/gasyncinitable.h130
-rw-r--r--include/glib/gio/gasyncresult.h85
-rw-r--r--include/glib/gio/gbufferedinputstream.h133
-rw-r--r--include/glib/gio/gbufferedoutputstream.h86
-rw-r--r--include/glib/gio/gbytesicon.h52
-rw-r--r--include/glib/gio/gcancellable.h118
-rw-r--r--include/glib/gio/gcharsetconverter.h63
-rw-r--r--include/glib/gio/gcontenttype.h82
-rw-r--r--include/glib/gio/gconverter.h96
-rw-r--r--include/glib/gio/gconverterinputstream.h80
-rw-r--r--include/glib/gio/gconverteroutputstream.h80
-rw-r--r--include/glib/gio/gcredentials.h85
-rw-r--r--include/glib/gio/gdatagrambased.h144
-rw-r--r--include/glib/gio/gdatainputstream.h180
-rw-r--r--include/glib/gio/gdataoutputstream.h125
-rw-r--r--include/glib/gio/gdbusactiongroup.h54
-rw-r--r--include/glib/gio/gdbusaddress.h65
-rw-r--r--include/glib/gio/gdbusauthobserver.h51
-rw-r--r--include/glib/gio/gdbusconnection.h683
-rw-r--r--include/glib/gio/gdbuserror.h109
-rw-r--r--include/glib/gio/gdbusinterface.h81
-rw-r--r--include/glib/gio/gdbusinterfaceskeleton.h127
-rw-r--r--include/glib/gio/gdbusintrospection.h325
-rw-r--r--include/glib/gio/gdbusmenumodel.h45
-rw-r--r--include/glib/gio/gdbusmessage.h197
-rw-r--r--include/glib/gio/gdbusmethodinvocation.h97
-rw-r--r--include/glib/gio/gdbusnameowning.h115
-rw-r--r--include/glib/gio/gdbusnamewatching.h102
-rw-r--r--include/glib/gio/gdbusobject.h78
-rw-r--r--include/glib/gio/gdbusobjectmanager.h94
-rw-r--r--include/glib/gio/gdbusobjectmanagerclient.h146
-rw-r--r--include/glib/gio/gdbusobjectmanagerserver.h93
-rw-r--r--include/glib/gio/gdbusobjectproxy.h79
-rw-r--r--include/glib/gio/gdbusobjectskeleton.h96
-rw-r--r--include/glib/gio/gdbusproxy.h214
-rw-r--r--include/glib/gio/gdbusserver.h60
-rw-r--r--include/glib/gio/gdbusutils.h55
-rw-r--r--include/glib/gio/gdrive.h272
-rw-r--r--include/glib/gio/gdtlsclientconnection.h75
-rw-r--r--include/glib/gio/gdtlsconnection.h206
-rw-r--r--include/glib/gio/gdtlsserverconnection.h69
-rw-r--r--include/glib/gio/gemblem.h61
-rw-r--r--include/glib/gio/gemblemedicon.h81
-rw-r--r--include/glib/gio/gfile.h1285
-rw-r--r--include/glib/gio/gfileattribute.h84
-rw-r--r--include/glib/gio/gfileenumerator.h152
-rw-r--r--include/glib/gio/gfileicon.h57
-rw-r--r--include/glib/gio/gfileinfo.h1144
-rw-r--r--include/glib/gio/gfileinputstream.h114
-rw-r--r--include/glib/gio/gfileiostream.h121
-rw-r--r--include/glib/gio/gfilemonitor.h98
-rw-r--r--include/glib/gio/gfilenamecompleter.h79
-rw-r--r--include/glib/gio/gfileoutputstream.h122
-rw-r--r--include/glib/gio/gfilterinputstream.h78
-rw-r--r--include/glib/gio/gfilteroutputstream.h78
-rw-r--r--include/glib/gio/gicon.h102
-rw-r--r--include/glib/gio/ginetaddress.h124
-rw-r--r--include/glib/gio/ginetaddressmask.h85
-rw-r--r--include/glib/gio/ginetsocketaddress.h78
-rw-r--r--include/glib/gio/ginitable.h105
-rw-r--r--include/glib/gio/ginputstream.h216
-rw-r--r--include/glib/gio/gio-autocleanups.h153
-rw-r--r--include/glib/gio/gio.h177
-rw-r--r--include/glib/gio/gioenums.h1969
-rw-r--r--include/glib/gio/gioenumtypes.h177
-rw-r--r--include/glib/gio/gioerror.h53
-rw-r--r--include/glib/gio/giomodule.h193
-rw-r--r--include/glib/gio/gioscheduler.h54
-rw-r--r--include/glib/gio/giostream.h135
-rw-r--r--include/glib/gio/giotypes.h654
-rw-r--r--include/glib/gio/glistmodel.h72
-rw-r--r--include/glib/gio/gliststore.h77
-rw-r--r--include/glib/gio/gloadableicon.h99
-rw-r--r--include/glib/gio/gmemoryinputstream.h90
-rw-r--r--include/glib/gio/gmemoryoutputstream.h107
-rw-r--r--include/glib/gio/gmenu.h182
-rw-r--r--include/glib/gio/gmenuexporter.h40
-rw-r--r--include/glib/gio/gmenumodel.h305
-rw-r--r--include/glib/gio/gmount.h276
-rw-r--r--include/glib/gio/gmountoperation.h177
-rw-r--r--include/glib/gio/gnativesocketaddress.h65
-rw-r--r--include/glib/gio/gnativevolumemonitor.h61
-rw-r--r--include/glib/gio/gnetworkaddress.h80
-rw-r--r--include/glib/gio/gnetworking.h82
-rw-r--r--include/glib/gio/gnetworkmonitor.h99
-rw-r--r--include/glib/gio/gnetworkservice.h76
-rw-r--r--include/glib/gio/gnotification.h97
-rw-r--r--include/glib/gio/goutputstream.h332
-rw-r--r--include/glib/gio/gpermission.h127
-rw-r--r--include/glib/gio/gpollableinputstream.h105
-rw-r--r--include/glib/gio/gpollableoutputstream.h126
-rw-r--r--include/glib/gio/gpollableutils.h64
-rw-r--r--include/glib/gio/gpropertyaction.h47
-rw-r--r--include/glib/gio/gproxy.h128
-rw-r--r--include/glib/gio/gproxyaddress.h86
-rw-r--r--include/glib/gio/gproxyaddressenumerator.h81
-rw-r--r--include/glib/gio/gproxyresolver.h95
-rw-r--r--include/glib/gio/gremoteactiongroup.h75
-rw-r--r--include/glib/gio/gresolver.h292
-rw-r--r--include/glib/gio/gresource.h130
-rw-r--r--include/glib/gio/gseekable.h103
-rw-r--r--include/glib/gio/gsettings.h345
-rw-r--r--include/glib/gio/gsettingsbackend.h174
-rw-r--r--include/glib/gio/gsettingsschema.h112
-rw-r--r--include/glib/gio/gsimpleaction.h63
-rw-r--r--include/glib/gio/gsimpleactiongroup.h97
-rw-r--r--include/glib/gio/gsimpleasyncresult.h162
-rw-r--r--include/glib/gio/gsimpleiostream.h45
-rw-r--r--include/glib/gio/gsimplepermission.h45
-rw-r--r--include/glib/gio/gsimpleproxyresolver.h89
-rw-r--r--include/glib/gio/gsocket.h328
-rw-r--r--include/glib/gio/gsocketaddress.h82
-rw-r--r--include/glib/gio/gsocketaddressenumerator.h101
-rw-r--r--include/glib/gio/gsocketclient.h197
-rw-r--r--include/glib/gio/gsocketconnectable.h81
-rw-r--r--include/glib/gio/gsocketconnection.h115
-rw-r--r--include/glib/gio/gsocketcontrolmessage.h111
-rw-r--r--include/glib/gio/gsocketlistener.h155
-rw-r--r--include/glib/gio/gsocketservice.h93
-rw-r--r--include/glib/gio/gsrvtarget.h59
-rw-r--r--include/glib/gio/gsubprocess.h167
-rw-r--r--include/glib/gio/gsubprocesslauncher.h116
-rw-r--r--include/glib/gio/gtask.h165
-rw-r--r--include/glib/gio/gtcpconnection.h69
-rw-r--r--include/glib/gio/gtcpwrapperconnection.h69
-rw-r--r--include/glib/gio/gtestdbus.h72
-rw-r--r--include/glib/gio/gthemedicon.h68
-rw-r--r--include/glib/gio/gthreadedsocketservice.h81
-rw-r--r--include/glib/gio/gtlsbackend.h113
-rw-r--r--include/glib/gio/gtlscertificate.h92
-rw-r--r--include/glib/gio/gtlsclientconnection.h86
-rw-r--r--include/glib/gio/gtlsconnection.h163
-rw-r--r--include/glib/gio/gtlsdatabase.h247
-rw-r--r--include/glib/gio/gtlsfiledatabase.h58
-rw-r--r--include/glib/gio/gtlsinteraction.h148
-rw-r--r--include/glib/gio/gtlspassword.h119
-rw-r--r--include/glib/gio/gtlsserverconnection.h69
-rw-r--r--include/glib/gio/gvfs.h168
-rw-r--r--include/glib/gio/gvolume.h253
-rw-r--r--include/glib/gio/gvolumemonitor.h154
-rw-r--r--include/glib/gio/gzlibcompressor.h62
-rw-r--r--include/glib/gio/gzlibdecompressor.h58
-rw-r--r--include/glib/glib-object.h43
-rw-r--r--include/glib/glib-unix.h119
-rw-r--r--include/glib/glib.h116
-rw-r--r--include/glib/glib/deprecated/gallocator.h88
-rw-r--r--include/glib/glib/deprecated/gcache.h75
-rw-r--r--include/glib/glib/deprecated/gcompletion.h83
-rw-r--r--include/glib/glib/deprecated/gmain.h135
-rw-r--r--include/glib/glib/deprecated/grel.h105
-rw-r--r--include/glib/glib/deprecated/gthread.h289
-rw-r--r--include/glib/glib/galloca.h103
-rw-r--r--include/glib/glib/garray.h272
-rw-r--r--include/glib/glib/gasyncqueue.h124
-rw-r--r--include/glib/glib/gatomic.h291
-rw-r--r--include/glib/glib/gbacktrace.h72
-rw-r--r--include/glib/glib/gbase64.h61
-rw-r--r--include/glib/glib/gbitlock.h76
-rw-r--r--include/glib/glib/gbookmarkfile.h254
-rw-r--r--include/glib/glib/gbytes.h90
-rw-r--r--include/glib/glib/gcharset.h47
-rw-r--r--include/glib/glib/gchecksum.h103
-rw-r--r--include/glib/glib/gconvert.h177
-rw-r--r--include/glib/glib/gdataset.h150
-rw-r--r--include/glib/glib/gdate.h307
-rw-r--r--include/glib/glib/gdatetime.h274
-rw-r--r--include/glib/glib/gdir.h52
-rw-r--r--include/glib/glib/genviron.h63
-rw-r--r--include/glib/glib/gerror.h117
-rw-r--r--include/glib/glib/gfileutils.h179
-rw-r--r--include/glib/glib/ggettext.h63
-rw-r--r--include/glib/glib/ghash.h188
-rw-r--r--include/glib/glib/ghmac.h83
-rw-r--r--include/glib/glib/ghook.h202
-rw-r--r--include/glib/glib/ghostutils.h43
-rw-r--r--include/glib/glib/gi18n-lib.h36
-rw-r--r--include/glib/glib/gi18n.h32
-rw-r--r--include/glib/glib/giochannel.h404
-rw-r--r--include/glib/glib/gkeyfile.h330
-rw-r--r--include/glib/glib/glib-autocleanups.h93
-rw-r--r--include/glib/glib/glist.h156
-rw-r--r--include/glib/glib/gmacros.h1099
-rw-r--r--include/glib/glib/gmain.h689
-rw-r--r--include/glib/glib/gmappedfile.h58
-rw-r--r--include/glib/glib/gmarkup.h261
-rw-r--r--include/glib/glib/gmem.h392
-rw-r--r--include/glib/glib/gmessages.h636
-rw-r--r--include/glib/glib/gnode.h307
-rw-r--r--include/glib/glib/goption.h388
-rw-r--r--include/glib/glib/gpattern.h53
-rw-r--r--include/glib/glib/gpoll.h120
-rw-r--r--include/glib/glib/gprimes.h50
-rw-r--r--include/glib/glib/gprintf.h57
-rw-r--r--include/glib/glib/gqsort.h45
-rw-r--r--include/glib/glib/gquark.h68
-rw-r--r--include/glib/glib/gqueue.h203
-rw-r--r--include/glib/glib/grand.h99
-rw-r--r--include/glib/glib/grcbox.h88
-rw-r--r--include/glib/glib/grefcount.h123
-rw-r--r--include/glib/glib/grefstring.h57
-rw-r--r--include/glib/glib/gregex.h609
-rw-r--r--include/glib/glib/gscanner.h299
-rw-r--r--include/glib/glib/gsequence.h173
-rw-r--r--include/glib/glib/gshell.h57
-rw-r--r--include/glib/glib/gslice.h99
-rw-r--r--include/glib/glib/gslist.h143
-rw-r--r--include/glib/glib/gspawn.h265
-rw-r--r--include/glib/glib/gstdio.h177
-rw-r--r--include/glib/glib/gstrfuncs.h362
-rw-r--r--include/glib/glib/gstring.h187
-rw-r--r--include/glib/glib/gstringchunk.h57
-rw-r--r--include/glib/glib/gtestutils.h605
-rw-r--r--include/glib/glib/gthread.h556
-rw-r--r--include/glib/glib/gthreadpool.h96
-rw-r--r--include/glib/glib/gtimer.h78
-rw-r--r--include/glib/glib/gtimezone.h93
-rw-r--r--include/glib/glib/gtrashstack.h58
-rw-r--r--include/glib/glib/gtree.h104
-rw-r--r--include/glib/glib/gtypes.h585
-rw-r--r--include/glib/glib/gunicode.h929
-rw-r--r--include/glib/glib/gurifuncs.h83
-rw-r--r--include/glib/glib/gutils.h364
-rw-r--r--include/glib/glib/guuid.h42
-rw-r--r--include/glib/glib/gvariant.h521
-rw-r--r--include/glib/glib/gvarianttype.h382
-rw-r--r--include/glib/glib/gversion.h55
-rw-r--r--include/glib/glib/gversionmacros.h923
-rw-r--r--include/glib/glib/gwin32.h140
-rw-r--r--include/glib/glibconfig.h216
-rw-r--r--include/glib/gmodule.h117
-rw-r--r--include/glib/gobject/gbinding.h149
-rw-r--r--include/glib/gobject/gboxed.h122
-rw-r--r--include/glib/gobject/gclosure.h317
-rw-r--r--include/glib/gobject/genums.h279
-rw-r--r--include/glib/gobject/glib-enumtypes.h25
-rw-r--r--include/glib/gobject/glib-types.h362
-rw-r--r--include/glib/gobject/gmarshal.h434
-rw-r--r--include/glib/gobject/gobject-autocleanups.h31
-rw-r--r--include/glib/gobject/gobject.h899
-rw-r--r--include/glib/gobject/gobjectnotifyqueue.c197
-rw-r--r--include/glib/gobject/gparam.h452
-rw-r--r--include/glib/gobject/gparamspecs.h1170
-rw-r--r--include/glib/gobject/gsignal.h623
-rw-r--r--include/glib/gobject/gsourceclosure.h38
-rw-r--r--include/glib/gobject/gtype.h2356
-rw-r--r--include/glib/gobject/gtypemodule.h295
-rw-r--r--include/glib/gobject/gtypeplugin.h134
-rw-r--r--include/glib/gobject/gvalue.h196
-rw-r--r--include/glib/gobject/gvaluearray.h104
-rw-r--r--include/glib/gobject/gvaluecollector.h261
-rw-r--r--include/glib/gobject/gvaluetypes.h300
-rw-r--r--include/glib/msvc_recommended_pragmas.h34
259 files changed, 50344 insertions, 0 deletions
diff --git a/include/glib/gio/gaction.h b/include/glib/gio/gaction.h
new file mode 100644
index 0000000000..f9f4b38e7d
--- /dev/null
+++ b/include/glib/gio/gaction.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_ACTION_H__
+#define __G_ACTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ACTION (g_action_get_type ())
+#define G_ACTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_ACTION, GAction))
+#define G_IS_ACTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_ACTION))
+#define G_ACTION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
+ G_TYPE_ACTION, GActionInterface))
+
+typedef struct _GActionInterface GActionInterface;
+
+struct _GActionInterface
+{
+ GTypeInterface g_iface;
+
+ /* virtual functions */
+ const gchar * (* get_name) (GAction *action);
+ const GVariantType * (* get_parameter_type) (GAction *action);
+ const GVariantType * (* get_state_type) (GAction *action);
+ GVariant * (* get_state_hint) (GAction *action);
+
+ gboolean (* get_enabled) (GAction *action);
+ GVariant * (* get_state) (GAction *action);
+
+ void (* change_state) (GAction *action,
+ GVariant *value);
+ void (* activate) (GAction *action,
+ GVariant *parameter);
+};
+
+GLIB_AVAILABLE_IN_2_30
+GType g_action_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_action_get_name (GAction *action);
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_action_get_parameter_type (GAction *action);
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_action_get_state_type (GAction *action);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_action_get_state_hint (GAction *action);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_action_get_enabled (GAction *action);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_action_get_state (GAction *action);
+
+GLIB_AVAILABLE_IN_ALL
+void g_action_change_state (GAction *action,
+ GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+void g_action_activate (GAction *action,
+ GVariant *parameter);
+
+GLIB_AVAILABLE_IN_2_28
+gboolean g_action_name_is_valid (const gchar *action_name);
+
+GLIB_AVAILABLE_IN_2_38
+gboolean g_action_parse_detailed_name (const gchar *detailed_name,
+ gchar **action_name,
+ GVariant **target_value,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_38
+gchar * g_action_print_detailed_name (const gchar *action_name,
+ GVariant *target_value);
+
+G_END_DECLS
+
+#endif /* __G_ACTION_H__ */
diff --git a/include/glib/gio/gactiongroup.h b/include/glib/gio/gactiongroup.h
new file mode 100644
index 0000000000..bba8a236b7
--- /dev/null
+++ b/include/glib/gio/gactiongroup.h
@@ -0,0 +1,161 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_ACTION_GROUP_H__
+#define __G_ACTION_GROUP_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+
+#define G_TYPE_ACTION_GROUP (g_action_group_get_type ())
+#define G_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_ACTION_GROUP, GActionGroup))
+#define G_IS_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_ACTION_GROUP))
+#define G_ACTION_GROUP_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
+ G_TYPE_ACTION_GROUP, GActionGroupInterface))
+
+typedef struct _GActionGroupInterface GActionGroupInterface;
+
+struct _GActionGroupInterface
+{
+ GTypeInterface g_iface;
+
+ /* virtual functions */
+ gboolean (* has_action) (GActionGroup *action_group,
+ const gchar *action_name);
+
+ gchar ** (* list_actions) (GActionGroup *action_group);
+
+ gboolean (* get_action_enabled) (GActionGroup *action_group,
+ const gchar *action_name);
+
+ const GVariantType * (* get_action_parameter_type) (GActionGroup *action_group,
+ const gchar *action_name);
+
+ const GVariantType * (* get_action_state_type) (GActionGroup *action_group,
+ const gchar *action_name);
+
+ GVariant * (* get_action_state_hint) (GActionGroup *action_group,
+ const gchar *action_name);
+
+ GVariant * (* get_action_state) (GActionGroup *action_group,
+ const gchar *action_name);
+
+ void (* change_action_state) (GActionGroup *action_group,
+ const gchar *action_name,
+ GVariant *value);
+
+ void (* activate_action) (GActionGroup *action_group,
+ const gchar *action_name,
+ GVariant *parameter);
+
+ /* signals */
+ void (* action_added) (GActionGroup *action_group,
+ const gchar *action_name);
+ void (* action_removed) (GActionGroup *action_group,
+ const gchar *action_name);
+ void (* action_enabled_changed) (GActionGroup *action_group,
+ const gchar *action_name,
+ gboolean enabled);
+ void (* action_state_changed) (GActionGroup *action_group,
+ const gchar *action_name,
+ GVariant *state);
+
+ /* more virtual functions */
+ gboolean (* query_action) (GActionGroup *action_group,
+ const gchar *action_name,
+ gboolean *enabled,
+ const GVariantType **parameter_type,
+ const GVariantType **state_type,
+ GVariant **state_hint,
+ GVariant **state);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_action_group_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_action_group_has_action (GActionGroup *action_group,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_action_group_list_actions (GActionGroup *action_group);
+
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_action_group_get_action_parameter_type (GActionGroup *action_group,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_action_group_get_action_state_type (GActionGroup *action_group,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_action_group_get_action_state_hint (GActionGroup *action_group,
+ const gchar *action_name);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_action_group_get_action_enabled (GActionGroup *action_group,
+ const gchar *action_name);
+
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_action_group_get_action_state (GActionGroup *action_group,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_ALL
+void g_action_group_change_action_state (GActionGroup *action_group,
+ const gchar *action_name,
+ GVariant *value);
+
+GLIB_AVAILABLE_IN_ALL
+void g_action_group_activate_action (GActionGroup *action_group,
+ const gchar *action_name,
+ GVariant *parameter);
+
+/* signals */
+GLIB_AVAILABLE_IN_ALL
+void g_action_group_action_added (GActionGroup *action_group,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_ALL
+void g_action_group_action_removed (GActionGroup *action_group,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_ALL
+void g_action_group_action_enabled_changed (GActionGroup *action_group,
+ const gchar *action_name,
+ gboolean enabled);
+
+GLIB_AVAILABLE_IN_ALL
+void g_action_group_action_state_changed (GActionGroup *action_group,
+ const gchar *action_name,
+ GVariant *state);
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_action_group_query_action (GActionGroup *action_group,
+ const gchar *action_name,
+ gboolean *enabled,
+ const GVariantType **parameter_type,
+ const GVariantType **state_type,
+ GVariant **state_hint,
+ GVariant **state);
+
+G_END_DECLS
+
+#endif /* __G_ACTION_GROUP_H__ */
diff --git a/include/glib/gio/gactiongroupexporter.h b/include/glib/gio/gactiongroupexporter.h
new file mode 100644
index 0000000000..ba28c8954b
--- /dev/null
+++ b/include/glib/gio/gactiongroupexporter.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ * Copyright © 2011 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+
+#ifndef __G_ACTION_GROUP_EXPORTER_H__
+#define __G_ACTION_GROUP_EXPORTER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_32
+guint g_dbus_connection_export_action_group (GDBusConnection *connection,
+ const gchar *object_path,
+ GActionGroup *action_group,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_32
+void g_dbus_connection_unexport_action_group (GDBusConnection *connection,
+ guint export_id);
+
+G_END_DECLS
+
+#endif /* __G_ACTION_GROUP_EXPORTER_H__ */
diff --git a/include/glib/gio/gactionmap.h b/include/glib/gio/gactionmap.h
new file mode 100644
index 0000000000..2a22a27712
--- /dev/null
+++ b/include/glib/gio/gactionmap.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_ACTION_MAP_H__
+#define __G_ACTION_MAP_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+
+#define G_TYPE_ACTION_MAP (g_action_map_get_type ())
+#define G_ACTION_MAP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_ACTION_MAP, GActionMap))
+#define G_IS_ACTION_MAP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_ACTION_MAP))
+#define G_ACTION_MAP_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
+ G_TYPE_ACTION_MAP, GActionMapInterface))
+
+typedef struct _GActionMapInterface GActionMapInterface;
+typedef struct _GActionEntry GActionEntry;
+
+struct _GActionMapInterface
+{
+ GTypeInterface g_iface;
+
+ GAction * (* lookup_action) (GActionMap *action_map,
+ const gchar *action_name);
+ void (* add_action) (GActionMap *action_map,
+ GAction *action);
+ void (* remove_action) (GActionMap *action_map,
+ const gchar *action_name);
+};
+
+struct _GActionEntry
+{
+ const gchar *name;
+
+ void (* activate) (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data);
+
+ const gchar *parameter_type;
+
+ const gchar *state;
+
+ void (* change_state) (GSimpleAction *action,
+ GVariant *value,
+ gpointer user_data);
+
+ /*< private >*/
+ gsize padding[3];
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_action_map_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+GAction * g_action_map_lookup_action (GActionMap *action_map,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_2_32
+void g_action_map_add_action (GActionMap *action_map,
+ GAction *action);
+GLIB_AVAILABLE_IN_2_32
+void g_action_map_remove_action (GActionMap *action_map,
+ const gchar *action_name);
+GLIB_AVAILABLE_IN_2_32
+void g_action_map_add_action_entries (GActionMap *action_map,
+ const GActionEntry *entries,
+ gint n_entries,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __G_ACTION_MAP_H__ */
diff --git a/include/glib/gio/gappinfo.h b/include/glib/gio/gappinfo.h
new file mode 100644
index 0000000000..d26d048a5f
--- /dev/null
+++ b/include/glib/gio/gappinfo.h
@@ -0,0 +1,347 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_APP_INFO_H__
+#define __G_APP_INFO_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_APP_INFO (g_app_info_get_type ())
+#define G_APP_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_APP_INFO, GAppInfo))
+#define G_IS_APP_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_APP_INFO))
+#define G_APP_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_APP_INFO, GAppInfoIface))
+
+#define G_TYPE_APP_LAUNCH_CONTEXT (g_app_launch_context_get_type ())
+#define G_APP_LAUNCH_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContext))
+#define G_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextClass))
+#define G_IS_APP_LAUNCH_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_APP_LAUNCH_CONTEXT))
+#define G_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_APP_LAUNCH_CONTEXT))
+#define G_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextClass))
+
+typedef struct _GAppLaunchContextClass GAppLaunchContextClass;
+typedef struct _GAppLaunchContextPrivate GAppLaunchContextPrivate;
+
+/**
+ * GAppInfo:
+ *
+ * Information about an installed application and methods to launch
+ * it (with file arguments).
+ */
+
+/**
+ * GAppInfoIface:
+ * @g_iface: The parent interface.
+ * @dup: Copies a #GAppInfo.
+ * @equal: Checks two #GAppInfos for equality.
+ * @get_id: Gets a string identifier for a #GAppInfo.
+ * @get_name: Gets the name of the application for a #GAppInfo.
+ * @get_description: Gets a short description for the application described by the #GAppInfo.
+ * @get_executable: Gets the executable name for the #GAppInfo.
+ * @get_icon: Gets the #GIcon for the #GAppInfo.
+ * @launch: Launches an application specified by the #GAppInfo.
+ * @supports_uris: Indicates whether the application specified supports launching URIs.
+ * @supports_files: Indicates whether the application specified accepts filename arguments.
+ * @launch_uris: Launches an application with a list of URIs.
+ * @should_show: Returns whether an application should be shown (e.g. when getting a list of installed applications).
+ * [FreeDesktop.Org Startup Notification Specification](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt).
+ * @set_as_default_for_type: Sets an application as default for a given content type.
+ * @set_as_default_for_extension: Sets an application as default for a given file extension.
+ * @add_supports_type: Adds to the #GAppInfo information about supported file types.
+ * @can_remove_supports_type: Checks for support for removing supported file types from a #GAppInfo.
+ * @remove_supports_type: Removes a supported application type from a #GAppInfo.
+ * @can_delete: Checks if a #GAppInfo can be deleted. Since 2.20
+ * @do_delete: Deletes a #GAppInfo. Since 2.20
+ * @get_commandline: Gets the commandline for the #GAppInfo. Since 2.20
+ * @get_display_name: Gets the display name for the #GAppInfo. Since 2.24
+ * @set_as_last_used_for_type: Sets the application as the last used. See g_app_info_set_as_last_used_for_type().
+ * @get_supported_types: Retrieves the list of content types that @app_info claims to support.
+ * @launch_uris_async: Asynchronously launches an application with a list of URIs. (Since: 2.60)
+ * @launch_uris_finish: Finishes an operation started with @launch_uris_async. (Since: 2.60)
+
+ * Application Information interface, for operating system portability.
+ */
+typedef struct _GAppInfoIface GAppInfoIface;
+
+struct _GAppInfoIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ GAppInfo * (* dup) (GAppInfo *appinfo);
+ gboolean (* equal) (GAppInfo *appinfo1,
+ GAppInfo *appinfo2);
+ const char * (* get_id) (GAppInfo *appinfo);
+ const char * (* get_name) (GAppInfo *appinfo);
+ const char * (* get_description) (GAppInfo *appinfo);
+ const char * (* get_executable) (GAppInfo *appinfo);
+ GIcon * (* get_icon) (GAppInfo *appinfo);
+ gboolean (* launch) (GAppInfo *appinfo,
+ GList *files,
+ GAppLaunchContext *context,
+ GError **error);
+ gboolean (* supports_uris) (GAppInfo *appinfo);
+ gboolean (* supports_files) (GAppInfo *appinfo);
+ gboolean (* launch_uris) (GAppInfo *appinfo,
+ GList *uris,
+ GAppLaunchContext *context,
+ GError **error);
+ gboolean (* should_show) (GAppInfo *appinfo);
+
+ /* For changing associations */
+ gboolean (* set_as_default_for_type) (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+ gboolean (* set_as_default_for_extension) (GAppInfo *appinfo,
+ const char *extension,
+ GError **error);
+ gboolean (* add_supports_type) (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+ gboolean (* can_remove_supports_type) (GAppInfo *appinfo);
+ gboolean (* remove_supports_type) (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+ gboolean (* can_delete) (GAppInfo *appinfo);
+ gboolean (* do_delete) (GAppInfo *appinfo);
+ const char * (* get_commandline) (GAppInfo *appinfo);
+ const char * (* get_display_name) (GAppInfo *appinfo);
+ gboolean (* set_as_last_used_for_type) (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+ const char ** (* get_supported_types) (GAppInfo *appinfo);
+ void (* launch_uris_async) (GAppInfo *appinfo,
+ GList *uris,
+ GAppLaunchContext *context,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* launch_uris_finish) (GAppInfo *appinfo,
+ GAsyncResult *result,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_app_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GAppInfo * g_app_info_create_from_commandline (const char *commandline,
+ const char *application_name,
+ GAppInfoCreateFlags flags,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GAppInfo * g_app_info_dup (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_equal (GAppInfo *appinfo1,
+ GAppInfo *appinfo2);
+GLIB_AVAILABLE_IN_ALL
+const char *g_app_info_get_id (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+const char *g_app_info_get_name (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+const char *g_app_info_get_display_name (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+const char *g_app_info_get_description (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+const char *g_app_info_get_executable (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+const char *g_app_info_get_commandline (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_app_info_get_icon (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_launch (GAppInfo *appinfo,
+ GList *files,
+ GAppLaunchContext *context,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_supports_uris (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_supports_files (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_launch_uris (GAppInfo *appinfo,
+ GList *uris,
+ GAppLaunchContext *context,
+ GError **error);
+GLIB_AVAILABLE_IN_2_60
+void g_app_info_launch_uris_async (GAppInfo *appinfo,
+ GList *uris,
+ GAppLaunchContext *context,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_60
+gboolean g_app_info_launch_uris_finish (GAppInfo *appinfo,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_should_show (GAppInfo *appinfo);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
+ const char *extension,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_add_supports_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_can_remove_supports_type (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_remove_supports_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+GLIB_AVAILABLE_IN_2_34
+const char **g_app_info_get_supported_types (GAppInfo *appinfo);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_can_delete (GAppInfo *appinfo);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_delete (GAppInfo *appinfo);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_set_as_last_used_for_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GList * g_app_info_get_all (void);
+GLIB_AVAILABLE_IN_ALL
+GList * g_app_info_get_all_for_type (const char *content_type);
+GLIB_AVAILABLE_IN_ALL
+GList * g_app_info_get_recommended_for_type (const gchar *content_type);
+GLIB_AVAILABLE_IN_ALL
+GList * g_app_info_get_fallback_for_type (const gchar *content_type);
+
+GLIB_AVAILABLE_IN_ALL
+void g_app_info_reset_type_associations (const char *content_type);
+GLIB_AVAILABLE_IN_ALL
+GAppInfo *g_app_info_get_default_for_type (const char *content_type,
+ gboolean must_support_uris);
+GLIB_AVAILABLE_IN_ALL
+GAppInfo *g_app_info_get_default_for_uri_scheme (const char *uri_scheme);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_app_info_launch_default_for_uri (const char *uri,
+ GAppLaunchContext *context,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_50
+void g_app_info_launch_default_for_uri_async (const char *uri,
+ GAppLaunchContext *context,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_50
+gboolean g_app_info_launch_default_for_uri_finish (GAsyncResult *result,
+ GError **error);
+
+
+/**
+ * GAppLaunchContext:
+ *
+ * Integrating the launch with the launching application. This is used to
+ * handle for instance startup notification and launching the new application
+ * on the same screen as the launching window.
+ */
+struct _GAppLaunchContext
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GAppLaunchContextPrivate *priv;
+};
+
+struct _GAppLaunchContextClass
+{
+ GObjectClass parent_class;
+
+ char * (* get_display) (GAppLaunchContext *context,
+ GAppInfo *info,
+ GList *files);
+ char * (* get_startup_notify_id) (GAppLaunchContext *context,
+ GAppInfo *info,
+ GList *files);
+ void (* launch_failed) (GAppLaunchContext *context,
+ const char *startup_notify_id);
+ void (* launched) (GAppLaunchContext *context,
+ GAppInfo *info,
+ GVariant *platform_data);
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_app_launch_context_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GAppLaunchContext *g_app_launch_context_new (void);
+
+GLIB_AVAILABLE_IN_2_32
+void g_app_launch_context_setenv (GAppLaunchContext *context,
+ const char *variable,
+ const char *value);
+GLIB_AVAILABLE_IN_2_32
+void g_app_launch_context_unsetenv (GAppLaunchContext *context,
+ const char *variable);
+GLIB_AVAILABLE_IN_2_32
+char ** g_app_launch_context_get_environment (GAppLaunchContext *context);
+
+GLIB_AVAILABLE_IN_ALL
+char * g_app_launch_context_get_display (GAppLaunchContext *context,
+ GAppInfo *info,
+ GList *files);
+GLIB_AVAILABLE_IN_ALL
+char * g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
+ GAppInfo *info,
+ GList *files);
+GLIB_AVAILABLE_IN_ALL
+void g_app_launch_context_launch_failed (GAppLaunchContext *context,
+ const char * startup_notify_id);
+
+#define G_TYPE_APP_INFO_MONITOR (g_app_info_monitor_get_type ())
+#define G_APP_INFO_MONITOR(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_APP_INFO_MONITOR, GAppInfoMonitor))
+#define G_IS_APP_INFO_MONITOR(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_APP_INFO_MONITOR))
+
+typedef struct _GAppInfoMonitor GAppInfoMonitor;
+
+GLIB_AVAILABLE_IN_2_40
+GType g_app_info_monitor_get_type (void);
+
+GLIB_AVAILABLE_IN_2_40
+GAppInfoMonitor * g_app_info_monitor_get (void);
+
+G_END_DECLS
+
+#endif /* __G_APP_INFO_H__ */
diff --git a/include/glib/gio/gapplication.h b/include/glib/gio/gapplication.h
new file mode 100644
index 0000000000..adc32ed44c
--- /dev/null
+++ b/include/glib/gio/gapplication.h
@@ -0,0 +1,252 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_APPLICATION_H__
+#define __G_APPLICATION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_APPLICATION (g_application_get_type ())
+#define G_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_APPLICATION, GApplication))
+#define G_APPLICATION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_APPLICATION, GApplicationClass))
+#define G_IS_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_APPLICATION))
+#define G_IS_APPLICATION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_APPLICATION))
+#define G_APPLICATION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_APPLICATION, GApplicationClass))
+
+typedef struct _GApplicationPrivate GApplicationPrivate;
+typedef struct _GApplicationClass GApplicationClass;
+
+struct _GApplication
+{
+ /*< private >*/
+ GObject parent_instance;
+
+ GApplicationPrivate *priv;
+};
+
+struct _GApplicationClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+
+ /*< public >*/
+ /* signals */
+ void (* startup) (GApplication *application);
+
+ void (* activate) (GApplication *application);
+
+ void (* open) (GApplication *application,
+ GFile **files,
+ gint n_files,
+ const gchar *hint);
+
+ int (* command_line) (GApplication *application,
+ GApplicationCommandLine *command_line);
+
+ /* vfuncs */
+
+ /**
+ * GApplicationClass::local_command_line:
+ * @application: a #GApplication
+ * @arguments: (inout) (array zero-terminated=1): array of command line arguments
+ * @exit_status: (out): exit status to fill after processing the command line.
+ *
+ * This virtual function is always invoked in the local instance. It
+ * gets passed a pointer to a %NULL-terminated copy of @argv and is
+ * expected to remove arguments that it handled (shifting up remaining
+ * arguments).
+ *
+ * The last argument to local_command_line() is a pointer to the @status
+ * variable which can used to set the exit status that is returned from
+ * g_application_run().
+ *
+ * See g_application_run() for more details on #GApplication startup.
+ *
+ * Returns: %TRUE if the commandline has been completely handled
+ */
+ gboolean (* local_command_line) (GApplication *application,
+ gchar ***arguments,
+ int *exit_status);
+
+ void (* before_emit) (GApplication *application,
+ GVariant *platform_data);
+ void (* after_emit) (GApplication *application,
+ GVariant *platform_data);
+ void (* add_platform_data) (GApplication *application,
+ GVariantBuilder *builder);
+ void (* quit_mainloop) (GApplication *application);
+ void (* run_mainloop) (GApplication *application);
+ void (* shutdown) (GApplication *application);
+
+ gboolean (* dbus_register) (GApplication *application,
+ GDBusConnection *connection,
+ const gchar *object_path,
+ GError **error);
+ void (* dbus_unregister) (GApplication *application,
+ GDBusConnection *connection,
+ const gchar *object_path);
+ gint (* handle_local_options)(GApplication *application,
+ GVariantDict *options);
+ gboolean (* name_lost) (GApplication *application);
+
+ /*< private >*/
+ gpointer padding[7];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_application_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_application_id_is_valid (const gchar *application_id);
+
+GLIB_AVAILABLE_IN_ALL
+GApplication * g_application_new (const gchar *application_id,
+ GApplicationFlags flags);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_application_get_application_id (GApplication *application);
+GLIB_AVAILABLE_IN_ALL
+void g_application_set_application_id (GApplication *application,
+ const gchar *application_id);
+
+GLIB_AVAILABLE_IN_2_34
+GDBusConnection * g_application_get_dbus_connection (GApplication *application);
+GLIB_AVAILABLE_IN_2_34
+const gchar * g_application_get_dbus_object_path (GApplication *application);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_application_get_inactivity_timeout (GApplication *application);
+GLIB_AVAILABLE_IN_ALL
+void g_application_set_inactivity_timeout (GApplication *application,
+ guint inactivity_timeout);
+
+GLIB_AVAILABLE_IN_ALL
+GApplicationFlags g_application_get_flags (GApplication *application);
+GLIB_AVAILABLE_IN_ALL
+void g_application_set_flags (GApplication *application,
+ GApplicationFlags flags);
+
+GLIB_AVAILABLE_IN_2_42
+const gchar * g_application_get_resource_base_path (GApplication *application);
+GLIB_AVAILABLE_IN_2_42
+void g_application_set_resource_base_path (GApplication *application,
+ const gchar *resource_path);
+
+GLIB_DEPRECATED
+void g_application_set_action_group (GApplication *application,
+ GActionGroup *action_group);
+
+GLIB_AVAILABLE_IN_2_40
+void g_application_add_main_option_entries (GApplication *application,
+ const GOptionEntry *entries);
+
+GLIB_AVAILABLE_IN_2_42
+void g_application_add_main_option (GApplication *application,
+ const char *long_name,
+ char short_name,
+ GOptionFlags flags,
+ GOptionArg arg,
+ const char *description,
+ const char *arg_description);
+GLIB_AVAILABLE_IN_2_40
+void g_application_add_option_group (GApplication *application,
+ GOptionGroup *group);
+GLIB_AVAILABLE_IN_2_56
+void g_application_set_option_context_parameter_string (GApplication *application,
+ const gchar *parameter_string);
+GLIB_AVAILABLE_IN_2_56
+void g_application_set_option_context_summary (GApplication *application,
+ const gchar *summary);
+GLIB_AVAILABLE_IN_2_56
+void g_application_set_option_context_description (GApplication *application,
+ const gchar *description);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_application_get_is_registered (GApplication *application);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_application_get_is_remote (GApplication *application);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_application_register (GApplication *application,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_application_hold (GApplication *application);
+GLIB_AVAILABLE_IN_ALL
+void g_application_release (GApplication *application);
+
+GLIB_AVAILABLE_IN_ALL
+void g_application_activate (GApplication *application);
+
+GLIB_AVAILABLE_IN_ALL
+void g_application_open (GApplication *application,
+ GFile **files,
+ gint n_files,
+ const gchar *hint);
+
+GLIB_AVAILABLE_IN_ALL
+int g_application_run (GApplication *application,
+ int argc,
+ char **argv);
+
+GLIB_AVAILABLE_IN_2_32
+void g_application_quit (GApplication *application);
+
+GLIB_AVAILABLE_IN_2_32
+GApplication * g_application_get_default (void);
+GLIB_AVAILABLE_IN_2_32
+void g_application_set_default (GApplication *application);
+
+GLIB_AVAILABLE_IN_2_38
+void g_application_mark_busy (GApplication *application);
+GLIB_AVAILABLE_IN_2_38
+void g_application_unmark_busy (GApplication *application);
+GLIB_AVAILABLE_IN_2_44
+gboolean g_application_get_is_busy (GApplication *application);
+
+GLIB_AVAILABLE_IN_2_40
+void g_application_send_notification (GApplication *application,
+ const gchar *id,
+ GNotification *notification);
+GLIB_AVAILABLE_IN_2_40
+void g_application_withdraw_notification (GApplication *application,
+ const gchar *id);
+
+GLIB_AVAILABLE_IN_2_44
+void g_application_bind_busy_property (GApplication *application,
+ gpointer object,
+ const gchar *property);
+
+GLIB_AVAILABLE_IN_2_44
+void g_application_unbind_busy_property (GApplication *application,
+ gpointer object,
+ const gchar *property);
+
+G_END_DECLS
+
+#endif /* __G_APPLICATION_H__ */
diff --git a/include/glib/gio/gapplicationcommandline.h b/include/glib/gio/gapplicationcommandline.h
new file mode 100644
index 0000000000..6610e86bd2
--- /dev/null
+++ b/include/glib/gio/gapplicationcommandline.h
@@ -0,0 +1,122 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_APPLICATION_COMMAND_LINE_H__
+#define __G_APPLICATION_COMMAND_LINE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_APPLICATION_COMMAND_LINE (g_application_command_line_get_type ())
+#define G_APPLICATION_COMMAND_LINE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_APPLICATION_COMMAND_LINE, \
+ GApplicationCommandLine))
+#define G_APPLICATION_COMMAND_LINE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_APPLICATION_COMMAND_LINE, \
+ GApplicationCommandLineClass))
+#define G_IS_APPLICATION_COMMAND_LINE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_APPLICATION_COMMAND_LINE))
+#define G_IS_APPLICATION_COMMAND_LINE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_APPLICATION_COMMAND_LINE))
+#define G_APPLICATION_COMMAND_LINE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_APPLICATION_COMMAND_LINE, \
+ GApplicationCommandLineClass))
+
+typedef struct _GApplicationCommandLinePrivate GApplicationCommandLinePrivate;
+typedef struct _GApplicationCommandLineClass GApplicationCommandLineClass;
+
+struct _GApplicationCommandLine
+{
+ /*< private >*/
+ GObject parent_instance;
+
+ GApplicationCommandLinePrivate *priv;
+};
+
+struct _GApplicationCommandLineClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+
+ void (* print_literal) (GApplicationCommandLine *cmdline,
+ const gchar *message);
+ void (* printerr_literal) (GApplicationCommandLine *cmdline,
+ const gchar *message);
+ GInputStream * (* get_stdin) (GApplicationCommandLine *cmdline);
+
+ gpointer padding[11];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_application_command_line_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_application_command_line_get_arguments (GApplicationCommandLine *cmdline,
+ int *argc);
+
+GLIB_AVAILABLE_IN_2_40
+GVariantDict * g_application_command_line_get_options_dict (GApplicationCommandLine *cmdline);
+
+GLIB_AVAILABLE_IN_2_36
+GInputStream * g_application_command_line_get_stdin (GApplicationCommandLine *cmdline);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * const * g_application_command_line_get_environ (GApplicationCommandLine *cmdline);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_application_command_line_getenv (GApplicationCommandLine *cmdline,
+ const gchar *name);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_application_command_line_get_cwd (GApplicationCommandLine *cmdline);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_application_command_line_get_is_remote (GApplicationCommandLine *cmdline);
+
+GLIB_AVAILABLE_IN_ALL
+void g_application_command_line_print (GApplicationCommandLine *cmdline,
+ const gchar *format,
+ ...) G_GNUC_PRINTF(2, 3);
+GLIB_AVAILABLE_IN_ALL
+void g_application_command_line_printerr (GApplicationCommandLine *cmdline,
+ const gchar *format,
+ ...) G_GNUC_PRINTF(2, 3);
+
+GLIB_AVAILABLE_IN_ALL
+int g_application_command_line_get_exit_status (GApplicationCommandLine *cmdline);
+GLIB_AVAILABLE_IN_ALL
+void g_application_command_line_set_exit_status (GApplicationCommandLine *cmdline,
+ int exit_status);
+
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_application_command_line_get_platform_data (GApplicationCommandLine *cmdline);
+
+GLIB_AVAILABLE_IN_2_36
+GFile * g_application_command_line_create_file_for_arg (GApplicationCommandLine *cmdline,
+ const gchar *arg);
+
+G_END_DECLS
+
+#endif /* __G_APPLICATION_COMMAND_LINE_H__ */
diff --git a/include/glib/gio/gasyncinitable.h b/include/glib/gio/gasyncinitable.h
new file mode 100644
index 0000000000..f30d2cec76
--- /dev/null
+++ b/include/glib/gio/gasyncinitable.h
@@ -0,0 +1,130 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_ASYNC_INITABLE_H__
+#define __G_ASYNC_INITABLE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+#include <gio/ginitable.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ASYNC_INITABLE (g_async_initable_get_type ())
+#define G_ASYNC_INITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_ASYNC_INITABLE, GAsyncInitable))
+#define G_IS_ASYNC_INITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ASYNC_INITABLE))
+#define G_ASYNC_INITABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ASYNC_INITABLE, GAsyncInitableIface))
+#define G_TYPE_IS_ASYNC_INITABLE(type) (g_type_is_a ((type), G_TYPE_ASYNC_INITABLE))
+
+/**
+ * GAsyncInitable:
+ *
+ * Interface for asynchronously initializable objects.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GAsyncInitableIface GAsyncInitableIface;
+
+/**
+ * GAsyncInitableIface:
+ * @g_iface: The parent interface.
+ * @init_async: Starts initialization of the object.
+ * @init_finish: Finishes initialization of the object.
+ *
+ * Provides an interface for asynchronous initializing object such that
+ * initialization may fail.
+ *
+ * Since: 2.22
+ **/
+struct _GAsyncInitableIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ void (* init_async) (GAsyncInitable *initable,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* init_finish) (GAsyncInitable *initable,
+ GAsyncResult *res,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_async_initable_get_type (void) G_GNUC_CONST;
+
+
+GLIB_AVAILABLE_IN_ALL
+void g_async_initable_init_async (GAsyncInitable *initable,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_async_initable_init_finish (GAsyncInitable *initable,
+ GAsyncResult *res,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_async_initable_new_async (GType object_type,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ const gchar *first_property_name,
+ ...);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties and g_async_initable_init_async)
+void g_async_initable_newv_async (GType object_type,
+ guint n_parameters,
+ GParameter *parameters,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_ALL
+void g_async_initable_new_valist_async (GType object_type,
+ const gchar *first_property_name,
+ va_list var_args,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GObject *g_async_initable_new_finish (GAsyncInitable *initable,
+ GAsyncResult *res,
+ GError **error);
+
+
+
+G_END_DECLS
+
+
+#endif /* __G_ASYNC_INITABLE_H__ */
diff --git a/include/glib/gio/gasyncresult.h b/include/glib/gio/gasyncresult.h
new file mode 100644
index 0000000000..956cbc4738
--- /dev/null
+++ b/include/glib/gio/gasyncresult.h
@@ -0,0 +1,85 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_ASYNC_RESULT_H__
+#define __G_ASYNC_RESULT_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ASYNC_RESULT (g_async_result_get_type ())
+#define G_ASYNC_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_ASYNC_RESULT, GAsyncResult))
+#define G_IS_ASYNC_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ASYNC_RESULT))
+#define G_ASYNC_RESULT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ASYNC_RESULT, GAsyncResultIface))
+
+/**
+ * GAsyncResult:
+ *
+ * Holds results information for an asynchronous operation,
+ * usually passed directly to an asynchronous _finish() operation.
+ **/
+typedef struct _GAsyncResultIface GAsyncResultIface;
+
+
+/**
+ * GAsyncResultIface:
+ * @g_iface: The parent interface.
+ * @get_user_data: Gets the user data passed to the callback.
+ * @get_source_object: Gets the source object that issued the asynchronous operation.
+ * @is_tagged: Checks if a result is tagged with a particular source.
+ *
+ * Interface definition for #GAsyncResult.
+ **/
+struct _GAsyncResultIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ gpointer (* get_user_data) (GAsyncResult *res);
+ GObject * (* get_source_object) (GAsyncResult *res);
+
+ gboolean (* is_tagged) (GAsyncResult *res,
+ gpointer source_tag);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_async_result_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_async_result_get_user_data (GAsyncResult *res);
+GLIB_AVAILABLE_IN_ALL
+GObject *g_async_result_get_source_object (GAsyncResult *res);
+
+GLIB_AVAILABLE_IN_2_34
+gboolean g_async_result_legacy_propagate_error (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_async_result_is_tagged (GAsyncResult *res,
+ gpointer source_tag);
+
+G_END_DECLS
+
+#endif /* __G_ASYNC_RESULT_H__ */
diff --git a/include/glib/gio/gbufferedinputstream.h b/include/glib/gio/gbufferedinputstream.h
new file mode 100644
index 0000000000..19c42147c0
--- /dev/null
+++ b/include/glib/gio/gbufferedinputstream.h
@@ -0,0 +1,133 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Christian Kellner <gicmo@gnome.org>
+ */
+
+#ifndef __G_BUFFERED_INPUT_STREAM_H__
+#define __G_BUFFERED_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gfilterinputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_BUFFERED_INPUT_STREAM (g_buffered_input_stream_get_type ())
+#define G_BUFFERED_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_BUFFERED_INPUT_STREAM, GBufferedInputStream))
+#define G_BUFFERED_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_BUFFERED_INPUT_STREAM, GBufferedInputStreamClass))
+#define G_IS_BUFFERED_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_BUFFERED_INPUT_STREAM))
+#define G_IS_BUFFERED_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_BUFFERED_INPUT_STREAM))
+#define G_BUFFERED_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_BUFFERED_INPUT_STREAM, GBufferedInputStreamClass))
+
+/**
+ * GBufferedInputStream:
+ *
+ * Implements #GFilterInputStream with a sized input buffer.
+ **/
+typedef struct _GBufferedInputStreamClass GBufferedInputStreamClass;
+typedef struct _GBufferedInputStreamPrivate GBufferedInputStreamPrivate;
+
+struct _GBufferedInputStream
+{
+ GFilterInputStream parent_instance;
+
+ /*< private >*/
+ GBufferedInputStreamPrivate *priv;
+};
+
+struct _GBufferedInputStreamClass
+{
+ GFilterInputStreamClass parent_class;
+
+ gssize (* fill) (GBufferedInputStream *stream,
+ gssize count,
+ GCancellable *cancellable,
+ GError **error);
+
+ /* Async ops: (optional in derived classes) */
+ void (* fill_async) (GBufferedInputStream *stream,
+ gssize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gssize (* fill_finish) (GBufferedInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_buffered_input_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GInputStream* g_buffered_input_stream_new (GInputStream *base_stream);
+GLIB_AVAILABLE_IN_ALL
+GInputStream* g_buffered_input_stream_new_sized (GInputStream *base_stream,
+ gsize size);
+
+GLIB_AVAILABLE_IN_ALL
+gsize g_buffered_input_stream_get_buffer_size (GBufferedInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+void g_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream,
+ gsize size);
+GLIB_AVAILABLE_IN_ALL
+gsize g_buffered_input_stream_get_available (GBufferedInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gsize g_buffered_input_stream_peek (GBufferedInputStream *stream,
+ void *buffer,
+ gsize offset,
+ gsize count);
+GLIB_AVAILABLE_IN_ALL
+const void* g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream,
+ gsize *count);
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_buffered_input_stream_fill (GBufferedInputStream *stream,
+ gssize count,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
+ gssize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gssize g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+int g_buffered_input_stream_read_byte (GBufferedInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_BUFFERED_INPUT_STREAM_H__ */
diff --git a/include/glib/gio/gbufferedoutputstream.h b/include/glib/gio/gbufferedoutputstream.h
new file mode 100644
index 0000000000..f88f27952a
--- /dev/null
+++ b/include/glib/gio/gbufferedoutputstream.h
@@ -0,0 +1,86 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Christian Kellner <gicmo@gnome.org>
+ */
+
+#ifndef __G_BUFFERED_OUTPUT_STREAM_H__
+#define __G_BUFFERED_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gfilteroutputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_BUFFERED_OUTPUT_STREAM (g_buffered_output_stream_get_type ())
+#define G_BUFFERED_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_BUFFERED_OUTPUT_STREAM, GBufferedOutputStream))
+#define G_BUFFERED_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_BUFFERED_OUTPUT_STREAM, GBufferedOutputStreamClass))
+#define G_IS_BUFFERED_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_BUFFERED_OUTPUT_STREAM))
+#define G_IS_BUFFERED_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_BUFFERED_OUTPUT_STREAM))
+#define G_BUFFERED_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_BUFFERED_OUTPUT_STREAM, GBufferedOutputStreamClass))
+
+/**
+ * GBufferedOutputStream:
+ *
+ * An implementation of #GFilterOutputStream with a sized buffer.
+ **/
+typedef struct _GBufferedOutputStreamClass GBufferedOutputStreamClass;
+typedef struct _GBufferedOutputStreamPrivate GBufferedOutputStreamPrivate;
+
+struct _GBufferedOutputStream
+{
+ GFilterOutputStream parent_instance;
+
+ /*< protected >*/
+ GBufferedOutputStreamPrivate *priv;
+};
+
+struct _GBufferedOutputStreamClass
+{
+ GFilterOutputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_buffered_output_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GOutputStream* g_buffered_output_stream_new (GOutputStream *base_stream);
+GLIB_AVAILABLE_IN_ALL
+GOutputStream* g_buffered_output_stream_new_sized (GOutputStream *base_stream,
+ gsize size);
+GLIB_AVAILABLE_IN_ALL
+gsize g_buffered_output_stream_get_buffer_size (GBufferedOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+void g_buffered_output_stream_set_buffer_size (GBufferedOutputStream *stream,
+ gsize size);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_buffered_output_stream_get_auto_grow (GBufferedOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+void g_buffered_output_stream_set_auto_grow (GBufferedOutputStream *stream,
+ gboolean auto_grow);
+
+G_END_DECLS
+
+#endif /* __G_BUFFERED_OUTPUT_STREAM_H__ */
diff --git a/include/glib/gio/gbytesicon.h b/include/glib/gio/gbytesicon.h
new file mode 100644
index 0000000000..5661044b72
--- /dev/null
+++ b/include/glib/gio/gbytesicon.h
@@ -0,0 +1,52 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_BYTES_ICON_H__
+#define __G_BYTES_ICON_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_BYTES_ICON (g_bytes_icon_get_type ())
+#define G_BYTES_ICON(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_BYTES_ICON, GBytesIcon))
+#define G_IS_BYTES_ICON(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_BYTES_ICON))
+
+/**
+ * GBytesIcon:
+ *
+ * Gets an icon for a #GBytes. Implements #GLoadableIcon.
+ **/
+GLIB_AVAILABLE_IN_2_38
+GType g_bytes_icon_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_38
+GIcon * g_bytes_icon_new (GBytes *bytes);
+
+GLIB_AVAILABLE_IN_2_38
+GBytes * g_bytes_icon_get_bytes (GBytesIcon *icon);
+
+G_END_DECLS
+
+#endif /* __G_BYTES_ICON_H__ */
diff --git a/include/glib/gio/gcancellable.h b/include/glib/gio/gcancellable.h
new file mode 100644
index 0000000000..45b9a5a19e
--- /dev/null
+++ b/include/glib/gio/gcancellable.h
@@ -0,0 +1,118 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_CANCELLABLE_H__
+#define __G_CANCELLABLE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_CANCELLABLE (g_cancellable_get_type ())
+#define G_CANCELLABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CANCELLABLE, GCancellable))
+#define G_CANCELLABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CANCELLABLE, GCancellableClass))
+#define G_IS_CANCELLABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CANCELLABLE))
+#define G_IS_CANCELLABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CANCELLABLE))
+#define G_CANCELLABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CANCELLABLE, GCancellableClass))
+
+/**
+ * GCancellable:
+ *
+ * Allows actions to be cancelled.
+ */
+typedef struct _GCancellableClass GCancellableClass;
+typedef struct _GCancellablePrivate GCancellablePrivate;
+
+struct _GCancellable
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GCancellablePrivate *priv;
+};
+
+struct _GCancellableClass
+{
+ GObjectClass parent_class;
+
+ void (* cancelled) (GCancellable *cancellable);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_cancellable_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GCancellable *g_cancellable_new (void);
+
+/* These are only safe to call inside a cancellable op */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_cancellable_is_cancelled (GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_cancellable_set_error_if_cancelled (GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+int g_cancellable_get_fd (GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_cancellable_make_pollfd (GCancellable *cancellable,
+ GPollFD *pollfd);
+GLIB_AVAILABLE_IN_ALL
+void g_cancellable_release_fd (GCancellable *cancellable);
+
+GLIB_AVAILABLE_IN_ALL
+GSource * g_cancellable_source_new (GCancellable *cancellable);
+
+GLIB_AVAILABLE_IN_ALL
+GCancellable *g_cancellable_get_current (void);
+GLIB_AVAILABLE_IN_ALL
+void g_cancellable_push_current (GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+void g_cancellable_pop_current (GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+void g_cancellable_reset (GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+gulong g_cancellable_connect (GCancellable *cancellable,
+ GCallback callback,
+ gpointer data,
+ GDestroyNotify data_destroy_func);
+GLIB_AVAILABLE_IN_ALL
+void g_cancellable_disconnect (GCancellable *cancellable,
+ gulong handler_id);
+
+
+/* This is safe to call from another thread */
+GLIB_AVAILABLE_IN_ALL
+void g_cancellable_cancel (GCancellable *cancellable);
+
+G_END_DECLS
+
+#endif /* __G_CANCELLABLE_H__ */
diff --git a/include/glib/gio/gcharsetconverter.h b/include/glib/gio/gcharsetconverter.h
new file mode 100644
index 0000000000..610f774d85
--- /dev/null
+++ b/include/glib/gio/gcharsetconverter.h
@@ -0,0 +1,63 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_CHARSET_CONVERTER_H__
+#define __G_CHARSET_CONVERTER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gconverter.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_CHARSET_CONVERTER (g_charset_converter_get_type ())
+#define G_CHARSET_CONVERTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CHARSET_CONVERTER, GCharsetConverter))
+#define G_CHARSET_CONVERTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CHARSET_CONVERTER, GCharsetConverterClass))
+#define G_IS_CHARSET_CONVERTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CHARSET_CONVERTER))
+#define G_IS_CHARSET_CONVERTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CHARSET_CONVERTER))
+#define G_CHARSET_CONVERTER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CHARSET_CONVERTER, GCharsetConverterClass))
+
+typedef struct _GCharsetConverterClass GCharsetConverterClass;
+
+struct _GCharsetConverterClass
+{
+ GObjectClass parent_class;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_charset_converter_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GCharsetConverter *g_charset_converter_new (const gchar *to_charset,
+ const gchar *from_charset,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_charset_converter_set_use_fallback (GCharsetConverter *converter,
+ gboolean use_fallback);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_charset_converter_get_use_fallback (GCharsetConverter *converter);
+GLIB_AVAILABLE_IN_ALL
+guint g_charset_converter_get_num_fallbacks (GCharsetConverter *converter);
+
+G_END_DECLS
+
+#endif /* __G_CHARSET_CONVERTER_H__ */
diff --git a/include/glib/gio/gcontenttype.h b/include/glib/gio/gcontenttype.h
new file mode 100644
index 0000000000..db2c974f3b
--- /dev/null
+++ b/include/glib/gio/gcontenttype.h
@@ -0,0 +1,82 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_CONTENT_TYPE_H__
+#define __G_CONTENT_TYPE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_content_type_equals (const gchar *type1,
+ const gchar *type2);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_content_type_is_a (const gchar *type,
+ const gchar *supertype);
+GLIB_AVAILABLE_IN_2_52
+gboolean g_content_type_is_mime_type (const gchar *type,
+ const gchar *mime_type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_content_type_is_unknown (const gchar *type);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_content_type_get_description (const gchar *type);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_content_type_get_mime_type (const gchar *type);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_content_type_get_icon (const gchar *type);
+GLIB_AVAILABLE_IN_2_34
+GIcon * g_content_type_get_symbolic_icon (const gchar *type);
+GLIB_AVAILABLE_IN_2_34
+gchar * g_content_type_get_generic_icon_name (const gchar *type);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_content_type_can_be_executable (const gchar *type);
+
+GLIB_AVAILABLE_IN_ALL
+gchar * g_content_type_from_mime_type (const gchar *mime_type);
+
+GLIB_AVAILABLE_IN_ALL
+gchar * g_content_type_guess (const gchar *filename,
+ const guchar *data,
+ gsize data_size,
+ gboolean *result_uncertain);
+
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_content_type_guess_for_tree (GFile *root);
+
+GLIB_AVAILABLE_IN_ALL
+GList * g_content_types_get_registered (void);
+
+/*< private >*/
+#ifndef __GTK_DOC_IGNORE__
+GLIB_AVAILABLE_IN_2_60
+const gchar * const *g_content_type_get_mime_dirs (void);
+GLIB_AVAILABLE_IN_2_60
+void g_content_type_set_mime_dirs (const gchar * const *dirs);
+#endif /* __GTK_DOC_IGNORE__ */
+
+G_END_DECLS
+
+#endif /* __G_CONTENT_TYPE_H__ */
diff --git a/include/glib/gio/gconverter.h b/include/glib/gio/gconverter.h
new file mode 100644
index 0000000000..87164534ba
--- /dev/null
+++ b/include/glib/gio/gconverter.h
@@ -0,0 +1,96 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_CONVERTER_H__
+#define __G_CONVERTER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_CONVERTER (g_converter_get_type ())
+#define G_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_CONVERTER, GConverter))
+#define G_IS_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_CONVERTER))
+#define G_CONVERTER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_CONVERTER, GConverterIface))
+
+/**
+ * GConverter:
+ *
+ * Seek object for streaming operations.
+ *
+ * Since: 2.24
+ **/
+typedef struct _GConverterIface GConverterIface;
+
+/**
+ * GConverterIface:
+ * @g_iface: The parent interface.
+ * @convert: Converts data.
+ * @reset: Reverts the internal state of the converter to its initial state.
+ *
+ * Provides an interface for converting data from one type
+ * to another type. The conversion can be stateful
+ * and may fail at any place.
+ *
+ * Since: 2.24
+ **/
+struct _GConverterIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ GConverterResult (* convert) (GConverter *converter,
+ const void *inbuf,
+ gsize inbuf_size,
+ void *outbuf,
+ gsize outbuf_size,
+ GConverterFlags flags,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error);
+ void (* reset) (GConverter *converter);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_converter_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GConverterResult g_converter_convert (GConverter *converter,
+ const void *inbuf,
+ gsize inbuf_size,
+ void *outbuf,
+ gsize outbuf_size,
+ GConverterFlags flags,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_converter_reset (GConverter *converter);
+
+
+G_END_DECLS
+
+
+#endif /* __G_CONVERTER_H__ */
diff --git a/include/glib/gio/gconverterinputstream.h b/include/glib/gio/gconverterinputstream.h
new file mode 100644
index 0000000000..48cc102212
--- /dev/null
+++ b/include/glib/gio/gconverterinputstream.h
@@ -0,0 +1,80 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_CONVERTER_INPUT_STREAM_H__
+#define __G_CONVERTER_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gfilterinputstream.h>
+#include <gio/gconverter.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_CONVERTER_INPUT_STREAM (g_converter_input_stream_get_type ())
+#define G_CONVERTER_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CONVERTER_INPUT_STREAM, GConverterInputStream))
+#define G_CONVERTER_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CONVERTER_INPUT_STREAM, GConverterInputStreamClass))
+#define G_IS_CONVERTER_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CONVERTER_INPUT_STREAM))
+#define G_IS_CONVERTER_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CONVERTER_INPUT_STREAM))
+#define G_CONVERTER_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CONVERTER_INPUT_STREAM, GConverterInputStreamClass))
+
+/**
+ * GConverterInputStream:
+ *
+ * An implementation of #GFilterInputStream that allows data
+ * conversion.
+ **/
+typedef struct _GConverterInputStreamClass GConverterInputStreamClass;
+typedef struct _GConverterInputStreamPrivate GConverterInputStreamPrivate;
+
+struct _GConverterInputStream
+{
+ GFilterInputStream parent_instance;
+
+ /*< private >*/
+ GConverterInputStreamPrivate *priv;
+};
+
+struct _GConverterInputStreamClass
+{
+ GFilterInputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_converter_input_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GInputStream *g_converter_input_stream_new (GInputStream *base_stream,
+ GConverter *converter);
+GLIB_AVAILABLE_IN_ALL
+GConverter *g_converter_input_stream_get_converter (GConverterInputStream *converter_stream);
+
+G_END_DECLS
+
+#endif /* __G_CONVERTER_INPUT_STREAM_H__ */
diff --git a/include/glib/gio/gconverteroutputstream.h b/include/glib/gio/gconverteroutputstream.h
new file mode 100644
index 0000000000..b9a1e5d407
--- /dev/null
+++ b/include/glib/gio/gconverteroutputstream.h
@@ -0,0 +1,80 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_CONVERTER_OUTPUT_STREAM_H__
+#define __G_CONVERTER_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gfilteroutputstream.h>
+#include <gio/gconverter.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_CONVERTER_OUTPUT_STREAM (g_converter_output_stream_get_type ())
+#define G_CONVERTER_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CONVERTER_OUTPUT_STREAM, GConverterOutputStream))
+#define G_CONVERTER_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CONVERTER_OUTPUT_STREAM, GConverterOutputStreamClass))
+#define G_IS_CONVERTER_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CONVERTER_OUTPUT_STREAM))
+#define G_IS_CONVERTER_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CONVERTER_OUTPUT_STREAM))
+#define G_CONVERTER_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CONVERTER_OUTPUT_STREAM, GConverterOutputStreamClass))
+
+/**
+ * GConverterOutputStream:
+ *
+ * An implementation of #GFilterOutputStream that allows data
+ * conversion.
+ **/
+typedef struct _GConverterOutputStreamClass GConverterOutputStreamClass;
+typedef struct _GConverterOutputStreamPrivate GConverterOutputStreamPrivate;
+
+struct _GConverterOutputStream
+{
+ GFilterOutputStream parent_instance;
+
+ /*< private >*/
+ GConverterOutputStreamPrivate *priv;
+};
+
+struct _GConverterOutputStreamClass
+{
+ GFilterOutputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_converter_output_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GOutputStream *g_converter_output_stream_new (GOutputStream *base_stream,
+ GConverter *converter);
+GLIB_AVAILABLE_IN_ALL
+GConverter *g_converter_output_stream_get_converter (GConverterOutputStream *converter_stream);
+
+G_END_DECLS
+
+#endif /* __G_CONVERTER_OUTPUT_STREAM_H__ */
diff --git a/include/glib/gio/gcredentials.h b/include/glib/gio/gcredentials.h
new file mode 100644
index 0000000000..25cebf2b42
--- /dev/null
+++ b/include/glib/gio/gcredentials.h
@@ -0,0 +1,85 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_CREDENTIALS_H__
+#define __G_CREDENTIALS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+#ifdef G_OS_UNIX
+/* To get the uid_t type */
+#include <unistd.h>
+#include <sys/types.h>
+#endif
+
+G_BEGIN_DECLS
+
+#define G_TYPE_CREDENTIALS (g_credentials_get_type ())
+#define G_CREDENTIALS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CREDENTIALS, GCredentials))
+#define G_CREDENTIALS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CREDENTIALS, GCredentialsClass))
+#define G_CREDENTIALS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CREDENTIALS, GCredentialsClass))
+#define G_IS_CREDENTIALS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CREDENTIALS))
+#define G_IS_CREDENTIALS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CREDENTIALS))
+
+typedef struct _GCredentialsClass GCredentialsClass;
+
+GLIB_AVAILABLE_IN_ALL
+GType g_credentials_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GCredentials *g_credentials_new (void);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_credentials_to_string (GCredentials *credentials);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_credentials_get_native (GCredentials *credentials,
+ GCredentialsType native_type);
+
+GLIB_AVAILABLE_IN_ALL
+void g_credentials_set_native (GCredentials *credentials,
+ GCredentialsType native_type,
+ gpointer native);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_credentials_is_same_user (GCredentials *credentials,
+ GCredentials *other_credentials,
+ GError **error);
+
+#ifdef G_OS_UNIX
+GLIB_AVAILABLE_IN_2_36
+pid_t g_credentials_get_unix_pid (GCredentials *credentials,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+uid_t g_credentials_get_unix_user (GCredentials *credentials,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_credentials_set_unix_user (GCredentials *credentials,
+ uid_t uid,
+ GError **error);
+#endif
+
+G_END_DECLS
+
+#endif /* __G_DBUS_PROXY_H__ */
diff --git a/include/glib/gio/gdatagrambased.h b/include/glib/gio/gdatagrambased.h
new file mode 100644
index 0000000000..838b485df9
--- /dev/null
+++ b/include/glib/gio/gdatagrambased.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2015 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Philip Withnall <philip.withnall@collabora.co.uk>
+ */
+
+#ifndef __G_DATAGRAM_BASED_H__
+#define __G_DATAGRAM_BASED_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DATAGRAM_BASED (g_datagram_based_get_type ())
+#define G_DATAGRAM_BASED(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_DATAGRAM_BASED, GDatagramBased))
+#define G_IS_DATAGRAM_BASED(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_DATAGRAM_BASED))
+#define G_DATAGRAM_BASED_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
+ G_TYPE_DATAGRAM_BASED, \
+ GDatagramBasedInterface))
+#define G_TYPE_IS_DATAGRAM_BASED(type) (g_type_is_a ((type), \
+ G_TYPE_DATAGRAM_BASED))
+
+/**
+ * GDatagramBased:
+ *
+ * Interface for socket-like objects with datagram semantics.
+ *
+ * Since: 2.48
+ */
+typedef struct _GDatagramBasedInterface GDatagramBasedInterface;
+
+/**
+ * GDatagramBasedInterface:
+ * @g_iface: The parent interface.
+ * @receive_messages: Virtual method for g_datagram_based_receive_messages().
+ * @send_messages: Virtual method for g_datagram_based_send_messages().
+ * @create_source: Virtual method for g_datagram_based_create_source().
+ * @condition_check: Virtual method for g_datagram_based_condition_check().
+ * @condition_wait: Virtual method for
+ * g_datagram_based_condition_wait().
+ *
+ * Provides an interface for socket-like objects which have datagram semantics,
+ * following the Berkeley sockets API. The interface methods are thin wrappers
+ * around the corresponding virtual methods, and no pre-processing of inputs is
+ * implemented — so implementations of this API must handle all functionality
+ * documented in the interface methods.
+ *
+ * Since: 2.48
+ */
+struct _GDatagramBasedInterface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual table */
+ gint (*receive_messages) (GDatagramBased *datagram_based,
+ GInputMessage *messages,
+ guint num_messages,
+ gint flags,
+ gint64 timeout,
+ GCancellable *cancellable,
+ GError **error);
+ gint (*send_messages) (GDatagramBased *datagram_based,
+ GOutputMessage *messages,
+ guint num_messages,
+ gint flags,
+ gint64 timeout,
+ GCancellable *cancellable,
+ GError **error);
+
+ GSource *(*create_source) (GDatagramBased *datagram_based,
+ GIOCondition condition,
+ GCancellable *cancellable);
+ GIOCondition (*condition_check) (GDatagramBased *datagram_based,
+ GIOCondition condition);
+ gboolean (*condition_wait) (GDatagramBased *datagram_based,
+ GIOCondition condition,
+ gint64 timeout,
+ GCancellable *cancellable,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_2_48
+GType
+g_datagram_based_get_type (void);
+
+GLIB_AVAILABLE_IN_2_48
+gint
+g_datagram_based_receive_messages (GDatagramBased *datagram_based,
+ GInputMessage *messages,
+ guint num_messages,
+ gint flags,
+ gint64 timeout,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+gint
+g_datagram_based_send_messages (GDatagramBased *datagram_based,
+ GOutputMessage *messages,
+ guint num_messages,
+ gint flags,
+ gint64 timeout,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+GSource *
+g_datagram_based_create_source (GDatagramBased *datagram_based,
+ GIOCondition condition,
+ GCancellable *cancellable);
+GLIB_AVAILABLE_IN_2_48
+GIOCondition
+g_datagram_based_condition_check (GDatagramBased *datagram_based,
+ GIOCondition condition);
+GLIB_AVAILABLE_IN_2_48
+gboolean
+g_datagram_based_condition_wait (GDatagramBased *datagram_based,
+ GIOCondition condition,
+ gint64 timeout,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_DATAGRAM_BASED_H__ */
diff --git a/include/glib/gio/gdatainputstream.h b/include/glib/gio/gdatainputstream.h
new file mode 100644
index 0000000000..3ad3b825f7
--- /dev/null
+++ b/include/glib/gio/gdatainputstream.h
@@ -0,0 +1,180 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_DATA_INPUT_STREAM_H__
+#define __G_DATA_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gbufferedinputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DATA_INPUT_STREAM (g_data_input_stream_get_type ())
+#define G_DATA_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStream))
+#define G_DATA_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
+#define G_IS_DATA_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DATA_INPUT_STREAM))
+#define G_IS_DATA_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DATA_INPUT_STREAM))
+#define G_DATA_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
+
+/**
+ * GDataInputStream:
+ *
+ * An implementation of #GBufferedInputStream that allows for high-level
+ * data manipulation of arbitrary data (including binary operations).
+ **/
+typedef struct _GDataInputStreamClass GDataInputStreamClass;
+typedef struct _GDataInputStreamPrivate GDataInputStreamPrivate;
+
+struct _GDataInputStream
+{
+ GBufferedInputStream parent_instance;
+
+ /*< private >*/
+ GDataInputStreamPrivate *priv;
+};
+
+struct _GDataInputStreamClass
+{
+ GBufferedInputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_data_input_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDataInputStream * g_data_input_stream_new (GInputStream *base_stream);
+
+GLIB_AVAILABLE_IN_ALL
+void g_data_input_stream_set_byte_order (GDataInputStream *stream,
+ GDataStreamByteOrder order);
+GLIB_AVAILABLE_IN_ALL
+GDataStreamByteOrder g_data_input_stream_get_byte_order (GDataInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+void g_data_input_stream_set_newline_type (GDataInputStream *stream,
+ GDataStreamNewlineType type);
+GLIB_AVAILABLE_IN_ALL
+GDataStreamNewlineType g_data_input_stream_get_newline_type (GDataInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+guchar g_data_input_stream_read_byte (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gint16 g_data_input_stream_read_int16 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_data_input_stream_read_uint16 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_data_input_stream_read_int32 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+guint32 g_data_input_stream_read_uint32 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gint64 g_data_input_stream_read_int64 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+guint64 g_data_input_stream_read_uint64 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+char * g_data_input_stream_read_line (GDataInputStream *stream,
+ gsize *length,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_30
+char * g_data_input_stream_read_line_utf8 (GDataInputStream *stream,
+ gsize *length,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_data_input_stream_read_line_async (GDataInputStream *stream,
+ gint io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+char * g_data_input_stream_read_line_finish (GDataInputStream *stream,
+ GAsyncResult *result,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_2_30
+char * g_data_input_stream_read_line_finish_utf8(GDataInputStream *stream,
+ GAsyncResult *result,
+ gsize *length,
+ GError **error);
+GLIB_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto)
+char * g_data_input_stream_read_until (GDataInputStream *stream,
+ const gchar *stop_chars,
+ gsize *length,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_async)
+void g_data_input_stream_read_until_async (GDataInputStream *stream,
+ const gchar *stop_chars,
+ gint io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_finish)
+char * g_data_input_stream_read_until_finish (GDataInputStream *stream,
+ GAsyncResult *result,
+ gsize *length,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+char * g_data_input_stream_read_upto (GDataInputStream *stream,
+ const gchar *stop_chars,
+ gssize stop_chars_len,
+ gsize *length,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_data_input_stream_read_upto_async (GDataInputStream *stream,
+ const gchar *stop_chars,
+ gssize stop_chars_len,
+ gint io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+char * g_data_input_stream_read_upto_finish (GDataInputStream *stream,
+ GAsyncResult *result,
+ gsize *length,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_DATA_INPUT_STREAM_H__ */
diff --git a/include/glib/gio/gdataoutputstream.h b/include/glib/gio/gdataoutputstream.h
new file mode 100644
index 0000000000..62cf7b5e3c
--- /dev/null
+++ b/include/glib/gio/gdataoutputstream.h
@@ -0,0 +1,125 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_DATA_OUTPUT_STREAM_H__
+#define __G_DATA_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gfilteroutputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DATA_OUTPUT_STREAM (g_data_output_stream_get_type ())
+#define G_DATA_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DATA_OUTPUT_STREAM, GDataOutputStream))
+#define G_DATA_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DATA_OUTPUT_STREAM, GDataOutputStreamClass))
+#define G_IS_DATA_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DATA_OUTPUT_STREAM))
+#define G_IS_DATA_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DATA_OUTPUT_STREAM))
+#define G_DATA_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DATA_OUTPUT_STREAM, GDataOutputStreamClass))
+
+/**
+ * GDataOutputStream:
+ *
+ * An implementation of #GBufferedOutputStream that allows for high-level
+ * data manipulation of arbitrary data (including binary operations).
+ **/
+typedef struct _GDataOutputStream GDataOutputStream;
+typedef struct _GDataOutputStreamClass GDataOutputStreamClass;
+typedef struct _GDataOutputStreamPrivate GDataOutputStreamPrivate;
+
+struct _GDataOutputStream
+{
+ GFilterOutputStream parent_instance;
+
+ /*< private >*/
+ GDataOutputStreamPrivate *priv;
+};
+
+struct _GDataOutputStreamClass
+{
+ GFilterOutputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_data_output_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDataOutputStream * g_data_output_stream_new (GOutputStream *base_stream);
+
+GLIB_AVAILABLE_IN_ALL
+void g_data_output_stream_set_byte_order (GDataOutputStream *stream,
+ GDataStreamByteOrder order);
+GLIB_AVAILABLE_IN_ALL
+GDataStreamByteOrder g_data_output_stream_get_byte_order (GDataOutputStream *stream);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_byte (GDataOutputStream *stream,
+ guchar data,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_int16 (GDataOutputStream *stream,
+ gint16 data,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_uint16 (GDataOutputStream *stream,
+ guint16 data,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_int32 (GDataOutputStream *stream,
+ gint32 data,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_uint32 (GDataOutputStream *stream,
+ guint32 data,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_int64 (GDataOutputStream *stream,
+ gint64 data,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_uint64 (GDataOutputStream *stream,
+ guint64 data,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_data_output_stream_put_string (GDataOutputStream *stream,
+ const char *str,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_DATA_OUTPUT_STREAM_H__ */
diff --git a/include/glib/gio/gdbusactiongroup.h b/include/glib/gio/gdbusactiongroup.h
new file mode 100644
index 0000000000..93e6a2cfe4
--- /dev/null
+++ b/include/glib/gio/gdbusactiongroup.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ * Copyright © 2011 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_DBUS_ACTION_GROUP_H__
+#define __G_DBUS_ACTION_GROUP_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include "giotypes.h"
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_ACTION_GROUP (g_dbus_action_group_get_type ())
+#define G_DBUS_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_DBUS_ACTION_GROUP, GDBusActionGroup))
+#define G_DBUS_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_DBUS_ACTION_GROUP, GDBusActionGroupClass))
+#define G_IS_DBUS_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_DBUS_ACTION_GROUP))
+#define G_IS_DBUS_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_DBUS_ACTION_GROUP))
+#define G_DBUS_ACTION_GROUP_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_DBUS_ACTION_GROUP, GDBusActionGroupClass))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_action_group_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+GDBusActionGroup * g_dbus_action_group_get (GDBusConnection *connection,
+ const gchar *bus_name,
+ const gchar *object_path);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_ACTION_GROUP_H__ */
diff --git a/include/glib/gio/gdbusaddress.h b/include/glib/gio/gdbusaddress.h
new file mode 100644
index 0000000000..43915bb8d5
--- /dev/null
+++ b/include/glib/gio/gdbusaddress.h
@@ -0,0 +1,65 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_ADDRESS_H__
+#define __G_DBUS_ADDRESS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_36
+gchar *g_dbus_address_escape_value (const gchar *string);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_is_address (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_is_supported_address (const gchar *string,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_address_get_stream (const gchar *address,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GIOStream *g_dbus_address_get_stream_finish (GAsyncResult *res,
+ gchar **out_guid,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GIOStream *g_dbus_address_get_stream_sync (const gchar *address,
+ gchar **out_guid,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_dbus_address_get_for_bus_sync (GBusType bus_type,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_ADDRESS_H__ */
diff --git a/include/glib/gio/gdbusauthobserver.h b/include/glib/gio/gdbusauthobserver.h
new file mode 100644
index 0000000000..8fe7b32928
--- /dev/null
+++ b/include/glib/gio/gdbusauthobserver.h
@@ -0,0 +1,51 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_AUTH_OBSERVER_H__
+#define __G_DBUS_AUTH_OBSERVER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_AUTH_OBSERVER (g_dbus_auth_observer_get_type ())
+#define G_DBUS_AUTH_OBSERVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_AUTH_OBSERVER, GDBusAuthObserver))
+#define G_IS_DBUS_AUTH_OBSERVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_AUTH_OBSERVER))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_auth_observer_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusAuthObserver *g_dbus_auth_observer_new (void);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_auth_observer_authorize_authenticated_peer (GDBusAuthObserver *observer,
+ GIOStream *stream,
+ GCredentials *credentials);
+
+GLIB_AVAILABLE_IN_2_34
+gboolean g_dbus_auth_observer_allow_mechanism (GDBusAuthObserver *observer,
+ const gchar *mechanism);
+
+G_END_DECLS
+
+#endif /* _G_DBUS_AUTH_OBSERVER_H__ */
diff --git a/include/glib/gio/gdbusconnection.h b/include/glib/gio/gdbusconnection.h
new file mode 100644
index 0000000000..c37363c0d1
--- /dev/null
+++ b/include/glib/gio/gdbusconnection.h
@@ -0,0 +1,683 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_CONNECTION_H__
+#define __G_DBUS_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_CONNECTION (g_dbus_connection_get_type ())
+#define G_DBUS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_CONNECTION, GDBusConnection))
+#define G_IS_DBUS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_CONNECTION))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_connection_get_type (void) G_GNUC_CONST;
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+GLIB_AVAILABLE_IN_ALL
+void g_bus_get (GBusType bus_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_bus_get_finish (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_bus_get_sync (GBusType bus_type,
+ GCancellable *cancellable,
+ GError **error);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_new (GIOStream *stream,
+ const gchar *guid,
+ GDBusConnectionFlags flags,
+ GDBusAuthObserver *observer,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_connection_new_finish (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_connection_new_sync (GIOStream *stream,
+ const gchar *guid,
+ GDBusConnectionFlags flags,
+ GDBusAuthObserver *observer,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_new_for_address (const gchar *address,
+ GDBusConnectionFlags flags,
+ GDBusAuthObserver *observer,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_connection_new_for_address_finish (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_connection_new_for_address_sync (const gchar *address,
+ GDBusConnectionFlags flags,
+ GDBusAuthObserver *observer,
+ GCancellable *cancellable,
+ GError **error);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_start_message_processing (GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_is_closed (GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+GIOStream *g_dbus_connection_get_stream (GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_connection_get_guid (GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_connection_get_unique_name (GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+GCredentials *g_dbus_connection_get_peer_credentials (GDBusConnection *connection);
+
+GLIB_AVAILABLE_IN_2_34
+guint32 g_dbus_connection_get_last_serial (GDBusConnection *connection);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_get_exit_on_close (GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_set_exit_on_close (GDBusConnection *connection,
+ gboolean exit_on_close);
+GLIB_AVAILABLE_IN_ALL
+GDBusCapabilityFlags g_dbus_connection_get_capabilities (GDBusConnection *connection);
+GLIB_AVAILABLE_IN_2_60
+GDBusConnectionFlags g_dbus_connection_get_flags (GDBusConnection *connection);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_close (GDBusConnection *connection,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_close_finish (GDBusConnection *connection,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_close_sync (GDBusConnection *connection,
+ GCancellable *cancellable,
+ GError **error);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_flush (GDBusConnection *connection,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_flush_finish (GDBusConnection *connection,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_flush_sync (GDBusConnection *connection,
+ GCancellable *cancellable,
+ GError **error);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_send_message (GDBusConnection *connection,
+ GDBusMessage *message,
+ GDBusSendMessageFlags flags,
+ volatile guint32 *out_serial,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_send_message_with_reply (GDBusConnection *connection,
+ GDBusMessage *message,
+ GDBusSendMessageFlags flags,
+ gint timeout_msec,
+ volatile guint32 *out_serial,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_connection_send_message_with_reply_finish (GDBusConnection *connection,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_connection_send_message_with_reply_sync (GDBusConnection *connection,
+ GDBusMessage *message,
+ GDBusSendMessageFlags flags,
+ gint timeout_msec,
+ volatile guint32 *out_serial,
+ GCancellable *cancellable,
+ GError **error);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_emit_signal (GDBusConnection *connection,
+ const gchar *destination_bus_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_call (GDBusConnection *connection,
+ const gchar *bus_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ const GVariantType *reply_type,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_connection_call_finish (GDBusConnection *connection,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_connection_call_sync (GDBusConnection *connection,
+ const gchar *bus_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ const GVariantType *reply_type,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_30
+void g_dbus_connection_call_with_unix_fd_list (GDBusConnection *connection,
+ const gchar *bus_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ const GVariantType *reply_type,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GUnixFDList *fd_list,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_30
+GVariant *g_dbus_connection_call_with_unix_fd_list_finish (GDBusConnection *connection,
+ GUnixFDList **out_fd_list,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_2_30
+GVariant *g_dbus_connection_call_with_unix_fd_list_sync (GDBusConnection *connection,
+ const gchar *bus_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ const GVariantType *reply_type,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GUnixFDList *fd_list,
+ GUnixFDList **out_fd_list,
+ GCancellable *cancellable,
+ GError **error);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+
+/**
+ * GDBusInterfaceMethodCallFunc:
+ * @connection: A #GDBusConnection.
+ * @sender: The unique bus name of the remote caller.
+ * @object_path: The object path that the method was invoked on.
+ * @interface_name: The D-Bus interface name the method was invoked on.
+ * @method_name: The name of the method that was invoked.
+ * @parameters: A #GVariant tuple with parameters.
+ * @invocation: (transfer full): A #GDBusMethodInvocation object that must be used to return a value or error.
+ * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_object().
+ *
+ * The type of the @method_call function in #GDBusInterfaceVTable.
+ *
+ * Since: 2.26
+ */
+typedef void (*GDBusInterfaceMethodCallFunc) (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data);
+
+/**
+ * GDBusInterfaceGetPropertyFunc:
+ * @connection: A #GDBusConnection.
+ * @sender: The unique bus name of the remote caller.
+ * @object_path: The object path that the method was invoked on.
+ * @interface_name: The D-Bus interface name for the property.
+ * @property_name: The name of the property to get the value of.
+ * @error: Return location for error.
+ * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_object().
+ *
+ * The type of the @get_property function in #GDBusInterfaceVTable.
+ *
+ * Returns: A #GVariant with the value for @property_name or %NULL if
+ * @error is set. If the returned #GVariant is floating, it is
+ * consumed - otherwise its reference count is decreased by one.
+ *
+ * Since: 2.26
+ */
+typedef GVariant *(*GDBusInterfaceGetPropertyFunc) (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data);
+
+/**
+ * GDBusInterfaceSetPropertyFunc:
+ * @connection: A #GDBusConnection.
+ * @sender: The unique bus name of the remote caller.
+ * @object_path: The object path that the method was invoked on.
+ * @interface_name: The D-Bus interface name for the property.
+ * @property_name: The name of the property to get the value of.
+ * @value: The value to set the property to.
+ * @error: Return location for error.
+ * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_object().
+ *
+ * The type of the @set_property function in #GDBusInterfaceVTable.
+ *
+ * Returns: %TRUE if the property was set to @value, %FALSE if @error is set.
+ *
+ * Since: 2.26
+ */
+typedef gboolean (*GDBusInterfaceSetPropertyFunc) (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *property_name,
+ GVariant *value,
+ GError **error,
+ gpointer user_data);
+
+/**
+ * GDBusInterfaceVTable:
+ * @method_call: Function for handling incoming method calls.
+ * @get_property: Function for getting a property.
+ * @set_property: Function for setting a property.
+ *
+ * Virtual table for handling properties and method calls for a D-Bus
+ * interface.
+ *
+ * Since 2.38, if you want to handle getting/setting D-Bus properties
+ * asynchronously, give %NULL as your get_property() or set_property()
+ * function. The D-Bus call will be directed to your @method_call function,
+ * with the provided @interface_name set to "org.freedesktop.DBus.Properties".
+ *
+ * Ownership of the #GDBusMethodInvocation object passed to the
+ * method_call() function is transferred to your handler; you must
+ * call one of the methods of #GDBusMethodInvocation to return a reply
+ * (possibly empty), or an error. These functions also take ownership
+ * of the passed-in invocation object, so unless the invocation
+ * object has otherwise been referenced, it will be then be freed.
+ * Calling one of these functions may be done within your
+ * method_call() implementation but it also can be done at a later
+ * point to handle the method asynchronously.
+ *
+ * The usual checks on the validity of the calls is performed. For
+ * `Get` calls, an error is automatically returned if the property does
+ * not exist or the permissions do not allow access. The same checks are
+ * performed for `Set` calls, and the provided value is also checked for
+ * being the correct type.
+ *
+ * For both `Get` and `Set` calls, the #GDBusMethodInvocation
+ * passed to the @method_call handler can be queried with
+ * g_dbus_method_invocation_get_property_info() to get a pointer
+ * to the #GDBusPropertyInfo of the property.
+ *
+ * If you have readable properties specified in your interface info,
+ * you must ensure that you either provide a non-%NULL @get_property()
+ * function or provide implementations of both the `Get` and `GetAll`
+ * methods on org.freedesktop.DBus.Properties interface in your @method_call
+ * function. Note that the required return type of the `Get` call is
+ * `(v)`, not the type of the property. `GetAll` expects a return value
+ * of type `a{sv}`.
+ *
+ * If you have writable properties specified in your interface info,
+ * you must ensure that you either provide a non-%NULL @set_property()
+ * function or provide an implementation of the `Set` call. If implementing
+ * the call, you must return the value of type %G_VARIANT_TYPE_UNIT.
+ *
+ * Since: 2.26
+ */
+struct _GDBusInterfaceVTable
+{
+ GDBusInterfaceMethodCallFunc method_call;
+ GDBusInterfaceGetPropertyFunc get_property;
+ GDBusInterfaceSetPropertyFunc set_property;
+
+ /*< private >*/
+ /* Padding for future expansion - also remember to update
+ * gdbusconnection.c:_g_dbus_interface_vtable_copy() when
+ * changing this.
+ */
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+guint g_dbus_connection_register_object (GDBusConnection *connection,
+ const gchar *object_path,
+ GDBusInterfaceInfo *interface_info,
+ const GDBusInterfaceVTable *vtable,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func,
+ GError **error);
+GLIB_AVAILABLE_IN_2_46
+guint g_dbus_connection_register_object_with_closures (GDBusConnection *connection,
+ const gchar *object_path,
+ GDBusInterfaceInfo *interface_info,
+ GClosure *method_call_closure,
+ GClosure *get_property_closure,
+ GClosure *set_property_closure,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_unregister_object (GDBusConnection *connection,
+ guint registration_id);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+/**
+ * GDBusSubtreeEnumerateFunc:
+ * @connection: A #GDBusConnection.
+ * @sender: The unique bus name of the remote caller.
+ * @object_path: The object path that was registered with g_dbus_connection_register_subtree().
+ * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
+ *
+ * The type of the @enumerate function in #GDBusSubtreeVTable.
+ *
+ * This function is called when generating introspection data and also
+ * when preparing to dispatch incoming messages in the event that the
+ * %G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not
+ * specified (ie: to verify that the object path is valid).
+ *
+ * Hierarchies are not supported; the items that you return should not
+ * contain the '/' character.
+ *
+ * The return value will be freed with g_strfreev().
+ *
+ * Returns: A newly allocated array of strings for node names that are children of @object_path.
+ *
+ * Since: 2.26
+ */
+typedef gchar** (*GDBusSubtreeEnumerateFunc) (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ gpointer user_data);
+
+/**
+ * GDBusSubtreeIntrospectFunc:
+ * @connection: A #GDBusConnection.
+ * @sender: The unique bus name of the remote caller.
+ * @object_path: The object path that was registered with g_dbus_connection_register_subtree().
+ * @node: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
+ * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
+ *
+ * The type of the @introspect function in #GDBusSubtreeVTable.
+ *
+ * Subtrees are flat. @node, if non-%NULL, is always exactly one
+ * segment of the object path (ie: it never contains a slash).
+ *
+ * This function should return %NULL to indicate that there is no object
+ * at this node.
+ *
+ * If this function returns non-%NULL, the return value is expected to
+ * be a %NULL-terminated array of pointers to #GDBusInterfaceInfo
+ * structures describing the interfaces implemented by @node. This
+ * array will have g_dbus_interface_info_unref() called on each item
+ * before being freed with g_free().
+ *
+ * The difference between returning %NULL and an array containing zero
+ * items is that the standard DBus interfaces will returned to the
+ * remote introspector in the empty array case, but not in the %NULL
+ * case.
+ *
+ * Returns: A %NULL-terminated array of pointers to #GDBusInterfaceInfo, or %NULL.
+ *
+ * Since: 2.26
+ */
+typedef GDBusInterfaceInfo ** (*GDBusSubtreeIntrospectFunc) (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *node,
+ gpointer user_data);
+
+/**
+ * GDBusSubtreeDispatchFunc:
+ * @connection: A #GDBusConnection.
+ * @sender: The unique bus name of the remote caller.
+ * @object_path: The object path that was registered with g_dbus_connection_register_subtree().
+ * @interface_name: The D-Bus interface name that the method call or property access is for.
+ * @node: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
+ * @out_user_data: (nullable) (not optional): Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL).
+ * @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
+ *
+ * The type of the @dispatch function in #GDBusSubtreeVTable.
+ *
+ * Subtrees are flat. @node, if non-%NULL, is always exactly one
+ * segment of the object path (ie: it never contains a slash).
+ *
+ * Returns: A #GDBusInterfaceVTable or %NULL if you don't want to handle the methods.
+ *
+ * Since: 2.26
+ */
+typedef const GDBusInterfaceVTable * (*GDBusSubtreeDispatchFunc) (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *node,
+ gpointer *out_user_data,
+ gpointer user_data);
+
+/**
+ * GDBusSubtreeVTable:
+ * @enumerate: Function for enumerating child nodes.
+ * @introspect: Function for introspecting a child node.
+ * @dispatch: Function for dispatching a remote call on a child node.
+ *
+ * Virtual table for handling subtrees registered with g_dbus_connection_register_subtree().
+ *
+ * Since: 2.26
+ */
+struct _GDBusSubtreeVTable
+{
+ GDBusSubtreeEnumerateFunc enumerate;
+ GDBusSubtreeIntrospectFunc introspect;
+ GDBusSubtreeDispatchFunc dispatch;
+
+ /*< private >*/
+ /* Padding for future expansion - also remember to update
+ * gdbusconnection.c:_g_dbus_subtree_vtable_copy() when
+ * changing this.
+ */
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+guint g_dbus_connection_register_subtree (GDBusConnection *connection,
+ const gchar *object_path,
+ const GDBusSubtreeVTable *vtable,
+ GDBusSubtreeFlags flags,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_connection_unregister_subtree (GDBusConnection *connection,
+ guint registration_id);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+/**
+ * GDBusSignalCallback:
+ * @connection: A #GDBusConnection.
+ * @sender_name: The unique bus name of the sender of the signal.
+ * @object_path: The object path that the signal was emitted on.
+ * @interface_name: The name of the interface.
+ * @signal_name: The name of the signal.
+ * @parameters: A #GVariant tuple with parameters for the signal.
+ * @user_data: User data passed when subscribing to the signal.
+ *
+ * Signature for callback function used in g_dbus_connection_signal_subscribe().
+ *
+ * Since: 2.26
+ */
+typedef void (*GDBusSignalCallback) (GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_dbus_connection_signal_subscribe (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *interface_name,
+ const gchar *member,
+ const gchar *object_path,
+ const gchar *arg0,
+ GDBusSignalFlags flags,
+ GDBusSignalCallback callback,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_signal_unsubscribe (GDBusConnection *connection,
+ guint subscription_id);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+/**
+ * GDBusMessageFilterFunction:
+ * @connection: (transfer none): A #GDBusConnection.
+ * @message: (transfer full): A locked #GDBusMessage that the filter function takes ownership of.
+ * @incoming: %TRUE if it is a message received from the other peer, %FALSE if it is
+ * a message to be sent to the other peer.
+ * @user_data: User data passed when adding the filter.
+ *
+ * Signature for function used in g_dbus_connection_add_filter().
+ *
+ * A filter function is passed a #GDBusMessage and expected to return
+ * a #GDBusMessage too. Passive filter functions that don't modify the
+ * message can simply return the @message object:
+ * |[
+ * static GDBusMessage *
+ * passive_filter (GDBusConnection *connection
+ * GDBusMessage *message,
+ * gboolean incoming,
+ * gpointer user_data)
+ * {
+ * // inspect @message
+ * return message;
+ * }
+ * ]|
+ * Filter functions that wants to drop a message can simply return %NULL:
+ * |[
+ * static GDBusMessage *
+ * drop_filter (GDBusConnection *connection
+ * GDBusMessage *message,
+ * gboolean incoming,
+ * gpointer user_data)
+ * {
+ * if (should_drop_message)
+ * {
+ * g_object_unref (message);
+ * message = NULL;
+ * }
+ * return message;
+ * }
+ * ]|
+ * Finally, a filter function may modify a message by copying it:
+ * |[
+ * static GDBusMessage *
+ * modifying_filter (GDBusConnection *connection
+ * GDBusMessage *message,
+ * gboolean incoming,
+ * gpointer user_data)
+ * {
+ * GDBusMessage *copy;
+ * GError *error;
+ *
+ * error = NULL;
+ * copy = g_dbus_message_copy (message, &error);
+ * // handle @error being set
+ * g_object_unref (message);
+ *
+ * // modify @copy
+ *
+ * return copy;
+ * }
+ * ]|
+ * If the returned #GDBusMessage is different from @message and cannot
+ * be sent on @connection (it could use features, such as file
+ * descriptors, not compatible with @connection), then a warning is
+ * logged to standard error. Applications can
+ * check this ahead of time using g_dbus_message_to_blob() passing a
+ * #GDBusCapabilityFlags value obtained from @connection.
+ *
+ * Returns: (transfer full) (nullable): A #GDBusMessage that will be freed with
+ * g_object_unref() or %NULL to drop the message. Passive filter
+ * functions can simply return the passed @message object.
+ *
+ * Since: 2.26
+ */
+typedef GDBusMessage *(*GDBusMessageFilterFunction) (GDBusConnection *connection,
+ GDBusMessage *message,
+ gboolean incoming,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_dbus_connection_add_filter (GDBusConnection *connection,
+ GDBusMessageFilterFunction filter_function,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_connection_remove_filter (GDBusConnection *connection,
+ guint filter_id);
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+
+G_END_DECLS
+
+#endif /* __G_DBUS_CONNECTION_H__ */
diff --git a/include/glib/gio/gdbuserror.h b/include/glib/gio/gdbuserror.h
new file mode 100644
index 0000000000..35a156cb26
--- /dev/null
+++ b/include/glib/gio/gdbuserror.h
@@ -0,0 +1,109 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_ERROR_H__
+#define __G_DBUS_ERROR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_DBUS_ERROR:
+ *
+ * Error domain for errors generated by a remote message bus. Errors
+ * in this domain will be from the #GDBusError enumeration. See
+ * #GError for more information on error domains.
+ *
+ * Note that this error domain is intended only for
+ * returning errors from a remote message bus process. Errors
+ * generated locally in-process by e.g. #GDBusConnection should use the
+ * %G_IO_ERROR domain.
+ *
+ * Since: 2.26
+ */
+#define G_DBUS_ERROR g_dbus_error_quark()
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_dbus_error_quark (void);
+
+/* Used by applications to check, get and strip the D-Bus error name */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_error_is_remote_error (const GError *error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_dbus_error_get_remote_error (const GError *error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_error_strip_remote_error (GError *error);
+
+/**
+ * GDBusErrorEntry:
+ * @error_code: An error code.
+ * @dbus_error_name: The D-Bus error name to associate with @error_code.
+ *
+ * Struct used in g_dbus_error_register_error_domain().
+ *
+ * Since: 2.26
+ */
+struct _GDBusErrorEntry
+{
+ gint error_code;
+ const gchar *dbus_error_name;
+};
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_error_register_error (GQuark error_domain,
+ gint error_code,
+ const gchar *dbus_error_name);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_error_unregister_error (GQuark error_domain,
+ gint error_code,
+ const gchar *dbus_error_name);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_error_register_error_domain (const gchar *error_domain_quark_name,
+ volatile gsize *quark_volatile,
+ const GDBusErrorEntry *entries,
+ guint num_entries);
+
+/* Only used by object mappings to map back and forth to GError */
+GLIB_AVAILABLE_IN_ALL
+GError *g_dbus_error_new_for_dbus_error (const gchar *dbus_error_name,
+ const gchar *dbus_error_message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_error_set_dbus_error (GError **error,
+ const gchar *dbus_error_name,
+ const gchar *dbus_error_message,
+ const gchar *format,
+ ...) G_GNUC_PRINTF(4, 5);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_error_set_dbus_error_valist (GError **error,
+ const gchar *dbus_error_name,
+ const gchar *dbus_error_message,
+ const gchar *format,
+ va_list var_args) G_GNUC_PRINTF(4, 0);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_dbus_error_encode_gerror (const GError *error);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_ERROR_H__ */
diff --git a/include/glib/gio/gdbusinterface.h b/include/glib/gio/gdbusinterface.h
new file mode 100644
index 0000000000..b2f3c44056
--- /dev/null
+++ b/include/glib/gio/gdbusinterface.h
@@ -0,0 +1,81 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_INTERFACE_H__
+#define __G_DBUS_INTERFACE_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_INTERFACE (g_dbus_interface_get_type())
+#define G_DBUS_INTERFACE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_INTERFACE, GDBusInterface))
+#define G_IS_DBUS_INTERFACE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_INTERFACE))
+#define G_DBUS_INTERFACE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), G_TYPE_DBUS_INTERFACE, GDBusInterfaceIface))
+
+/**
+ * GDBusInterface:
+ *
+ * Base type for D-Bus interfaces.
+ *
+ * Since: 2.30
+ */
+
+typedef struct _GDBusInterfaceIface GDBusInterfaceIface;
+
+/**
+ * GDBusInterfaceIface:
+ * @parent_iface: The parent interface.
+ * @get_info: Returns a #GDBusInterfaceInfo. See g_dbus_interface_get_info().
+ * @get_object: Gets the enclosing #GDBusObject. See g_dbus_interface_get_object().
+ * @set_object: Sets the enclosing #GDBusObject. See g_dbus_interface_set_object().
+ * @dup_object: Gets a reference to the enclosing #GDBusObject. See g_dbus_interface_dup_object(). Added in 2.32.
+ *
+ * Base type for D-Bus interfaces.
+ *
+ * Since: 2.30
+ */
+struct _GDBusInterfaceIface
+{
+ GTypeInterface parent_iface;
+
+ /* Virtual Functions */
+ GDBusInterfaceInfo *(*get_info) (GDBusInterface *interface_);
+ GDBusObject *(*get_object) (GDBusInterface *interface_);
+ void (*set_object) (GDBusInterface *interface_,
+ GDBusObject *object);
+ GDBusObject *(*dup_object) (GDBusInterface *interface_);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_interface_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusInterfaceInfo *g_dbus_interface_get_info (GDBusInterface *interface_);
+GLIB_AVAILABLE_IN_ALL
+GDBusObject *g_dbus_interface_get_object (GDBusInterface *interface_);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_set_object (GDBusInterface *interface_,
+ GDBusObject *object);
+GLIB_AVAILABLE_IN_2_32
+GDBusObject *g_dbus_interface_dup_object (GDBusInterface *interface_);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_INTERFACE_H__ */
diff --git a/include/glib/gio/gdbusinterfaceskeleton.h b/include/glib/gio/gdbusinterfaceskeleton.h
new file mode 100644
index 0000000000..bf3b630e42
--- /dev/null
+++ b/include/glib/gio/gdbusinterfaceskeleton.h
@@ -0,0 +1,127 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_INTERFACE_SKELETON_H__
+#define __G_DBUS_INTERFACE_SKELETON_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_INTERFACE_SKELETON (g_dbus_interface_skeleton_get_type ())
+#define G_DBUS_INTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeleton))
+#define G_DBUS_INTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeletonClass))
+#define G_DBUS_INTERFACE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeletonClass))
+#define G_IS_DBUS_INTERFACE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_INTERFACE_SKELETON))
+#define G_IS_DBUS_INTERFACE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_INTERFACE_SKELETON))
+
+typedef struct _GDBusInterfaceSkeletonClass GDBusInterfaceSkeletonClass;
+typedef struct _GDBusInterfaceSkeletonPrivate GDBusInterfaceSkeletonPrivate;
+
+/**
+ * GDBusInterfaceSkeleton:
+ *
+ * The #GDBusInterfaceSkeleton structure contains private data and should
+ * only be accessed using the provided API.
+ *
+ * Since: 2.30
+ */
+struct _GDBusInterfaceSkeleton
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusInterfaceSkeletonPrivate *priv;
+};
+
+/**
+ * GDBusInterfaceSkeletonClass:
+ * @parent_class: The parent class.
+ * @get_info: Returns a #GDBusInterfaceInfo. See g_dbus_interface_skeleton_get_info() for details.
+ * @get_vtable: Returns a #GDBusInterfaceVTable. See g_dbus_interface_skeleton_get_vtable() for details.
+ * @get_properties: Returns a #GVariant with all properties. See g_dbus_interface_skeleton_get_properties().
+ * @flush: Emits outstanding changes, if any. See g_dbus_interface_skeleton_flush().
+ * @g_authorize_method: Signal class handler for the #GDBusInterfaceSkeleton::g-authorize-method signal.
+ *
+ * Class structure for #GDBusInterfaceSkeleton.
+ *
+ * Since: 2.30
+ */
+struct _GDBusInterfaceSkeletonClass
+{
+ GObjectClass parent_class;
+
+ /* Virtual Functions */
+ GDBusInterfaceInfo *(*get_info) (GDBusInterfaceSkeleton *interface_);
+ GDBusInterfaceVTable *(*get_vtable) (GDBusInterfaceSkeleton *interface_);
+ GVariant *(*get_properties) (GDBusInterfaceSkeleton *interface_);
+ void (*flush) (GDBusInterfaceSkeleton *interface_);
+
+ /*< private >*/
+ gpointer vfunc_padding[8];
+ /*< public >*/
+
+ /* Signals */
+ gboolean (*g_authorize_method) (GDBusInterfaceSkeleton *interface_,
+ GDBusMethodInvocation *invocation);
+
+ /*< private >*/
+ gpointer signal_padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_interface_skeleton_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusInterfaceSkeletonFlags g_dbus_interface_skeleton_get_flags (GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_skeleton_set_flags (GDBusInterfaceSkeleton *interface_,
+ GDBusInterfaceSkeletonFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GDBusInterfaceInfo *g_dbus_interface_skeleton_get_info (GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+GDBusInterfaceVTable *g_dbus_interface_skeleton_get_vtable (GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_interface_skeleton_get_properties (GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_skeleton_flush (GDBusInterfaceSkeleton *interface_);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_interface_skeleton_export (GDBusInterfaceSkeleton *interface_,
+ GDBusConnection *connection,
+ const gchar *object_path,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_skeleton_unexport (GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_skeleton_unexport_from_connection (GDBusInterfaceSkeleton *interface_,
+ GDBusConnection *connection);
+
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_interface_skeleton_get_connection (GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+GList *g_dbus_interface_skeleton_get_connections (GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_interface_skeleton_has_connection (GDBusInterfaceSkeleton *interface_,
+ GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_interface_skeleton_get_object_path (GDBusInterfaceSkeleton *interface_);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_INTERFACE_SKELETON_H */
diff --git a/include/glib/gio/gdbusintrospection.h b/include/glib/gio/gdbusintrospection.h
new file mode 100644
index 0000000000..14b171055e
--- /dev/null
+++ b/include/glib/gio/gdbusintrospection.h
@@ -0,0 +1,325 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_INTROSPECTION_H__
+#define __G_DBUS_INTROSPECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GDBusAnnotationInfo:
+ * @ref_count: The reference count or -1 if statically allocated.
+ * @key: The name of the annotation, e.g. "org.freedesktop.DBus.Deprecated".
+ * @value: The value of the annotation.
+ * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
+ *
+ * Information about an annotation.
+ *
+ * Since: 2.26
+ */
+struct _GDBusAnnotationInfo
+{
+ /*< public >*/
+ volatile gint ref_count;
+ gchar *key;
+ gchar *value;
+ GDBusAnnotationInfo **annotations;
+};
+
+/**
+ * GDBusArgInfo:
+ * @ref_count: The reference count or -1 if statically allocated.
+ * @name: Name of the argument, e.g. @unix_user_id.
+ * @signature: D-Bus signature of the argument (a single complete type).
+ * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
+ *
+ * Information about an argument for a method or a signal.
+ *
+ * Since: 2.26
+ */
+struct _GDBusArgInfo
+{
+ /*< public >*/
+ volatile gint ref_count;
+ gchar *name;
+ gchar *signature;
+ GDBusAnnotationInfo **annotations;
+};
+
+/**
+ * GDBusMethodInfo:
+ * @ref_count: The reference count or -1 if statically allocated.
+ * @name: The name of the D-Bus method, e.g. @RequestName.
+ * @in_args: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no in arguments.
+ * @out_args: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no out arguments.
+ * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
+ *
+ * Information about a method on an D-Bus interface.
+ *
+ * Since: 2.26
+ */
+struct _GDBusMethodInfo
+{
+ /*< public >*/
+ volatile gint ref_count;
+ gchar *name;
+ GDBusArgInfo **in_args;
+ GDBusArgInfo **out_args;
+ GDBusAnnotationInfo **annotations;
+};
+
+/**
+ * GDBusSignalInfo:
+ * @ref_count: The reference count or -1 if statically allocated.
+ * @name: The name of the D-Bus signal, e.g. "NameOwnerChanged".
+ * @args: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusArgInfo structures or %NULL if there are no arguments.
+ * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
+ *
+ * Information about a signal on a D-Bus interface.
+ *
+ * Since: 2.26
+ */
+struct _GDBusSignalInfo
+{
+ /*< public >*/
+ volatile gint ref_count;
+ gchar *name;
+ GDBusArgInfo **args;
+ GDBusAnnotationInfo **annotations;
+};
+
+/**
+ * GDBusPropertyInfo:
+ * @ref_count: The reference count or -1 if statically allocated.
+ * @name: The name of the D-Bus property, e.g. "SupportedFilesystems".
+ * @signature: The D-Bus signature of the property (a single complete type).
+ * @flags: Access control flags for the property.
+ * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
+ *
+ * Information about a D-Bus property on a D-Bus interface.
+ *
+ * Since: 2.26
+ */
+struct _GDBusPropertyInfo
+{
+ /*< public >*/
+ volatile gint ref_count;
+ gchar *name;
+ gchar *signature;
+ GDBusPropertyInfoFlags flags;
+ GDBusAnnotationInfo **annotations;
+};
+
+/**
+ * GDBusInterfaceInfo:
+ * @ref_count: The reference count or -1 if statically allocated.
+ * @name: The name of the D-Bus interface, e.g. "org.freedesktop.DBus.Properties".
+ * @methods: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusMethodInfo structures or %NULL if there are no methods.
+ * @signals: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusSignalInfo structures or %NULL if there are no signals.
+ * @properties: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusPropertyInfo structures or %NULL if there are no properties.
+ * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
+ *
+ * Information about a D-Bus interface.
+ *
+ * Since: 2.26
+ */
+struct _GDBusInterfaceInfo
+{
+ /*< public >*/
+ volatile gint ref_count;
+ gchar *name;
+ GDBusMethodInfo **methods;
+ GDBusSignalInfo **signals;
+ GDBusPropertyInfo **properties;
+ GDBusAnnotationInfo **annotations;
+};
+
+/**
+ * GDBusNodeInfo:
+ * @ref_count: The reference count or -1 if statically allocated.
+ * @path: The path of the node or %NULL if omitted. Note that this may be a relative path. See the D-Bus specification for more details.
+ * @interfaces: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusInterfaceInfo structures or %NULL if there are no interfaces.
+ * @nodes: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusNodeInfo structures or %NULL if there are no nodes.
+ * @annotations: (array zero-terminated=1): A pointer to a %NULL-terminated array of pointers to #GDBusAnnotationInfo structures or %NULL if there are no annotations.
+ *
+ * Information about nodes in a remote object hierarchy.
+ *
+ * Since: 2.26
+ */
+struct _GDBusNodeInfo
+{
+ /*< public >*/
+ volatile gint ref_count;
+ gchar *path;
+ GDBusInterfaceInfo **interfaces;
+ GDBusNodeInfo **nodes;
+ GDBusAnnotationInfo **annotations;
+};
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+GDBusMethodInfo *g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+GDBusSignalInfo *g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+GDBusPropertyInfo *g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_info_cache_build (GDBusInterfaceInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_info_cache_release (GDBusInterfaceInfo *info);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info,
+ guint indent,
+ GString *string_builder);
+
+GLIB_AVAILABLE_IN_ALL
+GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (GDBusNodeInfo *info,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_node_info_generate_xml (GDBusNodeInfo *info,
+ guint indent,
+ GString *string_builder);
+
+GLIB_AVAILABLE_IN_ALL
+GDBusNodeInfo *g_dbus_node_info_ref (GDBusNodeInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GDBusInterfaceInfo *g_dbus_interface_info_ref (GDBusInterfaceInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GDBusMethodInfo *g_dbus_method_info_ref (GDBusMethodInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GDBusSignalInfo *g_dbus_signal_info_ref (GDBusSignalInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GDBusPropertyInfo *g_dbus_property_info_ref (GDBusPropertyInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GDBusArgInfo *g_dbus_arg_info_ref (GDBusArgInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GDBusAnnotationInfo *g_dbus_annotation_info_ref (GDBusAnnotationInfo *info);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_node_info_unref (GDBusNodeInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_interface_info_unref (GDBusInterfaceInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_info_unref (GDBusMethodInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_signal_info_unref (GDBusSignalInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_property_info_unref (GDBusPropertyInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_arg_info_unref (GDBusArgInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info);
+
+/**
+ * G_TYPE_DBUS_NODE_INFO:
+ *
+ * The #GType for a boxed type holding a #GDBusNodeInfo.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DBUS_NODE_INFO (g_dbus_node_info_get_type ())
+
+/**
+ * G_TYPE_DBUS_INTERFACE_INFO:
+ *
+ * The #GType for a boxed type holding a #GDBusInterfaceInfo.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DBUS_INTERFACE_INFO (g_dbus_interface_info_get_type ())
+
+/**
+ * G_TYPE_DBUS_METHOD_INFO:
+ *
+ * The #GType for a boxed type holding a #GDBusMethodInfo.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DBUS_METHOD_INFO (g_dbus_method_info_get_type ())
+
+/**
+ * G_TYPE_DBUS_SIGNAL_INFO:
+ *
+ * The #GType for a boxed type holding a #GDBusSignalInfo.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DBUS_SIGNAL_INFO (g_dbus_signal_info_get_type ())
+
+/**
+ * G_TYPE_DBUS_PROPERTY_INFO:
+ *
+ * The #GType for a boxed type holding a #GDBusPropertyInfo.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DBUS_PROPERTY_INFO (g_dbus_property_info_get_type ())
+
+/**
+ * G_TYPE_DBUS_ARG_INFO:
+ *
+ * The #GType for a boxed type holding a #GDBusArgInfo.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DBUS_ARG_INFO (g_dbus_arg_info_get_type ())
+
+/**
+ * G_TYPE_DBUS_ANNOTATION_INFO:
+ *
+ * The #GType for a boxed type holding a #GDBusAnnotationInfo.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DBUS_ANNOTATION_INFO (g_dbus_annotation_info_get_type ())
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_node_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_interface_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_method_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_signal_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_property_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_arg_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_annotation_info_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __G_DBUS_INTROSPECTION_H__ */
diff --git a/include/glib/gio/gdbusmenumodel.h b/include/glib/gio/gdbusmenumodel.h
new file mode 100644
index 0000000000..dd2882d224
--- /dev/null
+++ b/include/glib/gio/gdbusmenumodel.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2011 Canonical Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_DBUS_MENU_MODEL_H__
+#define __G_DBUS_MENU_MODEL_H__
+
+#include <gio/gdbusconnection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_MENU_MODEL (g_dbus_menu_model_get_type ())
+#define G_DBUS_MENU_MODEL(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_DBUS_MENU_MODEL, GDBusMenuModel))
+#define G_IS_DBUS_MENU_MODEL(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_DBUS_MENU_MODEL))
+
+typedef struct _GDBusMenuModel GDBusMenuModel;
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_menu_model_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GDBusMenuModel * g_dbus_menu_model_get (GDBusConnection *connection,
+ const gchar *bus_name,
+ const gchar *object_path);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_MENU_MODEL_H__ */
diff --git a/include/glib/gio/gdbusmessage.h b/include/glib/gio/gdbusmessage.h
new file mode 100644
index 0000000000..5f039dc910
--- /dev/null
+++ b/include/glib/gio/gdbusmessage.h
@@ -0,0 +1,197 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_MESSAGE_H__
+#define __G_DBUS_MESSAGE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_MESSAGE (g_dbus_message_get_type ())
+#define G_DBUS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_MESSAGE, GDBusMessage))
+#define G_IS_DBUS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_MESSAGE))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_message_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new (void);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new_signal (const gchar *path,
+ const gchar *interface_,
+ const gchar *signal);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new_method_call (const gchar *name,
+ const gchar *path,
+ const gchar *interface_,
+ const gchar *method);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new_method_reply (GDBusMessage *method_call_message);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new_method_error (GDBusMessage *method_call_message,
+ const gchar *error_name,
+ const gchar *error_message_format,
+ ...) G_GNUC_PRINTF(3, 4);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new_method_error_valist (GDBusMessage *method_call_message,
+ const gchar *error_name,
+ const gchar *error_message_format,
+ va_list var_args);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new_method_error_literal (GDBusMessage *method_call_message,
+ const gchar *error_name,
+ const gchar *error_message);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_dbus_message_print (GDBusMessage *message,
+ guint indent);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_message_get_locked (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_lock (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_copy (GDBusMessage *message,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessageByteOrder g_dbus_message_get_byte_order (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_byte_order (GDBusMessage *message,
+ GDBusMessageByteOrder byte_order);
+
+GLIB_AVAILABLE_IN_ALL
+GDBusMessageType g_dbus_message_get_message_type (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_message_type (GDBusMessage *message,
+ GDBusMessageType type);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessageFlags g_dbus_message_get_flags (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_flags (GDBusMessage *message,
+ GDBusMessageFlags flags);
+GLIB_AVAILABLE_IN_ALL
+guint32 g_dbus_message_get_serial (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_serial (GDBusMessage *message,
+ guint32 serial);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_message_get_header (GDBusMessage *message,
+ GDBusMessageHeaderField header_field);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_header (GDBusMessage *message,
+ GDBusMessageHeaderField header_field,
+ GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+guchar *g_dbus_message_get_header_fields (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_message_get_body (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_body (GDBusMessage *message,
+ GVariant *body);
+GLIB_AVAILABLE_IN_ALL
+GUnixFDList *g_dbus_message_get_unix_fd_list (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_unix_fd_list (GDBusMessage *message,
+ GUnixFDList *fd_list);
+
+GLIB_AVAILABLE_IN_ALL
+guint32 g_dbus_message_get_reply_serial (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_reply_serial (GDBusMessage *message,
+ guint32 value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_interface (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_interface (GDBusMessage *message,
+ const gchar *value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_member (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_member (GDBusMessage *message,
+ const gchar *value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_path (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_path (GDBusMessage *message,
+ const gchar *value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_sender (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_sender (GDBusMessage *message,
+ const gchar *value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_destination (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_destination (GDBusMessage *message,
+ const gchar *value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_error_name (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_error_name (GDBusMessage *message,
+ const gchar *value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_signature (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_signature (GDBusMessage *message,
+ const gchar *value);
+
+GLIB_AVAILABLE_IN_ALL
+guint32 g_dbus_message_get_num_unix_fds (GDBusMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_message_set_num_unix_fds (GDBusMessage *message,
+ guint32 value);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_message_get_arg0 (GDBusMessage *message);
+
+
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_message_new_from_blob (guchar *blob,
+ gsize blob_len,
+ GDBusCapabilityFlags capabilities,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_dbus_message_bytes_needed (guchar *blob,
+ gsize blob_len,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+guchar *g_dbus_message_to_blob (GDBusMessage *message,
+ gsize *out_size,
+ GDBusCapabilityFlags capabilities,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_message_to_gerror (GDBusMessage *message,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_MESSAGE_H__ */
diff --git a/include/glib/gio/gdbusmethodinvocation.h b/include/glib/gio/gdbusmethodinvocation.h
new file mode 100644
index 0000000000..061256ffe4
--- /dev/null
+++ b/include/glib/gio/gdbusmethodinvocation.h
@@ -0,0 +1,97 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_METHOD_INVOCATION_H__
+#define __G_DBUS_METHOD_INVOCATION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_METHOD_INVOCATION (g_dbus_method_invocation_get_type ())
+#define G_DBUS_METHOD_INVOCATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_METHOD_INVOCATION, GDBusMethodInvocation))
+#define G_IS_DBUS_METHOD_INVOCATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_METHOD_INVOCATION))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_method_invocation_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_method_invocation_get_sender (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_method_invocation_get_object_path (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_method_invocation_get_interface_name (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_method_invocation_get_method_name (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+const GDBusMethodInfo *g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_2_38
+const GDBusPropertyInfo *g_dbus_method_invocation_get_property_info (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_method_invocation_get_connection (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+GDBusMessage *g_dbus_method_invocation_get_message (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_method_invocation_get_parameters (GDBusMethodInvocation *invocation);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_dbus_method_invocation_get_user_data (GDBusMethodInvocation *invocation);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_return_value (GDBusMethodInvocation *invocation,
+ GVariant *parameters);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_return_value_with_unix_fd_list (GDBusMethodInvocation *invocation,
+ GVariant *parameters,
+ GUnixFDList *fd_list);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_return_error (GDBusMethodInvocation *invocation,
+ GQuark domain,
+ gint code,
+ const gchar *format,
+ ...) G_GNUC_PRINTF(4, 5);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_return_error_valist (GDBusMethodInvocation *invocation,
+ GQuark domain,
+ gint code,
+ const gchar *format,
+ va_list var_args)
+ G_GNUC_PRINTF(4, 0);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_return_error_literal (GDBusMethodInvocation *invocation,
+ GQuark domain,
+ gint code,
+ const gchar *message);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_return_gerror (GDBusMethodInvocation *invocation,
+ const GError *error);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_take_error (GDBusMethodInvocation *invocation,
+ GError *error);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_method_invocation_return_dbus_error (GDBusMethodInvocation *invocation,
+ const gchar *error_name,
+ const gchar *error_message);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_METHOD_INVOCATION_H__ */
diff --git a/include/glib/gio/gdbusnameowning.h b/include/glib/gio/gdbusnameowning.h
new file mode 100644
index 0000000000..89c011a2fb
--- /dev/null
+++ b/include/glib/gio/gdbusnameowning.h
@@ -0,0 +1,115 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_NAME_OWNING_H__
+#define __G_DBUS_NAME_OWNING_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GBusAcquiredCallback:
+ * @connection: The #GDBusConnection to a message bus.
+ * @name: The name that is requested to be owned.
+ * @user_data: User data passed to g_bus_own_name().
+ *
+ * Invoked when a connection to a message bus has been obtained.
+ *
+ * Since: 2.26
+ */
+typedef void (*GBusAcquiredCallback) (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data);
+
+/**
+ * GBusNameAcquiredCallback:
+ * @connection: The #GDBusConnection on which to acquired the name.
+ * @name: The name being owned.
+ * @user_data: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
+ *
+ * Invoked when the name is acquired.
+ *
+ * Since: 2.26
+ */
+typedef void (*GBusNameAcquiredCallback) (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data);
+
+/**
+ * GBusNameLostCallback:
+ * @connection: The #GDBusConnection on which to acquire the name or %NULL if
+ * the connection was disconnected.
+ * @name: The name being owned.
+ * @user_data: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
+ *
+ * Invoked when the name is lost or @connection has been closed.
+ *
+ * Since: 2.26
+ */
+typedef void (*GBusNameLostCallback) (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_own_name (GBusType bus_type,
+ const gchar *name,
+ GBusNameOwnerFlags flags,
+ GBusAcquiredCallback bus_acquired_handler,
+ GBusNameAcquiredCallback name_acquired_handler,
+ GBusNameLostCallback name_lost_handler,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_own_name_on_connection (GDBusConnection *connection,
+ const gchar *name,
+ GBusNameOwnerFlags flags,
+ GBusNameAcquiredCallback name_acquired_handler,
+ GBusNameLostCallback name_lost_handler,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_own_name_with_closures (GBusType bus_type,
+ const gchar *name,
+ GBusNameOwnerFlags flags,
+ GClosure *bus_acquired_closure,
+ GClosure *name_acquired_closure,
+ GClosure *name_lost_closure);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_own_name_on_connection_with_closures (
+ GDBusConnection *connection,
+ const gchar *name,
+ GBusNameOwnerFlags flags,
+ GClosure *name_acquired_closure,
+ GClosure *name_lost_closure);
+
+GLIB_AVAILABLE_IN_ALL
+void g_bus_unown_name (guint owner_id);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_NAME_OWNING_H__ */
diff --git a/include/glib/gio/gdbusnamewatching.h b/include/glib/gio/gdbusnamewatching.h
new file mode 100644
index 0000000000..19d57f2c51
--- /dev/null
+++ b/include/glib/gio/gdbusnamewatching.h
@@ -0,0 +1,102 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_NAME_WATCHING_H__
+#define __G_DBUS_NAME_WATCHING_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GBusNameAppearedCallback:
+ * @connection: The #GDBusConnection the name is being watched on.
+ * @name: The name being watched.
+ * @name_owner: Unique name of the owner of the name being watched.
+ * @user_data: User data passed to g_bus_watch_name().
+ *
+ * Invoked when the name being watched is known to have to have an owner.
+ *
+ * Since: 2.26
+ */
+typedef void (*GBusNameAppearedCallback) (GDBusConnection *connection,
+ const gchar *name,
+ const gchar *name_owner,
+ gpointer user_data);
+
+/**
+ * GBusNameVanishedCallback:
+ * @connection: The #GDBusConnection the name is being watched on, or
+ * %NULL.
+ * @name: The name being watched.
+ * @user_data: User data passed to g_bus_watch_name().
+ *
+ * Invoked when the name being watched is known not to have to have an owner.
+ *
+ * This is also invoked when the #GDBusConnection on which the watch was
+ * established has been closed. In that case, @connection will be
+ * %NULL.
+ *
+ * Since: 2.26
+ */
+typedef void (*GBusNameVanishedCallback) (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data);
+
+
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_watch_name (GBusType bus_type,
+ const gchar *name,
+ GBusNameWatcherFlags flags,
+ GBusNameAppearedCallback name_appeared_handler,
+ GBusNameVanishedCallback name_vanished_handler,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func);
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_watch_name_on_connection (GDBusConnection *connection,
+ const gchar *name,
+ GBusNameWatcherFlags flags,
+ GBusNameAppearedCallback name_appeared_handler,
+ GBusNameVanishedCallback name_vanished_handler,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func);
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_watch_name_with_closures (GBusType bus_type,
+ const gchar *name,
+ GBusNameWatcherFlags flags,
+ GClosure *name_appeared_closure,
+ GClosure *name_vanished_closure);
+GLIB_AVAILABLE_IN_ALL
+guint g_bus_watch_name_on_connection_with_closures (
+ GDBusConnection *connection,
+ const gchar *name,
+ GBusNameWatcherFlags flags,
+ GClosure *name_appeared_closure,
+ GClosure *name_vanished_closure);
+GLIB_AVAILABLE_IN_ALL
+void g_bus_unwatch_name (guint watcher_id);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_NAME_WATCHING_H__ */
diff --git a/include/glib/gio/gdbusobject.h b/include/glib/gio/gdbusobject.h
new file mode 100644
index 0000000000..157c52b1a8
--- /dev/null
+++ b/include/glib/gio/gdbusobject.h
@@ -0,0 +1,78 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_OBJECT_H__
+#define __G_DBUS_OBJECT_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_OBJECT (g_dbus_object_get_type())
+#define G_DBUS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT, GDBusObject))
+#define G_IS_DBUS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT))
+#define G_DBUS_OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), G_TYPE_DBUS_OBJECT, GDBusObjectIface))
+
+typedef struct _GDBusObjectIface GDBusObjectIface;
+
+/**
+ * GDBusObjectIface:
+ * @parent_iface: The parent interface.
+ * @get_object_path: Returns the object path. See g_dbus_object_get_object_path().
+ * @get_interfaces: Returns all interfaces. See g_dbus_object_get_interfaces().
+ * @get_interface: Returns an interface by name. See g_dbus_object_get_interface().
+ * @interface_added: Signal handler for the #GDBusObject::interface-added signal.
+ * @interface_removed: Signal handler for the #GDBusObject::interface-removed signal.
+ *
+ * Base object type for D-Bus objects.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectIface
+{
+ GTypeInterface parent_iface;
+
+ /* Virtual Functions */
+ const gchar *(*get_object_path) (GDBusObject *object);
+ GList *(*get_interfaces) (GDBusObject *object);
+ GDBusInterface *(*get_interface) (GDBusObject *object,
+ const gchar *interface_name);
+
+ /* Signals */
+ void (*interface_added) (GDBusObject *object,
+ GDBusInterface *interface_);
+ void (*interface_removed) (GDBusObject *object,
+ GDBusInterface *interface_);
+
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_object_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_object_get_object_path (GDBusObject *object);
+GLIB_AVAILABLE_IN_ALL
+GList *g_dbus_object_get_interfaces (GDBusObject *object);
+GLIB_AVAILABLE_IN_ALL
+GDBusInterface *g_dbus_object_get_interface (GDBusObject *object,
+ const gchar *interface_name);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_OBJECT_H__ */
diff --git a/include/glib/gio/gdbusobjectmanager.h b/include/glib/gio/gdbusobjectmanager.h
new file mode 100644
index 0000000000..260ae2ee67
--- /dev/null
+++ b/include/glib/gio/gdbusobjectmanager.h
@@ -0,0 +1,94 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_OBJECT_MANAGER_H__
+#define __G_DBUS_OBJECT_MANAGER_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_OBJECT_MANAGER (g_dbus_object_manager_get_type())
+#define G_DBUS_OBJECT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_MANAGER, GDBusObjectManager))
+#define G_IS_DBUS_OBJECT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_MANAGER))
+#define G_DBUS_OBJECT_MANAGER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), G_TYPE_DBUS_OBJECT_MANAGER, GDBusObjectManagerIface))
+
+typedef struct _GDBusObjectManagerIface GDBusObjectManagerIface;
+
+/**
+ * GDBusObjectManagerIface:
+ * @parent_iface: The parent interface.
+ * @get_object_path: Virtual function for g_dbus_object_manager_get_object_path().
+ * @get_objects: Virtual function for g_dbus_object_manager_get_objects().
+ * @get_object: Virtual function for g_dbus_object_manager_get_object().
+ * @get_interface: Virtual function for g_dbus_object_manager_get_interface().
+ * @object_added: Signal handler for the #GDBusObjectManager::object-added signal.
+ * @object_removed: Signal handler for the #GDBusObjectManager::object-removed signal.
+ * @interface_added: Signal handler for the #GDBusObjectManager::interface-added signal.
+ * @interface_removed: Signal handler for the #GDBusObjectManager::interface-removed signal.
+ *
+ * Base type for D-Bus object managers.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectManagerIface
+{
+ GTypeInterface parent_iface;
+
+ /* Virtual Functions */
+ const gchar *(*get_object_path) (GDBusObjectManager *manager);
+ GList *(*get_objects) (GDBusObjectManager *manager);
+ GDBusObject *(*get_object) (GDBusObjectManager *manager,
+ const gchar *object_path);
+ GDBusInterface *(*get_interface) (GDBusObjectManager *manager,
+ const gchar *object_path,
+ const gchar *interface_name);
+
+ /* Signals */
+ void (*object_added) (GDBusObjectManager *manager,
+ GDBusObject *object);
+ void (*object_removed) (GDBusObjectManager *manager,
+ GDBusObject *object);
+
+ void (*interface_added) (GDBusObjectManager *manager,
+ GDBusObject *object,
+ GDBusInterface *interface_);
+ void (*interface_removed) (GDBusObjectManager *manager,
+ GDBusObject *object,
+ GDBusInterface *interface_);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_object_manager_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_object_manager_get_object_path (GDBusObjectManager *manager);
+GLIB_AVAILABLE_IN_ALL
+GList *g_dbus_object_manager_get_objects (GDBusObjectManager *manager);
+GLIB_AVAILABLE_IN_ALL
+GDBusObject *g_dbus_object_manager_get_object (GDBusObjectManager *manager,
+ const gchar *object_path);
+GLIB_AVAILABLE_IN_ALL
+GDBusInterface *g_dbus_object_manager_get_interface (GDBusObjectManager *manager,
+ const gchar *object_path,
+ const gchar *interface_name);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_OBJECT_MANAGER_H__ */
diff --git a/include/glib/gio/gdbusobjectmanagerclient.h b/include/glib/gio/gdbusobjectmanagerclient.h
new file mode 100644
index 0000000000..eafabfbf15
--- /dev/null
+++ b/include/glib/gio/gdbusobjectmanagerclient.h
@@ -0,0 +1,146 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_OBJECT_MANAGER_CLIENT_H__
+#define __G_DBUS_OBJECT_MANAGER_CLIENT_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_OBJECT_MANAGER_CLIENT (g_dbus_object_manager_client_get_type ())
+#define G_DBUS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_MANAGER_CLIENT, GDBusObjectManagerClient))
+#define G_DBUS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_OBJECT_MANAGER_CLIENT, GDBusObjectManagerClientClass))
+#define G_DBUS_OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_OBJECT_MANAGER_CLIENT, GDBusObjectManagerClientClass))
+#define G_IS_DBUS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_MANAGER_CLIENT))
+#define G_IS_DBUS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_OBJECT_MANAGER_CLIENT))
+
+typedef struct _GDBusObjectManagerClientClass GDBusObjectManagerClientClass;
+typedef struct _GDBusObjectManagerClientPrivate GDBusObjectManagerClientPrivate;
+
+/**
+ * GDBusObjectManagerClient:
+ *
+ * The #GDBusObjectManagerClient structure contains private data and should
+ * only be accessed using the provided API.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectManagerClient
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusObjectManagerClientPrivate *priv;
+};
+
+/**
+ * GDBusObjectManagerClientClass:
+ * @parent_class: The parent class.
+ * @interface_proxy_signal: Signal class handler for the #GDBusObjectManagerClient::interface-proxy-signal signal.
+ * @interface_proxy_properties_changed: Signal class handler for the #GDBusObjectManagerClient::interface-proxy-properties-changed signal.
+ *
+ * Class structure for #GDBusObjectManagerClient.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectManagerClientClass
+{
+ GObjectClass parent_class;
+
+ /* signals */
+ void (*interface_proxy_signal) (GDBusObjectManagerClient *manager,
+ GDBusObjectProxy *object_proxy,
+ GDBusProxy *interface_proxy,
+ const gchar *sender_name,
+ const gchar *signal_name,
+ GVariant *parameters);
+
+ void (*interface_proxy_properties_changed) (GDBusObjectManagerClient *manager,
+ GDBusObjectProxy *object_proxy,
+ GDBusProxy *interface_proxy,
+ GVariant *changed_properties,
+ const gchar* const *invalidated_properties);
+
+ /*< private >*/
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_object_manager_client_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_manager_client_new (GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GDBusProxyTypeFunc get_proxy_type_func,
+ gpointer get_proxy_type_user_data,
+ GDestroyNotify get_proxy_type_destroy_notify,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectManager *g_dbus_object_manager_client_new_finish (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectManager *g_dbus_object_manager_client_new_sync (GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GDBusProxyTypeFunc get_proxy_type_func,
+ gpointer get_proxy_type_user_data,
+ GDestroyNotify get_proxy_type_destroy_notify,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_manager_client_new_for_bus (GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GDBusProxyTypeFunc get_proxy_type_func,
+ gpointer get_proxy_type_user_data,
+ GDestroyNotify get_proxy_type_destroy_notify,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectManager *g_dbus_object_manager_client_new_for_bus_finish (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectManager *g_dbus_object_manager_client_new_for_bus_sync (GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GDBusProxyTypeFunc get_proxy_type_func,
+ gpointer get_proxy_type_user_data,
+ GDestroyNotify get_proxy_type_destroy_notify,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_object_manager_client_get_connection (GDBusObjectManagerClient *manager);
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectManagerClientFlags g_dbus_object_manager_client_get_flags (GDBusObjectManagerClient *manager);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_object_manager_client_get_name (GDBusObjectManagerClient *manager);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_dbus_object_manager_client_get_name_owner (GDBusObjectManagerClient *manager);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_OBJECT_MANAGER_CLIENT_H */
diff --git a/include/glib/gio/gdbusobjectmanagerserver.h b/include/glib/gio/gdbusobjectmanagerserver.h
new file mode 100644
index 0000000000..dd725b737a
--- /dev/null
+++ b/include/glib/gio/gdbusobjectmanagerserver.h
@@ -0,0 +1,93 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_OBJECT_MANAGER_SERVER_H__
+#define __G_DBUS_OBJECT_MANAGER_SERVER_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_OBJECT_MANAGER_SERVER (g_dbus_object_manager_server_get_type ())
+#define G_DBUS_OBJECT_MANAGER_SERVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_MANAGER_SERVER, GDBusObjectManagerServer))
+#define G_DBUS_OBJECT_MANAGER_SERVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_OBJECT_MANAGER_SERVER, GDBusObjectManagerServerClass))
+#define G_DBUS_OBJECT_MANAGER_SERVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_OBJECT_MANAGER_SERVER, GDBusObjectManagerServerClass))
+#define G_IS_DBUS_OBJECT_MANAGER_SERVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_MANAGER_SERVER))
+#define G_IS_DBUS_OBJECT_MANAGER_SERVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_OBJECT_MANAGER_SERVER))
+
+typedef struct _GDBusObjectManagerServerClass GDBusObjectManagerServerClass;
+typedef struct _GDBusObjectManagerServerPrivate GDBusObjectManagerServerPrivate;
+
+/**
+ * GDBusObjectManagerServer:
+ *
+ * The #GDBusObjectManagerServer structure contains private data and should
+ * only be accessed using the provided API.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectManagerServer
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusObjectManagerServerPrivate *priv;
+};
+
+/**
+ * GDBusObjectManagerServerClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #GDBusObjectManagerServer.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectManagerServerClass
+{
+ GObjectClass parent_class;
+
+ /*< private >*/
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_object_manager_server_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectManagerServer *g_dbus_object_manager_server_new (const gchar *object_path);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_object_manager_server_get_connection (GDBusObjectManagerServer *manager);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_manager_server_set_connection (GDBusObjectManagerServer *manager,
+ GDBusConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
+ GDBusObjectSkeleton *object);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager,
+ GDBusObjectSkeleton *object);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_object_manager_server_is_exported (GDBusObjectManagerServer *manager,
+ GDBusObjectSkeleton *object);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_object_manager_server_unexport (GDBusObjectManagerServer *manager,
+ const gchar *object_path);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_OBJECT_MANAGER_SERVER_H */
diff --git a/include/glib/gio/gdbusobjectproxy.h b/include/glib/gio/gdbusobjectproxy.h
new file mode 100644
index 0000000000..38c8d51183
--- /dev/null
+++ b/include/glib/gio/gdbusobjectproxy.h
@@ -0,0 +1,79 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_OBJECT_PROXY_H__
+#define __G_DBUS_OBJECT_PROXY_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_OBJECT_PROXY (g_dbus_object_proxy_get_type ())
+#define G_DBUS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_PROXY, GDBusObjectProxy))
+#define G_DBUS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_OBJECT_PROXY, GDBusObjectProxyClass))
+#define G_DBUS_OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_OBJECT_PROXY, GDBusObjectProxyClass))
+#define G_IS_DBUS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_PROXY))
+#define G_IS_DBUS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_OBJECT_PROXY))
+
+typedef struct _GDBusObjectProxyClass GDBusObjectProxyClass;
+typedef struct _GDBusObjectProxyPrivate GDBusObjectProxyPrivate;
+
+/**
+ * GDBusObjectProxy:
+ *
+ * The #GDBusObjectProxy structure contains private data and should
+ * only be accessed using the provided API.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectProxy
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusObjectProxyPrivate *priv;
+};
+
+/**
+ * GDBusObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #GDBusObjectProxy.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectProxyClass
+{
+ GObjectClass parent_class;
+
+ /*< private >*/
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_object_proxy_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectProxy *g_dbus_object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_object_proxy_get_connection (GDBusObjectProxy *proxy);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_OBJECT_PROXY_H */
diff --git a/include/glib/gio/gdbusobjectskeleton.h b/include/glib/gio/gdbusobjectskeleton.h
new file mode 100644
index 0000000000..fe6952f5a4
--- /dev/null
+++ b/include/glib/gio/gdbusobjectskeleton.h
@@ -0,0 +1,96 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_OBJECT_SKELETON_H__
+#define __G_DBUS_OBJECT_SKELETON_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_OBJECT_SKELETON (g_dbus_object_skeleton_get_type ())
+#define G_DBUS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeleton))
+#define G_DBUS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeletonClass))
+#define G_DBUS_OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeletonClass))
+#define G_IS_DBUS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_SKELETON))
+#define G_IS_DBUS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_OBJECT_SKELETON))
+
+typedef struct _GDBusObjectSkeletonClass GDBusObjectSkeletonClass;
+typedef struct _GDBusObjectSkeletonPrivate GDBusObjectSkeletonPrivate;
+
+/**
+ * GDBusObjectSkeleton:
+ *
+ * The #GDBusObjectSkeleton structure contains private data and should only be
+ * accessed using the provided API.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectSkeleton
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusObjectSkeletonPrivate *priv;
+};
+
+/**
+ * GDBusObjectSkeletonClass:
+ * @parent_class: The parent class.
+ * @authorize_method: Signal class handler for the #GDBusObjectSkeleton::authorize-method signal.
+ *
+ * Class structure for #GDBusObjectSkeleton.
+ *
+ * Since: 2.30
+ */
+struct _GDBusObjectSkeletonClass
+{
+ GObjectClass parent_class;
+
+ /* Signals */
+ gboolean (*authorize_method) (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_,
+ GDBusMethodInvocation *invocation);
+
+ /*< private >*/
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_object_skeleton_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusObjectSkeleton *g_dbus_object_skeleton_new (const gchar *object_path);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_skeleton_flush (GDBusObjectSkeleton *object);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_skeleton_add_interface (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_skeleton_remove_interface (GDBusObjectSkeleton *object,
+ GDBusInterfaceSkeleton *interface_);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_skeleton_remove_interface_by_name (GDBusObjectSkeleton *object,
+ const gchar *interface_name);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_object_skeleton_set_object_path (GDBusObjectSkeleton *object,
+ const gchar *object_path);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_OBJECT_SKELETON_H */
diff --git a/include/glib/gio/gdbusproxy.h b/include/glib/gio/gdbusproxy.h
new file mode 100644
index 0000000000..6be9871ec1
--- /dev/null
+++ b/include/glib/gio/gdbusproxy.h
@@ -0,0 +1,214 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_PROXY_H__
+#define __G_DBUS_PROXY_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+#include <gio/gdbusintrospection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_PROXY (g_dbus_proxy_get_type ())
+#define G_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_PROXY, GDBusProxy))
+#define G_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DBUS_PROXY, GDBusProxyClass))
+#define G_DBUS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DBUS_PROXY, GDBusProxyClass))
+#define G_IS_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_PROXY))
+#define G_IS_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DBUS_PROXY))
+
+typedef struct _GDBusProxyClass GDBusProxyClass;
+typedef struct _GDBusProxyPrivate GDBusProxyPrivate;
+
+/**
+ * GDBusProxy:
+ *
+ * The #GDBusProxy structure contains only private data and
+ * should only be accessed using the provided API.
+ *
+ * Since: 2.26
+ */
+struct _GDBusProxy
+{
+ /*< private >*/
+ GObject parent_instance;
+ GDBusProxyPrivate *priv;
+};
+
+/**
+ * GDBusProxyClass:
+ * @g_properties_changed: Signal class handler for the #GDBusProxy::g-properties-changed signal.
+ * @g_signal: Signal class handler for the #GDBusProxy::g-signal signal.
+ *
+ * Class structure for #GDBusProxy.
+ *
+ * Since: 2.26
+ */
+struct _GDBusProxyClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+
+ /*< public >*/
+ /* Signals */
+ void (*g_properties_changed) (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ const gchar* const *invalidated_properties);
+ void (*g_signal) (GDBusProxy *proxy,
+ const gchar *sender_name,
+ const gchar *signal_name,
+ GVariant *parameters);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ gpointer padding[32];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_proxy_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_proxy_new (GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ GDBusInterfaceInfo *info,
+ const gchar *name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusProxy *g_dbus_proxy_new_finish (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusProxy *g_dbus_proxy_new_sync (GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ GDBusInterfaceInfo *info,
+ const gchar *name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_proxy_new_for_bus (GBusType bus_type,
+ GDBusProxyFlags flags,
+ GDBusInterfaceInfo *info,
+ const gchar *name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GDBusProxy *g_dbus_proxy_new_for_bus_finish (GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusProxy *g_dbus_proxy_new_for_bus_sync (GBusType bus_type,
+ GDBusProxyFlags flags,
+ GDBusInterfaceInfo *info,
+ const gchar *name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GDBusConnection *g_dbus_proxy_get_connection (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+GDBusProxyFlags g_dbus_proxy_get_flags (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_proxy_get_name (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_dbus_proxy_get_name_owner (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_proxy_get_object_path (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_proxy_get_interface_name (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+gint g_dbus_proxy_get_default_timeout (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_proxy_set_default_timeout (GDBusProxy *proxy,
+ gint timeout_msec);
+GLIB_AVAILABLE_IN_ALL
+GDBusInterfaceInfo *g_dbus_proxy_get_interface_info (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_proxy_set_interface_info (GDBusProxy *proxy,
+ GDBusInterfaceInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_proxy_get_cached_property (GDBusProxy *proxy,
+ const gchar *property_name);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_proxy_set_cached_property (GDBusProxy *proxy,
+ const gchar *property_name,
+ GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_proxy_call (GDBusProxy *proxy,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_proxy_call_finish (GDBusProxy *proxy,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_proxy_call_sync (GDBusProxy *proxy,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_proxy_call_with_unix_fd_list (GDBusProxy *proxy,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GUnixFDList *fd_list,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_proxy_call_with_unix_fd_list_finish (GDBusProxy *proxy,
+ GUnixFDList **out_fd_list,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_proxy_call_with_unix_fd_list_sync (GDBusProxy *proxy,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusCallFlags flags,
+ gint timeout_msec,
+ GUnixFDList *fd_list,
+ GUnixFDList **out_fd_list,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_PROXY_H__ */
diff --git a/include/glib/gio/gdbusserver.h b/include/glib/gio/gdbusserver.h
new file mode 100644
index 0000000000..123eac4da7
--- /dev/null
+++ b/include/glib/gio/gdbusserver.h
@@ -0,0 +1,60 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_SERVER_H__
+#define __G_DBUS_SERVER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DBUS_SERVER (g_dbus_server_get_type ())
+#define G_DBUS_SERVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_SERVER, GDBusServer))
+#define G_IS_DBUS_SERVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_SERVER))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_dbus_server_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GDBusServer *g_dbus_server_new_sync (const gchar *address,
+ GDBusServerFlags flags,
+ const gchar *guid,
+ GDBusAuthObserver *observer,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_server_get_client_address (GDBusServer *server);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dbus_server_get_guid (GDBusServer *server);
+GLIB_AVAILABLE_IN_ALL
+GDBusServerFlags g_dbus_server_get_flags (GDBusServer *server);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_server_start (GDBusServer *server);
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_server_stop (GDBusServer *server);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_server_is_active (GDBusServer *server);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_SERVER_H__ */
diff --git a/include/glib/gio/gdbusutils.h b/include/glib/gio/gdbusutils.h
new file mode 100644
index 0000000000..5aecb51421
--- /dev/null
+++ b/include/glib/gio/gdbusutils.h
@@ -0,0 +1,55 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DBUS_UTILS_H__
+#define __G_DBUS_UTILS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_is_guid (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_dbus_generate_guid (void);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_is_name (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_is_unique_name (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_is_member_name (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_dbus_is_interface_name (const gchar *string);
+
+GLIB_AVAILABLE_IN_ALL
+void g_dbus_gvariant_to_gvalue (GVariant *value,
+ GValue *out_gvalue);
+GLIB_AVAILABLE_IN_ALL
+GVariant *g_dbus_gvalue_to_gvariant (const GValue *gvalue,
+ const GVariantType *type);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_UTILS_H__ */
diff --git a/include/glib/gio/gdrive.h b/include/glib/gio/gdrive.h
new file mode 100644
index 0000000000..ec92071c76
--- /dev/null
+++ b/include/glib/gio/gdrive.h
@@ -0,0 +1,272 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ * David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_DRIVE_H__
+#define __G_DRIVE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE:
+ *
+ * The string used to obtain a Unix device path with g_drive_get_identifier().
+ *
+ * Since: 2.58
+ */
+#define G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE "unix-device"
+
+#define G_TYPE_DRIVE (g_drive_get_type ())
+#define G_DRIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DRIVE, GDrive))
+#define G_IS_DRIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DRIVE))
+#define G_DRIVE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_DRIVE, GDriveIface))
+
+/**
+ * GDriveIface:
+ * @g_iface: The parent interface.
+ * @changed: Signal emitted when the drive is changed.
+ * @disconnected: The removed signal that is emitted when the #GDrive have been disconnected. If the recipient is holding references to the object they should release them so the object can be finalized.
+ * @eject_button: Signal emitted when the physical eject button (if any) of a drive have been pressed.
+ * @get_name: Returns the name for the given #GDrive.
+ * @get_icon: Returns a #GIcon for the given #GDrive.
+ * @has_volumes: Returns %TRUE if the #GDrive has mountable volumes.
+ * @get_volumes: Returns a list #GList of #GVolume for the #GDrive.
+ * @is_removable: Returns %TRUE if the #GDrive and/or its media is considered removable by the user. Since 2.50.
+ * @is_media_removable: Returns %TRUE if the #GDrive supports removal and insertion of media.
+ * @has_media: Returns %TRUE if the #GDrive has media inserted.
+ * @is_media_check_automatic: Returns %TRUE if the #GDrive is capabable of automatically detecting media changes.
+ * @can_poll_for_media: Returns %TRUE if the #GDrive is capable of manually polling for media change.
+ * @can_eject: Returns %TRUE if the #GDrive can eject media.
+ * @eject: Ejects a #GDrive.
+ * @eject_finish: Finishes an eject operation.
+ * @poll_for_media: Poll for media insertion/removal on a #GDrive.
+ * @poll_for_media_finish: Finishes a media poll operation.
+ * @get_identifier: Returns the identifier of the given kind, or %NULL if
+ * the #GDrive doesn't have one.
+ * @enumerate_identifiers: Returns an array strings listing the kinds
+ * of identifiers which the #GDrive has.
+ * @get_start_stop_type: Gets a #GDriveStartStopType with details about starting/stopping the drive. Since 2.22.
+ * @can_stop: Returns %TRUE if a #GDrive can be stopped. Since 2.22.
+ * @stop: Stops a #GDrive. Since 2.22.
+ * @stop_finish: Finishes a stop operation. Since 2.22.
+ * @can_start: Returns %TRUE if a #GDrive can be started. Since 2.22.
+ * @can_start_degraded: Returns %TRUE if a #GDrive can be started degraded. Since 2.22.
+ * @start: Starts a #GDrive. Since 2.22.
+ * @start_finish: Finishes a start operation. Since 2.22.
+ * @stop_button: Signal emitted when the physical stop button (if any) of a drive have been pressed. Since 2.22.
+ * @eject_with_operation: Starts ejecting a #GDrive using a #GMountOperation. Since 2.22.
+ * @eject_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
+ * @get_sort_key: Gets a key used for sorting #GDrive instances or %NULL if no such key exists. Since 2.32.
+ * @get_symbolic_icon: Returns a symbolic #GIcon for the given #GDrive. Since 2.34.
+ *
+ * Interface for creating #GDrive implementations.
+ */
+typedef struct _GDriveIface GDriveIface;
+
+struct _GDriveIface
+{
+ GTypeInterface g_iface;
+
+ /* signals */
+ void (* changed) (GDrive *drive);
+ void (* disconnected) (GDrive *drive);
+ void (* eject_button) (GDrive *drive);
+
+ /* Virtual Table */
+ char * (* get_name) (GDrive *drive);
+ GIcon * (* get_icon) (GDrive *drive);
+ gboolean (* has_volumes) (GDrive *drive);
+ GList * (* get_volumes) (GDrive *drive);
+ gboolean (* is_media_removable) (GDrive *drive);
+ gboolean (* has_media) (GDrive *drive);
+ gboolean (* is_media_check_automatic) (GDrive *drive);
+ gboolean (* can_eject) (GDrive *drive);
+ gboolean (* can_poll_for_media) (GDrive *drive);
+ void (* eject) (GDrive *drive,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_finish) (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+ void (* poll_for_media) (GDrive *drive,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* poll_for_media_finish) (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+
+ char * (* get_identifier) (GDrive *drive,
+ const char *kind);
+ char ** (* enumerate_identifiers) (GDrive *drive);
+
+ GDriveStartStopType (* get_start_stop_type) (GDrive *drive);
+
+ gboolean (* can_start) (GDrive *drive);
+ gboolean (* can_start_degraded) (GDrive *drive);
+ void (* start) (GDrive *drive,
+ GDriveStartFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* start_finish) (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (* can_stop) (GDrive *drive);
+ void (* stop) (GDrive *drive,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* stop_finish) (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+ /* signal, not VFunc */
+ void (* stop_button) (GDrive *drive);
+
+ void (* eject_with_operation) (GDrive *drive,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_with_operation_finish) (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+
+ const gchar * (* get_sort_key) (GDrive *drive);
+ GIcon * (* get_symbolic_icon) (GDrive *drive);
+ gboolean (* is_removable) (GDrive *drive);
+
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_drive_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+char * g_drive_get_name (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_drive_get_icon (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_drive_get_symbolic_icon (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_has_volumes (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+GList * g_drive_get_volumes (GDrive *drive);
+GLIB_AVAILABLE_IN_2_50
+gboolean g_drive_is_removable (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_is_media_removable (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_has_media (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_is_media_check_automatic (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_can_poll_for_media (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_can_eject (GDrive *drive);
+GLIB_DEPRECATED_FOR(g_drive_eject_with_operation)
+void g_drive_eject (GDrive *drive,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_DEPRECATED_FOR(g_drive_eject_with_operation_finish)
+gboolean g_drive_eject_finish (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_drive_poll_for_media (GDrive *drive,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_poll_for_media_finish (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+char * g_drive_get_identifier (GDrive *drive,
+ const char *kind);
+GLIB_AVAILABLE_IN_ALL
+char ** g_drive_enumerate_identifiers (GDrive *drive);
+
+GLIB_AVAILABLE_IN_ALL
+GDriveStartStopType g_drive_get_start_stop_type (GDrive *drive);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_can_start (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_can_start_degraded (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+void g_drive_start (GDrive *drive,
+ GDriveStartFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_start_finish (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_can_stop (GDrive *drive);
+GLIB_AVAILABLE_IN_ALL
+void g_drive_stop (GDrive *drive,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_stop_finish (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_drive_eject_with_operation (GDrive *drive,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_drive_eject_with_operation_finish (GDrive *drive,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_32
+const gchar *g_drive_get_sort_key (GDrive *drive);
+
+G_END_DECLS
+
+#endif /* __G_DRIVE_H__ */
diff --git a/include/glib/gio/gdtlsclientconnection.h b/include/glib/gio/gdtlsclientconnection.h
new file mode 100644
index 0000000000..daf8e54ffe
--- /dev/null
+++ b/include/glib/gio/gdtlsclientconnection.h
@@ -0,0 +1,75 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2010 Red Hat, Inc.
+ * Copyright © 2015 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_DTLS_CLIENT_CONNECTION_H__
+#define __G_DTLS_CLIENT_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gdtlsconnection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DTLS_CLIENT_CONNECTION (g_dtls_client_connection_get_type ())
+#define G_DTLS_CLIENT_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_DTLS_CLIENT_CONNECTION, GDtlsClientConnection))
+#define G_IS_DTLS_CLIENT_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_DTLS_CLIENT_CONNECTION))
+#define G_DTLS_CLIENT_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_DTLS_CLIENT_CONNECTION, GDtlsClientConnectionInterface))
+
+typedef struct _GDtlsClientConnectionInterface GDtlsClientConnectionInterface;
+
+/**
+ * GDtlsClientConnectionInterface:
+ * @g_iface: The parent interface.
+ *
+ * vtable for a #GDtlsClientConnection implementation.
+ *
+ * Since: 2.48
+ */
+struct _GDtlsClientConnectionInterface
+{
+ GTypeInterface g_iface;
+};
+
+GLIB_AVAILABLE_IN_2_48
+GType g_dtls_client_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_48
+GDatagramBased *g_dtls_client_connection_new (GDatagramBased *base_socket,
+ GSocketConnectable *server_identity,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+GTlsCertificateFlags g_dtls_client_connection_get_validation_flags (GDtlsClientConnection *conn);
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_client_connection_set_validation_flags (GDtlsClientConnection *conn,
+ GTlsCertificateFlags flags);
+GLIB_AVAILABLE_IN_2_48
+GSocketConnectable *g_dtls_client_connection_get_server_identity (GDtlsClientConnection *conn);
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_client_connection_set_server_identity (GDtlsClientConnection *conn,
+ GSocketConnectable *identity);
+GLIB_AVAILABLE_IN_2_48
+GList * g_dtls_client_connection_get_accepted_cas (GDtlsClientConnection *conn);
+
+
+G_END_DECLS
+
+#endif /* __G_DTLS_CLIENT_CONNECTION_H__ */
diff --git a/include/glib/gio/gdtlsconnection.h b/include/glib/gio/gdtlsconnection.h
new file mode 100644
index 0000000000..3901cdc9ec
--- /dev/null
+++ b/include/glib/gio/gdtlsconnection.h
@@ -0,0 +1,206 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2010 Red Hat, Inc.
+ * Copyright © 2015 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_DTLS_CONNECTION_H__
+#define __G_DTLS_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gdatagrambased.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DTLS_CONNECTION (g_dtls_connection_get_type ())
+#define G_DTLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_DTLS_CONNECTION, GDtlsConnection))
+#define G_IS_DTLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_DTLS_CONNECTION))
+#define G_DTLS_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_DTLS_CONNECTION, GDtlsConnectionInterface))
+
+typedef struct _GDtlsConnectionInterface GDtlsConnectionInterface;
+
+/**
+ * GDtlsConnectionInterface:
+ * @g_iface: The parent interface.
+ * @accept_certificate: Check whether to accept a certificate.
+ * @handshake: Perform a handshake operation.
+ * @handshake_async: Start an asynchronous handshake operation.
+ * @handshake_finish: Finish an asynchronous handshake operation.
+ * @shutdown: Shut down one or both directions of the connection.
+ * @shutdown_async: Start an asynchronous shutdown operation.
+ * @shutdown_finish: Finish an asynchronous shutdown operation.
+ * @set_advertised_protocols: Set APLN protocol list
+ * @get_negotiated_protocol: Retrieve ALPN-negotiated protocol
+ *
+ * Virtual method table for a #GDtlsConnection implementation.
+ *
+ * Since: 2.48
+ */
+struct _GDtlsConnectionInterface
+{
+ GTypeInterface g_iface;
+
+ /* signals */
+ gboolean (*accept_certificate) (GDtlsConnection *connection,
+ GTlsCertificate *peer_cert,
+ GTlsCertificateFlags errors);
+
+ /* methods */
+ gboolean (*handshake) (GDtlsConnection *conn,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (*handshake_async) (GDtlsConnection *conn,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*handshake_finish) (GDtlsConnection *conn,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (*shutdown) (GDtlsConnection *conn,
+ gboolean shutdown_read,
+ gboolean shutdown_write,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (*shutdown_async) (GDtlsConnection *conn,
+ gboolean shutdown_read,
+ gboolean shutdown_write,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*shutdown_finish) (GDtlsConnection *conn,
+ GAsyncResult *result,
+ GError **error);
+
+ void (*set_advertised_protocols) (GDtlsConnection *conn,
+ const gchar * const *protocols);
+ const gchar *(*get_negotiated_protocol) (GDtlsConnection *conn);
+};
+
+GLIB_AVAILABLE_IN_2_48
+GType g_dtls_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_connection_set_database (GDtlsConnection *conn,
+ GTlsDatabase *database);
+GLIB_AVAILABLE_IN_2_48
+GTlsDatabase *g_dtls_connection_get_database (GDtlsConnection *conn);
+
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_connection_set_certificate (GDtlsConnection *conn,
+ GTlsCertificate *certificate);
+GLIB_AVAILABLE_IN_2_48
+GTlsCertificate *g_dtls_connection_get_certificate (GDtlsConnection *conn);
+
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_connection_set_interaction (GDtlsConnection *conn,
+ GTlsInteraction *interaction);
+GLIB_AVAILABLE_IN_2_48
+GTlsInteraction *g_dtls_connection_get_interaction (GDtlsConnection *conn);
+
+GLIB_AVAILABLE_IN_2_48
+GTlsCertificate *g_dtls_connection_get_peer_certificate (GDtlsConnection *conn);
+GLIB_AVAILABLE_IN_2_48
+GTlsCertificateFlags g_dtls_connection_get_peer_certificate_errors (GDtlsConnection *conn);
+
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_connection_set_require_close_notify (GDtlsConnection *conn,
+ gboolean require_close_notify);
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_get_require_close_notify (GDtlsConnection *conn);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_60
+void g_dtls_connection_set_rehandshake_mode (GDtlsConnection *conn,
+ GTlsRehandshakeMode mode);
+GLIB_DEPRECATED_IN_2_60
+GTlsRehandshakeMode g_dtls_connection_get_rehandshake_mode (GDtlsConnection *conn);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_handshake (GDtlsConnection *conn,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_connection_handshake_async (GDtlsConnection *conn,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_handshake_finish (GDtlsConnection *conn,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_shutdown (GDtlsConnection *conn,
+ gboolean shutdown_read,
+ gboolean shutdown_write,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_connection_shutdown_async (GDtlsConnection *conn,
+ gboolean shutdown_read,
+ gboolean shutdown_write,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_shutdown_finish (GDtlsConnection *conn,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_close (GDtlsConnection *conn,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+void g_dtls_connection_close_async (GDtlsConnection *conn,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_close_finish (GDtlsConnection *conn,
+ GAsyncResult *result,
+ GError **error);
+
+/*< protected >*/
+GLIB_AVAILABLE_IN_2_48
+gboolean g_dtls_connection_emit_accept_certificate (GDtlsConnection *conn,
+ GTlsCertificate *peer_cert,
+ GTlsCertificateFlags errors);
+GLIB_AVAILABLE_IN_2_60
+void g_dtls_connection_set_advertised_protocols (GDtlsConnection *conn,
+ const gchar * const *protocols);
+
+GLIB_AVAILABLE_IN_2_60
+const gchar * g_dtls_connection_get_negotiated_protocol (GDtlsConnection *conn);
+
+G_END_DECLS
+
+#endif /* __G_DTLS_CONNECTION_H__ */
diff --git a/include/glib/gio/gdtlsserverconnection.h b/include/glib/gio/gdtlsserverconnection.h
new file mode 100644
index 0000000000..24ecb76c44
--- /dev/null
+++ b/include/glib/gio/gdtlsserverconnection.h
@@ -0,0 +1,69 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2010 Red Hat, Inc.
+ * Copyright © 2015 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_DTLS_SERVER_CONNECTION_H__
+#define __G_DTLS_SERVER_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gdtlsconnection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_DTLS_SERVER_CONNECTION (g_dtls_server_connection_get_type ())
+#define G_DTLS_SERVER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_DTLS_SERVER_CONNECTION, GDtlsServerConnection))
+#define G_IS_DTLS_SERVER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_DTLS_SERVER_CONNECTION))
+#define G_DTLS_SERVER_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_DTLS_SERVER_CONNECTION, GDtlsServerConnectionInterface))
+
+/**
+ * GDtlsServerConnection:
+ *
+ * DTLS server-side connection. This is the server-side implementation
+ * of a #GDtlsConnection.
+ *
+ * Since: 2.48
+ */
+typedef struct _GDtlsServerConnectionInterface GDtlsServerConnectionInterface;
+
+/**
+ * GDtlsServerConnectionInterface:
+ * @g_iface: The parent interface.
+ *
+ * vtable for a #GDtlsServerConnection implementation.
+ *
+ * Since: 2.48
+ */
+struct _GDtlsServerConnectionInterface
+{
+ GTypeInterface g_iface;
+};
+
+GLIB_AVAILABLE_IN_2_48
+GType g_dtls_server_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_48
+GDatagramBased *g_dtls_server_connection_new (GDatagramBased *base_socket,
+ GTlsCertificate *certificate,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_DTLS_SERVER_CONNECTION_H__ */
diff --git a/include/glib/gio/gemblem.h b/include/glib/gio/gemblem.h
new file mode 100644
index 0000000000..094f9cb87f
--- /dev/null
+++ b/include/glib/gio/gemblem.h
@@ -0,0 +1,61 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Clemens N. Buss <cebuzz@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __G_EMBLEM_H__
+#define __G_EMBLEM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gioenums.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_EMBLEM (g_emblem_get_type ())
+#define G_EMBLEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_EMBLEM, GEmblem))
+#define G_EMBLEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_EMBLEM, GEmblemClass))
+#define G_IS_EMBLEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_EMBLEM))
+#define G_IS_EMBLEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_EMBLEM))
+#define G_EMBLEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_EMBLEM, GEmblemClass))
+
+/**
+ * GEmblem:
+ *
+ * An object for Emblems
+ */
+typedef struct _GEmblem GEmblem;
+typedef struct _GEmblemClass GEmblemClass;
+
+GLIB_AVAILABLE_IN_ALL
+GType g_emblem_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GEmblem *g_emblem_new (GIcon *icon);
+GLIB_AVAILABLE_IN_ALL
+GEmblem *g_emblem_new_with_origin (GIcon *icon,
+ GEmblemOrigin origin);
+GLIB_AVAILABLE_IN_ALL
+GIcon *g_emblem_get_icon (GEmblem *emblem);
+GLIB_AVAILABLE_IN_ALL
+GEmblemOrigin g_emblem_get_origin (GEmblem *emblem);
+
+G_END_DECLS
+
+#endif /* __G_EMBLEM_H__ */
diff --git a/include/glib/gio/gemblemedicon.h b/include/glib/gio/gemblemedicon.h
new file mode 100644
index 0000000000..3374e0a68e
--- /dev/null
+++ b/include/glib/gio/gemblemedicon.h
@@ -0,0 +1,81 @@
+/* Gio - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Matthias Clasen <mclasen@redhat.com>
+ * Clemens N. Buss <cebuzz@gmail.com>
+ */
+
+#ifndef __G_EMBLEMED_ICON_H__
+#define __G_EMBLEMED_ICON_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gicon.h>
+#include <gio/gemblem.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_EMBLEMED_ICON (g_emblemed_icon_get_type ())
+#define G_EMBLEMED_ICON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_EMBLEMED_ICON, GEmblemedIcon))
+#define G_EMBLEMED_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_EMBLEMED_ICON, GEmblemedIconClass))
+#define G_IS_EMBLEMED_ICON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_EMBLEMED_ICON))
+#define G_IS_EMBLEMED_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_EMBLEMED_ICON))
+#define G_EMBLEMED_ICON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_EMBLEMED_ICON, GEmblemedIconClass))
+
+/**
+ * GEmblemedIcon:
+ *
+ * An implementation of #GIcon for icons with emblems.
+ **/
+typedef struct _GEmblemedIcon GEmblemedIcon;
+typedef struct _GEmblemedIconClass GEmblemedIconClass;
+typedef struct _GEmblemedIconPrivate GEmblemedIconPrivate;
+
+struct _GEmblemedIcon
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GEmblemedIconPrivate *priv;
+};
+
+struct _GEmblemedIconClass
+{
+ GObjectClass parent_class;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_emblemed_icon_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GIcon *g_emblemed_icon_new (GIcon *icon,
+ GEmblem *emblem);
+GLIB_AVAILABLE_IN_ALL
+GIcon *g_emblemed_icon_get_icon (GEmblemedIcon *emblemed);
+GLIB_AVAILABLE_IN_ALL
+GList *g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed);
+GLIB_AVAILABLE_IN_ALL
+void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed,
+ GEmblem *emblem);
+GLIB_AVAILABLE_IN_ALL
+void g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed);
+
+G_END_DECLS
+
+#endif /* __G_EMBLEMED_ICON_H__ */
diff --git a/include/glib/gio/gfile.h b/include/glib/gio/gfile.h
new file mode 100644
index 0000000000..8441d0bd1e
--- /dev/null
+++ b/include/glib/gio/gfile.h
@@ -0,0 +1,1285 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_H__
+#define __G_FILE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE (g_file_get_type ())
+#define G_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
+#define G_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
+#define G_FILE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
+
+#if 0
+/**
+ * GFile:
+ *
+ * A handle to an object implementing the #GFileIface interface.
+ * Generally stores a location within the file system. Handles do not
+ * necessarily represent files or directories that currently exist.
+ **/
+typedef struct _GFile GFile; /* Dummy typedef */
+#endif
+typedef struct _GFileIface GFileIface;
+
+
+/**
+ * GFileIface:
+ * @g_iface: The parent interface.
+ * @dup: Duplicates a #GFile.
+ * @hash: Creates a hash of a #GFile.
+ * @equal: Checks equality of two given #GFiles.
+ * @is_native: Checks to see if a file is native to the system.
+ * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
+ * @get_uri_scheme: Gets the URI scheme for a #GFile.
+ * @get_basename: Gets the basename for a given #GFile.
+ * @get_path: Gets the current path within a #GFile.
+ * @get_uri: Gets a URI for the path within a #GFile.
+ * @get_parse_name: Gets the parsed name for the #GFile.
+ * @get_parent: Gets the parent directory for the #GFile.
+ * @prefix_matches: Checks whether a #GFile contains a specified file.
+ * @get_relative_path: Gets the path for a #GFile relative to a given path.
+ * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
+ * @get_child_for_display_name: Gets the child #GFile for a given display name.
+ * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
+ * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
+ * @enumerate_children_finish: Finishes asynchronously enumerating the children.
+ * @query_info: Gets the #GFileInfo for a #GFile.
+ * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
+ * @query_info_finish: Finishes an asynchronous query info operation.
+ * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
+ * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
+ * @query_filesystem_info_finish: Finishes asynchronously getting the file system info.
+ * @find_enclosing_mount: Gets a #GMount for the #GFile.
+ * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile.
+ * @find_enclosing_mount_finish: Finishes asynchronously getting the volume.
+ * @set_display_name: Sets the display name for a #GFile.
+ * @set_display_name_async: Asynchronously sets a #GFile's display name.
+ * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
+ * @query_settable_attributes: Returns a list of #GFileAttributeInfos that can be set.
+ * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttributeInfos that can be set.
+ * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
+ * @query_writable_namespaces: Returns a list of #GFileAttributeInfo namespaces that are writable.
+ * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttributeInfo namespaces that are writable.
+ * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
+ * @set_attribute: Sets a #GFileAttributeInfo.
+ * @set_attributes_from_info: Sets a #GFileAttributeInfo with information from a #GFileInfo.
+ * @set_attributes_async: Asynchronously sets a file's attributes.
+ * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
+ * @read_fn: Reads a file asynchronously.
+ * @read_async: Asynchronously reads a file.
+ * @read_finish: Finishes asynchronously reading a file.
+ * @append_to: Writes to the end of a file.
+ * @append_to_async: Asynchronously writes to the end of a file.
+ * @append_to_finish: Finishes an asynchronous file append operation.
+ * @create: Creates a new file.
+ * @create_async: Asynchronously creates a file.
+ * @create_finish: Finishes asynchronously creating a file.
+ * @replace: Replaces the contents of a file.
+ * @replace_async: Asynchronously replaces the contents of a file.
+ * @replace_finish: Finishes asynchronously replacing a file.
+ * @delete_file: Deletes a file.
+ * @delete_file_async: Asynchronously deletes a file.
+ * @delete_file_finish: Finishes an asynchronous delete.
+ * @trash: Sends a #GFile to the Trash location.
+ * @trash_async: Asynchronously sends a #GFile to the Trash location.
+ * @trash_finish: Finishes an asynchronous file trashing operation.
+ * @make_directory: Makes a directory.
+ * @make_directory_async: Asynchronously makes a directory.
+ * @make_directory_finish: Finishes making a directory asynchronously.
+ * @make_symbolic_link: Makes a symbolic link.
+ * @_make_symbolic_link_async: Asynchronously makes a symbolic link
+ * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
+ * @copy: Copies a file.
+ * @copy_async: Asynchronously copies a file.
+ * @copy_finish: Finishes an asynchronous copy operation.
+ * @move: Moves a file.
+ * @_move_async: Asynchronously moves a file.
+ * @_move_finish: Finishes an asynchronous move operation.
+ * @mount_mountable: Mounts a mountable object.
+ * @mount_mountable_finish: Finishes a mounting operation.
+ * @unmount_mountable: Unmounts a mountable object.
+ * @unmount_mountable_finish: Finishes an unmount operation.
+ * @eject_mountable: Ejects a mountable.
+ * @eject_mountable_finish: Finishes an eject operation.
+ * @mount_enclosing_volume: Mounts a specified location.
+ * @mount_enclosing_volume_finish: Finishes mounting a specified location.
+ * @monitor_dir: Creates a #GFileMonitor for the location.
+ * @monitor_file: Creates a #GFileMonitor for the location.
+ * @open_readwrite: Open file read/write. Since 2.22.
+ * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
+ * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
+ * @create_readwrite: Creates file read/write. Since 2.22.
+ * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
+ * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
+ * @replace_readwrite: Replaces file read/write. Since 2.22.
+ * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
+ * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
+ * @start_mountable: Starts a mountable object. Since 2.22.
+ * @start_mountable_finish: Finishes a start operation. Since 2.22.
+ * @stop_mountable: Stops a mountable. Since 2.22.
+ * @stop_mountable_finish: Finishes a stop operation. Since 2.22.
+ * @supports_thread_contexts: a boolean that indicates whether the #GFile implementation supports thread-default contexts. Since 2.22.
+ * @unmount_mountable_with_operation: Unmounts a mountable object using a #GMountOperation. Since 2.22.
+ * @unmount_mountable_with_operation_finish: Finishes an unmount operation using a #GMountOperation. Since 2.22.
+ * @eject_mountable_with_operation: Ejects a mountable object using a #GMountOperation. Since 2.22.
+ * @eject_mountable_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
+ * @poll_mountable: Polls a mountable object for media changes. Since 2.22.
+ * @poll_mountable_finish: Finishes a poll operation for media changes. Since 2.22.
+ * @measure_disk_usage: Recursively measures the disk usage of @file. Since 2.38
+ * @measure_disk_usage_async: Asynchronously recursively measures the disk usage of @file. Since 2.38
+ * @measure_disk_usage_finish: Finishes an asynchronous recursive measurement of the disk usage of @file. Since 2.38
+ *
+ * An interface for writing VFS file handles.
+ **/
+struct _GFileIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ GFile * (* dup) (GFile *file);
+ guint (* hash) (GFile *file);
+ gboolean (* equal) (GFile *file1,
+ GFile *file2);
+ gboolean (* is_native) (GFile *file);
+ gboolean (* has_uri_scheme) (GFile *file,
+ const char *uri_scheme);
+ char * (* get_uri_scheme) (GFile *file);
+ char * (* get_basename) (GFile *file);
+ char * (* get_path) (GFile *file);
+ char * (* get_uri) (GFile *file);
+ char * (* get_parse_name) (GFile *file);
+ GFile * (* get_parent) (GFile *file);
+ gboolean (* prefix_matches) (GFile *prefix,
+ GFile *file);
+ char * (* get_relative_path) (GFile *parent,
+ GFile *descendant);
+ GFile * (* resolve_relative_path) (GFile *file,
+ const char *relative_path);
+ GFile * (* get_child_for_display_name) (GFile *file,
+ const char *display_name,
+ GError **error);
+
+ GFileEnumerator * (* enumerate_children) (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* enumerate_children_async) (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileEnumerator * (* enumerate_children_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GFileInfo * (* query_info) (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* query_info_async) (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileInfo * (* query_info_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GFileInfo * (* query_filesystem_info) (GFile *file,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+ void (* query_filesystem_info_async) (GFile *file,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileInfo * (* query_filesystem_info_finish)(GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GMount * (* find_enclosing_mount) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* find_enclosing_mount_async) (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GMount * (* find_enclosing_mount_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GFile * (* set_display_name) (GFile *file,
+ const char *display_name,
+ GCancellable *cancellable,
+ GError **error);
+ void (* set_display_name_async) (GFile *file,
+ const char *display_name,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFile * (* set_display_name_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GFileAttributeInfoList * (* query_settable_attributes) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* _query_settable_attributes_async) (void);
+ void (* _query_settable_attributes_finish) (void);
+
+ GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* _query_writable_namespaces_async) (void);
+ void (* _query_writable_namespaces_finish) (void);
+
+ gboolean (* set_attribute) (GFile *file,
+ const char *attribute,
+ GFileAttributeType type,
+ gpointer value_p,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ gboolean (* set_attributes_from_info) (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* set_attributes_async) (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* set_attributes_finish) (GFile *file,
+ GAsyncResult *result,
+ GFileInfo **info,
+ GError **error);
+
+ GFileInputStream * (* read_fn) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* read_async) (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileInputStream * (* read_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GFileOutputStream * (* append_to) (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* append_to_async) (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileOutputStream * (* append_to_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GFileOutputStream * (* create) (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* create_async) (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileOutputStream * (* create_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ GFileOutputStream * (* replace) (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* replace_async) (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileOutputStream * (* replace_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ gboolean (* delete_file) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* delete_file_async) (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* delete_file_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (* trash) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* trash_async) (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* trash_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (* make_directory) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* make_directory_async) (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* make_directory_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (* make_symbolic_link) (GFile *file,
+ const char *symlink_value,
+ GCancellable *cancellable,
+ GError **error);
+ void (* _make_symbolic_link_async) (void);
+ void (* _make_symbolic_link_finish) (void);
+
+ gboolean (* copy) (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GError **error);
+ void (* copy_async) (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* copy_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ gboolean (* move) (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GError **error);
+ void (* _move_async) (void);
+ void (* _move_finish) (void);
+
+ void (* mount_mountable) (GFile *file,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFile * (* mount_mountable_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* unmount_mountable) (GFile *file,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* unmount_mountable_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* eject_mountable) (GFile *file,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_mountable_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* mount_enclosing_volume) (GFile *location,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* mount_enclosing_volume_finish) (GFile *location,
+ GAsyncResult *result,
+ GError **error);
+
+ GFileMonitor * (* monitor_dir) (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ GFileMonitor * (* monitor_file) (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+ GFileIOStream * (* open_readwrite) (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+ void (* open_readwrite_async) (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileIOStream * (* open_readwrite_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+ GFileIOStream * (* create_readwrite) (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* create_readwrite_async) (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileIOStream * (* create_readwrite_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+ GFileIOStream * (* replace_readwrite) (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* replace_readwrite_async) (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileIOStream * (* replace_readwrite_finish) (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+
+ void (* start_mountable) (GFile *file,
+ GDriveStartFlags flags,
+ GMountOperation *start_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* start_mountable_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* stop_mountable) (GFile *file,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* stop_mountable_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean supports_thread_contexts;
+
+ void (* unmount_mountable_with_operation) (GFile *file,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* unmount_mountable_with_operation_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* eject_mountable_with_operation) (GFile *file,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_mountable_with_operation_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* poll_mountable) (GFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* poll_mountable_finish) (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (* measure_disk_usage) (GFile *file,
+ GFileMeasureFlags flags,
+ GCancellable *cancellable,
+ GFileMeasureProgressCallback progress_callback,
+ gpointer progress_data,
+ guint64 *disk_usage,
+ guint64 *num_dirs,
+ guint64 *num_files,
+ GError **error);
+ void (* measure_disk_usage_async) (GFile *file,
+ GFileMeasureFlags flags,
+ gint io_priority,
+ GCancellable *cancellable,
+ GFileMeasureProgressCallback progress_callback,
+ gpointer progress_data,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* measure_disk_usage_finish) (GFile *file,
+ GAsyncResult *result,
+ guint64 *disk_usage,
+ guint64 *num_dirs,
+ guint64 *num_files,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_new_for_path (const char *path);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_new_for_uri (const char *uri);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_new_for_commandline_arg (const char *arg);
+GLIB_AVAILABLE_IN_2_36
+GFile * g_file_new_for_commandline_arg_and_cwd (const gchar *arg,
+ const gchar *cwd);
+GLIB_AVAILABLE_IN_2_32
+GFile * g_file_new_tmp (const char *tmpl,
+ GFileIOStream **iostream,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_parse_name (const char *parse_name);
+GLIB_AVAILABLE_IN_2_56
+GFile * g_file_new_build_filename (const gchar *first_element,
+ ...) G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_dup (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+guint g_file_hash (gconstpointer file);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_equal (GFile *file1,
+ GFile *file2);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_get_basename (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_get_path (GFile *file);
+GLIB_AVAILABLE_IN_2_56
+const char * g_file_peek_path (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_get_uri (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_get_parse_name (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_get_parent (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_has_parent (GFile *file,
+ GFile *parent);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_get_child (GFile *file,
+ const char *name);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_get_child_for_display_name (GFile *file,
+ const char *display_name,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_has_prefix (GFile *file,
+ GFile *prefix);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_get_relative_path (GFile *parent,
+ GFile *descendant);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_resolve_relative_path (GFile *file,
+ const char *relative_path);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_is_native (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_has_uri_scheme (GFile *file,
+ const char *uri_scheme);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_get_uri_scheme (GFile *file);
+GLIB_AVAILABLE_IN_ALL
+GFileInputStream * g_file_read (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_read_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileInputStream * g_file_read_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileOutputStream * g_file_append_to (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileOutputStream * g_file_create (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileOutputStream * g_file_replace (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_append_to_async (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileOutputStream * g_file_append_to_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_create_async (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileOutputStream * g_file_create_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_replace_async (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileOutputStream * g_file_replace_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileIOStream * g_file_open_readwrite (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_open_readwrite_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileIOStream * g_file_open_readwrite_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileIOStream * g_file_create_readwrite (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_create_readwrite_async (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileIOStream * g_file_create_readwrite_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileIOStream * g_file_replace_readwrite (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_replace_readwrite_async (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_query_exists (GFile *file,
+ GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+GFileType g_file_query_file_type (GFile *file,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo * g_file_query_info (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_query_info_async (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo * g_file_query_info_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo * g_file_query_filesystem_info (GFile *file,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_query_filesystem_info_async (GFile *file,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo * g_file_query_filesystem_info_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GMount * g_file_find_enclosing_mount (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_find_enclosing_mount_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GMount * g_file_find_enclosing_mount_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileEnumerator * g_file_enumerate_children (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_enumerate_children_async (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileEnumerator * g_file_enumerate_children_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_set_display_name (GFile *file,
+ const char *display_name,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_set_display_name_async (GFile *file,
+ const char *display_name,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_set_display_name_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_delete (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_34
+void g_file_delete_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_34
+gboolean g_file_delete_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_trash (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_38
+void g_file_trash_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_38
+gboolean g_file_trash_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_copy (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_copy_async (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_copy_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_move (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_make_directory (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_38
+void g_file_make_directory_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_38
+gboolean g_file_make_directory_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_make_directory_with_parents (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_make_symbolic_link (GFile *file,
+ const char *symlink_value,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeInfoList *g_file_query_settable_attributes (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeInfoList *g_file_query_writable_namespaces (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attribute (GFile *file,
+ const char *attribute,
+ GFileAttributeType type,
+ gpointer value_p,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attributes_from_info (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_set_attributes_async (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attributes_finish (GFile *file,
+ GAsyncResult *result,
+ GFileInfo **info,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attribute_string (GFile *file,
+ const char *attribute,
+ const char *value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attribute_byte_string (GFile *file,
+ const char *attribute,
+ const char *value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attribute_uint32 (GFile *file,
+ const char *attribute,
+ guint32 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attribute_int32 (GFile *file,
+ const char *attribute,
+ gint32 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attribute_uint64 (GFile *file,
+ const char *attribute,
+ guint64 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_attribute_int64 (GFile *file,
+ const char *attribute,
+ gint64 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_mount_enclosing_volume (GFile *location,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_mount_enclosing_volume_finish (GFile *location,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_mount_mountable (GFile *file,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_mount_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
+void g_file_unmount_mountable (GFile *file,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
+gboolean g_file_unmount_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_unmount_mountable_with_operation (GFile *file,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_unmount_mountable_with_operation_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
+void g_file_eject_mountable (GFile *file,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
+gboolean g_file_eject_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_eject_mountable_with_operation (GFile *file,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_eject_mountable_with_operation_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_copy_attributes (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+
+GLIB_AVAILABLE_IN_ALL
+GFileMonitor* g_file_monitor_directory (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileMonitor* g_file_monitor_file (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GFileMonitor* g_file_monitor (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_38
+gboolean g_file_measure_disk_usage (GFile *file,
+ GFileMeasureFlags flags,
+ GCancellable *cancellable,
+ GFileMeasureProgressCallback progress_callback,
+ gpointer progress_data,
+ guint64 *disk_usage,
+ guint64 *num_dirs,
+ guint64 *num_files,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_38
+void g_file_measure_disk_usage_async (GFile *file,
+ GFileMeasureFlags flags,
+ gint io_priority,
+ GCancellable *cancellable,
+ GFileMeasureProgressCallback progress_callback,
+ gpointer progress_data,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_38
+gboolean g_file_measure_disk_usage_finish (GFile *file,
+ GAsyncResult *result,
+ guint64 *disk_usage,
+ guint64 *num_dirs,
+ guint64 *num_files,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_file_start_mountable (GFile *file,
+ GDriveStartFlags flags,
+ GMountOperation *start_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_start_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_stop_mountable (GFile *file,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_stop_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_file_poll_mountable (GFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_poll_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+/* Utilities */
+
+GLIB_AVAILABLE_IN_ALL
+GAppInfo *g_file_query_default_handler (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_60
+void g_file_query_default_handler_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_60
+GAppInfo *g_file_query_default_handler_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_load_contents (GFile *file,
+ GCancellable *cancellable,
+ char **contents,
+ gsize *length,
+ char **etag_out,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_load_contents_async (GFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_load_contents_finish (GFile *file,
+ GAsyncResult *res,
+ char **contents,
+ gsize *length,
+ char **etag_out,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_load_partial_contents_async (GFile *file,
+ GCancellable *cancellable,
+ GFileReadMoreCallback read_more_callback,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_load_partial_contents_finish (GFile *file,
+ GAsyncResult *res,
+ char **contents,
+ gsize *length,
+ char **etag_out,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_replace_contents (GFile *file,
+ const char *contents,
+ gsize length,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ char **new_etag,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_replace_contents_async (GFile *file,
+ const char *contents,
+ gsize length,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_40
+void g_file_replace_contents_bytes_async (GFile *file,
+ GBytes *contents,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_replace_contents_finish (GFile *file,
+ GAsyncResult *res,
+ char **new_etag,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_supports_thread_contexts (GFile *file);
+
+GLIB_AVAILABLE_IN_2_56
+GBytes *g_file_load_bytes (GFile *file,
+ GCancellable *cancellable,
+ gchar **etag_out,
+ GError **error);
+GLIB_AVAILABLE_IN_2_56
+void g_file_load_bytes_async (GFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_56
+GBytes *g_file_load_bytes_finish (GFile *file,
+ GAsyncResult *result,
+ gchar **etag_out,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_FILE_H__ */
diff --git a/include/glib/gio/gfileattribute.h b/include/glib/gio/gfileattribute.h
new file mode 100644
index 0000000000..a551047015
--- /dev/null
+++ b/include/glib/gio/gfileattribute.h
@@ -0,0 +1,84 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_ATTRIBUTE_H__
+#define __G_FILE_ATTRIBUTE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GFileAttributeInfo:
+ * @name: the name of the attribute.
+ * @type: the #GFileAttributeType type of the attribute.
+ * @flags: a set of #GFileAttributeInfoFlags.
+ *
+ * Information about a specific attribute.
+ **/
+struct _GFileAttributeInfo
+{
+ char *name;
+ GFileAttributeType type;
+ GFileAttributeInfoFlags flags;
+};
+
+/**
+ * GFileAttributeInfoList:
+ * @infos: an array of #GFileAttributeInfos.
+ * @n_infos: the number of values in the array.
+ *
+ * Acts as a lightweight registry for possible valid file attributes.
+ * The registry stores Key-Value pair formats as #GFileAttributeInfos.
+ **/
+struct _GFileAttributeInfoList
+{
+ GFileAttributeInfo *infos;
+ int n_infos;
+};
+
+#define G_TYPE_FILE_ATTRIBUTE_INFO_LIST (g_file_attribute_info_list_get_type ())
+GLIB_AVAILABLE_IN_ALL
+GType g_file_attribute_info_list_get_type (void);
+
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeInfoList * g_file_attribute_info_list_new (void);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeInfoList * g_file_attribute_info_list_ref (GFileAttributeInfoList *list);
+GLIB_AVAILABLE_IN_ALL
+void g_file_attribute_info_list_unref (GFileAttributeInfoList *list);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeInfoList * g_file_attribute_info_list_dup (GFileAttributeInfoList *list);
+GLIB_AVAILABLE_IN_ALL
+const GFileAttributeInfo *g_file_attribute_info_list_lookup (GFileAttributeInfoList *list,
+ const char *name);
+GLIB_AVAILABLE_IN_ALL
+void g_file_attribute_info_list_add (GFileAttributeInfoList *list,
+ const char *name,
+ GFileAttributeType type,
+ GFileAttributeInfoFlags flags);
+
+G_END_DECLS
+
+#endif /* __G_FILE_INFO_H__ */
diff --git a/include/glib/gio/gfileenumerator.h b/include/glib/gio/gfileenumerator.h
new file mode 100644
index 0000000000..d4fd396b64
--- /dev/null
+++ b/include/glib/gio/gfileenumerator.h
@@ -0,0 +1,152 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_ENUMERATOR_H__
+#define __G_FILE_ENUMERATOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE_ENUMERATOR (g_file_enumerator_get_type ())
+#define G_FILE_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_ENUMERATOR, GFileEnumerator))
+#define G_FILE_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_ENUMERATOR, GFileEnumeratorClass))
+#define G_IS_FILE_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_ENUMERATOR))
+#define G_IS_FILE_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_ENUMERATOR))
+#define G_FILE_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_ENUMERATOR, GFileEnumeratorClass))
+
+/**
+ * GFileEnumerator:
+ *
+ * A per matched file iterator.
+ **/
+typedef struct _GFileEnumeratorClass GFileEnumeratorClass;
+typedef struct _GFileEnumeratorPrivate GFileEnumeratorPrivate;
+
+struct _GFileEnumerator
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GFileEnumeratorPrivate *priv;
+};
+
+struct _GFileEnumeratorClass
+{
+ GObjectClass parent_class;
+
+ /* Virtual Table */
+
+ GFileInfo * (* next_file) (GFileEnumerator *enumerator,
+ GCancellable *cancellable,
+ GError **error);
+ gboolean (* close_fn) (GFileEnumerator *enumerator,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (* next_files_async) (GFileEnumerator *enumerator,
+ int num_files,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GList * (* next_files_finish) (GFileEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error);
+ void (* close_async) (GFileEnumerator *enumerator,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* close_finish) (GFileEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+ void (*_g_reserved7) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_enumerator_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_file_enumerator_next_file (GFileEnumerator *enumerator,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_enumerator_close (GFileEnumerator *enumerator,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
+ int num_files,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GList * g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_enumerator_close_async (GFileEnumerator *enumerator,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator);
+GLIB_AVAILABLE_IN_ALL
+void g_file_enumerator_set_pending (GFileEnumerator *enumerator,
+ gboolean pending);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_enumerator_get_container (GFileEnumerator *enumerator);
+GLIB_AVAILABLE_IN_2_36
+GFile * g_file_enumerator_get_child (GFileEnumerator *enumerator,
+ GFileInfo *info);
+
+GLIB_AVAILABLE_IN_2_44
+gboolean g_file_enumerator_iterate (GFileEnumerator *direnum,
+ GFileInfo **out_info,
+ GFile **out_child,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __G_FILE_ENUMERATOR_H__ */
diff --git a/include/glib/gio/gfileicon.h b/include/glib/gio/gfileicon.h
new file mode 100644
index 0000000000..08a4ea6cf6
--- /dev/null
+++ b/include/glib/gio/gfileicon.h
@@ -0,0 +1,57 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_ICON_H__
+#define __G_FILE_ICON_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE_ICON (g_file_icon_get_type ())
+#define G_FILE_ICON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_ICON, GFileIcon))
+#define G_FILE_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_ICON, GFileIconClass))
+#define G_IS_FILE_ICON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_ICON))
+#define G_IS_FILE_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_ICON))
+#define G_FILE_ICON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_ICON, GFileIconClass))
+
+/**
+ * GFileIcon:
+ *
+ * Gets an icon for a #GFile. Implements #GLoadableIcon.
+ **/
+typedef struct _GFileIconClass GFileIconClass;
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_icon_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_file_icon_new (GFile *file);
+
+GLIB_AVAILABLE_IN_ALL
+GFile * g_file_icon_get_file (GFileIcon *icon);
+
+G_END_DECLS
+
+#endif /* __G_FILE_ICON_H__ */
diff --git a/include/glib/gio/gfileinfo.h b/include/glib/gio/gfileinfo.h
new file mode 100644
index 0000000000..1629a2edb1
--- /dev/null
+++ b/include/glib/gio/gfileinfo.h
@@ -0,0 +1,1144 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_INFO_H__
+#define __G_FILE_INFO_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE_INFO (g_file_info_get_type ())
+#define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
+#define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
+#define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
+#define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
+#define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
+
+/**
+ * GFileInfo:
+ *
+ * Stores information about a file system object referenced by a #GFile.
+ **/
+typedef struct _GFileInfoClass GFileInfoClass;
+
+
+/* Common Attributes: */
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_TYPE:
+ *
+ * A key in the "standard" namespace for storing file types.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ * The value for this key should contain a #GFileType.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_TYPE "standard::type" /* uint32 (GFileType) */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
+ *
+ * A key in the "standard" namespace for checking if a file is hidden.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
+ *
+ * A key in the "standard" namespace for checking if a file is a backup file.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
+ *
+ * A key in the "standard" namespace for checking if the file is a symlink.
+ * Typically the actual type is something else, if we followed the symlink
+ * to get the type.
+ * On Windows NTFS mountpoints are considered to be symlinks as well.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK "standard::is-symlink" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
+ *
+ * A key in the "standard" namespace for checking if a file is virtual.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE:
+ *
+ * A key in the "standard" namespace for checking if a file is
+ * volatile. This is meant for opaque, non-POSIX-like backends to
+ * indicate that the URI is not persistent. Applications should look
+ * at #G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET for the persistent URI.
+ *
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.46
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE "standard::is-volatile" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_NAME:
+ *
+ * A key in the "standard" namespace for getting the name of the file.
+ * The name is the on-disk filename which may not be in any known encoding,
+ * and can thus not be generally displayed as is.
+ * Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
+ * name in a user interface.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_NAME "standard::name" /* byte string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
+ *
+ * A key in the "standard" namespace for getting the display name of the file.
+ * A display name is guaranteed to be in UTF8 and can thus be displayed in
+ * the UI.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
+ *
+ * A key in the "standard" namespace for edit name of the file.
+ * An edit name is similar to the display name, but it is meant to be
+ * used when you want to rename the file in the UI. The display name
+ * might contain information you don't want in the new filename (such as
+ * "(invalid unicode)" if the filename was in an invalid encoding).
+ *
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME "standard::edit-name" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
+ *
+ * A key in the "standard" namespace for getting the copy name of the file.
+ * The copy name is an optional version of the name. If available it's always
+ * in UTF8, and corresponds directly to the original filename (only transcoded to
+ * UTF8). This is useful if you want to copy the file to another filesystem that
+ * might have a different encoding. If the filename is not a valid string in the
+ * encoding selected for the filesystem it is in then the copy name will not be set.
+ *
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_COPY_NAME "standard::copy-name" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION:
+ *
+ * A key in the "standard" namespace for getting the description of the file.
+ * The description is a utf8 string that describes the file, generally containing
+ * the filename, but can also contain furter information. Example descriptions
+ * could be "filename (on hostname)" for a remote file or "filename (in trash)"
+ * for a file in the trash. This is useful for instance as the window title
+ * when displaying a directory or for a bookmarks menu.
+ *
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_ICON:
+ *
+ * A key in the "standard" namespace for getting the icon for the file.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
+ * The value for this key should contain a #GIcon.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon" /* object (GIcon) */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON:
+ *
+ * A key in the "standard" namespace for getting the symbolic icon for the file.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
+ * The value for this key should contain a #GIcon.
+ *
+ * Since: 2.34
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON "standard::symbolic-icon" /* object (GIcon) */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
+ *
+ * A key in the "standard" namespace for getting the content type of the file.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ * The value for this key should contain a valid content type.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
+ *
+ * A key in the "standard" namespace for getting the fast content type.
+ * The fast content type isn't as reliable as the regular one, as it
+ * only uses the filename to guess it, but it is faster to calculate than the
+ * regular content type.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ *
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_SIZE:
+ *
+ * A key in the "standard" namespace for getting the file's size (in bytes).
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE:
+ *
+ * A key in the "standard" namespace for getting the amount of disk space
+ * that is consumed by the file (in bytes). This will generally be larger
+ * than the file size (due to block size overhead) but can occasionally be
+ * smaller (for example, for sparse files).
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
+ *
+ * Since: 2.20
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE "standard::allocated-size" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
+ *
+ * A key in the "standard" namespace for getting the symlink target, if the file
+ * is a symlink. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
+ *
+ * A key in the "standard" namespace for getting the target URI for the file, in
+ * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
+ *
+ * A key in the "standard" namespace for setting the sort order of a file.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
+ * An example use would be in file managers, which would use this key
+ * to set the order files are displayed. Files with smaller sort order
+ * should be sorted first, and files without sort order as if sort order
+ * was zero.
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order" /* int32 */
+
+/* Entity tags, used to avoid missing updates on save */
+
+/**
+ * G_FILE_ATTRIBUTE_ETAG_VALUE:
+ *
+ * A key in the "etag" namespace for getting the value of the file's
+ * entity tag. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
+
+/* File identifier, for e.g. avoiding loops when doing recursive
+ * directory scanning
+ */
+
+/**
+ * G_FILE_ATTRIBUTE_ID_FILE:
+ *
+ * A key in the "id" namespace for getting a file identifier.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ * An example use would be during listing files, to avoid recursive
+ * directory scanning.
+ **/
+#define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
+ *
+ * A key in the "id" namespace for getting the file system identifier.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ * An example use would be during drag and drop to see if the source
+ * and target are on the same filesystem (default to move) or not (default
+ * to copy).
+ **/
+#define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
+
+/* Calculated Access Rights for current user */
+
+/**
+ * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
+ *
+ * A key in the "access" namespace for getting read privileges.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ * This attribute will be %TRUE if the user is able to read the file.
+ **/
+#define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
+ *
+ * A key in the "access" namespace for getting write privileges.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ * This attribute will be %TRUE if the user is able to write to the file.
+ **/
+#define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
+ *
+ * A key in the "access" namespace for getting execution privileges.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ * This attribute will be %TRUE if the user is able to execute the file.
+ **/
+#define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
+ *
+ * A key in the "access" namespace for checking deletion privileges.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ * This attribute will be %TRUE if the user is able to delete the file.
+ **/
+#define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
+ *
+ * A key in the "access" namespace for checking trashing privileges.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ * This attribute will be %TRUE if the user is able to move the file to
+ * the trash.
+ **/
+#define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
+ *
+ * A key in the "access" namespace for checking renaming privileges.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ * This attribute will be %TRUE if the user is able to rename the file.
+ **/
+#define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
+
+/* TODO: Should we have special version for directories? can_enumerate, etc */
+
+/* Mountable attributes */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
+ *
+ * A key in the "mountable" namespace for getting the unix device.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE:
+ *
+ * A key in the "mountable" namespace for getting the unix device file.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ *
+ * Since: 2.22
+ **/
+#define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE "mountable::unix-device-file" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
+ *
+ * A key in the "mountable" namespace for getting the HAL UDI for the mountable
+ * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.22
+ */
+#define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START "mountable::can-start" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started
+ * degraded.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.22
+ */
+#define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED "mountable::can-start-degraded" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be stopped.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.22
+ */
+#define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP "mountable::can-stop" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE:
+ *
+ * A key in the "mountable" namespace for getting the #GDriveStartStopType.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ *
+ * Since: 2.22
+ */
+#define G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE "mountable::start-stop-type" /* uint32 (GDriveStartStopType) */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be polled.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.22
+ */
+#define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL "mountable::can-poll" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC:
+ *
+ * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)
+ * is automatically polled for media.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.22
+ */
+#define G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC "mountable::is-media-check-automatic" /* boolean */
+
+/* Time attributes */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_MODIFIED:
+ *
+ * A key in the "time" namespace for getting the time the file was last
+ * modified. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the time since the
+ * file was modified, in seconds since the UNIX epoch.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
+ *
+ * A key in the "time" namespace for getting the microseconds of the time
+ * the file was last modified. This should be used in conjunction with
+ * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_ACCESS:
+ *
+ * A key in the "time" namespace for getting the time the file was last
+ * accessed. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the time since the
+ * file was last accessed, in seconds since the UNIX epoch.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
+ *
+ * A key in the "time" namespace for getting the microseconds of the time
+ * the file was last accessed. This should be used in conjunction with
+ * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_CHANGED:
+ *
+ * A key in the "time" namespace for getting the time the file was last
+ * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
+ * and contains the time since the file was last changed, in seconds since the
+ * UNIX epoch.
+ *
+ * This corresponds to the traditional UNIX ctime.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
+ *
+ * A key in the "time" namespace for getting the microseconds of the time
+ * the file was last changed. This should be used in conjunction with
+ * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_CREATED:
+ *
+ * A key in the "time" namespace for getting the time the file was created.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
+ * and contains the time since the file was created, in seconds since the UNIX
+ * epoch.
+ *
+ * This corresponds to the NTFS ctime.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
+ *
+ * A key in the "time" namespace for getting the microseconds of the time
+ * the file was created. This should be used in conjunction with
+ * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
+
+/* Unix specific attributes */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_DEVICE:
+ *
+ * A key in the "unix" namespace for getting the device id of the device the
+ * file is located on (see stat() documentation). This attribute is only
+ * available for UNIX file systems. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_INODE:
+ *
+ * A key in the "unix" namespace for getting the inode of the file.
+ * This attribute is only available for UNIX file systems. Corresponding
+ * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_MODE:
+ *
+ * A key in the "unix" namespace for getting the mode of the file
+ * (e.g. whether the file is a regular file, symlink, etc). See lstat()
+ * documentation. This attribute is only available for UNIX file systems.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_NLINK:
+ *
+ * A key in the "unix" namespace for getting the number of hard links
+ * for a file. See lstat() documentation. This attribute is only available
+ * for UNIX file systems. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_UID:
+ *
+ * A key in the "unix" namespace for getting the user ID for the file.
+ * This attribute is only available for UNIX file systems.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_GID:
+ *
+ * A key in the "unix" namespace for getting the group ID for the file.
+ * This attribute is only available for UNIX file systems.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_RDEV:
+ *
+ * A key in the "unix" namespace for getting the device ID for the file
+ * (if it is a special file). See lstat() documentation. This attribute
+ * is only available for UNIX file systems. Corresponding #GFileAttributeType
+ * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
+ *
+ * A key in the "unix" namespace for getting the block size for the file
+ * system. This attribute is only available for UNIX file systems.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
+ *
+ * A key in the "unix" namespace for getting the number of blocks allocated
+ * for the file. This attribute is only available for UNIX file systems.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
+ *
+ * A key in the "unix" namespace for checking if the file represents a
+ * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
+ * point. Since 2.58, `/` is considered to be a mount point.
+ * This attribute is only available for UNIX file systems.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
+
+/* DOS specific attributes */
+
+/**
+ * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
+ *
+ * A key in the "dos" namespace for checking if the file's archive flag
+ * is set. This attribute is %TRUE if the archive flag is set. This attribute
+ * is only available for DOS file systems. Corresponding #GFileAttributeType
+ * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
+ *
+ * A key in the "dos" namespace for checking if the file's backup flag
+ * is set. This attribute is %TRUE if the backup flag is set. This attribute
+ * is only available for DOS file systems. Corresponding #GFileAttributeType
+ * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_DOS_IS_MOUNTPOINT:
+ *
+ * A key in the "dos" namespace for checking if the file is a NTFS mount point
+ * (a volume mount or a junction point).
+ * This attribute is %TRUE if file is a reparse point of type
+ * [IO_REPARSE_TAG_MOUNT_POINT](https://msdn.microsoft.com/en-us/library/dd541667.aspx).
+ * This attribute is only available for DOS file systems.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.60
+ **/
+#define G_FILE_ATTRIBUTE_DOS_IS_MOUNTPOINT "dos::is-mountpoint" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG:
+ *
+ * A key in the "dos" namespace for getting the file NTFS reparse tag.
+ * This value is 0 for files that are not reparse points.
+ * See the [Reparse Tags](https://msdn.microsoft.com/en-us/library/dd541667.aspx)
+ * page for possible reparse tag values. Corresponding #GFileAttributeType
+ * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ *
+ * Since: 2.60
+ **/
+#define G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG "dos::reparse-point-tag" /* uint32 */
+
+/* Owner attributes */
+
+/**
+ * G_FILE_ATTRIBUTE_OWNER_USER:
+ *
+ * A key in the "owner" namespace for getting the user name of the
+ * file's owner. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
+ *
+ * A key in the "owner" namespace for getting the real name of the
+ * user that owns the file. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_OWNER_GROUP:
+ *
+ * A key in the "owner" namespace for getting the file owner's group.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
+
+/* Thumbnails */
+
+/**
+ * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
+ *
+ * A key in the "thumbnail" namespace for getting the path to the thumbnail
+ * image. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
+/**
+ * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
+ *
+ * A key in the "thumbnail" namespace for checking if thumbnailing failed.
+ * This attribute is %TRUE if thumbnailing failed. Corresponding
+ * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
+/**
+ * G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID:
+ *
+ * A key in the "thumbnail" namespace for checking whether the thumbnail is outdated.
+ * This attribute is %TRUE if the thumbnail is up-to-date with the file it represents,
+ * and %FALSE if the file has been modified since the thumbnail was generated.
+ *
+ * If %G_FILE_ATTRIBUTE_THUMBNAILING_FAILED is %TRUE and this attribute is %FALSE,
+ * it indicates that thumbnailing may be attempted again and may succeed.
+ *
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.40
+ */
+#define G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "thumbnail::is-valid" /* boolean */
+
+/* Preview */
+
+/**
+ * G_FILE_ATTRIBUTE_PREVIEW_ICON:
+ *
+ * A key in the "preview" namespace for getting a #GIcon that can be
+ * used to get preview of the file. For example, it may be a low
+ * resolution thumbnail without metadata. Corresponding
+ * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT. The value
+ * for this key should contain a #GIcon.
+ *
+ * Since: 2.20
+ **/
+#define G_FILE_ATTRIBUTE_PREVIEW_ICON "preview::icon" /* object (GIcon) */
+
+/* File system info (for g_file_get_filesystem_info) */
+
+/**
+ * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
+ *
+ * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
+ * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
+ * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
+ **/
+#define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
+ *
+ * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
+ * file system. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT64.
+ **/
+#define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_FILESYSTEM_USED:
+ *
+ * A key in the "filesystem" namespace for getting the number of bytes of used on the
+ * file system. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_UINT64.
+ *
+ * Since: 2.32
+ */
+#define G_FILE_ATTRIBUTE_FILESYSTEM_USED "filesystem::used" /* uint64 */
+
+/**
+ * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
+ *
+ * A key in the "filesystem" namespace for getting the file system's type.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
+ *
+ * A key in the "filesystem" namespace for checking if the file system
+ * is read only. Is set to %TRUE if the file system is read only.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW:
+ *
+ * A key in the "filesystem" namespace for hinting a file manager
+ * application whether it should preview (e.g. thumbnail) files on the
+ * file system. The value for this key contain a
+ * #GFilesystemPreviewType.
+ **/
+#define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview" /* uint32 (GFilesystemPreviewType) */
+
+/**
+ * G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE:
+ *
+ * A key in the "filesystem" namespace for checking if the file system
+ * is remote. Is set to %TRUE if the file system is remote.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ **/
+#define G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE "filesystem::remote" /* boolean */
+
+/**
+ * G_FILE_ATTRIBUTE_GVFS_BACKEND:
+ *
+ * A key in the "gvfs" namespace that gets the name of the current
+ * GVFS backend in use. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_STRING.
+ **/
+#define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
+ *
+ * A key in the "selinux" namespace for getting the file's SELinux
+ * context. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
+ * available if GLib has been built with SELinux support.
+ **/
+#define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
+ *
+ * A key in the "trash" namespace. When requested against
+ * `trash:///` returns the number of (toplevel) items in the trash folder.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
+ **/
+#define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count" /* uint32 */
+
+/**
+ * G_FILE_ATTRIBUTE_TRASH_ORIG_PATH:
+ *
+ * A key in the "trash" namespace. When requested against
+ * items in `trash:///`, will return the original path to the file before it
+ * was trashed. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
+ *
+ * Since: 2.24
+ **/
+#define G_FILE_ATTRIBUTE_TRASH_ORIG_PATH "trash::orig-path" /* byte string */
+
+/**
+ * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE:
+ *
+ * A key in the "trash" namespace. When requested against
+ * items in `trash:///`, will return the date and time when the file
+ * was trashed. The format of the returned string is YYYY-MM-DDThh:mm:ss.
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
+ *
+ * Since: 2.24
+ **/
+#define G_FILE_ATTRIBUTE_TRASH_DELETION_DATE "trash::deletion-date" /* string */
+
+/**
+ * G_FILE_ATTRIBUTE_RECENT_MODIFIED:
+ *
+ * A key in the "recent" namespace for getting time, when the metadata for the
+ * file in `recent:///` was last changed. Corresponding #GFileAttributeType is
+ * %G_FILE_ATTRIBUTE_TYPE_INT64.
+ *
+ * Since: 2.52
+ **/
+#define G_FILE_ATTRIBUTE_RECENT_MODIFIED "recent::modified" /* int64 (time_t) */
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_info_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFileInfo * g_file_info_new (void);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo * g_file_info_dup (GFileInfo *other);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_copy_into (GFileInfo *src_info,
+ GFileInfo *dest_info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_has_attribute (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_has_namespace (GFileInfo *info,
+ const char *name_space);
+GLIB_AVAILABLE_IN_ALL
+char ** g_file_info_list_attributes (GFileInfo *info,
+ const char *name_space);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_get_attribute_data (GFileInfo *info,
+ const char *attribute,
+ GFileAttributeType *type,
+ gpointer *value_pp,
+ GFileAttributeStatus *status);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_remove_attribute (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_set_attribute_status (GFileInfo *info,
+ const char *attribute,
+ GFileAttributeStatus status);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_info_get_attribute_as_string (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_attribute_string (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+GObject * g_file_info_get_attribute_object (GFileInfo *info,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+char ** g_file_info_get_attribute_stringv (GFileInfo *info,
+ const char *attribute);
+
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute (GFileInfo *info,
+ const char *attribute,
+ GFileAttributeType type,
+ gpointer value_p);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_string (GFileInfo *info,
+ const char *attribute,
+ const char *attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_byte_string (GFileInfo *info,
+ const char *attribute,
+ const char *attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_boolean (GFileInfo *info,
+ const char *attribute,
+ gboolean attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_uint32 (GFileInfo *info,
+ const char *attribute,
+ guint32 attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_int32 (GFileInfo *info,
+ const char *attribute,
+ gint32 attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_uint64 (GFileInfo *info,
+ const char *attribute,
+ guint64 attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_int64 (GFileInfo *info,
+ const char *attribute,
+ gint64 attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_object (GFileInfo *info,
+ const char *attribute,
+ GObject *attr_value);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_stringv (GFileInfo *info,
+ const char *attribute,
+ char **attr_value);
+
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_clear_status (GFileInfo *info);
+
+/* Helper getters: */
+GLIB_AVAILABLE_IN_2_36
+GDateTime * g_file_info_get_deletion_date (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GFileType g_file_info_get_file_type (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_get_is_hidden (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_get_is_backup (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_info_get_is_symlink (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_name (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_display_name (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_edit_name (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_file_info_get_icon (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_file_info_get_symbolic_icon (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_content_type (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+goffset g_file_info_get_size (GFileInfo *info);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62_FOR(g_file_info_get_modification_date_time)
+void g_file_info_get_modification_time (GFileInfo *info,
+ GTimeVal *result);
+G_GNUC_END_IGNORE_DEPRECATIONS
+GLIB_AVAILABLE_IN_2_62
+GDateTime * g_file_info_get_modification_date_time (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_symlink_target (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_info_get_etag (GFileInfo *info);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_file_info_get_sort_order (GFileInfo *info);
+
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_attribute_mask (GFileInfo *info,
+ GFileAttributeMatcher *mask);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_unset_attribute_mask (GFileInfo *info);
+
+/* Helper setters: */
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_file_type (GFileInfo *info,
+ GFileType type);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_is_hidden (GFileInfo *info,
+ gboolean is_hidden);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_is_symlink (GFileInfo *info,
+ gboolean is_symlink);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_name (GFileInfo *info,
+ const char *name);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_display_name (GFileInfo *info,
+ const char *display_name);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_edit_name (GFileInfo *info,
+ const char *edit_name);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_icon (GFileInfo *info,
+ GIcon *icon);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_symbolic_icon (GFileInfo *info,
+ GIcon *icon);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_content_type (GFileInfo *info,
+ const char *content_type);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_size (GFileInfo *info,
+ goffset size);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62_FOR(g_file_info_set_modification_date_time)
+void g_file_info_set_modification_time (GFileInfo *info,
+ GTimeVal *mtime);
+G_GNUC_END_IGNORE_DEPRECATIONS
+GLIB_AVAILABLE_IN_2_62
+void g_file_info_set_modification_date_time (GFileInfo *info,
+ GDateTime *mtime);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_symlink_target (GFileInfo *info,
+ const char *symlink_target);
+GLIB_AVAILABLE_IN_ALL
+void g_file_info_set_sort_order (GFileInfo *info,
+ gint32 sort_order);
+
+#define G_TYPE_FILE_ATTRIBUTE_MATCHER (g_file_attribute_matcher_get_type ())
+GLIB_AVAILABLE_IN_ALL
+GType g_file_attribute_matcher_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
+GLIB_AVAILABLE_IN_ALL
+void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
+GLIB_AVAILABLE_IN_ALL
+GFileAttributeMatcher *g_file_attribute_matcher_subtract (GFileAttributeMatcher *matcher,
+ GFileAttributeMatcher *subtract);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
+ const char *attribute);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
+ const char *ns);
+GLIB_AVAILABLE_IN_ALL
+const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
+GLIB_AVAILABLE_IN_2_32
+char * g_file_attribute_matcher_to_string (GFileAttributeMatcher *matcher);
+
+G_END_DECLS
+
+#endif /* __G_FILE_INFO_H__ */
diff --git a/include/glib/gio/gfileinputstream.h b/include/glib/gio/gfileinputstream.h
new file mode 100644
index 0000000000..f84eecce19
--- /dev/null
+++ b/include/glib/gio/gfileinputstream.h
@@ -0,0 +1,114 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_INPUT_STREAM_H__
+#define __G_FILE_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/ginputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE_INPUT_STREAM (g_file_input_stream_get_type ())
+#define G_FILE_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INPUT_STREAM, GFileInputStream))
+#define G_FILE_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INPUT_STREAM, GFileInputStreamClass))
+#define G_IS_FILE_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INPUT_STREAM))
+#define G_IS_FILE_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INPUT_STREAM))
+#define G_FILE_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INPUT_STREAM, GFileInputStreamClass))
+
+/**
+ * GFileInputStream:
+ *
+ * A subclass of GInputStream for opened files. This adds
+ * a few file-specific operations and seeking.
+ *
+ * #GFileInputStream implements #GSeekable.
+ **/
+typedef struct _GFileInputStreamClass GFileInputStreamClass;
+typedef struct _GFileInputStreamPrivate GFileInputStreamPrivate;
+
+struct _GFileInputStream
+{
+ GInputStream parent_instance;
+
+ /*< private >*/
+ GFileInputStreamPrivate *priv;
+};
+
+struct _GFileInputStreamClass
+{
+ GInputStreamClass parent_class;
+
+ goffset (* tell) (GFileInputStream *stream);
+ gboolean (* can_seek) (GFileInputStream *stream);
+ gboolean (* seek) (GFileInputStream *stream,
+ goffset offset,
+ GSeekType type,
+ GCancellable *cancellable,
+ GError **error);
+ GFileInfo * (* query_info) (GFileInputStream *stream,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+ void (* query_info_async) (GFileInputStream *stream,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileInfo * (* query_info_finish) (GFileInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_input_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_file_input_stream_query_info (GFileInputStream *stream,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_input_stream_query_info_async (GFileInputStream *stream,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_file_input_stream_query_info_finish (GFileInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_FILE_FILE_INPUT_STREAM_H__ */
diff --git a/include/glib/gio/gfileiostream.h b/include/glib/gio/gfileiostream.h
new file mode 100644
index 0000000000..ca61db65de
--- /dev/null
+++ b/include/glib/gio/gfileiostream.h
@@ -0,0 +1,121 @@
+/* GIO - GLib Input, Io and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_IO_STREAM_H__
+#define __G_FILE_IO_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giostream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE_IO_STREAM (g_file_io_stream_get_type ())
+#define G_FILE_IO_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_IO_STREAM, GFileIOStream))
+#define G_FILE_IO_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_IO_STREAM, GFileIOStreamClass))
+#define G_IS_FILE_IO_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_IO_STREAM))
+#define G_IS_FILE_IO_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_IO_STREAM))
+#define G_FILE_IO_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_IO_STREAM, GFileIOStreamClass))
+
+/**
+ * GFileIOStream:
+ *
+ * A subclass of GIOStream for opened files. This adds
+ * a few file-specific operations and seeking and truncating.
+ *
+ * #GFileIOStream implements GSeekable.
+ **/
+typedef struct _GFileIOStreamClass GFileIOStreamClass;
+typedef struct _GFileIOStreamPrivate GFileIOStreamPrivate;
+
+struct _GFileIOStream
+{
+ GIOStream parent_instance;
+
+ /*< private >*/
+ GFileIOStreamPrivate *priv;
+};
+
+struct _GFileIOStreamClass
+{
+ GIOStreamClass parent_class;
+
+ goffset (* tell) (GFileIOStream *stream);
+ gboolean (* can_seek) (GFileIOStream *stream);
+ gboolean (* seek) (GFileIOStream *stream,
+ goffset offset,
+ GSeekType type,
+ GCancellable *cancellable,
+ GError **error);
+ gboolean (* can_truncate) (GFileIOStream *stream);
+ gboolean (* truncate_fn) (GFileIOStream *stream,
+ goffset size,
+ GCancellable *cancellable,
+ GError **error);
+ GFileInfo * (* query_info) (GFileIOStream *stream,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+ void (* query_info_async) (GFileIOStream *stream,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileInfo * (* query_info_finish) (GFileIOStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ char * (* get_etag) (GFileIOStream *stream);
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_io_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_file_io_stream_query_info (GFileIOStream *stream,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_io_stream_query_info_async (GFileIOStream *stream,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_file_io_stream_query_info_finish (GFileIOStream *stream,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_io_stream_get_etag (GFileIOStream *stream);
+
+G_END_DECLS
+
+#endif /* __G_FILE_FILE_IO_STREAM_H__ */
diff --git a/include/glib/gio/gfilemonitor.h b/include/glib/gio/gfilemonitor.h
new file mode 100644
index 0000000000..724d8def83
--- /dev/null
+++ b/include/glib/gio/gfilemonitor.h
@@ -0,0 +1,98 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_MONITOR_H__
+#define __G_FILE_MONITOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE_MONITOR (g_file_monitor_get_type ())
+#define G_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_MONITOR, GFileMonitor))
+#define G_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_MONITOR, GFileMonitorClass))
+#define G_IS_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_MONITOR))
+#define G_IS_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_MONITOR))
+#define G_FILE_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_MONITOR, GFileMonitorClass))
+
+typedef struct _GFileMonitorClass GFileMonitorClass;
+typedef struct _GFileMonitorPrivate GFileMonitorPrivate;
+
+/**
+ * GFileMonitor:
+ *
+ * Watches for changes to a file.
+ **/
+struct _GFileMonitor
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GFileMonitorPrivate *priv;
+};
+
+struct _GFileMonitorClass
+{
+ GObjectClass parent_class;
+
+ /* Signals */
+ void (* changed) (GFileMonitor *monitor,
+ GFile *file,
+ GFile *other_file,
+ GFileMonitorEvent event_type);
+
+ /* Virtual Table */
+ gboolean (* cancel) (GFileMonitor *monitor);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_monitor_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_monitor_cancel (GFileMonitor *monitor);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_monitor_is_cancelled (GFileMonitor *monitor);
+GLIB_AVAILABLE_IN_ALL
+void g_file_monitor_set_rate_limit (GFileMonitor *monitor,
+ gint limit_msecs);
+
+
+/* For implementations */
+GLIB_AVAILABLE_IN_ALL
+void g_file_monitor_emit_event (GFileMonitor *monitor,
+ GFile *child,
+ GFile *other_file,
+ GFileMonitorEvent event_type);
+
+G_END_DECLS
+
+#endif /* __G_FILE_MONITOR_H__ */
diff --git a/include/glib/gio/gfilenamecompleter.h b/include/glib/gio/gfilenamecompleter.h
new file mode 100644
index 0000000000..b10f18de9a
--- /dev/null
+++ b/include/glib/gio/gfilenamecompleter.h
@@ -0,0 +1,79 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILENAME_COMPLETER_H__
+#define __G_FILENAME_COMPLETER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILENAME_COMPLETER (g_filename_completer_get_type ())
+#define G_FILENAME_COMPLETER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILENAME_COMPLETER, GFilenameCompleter))
+#define G_FILENAME_COMPLETER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILENAME_COMPLETER, GFilenameCompleterClass))
+#define G_FILENAME_COMPLETER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILENAME_COMPLETER, GFilenameCompleterClass))
+#define G_IS_FILENAME_COMPLETER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILENAME_COMPLETER))
+#define G_IS_FILENAME_COMPLETER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILENAME_COMPLETER))
+
+/**
+ * GFilenameCompleter:
+ *
+ * Completes filenames based on files that exist within the file system.
+ **/
+typedef struct _GFilenameCompleterClass GFilenameCompleterClass;
+
+struct _GFilenameCompleterClass
+{
+ GObjectClass parent_class;
+
+ /*< public >*/
+ /* signals */
+ void (* got_completion_data) (GFilenameCompleter *filename_completer);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_filename_completer_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFilenameCompleter *g_filename_completer_new (void);
+
+GLIB_AVAILABLE_IN_ALL
+char * g_filename_completer_get_completion_suffix (GFilenameCompleter *completer,
+ const char *initial_text);
+GLIB_AVAILABLE_IN_ALL
+char ** g_filename_completer_get_completions (GFilenameCompleter *completer,
+ const char *initial_text);
+GLIB_AVAILABLE_IN_ALL
+void g_filename_completer_set_dirs_only (GFilenameCompleter *completer,
+ gboolean dirs_only);
+
+G_END_DECLS
+
+#endif /* __G_FILENAME_COMPLETER_H__ */
diff --git a/include/glib/gio/gfileoutputstream.h b/include/glib/gio/gfileoutputstream.h
new file mode 100644
index 0000000000..5df63efba7
--- /dev/null
+++ b/include/glib/gio/gfileoutputstream.h
@@ -0,0 +1,122 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_FILE_OUTPUT_STREAM_H__
+#define __G_FILE_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/goutputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILE_OUTPUT_STREAM (g_file_output_stream_get_type ())
+#define G_FILE_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_OUTPUT_STREAM, GFileOutputStream))
+#define G_FILE_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_OUTPUT_STREAM, GFileOutputStreamClass))
+#define G_IS_FILE_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_OUTPUT_STREAM))
+#define G_IS_FILE_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_OUTPUT_STREAM))
+#define G_FILE_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_OUTPUT_STREAM, GFileOutputStreamClass))
+
+/**
+ * GFileOutputStream:
+ *
+ * A subclass of GOutputStream for opened files. This adds
+ * a few file-specific operations and seeking and truncating.
+ *
+ * #GFileOutputStream implements GSeekable.
+ **/
+typedef struct _GFileOutputStreamClass GFileOutputStreamClass;
+typedef struct _GFileOutputStreamPrivate GFileOutputStreamPrivate;
+
+struct _GFileOutputStream
+{
+ GOutputStream parent_instance;
+
+ /*< private >*/
+ GFileOutputStreamPrivate *priv;
+};
+
+struct _GFileOutputStreamClass
+{
+ GOutputStreamClass parent_class;
+
+ goffset (* tell) (GFileOutputStream *stream);
+ gboolean (* can_seek) (GFileOutputStream *stream);
+ gboolean (* seek) (GFileOutputStream *stream,
+ goffset offset,
+ GSeekType type,
+ GCancellable *cancellable,
+ GError **error);
+ gboolean (* can_truncate) (GFileOutputStream *stream);
+ gboolean (* truncate_fn) (GFileOutputStream *stream,
+ goffset size,
+ GCancellable *cancellable,
+ GError **error);
+ GFileInfo * (* query_info) (GFileOutputStream *stream,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+ void (* query_info_async) (GFileOutputStream *stream,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GFileInfo * (* query_info_finish) (GFileOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ char * (* get_etag) (GFileOutputStream *stream);
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_file_output_stream_get_type (void) G_GNUC_CONST;
+
+
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_file_output_stream_query_info (GFileOutputStream *stream,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_file_output_stream_query_info_async (GFileOutputStream *stream,
+ const char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_file_output_stream_query_info_finish (GFileOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+char * g_file_output_stream_get_etag (GFileOutputStream *stream);
+
+G_END_DECLS
+
+#endif /* __G_FILE_FILE_OUTPUT_STREAM_H__ */
diff --git a/include/glib/gio/gfilterinputstream.h b/include/glib/gio/gfilterinputstream.h
new file mode 100644
index 0000000000..b44a458916
--- /dev/null
+++ b/include/glib/gio/gfilterinputstream.h
@@ -0,0 +1,78 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Christian Kellner <gicmo@gnome.org>
+ */
+
+#ifndef __G_FILTER_INPUT_STREAM_H__
+#define __G_FILTER_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/ginputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILTER_INPUT_STREAM (g_filter_input_stream_get_type ())
+#define G_FILTER_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILTER_INPUT_STREAM, GFilterInputStream))
+#define G_FILTER_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILTER_INPUT_STREAM, GFilterInputStreamClass))
+#define G_IS_FILTER_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILTER_INPUT_STREAM))
+#define G_IS_FILTER_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILTER_INPUT_STREAM))
+#define G_FILTER_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILTER_INPUT_STREAM, GFilterInputStreamClass))
+
+/**
+ * GFilterInputStream:
+ *
+ * A base class for all input streams that work on an underlying stream.
+ **/
+typedef struct _GFilterInputStreamClass GFilterInputStreamClass;
+
+struct _GFilterInputStream
+{
+ GInputStream parent_instance;
+
+ /*<protected >*/
+ GInputStream *base_stream;
+};
+
+struct _GFilterInputStreamClass
+{
+ GInputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_filter_input_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GInputStream * g_filter_input_stream_get_base_stream (GFilterInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_filter_input_stream_get_close_base_stream (GFilterInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+void g_filter_input_stream_set_close_base_stream (GFilterInputStream *stream,
+ gboolean close_base);
+
+G_END_DECLS
+
+#endif /* __G_FILTER_INPUT_STREAM_H__ */
diff --git a/include/glib/gio/gfilteroutputstream.h b/include/glib/gio/gfilteroutputstream.h
new file mode 100644
index 0000000000..105e72be22
--- /dev/null
+++ b/include/glib/gio/gfilteroutputstream.h
@@ -0,0 +1,78 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Christian Kellner <gicmo@gnome.org>
+ */
+
+#ifndef __G_FILTER_OUTPUT_STREAM_H__
+#define __G_FILTER_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/goutputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_FILTER_OUTPUT_STREAM (g_filter_output_stream_get_type ())
+#define G_FILTER_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILTER_OUTPUT_STREAM, GFilterOutputStream))
+#define G_FILTER_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILTER_OUTPUT_STREAM, GFilterOutputStreamClass))
+#define G_IS_FILTER_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILTER_OUTPUT_STREAM))
+#define G_IS_FILTER_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILTER_OUTPUT_STREAM))
+#define G_FILTER_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILTER_OUTPUT_STREAM, GFilterOutputStreamClass))
+
+/**
+ * GFilterOutputStream:
+ *
+ * A base class for all output streams that work on an underlying stream.
+ **/
+typedef struct _GFilterOutputStreamClass GFilterOutputStreamClass;
+
+struct _GFilterOutputStream
+{
+ GOutputStream parent_instance;
+
+ /*< protected >*/
+ GOutputStream *base_stream;
+};
+
+struct _GFilterOutputStreamClass
+{
+ GOutputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_filter_output_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GOutputStream * g_filter_output_stream_get_base_stream (GFilterOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_filter_output_stream_get_close_base_stream (GFilterOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+void g_filter_output_stream_set_close_base_stream (GFilterOutputStream *stream,
+ gboolean close_base);
+
+G_END_DECLS
+
+#endif /* __G_FILTER_OUTPUT_STREAM_H__ */
diff --git a/include/glib/gio/gicon.h b/include/glib/gio/gicon.h
new file mode 100644
index 0000000000..a4a03cbec9
--- /dev/null
+++ b/include/glib/gio/gicon.h
@@ -0,0 +1,102 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_ICON_H__
+#define __G_ICON_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ICON (g_icon_get_type ())
+#define G_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_ICON, GIcon))
+#define G_IS_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ICON))
+#define G_ICON_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ICON, GIconIface))
+
+/**
+ * GIcon:
+ *
+ * An abstract type that specifies an icon.
+ **/
+typedef struct _GIconIface GIconIface;
+
+/**
+ * GIconIface:
+ * @g_iface: The parent interface.
+ * @hash: A hash for a given #GIcon.
+ * @equal: Checks if two #GIcons are equal.
+ * @to_tokens: Serializes a #GIcon into tokens. The tokens must not
+ * contain any whitespace. Don't implement if the #GIcon can't be
+ * serialized (Since 2.20).
+ * @from_tokens: Constructs a #GIcon from tokens. Set the #GError if
+ * the tokens are malformed. Don't implement if the #GIcon can't be
+ * serialized (Since 2.20).
+ * @serialize: Serializes a #GIcon into a #GVariant. Since: 2.38
+ *
+ * GIconIface is used to implement GIcon types for various
+ * different systems. See #GThemedIcon and #GLoadableIcon for
+ * examples of how to implement this interface.
+ */
+struct _GIconIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ guint (* hash) (GIcon *icon);
+ gboolean (* equal) (GIcon *icon1,
+ GIcon *icon2);
+ gboolean (* to_tokens) (GIcon *icon,
+ GPtrArray *tokens,
+ gint *out_version);
+ GIcon * (* from_tokens) (gchar **tokens,
+ gint num_tokens,
+ gint version,
+ GError **error);
+
+ GVariant * (* serialize) (GIcon *icon);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_icon_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+guint g_icon_hash (gconstpointer icon);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_icon_equal (GIcon *icon1,
+ GIcon *icon2);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_icon_to_string (GIcon *icon);
+GLIB_AVAILABLE_IN_ALL
+GIcon *g_icon_new_for_string (const gchar *str,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_38
+GVariant * g_icon_serialize (GIcon *icon);
+GLIB_AVAILABLE_IN_2_38
+GIcon * g_icon_deserialize (GVariant *value);
+
+G_END_DECLS
+
+#endif /* __G_ICON_H__ */
diff --git a/include/glib/gio/ginetaddress.h b/include/glib/gio/ginetaddress.h
new file mode 100644
index 0000000000..2963affa4b
--- /dev/null
+++ b/include/glib/gio/ginetaddress.h
@@ -0,0 +1,124 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Kellner <gicmo@gnome.org>
+ * Samuel Cormier-Iijima <sciyoshi@gmail.com>
+ */
+
+#ifndef __G_INET_ADDRESS_H__
+#define __G_INET_ADDRESS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_INET_ADDRESS (g_inet_address_get_type ())
+#define G_INET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_INET_ADDRESS, GInetAddress))
+#define G_INET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_INET_ADDRESS, GInetAddressClass))
+#define G_IS_INET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_INET_ADDRESS))
+#define G_IS_INET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_INET_ADDRESS))
+#define G_INET_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_INET_ADDRESS, GInetAddressClass))
+
+typedef struct _GInetAddressClass GInetAddressClass;
+typedef struct _GInetAddressPrivate GInetAddressPrivate;
+
+struct _GInetAddress
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GInetAddressPrivate *priv;
+};
+
+struct _GInetAddressClass
+{
+ GObjectClass parent_class;
+
+ gchar * (*to_string) (GInetAddress *address);
+ const guint8 * (*to_bytes) (GInetAddress *address);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_inet_address_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GInetAddress * g_inet_address_new_from_string (const gchar *string);
+
+GLIB_AVAILABLE_IN_ALL
+GInetAddress * g_inet_address_new_from_bytes (const guint8 *bytes,
+ GSocketFamily family);
+
+GLIB_AVAILABLE_IN_ALL
+GInetAddress * g_inet_address_new_loopback (GSocketFamily family);
+
+GLIB_AVAILABLE_IN_ALL
+GInetAddress * g_inet_address_new_any (GSocketFamily family);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_equal (GInetAddress *address,
+ GInetAddress *other_address);
+
+GLIB_AVAILABLE_IN_ALL
+gchar * g_inet_address_to_string (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+const guint8 * g_inet_address_to_bytes (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gsize g_inet_address_get_native_size (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+GSocketFamily g_inet_address_get_family (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_any (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_loopback (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_link_local (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_site_local (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_multicast (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_mc_global (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_mc_link_local (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_mc_node_local (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_mc_org_local (GInetAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_inet_address_get_is_mc_site_local (GInetAddress *address);
+
+G_END_DECLS
+
+#endif /* __G_INET_ADDRESS_H__ */
+
diff --git a/include/glib/gio/ginetaddressmask.h b/include/glib/gio/ginetaddressmask.h
new file mode 100644
index 0000000000..ce5e285c6e
--- /dev/null
+++ b/include/glib/gio/ginetaddressmask.h
@@ -0,0 +1,85 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2011 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_INET_ADDRESS_MASK_H__
+#define __G_INET_ADDRESS_MASK_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_INET_ADDRESS_MASK (g_inet_address_mask_get_type ())
+#define G_INET_ADDRESS_MASK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_INET_ADDRESS_MASK, GInetAddressMask))
+#define G_INET_ADDRESS_MASK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_INET_ADDRESS_MASK, GInetAddressMaskClass))
+#define G_IS_INET_ADDRESS_MASK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_INET_ADDRESS_MASK))
+#define G_IS_INET_ADDRESS_MASK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_INET_ADDRESS_MASK))
+#define G_INET_ADDRESS_MASK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_INET_ADDRESS_MASK, GInetAddressMaskClass))
+
+typedef struct _GInetAddressMaskClass GInetAddressMaskClass;
+typedef struct _GInetAddressMaskPrivate GInetAddressMaskPrivate;
+
+struct _GInetAddressMask
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GInetAddressMaskPrivate *priv;
+};
+
+struct _GInetAddressMaskClass
+{
+ GObjectClass parent_class;
+
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_inet_address_mask_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+GInetAddressMask *g_inet_address_mask_new (GInetAddress *addr,
+ guint length,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_32
+GInetAddressMask *g_inet_address_mask_new_from_string (const gchar *mask_string,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+gchar *g_inet_address_mask_to_string (GInetAddressMask *mask);
+
+GLIB_AVAILABLE_IN_2_32
+GSocketFamily g_inet_address_mask_get_family (GInetAddressMask *mask);
+GLIB_AVAILABLE_IN_2_32
+GInetAddress *g_inet_address_mask_get_address (GInetAddressMask *mask);
+GLIB_AVAILABLE_IN_2_32
+guint g_inet_address_mask_get_length (GInetAddressMask *mask);
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_inet_address_mask_matches (GInetAddressMask *mask,
+ GInetAddress *address);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_inet_address_mask_equal (GInetAddressMask *mask,
+ GInetAddressMask *mask2);
+
+G_END_DECLS
+
+#endif /* __G_INET_ADDRESS_MASK_H__ */
+
diff --git a/include/glib/gio/ginetsocketaddress.h b/include/glib/gio/ginetsocketaddress.h
new file mode 100644
index 0000000000..e05ba09893
--- /dev/null
+++ b/include/glib/gio/ginetsocketaddress.h
@@ -0,0 +1,78 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Kellner <gicmo@gnome.org>
+ * Samuel Cormier-Iijima <sciyoshi@gmail.com>
+ */
+
+#ifndef __G_INET_SOCKET_ADDRESS_H__
+#define __G_INET_SOCKET_ADDRESS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gsocketaddress.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_INET_SOCKET_ADDRESS (g_inet_socket_address_get_type ())
+#define G_INET_SOCKET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_INET_SOCKET_ADDRESS, GInetSocketAddress))
+#define G_INET_SOCKET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_INET_SOCKET_ADDRESS, GInetSocketAddressClass))
+#define G_IS_INET_SOCKET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_INET_SOCKET_ADDRESS))
+#define G_IS_INET_SOCKET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_INET_SOCKET_ADDRESS))
+#define G_INET_SOCKET_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_INET_SOCKET_ADDRESS, GInetSocketAddressClass))
+
+typedef struct _GInetSocketAddressClass GInetSocketAddressClass;
+typedef struct _GInetSocketAddressPrivate GInetSocketAddressPrivate;
+
+struct _GInetSocketAddress
+{
+ GSocketAddress parent_instance;
+
+ /*< private >*/
+ GInetSocketAddressPrivate *priv;
+};
+
+struct _GInetSocketAddressClass
+{
+ GSocketAddressClass parent_class;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_inet_socket_address_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress *g_inet_socket_address_new (GInetAddress *address,
+ guint16 port);
+GLIB_AVAILABLE_IN_2_40
+GSocketAddress *g_inet_socket_address_new_from_string (const char *address,
+ guint port);
+
+GLIB_AVAILABLE_IN_ALL
+GInetAddress * g_inet_socket_address_get_address (GInetSocketAddress *address);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_inet_socket_address_get_port (GInetSocketAddress *address);
+
+GLIB_AVAILABLE_IN_2_32
+guint32 g_inet_socket_address_get_flowinfo (GInetSocketAddress *address);
+GLIB_AVAILABLE_IN_2_32
+guint32 g_inet_socket_address_get_scope_id (GInetSocketAddress *address);
+
+G_END_DECLS
+
+#endif /* __G_INET_SOCKET_ADDRESS_H__ */
diff --git a/include/glib/gio/ginitable.h b/include/glib/gio/ginitable.h
new file mode 100644
index 0000000000..463bfcc5aa
--- /dev/null
+++ b/include/glib/gio/ginitable.h
@@ -0,0 +1,105 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_INITABLE_H__
+#define __G_INITABLE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_INITABLE (g_initable_get_type ())
+#define G_INITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_INITABLE, GInitable))
+#define G_IS_INITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_INITABLE))
+#define G_INITABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_INITABLE, GInitableIface))
+#define G_TYPE_IS_INITABLE(type) (g_type_is_a ((type), G_TYPE_INITABLE))
+
+/**
+ * GInitable:
+ *
+ * Interface for initializable objects.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GInitableIface GInitableIface;
+
+/**
+ * GInitableIface:
+ * @g_iface: The parent interface.
+ * @init: Initializes the object.
+ *
+ * Provides an interface for initializing object such that initialization
+ * may fail.
+ *
+ * Since: 2.22
+ **/
+struct _GInitableIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ gboolean (* init) (GInitable *initable,
+ GCancellable *cancellable,
+ GError **error);
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_initable_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_initable_init (GInitable *initable,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_initable_new (GType object_type,
+ GCancellable *cancellable,
+ GError **error,
+ const gchar *first_property_name,
+ ...);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties and g_initable_init)
+gpointer g_initable_newv (GType object_type,
+ guint n_parameters,
+ GParameter *parameters,
+ GCancellable *cancellable,
+ GError **error);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_ALL
+GObject* g_initable_new_valist (GType object_type,
+ const gchar *first_property_name,
+ va_list var_args,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+
+#endif /* __G_INITABLE_H__ */
diff --git a/include/glib/gio/ginputstream.h b/include/glib/gio/ginputstream.h
new file mode 100644
index 0000000000..53b14e3870
--- /dev/null
+++ b/include/glib/gio/ginputstream.h
@@ -0,0 +1,216 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_INPUT_STREAM_H__
+#define __G_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_INPUT_STREAM (g_input_stream_get_type ())
+#define G_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_INPUT_STREAM, GInputStream))
+#define G_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_INPUT_STREAM, GInputStreamClass))
+#define G_IS_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_INPUT_STREAM))
+#define G_IS_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_INPUT_STREAM))
+#define G_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_INPUT_STREAM, GInputStreamClass))
+
+/**
+ * GInputStream:
+ *
+ * Base class for streaming input operations.
+ **/
+typedef struct _GInputStreamClass GInputStreamClass;
+typedef struct _GInputStreamPrivate GInputStreamPrivate;
+
+struct _GInputStream
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GInputStreamPrivate *priv;
+};
+
+struct _GInputStreamClass
+{
+ GObjectClass parent_class;
+
+ /* Sync ops: */
+
+ gssize (* read_fn) (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+ gssize (* skip) (GInputStream *stream,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+ gboolean (* close_fn) (GInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+
+ /* Async ops: (optional in derived classes) */
+ void (* read_async) (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gssize (* read_finish) (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ void (* skip_async) (GInputStream *stream,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gssize (* skip_finish) (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ void (* close_async) (GInputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* close_finish) (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_input_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_input_stream_read (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_input_stream_read_all (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ gsize *bytes_read,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_34
+GBytes *g_input_stream_read_bytes (GInputStream *stream,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_input_stream_skip (GInputStream *stream,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_input_stream_close (GInputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_input_stream_read_async (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gssize g_input_stream_read_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_44
+void g_input_stream_read_all_async (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_44
+gboolean g_input_stream_read_all_finish (GInputStream *stream,
+ GAsyncResult *result,
+ gsize *bytes_read,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_34
+void g_input_stream_read_bytes_async (GInputStream *stream,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_34
+GBytes *g_input_stream_read_bytes_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_input_stream_skip_async (GInputStream *stream,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gssize g_input_stream_skip_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_input_stream_close_async (GInputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_input_stream_close_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+/* For implementations: */
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_input_stream_is_closed (GInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_input_stream_has_pending (GInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_input_stream_set_pending (GInputStream *stream,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_input_stream_clear_pending (GInputStream *stream);
+
+G_END_DECLS
+
+#endif /* __G_INPUT_STREAM_H__ */
diff --git a/include/glib/gio/gio-autocleanups.h b/include/glib/gio/gio-autocleanups.h
new file mode 100644
index 0000000000..ff407293f8
--- /dev/null
+++ b/include/glib/gio/gio-autocleanups.h
@@ -0,0 +1,153 @@
+/*
+ * Copyright © 2015 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAction, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GActionMap, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppInfo, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppLaunchContext, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppInfoMonitor, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GApplicationCommandLine, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GApplication, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncInitable, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncResult, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBufferedInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBufferedOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBytesIcon, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GCancellable, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GCharsetConverter, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverter, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverterInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverterOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GCredentials, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDatagramBased, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDataInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDataOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusActionGroup, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusAuthObserver, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusConnection, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusInterface, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusInterfaceSkeleton, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMenuModel, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMessage, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMethodInvocation, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusNodeInfo, g_dbus_node_info_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObject, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectManagerClient, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectManager, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectManagerServer, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectProxy, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusObjectSkeleton, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusProxy, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusServer, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDrive, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GEmblemedIcon, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GEmblem, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileEnumerator, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFile, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileAttributeInfoList, g_file_attribute_info_list_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileIcon, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileInfo, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileIOStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileMonitor, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFilenameCompleter, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFilterInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFilterOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIcon, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInetAddress, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInetAddressMask, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInetSocketAddress, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitable, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOModule, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GLoadableIcon, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMemoryInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMemoryOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenu, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuItem, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuModel, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuAttributeIter, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMenuLinkIter, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMount, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMountOperation, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNativeVolumeMonitor, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNetworkAddress, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNetworkMonitor, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNetworkService, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNotification, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPermission, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPollableInputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPollableOutputStream, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPropertyAction, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxyAddressEnumerator, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxyAddress, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxy, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GProxyResolver, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRemoteActionGroup, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GResolver, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GResource, g_resource_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSeekable, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsBackend, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsSchema, g_settings_schema_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsSchemaKey, g_settings_schema_key_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettingsSchemaSource, g_settings_schema_source_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSettings, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleActionGroup, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleAction, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleAsyncResult, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimplePermission, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSimpleProxyResolver, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketAddressEnumerator, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketAddress, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketClient, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketConnectable, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketConnection, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketControlMessage, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocket, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketListener, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketService, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocess, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocessLauncher, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTask, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTcpConnection, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTcpWrapperConnection, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTestDBus, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThemedIcon, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThreadedSocketService, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsBackend, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsCertificate, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsClientConnection, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsConnection, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsDatabase, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsFileDatabase, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsInteraction, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsPassword, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsServerConnection, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVfs, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolume, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolumeMonitor, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibCompressor, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibDecompressor, g_object_unref)
diff --git a/include/glib/gio/gio.h b/include/glib/gio/gio.h
new file mode 100644
index 0000000000..8053768a00
--- /dev/null
+++ b/include/glib/gio/gio.h
@@ -0,0 +1,177 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_IO_H__
+#define __G_IO_H__
+
+#define __GIO_GIO_H_INSIDE__
+
+#include <gio/giotypes.h>
+
+#include <gio/gaction.h>
+#include <gio/gactiongroup.h>
+#include <gio/gactiongroupexporter.h>
+#include <gio/gactionmap.h>
+#include <gio/gappinfo.h>
+#include <gio/gapplication.h>
+#include <gio/gapplicationcommandline.h>
+#include <gio/gasyncinitable.h>
+#include <gio/gasyncresult.h>
+#include <gio/gbufferedinputstream.h>
+#include <gio/gbufferedoutputstream.h>
+#include <gio/gbytesicon.h>
+#include <gio/gcancellable.h>
+#include <gio/gcharsetconverter.h>
+#include <gio/gcontenttype.h>
+#include <gio/gconverter.h>
+#include <gio/gconverterinputstream.h>
+#include <gio/gconverteroutputstream.h>
+#include <gio/gcredentials.h>
+#include <gio/gdatagrambased.h>
+#include <gio/gdatainputstream.h>
+#include <gio/gdataoutputstream.h>
+#include <gio/gdbusaddress.h>
+#include <gio/gdbusauthobserver.h>
+#include <gio/gdbusconnection.h>
+#include <gio/gdbuserror.h>
+#include <gio/gdbusintrospection.h>
+#include <gio/gdbusmessage.h>
+#include <gio/gdbusmethodinvocation.h>
+#include <gio/gdbusnameowning.h>
+#include <gio/gdbusnamewatching.h>
+#include <gio/gdbusproxy.h>
+#include <gio/gdbusserver.h>
+#include <gio/gdbusutils.h>
+#include <gio/gdrive.h>
+#include <gio/gdtlsclientconnection.h>
+#include <gio/gdtlsconnection.h>
+#include <gio/gdtlsserverconnection.h>
+#include <gio/gemblemedicon.h>
+#include <gio/gfileattribute.h>
+#include <gio/gfileenumerator.h>
+#include <gio/gfile.h>
+#include <gio/gfileicon.h>
+#include <gio/gfileinfo.h>
+#include <gio/gfileinputstream.h>
+#include <gio/gfileiostream.h>
+#include <gio/gfilemonitor.h>
+#include <gio/gfilenamecompleter.h>
+#include <gio/gfileoutputstream.h>
+#include <gio/gfilterinputstream.h>
+#include <gio/gfilteroutputstream.h>
+#include <gio/gicon.h>
+#include <gio/ginetaddress.h>
+#include <gio/ginetaddressmask.h>
+#include <gio/ginetsocketaddress.h>
+#include <gio/ginitable.h>
+#include <gio/ginputstream.h>
+#include <gio/gioenums.h>
+#include <gio/gioenumtypes.h>
+#include <gio/gioerror.h>
+#include <gio/giomodule.h>
+#include <gio/gioscheduler.h>
+#include <gio/giostream.h>
+#include <gio/gloadableicon.h>
+#include <gio/gmemoryinputstream.h>
+#include <gio/gmemoryoutputstream.h>
+#include <gio/gmount.h>
+#include <gio/gmountoperation.h>
+#include <gio/gnativesocketaddress.h>
+#include <gio/gnativevolumemonitor.h>
+#include <gio/gnetworkaddress.h>
+#include <gio/gnetworkmonitor.h>
+#include <gio/gnetworkservice.h>
+#include <gio/goutputstream.h>
+#include <gio/gpermission.h>
+#include <gio/gpollableinputstream.h>
+#include <gio/gpollableoutputstream.h>
+#include <gio/gpollableutils.h>
+#include <gio/gpropertyaction.h>
+#include <gio/gproxy.h>
+#include <gio/gproxyaddress.h>
+#include <gio/gproxyaddressenumerator.h>
+#include <gio/gproxyresolver.h>
+#include <gio/gresolver.h>
+#include <gio/gresource.h>
+#include <gio/gseekable.h>
+#include <gio/gsettingsschema.h>
+#include <gio/gsettings.h>
+#include <gio/gsimpleaction.h>
+#include <gio/gsimpleactiongroup.h>
+#include <gio/gsimpleasyncresult.h>
+#include <gio/gsimpleiostream.h>
+#include <gio/gsimplepermission.h>
+#include <gio/gsocketaddressenumerator.h>
+#include <gio/gsocketaddress.h>
+#include <gio/gsocketclient.h>
+#include <gio/gsocketconnectable.h>
+#include <gio/gsocketconnection.h>
+#include <gio/gsocketcontrolmessage.h>
+#include <gio/gsocket.h>
+#include <gio/gsocketlistener.h>
+#include <gio/gsocketservice.h>
+#include <gio/gsrvtarget.h>
+#include <gio/gsimpleproxyresolver.h>
+#include <gio/gtask.h>
+#include <gio/gsubprocess.h>
+#include <gio/gsubprocesslauncher.h>
+#include <gio/gtcpconnection.h>
+#include <gio/gtcpwrapperconnection.h>
+#include <gio/gtestdbus.h>
+#include <gio/gthemedicon.h>
+#include <gio/gthreadedsocketservice.h>
+#include <gio/gtlsbackend.h>
+#include <gio/gtlscertificate.h>
+#include <gio/gtlsclientconnection.h>
+#include <gio/gtlsconnection.h>
+#include <gio/gtlsdatabase.h>
+#include <gio/gtlsfiledatabase.h>
+#include <gio/gtlsinteraction.h>
+#include <gio/gtlsserverconnection.h>
+#include <gio/gtlspassword.h>
+#include <gio/gvfs.h>
+#include <gio/gvolume.h>
+#include <gio/gvolumemonitor.h>
+#include <gio/gzlibcompressor.h>
+#include <gio/gzlibdecompressor.h>
+#include <gio/gdbusinterface.h>
+#include <gio/gdbusinterfaceskeleton.h>
+#include <gio/gdbusobject.h>
+#include <gio/gdbusobjectskeleton.h>
+#include <gio/gdbusobjectproxy.h>
+#include <gio/gdbusobjectmanager.h>
+#include <gio/gdbusobjectmanagerclient.h>
+#include <gio/gdbusobjectmanagerserver.h>
+#include <gio/gdbusactiongroup.h>
+#include <gio/gremoteactiongroup.h>
+#include <gio/gmenumodel.h>
+#include <gio/gmenu.h>
+#include <gio/gmenuexporter.h>
+#include <gio/gdbusmenumodel.h>
+#include <gio/gnotification.h>
+#include <gio/glistmodel.h>
+#include <gio/gliststore.h>
+
+#include <gio/gio-autocleanups.h>
+
+#undef __GIO_GIO_H_INSIDE__
+
+#endif /* __G_IO_H__ */
+
diff --git a/include/glib/gio/gioenums.h b/include/glib/gio/gioenums.h
new file mode 100644
index 0000000000..22fe7005c1
--- /dev/null
+++ b/include/glib/gio/gioenums.h
@@ -0,0 +1,1969 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __GIO_ENUMS_H__
+#define __GIO_ENUMS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+
+/**
+ * GAppInfoCreateFlags:
+ * @G_APP_INFO_CREATE_NONE: No flags.
+ * @G_APP_INFO_CREATE_NEEDS_TERMINAL: Application opens in a terminal window.
+ * @G_APP_INFO_CREATE_SUPPORTS_URIS: Application supports URI arguments.
+ * @G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION: Application supports startup notification. Since 2.26
+ *
+ * Flags used when creating a #GAppInfo.
+ */
+typedef enum {
+ G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/
+ G_APP_INFO_CREATE_NEEDS_TERMINAL = (1 << 0), /*< nick=needs-terminal >*/
+ G_APP_INFO_CREATE_SUPPORTS_URIS = (1 << 1), /*< nick=supports-uris >*/
+ G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION = (1 << 2) /*< nick=supports-startup-notification >*/
+} GAppInfoCreateFlags;
+
+/**
+ * GConverterFlags:
+ * @G_CONVERTER_NO_FLAGS: No flags.
+ * @G_CONVERTER_INPUT_AT_END: At end of input data
+ * @G_CONVERTER_FLUSH: Flush data
+ *
+ * Flags used when calling a g_converter_convert().
+ *
+ * Since: 2.24
+ */
+typedef enum {
+ G_CONVERTER_NO_FLAGS = 0, /*< nick=none >*/
+ G_CONVERTER_INPUT_AT_END = (1 << 0), /*< nick=input-at-end >*/
+ G_CONVERTER_FLUSH = (1 << 1) /*< nick=flush >*/
+} GConverterFlags;
+
+/**
+ * GConverterResult:
+ * @G_CONVERTER_ERROR: There was an error during conversion.
+ * @G_CONVERTER_CONVERTED: Some data was consumed or produced
+ * @G_CONVERTER_FINISHED: The conversion is finished
+ * @G_CONVERTER_FLUSHED: Flushing is finished
+ *
+ * Results returned from g_converter_convert().
+ *
+ * Since: 2.24
+ */
+typedef enum {
+ G_CONVERTER_ERROR = 0, /*< nick=error >*/
+ G_CONVERTER_CONVERTED = 1, /*< nick=converted >*/
+ G_CONVERTER_FINISHED = 2, /*< nick=finished >*/
+ G_CONVERTER_FLUSHED = 3 /*< nick=flushed >*/
+} GConverterResult;
+
+
+/**
+ * GDataStreamByteOrder:
+ * @G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN: Selects Big Endian byte order.
+ * @G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN: Selects Little Endian byte order.
+ * @G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN: Selects endianness based on host machine's architecture.
+ *
+ * #GDataStreamByteOrder is used to ensure proper endianness of streaming data sources
+ * across various machine architectures.
+ *
+ **/
+typedef enum {
+ G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN,
+ G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN,
+ G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN
+} GDataStreamByteOrder;
+
+
+/**
+ * GDataStreamNewlineType:
+ * @G_DATA_STREAM_NEWLINE_TYPE_LF: Selects "LF" line endings, common on most modern UNIX platforms.
+ * @G_DATA_STREAM_NEWLINE_TYPE_CR: Selects "CR" line endings.
+ * @G_DATA_STREAM_NEWLINE_TYPE_CR_LF: Selects "CR, LF" line ending, common on Microsoft Windows.
+ * @G_DATA_STREAM_NEWLINE_TYPE_ANY: Automatically try to handle any line ending type.
+ *
+ * #GDataStreamNewlineType is used when checking for or setting the line endings for a given file.
+ **/
+typedef enum {
+ G_DATA_STREAM_NEWLINE_TYPE_LF,
+ G_DATA_STREAM_NEWLINE_TYPE_CR,
+ G_DATA_STREAM_NEWLINE_TYPE_CR_LF,
+ G_DATA_STREAM_NEWLINE_TYPE_ANY
+} GDataStreamNewlineType;
+
+
+/**
+ * GFileAttributeType:
+ * @G_FILE_ATTRIBUTE_TYPE_INVALID: indicates an invalid or uninitalized type.
+ * @G_FILE_ATTRIBUTE_TYPE_STRING: a null terminated UTF8 string.
+ * @G_FILE_ATTRIBUTE_TYPE_BYTE_STRING: a zero terminated string of non-zero bytes.
+ * @G_FILE_ATTRIBUTE_TYPE_BOOLEAN: a boolean value.
+ * @G_FILE_ATTRIBUTE_TYPE_UINT32: an unsigned 4-byte/32-bit integer.
+ * @G_FILE_ATTRIBUTE_TYPE_INT32: a signed 4-byte/32-bit integer.
+ * @G_FILE_ATTRIBUTE_TYPE_UINT64: an unsigned 8-byte/64-bit integer.
+ * @G_FILE_ATTRIBUTE_TYPE_INT64: a signed 8-byte/64-bit integer.
+ * @G_FILE_ATTRIBUTE_TYPE_OBJECT: a #GObject.
+ * @G_FILE_ATTRIBUTE_TYPE_STRINGV: a %NULL terminated char **. Since 2.22
+ *
+ * The data types for file attributes.
+ **/
+typedef enum {
+ G_FILE_ATTRIBUTE_TYPE_INVALID = 0,
+ G_FILE_ATTRIBUTE_TYPE_STRING,
+ G_FILE_ATTRIBUTE_TYPE_BYTE_STRING, /* zero terminated string of non-zero bytes */
+ G_FILE_ATTRIBUTE_TYPE_BOOLEAN,
+ G_FILE_ATTRIBUTE_TYPE_UINT32,
+ G_FILE_ATTRIBUTE_TYPE_INT32,
+ G_FILE_ATTRIBUTE_TYPE_UINT64,
+ G_FILE_ATTRIBUTE_TYPE_INT64,
+ G_FILE_ATTRIBUTE_TYPE_OBJECT,
+ G_FILE_ATTRIBUTE_TYPE_STRINGV
+} GFileAttributeType;
+
+
+/**
+ * GFileAttributeInfoFlags:
+ * @G_FILE_ATTRIBUTE_INFO_NONE: no flags set.
+ * @G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE: copy the attribute values when the file is copied.
+ * @G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED: copy the attribute values when the file is moved.
+ *
+ * Flags specifying the behaviour of an attribute.
+ **/
+typedef enum {
+ G_FILE_ATTRIBUTE_INFO_NONE = 0,
+ G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE = (1 << 0),
+ G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED = (1 << 1)
+} GFileAttributeInfoFlags;
+
+
+/**
+ * GFileAttributeStatus:
+ * @G_FILE_ATTRIBUTE_STATUS_UNSET: Attribute value is unset (empty).
+ * @G_FILE_ATTRIBUTE_STATUS_SET: Attribute value is set.
+ * @G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING: Indicates an error in setting the value.
+ *
+ * Used by g_file_set_attributes_from_info() when setting file attributes.
+ **/
+typedef enum {
+ G_FILE_ATTRIBUTE_STATUS_UNSET = 0,
+ G_FILE_ATTRIBUTE_STATUS_SET,
+ G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING
+} GFileAttributeStatus;
+
+
+/**
+ * GFileQueryInfoFlags:
+ * @G_FILE_QUERY_INFO_NONE: No flags set.
+ * @G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS: Don't follow symlinks.
+ *
+ * Flags used when querying a #GFileInfo.
+ */
+typedef enum {
+ G_FILE_QUERY_INFO_NONE = 0,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1 << 0) /*< nick=nofollow-symlinks >*/
+} GFileQueryInfoFlags;
+
+
+/**
+ * GFileCreateFlags:
+ * @G_FILE_CREATE_NONE: No flags set.
+ * @G_FILE_CREATE_PRIVATE: Create a file that can only be
+ * accessed by the current user.
+ * @G_FILE_CREATE_REPLACE_DESTINATION: Replace the destination
+ * as if it didn't exist before. Don't try to keep any old
+ * permissions, replace instead of following links. This
+ * is generally useful if you're doing a "copy over"
+ * rather than a "save new version of" replace operation.
+ * You can think of it as "unlink destination" before
+ * writing to it, although the implementation may not
+ * be exactly like that. Since 2.20
+ *
+ * Flags used when an operation may create a file.
+ */
+typedef enum {
+ G_FILE_CREATE_NONE = 0,
+ G_FILE_CREATE_PRIVATE = (1 << 0),
+ G_FILE_CREATE_REPLACE_DESTINATION = (1 << 1)
+} GFileCreateFlags;
+
+/**
+ * GFileMeasureFlags:
+ * @G_FILE_MEASURE_NONE: No flags set.
+ * @G_FILE_MEASURE_REPORT_ANY_ERROR: Report any error encountered
+ * while traversing the directory tree. Normally errors are only
+ * reported for the toplevel file.
+ * @G_FILE_MEASURE_APPARENT_SIZE: Tally usage based on apparent file
+ * sizes. Normally, the block-size is used, if available, as this is a
+ * more accurate representation of disk space used.
+ * Compare with `du --apparent-size`.
+ * @G_FILE_MEASURE_NO_XDEV: Do not cross mount point boundaries.
+ * Compare with `du -x`.
+ *
+ * Flags that can be used with g_file_measure_disk_usage().
+ *
+ * Since: 2.38
+ **/
+typedef enum {
+ G_FILE_MEASURE_NONE = 0,
+ G_FILE_MEASURE_REPORT_ANY_ERROR = (1 << 1),
+ G_FILE_MEASURE_APPARENT_SIZE = (1 << 2),
+ G_FILE_MEASURE_NO_XDEV = (1 << 3)
+} GFileMeasureFlags;
+
+/**
+ * GMountMountFlags:
+ * @G_MOUNT_MOUNT_NONE: No flags set.
+ *
+ * Flags used when mounting a mount.
+ */
+typedef enum /*< flags >*/ {
+ G_MOUNT_MOUNT_NONE = 0
+} GMountMountFlags;
+
+
+/**
+ * GMountUnmountFlags:
+ * @G_MOUNT_UNMOUNT_NONE: No flags set.
+ * @G_MOUNT_UNMOUNT_FORCE: Unmount even if there are outstanding
+ * file operations on the mount.
+ *
+ * Flags used when an unmounting a mount.
+ */
+typedef enum {
+ G_MOUNT_UNMOUNT_NONE = 0,
+ G_MOUNT_UNMOUNT_FORCE = (1 << 0)
+} GMountUnmountFlags;
+
+/**
+ * GDriveStartFlags:
+ * @G_DRIVE_START_NONE: No flags set.
+ *
+ * Flags used when starting a drive.
+ *
+ * Since: 2.22
+ */
+typedef enum /*< flags >*/ {
+ G_DRIVE_START_NONE = 0
+} GDriveStartFlags;
+
+/**
+ * GDriveStartStopType:
+ * @G_DRIVE_START_STOP_TYPE_UNKNOWN: Unknown or drive doesn't support
+ * start/stop.
+ * @G_DRIVE_START_STOP_TYPE_SHUTDOWN: The stop method will physically
+ * shut down the drive and e.g. power down the port the drive is
+ * attached to.
+ * @G_DRIVE_START_STOP_TYPE_NETWORK: The start/stop methods are used
+ * for connecting/disconnect to the drive over the network.
+ * @G_DRIVE_START_STOP_TYPE_MULTIDISK: The start/stop methods will
+ * assemble/disassemble a virtual drive from several physical
+ * drives.
+ * @G_DRIVE_START_STOP_TYPE_PASSWORD: The start/stop methods will
+ * unlock/lock the disk (for example using the ATA <quote>SECURITY
+ * UNLOCK DEVICE</quote> command)
+ *
+ * Enumeration describing how a drive can be started/stopped.
+ *
+ * Since: 2.22
+ */
+typedef enum {
+ G_DRIVE_START_STOP_TYPE_UNKNOWN,
+ G_DRIVE_START_STOP_TYPE_SHUTDOWN,
+ G_DRIVE_START_STOP_TYPE_NETWORK,
+ G_DRIVE_START_STOP_TYPE_MULTIDISK,
+ G_DRIVE_START_STOP_TYPE_PASSWORD
+} GDriveStartStopType;
+
+/**
+ * GFileCopyFlags:
+ * @G_FILE_COPY_NONE: No flags set.
+ * @G_FILE_COPY_OVERWRITE: Overwrite any existing files
+ * @G_FILE_COPY_BACKUP: Make a backup of any existing files.
+ * @G_FILE_COPY_NOFOLLOW_SYMLINKS: Don't follow symlinks.
+ * @G_FILE_COPY_ALL_METADATA: Copy all file metadata instead of just default set used for copy (see #GFileInfo).
+ * @G_FILE_COPY_NO_FALLBACK_FOR_MOVE: Don't use copy and delete fallback if native move not supported.
+ * @G_FILE_COPY_TARGET_DEFAULT_PERMS: Leaves target file with default perms, instead of setting the source file perms.
+ *
+ * Flags used when copying or moving files.
+ */
+typedef enum {
+ G_FILE_COPY_NONE = 0, /*< nick=none >*/
+ G_FILE_COPY_OVERWRITE = (1 << 0),
+ G_FILE_COPY_BACKUP = (1 << 1),
+ G_FILE_COPY_NOFOLLOW_SYMLINKS = (1 << 2),
+ G_FILE_COPY_ALL_METADATA = (1 << 3),
+ G_FILE_COPY_NO_FALLBACK_FOR_MOVE = (1 << 4),
+ G_FILE_COPY_TARGET_DEFAULT_PERMS = (1 << 5)
+} GFileCopyFlags;
+
+
+/**
+ * GFileMonitorFlags:
+ * @G_FILE_MONITOR_NONE: No flags set.
+ * @G_FILE_MONITOR_WATCH_MOUNTS: Watch for mount events.
+ * @G_FILE_MONITOR_SEND_MOVED: Pair DELETED and CREATED events caused
+ * by file renames (moves) and send a single G_FILE_MONITOR_EVENT_MOVED
+ * event instead (NB: not supported on all backends; the default
+ * behaviour -without specifying this flag- is to send single DELETED
+ * and CREATED events). Deprecated since 2.46: use
+ * %G_FILE_MONITOR_WATCH_MOVES instead.
+ * @G_FILE_MONITOR_WATCH_HARD_LINKS: Watch for changes to the file made
+ * via another hard link. Since 2.36.
+ * @G_FILE_MONITOR_WATCH_MOVES: Watch for rename operations on a
+ * monitored directory. This causes %G_FILE_MONITOR_EVENT_RENAMED,
+ * %G_FILE_MONITOR_EVENT_MOVED_IN and %G_FILE_MONITOR_EVENT_MOVED_OUT
+ * events to be emitted when possible. Since: 2.46.
+ *
+ * Flags used to set what a #GFileMonitor will watch for.
+ */
+typedef enum {
+ G_FILE_MONITOR_NONE = 0,
+ G_FILE_MONITOR_WATCH_MOUNTS = (1 << 0),
+ G_FILE_MONITOR_SEND_MOVED = (1 << 1),
+ G_FILE_MONITOR_WATCH_HARD_LINKS = (1 << 2),
+ G_FILE_MONITOR_WATCH_MOVES = (1 << 3)
+} GFileMonitorFlags;
+
+
+/**
+ * GFileType:
+ * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
+ * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
+ * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
+ * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link
+ * (Unix systems).
+ * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo,
+ * block device, or character device.
+ * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems).
+ * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
+ *
+ * Indicates the file's on-disk type.
+ *
+ * On Windows systems a file will never have %G_FILE_TYPE_SYMBOLIC_LINK type;
+ * use #GFileInfo and %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK to determine
+ * whether a file is a symlink or not. This is due to the fact that NTFS does
+ * not have a single filesystem object type for symbolic links - it has
+ * files that symlink to files, and directories that symlink to directories.
+ * #GFileType enumeration cannot precisely represent this important distinction,
+ * which is why all Windows symlinks will continue to be reported as
+ * %G_FILE_TYPE_REGULAR or %G_FILE_TYPE_DIRECTORY.
+ **/
+typedef enum {
+ G_FILE_TYPE_UNKNOWN = 0,
+ G_FILE_TYPE_REGULAR,
+ G_FILE_TYPE_DIRECTORY,
+ G_FILE_TYPE_SYMBOLIC_LINK,
+ G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
+ G_FILE_TYPE_SHORTCUT,
+ G_FILE_TYPE_MOUNTABLE
+} GFileType;
+
+
+/**
+ * GFilesystemPreviewType:
+ * @G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS: Only preview files if user has explicitly requested it.
+ * @G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL: Preview files if user has requested preview of "local" files.
+ * @G_FILESYSTEM_PREVIEW_TYPE_NEVER: Never preview files.
+ *
+ * Indicates a hint from the file system whether files should be
+ * previewed in a file manager. Returned as the value of the key
+ * #G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW.
+ **/
+typedef enum {
+ G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS = 0,
+ G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL,
+ G_FILESYSTEM_PREVIEW_TYPE_NEVER
+} GFilesystemPreviewType;
+
+
+/**
+ * GFileMonitorEvent:
+ * @G_FILE_MONITOR_EVENT_CHANGED: a file changed.
+ * @G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: a hint that this was probably the last change in a set of changes.
+ * @G_FILE_MONITOR_EVENT_DELETED: a file was deleted.
+ * @G_FILE_MONITOR_EVENT_CREATED: a file was created.
+ * @G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: a file attribute was changed.
+ * @G_FILE_MONITOR_EVENT_PRE_UNMOUNT: the file location will soon be unmounted.
+ * @G_FILE_MONITOR_EVENT_UNMOUNTED: the file location was unmounted.
+ * @G_FILE_MONITOR_EVENT_MOVED: the file was moved -- only sent if the
+ * (deprecated) %G_FILE_MONITOR_SEND_MOVED flag is set
+ * @G_FILE_MONITOR_EVENT_RENAMED: the file was renamed within the
+ * current directory -- only sent if the %G_FILE_MONITOR_WATCH_MOVES
+ * flag is set. Since: 2.46.
+ * @G_FILE_MONITOR_EVENT_MOVED_IN: the file was moved into the
+ * monitored directory from another location -- only sent if the
+ * %G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.46.
+ * @G_FILE_MONITOR_EVENT_MOVED_OUT: the file was moved out of the
+ * monitored directory to another location -- only sent if the
+ * %G_FILE_MONITOR_WATCH_MOVES flag is set. Since: 2.46
+ *
+ * Specifies what type of event a monitor event is.
+ **/
+typedef enum {
+ G_FILE_MONITOR_EVENT_CHANGED,
+ G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT,
+ G_FILE_MONITOR_EVENT_DELETED,
+ G_FILE_MONITOR_EVENT_CREATED,
+ G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED,
+ G_FILE_MONITOR_EVENT_PRE_UNMOUNT,
+ G_FILE_MONITOR_EVENT_UNMOUNTED,
+ G_FILE_MONITOR_EVENT_MOVED,
+ G_FILE_MONITOR_EVENT_RENAMED,
+ G_FILE_MONITOR_EVENT_MOVED_IN,
+ G_FILE_MONITOR_EVENT_MOVED_OUT
+} GFileMonitorEvent;
+
+
+/* This enumeration conflicts with GIOError in giochannel.h. However,
+ * that is only used as a return value in some deprecated functions.
+ * So, we reuse the same prefix for the enumeration values, but call
+ * the actual enumeration (which is rarely used) GIOErrorEnum.
+ */
+/**
+ * GIOErrorEnum:
+ * @G_IO_ERROR_FAILED: Generic error condition for when an operation fails
+ * and no more specific #GIOErrorEnum value is defined.
+ * @G_IO_ERROR_NOT_FOUND: File not found.
+ * @G_IO_ERROR_EXISTS: File already exists.
+ * @G_IO_ERROR_IS_DIRECTORY: File is a directory.
+ * @G_IO_ERROR_NOT_DIRECTORY: File is not a directory.
+ * @G_IO_ERROR_NOT_EMPTY: File is a directory that isn't empty.
+ * @G_IO_ERROR_NOT_REGULAR_FILE: File is not a regular file.
+ * @G_IO_ERROR_NOT_SYMBOLIC_LINK: File is not a symbolic link.
+ * @G_IO_ERROR_NOT_MOUNTABLE_FILE: File cannot be mounted.
+ * @G_IO_ERROR_FILENAME_TOO_LONG: Filename is too many characters.
+ * @G_IO_ERROR_INVALID_FILENAME: Filename is invalid or contains invalid characters.
+ * @G_IO_ERROR_TOO_MANY_LINKS: File contains too many symbolic links.
+ * @G_IO_ERROR_NO_SPACE: No space left on drive.
+ * @G_IO_ERROR_INVALID_ARGUMENT: Invalid argument.
+ * @G_IO_ERROR_PERMISSION_DENIED: Permission denied.
+ * @G_IO_ERROR_NOT_SUPPORTED: Operation (or one of its parameters) not supported
+ * @G_IO_ERROR_NOT_MOUNTED: File isn't mounted.
+ * @G_IO_ERROR_ALREADY_MOUNTED: File is already mounted.
+ * @G_IO_ERROR_CLOSED: File was closed.
+ * @G_IO_ERROR_CANCELLED: Operation was cancelled. See #GCancellable.
+ * @G_IO_ERROR_PENDING: Operations are still pending.
+ * @G_IO_ERROR_READ_ONLY: File is read only.
+ * @G_IO_ERROR_CANT_CREATE_BACKUP: Backup couldn't be created.
+ * @G_IO_ERROR_WRONG_ETAG: File's Entity Tag was incorrect.
+ * @G_IO_ERROR_TIMED_OUT: Operation timed out.
+ * @G_IO_ERROR_WOULD_RECURSE: Operation would be recursive.
+ * @G_IO_ERROR_BUSY: File is busy.
+ * @G_IO_ERROR_WOULD_BLOCK: Operation would block.
+ * @G_IO_ERROR_HOST_NOT_FOUND: Host couldn't be found (remote operations).
+ * @G_IO_ERROR_WOULD_MERGE: Operation would merge files.
+ * @G_IO_ERROR_FAILED_HANDLED: Operation failed and a helper program has
+ * already interacted with the user. Do not display any error dialog.
+ * @G_IO_ERROR_TOO_MANY_OPEN_FILES: The current process has too many files
+ * open and can't open any more. Duplicate descriptors do count toward
+ * this limit. Since 2.20
+ * @G_IO_ERROR_NOT_INITIALIZED: The object has not been initialized. Since 2.22
+ * @G_IO_ERROR_ADDRESS_IN_USE: The requested address is already in use. Since 2.22
+ * @G_IO_ERROR_PARTIAL_INPUT: Need more input to finish operation. Since 2.24
+ * @G_IO_ERROR_INVALID_DATA: The input data was invalid. Since 2.24
+ * @G_IO_ERROR_DBUS_ERROR: A remote object generated an error that
+ * doesn't correspond to a locally registered #GError error
+ * domain. Use g_dbus_error_get_remote_error() to extract the D-Bus
+ * error name and g_dbus_error_strip_remote_error() to fix up the
+ * message so it matches what was received on the wire. Since 2.26.
+ * @G_IO_ERROR_HOST_UNREACHABLE: Host unreachable. Since 2.26
+ * @G_IO_ERROR_NETWORK_UNREACHABLE: Network unreachable. Since 2.26
+ * @G_IO_ERROR_CONNECTION_REFUSED: Connection refused. Since 2.26
+ * @G_IO_ERROR_PROXY_FAILED: Connection to proxy server failed. Since 2.26
+ * @G_IO_ERROR_PROXY_AUTH_FAILED: Proxy authentication failed. Since 2.26
+ * @G_IO_ERROR_PROXY_NEED_AUTH: Proxy server needs authentication. Since 2.26
+ * @G_IO_ERROR_PROXY_NOT_ALLOWED: Proxy connection is not allowed by ruleset.
+ * Since 2.26
+ * @G_IO_ERROR_BROKEN_PIPE: Broken pipe. Since 2.36
+ * @G_IO_ERROR_CONNECTION_CLOSED: Connection closed by peer. Note that this
+ * is the same code as %G_IO_ERROR_BROKEN_PIPE; before 2.44 some
+ * "connection closed" errors returned %G_IO_ERROR_BROKEN_PIPE, but others
+ * returned %G_IO_ERROR_FAILED. Now they should all return the same
+ * value, which has this more logical name. Since 2.44.
+ * @G_IO_ERROR_NOT_CONNECTED: Transport endpoint is not connected. Since 2.44
+ * @G_IO_ERROR_MESSAGE_TOO_LARGE: Message too large. Since 2.48.
+ *
+ * Error codes returned by GIO functions.
+ *
+ * Note that this domain may be extended in future GLib releases. In
+ * general, new error codes either only apply to new APIs, or else
+ * replace %G_IO_ERROR_FAILED in cases that were not explicitly
+ * distinguished before. You should therefore avoid writing code like
+ * |[<!-- language="C" -->
+ * if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_FAILED))
+ * {
+ * // Assume that this is EPRINTERONFIRE
+ * ...
+ * }
+ * ]|
+ * but should instead treat all unrecognized error codes the same as
+ * #G_IO_ERROR_FAILED.
+ *
+ * See also #GPollableReturn for a cheaper way of returning
+ * %G_IO_ERROR_WOULD_BLOCK to callers without allocating a #GError.
+ **/
+typedef enum {
+ G_IO_ERROR_FAILED,
+ G_IO_ERROR_NOT_FOUND,
+ G_IO_ERROR_EXISTS,
+ G_IO_ERROR_IS_DIRECTORY,
+ G_IO_ERROR_NOT_DIRECTORY,
+ G_IO_ERROR_NOT_EMPTY,
+ G_IO_ERROR_NOT_REGULAR_FILE,
+ G_IO_ERROR_NOT_SYMBOLIC_LINK,
+ G_IO_ERROR_NOT_MOUNTABLE_FILE,
+ G_IO_ERROR_FILENAME_TOO_LONG,
+ G_IO_ERROR_INVALID_FILENAME,
+ G_IO_ERROR_TOO_MANY_LINKS,
+ G_IO_ERROR_NO_SPACE,
+ G_IO_ERROR_INVALID_ARGUMENT,
+ G_IO_ERROR_PERMISSION_DENIED,
+ G_IO_ERROR_NOT_SUPPORTED,
+ G_IO_ERROR_NOT_MOUNTED,
+ G_IO_ERROR_ALREADY_MOUNTED,
+ G_IO_ERROR_CLOSED,
+ G_IO_ERROR_CANCELLED,
+ G_IO_ERROR_PENDING,
+ G_IO_ERROR_READ_ONLY,
+ G_IO_ERROR_CANT_CREATE_BACKUP,
+ G_IO_ERROR_WRONG_ETAG,
+ G_IO_ERROR_TIMED_OUT,
+ G_IO_ERROR_WOULD_RECURSE,
+ G_IO_ERROR_BUSY,
+ G_IO_ERROR_WOULD_BLOCK,
+ G_IO_ERROR_HOST_NOT_FOUND,
+ G_IO_ERROR_WOULD_MERGE,
+ G_IO_ERROR_FAILED_HANDLED,
+ G_IO_ERROR_TOO_MANY_OPEN_FILES,
+ G_IO_ERROR_NOT_INITIALIZED,
+ G_IO_ERROR_ADDRESS_IN_USE,
+ G_IO_ERROR_PARTIAL_INPUT,
+ G_IO_ERROR_INVALID_DATA,
+ G_IO_ERROR_DBUS_ERROR,
+ G_IO_ERROR_HOST_UNREACHABLE,
+ G_IO_ERROR_NETWORK_UNREACHABLE,
+ G_IO_ERROR_CONNECTION_REFUSED,
+ G_IO_ERROR_PROXY_FAILED,
+ G_IO_ERROR_PROXY_AUTH_FAILED,
+ G_IO_ERROR_PROXY_NEED_AUTH,
+ G_IO_ERROR_PROXY_NOT_ALLOWED,
+ G_IO_ERROR_BROKEN_PIPE,
+ G_IO_ERROR_CONNECTION_CLOSED = G_IO_ERROR_BROKEN_PIPE,
+ G_IO_ERROR_NOT_CONNECTED,
+ G_IO_ERROR_MESSAGE_TOO_LARGE
+} GIOErrorEnum;
+
+
+/**
+ * GAskPasswordFlags:
+ * @G_ASK_PASSWORD_NEED_PASSWORD: operation requires a password.
+ * @G_ASK_PASSWORD_NEED_USERNAME: operation requires a username.
+ * @G_ASK_PASSWORD_NEED_DOMAIN: operation requires a domain.
+ * @G_ASK_PASSWORD_SAVING_SUPPORTED: operation supports saving settings.
+ * @G_ASK_PASSWORD_ANONYMOUS_SUPPORTED: operation supports anonymous users.
+ * @G_ASK_PASSWORD_TCRYPT: operation takes TCRYPT parameters (Since: 2.58)
+ *
+ * #GAskPasswordFlags are used to request specific information from the
+ * user, or to notify the user of their choices in an authentication
+ * situation.
+ **/
+typedef enum {
+ G_ASK_PASSWORD_NEED_PASSWORD = (1 << 0),
+ G_ASK_PASSWORD_NEED_USERNAME = (1 << 1),
+ G_ASK_PASSWORD_NEED_DOMAIN = (1 << 2),
+ G_ASK_PASSWORD_SAVING_SUPPORTED = (1 << 3),
+ G_ASK_PASSWORD_ANONYMOUS_SUPPORTED = (1 << 4),
+ G_ASK_PASSWORD_TCRYPT = (1 << 5),
+} GAskPasswordFlags;
+
+
+/**
+ * GPasswordSave:
+ * @G_PASSWORD_SAVE_NEVER: never save a password.
+ * @G_PASSWORD_SAVE_FOR_SESSION: save a password for the session.
+ * @G_PASSWORD_SAVE_PERMANENTLY: save a password permanently.
+ *
+ * #GPasswordSave is used to indicate the lifespan of a saved password.
+ *
+ * #Gvfs stores passwords in the Gnome keyring when this flag allows it
+ * to, and later retrieves it again from there.
+ **/
+typedef enum {
+ G_PASSWORD_SAVE_NEVER,
+ G_PASSWORD_SAVE_FOR_SESSION,
+ G_PASSWORD_SAVE_PERMANENTLY
+} GPasswordSave;
+
+
+/**
+ * GMountOperationResult:
+ * @G_MOUNT_OPERATION_HANDLED: The request was fulfilled and the
+ * user specified data is now available
+ * @G_MOUNT_OPERATION_ABORTED: The user requested the mount operation
+ * to be aborted
+ * @G_MOUNT_OPERATION_UNHANDLED: The request was unhandled (i.e. not
+ * implemented)
+ *
+ * #GMountOperationResult is returned as a result when a request for
+ * information is send by the mounting operation.
+ **/
+typedef enum {
+ G_MOUNT_OPERATION_HANDLED,
+ G_MOUNT_OPERATION_ABORTED,
+ G_MOUNT_OPERATION_UNHANDLED
+} GMountOperationResult;
+
+
+/**
+ * GOutputStreamSpliceFlags:
+ * @G_OUTPUT_STREAM_SPLICE_NONE: Do not close either stream.
+ * @G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE: Close the source stream after
+ * the splice.
+ * @G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET: Close the target stream after
+ * the splice.
+ *
+ * GOutputStreamSpliceFlags determine how streams should be spliced.
+ **/
+typedef enum {
+ G_OUTPUT_STREAM_SPLICE_NONE = 0,
+ G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = (1 << 0),
+ G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET = (1 << 1)
+} GOutputStreamSpliceFlags;
+
+
+/**
+ * GIOStreamSpliceFlags:
+ * @G_IO_STREAM_SPLICE_NONE: Do not close either stream.
+ * @G_IO_STREAM_SPLICE_CLOSE_STREAM1: Close the first stream after
+ * the splice.
+ * @G_IO_STREAM_SPLICE_CLOSE_STREAM2: Close the second stream after
+ * the splice.
+ * @G_IO_STREAM_SPLICE_WAIT_FOR_BOTH: Wait for both splice operations to finish
+ * before calling the callback.
+ *
+ * GIOStreamSpliceFlags determine how streams should be spliced.
+ *
+ * Since: 2.28
+ **/
+typedef enum {
+ G_IO_STREAM_SPLICE_NONE = 0,
+ G_IO_STREAM_SPLICE_CLOSE_STREAM1 = (1 << 0),
+ G_IO_STREAM_SPLICE_CLOSE_STREAM2 = (1 << 1),
+ G_IO_STREAM_SPLICE_WAIT_FOR_BOTH = (1 << 2)
+} GIOStreamSpliceFlags;
+
+/**
+ * GEmblemOrigin:
+ * @G_EMBLEM_ORIGIN_UNKNOWN: Emblem of unknown origin
+ * @G_EMBLEM_ORIGIN_DEVICE: Emblem adds device-specific information
+ * @G_EMBLEM_ORIGIN_LIVEMETADATA: Emblem depicts live metadata, such as "readonly"
+ * @G_EMBLEM_ORIGIN_TAG: Emblem comes from a user-defined tag, e.g. set by nautilus (in the future)
+ *
+ * GEmblemOrigin is used to add information about the origin of the emblem
+ * to #GEmblem.
+ *
+ * Since: 2.18
+ */
+typedef enum {
+ G_EMBLEM_ORIGIN_UNKNOWN,
+ G_EMBLEM_ORIGIN_DEVICE,
+ G_EMBLEM_ORIGIN_LIVEMETADATA,
+ G_EMBLEM_ORIGIN_TAG
+} GEmblemOrigin;
+
+/**
+ * GResolverError:
+ * @G_RESOLVER_ERROR_NOT_FOUND: the requested name/address/service was not
+ * found
+ * @G_RESOLVER_ERROR_TEMPORARY_FAILURE: the requested information could not
+ * be looked up due to a network error or similar problem
+ * @G_RESOLVER_ERROR_INTERNAL: unknown error
+ *
+ * An error code used with %G_RESOLVER_ERROR in a #GError returned
+ * from a #GResolver routine.
+ *
+ * Since: 2.22
+ */
+typedef enum {
+ G_RESOLVER_ERROR_NOT_FOUND,
+ G_RESOLVER_ERROR_TEMPORARY_FAILURE,
+ G_RESOLVER_ERROR_INTERNAL
+} GResolverError;
+
+/**
+ * GResolverRecordType:
+ * @G_RESOLVER_RECORD_SRV: look up DNS SRV records for a domain
+ * @G_RESOLVER_RECORD_MX: look up DNS MX records for a domain
+ * @G_RESOLVER_RECORD_TXT: look up DNS TXT records for a name
+ * @G_RESOLVER_RECORD_SOA: look up DNS SOA records for a zone
+ * @G_RESOLVER_RECORD_NS: look up DNS NS records for a domain
+ *
+ * The type of record that g_resolver_lookup_records() or
+ * g_resolver_lookup_records_async() should retrieve. The records are returned
+ * as lists of #GVariant tuples. Each record type has different values in
+ * the variant tuples returned.
+ *
+ * %G_RESOLVER_RECORD_SRV records are returned as variants with the signature
+ * `(qqqs)`, containing a `guint16` with the priority, a `guint16` with the
+ * weight, a `guint16` with the port, and a string of the hostname.
+ *
+ * %G_RESOLVER_RECORD_MX records are returned as variants with the signature
+ * `(qs)`, representing a `guint16` with the preference, and a string containing
+ * the mail exchanger hostname.
+ *
+ * %G_RESOLVER_RECORD_TXT records are returned as variants with the signature
+ * `(as)`, representing an array of the strings in the text record. Note: Most TXT
+ * records only contain a single string, but
+ * [RFC 1035](https://tools.ietf.org/html/rfc1035#section-3.3.14) does allow a
+ * record to contain multiple strings. The RFC which defines the interpretation
+ * of a specific TXT record will likely require concatenation of multiple
+ * strings if they are present, as with
+ * [RFC 7208](https://tools.ietf.org/html/rfc7208#section-3.3).
+ *
+ * %G_RESOLVER_RECORD_SOA records are returned as variants with the signature
+ * `(ssuuuuu)`, representing a string containing the primary name server, a
+ * string containing the administrator, the serial as a `guint32`, the refresh
+ * interval as a `guint32`, the retry interval as a `guint32`, the expire timeout
+ * as a `guint32`, and the TTL as a `guint32`.
+ *
+ * %G_RESOLVER_RECORD_NS records are returned as variants with the signature
+ * `(s)`, representing a string of the hostname of the name server.
+ *
+ * Since: 2.34
+ */
+typedef enum {
+ G_RESOLVER_RECORD_SRV = 1,
+ G_RESOLVER_RECORD_MX,
+ G_RESOLVER_RECORD_TXT,
+ G_RESOLVER_RECORD_SOA,
+ G_RESOLVER_RECORD_NS
+} GResolverRecordType;
+
+/**
+ * GResourceError:
+ * @G_RESOURCE_ERROR_NOT_FOUND: no file was found at the requested path
+ * @G_RESOURCE_ERROR_INTERNAL: unknown error
+ *
+ * An error code used with %G_RESOURCE_ERROR in a #GError returned
+ * from a #GResource routine.
+ *
+ * Since: 2.32
+ */
+typedef enum {
+ G_RESOURCE_ERROR_NOT_FOUND,
+ G_RESOURCE_ERROR_INTERNAL
+} GResourceError;
+
+/**
+ * GResourceFlags:
+ * @G_RESOURCE_FLAGS_NONE: No flags set.
+ * @G_RESOURCE_FLAGS_COMPRESSED: The file is compressed.
+ *
+ * GResourceFlags give information about a particular file inside a resource
+ * bundle.
+ *
+ * Since: 2.32
+ **/
+typedef enum {
+ G_RESOURCE_FLAGS_NONE = 0,
+ G_RESOURCE_FLAGS_COMPRESSED = (1<<0)
+} GResourceFlags;
+
+/**
+ * GResourceLookupFlags:
+ * @G_RESOURCE_LOOKUP_FLAGS_NONE: No flags set.
+ *
+ * GResourceLookupFlags determine how resource path lookups are handled.
+ *
+ * Since: 2.32
+ **/
+typedef enum /*< flags >*/ {
+ G_RESOURCE_LOOKUP_FLAGS_NONE = 0
+} GResourceLookupFlags;
+
+/**
+ * GSocketFamily:
+ * @G_SOCKET_FAMILY_INVALID: no address family
+ * @G_SOCKET_FAMILY_IPV4: the IPv4 family
+ * @G_SOCKET_FAMILY_IPV6: the IPv6 family
+ * @G_SOCKET_FAMILY_UNIX: the UNIX domain family
+ *
+ * The protocol family of a #GSocketAddress. (These values are
+ * identical to the system defines %AF_INET, %AF_INET6 and %AF_UNIX,
+ * if available.)
+ *
+ * Since: 2.22
+ */
+typedef enum {
+ G_SOCKET_FAMILY_INVALID,
+ G_SOCKET_FAMILY_UNIX = GLIB_SYSDEF_AF_UNIX,
+ G_SOCKET_FAMILY_IPV4 = GLIB_SYSDEF_AF_INET,
+ G_SOCKET_FAMILY_IPV6 = GLIB_SYSDEF_AF_INET6
+} GSocketFamily;
+
+/**
+ * GSocketType:
+ * @G_SOCKET_TYPE_INVALID: Type unknown or wrong
+ * @G_SOCKET_TYPE_STREAM: Reliable connection-based byte streams (e.g. TCP).
+ * @G_SOCKET_TYPE_DATAGRAM: Connectionless, unreliable datagram passing.
+ * (e.g. UDP)
+ * @G_SOCKET_TYPE_SEQPACKET: Reliable connection-based passing of datagrams
+ * of fixed maximum length (e.g. SCTP).
+ *
+ * Flags used when creating a #GSocket. Some protocols may not implement
+ * all the socket types.
+ *
+ * Since: 2.22
+ */
+typedef enum
+{
+ G_SOCKET_TYPE_INVALID,
+ G_SOCKET_TYPE_STREAM,
+ G_SOCKET_TYPE_DATAGRAM,
+ G_SOCKET_TYPE_SEQPACKET
+} GSocketType;
+
+/**
+ * GSocketMsgFlags:
+ * @G_SOCKET_MSG_NONE: No flags.
+ * @G_SOCKET_MSG_OOB: Request to send/receive out of band data.
+ * @G_SOCKET_MSG_PEEK: Read data from the socket without removing it from
+ * the queue.
+ * @G_SOCKET_MSG_DONTROUTE: Don't use a gateway to send out the packet,
+ * only send to hosts on directly connected networks.
+ *
+ * Flags used in g_socket_receive_message() and g_socket_send_message().
+ * The flags listed in the enum are some commonly available flags, but the
+ * values used for them are the same as on the platform, and any other flags
+ * are passed in/out as is. So to use a platform specific flag, just include
+ * the right system header and pass in the flag.
+ *
+ * Since: 2.22
+ */
+typedef enum /*< flags >*/
+{
+ G_SOCKET_MSG_NONE,
+ G_SOCKET_MSG_OOB = GLIB_SYSDEF_MSG_OOB,
+ G_SOCKET_MSG_PEEK = GLIB_SYSDEF_MSG_PEEK,
+ G_SOCKET_MSG_DONTROUTE = GLIB_SYSDEF_MSG_DONTROUTE
+} GSocketMsgFlags;
+
+/**
+ * GSocketProtocol:
+ * @G_SOCKET_PROTOCOL_UNKNOWN: The protocol type is unknown
+ * @G_SOCKET_PROTOCOL_DEFAULT: The default protocol for the family/type
+ * @G_SOCKET_PROTOCOL_TCP: TCP over IP
+ * @G_SOCKET_PROTOCOL_UDP: UDP over IP
+ * @G_SOCKET_PROTOCOL_SCTP: SCTP over IP
+ *
+ * A protocol identifier is specified when creating a #GSocket, which is a
+ * family/type specific identifier, where 0 means the default protocol for
+ * the particular family/type.
+ *
+ * This enum contains a set of commonly available and used protocols. You
+ * can also pass any other identifiers handled by the platform in order to
+ * use protocols not listed here.
+ *
+ * Since: 2.22
+ */
+typedef enum {
+ G_SOCKET_PROTOCOL_UNKNOWN = -1,
+ G_SOCKET_PROTOCOL_DEFAULT = 0,
+ G_SOCKET_PROTOCOL_TCP = 6,
+ G_SOCKET_PROTOCOL_UDP = 17,
+ G_SOCKET_PROTOCOL_SCTP = 132
+} GSocketProtocol;
+
+/**
+ * GZlibCompressorFormat:
+ * @G_ZLIB_COMPRESSOR_FORMAT_ZLIB: deflate compression with zlib header
+ * @G_ZLIB_COMPRESSOR_FORMAT_GZIP: gzip file format
+ * @G_ZLIB_COMPRESSOR_FORMAT_RAW: deflate compression with no header
+ *
+ * Used to select the type of data format to use for #GZlibDecompressor
+ * and #GZlibCompressor.
+ *
+ * Since: 2.24
+ */
+typedef enum {
+ G_ZLIB_COMPRESSOR_FORMAT_ZLIB,
+ G_ZLIB_COMPRESSOR_FORMAT_GZIP,
+ G_ZLIB_COMPRESSOR_FORMAT_RAW
+} GZlibCompressorFormat;
+
+/**
+ * GUnixSocketAddressType:
+ * @G_UNIX_SOCKET_ADDRESS_INVALID: invalid
+ * @G_UNIX_SOCKET_ADDRESS_ANONYMOUS: anonymous
+ * @G_UNIX_SOCKET_ADDRESS_PATH: a filesystem path
+ * @G_UNIX_SOCKET_ADDRESS_ABSTRACT: an abstract name
+ * @G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED: an abstract name, 0-padded
+ * to the full length of a unix socket name
+ *
+ * The type of name used by a #GUnixSocketAddress.
+ * %G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain
+ * socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS
+ * indicates a socket not bound to any name (eg, a client-side socket,
+ * or a socket created with socketpair()).
+ *
+ * For abstract sockets, there are two incompatible ways of naming
+ * them; the man pages suggest using the entire `struct sockaddr_un`
+ * as the name, padding the unused parts of the %sun_path field with
+ * zeroes; this corresponds to %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED.
+ * However, many programs instead just use a portion of %sun_path, and
+ * pass an appropriate smaller length to bind() or connect(). This is
+ * %G_UNIX_SOCKET_ADDRESS_ABSTRACT.
+ *
+ * Since: 2.26
+ */
+typedef enum {
+ G_UNIX_SOCKET_ADDRESS_INVALID,
+ G_UNIX_SOCKET_ADDRESS_ANONYMOUS,
+ G_UNIX_SOCKET_ADDRESS_PATH,
+ G_UNIX_SOCKET_ADDRESS_ABSTRACT,
+ G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
+} GUnixSocketAddressType;
+
+/**
+ * GBusType:
+ * @G_BUS_TYPE_STARTER: An alias for the message bus that activated the process, if any.
+ * @G_BUS_TYPE_NONE: Not a message bus.
+ * @G_BUS_TYPE_SYSTEM: The system-wide message bus.
+ * @G_BUS_TYPE_SESSION: The login session message bus.
+ *
+ * An enumeration for well-known message buses.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_BUS_TYPE_STARTER = -1,
+ G_BUS_TYPE_NONE = 0,
+ G_BUS_TYPE_SYSTEM = 1,
+ G_BUS_TYPE_SESSION = 2
+} GBusType;
+
+/**
+ * GBusNameOwnerFlags:
+ * @G_BUS_NAME_OWNER_FLAGS_NONE: No flags set.
+ * @G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT: Allow another message bus connection to claim the name.
+ * @G_BUS_NAME_OWNER_FLAGS_REPLACE: If another message bus connection owns the name and have
+ * specified #G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection.
+ * @G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE: If another message bus connection owns the name, immediately
+ * return an error from g_bus_own_name() rather than entering the waiting queue for that name. (Since 2.54)
+ *
+ * Flags used in g_bus_own_name().
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_BUS_NAME_OWNER_FLAGS_NONE = 0, /*< nick=none >*/
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT = (1<<0), /*< nick=allow-replacement >*/
+ G_BUS_NAME_OWNER_FLAGS_REPLACE = (1<<1), /*< nick=replace >*/
+ G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE = (1<<2) /*< nick=do-not-queue >*/
+} GBusNameOwnerFlags;
+/* When adding new flags, their numeric values must currently match those
+ * used in the D-Bus Specification. */
+
+/**
+ * GBusNameWatcherFlags:
+ * @G_BUS_NAME_WATCHER_FLAGS_NONE: No flags set.
+ * @G_BUS_NAME_WATCHER_FLAGS_AUTO_START: If no-one owns the name when
+ * beginning to watch the name, ask the bus to launch an owner for the
+ * name.
+ *
+ * Flags used in g_bus_watch_name().
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_BUS_NAME_WATCHER_FLAGS_NONE = 0,
+ G_BUS_NAME_WATCHER_FLAGS_AUTO_START = (1<<0)
+} GBusNameWatcherFlags;
+
+/**
+ * GDBusProxyFlags:
+ * @G_DBUS_PROXY_FLAGS_NONE: No flags set.
+ * @G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES: Don't load properties.
+ * @G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS: Don't connect to signals on the remote object.
+ * @G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START: If the proxy is for a well-known name,
+ * do not ask the bus to launch an owner during proxy initialization or a method call.
+ * This flag is only meaningful in proxies for well-known names.
+ * @G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES: If set, the property value for any __invalidated property__ will be (asynchronously) retrieved upon receiving the [`PropertiesChanged`](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties) D-Bus signal and the property will not cause emission of the #GDBusProxy::g-properties-changed signal. When the value is received the #GDBusProxy::g-properties-changed signal is emitted for the property along with the retrieved value. Since 2.32.
+ * @G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION: If the proxy is for a well-known name,
+ * do not ask the bus to launch an owner during proxy initialization, but allow it to be
+ * autostarted by a method call. This flag is only meaningful in proxies for well-known names,
+ * and only if %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is not also specified.
+ *
+ * Flags used when constructing an instance of a #GDBusProxy derived class.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_DBUS_PROXY_FLAGS_NONE = 0,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES = (1<<0),
+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS = (1<<1),
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START = (1<<2),
+ G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES = (1<<3),
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION = (1<<4)
+} GDBusProxyFlags;
+
+/**
+ * GDBusError:
+ * @G_DBUS_ERROR_FAILED:
+ * A generic error; "something went wrong" - see the error message for
+ * more.
+ * @G_DBUS_ERROR_NO_MEMORY:
+ * There was not enough memory to complete an operation.
+ * @G_DBUS_ERROR_SERVICE_UNKNOWN:
+ * The bus doesn't know how to launch a service to supply the bus name
+ * you wanted.
+ * @G_DBUS_ERROR_NAME_HAS_NO_OWNER:
+ * The bus name you referenced doesn't exist (i.e. no application owns
+ * it).
+ * @G_DBUS_ERROR_NO_REPLY:
+ * No reply to a message expecting one, usually means a timeout occurred.
+ * @G_DBUS_ERROR_IO_ERROR:
+ * Something went wrong reading or writing to a socket, for example.
+ * @G_DBUS_ERROR_BAD_ADDRESS:
+ * A D-Bus bus address was malformed.
+ * @G_DBUS_ERROR_NOT_SUPPORTED:
+ * Requested operation isn't supported (like ENOSYS on UNIX).
+ * @G_DBUS_ERROR_LIMITS_EXCEEDED:
+ * Some limited resource is exhausted.
+ * @G_DBUS_ERROR_ACCESS_DENIED:
+ * Security restrictions don't allow doing what you're trying to do.
+ * @G_DBUS_ERROR_AUTH_FAILED:
+ * Authentication didn't work.
+ * @G_DBUS_ERROR_NO_SERVER:
+ * Unable to connect to server (probably caused by ECONNREFUSED on a
+ * socket).
+ * @G_DBUS_ERROR_TIMEOUT:
+ * Certain timeout errors, possibly ETIMEDOUT on a socket. Note that
+ * %G_DBUS_ERROR_NO_REPLY is used for message reply timeouts. Warning:
+ * this is confusingly-named given that %G_DBUS_ERROR_TIMED_OUT also
+ * exists. We can't fix it for compatibility reasons so just be
+ * careful.
+ * @G_DBUS_ERROR_NO_NETWORK:
+ * No network access (probably ENETUNREACH on a socket).
+ * @G_DBUS_ERROR_ADDRESS_IN_USE:
+ * Can't bind a socket since its address is in use (i.e. EADDRINUSE).
+ * @G_DBUS_ERROR_DISCONNECTED:
+ * The connection is disconnected and you're trying to use it.
+ * @G_DBUS_ERROR_INVALID_ARGS:
+ * Invalid arguments passed to a method call.
+ * @G_DBUS_ERROR_FILE_NOT_FOUND:
+ * Missing file.
+ * @G_DBUS_ERROR_FILE_EXISTS:
+ * Existing file and the operation you're using does not silently overwrite.
+ * @G_DBUS_ERROR_UNKNOWN_METHOD:
+ * Method name you invoked isn't known by the object you invoked it on.
+ * @G_DBUS_ERROR_UNKNOWN_OBJECT:
+ * Object you invoked a method on isn't known. Since 2.42
+ * @G_DBUS_ERROR_UNKNOWN_INTERFACE:
+ * Interface you invoked a method on isn't known by the object. Since 2.42
+ * @G_DBUS_ERROR_UNKNOWN_PROPERTY:
+ * Property you tried to access isn't known by the object. Since 2.42
+ * @G_DBUS_ERROR_PROPERTY_READ_ONLY:
+ * Property you tried to set is read-only. Since 2.42
+ * @G_DBUS_ERROR_TIMED_OUT:
+ * Certain timeout errors, e.g. while starting a service. Warning: this is
+ * confusingly-named given that %G_DBUS_ERROR_TIMEOUT also exists. We
+ * can't fix it for compatibility reasons so just be careful.
+ * @G_DBUS_ERROR_MATCH_RULE_NOT_FOUND:
+ * Tried to remove or modify a match rule that didn't exist.
+ * @G_DBUS_ERROR_MATCH_RULE_INVALID:
+ * The match rule isn't syntactically valid.
+ * @G_DBUS_ERROR_SPAWN_EXEC_FAILED:
+ * While starting a new process, the exec() call failed.
+ * @G_DBUS_ERROR_SPAWN_FORK_FAILED:
+ * While starting a new process, the fork() call failed.
+ * @G_DBUS_ERROR_SPAWN_CHILD_EXITED:
+ * While starting a new process, the child exited with a status code.
+ * @G_DBUS_ERROR_SPAWN_CHILD_SIGNALED:
+ * While starting a new process, the child exited on a signal.
+ * @G_DBUS_ERROR_SPAWN_FAILED:
+ * While starting a new process, something went wrong.
+ * @G_DBUS_ERROR_SPAWN_SETUP_FAILED:
+ * We failed to setup the environment correctly.
+ * @G_DBUS_ERROR_SPAWN_CONFIG_INVALID:
+ * We failed to setup the config parser correctly.
+ * @G_DBUS_ERROR_SPAWN_SERVICE_INVALID:
+ * Bus name was not valid.
+ * @G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND:
+ * Service file not found in system-services directory.
+ * @G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID:
+ * Permissions are incorrect on the setuid helper.
+ * @G_DBUS_ERROR_SPAWN_FILE_INVALID:
+ * Service file invalid (Name, User or Exec missing).
+ * @G_DBUS_ERROR_SPAWN_NO_MEMORY:
+ * Tried to get a UNIX process ID and it wasn't available.
+ * @G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN:
+ * Tried to get a UNIX process ID and it wasn't available.
+ * @G_DBUS_ERROR_INVALID_SIGNATURE:
+ * A type signature is not valid.
+ * @G_DBUS_ERROR_INVALID_FILE_CONTENT:
+ * A file contains invalid syntax or is otherwise broken.
+ * @G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN:
+ * Asked for SELinux security context and it wasn't available.
+ * @G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN:
+ * Asked for ADT audit data and it wasn't available.
+ * @G_DBUS_ERROR_OBJECT_PATH_IN_USE:
+ * There's already an object with the requested object path.
+ *
+ * Error codes for the %G_DBUS_ERROR error domain.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ /* Well-known errors in the org.freedesktop.DBus.Error namespace */
+ G_DBUS_ERROR_FAILED, /* org.freedesktop.DBus.Error.Failed */
+ G_DBUS_ERROR_NO_MEMORY, /* org.freedesktop.DBus.Error.NoMemory */
+ G_DBUS_ERROR_SERVICE_UNKNOWN, /* org.freedesktop.DBus.Error.ServiceUnknown */
+ G_DBUS_ERROR_NAME_HAS_NO_OWNER, /* org.freedesktop.DBus.Error.NameHasNoOwner */
+ G_DBUS_ERROR_NO_REPLY, /* org.freedesktop.DBus.Error.NoReply */
+ G_DBUS_ERROR_IO_ERROR, /* org.freedesktop.DBus.Error.IOError */
+ G_DBUS_ERROR_BAD_ADDRESS, /* org.freedesktop.DBus.Error.BadAddress */
+ G_DBUS_ERROR_NOT_SUPPORTED, /* org.freedesktop.DBus.Error.NotSupported */
+ G_DBUS_ERROR_LIMITS_EXCEEDED, /* org.freedesktop.DBus.Error.LimitsExceeded */
+ G_DBUS_ERROR_ACCESS_DENIED, /* org.freedesktop.DBus.Error.AccessDenied */
+ G_DBUS_ERROR_AUTH_FAILED, /* org.freedesktop.DBus.Error.AuthFailed */
+ G_DBUS_ERROR_NO_SERVER, /* org.freedesktop.DBus.Error.NoServer */
+ G_DBUS_ERROR_TIMEOUT, /* org.freedesktop.DBus.Error.Timeout */
+ G_DBUS_ERROR_NO_NETWORK, /* org.freedesktop.DBus.Error.NoNetwork */
+ G_DBUS_ERROR_ADDRESS_IN_USE, /* org.freedesktop.DBus.Error.AddressInUse */
+ G_DBUS_ERROR_DISCONNECTED, /* org.freedesktop.DBus.Error.Disconnected */
+ G_DBUS_ERROR_INVALID_ARGS, /* org.freedesktop.DBus.Error.InvalidArgs */
+ G_DBUS_ERROR_FILE_NOT_FOUND, /* org.freedesktop.DBus.Error.FileNotFound */
+ G_DBUS_ERROR_FILE_EXISTS, /* org.freedesktop.DBus.Error.FileExists */
+ G_DBUS_ERROR_UNKNOWN_METHOD, /* org.freedesktop.DBus.Error.UnknownMethod */
+ G_DBUS_ERROR_TIMED_OUT, /* org.freedesktop.DBus.Error.TimedOut */
+ G_DBUS_ERROR_MATCH_RULE_NOT_FOUND, /* org.freedesktop.DBus.Error.MatchRuleNotFound */
+ G_DBUS_ERROR_MATCH_RULE_INVALID, /* org.freedesktop.DBus.Error.MatchRuleInvalid */
+ G_DBUS_ERROR_SPAWN_EXEC_FAILED, /* org.freedesktop.DBus.Error.Spawn.ExecFailed */
+ G_DBUS_ERROR_SPAWN_FORK_FAILED, /* org.freedesktop.DBus.Error.Spawn.ForkFailed */
+ G_DBUS_ERROR_SPAWN_CHILD_EXITED, /* org.freedesktop.DBus.Error.Spawn.ChildExited */
+ G_DBUS_ERROR_SPAWN_CHILD_SIGNALED, /* org.freedesktop.DBus.Error.Spawn.ChildSignaled */
+ G_DBUS_ERROR_SPAWN_FAILED, /* org.freedesktop.DBus.Error.Spawn.Failed */
+ G_DBUS_ERROR_SPAWN_SETUP_FAILED, /* org.freedesktop.DBus.Error.Spawn.FailedToSetup */
+ G_DBUS_ERROR_SPAWN_CONFIG_INVALID, /* org.freedesktop.DBus.Error.Spawn.ConfigInvalid */
+ G_DBUS_ERROR_SPAWN_SERVICE_INVALID, /* org.freedesktop.DBus.Error.Spawn.ServiceNotValid */
+ G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND, /* org.freedesktop.DBus.Error.Spawn.ServiceNotFound */
+ G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID, /* org.freedesktop.DBus.Error.Spawn.PermissionsInvalid */
+ G_DBUS_ERROR_SPAWN_FILE_INVALID, /* org.freedesktop.DBus.Error.Spawn.FileInvalid */
+ G_DBUS_ERROR_SPAWN_NO_MEMORY, /* org.freedesktop.DBus.Error.Spawn.NoMemory */
+ G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN, /* org.freedesktop.DBus.Error.UnixProcessIdUnknown */
+ G_DBUS_ERROR_INVALID_SIGNATURE, /* org.freedesktop.DBus.Error.InvalidSignature */
+ G_DBUS_ERROR_INVALID_FILE_CONTENT, /* org.freedesktop.DBus.Error.InvalidFileContent */
+ G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, /* org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown */
+ G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN, /* org.freedesktop.DBus.Error.AdtAuditDataUnknown */
+ G_DBUS_ERROR_OBJECT_PATH_IN_USE, /* org.freedesktop.DBus.Error.ObjectPathInUse */
+ G_DBUS_ERROR_UNKNOWN_OBJECT, /* org.freedesktop.DBus.Error.UnknownObject */
+ G_DBUS_ERROR_UNKNOWN_INTERFACE, /* org.freedesktop.DBus.Error.UnknownInterface */
+ G_DBUS_ERROR_UNKNOWN_PROPERTY, /* org.freedesktop.DBus.Error.UnknownProperty */
+ G_DBUS_ERROR_PROPERTY_READ_ONLY /* org.freedesktop.DBus.Error.PropertyReadOnly */
+} GDBusError;
+/* Remember to update g_dbus_error_quark() in gdbuserror.c if you extend this enumeration */
+
+/**
+ * GDBusConnectionFlags:
+ * @G_DBUS_CONNECTION_FLAGS_NONE: No flags set.
+ * @G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT: Perform authentication against server.
+ * @G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER: Perform authentication against client.
+ * @G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS: When
+ * authenticating as a server, allow the anonymous authentication
+ * method.
+ * @G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION: Pass this flag if connecting to a peer that is a
+ * message bus. This means that the Hello() method will be invoked as part of the connection setup.
+ * @G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING: If set, processing of D-Bus messages is
+ * delayed until g_dbus_connection_start_message_processing() is called.
+ *
+ * Flags used when creating a new #GDBusConnection.
+ *
+ * Since: 2.26
+ */
+typedef enum {
+ G_DBUS_CONNECTION_FLAGS_NONE = 0,
+ G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT = (1<<0),
+ G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER = (1<<1),
+ G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS = (1<<2),
+ G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION = (1<<3),
+ G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING = (1<<4)
+} GDBusConnectionFlags;
+
+/**
+ * GDBusCapabilityFlags:
+ * @G_DBUS_CAPABILITY_FLAGS_NONE: No flags set.
+ * @G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING: The connection
+ * supports exchanging UNIX file descriptors with the remote peer.
+ *
+ * Capabilities negotiated with the remote peer.
+ *
+ * Since: 2.26
+ */
+typedef enum {
+ G_DBUS_CAPABILITY_FLAGS_NONE = 0,
+ G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING = (1<<0)
+} GDBusCapabilityFlags;
+
+/**
+ * GDBusCallFlags:
+ * @G_DBUS_CALL_FLAGS_NONE: No flags set.
+ * @G_DBUS_CALL_FLAGS_NO_AUTO_START: The bus must not launch
+ * an owner for the destination name in response to this method
+ * invocation.
+ * @G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION: the caller is prepared to
+ * wait for interactive authorization. Since 2.46.
+ *
+ * Flags used in g_dbus_connection_call() and similar APIs.
+ *
+ * Since: 2.26
+ */
+typedef enum {
+ G_DBUS_CALL_FLAGS_NONE = 0,
+ G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0),
+ G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION = (1<<1)
+} GDBusCallFlags;
+/* (1<<31) is reserved for internal use by GDBusConnection, do not use it. */
+
+/**
+ * GDBusMessageType:
+ * @G_DBUS_MESSAGE_TYPE_INVALID: Message is of invalid type.
+ * @G_DBUS_MESSAGE_TYPE_METHOD_CALL: Method call.
+ * @G_DBUS_MESSAGE_TYPE_METHOD_RETURN: Method reply.
+ * @G_DBUS_MESSAGE_TYPE_ERROR: Error reply.
+ * @G_DBUS_MESSAGE_TYPE_SIGNAL: Signal emission.
+ *
+ * Message types used in #GDBusMessage.
+ *
+ * Since: 2.26
+ */
+typedef enum {
+ G_DBUS_MESSAGE_TYPE_INVALID,
+ G_DBUS_MESSAGE_TYPE_METHOD_CALL,
+ G_DBUS_MESSAGE_TYPE_METHOD_RETURN,
+ G_DBUS_MESSAGE_TYPE_ERROR,
+ G_DBUS_MESSAGE_TYPE_SIGNAL
+} GDBusMessageType;
+
+/**
+ * GDBusMessageFlags:
+ * @G_DBUS_MESSAGE_FLAGS_NONE: No flags set.
+ * @G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED: A reply is not expected.
+ * @G_DBUS_MESSAGE_FLAGS_NO_AUTO_START: The bus must not launch an
+ * owner for the destination name in response to this message.
+ * @G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION: If set on a method
+ * call, this flag means that the caller is prepared to wait for interactive
+ * authorization. Since 2.46.
+ *
+ * Message flags used in #GDBusMessage.
+ *
+ * Since: 2.26
+ */
+typedef enum {
+ G_DBUS_MESSAGE_FLAGS_NONE = 0,
+ G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED = (1<<0),
+ G_DBUS_MESSAGE_FLAGS_NO_AUTO_START = (1<<1),
+ G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION = (1<<2)
+} GDBusMessageFlags;
+
+/**
+ * GDBusMessageHeaderField:
+ * @G_DBUS_MESSAGE_HEADER_FIELD_INVALID: Not a valid header field.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_PATH: The object path.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE: The interface name.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_MEMBER: The method or signal name.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME: The name of the error that occurred.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL: The serial number the message is a reply to.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION: The name the message is intended for.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_SENDER: Unique name of the sender of the message (filled in by the bus).
+ * @G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE: The signature of the message body.
+ * @G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS: The number of UNIX file descriptors that accompany the message.
+ *
+ * Header fields used in #GDBusMessage.
+ *
+ * Since: 2.26
+ */
+typedef enum {
+ G_DBUS_MESSAGE_HEADER_FIELD_INVALID,
+ G_DBUS_MESSAGE_HEADER_FIELD_PATH,
+ G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE,
+ G_DBUS_MESSAGE_HEADER_FIELD_MEMBER,
+ G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME,
+ G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL,
+ G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION,
+ G_DBUS_MESSAGE_HEADER_FIELD_SENDER,
+ G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE,
+ G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS
+} GDBusMessageHeaderField;
+
+/**
+ * GDBusPropertyInfoFlags:
+ * @G_DBUS_PROPERTY_INFO_FLAGS_NONE: No flags set.
+ * @G_DBUS_PROPERTY_INFO_FLAGS_READABLE: Property is readable.
+ * @G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE: Property is writable.
+ *
+ * Flags describing the access control of a D-Bus property.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_DBUS_PROPERTY_INFO_FLAGS_NONE = 0,
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE = (1<<0),
+ G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE = (1<<1)
+} GDBusPropertyInfoFlags;
+
+/**
+ * GDBusSubtreeFlags:
+ * @G_DBUS_SUBTREE_FLAGS_NONE: No flags set.
+ * @G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES: Method calls to objects not in the enumerated range
+ * will still be dispatched. This is useful if you want
+ * to dynamically spawn objects in the subtree.
+ *
+ * Flags passed to g_dbus_connection_register_subtree().
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_DBUS_SUBTREE_FLAGS_NONE = 0,
+ G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES = (1<<0)
+} GDBusSubtreeFlags;
+
+/**
+ * GDBusServerFlags:
+ * @G_DBUS_SERVER_FLAGS_NONE: No flags set.
+ * @G_DBUS_SERVER_FLAGS_RUN_IN_THREAD: All #GDBusServer::new-connection
+ * signals will run in separated dedicated threads (see signal for
+ * details).
+ * @G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS: Allow the anonymous
+ * authentication method.
+ *
+ * Flags used when creating a #GDBusServer.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_DBUS_SERVER_FLAGS_NONE = 0,
+ G_DBUS_SERVER_FLAGS_RUN_IN_THREAD = (1<<0),
+ G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS = (1<<1)
+} GDBusServerFlags;
+
+/**
+ * GDBusSignalFlags:
+ * @G_DBUS_SIGNAL_FLAGS_NONE: No flags set.
+ * @G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE: Don't actually send the AddMatch
+ * D-Bus call for this signal subscription. This gives you more control
+ * over which match rules you add (but you must add them manually).
+ * @G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE: Match first arguments that
+ * contain a bus or interface name with the given namespace.
+ * @G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH: Match first arguments that
+ * contain an object path that is either equivalent to the given path,
+ * or one of the paths is a subpath of the other.
+ *
+ * Flags used when subscribing to signals via g_dbus_connection_signal_subscribe().
+ *
+ * Since: 2.26
+ */
+typedef enum /*< flags >*/
+{
+ G_DBUS_SIGNAL_FLAGS_NONE = 0,
+ G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE = (1<<0),
+ G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE = (1<<1),
+ G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH = (1<<2)
+} GDBusSignalFlags;
+
+/**
+ * GDBusSendMessageFlags:
+ * @G_DBUS_SEND_MESSAGE_FLAGS_NONE: No flags set.
+ * @G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL: Do not automatically
+ * assign a serial number from the #GDBusConnection object when
+ * sending a message.
+ *
+ * Flags used when sending #GDBusMessages on a #GDBusConnection.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_DBUS_SEND_MESSAGE_FLAGS_NONE = 0,
+ G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL = (1<<0)
+} GDBusSendMessageFlags;
+/* (1<<31) is reserved for internal use by GDBusConnection, do not use it. */
+
+/**
+ * GCredentialsType:
+ * @G_CREDENTIALS_TYPE_INVALID: Indicates an invalid native credential type.
+ * @G_CREDENTIALS_TYPE_LINUX_UCRED: The native credentials type is a struct ucred.
+ * @G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED: The native credentials type is a struct cmsgcred.
+ * @G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED: The native credentials type is a struct sockpeercred. Added in 2.30.
+ * @G_CREDENTIALS_TYPE_SOLARIS_UCRED: The native credentials type is a ucred_t. Added in 2.40.
+ * @G_CREDENTIALS_TYPE_NETBSD_UNPCBID: The native credentials type is a struct unpcbid.
+ *
+ * Enumeration describing different kinds of native credential types.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_CREDENTIALS_TYPE_INVALID,
+ G_CREDENTIALS_TYPE_LINUX_UCRED,
+ G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED,
+ G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED,
+ G_CREDENTIALS_TYPE_SOLARIS_UCRED,
+ G_CREDENTIALS_TYPE_NETBSD_UNPCBID
+} GCredentialsType;
+
+/**
+ * GDBusMessageByteOrder:
+ * @G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN: The byte order is big endian.
+ * @G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN: The byte order is little endian.
+ *
+ * Enumeration used to describe the byte order of a D-Bus message.
+ *
+ * Since: 2.26
+ */
+typedef enum
+{
+ G_DBUS_MESSAGE_BYTE_ORDER_BIG_ENDIAN = 'B',
+ G_DBUS_MESSAGE_BYTE_ORDER_LITTLE_ENDIAN = 'l'
+} GDBusMessageByteOrder;
+
+/**
+ * GApplicationFlags:
+ * @G_APPLICATION_FLAGS_NONE: Default
+ * @G_APPLICATION_IS_SERVICE: Run as a service. In this mode, registration
+ * fails if the service is already running, and the application
+ * will initially wait up to 10 seconds for an initial activation
+ * message to arrive.
+ * @G_APPLICATION_IS_LAUNCHER: Don't try to become the primary instance.
+ * @G_APPLICATION_HANDLES_OPEN: This application handles opening files (in
+ * the primary instance). Note that this flag only affects the default
+ * implementation of local_command_line(), and has no effect if
+ * %G_APPLICATION_HANDLES_COMMAND_LINE is given.
+ * See g_application_run() for details.
+ * @G_APPLICATION_HANDLES_COMMAND_LINE: This application handles command line
+ * arguments (in the primary instance). Note that this flag only affect
+ * the default implementation of local_command_line().
+ * See g_application_run() for details.
+ * @G_APPLICATION_SEND_ENVIRONMENT: Send the environment of the
+ * launching process to the primary instance. Set this flag if your
+ * application is expected to behave differently depending on certain
+ * environment variables. For instance, an editor might be expected
+ * to use the `GIT_COMMITTER_NAME` environment variable
+ * when editing a git commit message. The environment is available
+ * to the #GApplication::command-line signal handler, via
+ * g_application_command_line_getenv().
+ * @G_APPLICATION_NON_UNIQUE: Make no attempts to do any of the typical
+ * single-instance application negotiation, even if the application
+ * ID is given. The application neither attempts to become the
+ * owner of the application ID nor does it check if an existing
+ * owner already exists. Everything occurs in the local process.
+ * Since: 2.30.
+ * @G_APPLICATION_CAN_OVERRIDE_APP_ID: Allow users to override the
+ * application ID from the command line with `--gapplication-app-id`.
+ * Since: 2.48
+ * @G_APPLICATION_ALLOW_REPLACEMENT: Allow another instance to take over
+ * the bus name. Since: 2.60
+ * @G_APPLICATION_REPLACE: Take over from another instance. This flag is
+ * usually set by passing `--gapplication-replace` on the commandline.
+ * Since: 2.60
+ *
+ * Flags used to define the behaviour of a #GApplication.
+ *
+ * Since: 2.28
+ **/
+typedef enum
+{
+ G_APPLICATION_FLAGS_NONE,
+ G_APPLICATION_IS_SERVICE = (1 << 0),
+ G_APPLICATION_IS_LAUNCHER = (1 << 1),
+
+ G_APPLICATION_HANDLES_OPEN = (1 << 2),
+ G_APPLICATION_HANDLES_COMMAND_LINE = (1 << 3),
+ G_APPLICATION_SEND_ENVIRONMENT = (1 << 4),
+
+ G_APPLICATION_NON_UNIQUE = (1 << 5),
+
+ G_APPLICATION_CAN_OVERRIDE_APP_ID = (1 << 6),
+ G_APPLICATION_ALLOW_REPLACEMENT = (1 << 7),
+ G_APPLICATION_REPLACE = (1 << 8)
+} GApplicationFlags;
+
+/**
+ * GTlsError:
+ * @G_TLS_ERROR_UNAVAILABLE: No TLS provider is available
+ * @G_TLS_ERROR_MISC: Miscellaneous TLS error
+ * @G_TLS_ERROR_BAD_CERTIFICATE: The certificate presented could not
+ * be parsed or failed validation.
+ * @G_TLS_ERROR_NOT_TLS: The TLS handshake failed because the
+ * peer does not seem to be a TLS server.
+ * @G_TLS_ERROR_HANDSHAKE: The TLS handshake failed because the
+ * peer's certificate was not acceptable.
+ * @G_TLS_ERROR_CERTIFICATE_REQUIRED: The TLS handshake failed because
+ * the server requested a client-side certificate, but none was
+ * provided. See g_tls_connection_set_certificate().
+ * @G_TLS_ERROR_EOF: The TLS connection was closed without proper
+ * notice, which may indicate an attack. See
+ * g_tls_connection_set_require_close_notify().
+ * @G_TLS_ERROR_INAPPROPRIATE_FALLBACK: The TLS handshake failed
+ * because the client sent the fallback SCSV, indicating a protocol
+ * downgrade attack. Since: 2.60
+ *
+ * An error code used with %G_TLS_ERROR in a #GError returned from a
+ * TLS-related routine.
+ *
+ * Since: 2.28
+ */
+typedef enum {
+ G_TLS_ERROR_UNAVAILABLE,
+ G_TLS_ERROR_MISC,
+ G_TLS_ERROR_BAD_CERTIFICATE,
+ G_TLS_ERROR_NOT_TLS,
+ G_TLS_ERROR_HANDSHAKE,
+ G_TLS_ERROR_CERTIFICATE_REQUIRED,
+ G_TLS_ERROR_EOF,
+ G_TLS_ERROR_INAPPROPRIATE_FALLBACK
+} GTlsError;
+
+/**
+ * GTlsCertificateFlags:
+ * @G_TLS_CERTIFICATE_UNKNOWN_CA: The signing certificate authority is
+ * not known.
+ * @G_TLS_CERTIFICATE_BAD_IDENTITY: The certificate does not match the
+ * expected identity of the site that it was retrieved from.
+ * @G_TLS_CERTIFICATE_NOT_ACTIVATED: The certificate's activation time
+ * is still in the future
+ * @G_TLS_CERTIFICATE_EXPIRED: The certificate has expired
+ * @G_TLS_CERTIFICATE_REVOKED: The certificate has been revoked
+ * according to the #GTlsConnection's certificate revocation list.
+ * @G_TLS_CERTIFICATE_INSECURE: The certificate's algorithm is
+ * considered insecure.
+ * @G_TLS_CERTIFICATE_GENERIC_ERROR: Some other error occurred validating
+ * the certificate
+ * @G_TLS_CERTIFICATE_VALIDATE_ALL: the combination of all of the above
+ * flags
+ *
+ * A set of flags describing TLS certification validation. This can be
+ * used to set which validation steps to perform (eg, with
+ * g_tls_client_connection_set_validation_flags()), or to describe why
+ * a particular certificate was rejected (eg, in
+ * #GTlsConnection::accept-certificate).
+ *
+ * Since: 2.28
+ */
+typedef enum {
+ G_TLS_CERTIFICATE_UNKNOWN_CA = (1 << 0),
+ G_TLS_CERTIFICATE_BAD_IDENTITY = (1 << 1),
+ G_TLS_CERTIFICATE_NOT_ACTIVATED = (1 << 2),
+ G_TLS_CERTIFICATE_EXPIRED = (1 << 3),
+ G_TLS_CERTIFICATE_REVOKED = (1 << 4),
+ G_TLS_CERTIFICATE_INSECURE = (1 << 5),
+ G_TLS_CERTIFICATE_GENERIC_ERROR = (1 << 6),
+
+ G_TLS_CERTIFICATE_VALIDATE_ALL = 0x007f
+} GTlsCertificateFlags;
+
+/**
+ * GTlsAuthenticationMode:
+ * @G_TLS_AUTHENTICATION_NONE: client authentication not required
+ * @G_TLS_AUTHENTICATION_REQUESTED: client authentication is requested
+ * @G_TLS_AUTHENTICATION_REQUIRED: client authentication is required
+ *
+ * The client authentication mode for a #GTlsServerConnection.
+ *
+ * Since: 2.28
+ */
+typedef enum {
+ G_TLS_AUTHENTICATION_NONE,
+ G_TLS_AUTHENTICATION_REQUESTED,
+ G_TLS_AUTHENTICATION_REQUIRED
+} GTlsAuthenticationMode;
+
+/**
+ * GTlsRehandshakeMode:
+ * @G_TLS_REHANDSHAKE_NEVER: Never allow rehandshaking
+ * @G_TLS_REHANDSHAKE_SAFELY: Allow safe rehandshaking only
+ * @G_TLS_REHANDSHAKE_UNSAFELY: Allow unsafe rehandshaking
+ *
+ * When to allow rehandshaking. See
+ * g_tls_connection_set_rehandshake_mode().
+ *
+ * Since: 2.28
+ *
+ * Deprecated: 2.60. Changing the rehandshake mode is no longer
+ * required for compatibility. Also, rehandshaking has been removed
+ * from the TLS protocol in TLS 1.3.
+ */
+typedef enum {
+ G_TLS_REHANDSHAKE_NEVER,
+ G_TLS_REHANDSHAKE_SAFELY,
+ G_TLS_REHANDSHAKE_UNSAFELY
+} GTlsRehandshakeMode GLIB_DEPRECATED_TYPE_IN_2_60;
+
+/**
+ * GTlsPasswordFlags:
+ * @G_TLS_PASSWORD_NONE: No flags
+ * @G_TLS_PASSWORD_RETRY: The password was wrong, and the user should retry.
+ * @G_TLS_PASSWORD_MANY_TRIES: Hint to the user that the password has been
+ * wrong many times, and the user may not have many chances left.
+ * @G_TLS_PASSWORD_FINAL_TRY: Hint to the user that this is the last try to get
+ * this password right.
+ *
+ * Various flags for the password.
+ *
+ * Since: 2.30
+ */
+
+typedef enum _GTlsPasswordFlags
+{
+ G_TLS_PASSWORD_NONE = 0,
+ G_TLS_PASSWORD_RETRY = 1 << 1,
+ G_TLS_PASSWORD_MANY_TRIES = 1 << 2,
+ G_TLS_PASSWORD_FINAL_TRY = 1 << 3
+} GTlsPasswordFlags;
+
+/**
+ * GTlsInteractionResult:
+ * @G_TLS_INTERACTION_UNHANDLED: The interaction was unhandled (i.e. not
+ * implemented).
+ * @G_TLS_INTERACTION_HANDLED: The interaction completed, and resulting data
+ * is available.
+ * @G_TLS_INTERACTION_FAILED: The interaction has failed, or was cancelled.
+ * and the operation should be aborted.
+ *
+ * #GTlsInteractionResult is returned by various functions in #GTlsInteraction
+ * when finishing an interaction request.
+ *
+ * Since: 2.30
+ */
+typedef enum {
+ G_TLS_INTERACTION_UNHANDLED,
+ G_TLS_INTERACTION_HANDLED,
+ G_TLS_INTERACTION_FAILED
+} GTlsInteractionResult;
+
+/**
+ * GDBusInterfaceSkeletonFlags:
+ * @G_DBUS_INTERFACE_SKELETON_FLAGS_NONE: No flags set.
+ * @G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD: Each method invocation is handled in
+ * a thread dedicated to the invocation. This means that the method implementation can use blocking IO
+ * without blocking any other part of the process. It also means that the method implementation must
+ * use locking to access data structures used by other threads.
+ *
+ * Flags describing the behavior of a #GDBusInterfaceSkeleton instance.
+ *
+ * Since: 2.30
+ */
+typedef enum
+{
+ G_DBUS_INTERFACE_SKELETON_FLAGS_NONE = 0,
+ G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD = (1<<0)
+} GDBusInterfaceSkeletonFlags;
+
+/**
+ * GDBusObjectManagerClientFlags:
+ * @G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE: No flags set.
+ * @G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START: If not set and the
+ * manager is for a well-known name, then request the bus to launch
+ * an owner for the name if no-one owns the name. This flag can only
+ * be used in managers for well-known names.
+ *
+ * Flags used when constructing a #GDBusObjectManagerClient.
+ *
+ * Since: 2.30
+ */
+typedef enum
+{
+ G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE = 0,
+ G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START = (1<<0)
+} GDBusObjectManagerClientFlags;
+
+/**
+ * GTlsDatabaseVerifyFlags:
+ * @G_TLS_DATABASE_VERIFY_NONE: No verification flags
+ *
+ * Flags for g_tls_database_verify_chain().
+ *
+ * Since: 2.30
+ */
+typedef enum /*< flags >*/ {
+ G_TLS_DATABASE_VERIFY_NONE = 0
+} GTlsDatabaseVerifyFlags;
+
+/**
+ * GTlsDatabaseLookupFlags:
+ * @G_TLS_DATABASE_LOOKUP_NONE: No lookup flags
+ * @G_TLS_DATABASE_LOOKUP_KEYPAIR: Restrict lookup to certificates that have
+ * a private key.
+ *
+ * Flags for g_tls_database_lookup_certificate_for_handle(),
+ * g_tls_database_lookup_certificate_issuer(),
+ * and g_tls_database_lookup_certificates_issued_by().
+ *
+ * Since: 2.30
+ */
+typedef enum {
+ G_TLS_DATABASE_LOOKUP_NONE = 0,
+ G_TLS_DATABASE_LOOKUP_KEYPAIR = 1
+} GTlsDatabaseLookupFlags;
+
+/**
+ * GTlsCertificateRequestFlags:
+ * @G_TLS_CERTIFICATE_REQUEST_NONE: No flags
+ *
+ * Flags for g_tls_interaction_request_certificate(),
+ * g_tls_interaction_request_certificate_async(), and
+ * g_tls_interaction_invoke_request_certificate().
+ *
+ * Since: 2.40
+ */
+typedef enum {
+ G_TLS_CERTIFICATE_REQUEST_NONE = 0
+} GTlsCertificateRequestFlags;
+
+/**
+ * GIOModuleScopeFlags:
+ * @G_IO_MODULE_SCOPE_NONE: No module scan flags
+ * @G_IO_MODULE_SCOPE_BLOCK_DUPLICATES: When using this scope to load or
+ * scan modules, automatically block a modules which has the same base
+ * basename as previously loaded module.
+ *
+ * Flags for use with g_io_module_scope_new().
+ *
+ * Since: 2.30
+ */
+typedef enum {
+ G_IO_MODULE_SCOPE_NONE,
+ G_IO_MODULE_SCOPE_BLOCK_DUPLICATES
+} GIOModuleScopeFlags;
+
+/**
+ * GSocketClientEvent:
+ * @G_SOCKET_CLIENT_RESOLVING: The client is doing a DNS lookup.
+ * @G_SOCKET_CLIENT_RESOLVED: The client has completed a DNS lookup.
+ * @G_SOCKET_CLIENT_CONNECTING: The client is connecting to a remote
+ * host (either a proxy or the destination server).
+ * @G_SOCKET_CLIENT_CONNECTED: The client has connected to a remote
+ * host.
+ * @G_SOCKET_CLIENT_PROXY_NEGOTIATING: The client is negotiating
+ * with a proxy to connect to the destination server.
+ * @G_SOCKET_CLIENT_PROXY_NEGOTIATED: The client has negotiated
+ * with the proxy server.
+ * @G_SOCKET_CLIENT_TLS_HANDSHAKING: The client is performing a
+ * TLS handshake.
+ * @G_SOCKET_CLIENT_TLS_HANDSHAKED: The client has performed a
+ * TLS handshake.
+ * @G_SOCKET_CLIENT_COMPLETE: The client is done with a particular
+ * #GSocketConnectable.
+ *
+ * Describes an event occurring on a #GSocketClient. See the
+ * #GSocketClient::event signal for more details.
+ *
+ * Additional values may be added to this type in the future.
+ *
+ * Since: 2.32
+ */
+typedef enum {
+ G_SOCKET_CLIENT_RESOLVING,
+ G_SOCKET_CLIENT_RESOLVED,
+ G_SOCKET_CLIENT_CONNECTING,
+ G_SOCKET_CLIENT_CONNECTED,
+ G_SOCKET_CLIENT_PROXY_NEGOTIATING,
+ G_SOCKET_CLIENT_PROXY_NEGOTIATED,
+ G_SOCKET_CLIENT_TLS_HANDSHAKING,
+ G_SOCKET_CLIENT_TLS_HANDSHAKED,
+ G_SOCKET_CLIENT_COMPLETE
+} GSocketClientEvent;
+
+/**
+ * GSocketListenerEvent:
+ * @G_SOCKET_LISTENER_BINDING: The listener is about to bind a socket.
+ * @G_SOCKET_LISTENER_BOUND: The listener has bound a socket.
+ * @G_SOCKET_LISTENER_LISTENING: The listener is about to start
+ * listening on this socket.
+ * @G_SOCKET_LISTENER_LISTENED: The listener is now listening on
+ * this socket.
+ *
+ * Describes an event occurring on a #GSocketListener. See the
+ * #GSocketListener::event signal for more details.
+ *
+ * Additional values may be added to this type in the future.
+ *
+ * Since: 2.46
+ */
+typedef enum {
+ G_SOCKET_LISTENER_BINDING,
+ G_SOCKET_LISTENER_BOUND,
+ G_SOCKET_LISTENER_LISTENING,
+ G_SOCKET_LISTENER_LISTENED
+} GSocketListenerEvent;
+
+/**
+ * GTestDBusFlags:
+ * @G_TEST_DBUS_NONE: No flags.
+ *
+ * Flags to define future #GTestDBus behaviour.
+ *
+ * Since: 2.34
+ */
+typedef enum /*< flags >*/ {
+ G_TEST_DBUS_NONE = 0
+} GTestDBusFlags;
+
+/**
+ * GSubprocessFlags:
+ * @G_SUBPROCESS_FLAGS_NONE: No flags.
+ * @G_SUBPROCESS_FLAGS_STDIN_PIPE: create a pipe for the stdin of the
+ * spawned process that can be accessed with
+ * g_subprocess_get_stdin_pipe().
+ * @G_SUBPROCESS_FLAGS_STDIN_INHERIT: stdin is inherited from the
+ * calling process.
+ * @G_SUBPROCESS_FLAGS_STDOUT_PIPE: create a pipe for the stdout of the
+ * spawned process that can be accessed with
+ * g_subprocess_get_stdout_pipe().
+ * @G_SUBPROCESS_FLAGS_STDOUT_SILENCE: silence the stdout of the spawned
+ * process (ie: redirect to `/dev/null`).
+ * @G_SUBPROCESS_FLAGS_STDERR_PIPE: create a pipe for the stderr of the
+ * spawned process that can be accessed with
+ * g_subprocess_get_stderr_pipe().
+ * @G_SUBPROCESS_FLAGS_STDERR_SILENCE: silence the stderr of the spawned
+ * process (ie: redirect to `/dev/null`).
+ * @G_SUBPROCESS_FLAGS_STDERR_MERGE: merge the stderr of the spawned
+ * process with whatever the stdout happens to be. This is a good way
+ * of directing both streams to a common log file, for example.
+ * @G_SUBPROCESS_FLAGS_INHERIT_FDS: spawned processes will inherit the
+ * file descriptors of their parent, unless those descriptors have
+ * been explicitly marked as close-on-exec. This flag has no effect
+ * over the "standard" file descriptors (stdin, stdout, stderr).
+ *
+ * Flags to define the behaviour of a #GSubprocess.
+ *
+ * Note that the default for stdin is to redirect from `/dev/null`. For
+ * stdout and stderr the default are for them to inherit the
+ * corresponding descriptor from the calling process.
+ *
+ * Note that it is a programmer error to mix 'incompatible' flags. For
+ * example, you may not request both %G_SUBPROCESS_FLAGS_STDOUT_PIPE and
+ * %G_SUBPROCESS_FLAGS_STDOUT_SILENCE.
+ *
+ * Since: 2.40
+ **/
+typedef enum {
+ G_SUBPROCESS_FLAGS_NONE = 0,
+ G_SUBPROCESS_FLAGS_STDIN_PIPE = (1u << 0),
+ G_SUBPROCESS_FLAGS_STDIN_INHERIT = (1u << 1),
+ G_SUBPROCESS_FLAGS_STDOUT_PIPE = (1u << 2),
+ G_SUBPROCESS_FLAGS_STDOUT_SILENCE = (1u << 3),
+ G_SUBPROCESS_FLAGS_STDERR_PIPE = (1u << 4),
+ G_SUBPROCESS_FLAGS_STDERR_SILENCE = (1u << 5),
+ G_SUBPROCESS_FLAGS_STDERR_MERGE = (1u << 6),
+ G_SUBPROCESS_FLAGS_INHERIT_FDS = (1u << 7)
+} GSubprocessFlags;
+
+/**
+ * GNotificationPriority:
+ * @G_NOTIFICATION_PRIORITY_LOW: for notifications that do not require
+ * immediate attention - typically used for contextual background
+ * information, such as contact birthdays or local weather
+ * @G_NOTIFICATION_PRIORITY_NORMAL: the default priority, to be used for the
+ * majority of notifications (for example email messages, software updates,
+ * completed download/sync operations)
+ * @G_NOTIFICATION_PRIORITY_HIGH: for events that require more attention,
+ * usually because responses are time-sensitive (for example chat and SMS
+ * messages or alarms)
+ * @G_NOTIFICATION_PRIORITY_URGENT: for urgent notifications, or notifications
+ * that require a response in a short space of time (for example phone calls
+ * or emergency warnings)
+ *
+ * Priority levels for #GNotifications.
+ *
+ * Since: 2.42
+ */
+typedef enum {
+ G_NOTIFICATION_PRIORITY_NORMAL,
+ G_NOTIFICATION_PRIORITY_LOW,
+ G_NOTIFICATION_PRIORITY_HIGH,
+ G_NOTIFICATION_PRIORITY_URGENT
+} GNotificationPriority;
+
+/**
+ * GNetworkConnectivity:
+ * @G_NETWORK_CONNECTIVITY_LOCAL: The host is not configured with a
+ * route to the Internet; it may or may not be connected to a local
+ * network.
+ * @G_NETWORK_CONNECTIVITY_LIMITED: The host is connected to a network, but
+ * does not appear to be able to reach the full Internet, perhaps
+ * due to upstream network problems.
+ * @G_NETWORK_CONNECTIVITY_PORTAL: The host is behind a captive portal and
+ * cannot reach the full Internet.
+ * @G_NETWORK_CONNECTIVITY_FULL: The host is connected to a network, and
+ * appears to be able to reach the full Internet.
+ *
+ * The host's network connectivity state, as reported by #GNetworkMonitor.
+ *
+ * Since: 2.44
+ */
+typedef enum {
+ G_NETWORK_CONNECTIVITY_LOCAL = 1,
+ G_NETWORK_CONNECTIVITY_LIMITED = 2,
+ G_NETWORK_CONNECTIVITY_PORTAL = 3,
+ G_NETWORK_CONNECTIVITY_FULL = 4
+} GNetworkConnectivity;
+
+/**
+ * GPollableReturn:
+ * @G_POLLABLE_RETURN_FAILED: Generic error condition for when an operation fails.
+ * @G_POLLABLE_RETURN_OK: The operation was successfully finished.
+ * @G_POLLABLE_RETURN_WOULD_BLOCK: The operation would block.
+ *
+ * Return value for various IO operations that signal errors via the
+ * return value and not necessarily via a #GError.
+ *
+ * This enum exists to be able to return errors to callers without having to
+ * allocate a #GError. Allocating #GErrors can be quite expensive for
+ * regularly happening errors like %G_IO_ERROR_WOULD_BLOCK.
+ *
+ * In case of %G_POLLABLE_RETURN_FAILED a #GError should be set for the
+ * operation to give details about the error that happened.
+ *
+ * Since: 2.60
+ */
+typedef enum {
+ G_POLLABLE_RETURN_FAILED = 0,
+ G_POLLABLE_RETURN_OK = 1,
+ G_POLLABLE_RETURN_WOULD_BLOCK = -G_IO_ERROR_WOULD_BLOCK
+} GPollableReturn;
+
+G_END_DECLS
+
+#endif /* __GIO_ENUMS_H__ */
diff --git a/include/glib/gio/gioenumtypes.h b/include/glib/gio/gioenumtypes.h
new file mode 100644
index 0000000000..bbf9ff7a67
--- /dev/null
+++ b/include/glib/gio/gioenumtypes.h
@@ -0,0 +1,177 @@
+
+/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+
+#ifndef __GIO_ENUM_TYPES_H__
+#define __GIO_ENUM_TYPES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* enumerations from "../gio/gioenums.h" */
+GLIB_AVAILABLE_IN_ALL GType g_app_info_create_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_APP_INFO_CREATE_FLAGS (g_app_info_create_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_converter_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_CONVERTER_FLAGS (g_converter_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_converter_result_get_type (void) G_GNUC_CONST;
+#define G_TYPE_CONVERTER_RESULT (g_converter_result_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_data_stream_byte_order_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DATA_STREAM_BYTE_ORDER (g_data_stream_byte_order_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_data_stream_newline_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DATA_STREAM_NEWLINE_TYPE (g_data_stream_newline_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_attribute_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_ATTRIBUTE_TYPE (g_file_attribute_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_attribute_info_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS (g_file_attribute_info_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_attribute_status_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_ATTRIBUTE_STATUS (g_file_attribute_status_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_query_info_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_QUERY_INFO_FLAGS (g_file_query_info_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_create_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_CREATE_FLAGS (g_file_create_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_measure_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_MEASURE_FLAGS (g_file_measure_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_mount_mount_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_MOUNT_MOUNT_FLAGS (g_mount_mount_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_mount_unmount_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_MOUNT_UNMOUNT_FLAGS (g_mount_unmount_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_drive_start_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DRIVE_START_FLAGS (g_drive_start_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_drive_start_stop_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DRIVE_START_STOP_TYPE (g_drive_start_stop_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_copy_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_COPY_FLAGS (g_file_copy_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_monitor_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_MONITOR_FLAGS (g_file_monitor_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_TYPE (g_file_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_filesystem_preview_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILESYSTEM_PREVIEW_TYPE (g_filesystem_preview_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_file_monitor_event_get_type (void) G_GNUC_CONST;
+#define G_TYPE_FILE_MONITOR_EVENT (g_file_monitor_event_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_io_error_enum_get_type (void) G_GNUC_CONST;
+#define G_TYPE_IO_ERROR_ENUM (g_io_error_enum_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_ask_password_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_ASK_PASSWORD_FLAGS (g_ask_password_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_password_save_get_type (void) G_GNUC_CONST;
+#define G_TYPE_PASSWORD_SAVE (g_password_save_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_mount_operation_result_get_type (void) G_GNUC_CONST;
+#define G_TYPE_MOUNT_OPERATION_RESULT (g_mount_operation_result_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_output_stream_splice_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS (g_output_stream_splice_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_io_stream_splice_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_IO_STREAM_SPLICE_FLAGS (g_io_stream_splice_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_emblem_origin_get_type (void) G_GNUC_CONST;
+#define G_TYPE_EMBLEM_ORIGIN (g_emblem_origin_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_resolver_error_get_type (void) G_GNUC_CONST;
+#define G_TYPE_RESOLVER_ERROR (g_resolver_error_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_resolver_record_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_RESOLVER_RECORD_TYPE (g_resolver_record_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_resource_error_get_type (void) G_GNUC_CONST;
+#define G_TYPE_RESOURCE_ERROR (g_resource_error_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_resource_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_RESOURCE_FLAGS (g_resource_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_resource_lookup_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_RESOURCE_LOOKUP_FLAGS (g_resource_lookup_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_socket_family_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SOCKET_FAMILY (g_socket_family_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_socket_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SOCKET_TYPE (g_socket_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_socket_msg_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SOCKET_MSG_FLAGS (g_socket_msg_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_socket_protocol_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SOCKET_PROTOCOL (g_socket_protocol_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_zlib_compressor_format_get_type (void) G_GNUC_CONST;
+#define G_TYPE_ZLIB_COMPRESSOR_FORMAT (g_zlib_compressor_format_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_unix_socket_address_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_UNIX_SOCKET_ADDRESS_TYPE (g_unix_socket_address_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_bus_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_BUS_TYPE (g_bus_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_bus_name_owner_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_BUS_NAME_OWNER_FLAGS (g_bus_name_owner_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_bus_name_watcher_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_BUS_NAME_WATCHER_FLAGS (g_bus_name_watcher_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_proxy_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_PROXY_FLAGS (g_dbus_proxy_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_error_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_ERROR (g_dbus_error_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_connection_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_CONNECTION_FLAGS (g_dbus_connection_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_capability_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_CAPABILITY_FLAGS (g_dbus_capability_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_call_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_CALL_FLAGS (g_dbus_call_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_message_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_MESSAGE_TYPE (g_dbus_message_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_message_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_MESSAGE_FLAGS (g_dbus_message_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_message_header_field_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_MESSAGE_HEADER_FIELD (g_dbus_message_header_field_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_property_info_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_PROPERTY_INFO_FLAGS (g_dbus_property_info_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_subtree_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_SUBTREE_FLAGS (g_dbus_subtree_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_server_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_SERVER_FLAGS (g_dbus_server_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_signal_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_SIGNAL_FLAGS (g_dbus_signal_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_send_message_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_SEND_MESSAGE_FLAGS (g_dbus_send_message_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_credentials_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_CREDENTIALS_TYPE (g_credentials_type_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_message_byte_order_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_MESSAGE_BYTE_ORDER (g_dbus_message_byte_order_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_application_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_APPLICATION_FLAGS (g_application_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_error_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_ERROR (g_tls_error_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_certificate_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_CERTIFICATE_FLAGS (g_tls_certificate_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_authentication_mode_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_AUTHENTICATION_MODE (g_tls_authentication_mode_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_rehandshake_mode_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_REHANDSHAKE_MODE (g_tls_rehandshake_mode_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_password_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_PASSWORD_FLAGS (g_tls_password_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_interaction_result_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_INTERACTION_RESULT (g_tls_interaction_result_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_interface_skeleton_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_INTERFACE_SKELETON_FLAGS (g_dbus_interface_skeleton_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_dbus_object_manager_client_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_DBUS_OBJECT_MANAGER_CLIENT_FLAGS (g_dbus_object_manager_client_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_database_verify_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_DATABASE_VERIFY_FLAGS (g_tls_database_verify_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_database_lookup_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_DATABASE_LOOKUP_FLAGS (g_tls_database_lookup_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_tls_certificate_request_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TLS_CERTIFICATE_REQUEST_FLAGS (g_tls_certificate_request_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_io_module_scope_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_IO_MODULE_SCOPE_FLAGS (g_io_module_scope_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_socket_client_event_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SOCKET_CLIENT_EVENT (g_socket_client_event_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_socket_listener_event_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SOCKET_LISTENER_EVENT (g_socket_listener_event_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_test_dbus_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_TEST_DBUS_FLAGS (g_test_dbus_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_subprocess_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SUBPROCESS_FLAGS (g_subprocess_flags_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_notification_priority_get_type (void) G_GNUC_CONST;
+#define G_TYPE_NOTIFICATION_PRIORITY (g_notification_priority_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_network_connectivity_get_type (void) G_GNUC_CONST;
+#define G_TYPE_NETWORK_CONNECTIVITY (g_network_connectivity_get_type ())
+GLIB_AVAILABLE_IN_ALL GType g_pollable_return_get_type (void) G_GNUC_CONST;
+#define G_TYPE_POLLABLE_RETURN (g_pollable_return_get_type ())
+
+/* enumerations from "../gio/gresolver.h" */
+GLIB_AVAILABLE_IN_ALL GType g_resolver_name_lookup_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_RESOLVER_NAME_LOOKUP_FLAGS (g_resolver_name_lookup_flags_get_type ())
+
+/* enumerations from "../gio/gsettings.h" */
+GLIB_AVAILABLE_IN_ALL GType g_settings_bind_flags_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SETTINGS_BIND_FLAGS (g_settings_bind_flags_get_type ())
+G_END_DECLS
+
+#endif /* __GIO_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
diff --git a/include/glib/gio/gioerror.h b/include/glib/gio/gioerror.h
new file mode 100644
index 0000000000..b3d6446461
--- /dev/null
+++ b/include/glib/gio/gioerror.h
@@ -0,0 +1,53 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_IO_ERROR_H__
+#define __G_IO_ERROR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <glib.h>
+#include <gio/gioenums.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_IO_ERROR:
+ *
+ * Error domain for GIO. Errors in this domain will be from the #GIOErrorEnum enumeration.
+ * See #GError for more information on error domains.
+ **/
+#define G_IO_ERROR g_io_error_quark()
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_io_error_quark (void);
+GLIB_AVAILABLE_IN_ALL
+GIOErrorEnum g_io_error_from_errno (gint err_no);
+
+#ifdef G_OS_WIN32
+GLIB_AVAILABLE_IN_ALL
+GIOErrorEnum g_io_error_from_win32_error (gint error_code);
+#endif
+
+G_END_DECLS
+
+#endif /* __G_IO_ERROR_H__ */
diff --git a/include/glib/gio/giomodule.h b/include/glib/gio/giomodule.h
new file mode 100644
index 0000000000..e94b8099db
--- /dev/null
+++ b/include/glib/gio/giomodule.h
@@ -0,0 +1,193 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_IO_MODULE_H__
+#define __G_IO_MODULE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+#include <gmodule.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GIOModuleScope GIOModuleScope;
+
+GLIB_AVAILABLE_IN_2_30
+GIOModuleScope * g_io_module_scope_new (GIOModuleScopeFlags flags);
+GLIB_AVAILABLE_IN_2_30
+void g_io_module_scope_free (GIOModuleScope *scope);
+GLIB_AVAILABLE_IN_2_30
+void g_io_module_scope_block (GIOModuleScope *scope,
+ const gchar *basename);
+
+#define G_IO_TYPE_MODULE (g_io_module_get_type ())
+#define G_IO_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_IO_TYPE_MODULE, GIOModule))
+#define G_IO_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_IO_TYPE_MODULE, GIOModuleClass))
+#define G_IO_IS_MODULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_IO_TYPE_MODULE))
+#define G_IO_IS_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_IO_TYPE_MODULE))
+#define G_IO_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_IO_TYPE_MODULE, GIOModuleClass))
+
+/**
+ * GIOModule:
+ *
+ * Opaque module base class for extending GIO.
+ **/
+typedef struct _GIOModuleClass GIOModuleClass;
+
+GLIB_AVAILABLE_IN_ALL
+GType g_io_module_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GIOModule *g_io_module_new (const gchar *filename);
+
+GLIB_AVAILABLE_IN_ALL
+void g_io_modules_scan_all_in_directory (const char *dirname);
+GLIB_AVAILABLE_IN_ALL
+GList *g_io_modules_load_all_in_directory (const gchar *dirname);
+
+GLIB_AVAILABLE_IN_2_30
+void g_io_modules_scan_all_in_directory_with_scope (const gchar *dirname,
+ GIOModuleScope *scope);
+GLIB_AVAILABLE_IN_2_30
+GList *g_io_modules_load_all_in_directory_with_scope (const gchar *dirname,
+ GIOModuleScope *scope);
+
+GLIB_AVAILABLE_IN_ALL
+GIOExtensionPoint *g_io_extension_point_register (const char *name);
+GLIB_AVAILABLE_IN_ALL
+GIOExtensionPoint *g_io_extension_point_lookup (const char *name);
+GLIB_AVAILABLE_IN_ALL
+void g_io_extension_point_set_required_type (GIOExtensionPoint *extension_point,
+ GType type);
+GLIB_AVAILABLE_IN_ALL
+GType g_io_extension_point_get_required_type (GIOExtensionPoint *extension_point);
+GLIB_AVAILABLE_IN_ALL
+GList *g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point);
+GLIB_AVAILABLE_IN_ALL
+GIOExtension * g_io_extension_point_get_extension_by_name (GIOExtensionPoint *extension_point,
+ const char *name);
+GLIB_AVAILABLE_IN_ALL
+GIOExtension * g_io_extension_point_implement (const char *extension_point_name,
+ GType type,
+ const char *extension_name,
+ gint priority);
+
+GLIB_AVAILABLE_IN_ALL
+GType g_io_extension_get_type (GIOExtension *extension);
+GLIB_AVAILABLE_IN_ALL
+const char * g_io_extension_get_name (GIOExtension *extension);
+GLIB_AVAILABLE_IN_ALL
+gint g_io_extension_get_priority (GIOExtension *extension);
+GLIB_AVAILABLE_IN_ALL
+GTypeClass* g_io_extension_ref_class (GIOExtension *extension);
+
+
+/* API for the modules to implement */
+
+/**
+ * g_io_module_load:
+ * @module: a #GIOModule.
+ *
+ * Required API for GIO modules to implement.
+ *
+ * This function is run after the module has been loaded into GIO,
+ * to initialize the module. Typically, this function will call
+ * g_io_extension_point_implement().
+ *
+ * Since 2.56, this function should be named `g_io_<modulename>_load`, where
+ * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
+ * everything after the first dot removed, and with `-` replaced with `_`
+ * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
+ * Using the new symbol names avoids name clashes when building modules
+ * statically. The old symbol names continue to be supported, but cannot be used
+ * for static builds.
+ **/
+GLIB_AVAILABLE_IN_ALL
+void g_io_module_load (GIOModule *module);
+
+/**
+ * g_io_module_unload:
+ * @module: a #GIOModule.
+ *
+ * Required API for GIO modules to implement.
+ *
+ * This function is run when the module is being unloaded from GIO,
+ * to finalize the module.
+ *
+ * Since 2.56, this function should be named `g_io_<modulename>_unload`, where
+ * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
+ * everything after the first dot removed, and with `-` replaced with `_`
+ * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
+ * Using the new symbol names avoids name clashes when building modules
+ * statically. The old symbol names continue to be supported, but cannot be used
+ * for static builds.
+ **/
+GLIB_AVAILABLE_IN_ALL
+void g_io_module_unload (GIOModule *module);
+
+/**
+ * g_io_module_query:
+ *
+ * Optional API for GIO modules to implement.
+ *
+ * Should return a list of all the extension points that may be
+ * implemented in this module.
+ *
+ * This method will not be called in normal use, however it may be
+ * called when probing existing modules and recording which extension
+ * points that this model is used for. This means we won't have to
+ * load and initialize this module unless its needed.
+ *
+ * If this function is not implemented by the module the module will
+ * always be loaded, initialized and then unloaded on application
+ * startup so that it can register its extension points during init.
+ *
+ * Note that a module need not actually implement all the extension
+ * points that g_io_module_query() returns, since the exact list of
+ * extension may depend on runtime issues. However all extension
+ * points actually implemented must be returned by g_io_module_query()
+ * (if defined).
+ *
+ * When installing a module that implements g_io_module_query() you must
+ * run gio-querymodules in order to build the cache files required for
+ * lazy loading.
+ *
+ * Since 2.56, this function should be named `g_io_<modulename>_query`, where
+ * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
+ * everything after the first dot removed, and with `-` replaced with `_`
+ * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
+ * Using the new symbol names avoids name clashes when building modules
+ * statically. The old symbol names continue to be supported, but cannot be used
+ * for static builds.
+ *
+ * Returns: (transfer full): A %NULL-terminated array of strings,
+ * listing the supported extension points of the module. The array
+ * must be suitable for freeing with g_strfreev().
+ *
+ * Since: 2.24
+ **/
+GLIB_AVAILABLE_IN_ALL
+char **g_io_module_query (void);
+
+G_END_DECLS
+
+#endif /* __G_IO_MODULE_H__ */
diff --git a/include/glib/gio/gioscheduler.h b/include/glib/gio/gioscheduler.h
new file mode 100644
index 0000000000..d58cff6035
--- /dev/null
+++ b/include/glib/gio/gioscheduler.h
@@ -0,0 +1,54 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_IO_SCHEDULER_H__
+#define __G_IO_SCHEDULER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+
+GLIB_DEPRECATED_IN_2_36_FOR ("GThreadPool or g_task_run_in_thread")
+void g_io_scheduler_push_job (GIOSchedulerJobFunc job_func,
+ gpointer user_data,
+ GDestroyNotify notify,
+ gint io_priority,
+ GCancellable *cancellable);
+GLIB_DEPRECATED_IN_2_36
+void g_io_scheduler_cancel_all_jobs (void);
+GLIB_DEPRECATED_IN_2_36_FOR (g_main_context_invoke)
+gboolean g_io_scheduler_job_send_to_mainloop (GIOSchedulerJob *job,
+ GSourceFunc func,
+ gpointer user_data,
+ GDestroyNotify notify);
+GLIB_DEPRECATED_IN_2_36_FOR (g_main_context_invoke)
+void g_io_scheduler_job_send_to_mainloop_async (GIOSchedulerJob *job,
+ GSourceFunc func,
+ gpointer user_data,
+ GDestroyNotify notify);
+
+G_END_DECLS
+
+#endif /* __G_IO_SCHEDULER_H__ */
diff --git a/include/glib/gio/giostream.h b/include/glib/gio/giostream.h
new file mode 100644
index 0000000000..5dbe0e6e6c
--- /dev/null
+++ b/include/glib/gio/giostream.h
@@ -0,0 +1,135 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2008, 2009 Codethink Limited
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * See the included COPYING file for more information.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ * Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_IO_STREAM_H__
+#define __G_IO_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/ginputstream.h>
+#include <gio/goutputstream.h>
+#include <gio/gcancellable.h>
+#include <gio/gioerror.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_IO_STREAM (g_io_stream_get_type ())
+#define G_IO_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_IO_STREAM, GIOStream))
+#define G_IO_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_IO_STREAM, GIOStreamClass))
+#define G_IS_IO_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_IO_STREAM))
+#define G_IS_IO_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_IO_STREAM))
+#define G_IO_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_IO_STREAM, GIOStreamClass))
+
+typedef struct _GIOStreamPrivate GIOStreamPrivate;
+typedef struct _GIOStreamClass GIOStreamClass;
+
+/**
+ * GIOStream:
+ *
+ * Base class for read-write streams.
+ **/
+struct _GIOStream
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GIOStreamPrivate *priv;
+};
+
+struct _GIOStreamClass
+{
+ GObjectClass parent_class;
+
+ GInputStream * (*get_input_stream) (GIOStream *stream);
+ GOutputStream * (*get_output_stream) (GIOStream *stream);
+
+ gboolean (* close_fn) (GIOStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+ void (* close_async) (GIOStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* close_finish) (GIOStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+ void (*_g_reserved7) (void);
+ void (*_g_reserved8) (void);
+ void (*_g_reserved9) (void);
+ void (*_g_reserved10) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_io_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GInputStream * g_io_stream_get_input_stream (GIOStream *stream);
+GLIB_AVAILABLE_IN_ALL
+GOutputStream *g_io_stream_get_output_stream (GIOStream *stream);
+
+GLIB_AVAILABLE_IN_ALL
+void g_io_stream_splice_async (GIOStream *stream1,
+ GIOStream *stream2,
+ GIOStreamSpliceFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_stream_splice_finish (GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_stream_close (GIOStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_io_stream_close_async (GIOStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_stream_close_finish (GIOStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_stream_is_closed (GIOStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_stream_has_pending (GIOStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_stream_set_pending (GIOStream *stream,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_io_stream_clear_pending (GIOStream *stream);
+
+G_END_DECLS
+
+#endif /* __G_IO_STREAM_H__ */
diff --git a/include/glib/gio/giotypes.h b/include/glib/gio/giotypes.h
new file mode 100644
index 0000000000..c9ad8dd90e
--- /dev/null
+++ b/include/glib/gio/giotypes.h
@@ -0,0 +1,654 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __GIO_TYPES_H__
+#define __GIO_TYPES_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gioenums.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GAppLaunchContext GAppLaunchContext;
+typedef struct _GAppInfo GAppInfo; /* Dummy typedef */
+typedef struct _GAsyncResult GAsyncResult; /* Dummy typedef */
+typedef struct _GAsyncInitable GAsyncInitable;
+typedef struct _GBufferedInputStream GBufferedInputStream;
+typedef struct _GBufferedOutputStream GBufferedOutputStream;
+typedef struct _GCancellable GCancellable;
+typedef struct _GCharsetConverter GCharsetConverter;
+typedef struct _GConverter GConverter;
+typedef struct _GConverterInputStream GConverterInputStream;
+typedef struct _GConverterOutputStream GConverterOutputStream;
+typedef struct _GDatagramBased GDatagramBased;
+typedef struct _GDataInputStream GDataInputStream;
+typedef struct _GSimplePermission GSimplePermission;
+typedef struct _GZlibCompressor GZlibCompressor;
+typedef struct _GZlibDecompressor GZlibDecompressor;
+
+typedef struct _GSimpleActionGroup GSimpleActionGroup;
+typedef struct _GRemoteActionGroup GRemoteActionGroup;
+typedef struct _GDBusActionGroup GDBusActionGroup;
+typedef struct _GActionMap GActionMap;
+typedef struct _GActionGroup GActionGroup;
+typedef struct _GPropertyAction GPropertyAction;
+typedef struct _GSimpleAction GSimpleAction;
+typedef struct _GAction GAction;
+typedef struct _GApplication GApplication;
+typedef struct _GApplicationCommandLine GApplicationCommandLine;
+typedef struct _GSettingsBackend GSettingsBackend;
+typedef struct _GSettings GSettings;
+typedef struct _GPermission GPermission;
+
+typedef struct _GMenuModel GMenuModel;
+typedef struct _GNotification GNotification;
+
+/**
+ * GDrive:
+ *
+ * Opaque drive object.
+ **/
+typedef struct _GDrive GDrive; /* Dummy typedef */
+typedef struct _GFileEnumerator GFileEnumerator;
+typedef struct _GFileMonitor GFileMonitor;
+typedef struct _GFilterInputStream GFilterInputStream;
+typedef struct _GFilterOutputStream GFilterOutputStream;
+
+/**
+ * GFile:
+ *
+ * A handle to an object implementing the #GFileIface interface.
+ * Generally stores a location within the file system. Handles do not
+ * necessarily represent files or directories that currently exist.
+ **/
+typedef struct _GFile GFile; /* Dummy typedef */
+typedef struct _GFileInfo GFileInfo;
+
+/**
+ * GFileAttributeMatcher:
+ *
+ * Determines if a string matches a file attribute.
+ **/
+typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
+typedef struct _GFileAttributeInfo GFileAttributeInfo;
+typedef struct _GFileAttributeInfoList GFileAttributeInfoList;
+typedef struct _GFileDescriptorBased GFileDescriptorBased;
+typedef struct _GFileInputStream GFileInputStream;
+typedef struct _GFileOutputStream GFileOutputStream;
+typedef struct _GFileIOStream GFileIOStream;
+typedef struct _GFileIcon GFileIcon;
+typedef struct _GFilenameCompleter GFilenameCompleter;
+
+
+typedef struct _GIcon GIcon; /* Dummy typedef */
+typedef struct _GInetAddress GInetAddress;
+typedef struct _GInetAddressMask GInetAddressMask;
+typedef struct _GInetSocketAddress GInetSocketAddress;
+typedef struct _GNativeSocketAddress GNativeSocketAddress;
+typedef struct _GInputStream GInputStream;
+typedef struct _GInitable GInitable;
+typedef struct _GIOModule GIOModule;
+typedef struct _GIOExtensionPoint GIOExtensionPoint;
+typedef struct _GIOExtension GIOExtension;
+
+/**
+ * GIOSchedulerJob:
+ *
+ * Opaque class for defining and scheduling IO jobs.
+ **/
+typedef struct _GIOSchedulerJob GIOSchedulerJob;
+typedef struct _GIOStreamAdapter GIOStreamAdapter;
+typedef struct _GLoadableIcon GLoadableIcon; /* Dummy typedef */
+typedef struct _GBytesIcon GBytesIcon;
+typedef struct _GMemoryInputStream GMemoryInputStream;
+typedef struct _GMemoryOutputStream GMemoryOutputStream;
+
+/**
+ * GMount:
+ *
+ * A handle to an object implementing the #GMountIface interface.
+ **/
+typedef struct _GMount GMount; /* Dummy typedef */
+typedef struct _GMountOperation GMountOperation;
+typedef struct _GNetworkAddress GNetworkAddress;
+typedef struct _GNetworkMonitor GNetworkMonitor;
+typedef struct _GNetworkService GNetworkService;
+typedef struct _GOutputStream GOutputStream;
+typedef struct _GIOStream GIOStream;
+typedef struct _GSimpleIOStream GSimpleIOStream;
+typedef struct _GPollableInputStream GPollableInputStream; /* Dummy typedef */
+typedef struct _GPollableOutputStream GPollableOutputStream; /* Dummy typedef */
+typedef struct _GResolver GResolver;
+
+/**
+ * GResource:
+ *
+ * A resource bundle.
+ *
+ * Since: 2.32
+ */
+typedef struct _GResource GResource;
+typedef struct _GSeekable GSeekable;
+typedef struct _GSimpleAsyncResult GSimpleAsyncResult;
+
+/**
+ * GSocket:
+ *
+ * A lowlevel network socket object.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GSocket GSocket;
+
+/**
+ * GSocketControlMessage:
+ *
+ * Base class for socket-type specific control messages that can be sent and
+ * received over #GSocket.
+ **/
+typedef struct _GSocketControlMessage GSocketControlMessage;
+/**
+ * GSocketClient:
+ *
+ * A helper class for network clients to make connections.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GSocketClient GSocketClient;
+/**
+ * GSocketConnection:
+ *
+ * A socket connection GIOStream object for connection-oriented sockets.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GSocketConnection GSocketConnection;
+/**
+ * GSocketListener:
+ *
+ * A helper class for network servers to listen for and accept connections.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GSocketListener GSocketListener;
+/**
+ * GSocketService:
+ *
+ * A helper class for handling accepting incomming connections in the
+ * glib mainloop.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GSocketService GSocketService;
+typedef struct _GSocketAddress GSocketAddress;
+typedef struct _GSocketAddressEnumerator GSocketAddressEnumerator;
+typedef struct _GSocketConnectable GSocketConnectable;
+typedef struct _GSrvTarget GSrvTarget;
+typedef struct _GTask GTask;
+/**
+ * GTcpConnection:
+ *
+ * A #GSocketConnection for TCP/IP connections.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GTcpConnection GTcpConnection;
+typedef struct _GTcpWrapperConnection GTcpWrapperConnection;
+/**
+ * GThreadedSocketService:
+ *
+ * A helper class for handling accepting incoming connections in the
+ * glib mainloop and handling them in a thread.
+ *
+ * Since: 2.22
+ **/
+typedef struct _GThreadedSocketService GThreadedSocketService;
+typedef struct _GDtlsConnection GDtlsConnection;
+typedef struct _GDtlsClientConnection GDtlsClientConnection; /* Dummy typedef */
+typedef struct _GDtlsServerConnection GDtlsServerConnection; /* Dummy typedef */
+typedef struct _GThemedIcon GThemedIcon;
+typedef struct _GTlsCertificate GTlsCertificate;
+typedef struct _GTlsClientConnection GTlsClientConnection; /* Dummy typedef */
+typedef struct _GTlsConnection GTlsConnection;
+typedef struct _GTlsDatabase GTlsDatabase;
+typedef struct _GTlsFileDatabase GTlsFileDatabase;
+typedef struct _GTlsInteraction GTlsInteraction;
+typedef struct _GTlsPassword GTlsPassword;
+typedef struct _GTlsServerConnection GTlsServerConnection; /* Dummy typedef */
+typedef struct _GVfs GVfs; /* Dummy typedef */
+
+/**
+ * GProxyResolver:
+ *
+ * A helper class to enumerate proxies base on URI.
+ *
+ * Since: 2.26
+ **/
+typedef struct _GProxyResolver GProxyResolver;
+typedef struct _GProxy GProxy;
+typedef struct _GProxyAddress GProxyAddress;
+typedef struct _GProxyAddressEnumerator GProxyAddressEnumerator;
+
+/**
+ * GVolume:
+ *
+ * Opaque mountable volume object.
+ **/
+typedef struct _GVolume GVolume; /* Dummy typedef */
+typedef struct _GVolumeMonitor GVolumeMonitor;
+
+/**
+ * GAsyncReadyCallback:
+ * @source_object: (nullable): the object the asynchronous operation was started with.
+ * @res: a #GAsyncResult.
+ * @user_data: user data passed to the callback.
+ *
+ * Type definition for a function that will be called back when an asynchronous
+ * operation within GIO has been completed. #GAsyncReadyCallback
+ * callbacks from #GTask are guaranteed to be invoked in a later
+ * iteration of the
+ * [thread-default main context][g-main-context-push-thread-default]
+ * where the #GTask was created. All other users of
+ * #GAsyncReadyCallback must likewise call it asynchronously in a
+ * later iteration of the main context.
+ **/
+typedef void (*GAsyncReadyCallback) (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data);
+
+/**
+ * GFileProgressCallback:
+ * @current_num_bytes: the current number of bytes in the operation.
+ * @total_num_bytes: the total number of bytes in the operation.
+ * @user_data: user data passed to the callback.
+ *
+ * When doing file operations that may take a while, such as moving
+ * a file or copying a file, a progress callback is used to pass how
+ * far along that operation is to the application.
+ **/
+typedef void (*GFileProgressCallback) (goffset current_num_bytes,
+ goffset total_num_bytes,
+ gpointer user_data);
+
+/**
+ * GFileReadMoreCallback:
+ * @file_contents: the data as currently read.
+ * @file_size: the size of the data currently read.
+ * @callback_data: (closure): data passed to the callback.
+ *
+ * When loading the partial contents of a file with g_file_load_partial_contents_async(),
+ * it may become necessary to determine if any more data from the file should be loaded.
+ * A #GFileReadMoreCallback function facilitates this by returning %TRUE if more data
+ * should be read, or %FALSE otherwise.
+ *
+ * Returns: %TRUE if more data should be read back. %FALSE otherwise.
+ **/
+typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
+ goffset file_size,
+ gpointer callback_data);
+
+/**
+ * GFileMeasureProgressCallback:
+ * @reporting: %TRUE if more reports will come
+ * @current_size: the current cumulative size measurement
+ * @num_dirs: the number of directories visited so far
+ * @num_files: the number of non-directory files encountered
+ * @user_data: the data passed to the original request for this callback
+ *
+ * This callback type is used by g_file_measure_disk_usage() to make
+ * periodic progress reports when measuring the amount of disk spaced
+ * used by a directory.
+ *
+ * These calls are made on a best-effort basis and not all types of
+ * #GFile will support them. At the minimum, however, one call will
+ * always be made immediately.
+ *
+ * In the case that there is no support, @reporting will be set to
+ * %FALSE (and the other values undefined) and no further calls will be
+ * made. Otherwise, the @reporting will be %TRUE and the other values
+ * all-zeros during the first (immediate) call. In this way, you can
+ * know which type of progress UI to show without a delay.
+ *
+ * For g_file_measure_disk_usage() the callback is made directly. For
+ * g_file_measure_disk_usage_async() the callback is made via the
+ * default main context of the calling thread (ie: the same way that the
+ * final async result would be reported).
+ *
+ * @current_size is in the same units as requested by the operation (see
+ * %G_FILE_MEASURE_APPARENT_SIZE).
+ *
+ * The frequency of the updates is implementation defined, but is
+ * ideally about once every 200ms.
+ *
+ * The last progress callback may or may not be equal to the final
+ * result. Always check the async result to get the final value.
+ *
+ * Since: 2.38
+ **/
+typedef void (* GFileMeasureProgressCallback) (gboolean reporting,
+ guint64 current_size,
+ guint64 num_dirs,
+ guint64 num_files,
+ gpointer user_data);
+
+/**
+ * GIOSchedulerJobFunc:
+ * @job: a #GIOSchedulerJob.
+ * @cancellable: optional #GCancellable object, %NULL to ignore.
+ * @user_data: the data to pass to callback function
+ *
+ * I/O Job function.
+ *
+ * Long-running jobs should periodically check the @cancellable
+ * to see if they have been cancelled.
+ *
+ * Returns: %TRUE if this function should be called again to
+ * complete the job, %FALSE if the job is complete (or cancelled)
+ **/
+typedef gboolean (*GIOSchedulerJobFunc) (GIOSchedulerJob *job,
+ GCancellable *cancellable,
+ gpointer user_data);
+
+/**
+ * GSimpleAsyncThreadFunc:
+ * @res: a #GSimpleAsyncResult.
+ * @object: a #GObject.
+ * @cancellable: optional #GCancellable object, %NULL to ignore.
+ *
+ * Simple thread function that runs an asynchronous operation and
+ * checks for cancellation.
+ **/
+typedef void (*GSimpleAsyncThreadFunc) (GSimpleAsyncResult *res,
+ GObject *object,
+ GCancellable *cancellable);
+
+/**
+ * GSocketSourceFunc:
+ * @socket: the #GSocket
+ * @condition: the current condition at the source fired.
+ * @user_data: data passed in by the user.
+ *
+ * This is the function type of the callback used for the #GSource
+ * returned by g_socket_create_source().
+ *
+ * Returns: it should return %FALSE if the source should be removed.
+ *
+ * Since: 2.22
+ */
+typedef gboolean (*GSocketSourceFunc) (GSocket *socket,
+ GIOCondition condition,
+ gpointer user_data);
+
+/**
+ * GDatagramBasedSourceFunc:
+ * @datagram_based: the #GDatagramBased
+ * @condition: the current condition at the source fired
+ * @user_data: data passed in by the user
+ *
+ * This is the function type of the callback used for the #GSource
+ * returned by g_datagram_based_create_source().
+ *
+ * Returns: %G_SOURCE_REMOVE if the source should be removed,
+ * %G_SOURCE_CONTINUE otherwise
+ *
+ * Since: 2.48
+ */
+typedef gboolean (*GDatagramBasedSourceFunc) (GDatagramBased *datagram_based,
+ GIOCondition condition,
+ gpointer user_data);
+
+/**
+ * GInputVector:
+ * @buffer: Pointer to a buffer where data will be written.
+ * @size: the available size in @buffer.
+ *
+ * Structure used for scatter/gather data input.
+ * You generally pass in an array of #GInputVectors
+ * and the operation will store the read data starting in the
+ * first buffer, switching to the next as needed.
+ *
+ * Since: 2.22
+ */
+typedef struct _GInputVector GInputVector;
+
+struct _GInputVector {
+ gpointer buffer;
+ gsize size;
+};
+
+/**
+ * GInputMessage:
+ * @address: (optional) (out) (transfer full): return location
+ * for a #GSocketAddress, or %NULL
+ * @vectors: (array length=num_vectors) (out): pointer to an
+ * array of input vectors
+ * @num_vectors: the number of input vectors pointed to by @vectors
+ * @bytes_received: (out): will be set to the number of bytes that have been
+ * received
+ * @flags: (out): collection of #GSocketMsgFlags for the received message,
+ * outputted by the call
+ * @control_messages: (array length=num_control_messages) (optional)
+ * (out) (transfer full): return location for a
+ * caller-allocated array of #GSocketControlMessages, or %NULL
+ * @num_control_messages: (out) (optional): return location for the number of
+ * elements in @control_messages
+ *
+ * Structure used for scatter/gather data input when receiving multiple
+ * messages or packets in one go. You generally pass in an array of empty
+ * #GInputVectors and the operation will use all the buffers as if they
+ * were one buffer, and will set @bytes_received to the total number of bytes
+ * received across all #GInputVectors.
+ *
+ * This structure closely mirrors `struct mmsghdr` and `struct msghdr` from
+ * the POSIX sockets API (see `man 2 recvmmsg`).
+ *
+ * If @address is non-%NULL then it is set to the source address the message
+ * was received from, and the caller must free it afterwards.
+ *
+ * If @control_messages is non-%NULL then it is set to an array of control
+ * messages received with the message (if any), and the caller must free it
+ * afterwards. @num_control_messages is set to the number of elements in
+ * this array, which may be zero.
+ *
+ * Flags relevant to this message will be returned in @flags. For example,
+ * `MSG_EOR` or `MSG_TRUNC`.
+ *
+ * Since: 2.48
+ */
+typedef struct _GInputMessage GInputMessage;
+
+struct _GInputMessage {
+ GSocketAddress **address;
+
+ GInputVector *vectors;
+ guint num_vectors;
+
+ gsize bytes_received;
+ gint flags;
+
+ GSocketControlMessage ***control_messages;
+ guint *num_control_messages;
+};
+
+/**
+ * GOutputVector:
+ * @buffer: Pointer to a buffer of data to read.
+ * @size: the size of @buffer.
+ *
+ * Structure used for scatter/gather data output.
+ * You generally pass in an array of #GOutputVectors
+ * and the operation will use all the buffers as if they were
+ * one buffer.
+ *
+ * Since: 2.22
+ */
+typedef struct _GOutputVector GOutputVector;
+
+struct _GOutputVector {
+ gconstpointer buffer;
+ gsize size;
+};
+
+/**
+ * GOutputMessage:
+ * @address: (nullable): a #GSocketAddress, or %NULL
+ * @vectors: pointer to an array of output vectors
+ * @num_vectors: the number of output vectors pointed to by @vectors.
+ * @bytes_sent: initialize to 0. Will be set to the number of bytes
+ * that have been sent
+ * @control_messages: (array length=num_control_messages) (nullable): a pointer
+ * to an array of #GSocketControlMessages, or %NULL.
+ * @num_control_messages: number of elements in @control_messages.
+ *
+ * Structure used for scatter/gather data output when sending multiple
+ * messages or packets in one go. You generally pass in an array of
+ * #GOutputVectors and the operation will use all the buffers as if they
+ * were one buffer.
+ *
+ * If @address is %NULL then the message is sent to the default receiver
+ * (as previously set by g_socket_connect()).
+ *
+ * Since: 2.44
+ */
+typedef struct _GOutputMessage GOutputMessage;
+
+struct _GOutputMessage {
+ GSocketAddress *address;
+
+ GOutputVector *vectors;
+ guint num_vectors;
+
+ guint bytes_sent;
+
+ GSocketControlMessage **control_messages;
+ guint num_control_messages;
+};
+
+typedef struct _GCredentials GCredentials;
+typedef struct _GUnixCredentialsMessage GUnixCredentialsMessage;
+typedef struct _GUnixFDList GUnixFDList;
+typedef struct _GDBusMessage GDBusMessage;
+typedef struct _GDBusConnection GDBusConnection;
+typedef struct _GDBusProxy GDBusProxy;
+typedef struct _GDBusMethodInvocation GDBusMethodInvocation;
+typedef struct _GDBusServer GDBusServer;
+typedef struct _GDBusAuthObserver GDBusAuthObserver;
+typedef struct _GDBusErrorEntry GDBusErrorEntry;
+typedef struct _GDBusInterfaceVTable GDBusInterfaceVTable;
+typedef struct _GDBusSubtreeVTable GDBusSubtreeVTable;
+typedef struct _GDBusAnnotationInfo GDBusAnnotationInfo;
+typedef struct _GDBusArgInfo GDBusArgInfo;
+typedef struct _GDBusMethodInfo GDBusMethodInfo;
+typedef struct _GDBusSignalInfo GDBusSignalInfo;
+typedef struct _GDBusPropertyInfo GDBusPropertyInfo;
+typedef struct _GDBusInterfaceInfo GDBusInterfaceInfo;
+typedef struct _GDBusNodeInfo GDBusNodeInfo;
+
+/**
+ * GCancellableSourceFunc:
+ * @cancellable: the #GCancellable
+ * @user_data: data passed in by the user.
+ *
+ * This is the function type of the callback used for the #GSource
+ * returned by g_cancellable_source_new().
+ *
+ * Returns: it should return %FALSE if the source should be removed.
+ *
+ * Since: 2.28
+ */
+typedef gboolean (*GCancellableSourceFunc) (GCancellable *cancellable,
+ gpointer user_data);
+
+/**
+ * GPollableSourceFunc:
+ * @pollable_stream: the #GPollableInputStream or #GPollableOutputStream
+ * @user_data: data passed in by the user.
+ *
+ * This is the function type of the callback used for the #GSource
+ * returned by g_pollable_input_stream_create_source() and
+ * g_pollable_output_stream_create_source().
+ *
+ * Returns: it should return %FALSE if the source should be removed.
+ *
+ * Since: 2.28
+ */
+typedef gboolean (*GPollableSourceFunc) (GObject *pollable_stream,
+ gpointer user_data);
+
+typedef struct _GDBusInterface GDBusInterface; /* Dummy typedef */
+typedef struct _GDBusInterfaceSkeleton GDBusInterfaceSkeleton;
+typedef struct _GDBusObject GDBusObject; /* Dummy typedef */
+typedef struct _GDBusObjectSkeleton GDBusObjectSkeleton;
+typedef struct _GDBusObjectProxy GDBusObjectProxy;
+typedef struct _GDBusObjectManager GDBusObjectManager; /* Dummy typedef */
+typedef struct _GDBusObjectManagerClient GDBusObjectManagerClient;
+typedef struct _GDBusObjectManagerServer GDBusObjectManagerServer;
+
+/**
+ * GDBusProxyTypeFunc:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object.
+ * @interface_name: (nullable): The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.
+ * @user_data: User data.
+ *
+ * Function signature for a function used to determine the #GType to
+ * use for an interface proxy (if @interface_name is not %NULL) or
+ * object proxy (if @interface_name is %NULL).
+ *
+ * This function is called in the
+ * [thread-default main loop][g-main-context-push-thread-default]
+ * that @manager was constructed in.
+ *
+ * Returns: A #GType to use for the remote object. The returned type
+ * must be a #GDBusProxy or #GDBusObjectProxy -derived
+ * type.
+ *
+ * Since: 2.30
+ */
+typedef GType (*GDBusProxyTypeFunc) (GDBusObjectManagerClient *manager,
+ const gchar *object_path,
+ const gchar *interface_name,
+ gpointer user_data);
+
+typedef struct _GTestDBus GTestDBus;
+
+/**
+ * GSubprocess:
+ *
+ * A child process.
+ *
+ * Since: 2.40
+ */
+typedef struct _GSubprocess GSubprocess;
+/**
+ * GSubprocessLauncher:
+ *
+ * Options for launching a child process.
+ *
+ * Since: 2.40
+ */
+typedef struct _GSubprocessLauncher GSubprocessLauncher;
+
+G_END_DECLS
+
+#endif /* __GIO_TYPES_H__ */
diff --git a/include/glib/gio/glistmodel.h b/include/glib/gio/glistmodel.h
new file mode 100644
index 0000000000..48348afd54
--- /dev/null
+++ b/include/glib/gio/glistmodel.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2015 Lars Uebernickel
+ * Copyright 2015 Ryan Lortie
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Lars Uebernickel <lars@uebernic.de>
+ * Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_LIST_MODEL_H__
+#define __G_LIST_MODEL_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_LIST_MODEL g_list_model_get_type ()
+GLIB_AVAILABLE_IN_2_44
+G_DECLARE_INTERFACE(GListModel, g_list_model, G, LIST_MODEL, GObject)
+
+struct _GListModelInterface
+{
+ GTypeInterface g_iface;
+
+ GType (* get_item_type) (GListModel *list);
+
+ guint (* get_n_items) (GListModel *list);
+
+ gpointer (* get_item) (GListModel *list,
+ guint position);
+};
+
+GLIB_AVAILABLE_IN_2_44
+GType g_list_model_get_item_type (GListModel *list);
+
+GLIB_AVAILABLE_IN_2_44
+guint g_list_model_get_n_items (GListModel *list);
+
+GLIB_AVAILABLE_IN_2_44
+gpointer g_list_model_get_item (GListModel *list,
+ guint position);
+
+GLIB_AVAILABLE_IN_2_44
+GObject * g_list_model_get_object (GListModel *list,
+ guint position);
+
+GLIB_AVAILABLE_IN_2_44
+void g_list_model_items_changed (GListModel *list,
+ guint position,
+ guint removed,
+ guint added);
+
+G_END_DECLS
+
+#endif /* __G_LIST_MODEL_H__ */
diff --git a/include/glib/gio/gliststore.h b/include/glib/gio/gliststore.h
new file mode 100644
index 0000000000..407d542fbb
--- /dev/null
+++ b/include/glib/gio/gliststore.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2015 Lars Uebernickel
+ * Copyright 2015 Ryan Lortie
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Lars Uebernickel <lars@uebernic.de>
+ * Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_LIST_STORE_H__
+#define __G_LIST_STORE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_LIST_STORE (g_list_store_get_type ())
+GLIB_AVAILABLE_IN_2_44
+G_DECLARE_FINAL_TYPE(GListStore, g_list_store, G, LIST_STORE, GObject)
+
+GLIB_AVAILABLE_IN_2_44
+GListStore * g_list_store_new (GType item_type);
+
+GLIB_AVAILABLE_IN_2_44
+void g_list_store_insert (GListStore *store,
+ guint position,
+ gpointer item);
+
+GLIB_AVAILABLE_IN_2_44
+guint g_list_store_insert_sorted (GListStore *store,
+ gpointer item,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_46
+void g_list_store_sort (GListStore *store,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_44
+void g_list_store_append (GListStore *store,
+ gpointer item);
+
+GLIB_AVAILABLE_IN_2_44
+void g_list_store_remove (GListStore *store,
+ guint position);
+
+GLIB_AVAILABLE_IN_2_44
+void g_list_store_remove_all (GListStore *store);
+
+GLIB_AVAILABLE_IN_2_44
+void g_list_store_splice (GListStore *store,
+ guint position,
+ guint n_removals,
+ gpointer *additions,
+ guint n_additions);
+
+G_END_DECLS
+
+#endif /* __G_LIST_STORE_H__ */
diff --git a/include/glib/gio/gloadableicon.h b/include/glib/gio/gloadableicon.h
new file mode 100644
index 0000000000..c2951c991b
--- /dev/null
+++ b/include/glib/gio/gloadableicon.h
@@ -0,0 +1,99 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_LOADABLE_ICON_H__
+#define __G_LOADABLE_ICON_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_LOADABLE_ICON (g_loadable_icon_get_type ())
+#define G_LOADABLE_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_LOADABLE_ICON, GLoadableIcon))
+#define G_IS_LOADABLE_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_LOADABLE_ICON))
+#define G_LOADABLE_ICON_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_LOADABLE_ICON, GLoadableIconIface))
+
+/**
+ * GLoadableIcon:
+ *
+ * Generic type for all kinds of icons that can be loaded
+ * as a stream.
+ **/
+typedef struct _GLoadableIconIface GLoadableIconIface;
+
+/**
+ * GLoadableIconIface:
+ * @g_iface: The parent interface.
+ * @load: Loads an icon.
+ * @load_async: Loads an icon asynchronously.
+ * @load_finish: Finishes an asynchronous icon load.
+ *
+ * Interface for icons that can be loaded as a stream.
+ **/
+struct _GLoadableIconIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ GInputStream * (* load) (GLoadableIcon *icon,
+ int size,
+ char **type,
+ GCancellable *cancellable,
+ GError **error);
+ void (* load_async) (GLoadableIcon *icon,
+ int size,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GInputStream * (* load_finish) (GLoadableIcon *icon,
+ GAsyncResult *res,
+ char **type,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_loadable_icon_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GInputStream *g_loadable_icon_load (GLoadableIcon *icon,
+ int size,
+ char **type,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_loadable_icon_load_async (GLoadableIcon *icon,
+ int size,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GInputStream *g_loadable_icon_load_finish (GLoadableIcon *icon,
+ GAsyncResult *res,
+ char **type,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_LOADABLE_ICON_H__ */
diff --git a/include/glib/gio/gmemoryinputstream.h b/include/glib/gio/gmemoryinputstream.h
new file mode 100644
index 0000000000..7563fd6488
--- /dev/null
+++ b/include/glib/gio/gmemoryinputstream.h
@@ -0,0 +1,90 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Christian Kellner <gicmo@gnome.org>
+ */
+
+#ifndef __G_MEMORY_INPUT_STREAM_H__
+#define __G_MEMORY_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/ginputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_MEMORY_INPUT_STREAM (g_memory_input_stream_get_type ())
+#define G_MEMORY_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MEMORY_INPUT_STREAM, GMemoryInputStream))
+#define G_MEMORY_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_MEMORY_INPUT_STREAM, GMemoryInputStreamClass))
+#define G_IS_MEMORY_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MEMORY_INPUT_STREAM))
+#define G_IS_MEMORY_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_MEMORY_INPUT_STREAM))
+#define G_MEMORY_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_MEMORY_INPUT_STREAM, GMemoryInputStreamClass))
+
+/**
+ * GMemoryInputStream:
+ *
+ * Implements #GInputStream for arbitrary memory chunks.
+ **/
+typedef struct _GMemoryInputStreamClass GMemoryInputStreamClass;
+typedef struct _GMemoryInputStreamPrivate GMemoryInputStreamPrivate;
+
+struct _GMemoryInputStream
+{
+ GInputStream parent_instance;
+
+ /*< private >*/
+ GMemoryInputStreamPrivate *priv;
+};
+
+struct _GMemoryInputStreamClass
+{
+ GInputStreamClass parent_class;
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_memory_input_stream_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GInputStream * g_memory_input_stream_new (void);
+GLIB_AVAILABLE_IN_ALL
+GInputStream * g_memory_input_stream_new_from_data (const void *data,
+ gssize len,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_2_34
+GInputStream * g_memory_input_stream_new_from_bytes (GBytes *bytes);
+
+GLIB_AVAILABLE_IN_ALL
+void g_memory_input_stream_add_data (GMemoryInputStream *stream,
+ const void *data,
+ gssize len,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_2_34
+void g_memory_input_stream_add_bytes (GMemoryInputStream *stream,
+ GBytes *bytes);
+
+G_END_DECLS
+
+#endif /* __G_MEMORY_INPUT_STREAM_H__ */
diff --git a/include/glib/gio/gmemoryoutputstream.h b/include/glib/gio/gmemoryoutputstream.h
new file mode 100644
index 0000000000..5418d23d8a
--- /dev/null
+++ b/include/glib/gio/gmemoryoutputstream.h
@@ -0,0 +1,107 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Christian Kellner <gicmo@gnome.org>
+ */
+
+#ifndef __G_MEMORY_OUTPUT_STREAM_H__
+#define __G_MEMORY_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/goutputstream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_MEMORY_OUTPUT_STREAM (g_memory_output_stream_get_type ())
+#define G_MEMORY_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MEMORY_OUTPUT_STREAM, GMemoryOutputStream))
+#define G_MEMORY_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_MEMORY_OUTPUT_STREAM, GMemoryOutputStreamClass))
+#define G_IS_MEMORY_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MEMORY_OUTPUT_STREAM))
+#define G_IS_MEMORY_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_MEMORY_OUTPUT_STREAM))
+#define G_MEMORY_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_MEMORY_OUTPUT_STREAM, GMemoryOutputStreamClass))
+
+/**
+ * GMemoryOutputStream:
+ *
+ * Implements #GOutputStream for arbitrary memory chunks.
+ **/
+typedef struct _GMemoryOutputStreamClass GMemoryOutputStreamClass;
+typedef struct _GMemoryOutputStreamPrivate GMemoryOutputStreamPrivate;
+
+struct _GMemoryOutputStream
+{
+ GOutputStream parent_instance;
+
+ /*< private >*/
+ GMemoryOutputStreamPrivate *priv;
+};
+
+struct _GMemoryOutputStreamClass
+{
+ GOutputStreamClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+/**
+ * GReallocFunc:
+ * @data: memory block to reallocate
+ * @size: size to reallocate @data to
+ *
+ * Changes the size of the memory block pointed to by @data to
+ * @size bytes.
+ *
+ * The function should have the same semantics as realloc().
+ *
+ * Returns: a pointer to the reallocated memory
+ */
+typedef gpointer (* GReallocFunc) (gpointer data,
+ gsize size);
+
+GLIB_AVAILABLE_IN_ALL
+GType g_memory_output_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GOutputStream *g_memory_output_stream_new (gpointer data,
+ gsize size,
+ GReallocFunc realloc_function,
+ GDestroyNotify destroy_function);
+GLIB_AVAILABLE_IN_2_36
+GOutputStream *g_memory_output_stream_new_resizable (void);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_memory_output_stream_get_data (GMemoryOutputStream *ostream);
+GLIB_AVAILABLE_IN_ALL
+gsize g_memory_output_stream_get_size (GMemoryOutputStream *ostream);
+GLIB_AVAILABLE_IN_ALL
+gsize g_memory_output_stream_get_data_size (GMemoryOutputStream *ostream);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_memory_output_stream_steal_data (GMemoryOutputStream *ostream);
+
+GLIB_AVAILABLE_IN_2_34
+GBytes * g_memory_output_stream_steal_as_bytes (GMemoryOutputStream *ostream);
+
+G_END_DECLS
+
+#endif /* __G_MEMORY_OUTPUT_STREAM_H__ */
diff --git a/include/glib/gio/gmenu.h b/include/glib/gio/gmenu.h
new file mode 100644
index 0000000000..660943834b
--- /dev/null
+++ b/include/glib/gio/gmenu.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright © 2011 Canonical Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_MENU_H__
+#define __G_MENU_H__
+
+#include <gio/gmenumodel.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_MENU (g_menu_get_type ())
+#define G_MENU(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_MENU, GMenu))
+#define G_IS_MENU(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_MENU))
+
+#define G_TYPE_MENU_ITEM (g_menu_item_get_type ())
+#define G_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_MENU_ITEM, GMenuItem))
+#define G_IS_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_MENU_ITEM))
+
+typedef struct _GMenuItem GMenuItem;
+typedef struct _GMenu GMenu;
+
+GLIB_AVAILABLE_IN_2_32
+GType g_menu_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_32
+GMenu * g_menu_new (void);
+
+GLIB_AVAILABLE_IN_2_32
+void g_menu_freeze (GMenu *menu);
+
+GLIB_AVAILABLE_IN_2_32
+void g_menu_insert_item (GMenu *menu,
+ gint position,
+ GMenuItem *item);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_prepend_item (GMenu *menu,
+ GMenuItem *item);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_append_item (GMenu *menu,
+ GMenuItem *item);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_remove (GMenu *menu,
+ gint position);
+
+GLIB_AVAILABLE_IN_2_38
+void g_menu_remove_all (GMenu *menu);
+
+GLIB_AVAILABLE_IN_2_32
+void g_menu_insert (GMenu *menu,
+ gint position,
+ const gchar *label,
+ const gchar *detailed_action);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_prepend (GMenu *menu,
+ const gchar *label,
+ const gchar *detailed_action);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_append (GMenu *menu,
+ const gchar *label,
+ const gchar *detailed_action);
+
+GLIB_AVAILABLE_IN_2_32
+void g_menu_insert_section (GMenu *menu,
+ gint position,
+ const gchar *label,
+ GMenuModel *section);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_prepend_section (GMenu *menu,
+ const gchar *label,
+ GMenuModel *section);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_append_section (GMenu *menu,
+ const gchar *label,
+ GMenuModel *section);
+
+GLIB_AVAILABLE_IN_2_32
+void g_menu_insert_submenu (GMenu *menu,
+ gint position,
+ const gchar *label,
+ GMenuModel *submenu);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_prepend_submenu (GMenu *menu,
+ const gchar *label,
+ GMenuModel *submenu);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_append_submenu (GMenu *menu,
+ const gchar *label,
+ GMenuModel *submenu);
+
+
+GLIB_AVAILABLE_IN_2_32
+GType g_menu_item_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_32
+GMenuItem * g_menu_item_new (const gchar *label,
+ const gchar *detailed_action);
+
+GLIB_AVAILABLE_IN_2_34
+GMenuItem * g_menu_item_new_from_model (GMenuModel *model,
+ gint item_index);
+
+GLIB_AVAILABLE_IN_2_32
+GMenuItem * g_menu_item_new_submenu (const gchar *label,
+ GMenuModel *submenu);
+
+GLIB_AVAILABLE_IN_2_32
+GMenuItem * g_menu_item_new_section (const gchar *label,
+ GMenuModel *section);
+
+GLIB_AVAILABLE_IN_2_34
+GVariant * g_menu_item_get_attribute_value (GMenuItem *menu_item,
+ const gchar *attribute,
+ const GVariantType *expected_type);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_menu_item_get_attribute (GMenuItem *menu_item,
+ const gchar *attribute,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_2_34
+GMenuModel *g_menu_item_get_link (GMenuItem *menu_item,
+ const gchar *link);
+
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_attribute_value (GMenuItem *menu_item,
+ const gchar *attribute,
+ GVariant *value);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_attribute (GMenuItem *menu_item,
+ const gchar *attribute,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_link (GMenuItem *menu_item,
+ const gchar *link,
+ GMenuModel *model);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_label (GMenuItem *menu_item,
+ const gchar *label);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_submenu (GMenuItem *menu_item,
+ GMenuModel *submenu);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_section (GMenuItem *menu_item,
+ GMenuModel *section);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_action_and_target_value (GMenuItem *menu_item,
+ const gchar *action,
+ GVariant *target_value);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_action_and_target (GMenuItem *menu_item,
+ const gchar *action,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_2_32
+void g_menu_item_set_detailed_action (GMenuItem *menu_item,
+ const gchar *detailed_action);
+
+GLIB_AVAILABLE_IN_2_38
+void g_menu_item_set_icon (GMenuItem *menu_item,
+ GIcon *icon);
+
+G_END_DECLS
+
+#endif /* __G_MENU_H__ */
diff --git a/include/glib/gio/gmenuexporter.h b/include/glib/gio/gmenuexporter.h
new file mode 100644
index 0000000000..650aaf0ed6
--- /dev/null
+++ b/include/glib/gio/gmenuexporter.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright © 2011 Canonical Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_MENU_EXPORTER_H__
+#define __G_MENU_EXPORTER_H__
+
+#include <gio/gdbusconnection.h>
+#include <gio/gmenumodel.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_32
+guint g_dbus_connection_export_menu_model (GDBusConnection *connection,
+ const gchar *object_path,
+ GMenuModel *menu,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_32
+void g_dbus_connection_unexport_menu_model (GDBusConnection *connection,
+ guint export_id);
+
+G_END_DECLS
+
+#endif /* __G_MENU_EXPORTER_H__ */
diff --git a/include/glib/gio/gmenumodel.h b/include/glib/gio/gmenumodel.h
new file mode 100644
index 0000000000..34c8d0f39a
--- /dev/null
+++ b/include/glib/gio/gmenumodel.h
@@ -0,0 +1,305 @@
+/*
+ * Copyright © 2011 Canonical Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_MENU_MODEL_H__
+#define __G_MENU_MODEL_H__
+
+#include <glib-object.h>
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_MENU_ATTRIBUTE_ACTION:
+ *
+ * The menu item attribute which holds the action name of the item. Action
+ * names are namespaced with an identifier for the action group in which the
+ * action resides. For example, "win." for window-specific actions and "app."
+ * for application-wide actions.
+ *
+ * See also g_menu_model_get_item_attribute() and g_menu_item_set_attribute().
+ *
+ * Since: 2.32
+ **/
+#define G_MENU_ATTRIBUTE_ACTION "action"
+
+/**
+ * G_MENU_ATTRIBUTE_ACTION_NAMESPACE:
+ *
+ * The menu item attribute that holds the namespace for all action names in
+ * menus that are linked from this item.
+ *
+ * Since: 2.36
+ **/
+#define G_MENU_ATTRIBUTE_ACTION_NAMESPACE "action-namespace"
+
+/**
+ * G_MENU_ATTRIBUTE_TARGET:
+ *
+ * The menu item attribute which holds the target with which the item's action
+ * will be activated.
+ *
+ * See also g_menu_item_set_action_and_target()
+ *
+ * Since: 2.32
+ **/
+#define G_MENU_ATTRIBUTE_TARGET "target"
+
+/**
+ * G_MENU_ATTRIBUTE_LABEL:
+ *
+ * The menu item attribute which holds the label of the item.
+ *
+ * Since: 2.32
+ **/
+#define G_MENU_ATTRIBUTE_LABEL "label"
+
+/**
+ * G_MENU_ATTRIBUTE_ICON:
+ *
+ * The menu item attribute which holds the icon of the item.
+ *
+ * The icon is stored in the format returned by g_icon_serialize().
+ *
+ * This attribute is intended only to represent 'noun' icons such as
+ * favicons for a webpage, or application icons. It should not be used
+ * for 'verbs' (ie: stock icons).
+ *
+ * Since: 2.38
+ **/
+#define G_MENU_ATTRIBUTE_ICON "icon"
+
+/**
+ * G_MENU_LINK_SUBMENU:
+ *
+ * The name of the link that associates a menu item with a submenu.
+ *
+ * See also g_menu_item_set_link().
+ *
+ * Since: 2.32
+ **/
+#define G_MENU_LINK_SUBMENU "submenu"
+
+/**
+ * G_MENU_LINK_SECTION:
+ *
+ * The name of the link that associates a menu item with a section. The linked
+ * menu will usually be shown in place of the menu item, using the item's label
+ * as a header.
+ *
+ * See also g_menu_item_set_link().
+ *
+ * Since: 2.32
+ **/
+#define G_MENU_LINK_SECTION "section"
+
+#define G_TYPE_MENU_MODEL (g_menu_model_get_type ())
+#define G_MENU_MODEL(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_MENU_MODEL, GMenuModel))
+#define G_MENU_MODEL_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_MENU_MODEL, GMenuModelClass))
+#define G_IS_MENU_MODEL(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_MENU_MODEL))
+#define G_IS_MENU_MODEL_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_MENU_MODEL))
+#define G_MENU_MODEL_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_MENU_MODEL, GMenuModelClass))
+
+typedef struct _GMenuModelPrivate GMenuModelPrivate;
+typedef struct _GMenuModelClass GMenuModelClass;
+
+typedef struct _GMenuAttributeIterPrivate GMenuAttributeIterPrivate;
+typedef struct _GMenuAttributeIterClass GMenuAttributeIterClass;
+typedef struct _GMenuAttributeIter GMenuAttributeIter;
+
+typedef struct _GMenuLinkIterPrivate GMenuLinkIterPrivate;
+typedef struct _GMenuLinkIterClass GMenuLinkIterClass;
+typedef struct _GMenuLinkIter GMenuLinkIter;
+
+struct _GMenuModel
+{
+ GObject parent_instance;
+ GMenuModelPrivate *priv;
+};
+
+/**
+ * GMenuModelClass::get_item_attributes:
+ * @model: the #GMenuModel to query
+ * @item_index: The #GMenuItem to query
+ * @attributes: (out) (element-type utf8 GLib.Variant): Attributes on the item
+ *
+ * Gets all the attributes associated with the item in the menu model.
+ */
+/**
+ * GMenuModelClass::get_item_links:
+ * @model: the #GMenuModel to query
+ * @item_index: The #GMenuItem to query
+ * @links: (out) (element-type utf8 Gio.MenuModel): Links from the item
+ *
+ * Gets all the links associated with the item in the menu model.
+ */
+struct _GMenuModelClass
+{
+ GObjectClass parent_class;
+
+ gboolean (*is_mutable) (GMenuModel *model);
+ gint (*get_n_items) (GMenuModel *model);
+ void (*get_item_attributes) (GMenuModel *model,
+ gint item_index,
+ GHashTable **attributes);
+ GMenuAttributeIter * (*iterate_item_attributes) (GMenuModel *model,
+ gint item_index);
+ GVariant * (*get_item_attribute_value) (GMenuModel *model,
+ gint item_index,
+ const gchar *attribute,
+ const GVariantType *expected_type);
+ void (*get_item_links) (GMenuModel *model,
+ gint item_index,
+ GHashTable **links);
+ GMenuLinkIter * (*iterate_item_links) (GMenuModel *model,
+ gint item_index);
+ GMenuModel * (*get_item_link) (GMenuModel *model,
+ gint item_index,
+ const gchar *link);
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_menu_model_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_menu_model_is_mutable (GMenuModel *model);
+GLIB_AVAILABLE_IN_2_32
+gint g_menu_model_get_n_items (GMenuModel *model);
+
+GLIB_AVAILABLE_IN_2_32
+GMenuAttributeIter * g_menu_model_iterate_item_attributes (GMenuModel *model,
+ gint item_index);
+GLIB_AVAILABLE_IN_2_32
+GVariant * g_menu_model_get_item_attribute_value (GMenuModel *model,
+ gint item_index,
+ const gchar *attribute,
+ const GVariantType *expected_type);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_menu_model_get_item_attribute (GMenuModel *model,
+ gint item_index,
+ const gchar *attribute,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_2_32
+GMenuLinkIter * g_menu_model_iterate_item_links (GMenuModel *model,
+ gint item_index);
+GLIB_AVAILABLE_IN_2_32
+GMenuModel * g_menu_model_get_item_link (GMenuModel *model,
+ gint item_index,
+ const gchar *link);
+
+GLIB_AVAILABLE_IN_2_32
+void g_menu_model_items_changed (GMenuModel *model,
+ gint position,
+ gint removed,
+ gint added);
+
+
+#define G_TYPE_MENU_ATTRIBUTE_ITER (g_menu_attribute_iter_get_type ())
+#define G_MENU_ATTRIBUTE_ITER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_MENU_ATTRIBUTE_ITER, GMenuAttributeIter))
+#define G_MENU_ATTRIBUTE_ITER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_MENU_ATTRIBUTE_ITER, GMenuAttributeIterClass))
+#define G_IS_MENU_ATTRIBUTE_ITER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_MENU_ATTRIBUTE_ITER))
+#define G_IS_MENU_ATTRIBUTE_ITER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_MENU_ATTRIBUTE_ITER))
+#define G_MENU_ATTRIBUTE_ITER_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_MENU_ATTRIBUTE_ITER, GMenuAttributeIterClass))
+
+struct _GMenuAttributeIter
+{
+ GObject parent_instance;
+ GMenuAttributeIterPrivate *priv;
+};
+
+struct _GMenuAttributeIterClass
+{
+ GObjectClass parent_class;
+
+ gboolean (*get_next) (GMenuAttributeIter *iter,
+ const gchar **out_name,
+ GVariant **value);
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_menu_attribute_iter_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_menu_attribute_iter_get_next (GMenuAttributeIter *iter,
+ const gchar **out_name,
+ GVariant **value);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_menu_attribute_iter_next (GMenuAttributeIter *iter);
+GLIB_AVAILABLE_IN_2_32
+const gchar * g_menu_attribute_iter_get_name (GMenuAttributeIter *iter);
+GLIB_AVAILABLE_IN_2_32
+GVariant * g_menu_attribute_iter_get_value (GMenuAttributeIter *iter);
+
+
+#define G_TYPE_MENU_LINK_ITER (g_menu_link_iter_get_type ())
+#define G_MENU_LINK_ITER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_MENU_LINK_ITER, GMenuLinkIter))
+#define G_MENU_LINK_ITER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_MENU_LINK_ITER, GMenuLinkIterClass))
+#define G_IS_MENU_LINK_ITER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_MENU_LINK_ITER))
+#define G_IS_MENU_LINK_ITER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_MENU_LINK_ITER))
+#define G_MENU_LINK_ITER_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_MENU_LINK_ITER, GMenuLinkIterClass))
+
+struct _GMenuLinkIter
+{
+ GObject parent_instance;
+ GMenuLinkIterPrivate *priv;
+};
+
+struct _GMenuLinkIterClass
+{
+ GObjectClass parent_class;
+
+ gboolean (*get_next) (GMenuLinkIter *iter,
+ const gchar **out_link,
+ GMenuModel **value);
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_menu_link_iter_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_menu_link_iter_get_next (GMenuLinkIter *iter,
+ const gchar **out_link,
+ GMenuModel **value);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_menu_link_iter_next (GMenuLinkIter *iter);
+GLIB_AVAILABLE_IN_2_32
+const gchar * g_menu_link_iter_get_name (GMenuLinkIter *iter);
+GLIB_AVAILABLE_IN_2_32
+GMenuModel * g_menu_link_iter_get_value (GMenuLinkIter *iter);
+
+G_END_DECLS
+
+#endif /* __G_MENU_MODEL_H__ */
diff --git a/include/glib/gio/gmount.h b/include/glib/gio/gmount.h
new file mode 100644
index 0000000000..c376a6135a
--- /dev/null
+++ b/include/glib/gio/gmount.h
@@ -0,0 +1,276 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ * David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_MOUNT_H__
+#define __G_MOUNT_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_MOUNT (g_mount_get_type ())
+#define G_MOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_MOUNT, GMount))
+#define G_IS_MOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_MOUNT))
+#define G_MOUNT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_MOUNT, GMountIface))
+
+typedef struct _GMountIface GMountIface;
+
+/**
+ * GMountIface:
+ * @g_iface: The parent interface.
+ * @changed: Changed signal that is emitted when the mount's state has changed.
+ * @unmounted: The unmounted signal that is emitted when the #GMount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.
+ * @pre_unmount: The ::pre-unmount signal that is emitted when the #GMount will soon be emitted. If the recipient is somehow holding the mount open by keeping an open file on it it should close the file.
+ * @get_root: Gets a #GFile to the root directory of the #GMount.
+ * @get_name: Gets a string containing the name of the #GMount.
+ * @get_icon: Gets a #GIcon for the #GMount.
+ * @get_uuid: Gets the UUID for the #GMount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns %NULL if there is no UUID available.
+ * @get_volume: Gets a #GVolume the mount is located on. Returns %NULL if the #GMount is not associated with a #GVolume.
+ * @get_drive: Gets a #GDrive the volume of the mount is located on. Returns %NULL if the #GMount is not associated with a #GDrive or a #GVolume. This is convenience method for getting the #GVolume and using that to get the #GDrive.
+ * @can_unmount: Checks if a #GMount can be unmounted.
+ * @can_eject: Checks if a #GMount can be ejected.
+ * @unmount: Starts unmounting a #GMount.
+ * @unmount_finish: Finishes an unmounting operation.
+ * @eject: Starts ejecting a #GMount.
+ * @eject_finish: Finishes an eject operation.
+ * @remount: Starts remounting a #GMount.
+ * @remount_finish: Finishes a remounting operation.
+ * @guess_content_type: Starts guessing the type of the content of a #GMount.
+ * See g_mount_guess_content_type() for more information on content
+ * type guessing. This operation was added in 2.18.
+ * @guess_content_type_finish: Finishes a content type guessing operation. Added in 2.18.
+ * @guess_content_type_sync: Synchronous variant of @guess_content_type. Added in 2.18
+ * @unmount_with_operation: Starts unmounting a #GMount using a #GMountOperation. Since 2.22.
+ * @unmount_with_operation_finish: Finishes an unmounting operation using a #GMountOperation. Since 2.22.
+ * @eject_with_operation: Starts ejecting a #GMount using a #GMountOperation. Since 2.22.
+ * @eject_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
+ * @get_default_location: Gets a #GFile indication a start location that can be use as the entry point for this mount. Since 2.24.
+ * @get_sort_key: Gets a key used for sorting #GMount instance or %NULL if no such key exists. Since 2.32.
+ * @get_symbolic_icon: Gets a symbolic #GIcon for the #GMount. Since 2.34.
+ *
+ * Interface for implementing operations for mounts.
+ **/
+struct _GMountIface
+{
+ GTypeInterface g_iface;
+
+ /* signals */
+
+ void (* changed) (GMount *mount);
+ void (* unmounted) (GMount *mount);
+
+ /* Virtual Table */
+
+ GFile * (* get_root) (GMount *mount);
+ char * (* get_name) (GMount *mount);
+ GIcon * (* get_icon) (GMount *mount);
+ char * (* get_uuid) (GMount *mount);
+ GVolume * (* get_volume) (GMount *mount);
+ GDrive * (* get_drive) (GMount *mount);
+ gboolean (* can_unmount) (GMount *mount);
+ gboolean (* can_eject) (GMount *mount);
+
+ void (* unmount) (GMount *mount,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* unmount_finish) (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* eject) (GMount *mount,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_finish) (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* remount) (GMount *mount,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* remount_finish) (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* guess_content_type) (GMount *mount,
+ gboolean force_rescan,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gchar ** (* guess_content_type_finish) (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+ gchar ** (* guess_content_type_sync) (GMount *mount,
+ gboolean force_rescan,
+ GCancellable *cancellable,
+ GError **error);
+
+ /* Signal, not VFunc */
+ void (* pre_unmount) (GMount *mount);
+
+ void (* unmount_with_operation) (GMount *mount,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* unmount_with_operation_finish) (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+ void (* eject_with_operation) (GMount *mount,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_with_operation_finish) (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+ GFile * (* get_default_location) (GMount *mount);
+
+ const gchar * (* get_sort_key) (GMount *mount);
+ GIcon * (* get_symbolic_icon) (GMount *mount);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_mount_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GFile * g_mount_get_root (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_mount_get_default_location (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+char * g_mount_get_name (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_mount_get_icon (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_mount_get_symbolic_icon (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+char * g_mount_get_uuid (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+GVolume * g_mount_get_volume (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+GDrive * g_mount_get_drive (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mount_can_unmount (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mount_can_eject (GMount *mount);
+
+GLIB_DEPRECATED_FOR(g_mount_unmount_with_operation)
+void g_mount_unmount (GMount *mount,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_DEPRECATED_FOR(g_mount_unmount_with_operation_finish)
+gboolean g_mount_unmount_finish (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_DEPRECATED_FOR(g_mount_eject_with_operation)
+void g_mount_eject (GMount *mount,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_DEPRECATED_FOR(g_mount_eject_with_operation_finish)
+gboolean g_mount_eject_finish (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_mount_remount (GMount *mount,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mount_remount_finish (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_mount_guess_content_type (GMount *mount,
+ gboolean force_rescan,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_mount_guess_content_type_finish (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_mount_guess_content_type_sync (GMount *mount,
+ gboolean force_rescan,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mount_is_shadowed (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_shadow (GMount *mount);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_unshadow (GMount *mount);
+
+GLIB_AVAILABLE_IN_ALL
+void g_mount_unmount_with_operation (GMount *mount,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mount_unmount_with_operation_finish (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_mount_eject_with_operation (GMount *mount,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mount_eject_with_operation_finish (GMount *mount,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_mount_get_sort_key (GMount *mount);
+
+G_END_DECLS
+
+#endif /* __G_MOUNT_H__ */
diff --git a/include/glib/gio/gmountoperation.h b/include/glib/gio/gmountoperation.h
new file mode 100644
index 0000000000..56db2a577f
--- /dev/null
+++ b/include/glib/gio/gmountoperation.h
@@ -0,0 +1,177 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_MOUNT_OPERATION_H__
+#define __G_MOUNT_OPERATION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_MOUNT_OPERATION (g_mount_operation_get_type ())
+#define G_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MOUNT_OPERATION, GMountOperation))
+#define G_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
+#define G_IS_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MOUNT_OPERATION))
+#define G_IS_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_MOUNT_OPERATION))
+#define G_MOUNT_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
+
+/**
+ * GMountOperation:
+ *
+ * Class for providing authentication methods for mounting operations,
+ * such as mounting a file locally, or authenticating with a server.
+ **/
+typedef struct _GMountOperationClass GMountOperationClass;
+typedef struct _GMountOperationPrivate GMountOperationPrivate;
+
+struct _GMountOperation
+{
+ GObject parent_instance;
+
+ GMountOperationPrivate *priv;
+};
+
+struct _GMountOperationClass
+{
+ GObjectClass parent_class;
+
+ /* signals: */
+
+ void (* ask_password) (GMountOperation *op,
+ const char *message,
+ const char *default_user,
+ const char *default_domain,
+ GAskPasswordFlags flags);
+
+ /**
+ * GMountOperationClass::ask_question:
+ * @op: a #GMountOperation
+ * @message: string containing a message to display to the user
+ * @choices: (array zero-terminated=1) (element-type utf8): an array of
+ * strings for each possible choice
+ *
+ * Virtual implementation of #GMountOperation::ask-question.
+ */
+ void (* ask_question) (GMountOperation *op,
+ const char *message,
+ const char *choices[]);
+
+ void (* reply) (GMountOperation *op,
+ GMountOperationResult result);
+
+ void (* aborted) (GMountOperation *op);
+
+ /**
+ * GMountOperationClass::show_processes:
+ * @op: a #GMountOperation
+ * @message: string containing a message to display to the user
+ * @processes: (element-type GPid): an array of #GPid for processes blocking
+ * the operation
+ * @choices: (array zero-terminated=1) (element-type utf8): an array of
+ * strings for each possible choice
+ *
+ * Virtual implementation of #GMountOperation::show-processes.
+ *
+ * Since: 2.22
+ */
+ void (* show_processes) (GMountOperation *op,
+ const gchar *message,
+ GArray *processes,
+ const gchar *choices[]);
+
+ void (* show_unmount_progress) (GMountOperation *op,
+ const gchar *message,
+ gint64 time_left,
+ gint64 bytes_left);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+ void (*_g_reserved7) (void);
+ void (*_g_reserved8) (void);
+ void (*_g_reserved9) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_mount_operation_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GMountOperation * g_mount_operation_new (void);
+
+GLIB_AVAILABLE_IN_ALL
+const char * g_mount_operation_get_username (GMountOperation *op);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_operation_set_username (GMountOperation *op,
+ const char *username);
+GLIB_AVAILABLE_IN_ALL
+const char * g_mount_operation_get_password (GMountOperation *op);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_operation_set_password (GMountOperation *op,
+ const char *password);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mount_operation_get_anonymous (GMountOperation *op);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_operation_set_anonymous (GMountOperation *op,
+ gboolean anonymous);
+GLIB_AVAILABLE_IN_ALL
+const char * g_mount_operation_get_domain (GMountOperation *op);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_operation_set_domain (GMountOperation *op,
+ const char *domain);
+GLIB_AVAILABLE_IN_ALL
+GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_operation_set_password_save (GMountOperation *op,
+ GPasswordSave save);
+GLIB_AVAILABLE_IN_ALL
+int g_mount_operation_get_choice (GMountOperation *op);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_operation_set_choice (GMountOperation *op,
+ int choice);
+GLIB_AVAILABLE_IN_ALL
+void g_mount_operation_reply (GMountOperation *op,
+ GMountOperationResult result);
+GLIB_AVAILABLE_IN_2_58
+gboolean g_mount_operation_get_is_tcrypt_hidden_volume (GMountOperation *op);
+GLIB_AVAILABLE_IN_2_58
+void g_mount_operation_set_is_tcrypt_hidden_volume (GMountOperation *op,
+ gboolean hidden_volume);
+GLIB_AVAILABLE_IN_2_58
+gboolean g_mount_operation_get_is_tcrypt_system_volume (GMountOperation *op);
+GLIB_AVAILABLE_IN_2_58
+void g_mount_operation_set_is_tcrypt_system_volume (GMountOperation *op,
+ gboolean system_volume);
+GLIB_AVAILABLE_IN_2_58
+guint g_mount_operation_get_pim (GMountOperation *op);
+GLIB_AVAILABLE_IN_2_58
+void g_mount_operation_set_pim (GMountOperation *op,
+ guint pim);
+
+G_END_DECLS
+
+#endif /* __G_MOUNT_OPERATION_H__ */
diff --git a/include/glib/gio/gnativesocketaddress.h b/include/glib/gio/gnativesocketaddress.h
new file mode 100644
index 0000000000..032cd00a45
--- /dev/null
+++ b/include/glib/gio/gnativesocketaddress.h
@@ -0,0 +1,65 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Kellner <gicmo@gnome.org>
+ * Samuel Cormier-Iijima <sciyoshi@gmail.com>
+ */
+
+#ifndef __G_NATIVE_SOCKET_ADDRESS_H__
+#define __G_NATIVE_SOCKET_ADDRESS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gsocketaddress.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_NATIVE_SOCKET_ADDRESS (g_native_socket_address_get_type ())
+#define G_NATIVE_SOCKET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NATIVE_SOCKET_ADDRESS, GNativeSocketAddress))
+#define G_NATIVE_SOCKET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_NATIVE_SOCKET_ADDRESS, GNativeSocketAddressClass))
+#define G_IS_NATIVE_SOCKET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NATIVE_SOCKET_ADDRESS))
+#define G_IS_NATIVE_SOCKET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_NATIVE_SOCKET_ADDRESS))
+#define G_NATIVE_SOCKET_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_NATIVE_SOCKET_ADDRESS, GNativeSocketAddressClass))
+
+typedef struct _GNativeSocketAddressClass GNativeSocketAddressClass;
+typedef struct _GNativeSocketAddressPrivate GNativeSocketAddressPrivate;
+
+struct _GNativeSocketAddress
+{
+ GSocketAddress parent_instance;
+
+ /*< private >*/
+ GNativeSocketAddressPrivate *priv;
+};
+
+struct _GNativeSocketAddressClass
+{
+ GSocketAddressClass parent_class;
+};
+
+GLIB_AVAILABLE_IN_2_46
+GType g_native_socket_address_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_46
+GSocketAddress *g_native_socket_address_new (gpointer native,
+ gsize len);
+
+G_END_DECLS
+
+#endif /* __G_NATIVE_SOCKET_ADDRESS_H__ */
diff --git a/include/glib/gio/gnativevolumemonitor.h b/include/glib/gio/gnativevolumemonitor.h
new file mode 100644
index 0000000000..739054705c
--- /dev/null
+++ b/include/glib/gio/gnativevolumemonitor.h
@@ -0,0 +1,61 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_NATIVE_VOLUME_MONITOR_H__
+#define __G_NATIVE_VOLUME_MONITOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gvolumemonitor.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_NATIVE_VOLUME_MONITOR (g_native_volume_monitor_get_type ())
+#define G_NATIVE_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NATIVE_VOLUME_MONITOR, GNativeVolumeMonitor))
+#define G_NATIVE_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_NATIVE_VOLUME_MONITOR, GNativeVolumeMonitorClass))
+#define G_IS_NATIVE_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NATIVE_VOLUME_MONITOR))
+#define G_IS_NATIVE_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_NATIVE_VOLUME_MONITOR))
+
+#define G_NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME "gio-native-volume-monitor"
+
+typedef struct _GNativeVolumeMonitor GNativeVolumeMonitor;
+typedef struct _GNativeVolumeMonitorClass GNativeVolumeMonitorClass;
+
+struct _GNativeVolumeMonitor
+{
+ GVolumeMonitor parent_instance;
+};
+
+struct _GNativeVolumeMonitorClass
+{
+ GVolumeMonitorClass parent_class;
+
+ GMount * (* get_mount_for_mount_path) (const char *mount_path,
+ GCancellable *cancellable);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_native_volume_monitor_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __G_NATIVE_VOLUME_MONITOR_H__ */
diff --git a/include/glib/gio/gnetworkaddress.h b/include/glib/gio/gnetworkaddress.h
new file mode 100644
index 0000000000..10bb0b5021
--- /dev/null
+++ b/include/glib/gio/gnetworkaddress.h
@@ -0,0 +1,80 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_NETWORK_ADDRESS_H__
+#define __G_NETWORK_ADDRESS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_NETWORK_ADDRESS (g_network_address_get_type ())
+#define G_NETWORK_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NETWORK_ADDRESS, GNetworkAddress))
+#define G_NETWORK_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_NETWORK_ADDRESS, GNetworkAddressClass))
+#define G_IS_NETWORK_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NETWORK_ADDRESS))
+#define G_IS_NETWORK_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_NETWORK_ADDRESS))
+#define G_NETWORK_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_NETWORK_ADDRESS, GNetworkAddressClass))
+
+typedef struct _GNetworkAddressClass GNetworkAddressClass;
+typedef struct _GNetworkAddressPrivate GNetworkAddressPrivate;
+
+struct _GNetworkAddress
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GNetworkAddressPrivate *priv;
+};
+
+struct _GNetworkAddressClass
+{
+ GObjectClass parent_class;
+
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_network_address_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketConnectable *g_network_address_new (const gchar *hostname,
+ guint16 port);
+GLIB_AVAILABLE_IN_2_44
+GSocketConnectable *g_network_address_new_loopback (guint16 port);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnectable *g_network_address_parse (const gchar *host_and_port,
+ guint16 default_port,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnectable *g_network_address_parse_uri (const gchar *uri,
+ guint16 default_port,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_network_address_get_hostname (GNetworkAddress *addr);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_network_address_get_port (GNetworkAddress *addr);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_network_address_get_scheme (GNetworkAddress *addr);
+
+
+G_END_DECLS
+
+#endif /* __G_NETWORK_ADDRESS_H__ */
diff --git a/include/glib/gio/gnetworking.h b/include/glib/gio/gnetworking.h
new file mode 100644
index 0000000000..1327c9931f
--- /dev/null
+++ b/include/glib/gio/gnetworking.h
@@ -0,0 +1,82 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008-2011 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_NETWORKING_H__
+#define __G_NETWORKING_H__
+
+#include <glib.h>
+
+#ifdef G_OS_WIN32
+
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windns.h>
+#include <mswsock.h>
+#include <wspiapi.h>
+#include <iphlpapi.h>
+#undef interface
+
+#else /* !G_OS_WIN32 */
+
+#include <sys/types.h>
+
+#include <netdb.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <resolv.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <net/if.h>
+
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+
+#ifndef T_SRV
+#define T_SRV 33
+#endif
+
+#ifndef _PATH_RESCONF
+#define _PATH_RESCONF "/etc/resolv.conf"
+#endif
+
+#ifndef CMSG_LEN
+/* CMSG_LEN and CMSG_SPACE are defined by RFC 2292, but missing on
+ * some older platforms.
+ */
+#define CMSG_LEN(len) ((size_t)CMSG_DATA((struct cmsghdr *)NULL) + (len))
+
+/* CMSG_SPACE must add at least as much padding as CMSG_NXTHDR()
+ * adds. We overestimate here.
+ */
+#define GLIB_ALIGN_TO_SIZEOF(len, obj) (((len) + sizeof (obj) - 1) & ~(sizeof (obj) - 1))
+#define CMSG_SPACE(len) GLIB_ALIGN_TO_SIZEOF (CMSG_LEN (len), struct cmsghdr)
+#endif
+#endif
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_36
+void g_networking_init (void);
+
+G_END_DECLS
+
+#endif /* __G_NETWORKING_H__ */
diff --git a/include/glib/gio/gnetworkmonitor.h b/include/glib/gio/gnetworkmonitor.h
new file mode 100644
index 0000000000..dcaeaad33f
--- /dev/null
+++ b/include/glib/gio/gnetworkmonitor.h
@@ -0,0 +1,99 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2011 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_NETWORK_MONITOR_H__
+#define __G_NETWORK_MONITOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_NETWORK_MONITOR_EXTENSION_POINT_NAME:
+ *
+ * Extension point for network status monitoring functionality.
+ * See [Extending GIO][extending-gio].
+ *
+ * Since: 2.30
+ */
+#define G_NETWORK_MONITOR_EXTENSION_POINT_NAME "gio-network-monitor"
+
+#define G_TYPE_NETWORK_MONITOR (g_network_monitor_get_type ())
+#define G_NETWORK_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NETWORK_MONITOR, GNetworkMonitor))
+#define G_IS_NETWORK_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NETWORK_MONITOR))
+#define G_NETWORK_MONITOR_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_NETWORK_MONITOR, GNetworkMonitorInterface))
+
+typedef struct _GNetworkMonitorInterface GNetworkMonitorInterface;
+
+struct _GNetworkMonitorInterface {
+ GTypeInterface g_iface;
+
+ void (*network_changed) (GNetworkMonitor *monitor,
+ gboolean network_available);
+
+ gboolean (*can_reach) (GNetworkMonitor *monitor,
+ GSocketConnectable *connectable,
+ GCancellable *cancellable,
+ GError **error);
+ void (*can_reach_async) (GNetworkMonitor *monitor,
+ GSocketConnectable *connectable,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*can_reach_finish) (GNetworkMonitor *monitor,
+ GAsyncResult *result,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_network_monitor_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_32
+GNetworkMonitor *g_network_monitor_get_default (void);
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_network_monitor_get_network_available (GNetworkMonitor *monitor);
+
+GLIB_AVAILABLE_IN_2_46
+gboolean g_network_monitor_get_network_metered (GNetworkMonitor *monitor);
+
+GLIB_AVAILABLE_IN_2_44
+GNetworkConnectivity g_network_monitor_get_connectivity (GNetworkMonitor *monitor);
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_network_monitor_can_reach (GNetworkMonitor *monitor,
+ GSocketConnectable *connectable,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+void g_network_monitor_can_reach_async (GNetworkMonitor *monitor,
+ GSocketConnectable *connectable,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_network_monitor_can_reach_finish (GNetworkMonitor *monitor,
+ GAsyncResult *result,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_NETWORK_MONITOR_H__ */
diff --git a/include/glib/gio/gnetworkservice.h b/include/glib/gio/gnetworkservice.h
new file mode 100644
index 0000000000..9cdb4ab47b
--- /dev/null
+++ b/include/glib/gio/gnetworkservice.h
@@ -0,0 +1,76 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_NETWORK_SERVICE_H__
+#define __G_NETWORK_SERVICE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_NETWORK_SERVICE (g_network_service_get_type ())
+#define G_NETWORK_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NETWORK_SERVICE, GNetworkService))
+#define G_NETWORK_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_NETWORK_SERVICE, GNetworkServiceClass))
+#define G_IS_NETWORK_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NETWORK_SERVICE))
+#define G_IS_NETWORK_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_NETWORK_SERVICE))
+#define G_NETWORK_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_NETWORK_SERVICE, GNetworkServiceClass))
+
+typedef struct _GNetworkServiceClass GNetworkServiceClass;
+typedef struct _GNetworkServicePrivate GNetworkServicePrivate;
+
+struct _GNetworkService
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GNetworkServicePrivate *priv;
+};
+
+struct _GNetworkServiceClass
+{
+ GObjectClass parent_class;
+
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_network_service_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketConnectable *g_network_service_new (const gchar *service,
+ const gchar *protocol,
+ const gchar *domain);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_network_service_get_service (GNetworkService *srv);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_network_service_get_protocol (GNetworkService *srv);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_network_service_get_domain (GNetworkService *srv);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_network_service_get_scheme (GNetworkService *srv);
+GLIB_AVAILABLE_IN_ALL
+void g_network_service_set_scheme (GNetworkService *srv, const gchar *scheme);
+
+G_END_DECLS
+
+#endif /* __G_NETWORK_SERVICE_H__ */
+
diff --git a/include/glib/gio/gnotification.h b/include/glib/gio/gnotification.h
new file mode 100644
index 0000000000..55e6830128
--- /dev/null
+++ b/include/glib/gio/gnotification.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright © 2013 Lars Uebernickel
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Lars Uebernickel <lars@uebernic.de>
+ */
+
+#ifndef __G_NOTIFICATION_H__
+#define __G_NOTIFICATION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+#include <gio/gioenums.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_NOTIFICATION (g_notification_get_type ())
+#define G_NOTIFICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NOTIFICATION, GNotification))
+#define G_IS_NOTIFICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NOTIFICATION))
+
+GLIB_AVAILABLE_IN_2_40
+GType g_notification_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_40
+GNotification * g_notification_new (const gchar *title);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_set_title (GNotification *notification,
+ const gchar *title);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_set_body (GNotification *notification,
+ const gchar *body);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_set_icon (GNotification *notification,
+ GIcon *icon);
+
+GLIB_DEPRECATED_IN_2_42_FOR(g_notification_set_priority)
+void g_notification_set_urgent (GNotification *notification,
+ gboolean urgent);
+
+GLIB_AVAILABLE_IN_2_42
+void g_notification_set_priority (GNotification *notification,
+ GNotificationPriority priority);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_add_button (GNotification *notification,
+ const gchar *label,
+ const gchar *detailed_action);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_add_button_with_target (GNotification *notification,
+ const gchar *label,
+ const gchar *action,
+ const gchar *target_format,
+ ...);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_add_button_with_target_value (GNotification *notification,
+ const gchar *label,
+ const gchar *action,
+ GVariant *target);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_set_default_action (GNotification *notification,
+ const gchar *detailed_action);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_set_default_action_and_target (GNotification *notification,
+ const gchar *action,
+ const gchar *target_format,
+ ...);
+
+GLIB_AVAILABLE_IN_2_40
+void g_notification_set_default_action_and_target_value (GNotification *notification,
+ const gchar *action,
+ GVariant *target);
+
+G_END_DECLS
+
+#endif
diff --git a/include/glib/gio/goutputstream.h b/include/glib/gio/goutputstream.h
new file mode 100644
index 0000000000..dc0f4925af
--- /dev/null
+++ b/include/glib/gio/goutputstream.h
@@ -0,0 +1,332 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_OUTPUT_STREAM_H__
+#define __G_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_OUTPUT_STREAM (g_output_stream_get_type ())
+#define G_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_OUTPUT_STREAM, GOutputStream))
+#define G_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_OUTPUT_STREAM, GOutputStreamClass))
+#define G_IS_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_OUTPUT_STREAM))
+#define G_IS_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_OUTPUT_STREAM))
+#define G_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_OUTPUT_STREAM, GOutputStreamClass))
+
+/**
+ * GOutputStream:
+ *
+ * Base class for writing output.
+ *
+ * All classes derived from GOutputStream should implement synchronous
+ * writing, splicing, flushing and closing streams, but may implement
+ * asynchronous versions.
+ **/
+typedef struct _GOutputStreamClass GOutputStreamClass;
+typedef struct _GOutputStreamPrivate GOutputStreamPrivate;
+
+struct _GOutputStream
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GOutputStreamPrivate *priv;
+};
+
+
+struct _GOutputStreamClass
+{
+ GObjectClass parent_class;
+
+ /* Sync ops: */
+
+ gssize (* write_fn) (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+ gssize (* splice) (GOutputStream *stream,
+ GInputStream *source,
+ GOutputStreamSpliceFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ gboolean (* flush) (GOutputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+ gboolean (* close_fn) (GOutputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+
+ /* Async ops: (optional in derived classes) */
+
+ void (* write_async) (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gssize (* write_finish) (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ void (* splice_async) (GOutputStream *stream,
+ GInputStream *source,
+ GOutputStreamSpliceFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gssize (* splice_finish) (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ void (* flush_async) (GOutputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* flush_finish) (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+ void (* close_async) (GOutputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* close_finish) (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (* writev_fn) (GOutputStream *stream,
+ const GOutputVector *vectors,
+ gsize n_vectors,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (* writev_async) (GOutputStream *stream,
+ const GOutputVector *vectors,
+ gsize n_vectors,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ gboolean (* writev_finish) (GOutputStream *stream,
+ GAsyncResult *result,
+ gsize *bytes_written,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+ void (*_g_reserved7) (void);
+ void (*_g_reserved8) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_output_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_output_stream_write (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_write_all (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_60
+gboolean g_output_stream_writev (GOutputStream *stream,
+ const GOutputVector *vectors,
+ gsize n_vectors,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_60
+gboolean g_output_stream_writev_all (GOutputStream *stream,
+ GOutputVector *vectors,
+ gsize n_vectors,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_output_stream_printf (GOutputStream *stream,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (5, 6);
+GLIB_AVAILABLE_IN_2_40
+gboolean g_output_stream_vprintf (GOutputStream *stream,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error,
+ const gchar *format,
+ va_list args) G_GNUC_PRINTF (5, 0);
+GLIB_AVAILABLE_IN_2_34
+gssize g_output_stream_write_bytes (GOutputStream *stream,
+ GBytes *bytes,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_output_stream_splice (GOutputStream *stream,
+ GInputStream *source,
+ GOutputStreamSpliceFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_flush (GOutputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_close (GOutputStream *stream,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_output_stream_write_async (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gssize g_output_stream_write_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_44
+void g_output_stream_write_all_async (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_44
+gboolean g_output_stream_write_all_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ gsize *bytes_written,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_60
+void g_output_stream_writev_async (GOutputStream *stream,
+ const GOutputVector *vectors,
+ gsize n_vectors,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_60
+gboolean g_output_stream_writev_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ gsize *bytes_written,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_60
+void g_output_stream_writev_all_async (GOutputStream *stream,
+ GOutputVector *vectors,
+ gsize n_vectors,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_60
+gboolean g_output_stream_writev_all_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ gsize *bytes_written,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_34
+void g_output_stream_write_bytes_async (GOutputStream *stream,
+ GBytes *bytes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_34
+gssize g_output_stream_write_bytes_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_output_stream_splice_async (GOutputStream *stream,
+ GInputStream *source,
+ GOutputStreamSpliceFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gssize g_output_stream_splice_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_output_stream_flush_async (GOutputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_flush_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_output_stream_close_async (GOutputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_close_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_is_closed (GOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_is_closing (GOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_has_pending (GOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_output_stream_set_pending (GOutputStream *stream,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_output_stream_clear_pending (GOutputStream *stream);
+
+
+G_END_DECLS
+
+#endif /* __G_OUTPUT_STREAM_H__ */
diff --git a/include/glib/gio/gpermission.h b/include/glib/gio/gpermission.h
new file mode 100644
index 0000000000..0c2b0bdf5d
--- /dev/null
+++ b/include/glib/gio/gpermission.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_PERMISSION_H__
+#define __G_PERMISSION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_PERMISSION (g_permission_get_type ())
+#define G_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_PERMISSION, GPermission))
+#define G_PERMISSION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_PERMISSION, GPermissionClass))
+#define G_IS_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_PERMISSION))
+#define G_IS_PERMISSION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_PERMISSION))
+#define G_PERMISSION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_PERMISSION, GPermissionClass))
+
+typedef struct _GPermissionPrivate GPermissionPrivate;
+typedef struct _GPermissionClass GPermissionClass;
+
+struct _GPermission
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GPermissionPrivate *priv;
+};
+
+struct _GPermissionClass {
+ GObjectClass parent_class;
+
+ gboolean (*acquire) (GPermission *permission,
+ GCancellable *cancellable,
+ GError **error);
+ void (*acquire_async) (GPermission *permission,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*acquire_finish) (GPermission *permission,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (*release) (GPermission *permission,
+ GCancellable *cancellable,
+ GError **error);
+ void (*release_async) (GPermission *permission,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*release_finish) (GPermission *permission,
+ GAsyncResult *result,
+ GError **error);
+
+ gpointer reserved[16];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_permission_get_type (void);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_permission_acquire (GPermission *permission,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_permission_acquire_async (GPermission *permission,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_permission_acquire_finish (GPermission *permission,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_permission_release (GPermission *permission,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_permission_release_async (GPermission *permission,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_permission_release_finish (GPermission *permission,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_permission_get_allowed (GPermission *permission);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_permission_get_can_acquire (GPermission *permission);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_permission_get_can_release (GPermission *permission);
+
+GLIB_AVAILABLE_IN_ALL
+void g_permission_impl_update (GPermission *permission,
+ gboolean allowed,
+ gboolean can_acquire,
+ gboolean can_release);
+
+G_END_DECLS
+
+#endif /* __G_PERMISSION_H__ */
diff --git a/include/glib/gio/gpollableinputstream.h b/include/glib/gio/gpollableinputstream.h
new file mode 100644
index 0000000000..ce50312e7b
--- /dev/null
+++ b/include/glib/gio/gpollableinputstream.h
@@ -0,0 +1,105 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_POLLABLE_INPUT_STREAM_H__
+#define __G_POLLABLE_INPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_POLLABLE_INPUT_STREAM (g_pollable_input_stream_get_type ())
+#define G_POLLABLE_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_POLLABLE_INPUT_STREAM, GPollableInputStream))
+#define G_IS_POLLABLE_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_POLLABLE_INPUT_STREAM))
+#define G_POLLABLE_INPUT_STREAM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_POLLABLE_INPUT_STREAM, GPollableInputStreamInterface))
+
+/**
+ * GPollableInputStream:
+ *
+ * An interface for a #GInputStream that can be polled for readability.
+ *
+ * Since: 2.28
+ */
+typedef struct _GPollableInputStreamInterface GPollableInputStreamInterface;
+
+/**
+ * GPollableInputStreamInterface:
+ * @g_iface: The parent interface.
+ * @can_poll: Checks if the #GPollableInputStream instance is actually pollable
+ * @is_readable: Checks if the stream is readable
+ * @create_source: Creates a #GSource to poll the stream
+ * @read_nonblocking: Does a non-blocking read or returns
+ * %G_IO_ERROR_WOULD_BLOCK
+ *
+ * The interface for pollable input streams.
+ *
+ * The default implementation of @can_poll always returns %TRUE.
+ *
+ * The default implementation of @read_nonblocking calls
+ * g_pollable_input_stream_is_readable(), and then calls
+ * g_input_stream_read() if it returns %TRUE. This means you only need
+ * to override it if it is possible that your @is_readable
+ * implementation may return %TRUE when the stream is not actually
+ * readable.
+ *
+ * Since: 2.28
+ */
+struct _GPollableInputStreamInterface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+ gboolean (*can_poll) (GPollableInputStream *stream);
+
+ gboolean (*is_readable) (GPollableInputStream *stream);
+ GSource * (*create_source) (GPollableInputStream *stream,
+ GCancellable *cancellable);
+ gssize (*read_nonblocking) (GPollableInputStream *stream,
+ void *buffer,
+ gsize count,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_pollable_input_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pollable_input_stream_can_poll (GPollableInputStream *stream);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pollable_input_stream_is_readable (GPollableInputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_pollable_input_stream_create_source (GPollableInputStream *stream,
+ GCancellable *cancellable);
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_pollable_input_stream_read_nonblocking (GPollableInputStream *stream,
+ void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+
+#endif /* __G_POLLABLE_INPUT_STREAM_H__ */
+
diff --git a/include/glib/gio/gpollableoutputstream.h b/include/glib/gio/gpollableoutputstream.h
new file mode 100644
index 0000000000..c282afdec4
--- /dev/null
+++ b/include/glib/gio/gpollableoutputstream.h
@@ -0,0 +1,126 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_POLLABLE_OUTPUT_STREAM_H__
+#define __G_POLLABLE_OUTPUT_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_POLLABLE_OUTPUT_STREAM (g_pollable_output_stream_get_type ())
+#define G_POLLABLE_OUTPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_POLLABLE_OUTPUT_STREAM, GPollableOutputStream))
+#define G_IS_POLLABLE_OUTPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_POLLABLE_OUTPUT_STREAM))
+#define G_POLLABLE_OUTPUT_STREAM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_POLLABLE_OUTPUT_STREAM, GPollableOutputStreamInterface))
+
+/**
+ * GPollableOutputStream:
+ *
+ * An interface for a #GOutputStream that can be polled for writeability.
+ *
+ * Since: 2.28
+ */
+typedef struct _GPollableOutputStreamInterface GPollableOutputStreamInterface;
+
+/**
+ * GPollableOutputStreamInterface:
+ * @g_iface: The parent interface.
+ * @can_poll: Checks if the #GPollableOutputStream instance is actually pollable
+ * @is_writable: Checks if the stream is writable
+ * @create_source: Creates a #GSource to poll the stream
+ * @write_nonblocking: Does a non-blocking write or returns
+ * %G_IO_ERROR_WOULD_BLOCK
+ * @writev_nonblocking: Does a vectored non-blocking write, or returns
+ * %G_POLLABLE_RETURN_WOULD_BLOCK
+ *
+ * The interface for pollable output streams.
+ *
+ * The default implementation of @can_poll always returns %TRUE.
+ *
+ * The default implementation of @write_nonblocking calls
+ * g_pollable_output_stream_is_writable(), and then calls
+ * g_output_stream_write() if it returns %TRUE. This means you only
+ * need to override it if it is possible that your @is_writable
+ * implementation may return %TRUE when the stream is not actually
+ * writable.
+ *
+ * The default implementation of @writev_nonblocking calls
+ * g_pollable_output_stream_write_nonblocking() for each vector, and converts
+ * its return value and error (if set) to a #GPollableReturn. You should
+ * override this where possible to avoid having to allocate a #GError to return
+ * %G_IO_ERROR_WOULD_BLOCK.
+ *
+ * Since: 2.28
+ */
+struct _GPollableOutputStreamInterface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+ gboolean (*can_poll) (GPollableOutputStream *stream);
+
+ gboolean (*is_writable) (GPollableOutputStream *stream);
+ GSource * (*create_source) (GPollableOutputStream *stream,
+ GCancellable *cancellable);
+ gssize (*write_nonblocking) (GPollableOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ GError **error);
+ GPollableReturn (*writev_nonblocking) (GPollableOutputStream *stream,
+ const GOutputVector *vectors,
+ gsize n_vectors,
+ gsize *bytes_written,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_pollable_output_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pollable_output_stream_can_poll (GPollableOutputStream *stream);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pollable_output_stream_is_writable (GPollableOutputStream *stream);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_pollable_output_stream_create_source (GPollableOutputStream *stream,
+ GCancellable *cancellable);
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_pollable_output_stream_write_nonblocking (GPollableOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_60
+GPollableReturn g_pollable_output_stream_writev_nonblocking (GPollableOutputStream *stream,
+ const GOutputVector *vectors,
+ gsize n_vectors,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+
+#endif /* __G_POLLABLE_OUTPUT_STREAM_H__ */
+
diff --git a/include/glib/gio/gpollableutils.h b/include/glib/gio/gpollableutils.h
new file mode 100644
index 0000000000..007048cf16
--- /dev/null
+++ b/include/glib/gio/gpollableutils.h
@@ -0,0 +1,64 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2012 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_POLLABLE_UTILS_H__
+#define __G_POLLABLE_UTILS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+GSource *g_pollable_source_new (GObject *pollable_stream);
+
+GLIB_AVAILABLE_IN_2_34
+GSource *g_pollable_source_new_full (gpointer pollable_stream,
+ GSource *child_source,
+ GCancellable *cancellable);
+
+GLIB_AVAILABLE_IN_2_34
+gssize g_pollable_stream_read (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ gboolean blocking,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_34
+gssize g_pollable_stream_write (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ gboolean blocking,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_pollable_stream_write_all (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ gboolean blocking,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* _G_POLLABLE_UTILS_H_ */
diff --git a/include/glib/gio/gpropertyaction.h b/include/glib/gio/gpropertyaction.h
new file mode 100644
index 0000000000..6fb4e63307
--- /dev/null
+++ b/include/glib/gio/gpropertyaction.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright © 2013 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_PROPERTY_ACTION_H__
+#define __G_PROPERTY_ACTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_PROPERTY_ACTION (g_property_action_get_type ())
+#define G_PROPERTY_ACTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_PROPERTY_ACTION, GPropertyAction))
+#define G_IS_PROPERTY_ACTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_PROPERTY_ACTION))
+
+GLIB_AVAILABLE_IN_2_38
+GType g_property_action_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_38
+GPropertyAction * g_property_action_new (const gchar *name,
+ gpointer object,
+ const gchar *property_name);
+
+G_END_DECLS
+
+#endif /* __G_PROPERTY_ACTION_H__ */
diff --git a/include/glib/gio/gproxy.h b/include/glib/gio/gproxy.h
new file mode 100644
index 0000000000..5589f21dcd
--- /dev/null
+++ b/include/glib/gio/gproxy.h
@@ -0,0 +1,128 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
+ */
+
+#ifndef __G_PROXY_H__
+#define __G_PROXY_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_PROXY (g_proxy_get_type ())
+#define G_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY, GProxy))
+#define G_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY))
+#define G_PROXY_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_PROXY, GProxyInterface))
+
+/**
+ * G_PROXY_EXTENSION_POINT_NAME:
+ *
+ * Extension point for proxy functionality.
+ * See [Extending GIO][extending-gio].
+ *
+ * Since: 2.26
+ */
+#define G_PROXY_EXTENSION_POINT_NAME "gio-proxy"
+
+/**
+ * GProxy:
+ *
+ * Interface that handles proxy connection and payload.
+ *
+ * Since: 2.26
+ */
+typedef struct _GProxyInterface GProxyInterface;
+
+/**
+ * GProxyInterface:
+ * @g_iface: The parent interface.
+ * @connect: Connect to proxy server and wrap (if required) the #connection
+ * to handle payload.
+ * @connect_async: Same as connect() but asynchronous.
+ * @connect_finish: Returns the result of connect_async()
+ * @supports_hostname: Returns whether the proxy supports hostname lookups.
+ *
+ * Provides an interface for handling proxy connection and payload.
+ *
+ * Since: 2.26
+ */
+struct _GProxyInterface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ GIOStream * (* connect) (GProxy *proxy,
+ GIOStream *connection,
+ GProxyAddress *proxy_address,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (* connect_async) (GProxy *proxy,
+ GIOStream *connection,
+ GProxyAddress *proxy_address,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GIOStream * (* connect_finish) (GProxy *proxy,
+ GAsyncResult *result,
+ GError **error);
+
+ gboolean (* supports_hostname) (GProxy *proxy);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_proxy_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GProxy *g_proxy_get_default_for_protocol (const gchar *protocol);
+
+GLIB_AVAILABLE_IN_ALL
+GIOStream *g_proxy_connect (GProxy *proxy,
+ GIOStream *connection,
+ GProxyAddress *proxy_address,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_proxy_connect_async (GProxy *proxy,
+ GIOStream *connection,
+ GProxyAddress *proxy_address,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GIOStream *g_proxy_connect_finish (GProxy *proxy,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_proxy_supports_hostname (GProxy *proxy);
+
+G_END_DECLS
+
+#endif /* __G_PROXY_H__ */
diff --git a/include/glib/gio/gproxyaddress.h b/include/glib/gio/gproxyaddress.h
new file mode 100644
index 0000000000..21b1992ea7
--- /dev/null
+++ b/include/glib/gio/gproxyaddress.h
@@ -0,0 +1,86 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
+ */
+
+#ifndef __G_PROXY_ADDRESS_H__
+#define __G_PROXY_ADDRESS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/ginetsocketaddress.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_PROXY_ADDRESS (g_proxy_address_get_type ())
+#define G_PROXY_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY_ADDRESS, GProxyAddress))
+#define G_PROXY_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_PROXY_ADDRESS, GProxyAddressClass))
+#define G_IS_PROXY_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY_ADDRESS))
+#define G_IS_PROXY_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_PROXY_ADDRESS))
+#define G_PROXY_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_PROXY_ADDRESS, GProxyAddressClass))
+
+typedef struct _GProxyAddressClass GProxyAddressClass;
+typedef struct _GProxyAddressPrivate GProxyAddressPrivate;
+
+struct _GProxyAddress
+{
+ GInetSocketAddress parent_instance;
+
+ /*< private >*/
+ GProxyAddressPrivate *priv;
+};
+
+struct _GProxyAddressClass
+{
+ GInetSocketAddressClass parent_class;
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_proxy_address_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress *g_proxy_address_new (GInetAddress *inetaddr,
+ guint16 port,
+ const gchar *protocol,
+ const gchar *dest_hostname,
+ guint16 dest_port,
+ const gchar *username,
+ const gchar *password);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_proxy_address_get_protocol (GProxyAddress *proxy);
+GLIB_AVAILABLE_IN_2_34
+const gchar *g_proxy_address_get_destination_protocol (GProxyAddress *proxy);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_proxy_address_get_destination_hostname (GProxyAddress *proxy);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_proxy_address_get_destination_port (GProxyAddress *proxy);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_proxy_address_get_username (GProxyAddress *proxy);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_proxy_address_get_password (GProxyAddress *proxy);
+
+GLIB_AVAILABLE_IN_2_34
+const gchar *g_proxy_address_get_uri (GProxyAddress *proxy);
+
+G_END_DECLS
+
+#endif /* __G_PROXY_ADDRESS_H__ */
diff --git a/include/glib/gio/gproxyaddressenumerator.h b/include/glib/gio/gproxyaddressenumerator.h
new file mode 100644
index 0000000000..470f1dc66e
--- /dev/null
+++ b/include/glib/gio/gproxyaddressenumerator.h
@@ -0,0 +1,81 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
+ */
+
+#ifndef __G_PROXY_ADDRESS_ENUMERATOR_H__
+#define __G_PROXY_ADDRESS_ENUMERATOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gsocketaddressenumerator.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_PROXY_ADDRESS_ENUMERATOR (g_proxy_address_enumerator_get_type ())
+#define G_PROXY_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY_ADDRESS_ENUMERATOR, GProxyAddressEnumerator))
+#define G_PROXY_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_PROXY_ADDRESS_ENUMERATOR, GProxyAddressEnumeratorClass))
+#define G_IS_PROXY_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY_ADDRESS_ENUMERATOR))
+#define G_IS_PROXY_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_PROXY_ADDRESS_ENUMERATOR))
+#define G_PROXY_ADDRESS_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_PROXY_ADDRESS_ENUMERATOR, GProxyAddressEnumeratorClass))
+
+/**
+ * GProxyAddressEnumerator:
+ *
+ * A subclass of #GSocketAddressEnumerator that takes another address
+ * enumerator and wraps each of its results in a #GProxyAddress as
+ * directed by the default #GProxyResolver.
+ */
+
+typedef struct _GProxyAddressEnumeratorClass GProxyAddressEnumeratorClass;
+typedef struct _GProxyAddressEnumeratorPrivate GProxyAddressEnumeratorPrivate;
+
+struct _GProxyAddressEnumerator
+{
+ /*< private >*/
+ GSocketAddressEnumerator parent_instance;
+ GProxyAddressEnumeratorPrivate *priv;
+};
+
+/**
+ * GProxyAddressEnumeratorClass:
+ *
+ * Class structure for #GProxyAddressEnumerator.
+ */
+struct _GProxyAddressEnumeratorClass
+{
+ /*< private >*/
+ GSocketAddressEnumeratorClass parent_class;
+
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+ void (*_g_reserved7) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_proxy_address_enumerator_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __G_PROXY_ADDRESS_ENUMERATOR_H__ */
diff --git a/include/glib/gio/gproxyresolver.h b/include/glib/gio/gproxyresolver.h
new file mode 100644
index 0000000000..c8ed82812c
--- /dev/null
+++ b/include/glib/gio/gproxyresolver.h
@@ -0,0 +1,95 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
+ */
+
+#ifndef __G_PROXY_RESOLVER_H__
+#define __G_PROXY_RESOLVER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_PROXY_RESOLVER (g_proxy_resolver_get_type ())
+#define G_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY_RESOLVER, GProxyResolver))
+#define G_IS_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY_RESOLVER))
+#define G_PROXY_RESOLVER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_PROXY_RESOLVER, GProxyResolverInterface))
+
+/**
+ * G_PROXY_RESOLVER_EXTENSION_POINT_NAME:
+ *
+ * Extension point for proxy resolving functionality.
+ * See [Extending GIO][extending-gio].
+ */
+#define G_PROXY_RESOLVER_EXTENSION_POINT_NAME "gio-proxy-resolver"
+
+typedef struct _GProxyResolverInterface GProxyResolverInterface;
+
+struct _GProxyResolverInterface {
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+ gboolean (* is_supported) (GProxyResolver *resolver);
+
+ gchar ** (* lookup) (GProxyResolver *resolver,
+ const gchar *uri,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (* lookup_async) (GProxyResolver *resolver,
+ const gchar *uri,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ gchar ** (* lookup_finish) (GProxyResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_proxy_resolver_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GProxyResolver *g_proxy_resolver_get_default (void);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_proxy_resolver_is_supported (GProxyResolver *resolver);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_proxy_resolver_lookup (GProxyResolver *resolver,
+ const gchar *uri,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_proxy_resolver_lookup_async (GProxyResolver *resolver,
+ const gchar *uri,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_proxy_resolver_lookup_finish (GProxyResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __G_PROXY_RESOLVER_H__ */
diff --git a/include/glib/gio/gremoteactiongroup.h b/include/glib/gio/gremoteactiongroup.h
new file mode 100644
index 0000000000..206c737344
--- /dev/null
+++ b/include/glib/gio/gremoteactiongroup.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright © 2011 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_REMOTE_ACTION_GROUP_H__
+#define __G_REMOTE_ACTION_GROUP_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+
+#define G_TYPE_REMOTE_ACTION_GROUP (g_remote_action_group_get_type ())
+#define G_REMOTE_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_REMOTE_ACTION_GROUP, GRemoteActionGroup))
+#define G_IS_REMOTE_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_REMOTE_ACTION_GROUP))
+#define G_REMOTE_ACTION_GROUP_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
+ G_TYPE_REMOTE_ACTION_GROUP, \
+ GRemoteActionGroupInterface))
+
+typedef struct _GRemoteActionGroupInterface GRemoteActionGroupInterface;
+
+struct _GRemoteActionGroupInterface
+{
+ GTypeInterface g_iface;
+
+ void (* activate_action_full) (GRemoteActionGroup *remote,
+ const gchar *action_name,
+ GVariant *parameter,
+ GVariant *platform_data);
+
+ void (* change_action_state_full) (GRemoteActionGroup *remote,
+ const gchar *action_name,
+ GVariant *value,
+ GVariant *platform_data);
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_remote_action_group_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+void g_remote_action_group_activate_action_full (GRemoteActionGroup *remote,
+ const gchar *action_name,
+ GVariant *parameter,
+ GVariant *platform_data);
+
+GLIB_AVAILABLE_IN_2_32
+void g_remote_action_group_change_action_state_full (GRemoteActionGroup *remote,
+ const gchar *action_name,
+ GVariant *value,
+ GVariant *platform_data);
+
+G_END_DECLS
+
+#endif /* __G_REMOTE_ACTION_GROUP_H__ */
diff --git a/include/glib/gio/gresolver.h b/include/glib/gio/gresolver.h
new file mode 100644
index 0000000000..dc4ba59a14
--- /dev/null
+++ b/include/glib/gio/gresolver.h
@@ -0,0 +1,292 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_RESOLVER_H__
+#define __G_RESOLVER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_RESOLVER (g_resolver_get_type ())
+#define G_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_RESOLVER, GResolver))
+#define G_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_RESOLVER, GResolverClass))
+#define G_IS_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_RESOLVER))
+#define G_IS_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_RESOLVER))
+#define G_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_RESOLVER, GResolverClass))
+
+typedef struct _GResolverPrivate GResolverPrivate;
+typedef struct _GResolverClass GResolverClass;
+
+struct _GResolver {
+ GObject parent_instance;
+
+ GResolverPrivate *priv;
+};
+
+/**
+ * GResolverNameLookupFlags:
+ * @G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT: default behavior (same as g_resolver_lookup_by_name())
+ * @G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY: only resolve ipv4 addresses
+ * @G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY: only resolve ipv6 addresses
+ *
+ * Flags to modify lookup behavior.
+ *
+ * Since: 2.60
+ */
+typedef enum {
+ G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT = 0,
+ G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY = 1 << 0,
+ G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY = 1 << 1,
+} GResolverNameLookupFlags;
+
+struct _GResolverClass {
+ GObjectClass parent_class;
+
+ /* Signals */
+ void ( *reload) (GResolver *resolver);
+
+ /* Virtual methods */
+ GList * ( *lookup_by_name) (GResolver *resolver,
+ const gchar *hostname,
+ GCancellable *cancellable,
+ GError **error);
+ void ( *lookup_by_name_async) (GResolver *resolver,
+ const gchar *hostname,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GList * ( *lookup_by_name_finish) (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+
+ gchar * ( *lookup_by_address) (GResolver *resolver,
+ GInetAddress *address,
+ GCancellable *cancellable,
+ GError **error);
+ void ( *lookup_by_address_async) (GResolver *resolver,
+ GInetAddress *address,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gchar * ( *lookup_by_address_finish) (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+
+ GList * ( *lookup_service) (GResolver *resolver,
+ const gchar *rrname,
+ GCancellable *cancellable,
+ GError **error);
+ void ( *lookup_service_async) (GResolver *resolver,
+ const gchar *rrname,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GList * ( *lookup_service_finish) (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+
+ GList * ( *lookup_records) (GResolver *resolver,
+ const gchar *rrname,
+ GResolverRecordType record_type,
+ GCancellable *cancellable,
+ GError **error);
+
+ void ( *lookup_records_async) (GResolver *resolver,
+ const gchar *rrname,
+ GResolverRecordType record_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GList * ( *lookup_records_finish) (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+ /**
+ * GResolverClass::lookup_by_name_with_flags_async:
+ * @resolver: a #GResolver
+ * @hostname: the hostname to resolve
+ * @flags: extra #GResolverNameLookupFlags to modify the lookup
+ * @cancellable: (nullable): a #GCancellable
+ * @callback: (scope async): a #GAsyncReadyCallback to call when completed
+ * @user_data: (closure): data to pass to @callback
+ *
+ * Asynchronous version of GResolverClass::lookup_by_name_with_flags
+ *
+ * GResolverClass::lookup_by_name_with_flags_finish will be called to get
+ * the result.
+ *
+ * Since: 2.60
+ */
+ void ( *lookup_by_name_with_flags_async) (GResolver *resolver,
+ const gchar *hostname,
+ GResolverNameLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ /**
+ * GResolverClass::lookup_by_name_with_flags_finish:
+ * @resolver: a #GResolver
+ * @result: a #GAsyncResult
+ * @error: (nullable): a pointer to a %NULL #GError
+ *
+ * Gets the result from GResolverClass::lookup_by_name_with_flags_async
+ *
+ * Returns: (element-type GInetAddress) (transfer full): List of #GInetAddress.
+ * Since: 2.60
+ */
+ GList * ( *lookup_by_name_with_flags_finish) (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+ /**
+ * GResolverClass::lookup_by_name_with_flags:
+ * @resolver: a #GResolver
+ * @hostname: the hostname to resolve
+ * @flags: extra #GResolverNameLookupFlags to modify the lookup
+ * @cancellable: (nullable): a #GCancellable
+ * @error: (nullable): a pointer to a %NULL #GError
+ *
+ * This is identical to GResolverClass::lookup_by_name except it takes
+ * @flags which modifies the behavior of the lookup. See #GResolverNameLookupFlags
+ * for more details.
+ *
+ * Returns: (element-type GInetAddress) (transfer full): List of #GInetAddress.
+ * Since: 2.60
+ */
+ GList * ( *lookup_by_name_with_flags) (GResolver *resolver,
+ const gchar *hostname,
+ GResolverNameLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_resolver_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GResolver *g_resolver_get_default (void);
+GLIB_AVAILABLE_IN_ALL
+void g_resolver_set_default (GResolver *resolver);
+GLIB_AVAILABLE_IN_ALL
+GList *g_resolver_lookup_by_name (GResolver *resolver,
+ const gchar *hostname,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_resolver_lookup_by_name_async (GResolver *resolver,
+ const gchar *hostname,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GList *g_resolver_lookup_by_name_finish (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_2_60
+void g_resolver_lookup_by_name_with_flags_async (GResolver *resolver,
+ const gchar *hostname,
+ GResolverNameLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_60
+GList *g_resolver_lookup_by_name_with_flags_finish (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_2_60
+GList *g_resolver_lookup_by_name_with_flags (GResolver *resolver,
+ const gchar *hostname,
+ GResolverNameLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_resolver_free_addresses (GList *addresses);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_resolver_lookup_by_address (GResolver *resolver,
+ GInetAddress *address,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_resolver_lookup_by_address_async (GResolver *resolver,
+ GInetAddress *address,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_resolver_lookup_by_address_finish (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GList *g_resolver_lookup_service (GResolver *resolver,
+ const gchar *service,
+ const gchar *protocol,
+ const gchar *domain,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_resolver_lookup_service_async (GResolver *resolver,
+ const gchar *service,
+ const gchar *protocol,
+ const gchar *domain,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GList *g_resolver_lookup_service_finish (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_2_34
+GList *g_resolver_lookup_records (GResolver *resolver,
+ const gchar *rrname,
+ GResolverRecordType record_type,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_34
+void g_resolver_lookup_records_async (GResolver *resolver,
+ const gchar *rrname,
+ GResolverRecordType record_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_34
+GList *g_resolver_lookup_records_finish (GResolver *resolver,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_resolver_free_targets (GList *targets);
+
+
+/**
+ * G_RESOLVER_ERROR:
+ *
+ * Error domain for #GResolver. Errors in this domain will be from the
+ * #GResolverError enumeration. See #GError for more information on
+ * error domains.
+ */
+#define G_RESOLVER_ERROR (g_resolver_error_quark ())
+GLIB_AVAILABLE_IN_ALL
+GQuark g_resolver_error_quark (void);
+
+G_END_DECLS
+
+#endif /* __G_RESOLVER_H__ */
diff --git a/include/glib/gio/gresource.h b/include/glib/gio/gresource.h
new file mode 100644
index 0000000000..e9870c1488
--- /dev/null
+++ b/include/glib/gio/gresource.h
@@ -0,0 +1,130 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_RESOURCE_H__
+#define __G_RESOURCE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_TYPE_RESOURCE:
+ *
+ * The #GType for #GResource.
+ */
+#define G_TYPE_RESOURCE (g_resource_get_type ())
+
+
+/**
+ * G_RESOURCE_ERROR:
+ *
+ * Error domain for #GResource. Errors in this domain will be from the
+ * #GResourceError enumeration. See #GError for more information on
+ * error domains.
+ */
+#define G_RESOURCE_ERROR (g_resource_error_quark ())
+GLIB_AVAILABLE_IN_2_32
+GQuark g_resource_error_quark (void);
+
+typedef struct _GStaticResource GStaticResource;
+
+struct _GStaticResource {
+ /*< private >*/
+ const guint8 *data;
+ gsize data_len;
+ GResource *resource;
+ GStaticResource *next;
+ gpointer padding;
+};
+
+GLIB_AVAILABLE_IN_2_32
+GType g_resource_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_32
+GResource * g_resource_new_from_data (GBytes *data,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+GResource * g_resource_ref (GResource *resource);
+GLIB_AVAILABLE_IN_2_32
+void g_resource_unref (GResource *resource);
+GLIB_AVAILABLE_IN_2_32
+GResource * g_resource_load (const gchar *filename,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+GInputStream *g_resource_open_stream (GResource *resource,
+ const char *path,
+ GResourceLookupFlags lookup_flags,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+GBytes * g_resource_lookup_data (GResource *resource,
+ const char *path,
+ GResourceLookupFlags lookup_flags,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+char ** g_resource_enumerate_children (GResource *resource,
+ const char *path,
+ GResourceLookupFlags lookup_flags,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_resource_get_info (GResource *resource,
+ const char *path,
+ GResourceLookupFlags lookup_flags,
+ gsize *size,
+ guint32 *flags,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_32
+void g_resources_register (GResource *resource);
+GLIB_AVAILABLE_IN_2_32
+void g_resources_unregister (GResource *resource);
+GLIB_AVAILABLE_IN_2_32
+GInputStream *g_resources_open_stream (const char *path,
+ GResourceLookupFlags lookup_flags,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+GBytes * g_resources_lookup_data (const char *path,
+ GResourceLookupFlags lookup_flags,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+char ** g_resources_enumerate_children (const char *path,
+ GResourceLookupFlags lookup_flags,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_resources_get_info (const char *path,
+ GResourceLookupFlags lookup_flags,
+ gsize *size,
+ guint32 *flags,
+ GError **error);
+
+
+GLIB_AVAILABLE_IN_2_32
+void g_static_resource_init (GStaticResource *static_resource);
+GLIB_AVAILABLE_IN_2_32
+void g_static_resource_fini (GStaticResource *static_resource);
+GLIB_AVAILABLE_IN_2_32
+GResource *g_static_resource_get_resource (GStaticResource *static_resource);
+
+G_END_DECLS
+
+#endif /* __G_RESOURCE_H__ */
diff --git a/include/glib/gio/gseekable.h b/include/glib/gio/gseekable.h
new file mode 100644
index 0000000000..191f3cca2f
--- /dev/null
+++ b/include/glib/gio/gseekable.h
@@ -0,0 +1,103 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_SEEKABLE_H__
+#define __G_SEEKABLE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SEEKABLE (g_seekable_get_type ())
+#define G_SEEKABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_SEEKABLE, GSeekable))
+#define G_IS_SEEKABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_SEEKABLE))
+#define G_SEEKABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_SEEKABLE, GSeekableIface))
+
+/**
+ * GSeekable:
+ *
+ * Seek object for streaming operations.
+ **/
+typedef struct _GSeekableIface GSeekableIface;
+
+/**
+ * GSeekableIface:
+ * @g_iface: The parent interface.
+ * @tell: Tells the current location within a stream.
+ * @can_seek: Checks if seeking is supported by the stream.
+ * @seek: Seeks to a location within a stream.
+ * @can_truncate: Checks if truncation is supported by the stream.
+ * @truncate_fn: Truncates a stream.
+ *
+ * Provides an interface for implementing seekable functionality on I/O Streams.
+ **/
+struct _GSeekableIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ goffset (* tell) (GSeekable *seekable);
+
+ gboolean (* can_seek) (GSeekable *seekable);
+ gboolean (* seek) (GSeekable *seekable,
+ goffset offset,
+ GSeekType type,
+ GCancellable *cancellable,
+ GError **error);
+
+ gboolean (* can_truncate) (GSeekable *seekable);
+ gboolean (* truncate_fn) (GSeekable *seekable,
+ goffset offset,
+ GCancellable *cancellable,
+ GError **error);
+
+ /* TODO: Async seek/truncate */
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_seekable_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+goffset g_seekable_tell (GSeekable *seekable);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_seekable_can_seek (GSeekable *seekable);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_seekable_seek (GSeekable *seekable,
+ goffset offset,
+ GSeekType type,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_seekable_can_truncate (GSeekable *seekable);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_seekable_truncate (GSeekable *seekable,
+ goffset offset,
+ GCancellable *cancellable,
+ GError **error);
+
+G_END_DECLS
+
+
+#endif /* __G_SEEKABLE_H__ */
diff --git a/include/glib/gio/gsettings.h b/include/glib/gio/gsettings.h
new file mode 100644
index 0000000000..d3d5a076fd
--- /dev/null
+++ b/include/glib/gio/gsettings.h
@@ -0,0 +1,345 @@
+/*
+ * Copyright © 2009, 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_SETTINGS_H__
+#define __G_SETTINGS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gsettingsschema.h>
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SETTINGS (g_settings_get_type ())
+#define G_SETTINGS(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SETTINGS, GSettings))
+#define G_SETTINGS_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SETTINGS, GSettingsClass))
+#define G_IS_SETTINGS(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_SETTINGS))
+#define G_IS_SETTINGS_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_SETTINGS))
+#define G_SETTINGS_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SETTINGS, GSettingsClass))
+
+typedef struct _GSettingsPrivate GSettingsPrivate;
+typedef struct _GSettingsClass GSettingsClass;
+
+struct _GSettingsClass
+{
+ GObjectClass parent_class;
+
+ /* Signals */
+ void (*writable_changed) (GSettings *settings,
+ const gchar *key);
+ void (*changed) (GSettings *settings,
+ const gchar *key);
+ gboolean (*writable_change_event) (GSettings *settings,
+ GQuark key);
+ gboolean (*change_event) (GSettings *settings,
+ const GQuark *keys,
+ gint n_keys);
+
+ gpointer padding[20];
+};
+
+struct _GSettings
+{
+ GObject parent_instance;
+ GSettingsPrivate *priv;
+};
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_settings_get_type (void);
+
+GLIB_DEPRECATED_IN_2_40_FOR(g_settings_schema_source_list_schemas)
+const gchar * const * g_settings_list_schemas (void);
+GLIB_DEPRECATED_IN_2_40_FOR(g_settings_schema_source_list_schemas)
+const gchar * const * g_settings_list_relocatable_schemas (void);
+GLIB_AVAILABLE_IN_ALL
+GSettings * g_settings_new (const gchar *schema_id);
+GLIB_AVAILABLE_IN_ALL
+GSettings * g_settings_new_with_path (const gchar *schema_id,
+ const gchar *path);
+GLIB_AVAILABLE_IN_ALL
+GSettings * g_settings_new_with_backend (const gchar *schema_id,
+ GSettingsBackend *backend);
+GLIB_AVAILABLE_IN_ALL
+GSettings * g_settings_new_with_backend_and_path (const gchar *schema_id,
+ GSettingsBackend *backend,
+ const gchar *path);
+GLIB_AVAILABLE_IN_2_32
+GSettings * g_settings_new_full (GSettingsSchema *schema,
+ GSettingsBackend *backend,
+ const gchar *path);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_settings_list_children (GSettings *settings);
+GLIB_DEPRECATED_IN_2_46_FOR(g_settings_schema_list_keys)
+gchar ** g_settings_list_keys (GSettings *settings);
+GLIB_DEPRECATED_IN_2_40_FOR(g_settings_schema_key_get_range)
+GVariant * g_settings_get_range (GSettings *settings,
+ const gchar *key);
+GLIB_DEPRECATED_IN_2_40_FOR(g_settings_schema_key_range_check)
+gboolean g_settings_range_check (GSettings *settings,
+ const gchar *key,
+ GVariant *value);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_value (GSettings *settings,
+ const gchar *key,
+ GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_settings_get_value (GSettings *settings,
+ const gchar *key);
+
+GLIB_AVAILABLE_IN_2_40
+GVariant * g_settings_get_user_value (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_2_40
+GVariant * g_settings_get_default_value (GSettings *settings,
+ const gchar *key);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set (GSettings *settings,
+ const gchar *key,
+ const gchar *format,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_get (GSettings *settings,
+ const gchar *key,
+ const gchar *format,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_reset (GSettings *settings,
+ const gchar *key);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_settings_get_int (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_int (GSettings *settings,
+ const gchar *key,
+ gint value);
+GLIB_AVAILABLE_IN_2_50
+gint64 g_settings_get_int64 (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_2_50
+gboolean g_settings_set_int64 (GSettings *settings,
+ const gchar *key,
+ gint64 value);
+GLIB_AVAILABLE_IN_2_32
+guint g_settings_get_uint (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_settings_set_uint (GSettings *settings,
+ const gchar *key,
+ guint value);
+GLIB_AVAILABLE_IN_2_50
+guint64 g_settings_get_uint64 (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_2_50
+gboolean g_settings_set_uint64 (GSettings *settings,
+ const gchar *key,
+ guint64 value);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_settings_get_string (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_string (GSettings *settings,
+ const gchar *key,
+ const gchar *value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_get_boolean (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_boolean (GSettings *settings,
+ const gchar *key,
+ gboolean value);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_settings_get_double (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_double (GSettings *settings,
+ const gchar *key,
+ gdouble value);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_settings_get_strv (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_strv (GSettings *settings,
+ const gchar *key,
+ const gchar *const *value);
+GLIB_AVAILABLE_IN_ALL
+gint g_settings_get_enum (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_enum (GSettings *settings,
+ const gchar *key,
+ gint value);
+GLIB_AVAILABLE_IN_ALL
+guint g_settings_get_flags (GSettings *settings,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_set_flags (GSettings *settings,
+ const gchar *key,
+ guint value);
+GLIB_AVAILABLE_IN_ALL
+GSettings * g_settings_get_child (GSettings *settings,
+ const gchar *name);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_is_writable (GSettings *settings,
+ const gchar *name);
+
+GLIB_AVAILABLE_IN_ALL
+void g_settings_delay (GSettings *settings);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_apply (GSettings *settings);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_revert (GSettings *settings);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_settings_get_has_unapplied (GSettings *settings);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_sync (void);
+
+/**
+ * GSettingsBindSetMapping:
+ * @value: a #GValue containing the property value to map
+ * @expected_type: the #GVariantType to create
+ * @user_data: user data that was specified when the binding was created
+ *
+ * The type for the function that is used to convert an object property
+ * value to a #GVariant for storing it in #GSettings.
+ *
+ * Returns: a new #GVariant holding the data from @value,
+ * or %NULL in case of an error
+ */
+typedef GVariant * (*GSettingsBindSetMapping) (const GValue *value,
+ const GVariantType *expected_type,
+ gpointer user_data);
+
+/**
+ * GSettingsBindGetMapping:
+ * @value: return location for the property value
+ * @variant: the #GVariant
+ * @user_data: user data that was specified when the binding was created
+ *
+ * The type for the function that is used to convert from #GSettings to
+ * an object property. The @value is already initialized to hold values
+ * of the appropriate type.
+ *
+ * Returns: %TRUE if the conversion succeeded, %FALSE in case of an error
+ */
+typedef gboolean (*GSettingsBindGetMapping) (GValue *value,
+ GVariant *variant,
+ gpointer user_data);
+
+/**
+ * GSettingsGetMapping:
+ * @value: the #GVariant to map, or %NULL
+ * @result: (out): the result of the mapping
+ * @user_data: (closure): the user data that was passed to
+ * g_settings_get_mapped()
+ *
+ * The type of the function that is used to convert from a value stored
+ * in a #GSettings to a value that is useful to the application.
+ *
+ * If the value is successfully mapped, the result should be stored at
+ * @result and %TRUE returned. If mapping fails (for example, if @value
+ * is not in the right format) then %FALSE should be returned.
+ *
+ * If @value is %NULL then it means that the mapping function is being
+ * given a "last chance" to successfully return a valid value. %TRUE
+ * must be returned in this case.
+ *
+ * Returns: %TRUE if the conversion succeeded, %FALSE in case of an error
+ **/
+typedef gboolean (*GSettingsGetMapping) (GVariant *value,
+ gpointer *result,
+ gpointer user_data);
+
+/**
+ * GSettingsBindFlags:
+ * @G_SETTINGS_BIND_DEFAULT: Equivalent to `G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET`
+ * @G_SETTINGS_BIND_GET: Update the #GObject property when the setting changes.
+ * It is an error to use this flag if the property is not writable.
+ * @G_SETTINGS_BIND_SET: Update the setting when the #GObject property changes.
+ * It is an error to use this flag if the property is not readable.
+ * @G_SETTINGS_BIND_NO_SENSITIVITY: Do not try to bind a "sensitivity" property to the writability of the setting
+ * @G_SETTINGS_BIND_GET_NO_CHANGES: When set in addition to #G_SETTINGS_BIND_GET, set the #GObject property
+ * value initially from the setting, but do not listen for changes of the setting
+ * @G_SETTINGS_BIND_INVERT_BOOLEAN: When passed to g_settings_bind(), uses a pair of mapping functions that invert
+ * the boolean value when mapping between the setting and the property. The setting and property must both
+ * be booleans. You cannot pass this flag to g_settings_bind_with_mapping().
+ *
+ * Flags used when creating a binding. These flags determine in which
+ * direction the binding works. The default is to synchronize in both
+ * directions.
+ */
+typedef enum
+{
+ G_SETTINGS_BIND_DEFAULT,
+ G_SETTINGS_BIND_GET = (1<<0),
+ G_SETTINGS_BIND_SET = (1<<1),
+ G_SETTINGS_BIND_NO_SENSITIVITY = (1<<2),
+ G_SETTINGS_BIND_GET_NO_CHANGES = (1<<3),
+ G_SETTINGS_BIND_INVERT_BOOLEAN = (1<<4)
+} GSettingsBindFlags;
+
+GLIB_AVAILABLE_IN_ALL
+void g_settings_bind (GSettings *settings,
+ const gchar *key,
+ gpointer object,
+ const gchar *property,
+ GSettingsBindFlags flags);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_bind_with_mapping (GSettings *settings,
+ const gchar *key,
+ gpointer object,
+ const gchar *property,
+ GSettingsBindFlags flags,
+ GSettingsBindGetMapping get_mapping,
+ GSettingsBindSetMapping set_mapping,
+ gpointer user_data,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_bind_writable (GSettings *settings,
+ const gchar *key,
+ gpointer object,
+ const gchar *property,
+ gboolean inverted);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_unbind (gpointer object,
+ const gchar *property);
+
+GLIB_AVAILABLE_IN_2_32
+GAction * g_settings_create_action (GSettings *settings,
+ const gchar *key);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_settings_get_mapped (GSettings *settings,
+ const gchar *key,
+ GSettingsGetMapping mapping,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __G_SETTINGS_H__ */
diff --git a/include/glib/gio/gsettingsbackend.h b/include/glib/gio/gsettingsbackend.h
new file mode 100644
index 0000000000..34bae6b609
--- /dev/null
+++ b/include/glib/gio/gsettingsbackend.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright © 2009, 2010 Codethink Limited
+ * Copyright © 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ * Matthias Clasen <mclasen@redhat.com>
+ */
+
+#ifndef __G_SETTINGS_BACKEND_H__
+#define __G_SETTINGS_BACKEND_H__
+
+#if !defined (G_SETTINGS_ENABLE_BACKEND) && !defined (GIO_COMPILATION)
+#error "You must define G_SETTINGS_ENABLE_BACKEND before including <gio/gsettingsbackend.h>."
+#endif
+
+#define __GIO_GIO_H_INSIDE__
+#include <gio/giotypes.h>
+#undef __GIO_GIO_H_INSIDE__
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SETTINGS_BACKEND (g_settings_backend_get_type ())
+#define G_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SETTINGS_BACKEND, GSettingsBackend))
+#define G_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SETTINGS_BACKEND, GSettingsBackendClass))
+#define G_IS_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SETTINGS_BACKEND))
+#define G_IS_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SETTINGS_BACKEND))
+#define G_SETTINGS_BACKEND_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SETTINGS_BACKEND, GSettingsBackendClass))
+
+/**
+ * G_SETTINGS_BACKEND_EXTENSION_POINT_NAME:
+ *
+ * Extension point for #GSettingsBackend functionality.
+ **/
+#define G_SETTINGS_BACKEND_EXTENSION_POINT_NAME "gsettings-backend"
+
+/**
+ * GSettingsBackend:
+ *
+ * An implementation of a settings storage repository.
+ **/
+typedef struct _GSettingsBackendPrivate GSettingsBackendPrivate;
+typedef struct _GSettingsBackendClass GSettingsBackendClass;
+
+/**
+ * GSettingsBackendClass:
+ * @read: virtual method to read a key's value
+ * @get_writable: virtual method to get if a key is writable
+ * @write: virtual method to change key's value
+ * @write_tree: virtual method to change a tree of keys
+ * @reset: virtual method to reset state
+ * @subscribe: virtual method to subscribe to key changes
+ * @unsubscribe: virtual method to unsubscribe to key changes
+ * @sync: virtual method to sync state
+ * @get_permission: virtual method to get permission of a key
+ * @read_user_value: virtual method to read user's key value
+ *
+ * Class structure for #GSettingsBackend.
+ */
+struct _GSettingsBackendClass
+{
+ GObjectClass parent_class;
+
+ GVariant * (*read) (GSettingsBackend *backend,
+ const gchar *key,
+ const GVariantType *expected_type,
+ gboolean default_value);
+
+ gboolean (*get_writable) (GSettingsBackend *backend,
+ const gchar *key);
+
+ gboolean (*write) (GSettingsBackend *backend,
+ const gchar *key,
+ GVariant *value,
+ gpointer origin_tag);
+ gboolean (*write_tree) (GSettingsBackend *backend,
+ GTree *tree,
+ gpointer origin_tag);
+ void (*reset) (GSettingsBackend *backend,
+ const gchar *key,
+ gpointer origin_tag);
+
+ void (*subscribe) (GSettingsBackend *backend,
+ const gchar *name);
+ void (*unsubscribe) (GSettingsBackend *backend,
+ const gchar *name);
+ void (*sync) (GSettingsBackend *backend);
+
+ GPermission * (*get_permission) (GSettingsBackend *backend,
+ const gchar *path);
+
+ GVariant * (*read_user_value) (GSettingsBackend *backend,
+ const gchar *key,
+ const GVariantType *expected_type);
+
+ /*< private >*/
+ gpointer padding[23];
+};
+
+struct _GSettingsBackend
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GSettingsBackendPrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_settings_backend_get_type (void);
+
+GLIB_AVAILABLE_IN_ALL
+void g_settings_backend_changed (GSettingsBackend *backend,
+ const gchar *key,
+ gpointer origin_tag);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_backend_path_changed (GSettingsBackend *backend,
+ const gchar *path,
+ gpointer origin_tag);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_backend_flatten_tree (GTree *tree,
+ gchar **path,
+ const gchar ***keys,
+ GVariant ***values);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_backend_keys_changed (GSettingsBackend *backend,
+ const gchar *path,
+ gchar const * const *items,
+ gpointer origin_tag);
+
+GLIB_AVAILABLE_IN_ALL
+void g_settings_backend_path_writable_changed (GSettingsBackend *backend,
+ const gchar *path);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_backend_writable_changed (GSettingsBackend *backend,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+void g_settings_backend_changed_tree (GSettingsBackend *backend,
+ GTree *tree,
+ gpointer origin_tag);
+
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend * g_settings_backend_get_default (void);
+
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend * g_keyfile_settings_backend_new (const gchar *filename,
+ const gchar *root_path,
+ const gchar *root_group);
+
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend * g_null_settings_backend_new (void);
+
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend * g_memory_settings_backend_new (void);
+
+G_END_DECLS
+
+#endif /* __G_SETTINGS_BACKEND_H__ */
diff --git a/include/glib/gio/gsettingsschema.h b/include/glib/gio/gsettingsschema.h
new file mode 100644
index 0000000000..219e30914e
--- /dev/null
+++ b/include/glib/gio/gsettingsschema.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ * Copyright © 2011 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SETTINGS_SCHEMA_H__
+#define __G_SETTINGS_SCHEMA_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GSettingsSchemaSource GSettingsSchemaSource;
+typedef struct _GSettingsSchema GSettingsSchema;
+typedef struct _GSettingsSchemaKey GSettingsSchemaKey;
+
+#define G_TYPE_SETTINGS_SCHEMA_SOURCE (g_settings_schema_source_get_type ())
+GLIB_AVAILABLE_IN_2_32
+GType g_settings_schema_source_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+GSettingsSchemaSource * g_settings_schema_source_get_default (void);
+GLIB_AVAILABLE_IN_2_32
+GSettingsSchemaSource * g_settings_schema_source_ref (GSettingsSchemaSource *source);
+GLIB_AVAILABLE_IN_2_32
+void g_settings_schema_source_unref (GSettingsSchemaSource *source);
+
+GLIB_AVAILABLE_IN_2_32
+GSettingsSchemaSource * g_settings_schema_source_new_from_directory (const gchar *directory,
+ GSettingsSchemaSource *parent,
+ gboolean trusted,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_32
+GSettingsSchema * g_settings_schema_source_lookup (GSettingsSchemaSource *source,
+ const gchar *schema_id,
+ gboolean recursive);
+
+GLIB_AVAILABLE_IN_2_40
+void g_settings_schema_source_list_schemas (GSettingsSchemaSource *source,
+ gboolean recursive,
+ gchar ***non_relocatable,
+ gchar ***relocatable);
+
+#define G_TYPE_SETTINGS_SCHEMA (g_settings_schema_get_type ())
+GLIB_AVAILABLE_IN_2_32
+GType g_settings_schema_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+GSettingsSchema * g_settings_schema_ref (GSettingsSchema *schema);
+GLIB_AVAILABLE_IN_2_32
+void g_settings_schema_unref (GSettingsSchema *schema);
+
+GLIB_AVAILABLE_IN_2_32
+const gchar * g_settings_schema_get_id (GSettingsSchema *schema);
+GLIB_AVAILABLE_IN_2_32
+const gchar * g_settings_schema_get_path (GSettingsSchema *schema);
+GLIB_AVAILABLE_IN_2_40
+GSettingsSchemaKey * g_settings_schema_get_key (GSettingsSchema *schema,
+ const gchar *name);
+GLIB_AVAILABLE_IN_2_40
+gboolean g_settings_schema_has_key (GSettingsSchema *schema,
+ const gchar *name);
+GLIB_AVAILABLE_IN_2_46
+gchar** g_settings_schema_list_keys (GSettingsSchema *schema);
+
+
+GLIB_AVAILABLE_IN_2_44
+gchar ** g_settings_schema_list_children (GSettingsSchema *schema);
+
+#define G_TYPE_SETTINGS_SCHEMA_KEY (g_settings_schema_key_get_type ())
+GLIB_AVAILABLE_IN_2_40
+GType g_settings_schema_key_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_40
+GSettingsSchemaKey * g_settings_schema_key_ref (GSettingsSchemaKey *key);
+GLIB_AVAILABLE_IN_2_40
+void g_settings_schema_key_unref (GSettingsSchemaKey *key);
+
+GLIB_AVAILABLE_IN_2_40
+const GVariantType * g_settings_schema_key_get_value_type (GSettingsSchemaKey *key);
+GLIB_AVAILABLE_IN_2_40
+GVariant * g_settings_schema_key_get_default_value (GSettingsSchemaKey *key);
+GLIB_AVAILABLE_IN_2_40
+GVariant * g_settings_schema_key_get_range (GSettingsSchemaKey *key);
+GLIB_AVAILABLE_IN_2_40
+gboolean g_settings_schema_key_range_check (GSettingsSchemaKey *key,
+ GVariant *value);
+
+GLIB_AVAILABLE_IN_2_44
+const gchar * g_settings_schema_key_get_name (GSettingsSchemaKey *key);
+GLIB_AVAILABLE_IN_2_40
+const gchar * g_settings_schema_key_get_summary (GSettingsSchemaKey *key);
+GLIB_AVAILABLE_IN_2_40
+const gchar * g_settings_schema_key_get_description (GSettingsSchemaKey *key);
+
+G_END_DECLS
+
+#endif /* __G_SETTINGS_SCHEMA_H__ */
diff --git a/include/glib/gio/gsimpleaction.h b/include/glib/gio/gsimpleaction.h
new file mode 100644
index 0000000000..041eb7ecc8
--- /dev/null
+++ b/include/glib/gio/gsimpleaction.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_SIMPLE_ACTION_H__
+#define __G_SIMPLE_ACTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SIMPLE_ACTION (g_simple_action_get_type ())
+#define G_SIMPLE_ACTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SIMPLE_ACTION, GSimpleAction))
+#define G_IS_SIMPLE_ACTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SIMPLE_ACTION))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_simple_action_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSimpleAction * g_simple_action_new (const gchar *name,
+ const GVariantType *parameter_type);
+
+GLIB_AVAILABLE_IN_ALL
+GSimpleAction * g_simple_action_new_stateful (const gchar *name,
+ const GVariantType *parameter_type,
+ GVariant *state);
+
+GLIB_AVAILABLE_IN_ALL
+void g_simple_action_set_enabled (GSimpleAction *simple,
+ gboolean enabled);
+
+GLIB_AVAILABLE_IN_2_30
+void g_simple_action_set_state (GSimpleAction *simple,
+ GVariant *value);
+
+GLIB_AVAILABLE_IN_2_44
+void g_simple_action_set_state_hint (GSimpleAction *simple,
+ GVariant *state_hint);
+
+G_END_DECLS
+
+#endif /* __G_SIMPLE_ACTION_H__ */
diff --git a/include/glib/gio/gsimpleactiongroup.h b/include/glib/gio/gsimpleactiongroup.h
new file mode 100644
index 0000000000..6ad46e7da2
--- /dev/null
+++ b/include/glib/gio/gsimpleactiongroup.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_SIMPLE_ACTION_GROUP_H__
+#define __G_SIMPLE_ACTION_GROUP_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include "gactiongroup.h"
+#include "gactionmap.h"
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SIMPLE_ACTION_GROUP (g_simple_action_group_get_type ())
+#define G_SIMPLE_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SIMPLE_ACTION_GROUP, GSimpleActionGroup))
+#define G_SIMPLE_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SIMPLE_ACTION_GROUP, GSimpleActionGroupClass))
+#define G_IS_SIMPLE_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SIMPLE_ACTION_GROUP))
+#define G_IS_SIMPLE_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SIMPLE_ACTION_GROUP))
+#define G_SIMPLE_ACTION_GROUP_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SIMPLE_ACTION_GROUP, GSimpleActionGroupClass))
+
+typedef struct _GSimpleActionGroupPrivate GSimpleActionGroupPrivate;
+typedef struct _GSimpleActionGroupClass GSimpleActionGroupClass;
+
+/**
+ * GSimpleActionGroup:
+ *
+ * The #GSimpleActionGroup structure contains private data and should only be accessed using the provided API.
+ *
+ * Since: 2.28
+ */
+struct _GSimpleActionGroup
+{
+ /*< private >*/
+ GObject parent_instance;
+
+ GSimpleActionGroupPrivate *priv;
+};
+
+struct _GSimpleActionGroupClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+
+ /*< private >*/
+ gpointer padding[12];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_simple_action_group_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSimpleActionGroup * g_simple_action_group_new (void);
+
+GLIB_DEPRECATED_IN_2_38_FOR (g_action_map_lookup_action)
+GAction * g_simple_action_group_lookup (GSimpleActionGroup *simple,
+ const gchar *action_name);
+
+GLIB_DEPRECATED_IN_2_38_FOR (g_action_map_add_action)
+void g_simple_action_group_insert (GSimpleActionGroup *simple,
+ GAction *action);
+
+GLIB_DEPRECATED_IN_2_38_FOR (g_action_map_remove_action)
+void g_simple_action_group_remove (GSimpleActionGroup *simple,
+ const gchar *action_name);
+
+GLIB_DEPRECATED_IN_2_38_FOR (g_action_map_add_action_entries)
+void g_simple_action_group_add_entries (GSimpleActionGroup *simple,
+ const GActionEntry *entries,
+ gint n_entries,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __G_SIMPLE_ACTION_GROUP_H__ */
diff --git a/include/glib/gio/gsimpleasyncresult.h b/include/glib/gio/gsimpleasyncresult.h
new file mode 100644
index 0000000000..8daa91d400
--- /dev/null
+++ b/include/glib/gio/gsimpleasyncresult.h
@@ -0,0 +1,162 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_SIMPLE_ASYNC_RESULT_H__
+#define __G_SIMPLE_ASYNC_RESULT_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SIMPLE_ASYNC_RESULT (g_simple_async_result_get_type ())
+#define G_SIMPLE_ASYNC_RESULT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SIMPLE_ASYNC_RESULT, GSimpleAsyncResult))
+#define G_SIMPLE_ASYNC_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SIMPLE_ASYNC_RESULT, GSimpleAsyncResultClass))
+#define G_IS_SIMPLE_ASYNC_RESULT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SIMPLE_ASYNC_RESULT))
+#define G_IS_SIMPLE_ASYNC_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SIMPLE_ASYNC_RESULT))
+#define G_SIMPLE_ASYNC_RESULT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SIMPLE_ASYNC_RESULT, GSimpleAsyncResultClass))
+
+/**
+ * GSimpleAsyncResult:
+ *
+ * A simple implementation of #GAsyncResult.
+ **/
+typedef struct _GSimpleAsyncResultClass GSimpleAsyncResultClass;
+
+
+GLIB_AVAILABLE_IN_ALL
+GType g_simple_async_result_get_type (void) G_GNUC_CONST;
+
+GLIB_DEPRECATED_IN_2_46_FOR(g_task_new)
+GSimpleAsyncResult *g_simple_async_result_new (GObject *source_object,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ gpointer source_tag);
+GLIB_DEPRECATED_IN_2_46_FOR(g_task_new)
+GSimpleAsyncResult *g_simple_async_result_new_error (GObject *source_object,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ GQuark domain,
+ gint code,
+ const char *format,
+ ...) G_GNUC_PRINTF (6, 7);
+GLIB_DEPRECATED_IN_2_46_FOR(g_task_new)
+GSimpleAsyncResult *g_simple_async_result_new_from_error (GObject *source_object,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ const GError *error);
+GLIB_DEPRECATED_IN_2_46_FOR(g_task_new)
+GSimpleAsyncResult *g_simple_async_result_new_take_error (GObject *source_object,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ GError *error);
+
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple,
+ gpointer op_res,
+ GDestroyNotify destroy_op_res);
+GLIB_DEPRECATED_IN_2_46
+gpointer g_simple_async_result_get_op_res_gpointer (GSimpleAsyncResult *simple);
+
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_set_op_res_gssize (GSimpleAsyncResult *simple,
+ gssize op_res);
+GLIB_DEPRECATED_IN_2_46
+gssize g_simple_async_result_get_op_res_gssize (GSimpleAsyncResult *simple);
+
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_set_op_res_gboolean (GSimpleAsyncResult *simple,
+ gboolean op_res);
+GLIB_DEPRECATED_IN_2_46
+gboolean g_simple_async_result_get_op_res_gboolean (GSimpleAsyncResult *simple);
+
+
+
+GLIB_AVAILABLE_IN_2_32 /* Also deprecated, but can't mark something both AVAILABLE and DEPRECATED */
+void g_simple_async_result_set_check_cancellable (GSimpleAsyncResult *simple,
+ GCancellable *check_cancellable);
+GLIB_DEPRECATED_IN_2_46
+gpointer g_simple_async_result_get_source_tag (GSimpleAsyncResult *simple);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple,
+ gboolean handle_cancellation);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_complete (GSimpleAsyncResult *simple);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_complete_in_idle (GSimpleAsyncResult *simple);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_run_in_thread (GSimpleAsyncResult *simple,
+ GSimpleAsyncThreadFunc func,
+ int io_priority,
+ GCancellable *cancellable);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_set_from_error (GSimpleAsyncResult *simple,
+ const GError *error);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_take_error (GSimpleAsyncResult *simple,
+ GError *error);
+GLIB_DEPRECATED_IN_2_46
+gboolean g_simple_async_result_propagate_error (GSimpleAsyncResult *simple,
+ GError **dest);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_set_error (GSimpleAsyncResult *simple,
+ GQuark domain,
+ gint code,
+ const char *format,
+ ...) G_GNUC_PRINTF (4, 5);
+GLIB_DEPRECATED_IN_2_46
+void g_simple_async_result_set_error_va (GSimpleAsyncResult *simple,
+ GQuark domain,
+ gint code,
+ const char *format,
+ va_list args)
+ G_GNUC_PRINTF(4, 0);
+GLIB_DEPRECATED_IN_2_46
+gboolean g_simple_async_result_is_valid (GAsyncResult *result,
+ GObject *source,
+ gpointer source_tag);
+
+GLIB_DEPRECATED_IN_2_46_FOR(g_task_report_error)
+void g_simple_async_report_error_in_idle (GObject *object,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ GQuark domain,
+ gint code,
+ const char *format,
+ ...) G_GNUC_PRINTF(6, 7);
+GLIB_DEPRECATED_IN_2_46_FOR(g_task_report_error)
+void g_simple_async_report_gerror_in_idle (GObject *object,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ const GError *error);
+GLIB_DEPRECATED_IN_2_46_FOR(g_task_report_error)
+void g_simple_async_report_take_gerror_in_idle (GObject *object,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ GError *error);
+
+G_END_DECLS
+
+
+
+#endif /* __G_SIMPLE_ASYNC_RESULT_H__ */
diff --git a/include/glib/gio/gsimpleiostream.h b/include/glib/gio/gsimpleiostream.h
new file mode 100644
index 0000000000..37919d32f5
--- /dev/null
+++ b/include/glib/gio/gsimpleiostream.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2014 NICE s.r.l.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ignacio Casal Quinteiro <ignacio.casal@nice-software.com>
+ */
+
+#ifndef __G_SIMPLE_IO_STREAM_H__
+#define __G_SIMPLE_IO_STREAM_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+#include <gio/giostream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SIMPLE_IO_STREAM (g_simple_io_stream_get_type ())
+#define G_SIMPLE_IO_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_SIMPLE_IO_STREAM, GSimpleIOStream))
+#define G_IS_SIMPLE_IO_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_SIMPLE_IO_STREAM))
+
+GLIB_AVAILABLE_IN_2_44
+GType g_simple_io_stream_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_44
+GIOStream *g_simple_io_stream_new (GInputStream *input_stream,
+ GOutputStream *output_stream);
+
+G_END_DECLS
+
+#endif /* __G_SIMPLE_IO_STREAM_H__ */
diff --git a/include/glib/gio/gsimplepermission.h b/include/glib/gio/gsimplepermission.h
new file mode 100644
index 0000000000..11b8d1224a
--- /dev/null
+++ b/include/glib/gio/gsimplepermission.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_SIMPLE_PERMISSION_H__
+#define __G_SIMPLE_PERMISSION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SIMPLE_PERMISSION (g_simple_permission_get_type ())
+#define G_SIMPLE_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SIMPLE_PERMISSION, \
+ GSimplePermission))
+#define G_IS_SIMPLE_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SIMPLE_PERMISSION))
+
+GLIB_AVAILABLE_IN_ALL
+GType g_simple_permission_get_type (void);
+GLIB_AVAILABLE_IN_ALL
+GPermission * g_simple_permission_new (gboolean allowed);
+
+G_END_DECLS
+
+#endif /* __G_SIMPLE_PERMISSION_H__ */
diff --git a/include/glib/gio/gsimpleproxyresolver.h b/include/glib/gio/gsimpleproxyresolver.h
new file mode 100644
index 0000000000..e1bb199fa7
--- /dev/null
+++ b/include/glib/gio/gsimpleproxyresolver.h
@@ -0,0 +1,89 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2010, 2013 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SIMPLE_PROXY_RESOLVER_H__
+#define __G_SIMPLE_PROXY_RESOLVER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gproxyresolver.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SIMPLE_PROXY_RESOLVER (g_simple_proxy_resolver_get_type ())
+#define G_SIMPLE_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SIMPLE_PROXY_RESOLVER, GSimpleProxyResolver))
+#define G_SIMPLE_PROXY_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SIMPLE_PROXY_RESOLVER, GSimpleProxyResolverClass))
+#define G_IS_SIMPLE_PROXY_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SIMPLE_PROXY_RESOLVER))
+#define G_IS_SIMPLE_PROXY_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SIMPLE_PROXY_RESOLVER))
+#define G_SIMPLE_PROXY_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SIMPLE_PROXY_RESOLVER, GSimpleProxyResolverClass))
+
+/**
+ * GSimpleProxyResolver:
+ *
+ * A #GProxyResolver implementation for using a fixed set of proxies.
+ **/
+typedef struct _GSimpleProxyResolver GSimpleProxyResolver;
+typedef struct _GSimpleProxyResolverPrivate GSimpleProxyResolverPrivate;
+typedef struct _GSimpleProxyResolverClass GSimpleProxyResolverClass;
+
+struct _GSimpleProxyResolver
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ GSimpleProxyResolverPrivate *priv;
+};
+
+struct _GSimpleProxyResolverClass
+{
+ GObjectClass parent_class;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+GLIB_AVAILABLE_IN_2_36
+GType g_simple_proxy_resolver_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_36
+GProxyResolver *g_simple_proxy_resolver_new (const gchar *default_proxy,
+ gchar **ignore_hosts);
+
+GLIB_AVAILABLE_IN_2_36
+void g_simple_proxy_resolver_set_default_proxy (GSimpleProxyResolver *resolver,
+ const gchar *default_proxy);
+
+GLIB_AVAILABLE_IN_2_36
+void g_simple_proxy_resolver_set_ignore_hosts (GSimpleProxyResolver *resolver,
+ gchar **ignore_hosts);
+
+GLIB_AVAILABLE_IN_2_36
+void g_simple_proxy_resolver_set_uri_proxy (GSimpleProxyResolver *resolver,
+ const gchar *uri_scheme,
+ const gchar *proxy);
+
+G_END_DECLS
+
+#endif /* __G_SIMPLE_PROXY_RESOLVER_H__ */
diff --git a/include/glib/gio/gsocket.h b/include/glib/gio/gsocket.h
new file mode 100644
index 0000000000..97411355d7
--- /dev/null
+++ b/include/glib/gio/gsocket.h
@@ -0,0 +1,328 @@
+/*
+ * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima
+ * Copyright © 2009 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Kellner <gicmo@gnome.org>
+ * Samuel Cormier-Iijima <sciyoshi@gmail.com>
+ * Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_SOCKET_H__
+#define __G_SOCKET_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET (g_socket_get_type ())
+#define G_SOCKET(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SOCKET, GSocket))
+#define G_SOCKET_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SOCKET, GSocketClass))
+#define G_IS_SOCKET(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SOCKET))
+#define G_IS_SOCKET_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SOCKET))
+#define G_SOCKET_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SOCKET, GSocketClass))
+
+typedef struct _GSocketPrivate GSocketPrivate;
+typedef struct _GSocketClass GSocketClass;
+
+struct _GSocketClass
+{
+ GObjectClass parent_class;
+
+ /*< private >*/
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+ void (*_g_reserved7) (void);
+ void (*_g_reserved8) (void);
+ void (*_g_reserved9) (void);
+ void (*_g_reserved10) (void);
+};
+
+struct _GSocket
+{
+ GObject parent_instance;
+ GSocketPrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GSocket * g_socket_new (GSocketFamily family,
+ GSocketType type,
+ GSocketProtocol protocol,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GSocket * g_socket_new_from_fd (gint fd,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+int g_socket_get_fd (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+GSocketFamily g_socket_get_family (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+GSocketType g_socket_get_socket_type (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+GSocketProtocol g_socket_get_protocol (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress * g_socket_get_local_address (GSocket *socket,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress * g_socket_get_remote_address (GSocket *socket,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_set_blocking (GSocket *socket,
+ gboolean blocking);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_get_blocking (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_set_keepalive (GSocket *socket,
+ gboolean keepalive);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_get_keepalive (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+gint g_socket_get_listen_backlog (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_set_listen_backlog (GSocket *socket,
+ gint backlog);
+GLIB_AVAILABLE_IN_ALL
+guint g_socket_get_timeout (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_set_timeout (GSocket *socket,
+ guint timeout);
+
+GLIB_AVAILABLE_IN_2_32
+guint g_socket_get_ttl (GSocket *socket);
+GLIB_AVAILABLE_IN_2_32
+void g_socket_set_ttl (GSocket *socket,
+ guint ttl);
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_get_broadcast (GSocket *socket);
+GLIB_AVAILABLE_IN_2_32
+void g_socket_set_broadcast (GSocket *socket,
+ gboolean broadcast);
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_get_multicast_loopback (GSocket *socket);
+GLIB_AVAILABLE_IN_2_32
+void g_socket_set_multicast_loopback (GSocket *socket,
+ gboolean loopback);
+GLIB_AVAILABLE_IN_2_32
+guint g_socket_get_multicast_ttl (GSocket *socket);
+GLIB_AVAILABLE_IN_2_32
+void g_socket_set_multicast_ttl (GSocket *socket,
+ guint ttl);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_is_connected (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_bind (GSocket *socket,
+ GSocketAddress *address,
+ gboolean allow_reuse,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_join_multicast_group (GSocket *socket,
+ GInetAddress *group,
+ gboolean source_specific,
+ const gchar *iface,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_leave_multicast_group (GSocket *socket,
+ GInetAddress *group,
+ gboolean source_specific,
+ const gchar *iface,
+ GError **error);
+GLIB_AVAILABLE_IN_2_56
+gboolean g_socket_join_multicast_group_ssm (GSocket *socket,
+ GInetAddress *group,
+ GInetAddress *source_specific,
+ const gchar *iface,
+ GError **error);
+GLIB_AVAILABLE_IN_2_56
+gboolean g_socket_leave_multicast_group_ssm (GSocket *socket,
+ GInetAddress *group,
+ GInetAddress *source_specific,
+ const gchar *iface,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_connect (GSocket *socket,
+ GSocketAddress *address,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_check_connect_result (GSocket *socket,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_get_available_bytes (GSocket *socket);
+
+GLIB_AVAILABLE_IN_ALL
+GIOCondition g_socket_condition_check (GSocket *socket,
+ GIOCondition condition);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_condition_wait (GSocket *socket,
+ GIOCondition condition,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_condition_timed_wait (GSocket *socket,
+ GIOCondition condition,
+ gint64 timeout_us,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GSocket * g_socket_accept (GSocket *socket,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_listen (GSocket *socket,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_receive (GSocket *socket,
+ gchar *buffer,
+ gsize size,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_receive_from (GSocket *socket,
+ GSocketAddress **address,
+ gchar *buffer,
+ gsize size,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_send (GSocket *socket,
+ const gchar *buffer,
+ gsize size,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_send_to (GSocket *socket,
+ GSocketAddress *address,
+ const gchar *buffer,
+ gsize size,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_receive_message (GSocket *socket,
+ GSocketAddress **address,
+ GInputVector *vectors,
+ gint num_vectors,
+ GSocketControlMessage ***messages,
+ gint *num_messages,
+ gint *flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_send_message (GSocket *socket,
+ GSocketAddress *address,
+ GOutputVector *vectors,
+ gint num_vectors,
+ GSocketControlMessage **messages,
+ gint num_messages,
+ gint flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_48
+gint g_socket_receive_messages (GSocket *socket,
+ GInputMessage *messages,
+ guint num_messages,
+ gint flags,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_44
+gint g_socket_send_messages (GSocket *socket,
+ GOutputMessage *messages,
+ guint num_messages,
+ gint flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_close (GSocket *socket,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_shutdown (GSocket *socket,
+ gboolean shutdown_read,
+ gboolean shutdown_write,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_is_closed (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+GSource * g_socket_create_source (GSocket *socket,
+ GIOCondition condition,
+ GCancellable *cancellable);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_speaks_ipv4 (GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+GCredentials *g_socket_get_credentials (GSocket *socket,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_receive_with_blocking (GSocket *socket,
+ gchar *buffer,
+ gsize size,
+ gboolean blocking,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_send_with_blocking (GSocket *socket,
+ const gchar *buffer,
+ gsize size,
+ gboolean blocking,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_60
+GPollableReturn g_socket_send_message_with_timeout (GSocket *socket,
+ GSocketAddress *address,
+ const GOutputVector *vectors,
+ gint num_vectors,
+ GSocketControlMessage **messages,
+ gint num_messages,
+ gint flags,
+ gint64 timeout_us,
+ gsize *bytes_written,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_36
+gboolean g_socket_get_option (GSocket *socket,
+ gint level,
+ gint optname,
+ gint *value,
+ GError **error);
+GLIB_AVAILABLE_IN_2_36
+gboolean g_socket_set_option (GSocket *socket,
+ gint level,
+ gint optname,
+ gint value,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_SOCKET_H__ */
diff --git a/include/glib/gio/gsocketaddress.h b/include/glib/gio/gsocketaddress.h
new file mode 100644
index 0000000000..ca2dbdae2f
--- /dev/null
+++ b/include/glib/gio/gsocketaddress.h
@@ -0,0 +1,82 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Kellner <gicmo@gnome.org>
+ * Samuel Cormier-Iijima <sciyoshi@gmail.com>
+ */
+
+#ifndef __G_SOCKET_ADDRESS_H__
+#define __G_SOCKET_ADDRESS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_ADDRESS (g_socket_address_get_type ())
+#define G_SOCKET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SOCKET_ADDRESS, GSocketAddress))
+#define G_SOCKET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SOCKET_ADDRESS, GSocketAddressClass))
+#define G_IS_SOCKET_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SOCKET_ADDRESS))
+#define G_IS_SOCKET_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SOCKET_ADDRESS))
+#define G_SOCKET_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SOCKET_ADDRESS, GSocketAddressClass))
+
+typedef struct _GSocketAddressClass GSocketAddressClass;
+
+struct _GSocketAddress
+{
+ GObject parent_instance;
+};
+
+struct _GSocketAddressClass
+{
+ GObjectClass parent_class;
+
+ GSocketFamily (*get_family) (GSocketAddress *address);
+
+ gssize (*get_native_size) (GSocketAddress *address);
+
+ gboolean (*to_native) (GSocketAddress *address,
+ gpointer dest,
+ gsize destlen,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_address_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketFamily g_socket_address_get_family (GSocketAddress *address);
+
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress * g_socket_address_new_from_native (gpointer native,
+ gsize len);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_address_to_native (GSocketAddress *address,
+ gpointer dest,
+ gsize destlen,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_socket_address_get_native_size (GSocketAddress *address);
+
+G_END_DECLS
+
+#endif /* __G_SOCKET_ADDRESS_H__ */
diff --git a/include/glib/gio/gsocketaddressenumerator.h b/include/glib/gio/gsocketaddressenumerator.h
new file mode 100644
index 0000000000..2a180fdf50
--- /dev/null
+++ b/include/glib/gio/gsocketaddressenumerator.h
@@ -0,0 +1,101 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SOCKET_ADDRESS_ENUMERATOR_H__
+#define __G_SOCKET_ADDRESS_ENUMERATOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_ADDRESS_ENUMERATOR (g_socket_address_enumerator_get_type ())
+#define G_SOCKET_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SOCKET_ADDRESS_ENUMERATOR, GSocketAddressEnumerator))
+#define G_SOCKET_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SOCKET_ADDRESS_ENUMERATOR, GSocketAddressEnumeratorClass))
+#define G_IS_SOCKET_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SOCKET_ADDRESS_ENUMERATOR))
+#define G_IS_SOCKET_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SOCKET_ADDRESS_ENUMERATOR))
+#define G_SOCKET_ADDRESS_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SOCKET_ADDRESS_ENUMERATOR, GSocketAddressEnumeratorClass))
+
+/**
+ * GSocketAddressEnumerator:
+ *
+ * Enumerator type for objects that contain or generate
+ * #GSocketAddress instances.
+ */
+typedef struct _GSocketAddressEnumeratorClass GSocketAddressEnumeratorClass;
+
+struct _GSocketAddressEnumerator
+{
+ /*< private >*/
+ GObject parent_instance;
+};
+
+/**
+ * GSocketAddressEnumeratorClass:
+ * @next: Virtual method for g_socket_address_enumerator_next().
+ * @next_async: Virtual method for g_socket_address_enumerator_next_async().
+ * @next_finish: Virtual method for g_socket_address_enumerator_next_finish().
+ *
+ * Class structure for #GSocketAddressEnumerator.
+ */
+struct _GSocketAddressEnumeratorClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+
+ /*< public >*/
+ /* Virtual Table */
+
+ GSocketAddress * (* next) (GSocketAddressEnumerator *enumerator,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (* next_async) (GSocketAddressEnumerator *enumerator,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GSocketAddress * (* next_finish) (GSocketAddressEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_address_enumerator_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress *g_socket_address_enumerator_next (GSocketAddressEnumerator *enumerator,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_socket_address_enumerator_next_async (GSocketAddressEnumerator *enumerator,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress *g_socket_address_enumerator_next_finish (GSocketAddressEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error);
+
+G_END_DECLS
+
+
+#endif /* __G_SOCKET_ADDRESS_ENUMERATOR_H__ */
diff --git a/include/glib/gio/gsocketclient.h b/include/glib/gio/gsocketclient.h
new file mode 100644
index 0000000000..f0153450d9
--- /dev/null
+++ b/include/glib/gio/gsocketclient.h
@@ -0,0 +1,197 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2008, 2009 Codethink Limited
+ * Copyright © 2009 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ * Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_SOCKET_CLIENT_H__
+#define __G_SOCKET_CLIENT_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_CLIENT (g_socket_client_get_type ())
+#define G_SOCKET_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SOCKET_CLIENT, GSocketClient))
+#define G_SOCKET_CLIENT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SOCKET_CLIENT, GSocketClientClass))
+#define G_IS_SOCKET_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SOCKET_CLIENT))
+#define G_IS_SOCKET_CLIENT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SOCKET_CLIENT))
+#define G_SOCKET_CLIENT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SOCKET_CLIENT, GSocketClientClass))
+
+typedef struct _GSocketClientPrivate GSocketClientPrivate;
+typedef struct _GSocketClientClass GSocketClientClass;
+
+struct _GSocketClientClass
+{
+ GObjectClass parent_class;
+
+ void (* event) (GSocketClient *client,
+ GSocketClientEvent event,
+ GSocketConnectable *connectable,
+ GIOStream *connection);
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+};
+
+struct _GSocketClient
+{
+ GObject parent_instance;
+ GSocketClientPrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_client_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketClient *g_socket_client_new (void);
+
+GLIB_AVAILABLE_IN_ALL
+GSocketFamily g_socket_client_get_family (GSocketClient *client);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_set_family (GSocketClient *client,
+ GSocketFamily family);
+GLIB_AVAILABLE_IN_ALL
+GSocketType g_socket_client_get_socket_type (GSocketClient *client);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_set_socket_type (GSocketClient *client,
+ GSocketType type);
+GLIB_AVAILABLE_IN_ALL
+GSocketProtocol g_socket_client_get_protocol (GSocketClient *client);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_set_protocol (GSocketClient *client,
+ GSocketProtocol protocol);
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress *g_socket_client_get_local_address (GSocketClient *client);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_set_local_address (GSocketClient *client,
+ GSocketAddress *address);
+GLIB_AVAILABLE_IN_ALL
+guint g_socket_client_get_timeout (GSocketClient *client);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_set_timeout (GSocketClient *client,
+ guint timeout);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_client_get_enable_proxy (GSocketClient *client);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_set_enable_proxy (GSocketClient *client,
+ gboolean enable);
+
+GLIB_AVAILABLE_IN_2_28
+gboolean g_socket_client_get_tls (GSocketClient *client);
+GLIB_AVAILABLE_IN_2_28
+void g_socket_client_set_tls (GSocketClient *client,
+ gboolean tls);
+GLIB_AVAILABLE_IN_2_28
+GTlsCertificateFlags g_socket_client_get_tls_validation_flags (GSocketClient *client);
+GLIB_AVAILABLE_IN_2_28
+void g_socket_client_set_tls_validation_flags (GSocketClient *client,
+ GTlsCertificateFlags flags);
+GLIB_AVAILABLE_IN_2_36
+GProxyResolver *g_socket_client_get_proxy_resolver (GSocketClient *client);
+GLIB_AVAILABLE_IN_2_36
+void g_socket_client_set_proxy_resolver (GSocketClient *client,
+ GProxyResolver *proxy_resolver);
+
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_client_connect (GSocketClient *client,
+ GSocketConnectable *connectable,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_client_connect_to_host (GSocketClient *client,
+ const gchar *host_and_port,
+ guint16 default_port,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_client_connect_to_service (GSocketClient *client,
+ const gchar *domain,
+ const gchar *service,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_26
+GSocketConnection * g_socket_client_connect_to_uri (GSocketClient *client,
+ const gchar *uri,
+ guint16 default_port,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_connect_async (GSocketClient *client,
+ GSocketConnectable *connectable,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_client_connect_finish (GSocketClient *client,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_connect_to_host_async (GSocketClient *client,
+ const gchar *host_and_port,
+ guint16 default_port,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_client_connect_to_host_finish (GSocketClient *client,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_connect_to_service_async (GSocketClient *client,
+ const gchar *domain,
+ const gchar *service,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_client_connect_to_service_finish (GSocketClient *client,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_connect_to_uri_async (GSocketClient *client,
+ const gchar *uri,
+ guint16 default_port,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_client_connect_to_uri_finish (GSocketClient *client,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_client_add_application_proxy (GSocketClient *client,
+ const gchar *protocol);
+
+G_END_DECLS
+
+#endif /* __G_SOCKET_CLIENT_H___ */
diff --git a/include/glib/gio/gsocketconnectable.h b/include/glib/gio/gsocketconnectable.h
new file mode 100644
index 0000000000..da882143a3
--- /dev/null
+++ b/include/glib/gio/gsocketconnectable.h
@@ -0,0 +1,81 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SOCKET_CONNECTABLE_H__
+#define __G_SOCKET_CONNECTABLE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_CONNECTABLE (g_socket_connectable_get_type ())
+#define G_SOCKET_CONNECTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_SOCKET_CONNECTABLE, GSocketConnectable))
+#define G_IS_SOCKET_CONNECTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_SOCKET_CONNECTABLE))
+#define G_SOCKET_CONNECTABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_SOCKET_CONNECTABLE, GSocketConnectableIface))
+
+/**
+ * GSocketConnectable:
+ *
+ * Interface for objects that contain or generate a #GSocketAddress.
+ */
+typedef struct _GSocketConnectableIface GSocketConnectableIface;
+
+/**
+ * GSocketConnectableIface:
+ * @g_iface: The parent interface.
+ * @enumerate: Creates a #GSocketAddressEnumerator
+ * @proxy_enumerate: Creates a #GProxyAddressEnumerator
+ * @to_string: Format the connectable’s address as a string for debugging.
+ * Implementing this is optional. (Since: 2.48)
+ *
+ * Provides an interface for returning a #GSocketAddressEnumerator
+ * and #GProxyAddressEnumerator
+ */
+struct _GSocketConnectableIface
+{
+ GTypeInterface g_iface;
+
+ /* Virtual Table */
+
+ GSocketAddressEnumerator * (* enumerate) (GSocketConnectable *connectable);
+
+ GSocketAddressEnumerator * (* proxy_enumerate) (GSocketConnectable *connectable);
+
+ gchar * (* to_string) (GSocketConnectable *connectable);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_connectable_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketAddressEnumerator *g_socket_connectable_enumerate (GSocketConnectable *connectable);
+
+GLIB_AVAILABLE_IN_ALL
+GSocketAddressEnumerator *g_socket_connectable_proxy_enumerate (GSocketConnectable *connectable);
+
+GLIB_AVAILABLE_IN_2_48
+gchar *g_socket_connectable_to_string (GSocketConnectable *connectable);
+
+G_END_DECLS
+
+
+#endif /* __G_SOCKET_CONNECTABLE_H__ */
diff --git a/include/glib/gio/gsocketconnection.h b/include/glib/gio/gsocketconnection.h
new file mode 100644
index 0000000000..bc7a076009
--- /dev/null
+++ b/include/glib/gio/gsocketconnection.h
@@ -0,0 +1,115 @@
+/* GIO - GLib Input, Output and Streaming Library
+ * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima
+ * Copyright © 2009 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Kellner <gicmo@gnome.org>
+ * Samuel Cormier-Iijima <sciyoshi@gmail.com>
+ * Ryan Lortie <desrt@desrt.ca>
+ * Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_SOCKET_CONNECTION_H__
+#define __G_SOCKET_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <glib-object.h>
+#include <gio/gsocket.h>
+#include <gio/giostream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_CONNECTION (g_socket_connection_get_type ())
+#define G_SOCKET_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SOCKET_CONNECTION, GSocketConnection))
+#define G_SOCKET_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SOCKET_CONNECTION, GSocketConnectionClass))
+#define G_IS_SOCKET_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SOCKET_CONNECTION))
+#define G_IS_SOCKET_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SOCKET_CONNECTION))
+#define G_SOCKET_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SOCKET_CONNECTION, GSocketConnectionClass))
+
+typedef struct _GSocketConnectionPrivate GSocketConnectionPrivate;
+typedef struct _GSocketConnectionClass GSocketConnectionClass;
+
+struct _GSocketConnectionClass
+{
+ GIOStreamClass parent_class;
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+};
+
+struct _GSocketConnection
+{
+ GIOStream parent_instance;
+ GSocketConnectionPrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_connection_is_connected (GSocketConnection *connection);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_connection_connect (GSocketConnection *connection,
+ GSocketAddress *address,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_2_32
+void g_socket_connection_connect_async (GSocketConnection *connection,
+ GSocketAddress *address,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_socket_connection_connect_finish (GSocketConnection *connection,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GSocket *g_socket_connection_get_socket (GSocketConnection *connection);
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress *g_socket_connection_get_local_address (GSocketConnection *connection,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GSocketAddress *g_socket_connection_get_remote_address (GSocketConnection *connection,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_socket_connection_factory_register_type (GType g_type,
+ GSocketFamily family,
+ GSocketType type,
+ gint protocol);
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_connection_factory_lookup_type (GSocketFamily family,
+ GSocketType type,
+ gint protocol_id);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection *g_socket_connection_factory_create_connection (GSocket *socket);
+
+G_END_DECLS
+
+#endif /* __G_SOCKET_CONNECTION_H__ */
diff --git a/include/glib/gio/gsocketcontrolmessage.h b/include/glib/gio/gsocketcontrolmessage.h
new file mode 100644
index 0000000000..a4a5d0194c
--- /dev/null
+++ b/include/glib/gio/gsocketcontrolmessage.h
@@ -0,0 +1,111 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2009 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_SOCKET_CONTROL_MESSAGE_H__
+#define __G_SOCKET_CONTROL_MESSAGE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_CONTROL_MESSAGE (g_socket_control_message_get_type ())
+#define G_SOCKET_CONTROL_MESSAGE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SOCKET_CONTROL_MESSAGE, \
+ GSocketControlMessage))
+#define G_SOCKET_CONTROL_MESSAGE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SOCKET_CONTROL_MESSAGE, \
+ GSocketControlMessageClass))
+#define G_IS_SOCKET_CONTROL_MESSAGE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SOCKET_CONTROL_MESSAGE))
+#define G_IS_SOCKET_CONTROL_MESSAGE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SOCKET_CONTROL_MESSAGE))
+#define G_SOCKET_CONTROL_MESSAGE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SOCKET_CONTROL_MESSAGE, \
+ GSocketControlMessageClass))
+
+typedef struct _GSocketControlMessagePrivate GSocketControlMessagePrivate;
+typedef struct _GSocketControlMessageClass GSocketControlMessageClass;
+
+/**
+ * GSocketControlMessageClass:
+ * @get_size: gets the size of the message.
+ * @get_level: gets the protocol of the message.
+ * @get_type: gets the protocol specific type of the message.
+ * @serialize: Writes out the message data.
+ * @deserialize: Tries to deserialize a message.
+ *
+ * Class structure for #GSocketControlMessage.
+ **/
+
+struct _GSocketControlMessageClass
+{
+ GObjectClass parent_class;
+
+ gsize (* get_size) (GSocketControlMessage *message);
+ int (* get_level) (GSocketControlMessage *message);
+ int (* get_type) (GSocketControlMessage *message);
+ void (* serialize) (GSocketControlMessage *message,
+ gpointer data);
+ GSocketControlMessage *(* deserialize) (int level,
+ int type,
+ gsize size,
+ gpointer data);
+
+ /*< private >*/
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+struct _GSocketControlMessage
+{
+ GObject parent_instance;
+ GSocketControlMessagePrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_control_message_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gsize g_socket_control_message_get_size (GSocketControlMessage *message);
+GLIB_AVAILABLE_IN_ALL
+int g_socket_control_message_get_level (GSocketControlMessage *message);
+GLIB_AVAILABLE_IN_ALL
+int g_socket_control_message_get_msg_type (GSocketControlMessage *message);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_control_message_serialize (GSocketControlMessage *message,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+GSocketControlMessage *g_socket_control_message_deserialize (int level,
+ int type,
+ gsize size,
+ gpointer data);
+
+
+G_END_DECLS
+
+#endif /* __G_SOCKET_CONTROL_MESSAGE_H__ */
diff --git a/include/glib/gio/gsocketlistener.h b/include/glib/gio/gsocketlistener.h
new file mode 100644
index 0000000000..e5185c28d8
--- /dev/null
+++ b/include/glib/gio/gsocketlistener.h
@@ -0,0 +1,155 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima
+ * Copyright © 2009 Codethink Limited
+ * Copyright © 2009 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Kellner <gicmo@gnome.org>
+ * Samuel Cormier-Iijima <sciyoshi@gmail.com>
+ * Ryan Lortie <desrt@desrt.ca>
+ * Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_SOCKET_LISTENER_H__
+#define __G_SOCKET_LISTENER_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_LISTENER (g_socket_listener_get_type ())
+#define G_SOCKET_LISTENER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SOCKET_LISTENER, GSocketListener))
+#define G_SOCKET_LISTENER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
+#define G_IS_SOCKET_LISTENER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SOCKET_LISTENER))
+#define G_IS_SOCKET_LISTENER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SOCKET_LISTENER))
+#define G_SOCKET_LISTENER_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
+
+typedef struct _GSocketListenerPrivate GSocketListenerPrivate;
+typedef struct _GSocketListenerClass GSocketListenerClass;
+
+/**
+ * GSocketListenerClass:
+ * @changed: virtual method called when the set of socket listened to changes
+ *
+ * Class structure for #GSocketListener.
+ **/
+struct _GSocketListenerClass
+{
+ GObjectClass parent_class;
+
+ void (* changed) (GSocketListener *listener);
+
+ void (* event) (GSocketListener *listener,
+ GSocketListenerEvent event,
+ GSocket *socket);
+
+ /* Padding for future expansion */
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+};
+
+struct _GSocketListener
+{
+ GObject parent_instance;
+ GSocketListenerPrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_listener_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketListener * g_socket_listener_new (void);
+
+GLIB_AVAILABLE_IN_ALL
+void g_socket_listener_set_backlog (GSocketListener *listener,
+ int listen_backlog);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_listener_add_socket (GSocketListener *listener,
+ GSocket *socket,
+ GObject *source_object,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_listener_add_address (GSocketListener *listener,
+ GSocketAddress *address,
+ GSocketType type,
+ GSocketProtocol protocol,
+ GObject *source_object,
+ GSocketAddress **effective_address,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_listener_add_inet_port (GSocketListener *listener,
+ guint16 port,
+ GObject *source_object,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_socket_listener_add_any_inet_port (GSocketListener *listener,
+ GObject *source_object,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GSocket * g_socket_listener_accept_socket (GSocketListener *listener,
+ GObject **source_object,
+ GCancellable *cancellable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_listener_accept_socket_async (GSocketListener *listener,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSocket * g_socket_listener_accept_socket_finish (GSocketListener *listener,
+ GAsyncResult *result,
+ GObject **source_object,
+ GError **error);
+
+
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_listener_accept (GSocketListener *listener,
+ GObject **source_object,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_socket_listener_accept_async (GSocketListener *listener,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection * g_socket_listener_accept_finish (GSocketListener *listener,
+ GAsyncResult *result,
+ GObject **source_object,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_socket_listener_close (GSocketListener *listener);
+
+G_END_DECLS
+
+#endif /* __G_SOCKET_LISTENER_H__ */
diff --git a/include/glib/gio/gsocketservice.h b/include/glib/gio/gsocketservice.h
new file mode 100644
index 0000000000..f25a1b6b75
--- /dev/null
+++ b/include/glib/gio/gsocketservice.h
@@ -0,0 +1,93 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2009 Codethink Limited
+ * Copyright © 2009 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ * Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_SOCKET_SERVICE_H__
+#define __G_SOCKET_SERVICE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gsocketlistener.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SOCKET_SERVICE (g_socket_service_get_type ())
+#define G_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_SOCKET_SERVICE, GSocketService))
+#define G_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_SOCKET_SERVICE, GSocketServiceClass))
+#define G_IS_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_SOCKET_SERVICE))
+#define G_IS_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_SOCKET_SERVICE))
+#define G_SOCKET_SERVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_SOCKET_SERVICE, GSocketServiceClass))
+
+typedef struct _GSocketServicePrivate GSocketServicePrivate;
+typedef struct _GSocketServiceClass GSocketServiceClass;
+
+/**
+ * GSocketServiceClass:
+ * @incomming: signal emitted when new connections are accepted
+ *
+ * Class structure for #GSocketService.
+ */
+struct _GSocketServiceClass
+{
+ GSocketListenerClass parent_class;
+
+ gboolean (* incoming) (GSocketService *service,
+ GSocketConnection *connection,
+ GObject *source_object);
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+};
+
+struct _GSocketService
+{
+ GSocketListener parent_instance;
+ GSocketServicePrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_socket_service_get_type (void);
+
+GLIB_AVAILABLE_IN_ALL
+GSocketService *g_socket_service_new (void);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_service_start (GSocketService *service);
+GLIB_AVAILABLE_IN_ALL
+void g_socket_service_stop (GSocketService *service);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_socket_service_is_active (GSocketService *service);
+
+
+G_END_DECLS
+
+#endif /* __G_SOCKET_SERVICE_H__ */
diff --git a/include/glib/gio/gsrvtarget.h b/include/glib/gio/gsrvtarget.h
new file mode 100644
index 0000000000..3ef16f1398
--- /dev/null
+++ b/include/glib/gio/gsrvtarget.h
@@ -0,0 +1,59 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SRV_TARGET_H__
+#define __G_SRV_TARGET_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+GType g_srv_target_get_type (void) G_GNUC_CONST;
+#define G_TYPE_SRV_TARGET (g_srv_target_get_type ())
+
+GLIB_AVAILABLE_IN_ALL
+GSrvTarget *g_srv_target_new (const gchar *hostname,
+ guint16 port,
+ guint16 priority,
+ guint16 weight);
+GLIB_AVAILABLE_IN_ALL
+GSrvTarget *g_srv_target_copy (GSrvTarget *target);
+GLIB_AVAILABLE_IN_ALL
+void g_srv_target_free (GSrvTarget *target);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_srv_target_get_hostname (GSrvTarget *target);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_srv_target_get_port (GSrvTarget *target);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_srv_target_get_priority (GSrvTarget *target);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_srv_target_get_weight (GSrvTarget *target);
+
+GLIB_AVAILABLE_IN_ALL
+GList *g_srv_target_list_sort (GList *targets);
+
+G_END_DECLS
+
+#endif /* __G_SRV_TARGET_H__ */
+
diff --git a/include/glib/gio/gsubprocess.h b/include/glib/gio/gsubprocess.h
new file mode 100644
index 0000000000..68bb26aab5
--- /dev/null
+++ b/include/glib/gio/gsubprocess.h
@@ -0,0 +1,167 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2012 Colin Walters <walters@verbum.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Colin Walters <walters@verbum.org>
+ */
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#ifndef __G_SUBPROCESS_H__
+#define __G_SUBPROCESS_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SUBPROCESS (g_subprocess_get_type ())
+#define G_SUBPROCESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SUBPROCESS, GSubprocess))
+#define G_IS_SUBPROCESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SUBPROCESS))
+
+GLIB_AVAILABLE_IN_2_40
+GType g_subprocess_get_type (void) G_GNUC_CONST;
+
+/**** Core API ****/
+
+GLIB_AVAILABLE_IN_2_40
+GSubprocess * g_subprocess_new (GSubprocessFlags flags,
+ GError **error,
+ const gchar *argv0,
+ ...) G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_2_40
+GSubprocess * g_subprocess_newv (const gchar * const *argv,
+ GSubprocessFlags flags,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+GOutputStream * g_subprocess_get_stdin_pipe (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+GInputStream * g_subprocess_get_stdout_pipe (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+GInputStream * g_subprocess_get_stderr_pipe (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+const gchar * g_subprocess_get_identifier (GSubprocess *subprocess);
+
+#ifdef G_OS_UNIX
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_send_signal (GSubprocess *subprocess,
+ gint signal_num);
+#endif
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_force_exit (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_wait (GSubprocess *subprocess,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_wait_async (GSubprocess *subprocess,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_wait_finish (GSubprocess *subprocess,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_wait_check (GSubprocess *subprocess,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_wait_check_async (GSubprocess *subprocess,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_wait_check_finish (GSubprocess *subprocess,
+ GAsyncResult *result,
+ GError **error);
+
+
+GLIB_AVAILABLE_IN_2_40
+gint g_subprocess_get_status (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_get_successful (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_get_if_exited (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+gint g_subprocess_get_exit_status (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_get_if_signaled (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+gint g_subprocess_get_term_sig (GSubprocess *subprocess);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_communicate (GSubprocess *subprocess,
+ GBytes *stdin_buf,
+ GCancellable *cancellable,
+ GBytes **stdout_buf,
+ GBytes **stderr_buf,
+ GError **error);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_communicate_async (GSubprocess *subprocess,
+ GBytes *stdin_buf,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_communicate_finish (GSubprocess *subprocess,
+ GAsyncResult *result,
+ GBytes **stdout_buf,
+ GBytes **stderr_buf,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_communicate_utf8 (GSubprocess *subprocess,
+ const char *stdin_buf,
+ GCancellable *cancellable,
+ char **stdout_buf,
+ char **stderr_buf,
+ GError **error);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_communicate_utf8_async (GSubprocess *subprocess,
+ const char *stdin_buf,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_subprocess_communicate_utf8_finish (GSubprocess *subprocess,
+ GAsyncResult *result,
+ char **stdout_buf,
+ char **stderr_buf,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_SUBPROCESS_H__ */
diff --git a/include/glib/gio/gsubprocesslauncher.h b/include/glib/gio/gsubprocesslauncher.h
new file mode 100644
index 0000000000..05d83f131d
--- /dev/null
+++ b/include/glib/gio/gsubprocesslauncher.h
@@ -0,0 +1,116 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2012,2013 Colin Walters <walters@verbum.org>
+ * Copyright © 2012,2013 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ * Author: Colin Walters <walters@verbum.org>
+ */
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#ifndef __G_SUBPROCESS_LAUNCHER_H__
+#define __G_SUBPROCESS_LAUNCHER_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SUBPROCESS_LAUNCHER (g_subprocess_launcher_get_type ())
+#define G_SUBPROCESS_LAUNCHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SUBPROCESS_LAUNCHER, GSubprocessLauncher))
+#define G_IS_SUBPROCESS_LAUNCHER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SUBPROCESS_LAUNCHER))
+
+GLIB_AVAILABLE_IN_2_40
+GType g_subprocess_launcher_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_40
+GSubprocessLauncher * g_subprocess_launcher_new (GSubprocessFlags flags);
+
+GLIB_AVAILABLE_IN_2_40
+GSubprocess * g_subprocess_launcher_spawn (GSubprocessLauncher *self,
+ GError **error,
+ const gchar *argv0,
+ ...) G_GNUC_NULL_TERMINATED;
+
+GLIB_AVAILABLE_IN_2_40
+GSubprocess * g_subprocess_launcher_spawnv (GSubprocessLauncher *self,
+ const gchar * const *argv,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_set_environ (GSubprocessLauncher *self,
+ gchar **env);
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_setenv (GSubprocessLauncher *self,
+ const gchar *variable,
+ const gchar *value,
+ gboolean overwrite);
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_unsetenv (GSubprocessLauncher *self,
+ const gchar *variable);
+
+GLIB_AVAILABLE_IN_2_40
+const gchar * g_subprocess_launcher_getenv (GSubprocessLauncher *self,
+ const gchar *variable);
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_set_cwd (GSubprocessLauncher *self,
+ const gchar *cwd);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_set_flags (GSubprocessLauncher *self,
+ GSubprocessFlags flags);
+
+/* Extended I/O control, only available on UNIX */
+#ifdef G_OS_UNIX
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_set_stdin_file_path (GSubprocessLauncher *self,
+ const gchar *path);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_take_stdin_fd (GSubprocessLauncher *self,
+ gint fd);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_set_stdout_file_path (GSubprocessLauncher *self,
+ const gchar *path);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_take_stdout_fd (GSubprocessLauncher *self,
+ gint fd);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_set_stderr_file_path (GSubprocessLauncher *self,
+ const gchar *path);
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_take_stderr_fd (GSubprocessLauncher *self,
+ gint fd);
+
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_take_fd (GSubprocessLauncher *self,
+ gint source_fd,
+ gint target_fd);
+
+/* Child setup, only available on UNIX */
+GLIB_AVAILABLE_IN_2_40
+void g_subprocess_launcher_set_child_setup (GSubprocessLauncher *self,
+ GSpawnChildSetupFunc child_setup,
+ gpointer user_data,
+ GDestroyNotify destroy_notify);
+#endif
+
+G_END_DECLS
+
+#endif /* __G_SUBPROCESS_H__ */
diff --git a/include/glib/gio/gtask.h b/include/glib/gio/gtask.h
new file mode 100644
index 0000000000..4fc1c859e3
--- /dev/null
+++ b/include/glib/gio/gtask.h
@@ -0,0 +1,165 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2011 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_TASK_H__
+#define __G_TASK_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TASK (g_task_get_type ())
+#define G_TASK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TASK, GTask))
+#define G_TASK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_TASK, GTaskClass))
+#define G_IS_TASK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TASK))
+#define G_IS_TASK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_TASK))
+#define G_TASK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_TASK, GTaskClass))
+
+typedef struct _GTaskClass GTaskClass;
+
+GLIB_AVAILABLE_IN_2_36
+GType g_task_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_36
+GTask *g_task_new (gpointer source_object,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer callback_data);
+
+GLIB_AVAILABLE_IN_2_36
+void g_task_report_error (gpointer source_object,
+ GAsyncReadyCallback callback,
+ gpointer callback_data,
+ gpointer source_tag,
+ GError *error);
+GLIB_AVAILABLE_IN_2_36
+void g_task_report_new_error (gpointer source_object,
+ GAsyncReadyCallback callback,
+ gpointer callback_data,
+ gpointer source_tag,
+ GQuark domain,
+ gint code,
+ const char *format,
+ ...) G_GNUC_PRINTF(7, 8);
+
+GLIB_AVAILABLE_IN_2_36
+void g_task_set_task_data (GTask *task,
+ gpointer task_data,
+ GDestroyNotify task_data_destroy);
+GLIB_AVAILABLE_IN_2_36
+void g_task_set_priority (GTask *task,
+ gint priority);
+GLIB_AVAILABLE_IN_2_36
+void g_task_set_check_cancellable (GTask *task,
+ gboolean check_cancellable);
+GLIB_AVAILABLE_IN_2_36
+void g_task_set_source_tag (GTask *task,
+ gpointer source_tag);
+GLIB_AVAILABLE_IN_2_60
+void g_task_set_name (GTask *task,
+ const gchar *name);
+
+GLIB_AVAILABLE_IN_2_36
+gpointer g_task_get_source_object (GTask *task);
+GLIB_AVAILABLE_IN_2_36
+gpointer g_task_get_task_data (GTask *task);
+GLIB_AVAILABLE_IN_2_36
+gint g_task_get_priority (GTask *task);
+GLIB_AVAILABLE_IN_2_36
+GMainContext *g_task_get_context (GTask *task);
+GLIB_AVAILABLE_IN_2_36
+GCancellable *g_task_get_cancellable (GTask *task);
+GLIB_AVAILABLE_IN_2_36
+gboolean g_task_get_check_cancellable (GTask *task);
+GLIB_AVAILABLE_IN_2_36
+gpointer g_task_get_source_tag (GTask *task);
+GLIB_AVAILABLE_IN_2_60
+const gchar *g_task_get_name (GTask *task);
+
+GLIB_AVAILABLE_IN_2_36
+gboolean g_task_is_valid (gpointer result,
+ gpointer source_object);
+
+
+typedef void (*GTaskThreadFunc) (GTask *task,
+ gpointer source_object,
+ gpointer task_data,
+ GCancellable *cancellable);
+GLIB_AVAILABLE_IN_2_36
+void g_task_run_in_thread (GTask *task,
+ GTaskThreadFunc task_func);
+GLIB_AVAILABLE_IN_2_36
+void g_task_run_in_thread_sync (GTask *task,
+ GTaskThreadFunc task_func);
+GLIB_AVAILABLE_IN_2_36
+gboolean g_task_set_return_on_cancel (GTask *task,
+ gboolean return_on_cancel);
+GLIB_AVAILABLE_IN_2_36
+gboolean g_task_get_return_on_cancel (GTask *task);
+
+GLIB_AVAILABLE_IN_2_36
+void g_task_attach_source (GTask *task,
+ GSource *source,
+ GSourceFunc callback);
+
+
+GLIB_AVAILABLE_IN_2_36
+void g_task_return_pointer (GTask *task,
+ gpointer result,
+ GDestroyNotify result_destroy);
+GLIB_AVAILABLE_IN_2_36
+void g_task_return_boolean (GTask *task,
+ gboolean result);
+GLIB_AVAILABLE_IN_2_36
+void g_task_return_int (GTask *task,
+ gssize result);
+
+GLIB_AVAILABLE_IN_2_36
+void g_task_return_error (GTask *task,
+ GError *error);
+GLIB_AVAILABLE_IN_2_36
+void g_task_return_new_error (GTask *task,
+ GQuark domain,
+ gint code,
+ const char *format,
+ ...) G_GNUC_PRINTF (4, 5);
+
+GLIB_AVAILABLE_IN_2_36
+gboolean g_task_return_error_if_cancelled (GTask *task);
+
+GLIB_AVAILABLE_IN_2_36
+gpointer g_task_propagate_pointer (GTask *task,
+ GError **error);
+GLIB_AVAILABLE_IN_2_36
+gboolean g_task_propagate_boolean (GTask *task,
+ GError **error);
+GLIB_AVAILABLE_IN_2_36
+gssize g_task_propagate_int (GTask *task,
+ GError **error);
+GLIB_AVAILABLE_IN_2_36
+gboolean g_task_had_error (GTask *task);
+GLIB_AVAILABLE_IN_2_44
+gboolean g_task_get_completed (GTask *task);
+
+G_END_DECLS
+
+#endif /* __G_TASK_H__ */
diff --git a/include/glib/gio/gtcpconnection.h b/include/glib/gio/gtcpconnection.h
new file mode 100644
index 0000000000..39645f914b
--- /dev/null
+++ b/include/glib/gio/gtcpconnection.h
@@ -0,0 +1,69 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2008, 2009 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_TCP_CONNECTION_H__
+#define __G_TCP_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gsocketconnection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TCP_CONNECTION (g_tcp_connection_get_type ())
+#define G_TCP_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_TCP_CONNECTION, GTcpConnection))
+#define G_TCP_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_TCP_CONNECTION, GTcpConnectionClass))
+#define G_IS_TCP_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_TCP_CONNECTION))
+#define G_IS_TCP_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_TCP_CONNECTION))
+#define G_TCP_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_TCP_CONNECTION, GTcpConnectionClass))
+
+typedef struct _GTcpConnectionPrivate GTcpConnectionPrivate;
+typedef struct _GTcpConnectionClass GTcpConnectionClass;
+
+struct _GTcpConnectionClass
+{
+ GSocketConnectionClass parent_class;
+};
+
+struct _GTcpConnection
+{
+ GSocketConnection parent_instance;
+ GTcpConnectionPrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tcp_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+void g_tcp_connection_set_graceful_disconnect (GTcpConnection *connection,
+ gboolean graceful_disconnect);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tcp_connection_get_graceful_disconnect (GTcpConnection *connection);
+
+G_END_DECLS
+
+#endif /* __G_TCP_CONNECTION_H__ */
diff --git a/include/glib/gio/gtcpwrapperconnection.h b/include/glib/gio/gtcpwrapperconnection.h
new file mode 100644
index 0000000000..a32acad79f
--- /dev/null
+++ b/include/glib/gio/gtcpwrapperconnection.h
@@ -0,0 +1,69 @@
+/* GIO - GLib Input, Output and Streaming Library
+ * Copyright © 2010 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
+ *
+ */
+
+#ifndef __G_TCP_WRAPPER_CONNECTION_H__
+#define __G_TCP_WRAPPER_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gtcpconnection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TCP_WRAPPER_CONNECTION (g_tcp_wrapper_connection_get_type ())
+#define G_TCP_WRAPPER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_TCP_WRAPPER_CONNECTION, GTcpWrapperConnection))
+#define G_TCP_WRAPPER_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_TCP_WRAPPER_CONNECTION, GTcpWrapperConnectionClass))
+#define G_IS_TCP_WRAPPER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_TCP_WRAPPER_CONNECTION))
+#define G_IS_TCP_WRAPPER_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_TCP_WRAPPER_CONNECTION))
+#define G_TCP_WRAPPER_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_TCP_WRAPPER_CONNECTION, GTcpWrapperConnectionClass))
+
+typedef struct _GTcpWrapperConnectionPrivate GTcpWrapperConnectionPrivate;
+typedef struct _GTcpWrapperConnectionClass GTcpWrapperConnectionClass;
+
+struct _GTcpWrapperConnectionClass
+{
+ GTcpConnectionClass parent_class;
+};
+
+struct _GTcpWrapperConnection
+{
+ GTcpConnection parent_instance;
+ GTcpWrapperConnectionPrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tcp_wrapper_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GSocketConnection *g_tcp_wrapper_connection_new (GIOStream *base_io_stream,
+ GSocket *socket);
+GLIB_AVAILABLE_IN_ALL
+GIOStream *g_tcp_wrapper_connection_get_base_io_stream (GTcpWrapperConnection *conn);
+
+G_END_DECLS
+
+#endif /* __G_TCP_WRAPPER_CONNECTION_H__ */
diff --git a/include/glib/gio/gtestdbus.h b/include/glib/gio/gtestdbus.h
new file mode 100644
index 0000000000..9467f59aec
--- /dev/null
+++ b/include/glib/gio/gtestdbus.h
@@ -0,0 +1,72 @@
+/* GIO testing utilities
+ *
+ * Copyright (C) 2008-2010 Red Hat, Inc.
+ * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: David Zeuthen <davidz@redhat.com>
+ * Xavier Claessens <xavier.claessens@collabora.co.uk>
+ */
+
+#ifndef __G_TEST_DBUS_H__
+#define __G_TEST_DBUS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TEST_DBUS \
+ (g_test_dbus_get_type ())
+#define G_TEST_DBUS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_TEST_DBUS, \
+ GTestDBus))
+#define G_IS_TEST_DBUS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_TEST_DBUS))
+
+GLIB_AVAILABLE_IN_2_34
+GType g_test_dbus_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_2_34
+GTestDBus * g_test_dbus_new (GTestDBusFlags flags);
+
+GLIB_AVAILABLE_IN_2_34
+GTestDBusFlags g_test_dbus_get_flags (GTestDBus *self);
+
+GLIB_AVAILABLE_IN_2_34
+const gchar * g_test_dbus_get_bus_address (GTestDBus *self);
+
+GLIB_AVAILABLE_IN_2_34
+void g_test_dbus_add_service_dir (GTestDBus *self,
+ const gchar *path);
+
+GLIB_AVAILABLE_IN_2_34
+void g_test_dbus_up (GTestDBus *self);
+
+GLIB_AVAILABLE_IN_2_34
+void g_test_dbus_stop (GTestDBus *self);
+
+GLIB_AVAILABLE_IN_2_34
+void g_test_dbus_down (GTestDBus *self);
+
+GLIB_AVAILABLE_IN_2_34
+void g_test_dbus_unset (void);
+
+G_END_DECLS
+
+#endif /* __G_TEST_DBUS_H__ */
diff --git a/include/glib/gio/gthemedicon.h b/include/glib/gio/gthemedicon.h
new file mode 100644
index 0000000000..3a145b5c3a
--- /dev/null
+++ b/include/glib/gio/gthemedicon.h
@@ -0,0 +1,68 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_THEMED_ICON_H__
+#define __G_THEMED_ICON_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_THEMED_ICON (g_themed_icon_get_type ())
+#define G_THEMED_ICON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_THEMED_ICON, GThemedIcon))
+#define G_THEMED_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_THEMED_ICON, GThemedIconClass))
+#define G_IS_THEMED_ICON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_THEMED_ICON))
+#define G_IS_THEMED_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_THEMED_ICON))
+#define G_THEMED_ICON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_THEMED_ICON, GThemedIconClass))
+
+/**
+ * GThemedIcon:
+ *
+ * An implementation of #GIcon for themed icons.
+ **/
+typedef struct _GThemedIconClass GThemedIconClass;
+
+GLIB_AVAILABLE_IN_ALL
+GType g_themed_icon_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GIcon *g_themed_icon_new (const char *iconname);
+GLIB_AVAILABLE_IN_ALL
+GIcon *g_themed_icon_new_with_default_fallbacks (const char *iconname);
+GLIB_AVAILABLE_IN_ALL
+GIcon *g_themed_icon_new_from_names (char **iconnames,
+ int len);
+GLIB_AVAILABLE_IN_ALL
+void g_themed_icon_prepend_name (GThemedIcon *icon,
+ const char *iconname);
+GLIB_AVAILABLE_IN_ALL
+void g_themed_icon_append_name (GThemedIcon *icon,
+ const char *iconname);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar* const * g_themed_icon_get_names (GThemedIcon *icon);
+
+G_END_DECLS
+
+#endif /* __G_THEMED_ICON_H__ */
diff --git a/include/glib/gio/gthreadedsocketservice.h b/include/glib/gio/gthreadedsocketservice.h
new file mode 100644
index 0000000000..fa3204f953
--- /dev/null
+++ b/include/glib/gio/gthreadedsocketservice.h
@@ -0,0 +1,81 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2009 Codethink Limited
+ * Copyright © 2009 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ryan Lortie <desrt@desrt.ca>
+ * Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_THREADED_SOCKET_SERVICE_H__
+#define __G_THREADED_SOCKET_SERVICE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gsocketservice.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_THREADED_SOCKET_SERVICE (g_threaded_socket_service_get_type ())
+#define G_THREADED_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
+ G_TYPE_THREADED_SOCKET_SERVICE, \
+ GThreadedSocketService))
+#define G_THREADED_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
+ G_TYPE_THREADED_SOCKET_SERVICE, \
+ GThreadedSocketServiceClass))
+#define G_IS_THREADED_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
+ G_TYPE_THREADED_SOCKET_SERVICE))
+#define G_IS_THREADED_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
+ G_TYPE_THREADED_SOCKET_SERVICE))
+#define G_THREADED_SOCKET_SERVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
+ G_TYPE_THREADED_SOCKET_SERVICE, \
+ GThreadedSocketServiceClass))
+
+typedef struct _GThreadedSocketServicePrivate GThreadedSocketServicePrivate;
+typedef struct _GThreadedSocketServiceClass GThreadedSocketServiceClass;
+
+struct _GThreadedSocketServiceClass
+{
+ GSocketServiceClass parent_class;
+
+ gboolean (* run) (GThreadedSocketService *service,
+ GSocketConnection *connection,
+ GObject *source_object);
+
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+};
+
+struct _GThreadedSocketService
+{
+ GSocketService parent_instance;
+ GThreadedSocketServicePrivate *priv;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_threaded_socket_service_get_type (void);
+GLIB_AVAILABLE_IN_ALL
+GSocketService * g_threaded_socket_service_new (int max_threads);
+
+G_END_DECLS
+
+#endif /* __G_THREADED_SOCKET_SERVICE_H__ */
diff --git a/include/glib/gio/gtlsbackend.h b/include/glib/gio/gtlsbackend.h
new file mode 100644
index 0000000000..f19ab7e3c9
--- /dev/null
+++ b/include/glib/gio/gtlsbackend.h
@@ -0,0 +1,113 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright © 2015 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_TLS_BACKEND_H__
+#define __G_TLS_BACKEND_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_TLS_BACKEND_EXTENSION_POINT_NAME:
+ *
+ * Extension point for TLS functionality via #GTlsBackend.
+ * See [Extending GIO][extending-gio].
+ */
+#define G_TLS_BACKEND_EXTENSION_POINT_NAME "gio-tls-backend"
+
+#define G_TYPE_TLS_BACKEND (g_tls_backend_get_type ())
+#define G_TLS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_TLS_BACKEND, GTlsBackend))
+#define G_IS_TLS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_TLS_BACKEND))
+#define G_TLS_BACKEND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_TLS_BACKEND, GTlsBackendInterface))
+
+typedef struct _GTlsBackend GTlsBackend;
+typedef struct _GTlsBackendInterface GTlsBackendInterface;
+
+/**
+ * GTlsBackendInterface:
+ * @g_iface: The parent interface.
+ * @supports_tls: returns whether the backend supports TLS.
+ * @supports_dtls: returns whether the backend supports DTLS
+ * @get_default_database: returns a default #GTlsDatabase instance.
+ * @get_certificate_type: returns the #GTlsCertificate implementation type
+ * @get_client_connection_type: returns the #GTlsClientConnection implementation type
+ * @get_server_connection_type: returns the #GTlsServerConnection implementation type
+ * @get_file_database_type: returns the #GTlsFileDatabase implementation type.
+ * @get_dtls_client_connection_type: returns the #GDtlsClientConnection implementation type
+ * @get_dtls_server_connection_type: returns the #GDtlsServerConnection implementation type
+ *
+ * Provides an interface for describing TLS-related types.
+ *
+ * Since: 2.28
+ */
+struct _GTlsBackendInterface
+{
+ GTypeInterface g_iface;
+
+ /* methods */
+ gboolean ( *supports_tls) (GTlsBackend *backend);
+ GType ( *get_certificate_type) (void);
+ GType ( *get_client_connection_type) (void);
+ GType ( *get_server_connection_type) (void);
+ GType ( *get_file_database_type) (void);
+ GTlsDatabase * ( *get_default_database) (GTlsBackend *backend);
+ gboolean ( *supports_dtls) (GTlsBackend *backend);
+ GType ( *get_dtls_client_connection_type) (void);
+ GType ( *get_dtls_server_connection_type) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_backend_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GTlsBackend * g_tls_backend_get_default (void);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsDatabase * g_tls_backend_get_default_database (GTlsBackend *backend);
+GLIB_AVAILABLE_IN_2_60
+void g_tls_backend_set_default_database (GTlsBackend *backend,
+ GTlsDatabase *database);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tls_backend_supports_tls (GTlsBackend *backend);
+GLIB_AVAILABLE_IN_2_48
+gboolean g_tls_backend_supports_dtls (GTlsBackend *backend);
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_backend_get_certificate_type (GTlsBackend *backend);
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_backend_get_client_connection_type (GTlsBackend *backend);
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_backend_get_server_connection_type (GTlsBackend *backend);
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_backend_get_file_database_type (GTlsBackend *backend);
+
+GLIB_AVAILABLE_IN_2_48
+GType g_tls_backend_get_dtls_client_connection_type (GTlsBackend *backend);
+GLIB_AVAILABLE_IN_2_48
+GType g_tls_backend_get_dtls_server_connection_type (GTlsBackend *backend);
+
+G_END_DECLS
+
+#endif /* __G_TLS_BACKEND_H__ */
diff --git a/include/glib/gio/gtlscertificate.h b/include/glib/gio/gtlscertificate.h
new file mode 100644
index 0000000000..a064543c44
--- /dev/null
+++ b/include/glib/gio/gtlscertificate.h
@@ -0,0 +1,92 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_TLS_CERTIFICATE_H__
+#define __G_TLS_CERTIFICATE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_CERTIFICATE (g_tls_certificate_get_type ())
+#define G_TLS_CERTIFICATE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CERTIFICATE, GTlsCertificate))
+#define G_TLS_CERTIFICATE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_CERTIFICATE, GTlsCertificateClass))
+#define G_IS_TLS_CERTIFICATE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CERTIFICATE))
+#define G_IS_TLS_CERTIFICATE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_CERTIFICATE))
+#define G_TLS_CERTIFICATE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_CERTIFICATE, GTlsCertificateClass))
+
+typedef struct _GTlsCertificateClass GTlsCertificateClass;
+typedef struct _GTlsCertificatePrivate GTlsCertificatePrivate;
+
+struct _GTlsCertificate {
+ GObject parent_instance;
+
+ GTlsCertificatePrivate *priv;
+};
+
+struct _GTlsCertificateClass
+{
+ GObjectClass parent_class;
+
+ GTlsCertificateFlags (* verify) (GTlsCertificate *cert,
+ GSocketConnectable *identity,
+ GTlsCertificate *trusted_ca);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_certificate_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate *g_tls_certificate_new_from_pem (const gchar *data,
+ gssize length,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate *g_tls_certificate_new_from_file (const gchar *file,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate *g_tls_certificate_new_from_files (const gchar *cert_file,
+ const gchar *key_file,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GList *g_tls_certificate_list_new_from_file (const gchar *file,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate *g_tls_certificate_get_issuer (GTlsCertificate *cert);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificateFlags g_tls_certificate_verify (GTlsCertificate *cert,
+ GSocketConnectable *identity,
+ GTlsCertificate *trusted_ca);
+
+GLIB_AVAILABLE_IN_2_34
+gboolean g_tls_certificate_is_same (GTlsCertificate *cert_one,
+ GTlsCertificate *cert_two);
+
+G_END_DECLS
+
+#endif /* __G_TLS_CERTIFICATE_H__ */
diff --git a/include/glib/gio/gtlsclientconnection.h b/include/glib/gio/gtlsclientconnection.h
new file mode 100644
index 0000000000..29dbafcf4a
--- /dev/null
+++ b/include/glib/gio/gtlsclientconnection.h
@@ -0,0 +1,86 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_TLS_CLIENT_CONNECTION_H__
+#define __G_TLS_CLIENT_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gtlsconnection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_CLIENT_CONNECTION (g_tls_client_connection_get_type ())
+#define G_TLS_CLIENT_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CLIENT_CONNECTION, GTlsClientConnection))
+#define G_IS_TLS_CLIENT_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CLIENT_CONNECTION))
+#define G_TLS_CLIENT_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TLS_CLIENT_CONNECTION, GTlsClientConnectionInterface))
+
+typedef struct _GTlsClientConnectionInterface GTlsClientConnectionInterface;
+
+/**
+ * GTlsClientConnectionInterface:
+ * @g_iface: The parent interface.
+ * @copy_session_state: Copies session state from one #GTlsClientConnection to another.
+ *
+ * vtable for a #GTlsClientConnection implementation.
+ *
+ * Since: 2.26
+ */
+struct _GTlsClientConnectionInterface
+{
+ GTypeInterface g_iface;
+
+ void ( *copy_session_state ) (GTlsClientConnection *conn,
+ GTlsClientConnection *source);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_client_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GIOStream * g_tls_client_connection_new (GIOStream *base_io_stream,
+ GSocketConnectable *server_identity,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificateFlags g_tls_client_connection_get_validation_flags (GTlsClientConnection *conn);
+GLIB_AVAILABLE_IN_ALL
+void g_tls_client_connection_set_validation_flags (GTlsClientConnection *conn,
+ GTlsCertificateFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GSocketConnectable *g_tls_client_connection_get_server_identity (GTlsClientConnection *conn);
+GLIB_AVAILABLE_IN_ALL
+void g_tls_client_connection_set_server_identity (GTlsClientConnection *conn,
+ GSocketConnectable *identity);
+GLIB_DEPRECATED_IN_2_56
+gboolean g_tls_client_connection_get_use_ssl3 (GTlsClientConnection *conn);
+GLIB_DEPRECATED_IN_2_56
+void g_tls_client_connection_set_use_ssl3 (GTlsClientConnection *conn,
+ gboolean use_ssl3);
+GLIB_AVAILABLE_IN_ALL
+GList * g_tls_client_connection_get_accepted_cas (GTlsClientConnection *conn);
+
+GLIB_AVAILABLE_IN_2_46
+void g_tls_client_connection_copy_session_state (GTlsClientConnection *conn,
+ GTlsClientConnection *source);
+
+G_END_DECLS
+
+#endif /* __G_TLS_CLIENT_CONNECTION_H__ */
diff --git a/include/glib/gio/gtlsconnection.h b/include/glib/gio/gtlsconnection.h
new file mode 100644
index 0000000000..be38dcf5c9
--- /dev/null
+++ b/include/glib/gio/gtlsconnection.h
@@ -0,0 +1,163 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_TLS_CONNECTION_H__
+#define __G_TLS_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giostream.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_CONNECTION (g_tls_connection_get_type ())
+#define G_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CONNECTION, GTlsConnection))
+#define G_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_CONNECTION, GTlsConnectionClass))
+#define G_IS_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CONNECTION))
+#define G_IS_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_CONNECTION))
+#define G_TLS_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_CONNECTION, GTlsConnectionClass))
+
+typedef struct _GTlsConnectionClass GTlsConnectionClass;
+typedef struct _GTlsConnectionPrivate GTlsConnectionPrivate;
+
+struct _GTlsConnection {
+ GIOStream parent_instance;
+
+ GTlsConnectionPrivate *priv;
+};
+
+struct _GTlsConnectionClass
+{
+ GIOStreamClass parent_class;
+
+ /* signals */
+ gboolean ( *accept_certificate) (GTlsConnection *connection,
+ GTlsCertificate *peer_cert,
+ GTlsCertificateFlags errors);
+
+ /* methods */
+ gboolean ( *handshake ) (GTlsConnection *conn,
+ GCancellable *cancellable,
+ GError **error);
+
+ void ( *handshake_async ) (GTlsConnection *conn,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean ( *handshake_finish ) (GTlsConnection *conn,
+ GAsyncResult *result,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_DEPRECATED
+void g_tls_connection_set_use_system_certdb (GTlsConnection *conn,
+ gboolean use_system_certdb);
+GLIB_DEPRECATED
+gboolean g_tls_connection_get_use_system_certdb (GTlsConnection *conn);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_connection_set_database (GTlsConnection *conn,
+ GTlsDatabase *database);
+GLIB_AVAILABLE_IN_ALL
+GTlsDatabase * g_tls_connection_get_database (GTlsConnection *conn);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_connection_set_certificate (GTlsConnection *conn,
+ GTlsCertificate *certificate);
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate *g_tls_connection_get_certificate (GTlsConnection *conn);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_connection_set_interaction (GTlsConnection *conn,
+ GTlsInteraction *interaction);
+GLIB_AVAILABLE_IN_ALL
+GTlsInteraction * g_tls_connection_get_interaction (GTlsConnection *conn);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate *g_tls_connection_get_peer_certificate (GTlsConnection *conn);
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificateFlags g_tls_connection_get_peer_certificate_errors (GTlsConnection *conn);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_connection_set_require_close_notify (GTlsConnection *conn,
+ gboolean require_close_notify);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tls_connection_get_require_close_notify (GTlsConnection *conn);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_60
+void g_tls_connection_set_rehandshake_mode (GTlsConnection *conn,
+ GTlsRehandshakeMode mode);
+GLIB_DEPRECATED_IN_2_60
+GTlsRehandshakeMode g_tls_connection_get_rehandshake_mode (GTlsConnection *conn);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_2_60
+void g_tls_connection_set_advertised_protocols (GTlsConnection *conn,
+ const gchar * const *protocols);
+
+GLIB_AVAILABLE_IN_2_60
+const gchar * g_tls_connection_get_negotiated_protocol (GTlsConnection *conn);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tls_connection_handshake (GTlsConnection *conn,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_connection_handshake_async (GTlsConnection *conn,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tls_connection_handshake_finish (GTlsConnection *conn,
+ GAsyncResult *result,
+ GError **error);
+
+/**
+ * G_TLS_ERROR:
+ *
+ * Error domain for TLS. Errors in this domain will be from the
+ * #GTlsError enumeration. See #GError for more information on error
+ * domains.
+ */
+#define G_TLS_ERROR (g_tls_error_quark ())
+GLIB_AVAILABLE_IN_ALL
+GQuark g_tls_error_quark (void);
+
+
+/*< protected >*/
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tls_connection_emit_accept_certificate (GTlsConnection *conn,
+ GTlsCertificate *peer_cert,
+ GTlsCertificateFlags errors);
+
+G_END_DECLS
+
+#endif /* __G_TLS_CONNECTION_H__ */
diff --git a/include/glib/gio/gtlsdatabase.h b/include/glib/gio/gtlsdatabase.h
new file mode 100644
index 0000000000..5dafd7bc00
--- /dev/null
+++ b/include/glib/gio/gtlsdatabase.h
@@ -0,0 +1,247 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Stef Walter <stefw@collabora.co.uk>
+ */
+
+#ifndef __G_TLS_DATABASE_H__
+#define __G_TLS_DATABASE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER "1.3.6.1.5.5.7.3.1"
+#define G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT "1.3.6.1.5.5.7.3.2"
+
+#define G_TYPE_TLS_DATABASE (g_tls_database_get_type ())
+#define G_TLS_DATABASE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_DATABASE, GTlsDatabase))
+#define G_TLS_DATABASE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_DATABASE, GTlsDatabaseClass))
+#define G_IS_TLS_DATABASE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_DATABASE))
+#define G_IS_TLS_DATABASE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_DATABASE))
+#define G_TLS_DATABASE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_DATABASE, GTlsDatabaseClass))
+
+typedef struct _GTlsDatabaseClass GTlsDatabaseClass;
+typedef struct _GTlsDatabasePrivate GTlsDatabasePrivate;
+
+struct _GTlsDatabase
+{
+ GObject parent_instance;
+
+ GTlsDatabasePrivate *priv;
+};
+
+struct _GTlsDatabaseClass
+{
+ GObjectClass parent_class;
+
+ /* virtual methods */
+
+ GTlsCertificateFlags (*verify_chain) (GTlsDatabase *self,
+ GTlsCertificate *chain,
+ const gchar *purpose,
+ GSocketConnectable *identity,
+ GTlsInteraction *interaction,
+ GTlsDatabaseVerifyFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (*verify_chain_async) (GTlsDatabase *self,
+ GTlsCertificate *chain,
+ const gchar *purpose,
+ GSocketConnectable *identity,
+ GTlsInteraction *interaction,
+ GTlsDatabaseVerifyFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GTlsCertificateFlags (*verify_chain_finish) (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+ gchar* (*create_certificate_handle) (GTlsDatabase *self,
+ GTlsCertificate *certificate);
+
+ GTlsCertificate* (*lookup_certificate_for_handle) (GTlsDatabase *self,
+ const gchar *handle,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (*lookup_certificate_for_handle_async) (GTlsDatabase *self,
+ const gchar *handle,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GTlsCertificate* (*lookup_certificate_for_handle_finish) (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+ GTlsCertificate* (*lookup_certificate_issuer) (GTlsDatabase *self,
+ GTlsCertificate *certificate,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (*lookup_certificate_issuer_async) (GTlsDatabase *self,
+ GTlsCertificate *certificate,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GTlsCertificate* (*lookup_certificate_issuer_finish) (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+ GList* (*lookup_certificates_issued_by) (GTlsDatabase *self,
+ GByteArray *issuer_raw_dn,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (*lookup_certificates_issued_by_async) (GTlsDatabase *self,
+ GByteArray *issuer_raw_dn,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GList* (*lookup_certificates_issued_by_finish) (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ gpointer padding[16];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_database_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificateFlags g_tls_database_verify_chain (GTlsDatabase *self,
+ GTlsCertificate *chain,
+ const gchar *purpose,
+ GSocketConnectable *identity,
+ GTlsInteraction *interaction,
+ GTlsDatabaseVerifyFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_database_verify_chain_async (GTlsDatabase *self,
+ GTlsCertificate *chain,
+ const gchar *purpose,
+ GSocketConnectable *identity,
+ GTlsInteraction *interaction,
+ GTlsDatabaseVerifyFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificateFlags g_tls_database_verify_chain_finish (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gchar* g_tls_database_create_certificate_handle (GTlsDatabase *self,
+ GTlsCertificate *certificate);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate* g_tls_database_lookup_certificate_for_handle (GTlsDatabase *self,
+ const gchar *handle,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_database_lookup_certificate_for_handle_async (GTlsDatabase *self,
+ const gchar *handle,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate* g_tls_database_lookup_certificate_for_handle_finish (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate* g_tls_database_lookup_certificate_issuer (GTlsDatabase *self,
+ GTlsCertificate *certificate,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_database_lookup_certificate_issuer_async (GTlsDatabase *self,
+ GTlsCertificate *certificate,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsCertificate* g_tls_database_lookup_certificate_issuer_finish (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GList* g_tls_database_lookup_certificates_issued_by (GTlsDatabase *self,
+ GByteArray *issuer_raw_dn,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_database_lookup_certificates_issued_by_async (GTlsDatabase *self,
+ GByteArray *issuer_raw_dn,
+ GTlsInteraction *interaction,
+ GTlsDatabaseLookupFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GList* g_tls_database_lookup_certificates_issued_by_finish (GTlsDatabase *self,
+ GAsyncResult *result,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_TLS_DATABASE_H__ */
diff --git a/include/glib/gio/gtlsfiledatabase.h b/include/glib/gio/gtlsfiledatabase.h
new file mode 100644
index 0000000000..1ee4631be9
--- /dev/null
+++ b/include/glib/gio/gtlsfiledatabase.h
@@ -0,0 +1,58 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright © 2010 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * See the included COPYING file for more information.
+ *
+ * Author: Stef Walter <stefw@collabora.co.uk>
+ */
+
+#ifndef __G_TLS_FILE_DATABASE_H__
+#define __G_TLS_FILE_DATABASE_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_FILE_DATABASE (g_tls_file_database_get_type ())
+#define G_TLS_FILE_DATABASE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_FILE_DATABASE, GTlsFileDatabase))
+#define G_IS_TLS_FILE_DATABASE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_FILE_DATABASE))
+#define G_TLS_FILE_DATABASE_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TLS_FILE_DATABASE, GTlsFileDatabaseInterface))
+
+typedef struct _GTlsFileDatabaseInterface GTlsFileDatabaseInterface;
+
+/**
+ * GTlsFileDatabaseInterface:
+ * @g_iface: The parent interface.
+ *
+ * Provides an interface for #GTlsFileDatabase implementations.
+ *
+ */
+struct _GTlsFileDatabaseInterface
+{
+ GTypeInterface g_iface;
+
+ /*< private >*/
+ /* Padding for future expansion */
+ gpointer padding[8];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_file_database_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GTlsDatabase* g_tls_file_database_new (const gchar *anchors,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_TLS_FILE_DATABASE_H___ */
diff --git a/include/glib/gio/gtlsinteraction.h b/include/glib/gio/gtlsinteraction.h
new file mode 100644
index 0000000000..03552fb14a
--- /dev/null
+++ b/include/glib/gio/gtlsinteraction.h
@@ -0,0 +1,148 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2011 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Stef Walter <stefw@collabora.co.uk>
+ */
+
+#ifndef __G_TLS_INTERACTION_H__
+#define __G_TLS_INTERACTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_INTERACTION (g_tls_interaction_get_type ())
+#define G_TLS_INTERACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TLS_INTERACTION, GTlsInteraction))
+#define G_TLS_INTERACTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_TLS_INTERACTION, GTlsInteractionClass))
+#define G_IS_TLS_INTERACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TLS_INTERACTION))
+#define G_IS_TLS_INTERACTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_TLS_INTERACTION))
+#define G_TLS_INTERACTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_TLS_INTERACTION, GTlsInteractionClass))
+
+typedef struct _GTlsInteractionClass GTlsInteractionClass;
+typedef struct _GTlsInteractionPrivate GTlsInteractionPrivate;
+
+struct _GTlsInteraction
+{
+ /*< private >*/
+ GObject parent_instance;
+ GTlsInteractionPrivate *priv;
+};
+
+struct _GTlsInteractionClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+
+ /*< public >*/
+ GTlsInteractionResult (* ask_password) (GTlsInteraction *interaction,
+ GTlsPassword *password,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (* ask_password_async) (GTlsInteraction *interaction,
+ GTlsPassword *password,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GTlsInteractionResult (* ask_password_finish) (GTlsInteraction *interaction,
+ GAsyncResult *result,
+ GError **error);
+
+ GTlsInteractionResult (* request_certificate) (GTlsInteraction *interaction,
+ GTlsConnection *connection,
+ GTlsCertificateRequestFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+ void (* request_certificate_async) (GTlsInteraction *interaction,
+ GTlsConnection *connection,
+ GTlsCertificateRequestFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GTlsInteractionResult (* request_certificate_finish) (GTlsInteraction *interaction,
+ GAsyncResult *result,
+ GError **error);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ gpointer padding[21];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_interaction_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GTlsInteractionResult g_tls_interaction_invoke_ask_password (GTlsInteraction *interaction,
+ GTlsPassword *password,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsInteractionResult g_tls_interaction_ask_password (GTlsInteraction *interaction,
+ GTlsPassword *password,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_tls_interaction_ask_password_async (GTlsInteraction *interaction,
+ GTlsPassword *password,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsInteractionResult g_tls_interaction_ask_password_finish (GTlsInteraction *interaction,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+GTlsInteractionResult g_tls_interaction_invoke_request_certificate (GTlsInteraction *interaction,
+ GTlsConnection *connection,
+ GTlsCertificateRequestFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+GTlsInteractionResult g_tls_interaction_request_certificate (GTlsInteraction *interaction,
+ GTlsConnection *connection,
+ GTlsCertificateRequestFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_40
+void g_tls_interaction_request_certificate_async (GTlsInteraction *interaction,
+ GTlsConnection *connection,
+ GTlsCertificateRequestFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_40
+GTlsInteractionResult g_tls_interaction_request_certificate_finish (GTlsInteraction *interaction,
+ GAsyncResult *result,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_TLS_INTERACTION_H__ */
diff --git a/include/glib/gio/gtlspassword.h b/include/glib/gio/gtlspassword.h
new file mode 100644
index 0000000000..befe706a84
--- /dev/null
+++ b/include/glib/gio/gtlspassword.h
@@ -0,0 +1,119 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2011 Collabora, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Stef Walter <stefw@collabora.co.uk>
+ */
+
+#ifndef __G_TLS_PASSWORD_H__
+#define __G_TLS_PASSWORD_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_PASSWORD (g_tls_password_get_type ())
+#define G_TLS_PASSWORD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TLS_PASSWORD, GTlsPassword))
+#define G_TLS_PASSWORD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_TLS_PASSWORD, GTlsPasswordClass))
+#define G_IS_TLS_PASSWORD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TLS_PASSWORD))
+#define G_IS_TLS_PASSWORD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_TLS_PASSWORD))
+#define G_TLS_PASSWORD_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_TLS_PASSWORD, GTlsPasswordClass))
+
+typedef struct _GTlsPasswordClass GTlsPasswordClass;
+typedef struct _GTlsPasswordPrivate GTlsPasswordPrivate;
+
+struct _GTlsPassword
+{
+ GObject parent_instance;
+
+ GTlsPasswordPrivate *priv;
+};
+
+/**
+ * GTlsPasswordClass:
+ * @get_value: virtual method for g_tls_password_get_value()
+ * @set_value: virtual method for g_tls_password_set_value()
+ * @get_default_warning: virtual method for g_tls_password_get_warning() if no
+ * value has been set using g_tls_password_set_warning()
+ *
+ * Class structure for #GTlsPassword.
+ */
+struct _GTlsPasswordClass
+{
+ GObjectClass parent_class;
+
+ /* methods */
+
+ const guchar * ( *get_value) (GTlsPassword *password,
+ gsize *length);
+
+ void ( *set_value) (GTlsPassword *password,
+ guchar *value,
+ gssize length,
+ GDestroyNotify destroy);
+
+ const gchar* ( *get_default_warning) (GTlsPassword *password);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ gpointer padding[4];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_password_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GTlsPassword * g_tls_password_new (GTlsPasswordFlags flags,
+ const gchar *description);
+
+GLIB_AVAILABLE_IN_ALL
+const guchar * g_tls_password_get_value (GTlsPassword *password,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+void g_tls_password_set_value (GTlsPassword *password,
+ const guchar *value,
+ gssize length);
+GLIB_AVAILABLE_IN_ALL
+void g_tls_password_set_value_full (GTlsPassword *password,
+ guchar *value,
+ gssize length,
+ GDestroyNotify destroy);
+
+GLIB_AVAILABLE_IN_ALL
+GTlsPasswordFlags g_tls_password_get_flags (GTlsPassword *password);
+GLIB_AVAILABLE_IN_ALL
+void g_tls_password_set_flags (GTlsPassword *password,
+ GTlsPasswordFlags flags);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar* g_tls_password_get_description (GTlsPassword *password);
+GLIB_AVAILABLE_IN_ALL
+void g_tls_password_set_description (GTlsPassword *password,
+ const gchar *description);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_tls_password_get_warning (GTlsPassword *password);
+GLIB_AVAILABLE_IN_ALL
+void g_tls_password_set_warning (GTlsPassword *password,
+ const gchar *warning);
+
+G_END_DECLS
+
+#endif /* __G_TLS_PASSWORD_H__ */
diff --git a/include/glib/gio/gtlsserverconnection.h b/include/glib/gio/gtlsserverconnection.h
new file mode 100644
index 0000000000..6926e7d122
--- /dev/null
+++ b/include/glib/gio/gtlsserverconnection.h
@@ -0,0 +1,69 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_TLS_SERVER_CONNECTION_H__
+#define __G_TLS_SERVER_CONNECTION_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gtlsconnection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_SERVER_CONNECTION (g_tls_server_connection_get_type ())
+#define G_TLS_SERVER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_SERVER_CONNECTION, GTlsServerConnection))
+#define G_IS_TLS_SERVER_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_SERVER_CONNECTION))
+#define G_TLS_SERVER_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TLS_SERVER_CONNECTION, GTlsServerConnectionInterface))
+
+/**
+ * GTlsServerConnection:
+ *
+ * TLS server-side connection. This is the server-side implementation
+ * of a #GTlsConnection.
+ *
+ * Since: 2.28
+ */
+typedef struct _GTlsServerConnectionInterface GTlsServerConnectionInterface;
+
+/**
+ * GTlsServerConnectionInterface:
+ * @g_iface: The parent interface.
+ *
+ * vtable for a #GTlsServerConnection implementation.
+ *
+ * Since: 2.26
+ */
+struct _GTlsServerConnectionInterface
+{
+ GTypeInterface g_iface;
+
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_tls_server_connection_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GIOStream * g_tls_server_connection_new (GIOStream *base_io_stream,
+ GTlsCertificate *certificate,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_TLS_SERVER_CONNECTION_H__ */
diff --git a/include/glib/gio/gvfs.h b/include/glib/gio/gvfs.h
new file mode 100644
index 0000000000..72fe2dd323
--- /dev/null
+++ b/include/glib/gio/gvfs.h
@@ -0,0 +1,168 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_VFS_H__
+#define __G_VFS_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_VFS (g_vfs_get_type ())
+#define G_VFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VFS, GVfs))
+#define G_VFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VFS, GVfsClass))
+#define G_VFS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VFS, GVfsClass))
+#define G_IS_VFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VFS))
+#define G_IS_VFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VFS))
+
+/**
+ * GVfsFileLookupFunc:
+ * @vfs: a #GVfs
+ * @identifier: the identifier to look up a #GFile for. This can either
+ * be an URI or a parse name as returned by g_file_get_parse_name()
+ * @user_data: user data passed to the function
+ *
+ * This function type is used by g_vfs_register_uri_scheme() to make it
+ * possible for a client to associate an URI scheme to a different #GFile
+ * implementation.
+ *
+ * The client should return a reference to the new file that has been
+ * created for @uri, or %NULL to continue with the default implementation.
+ *
+ * Returns: (transfer full): a #GFile for @identifier.
+ *
+ * Since: 2.50
+ */
+typedef GFile * (* GVfsFileLookupFunc) (GVfs *vfs,
+ const char *identifier,
+ gpointer user_data);
+
+/**
+ * G_VFS_EXTENSION_POINT_NAME:
+ *
+ * Extension point for #GVfs functionality.
+ * See [Extending GIO][extending-gio].
+ */
+#define G_VFS_EXTENSION_POINT_NAME "gio-vfs"
+
+/**
+ * GVfs:
+ *
+ * Virtual File System object.
+ **/
+typedef struct _GVfsClass GVfsClass;
+
+struct _GVfs
+{
+ GObject parent_instance;
+};
+
+struct _GVfsClass
+{
+ GObjectClass parent_class;
+
+ /* Virtual Table */
+
+ gboolean (* is_active) (GVfs *vfs);
+ GFile * (* get_file_for_path) (GVfs *vfs,
+ const char *path);
+ GFile * (* get_file_for_uri) (GVfs *vfs,
+ const char *uri);
+ const gchar * const * (* get_supported_uri_schemes) (GVfs *vfs);
+ GFile * (* parse_name) (GVfs *vfs,
+ const char *parse_name);
+
+ /*< private >*/
+ void (* local_file_add_info) (GVfs *vfs,
+ const char *filename,
+ guint64 device,
+ GFileAttributeMatcher *attribute_matcher,
+ GFileInfo *info,
+ GCancellable *cancellable,
+ gpointer *extra_data,
+ GDestroyNotify *free_extra_data);
+ void (* add_writable_namespaces) (GVfs *vfs,
+ GFileAttributeInfoList *list);
+ gboolean (* local_file_set_attributes) (GVfs *vfs,
+ const char *filename,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error);
+ void (* local_file_removed) (GVfs *vfs,
+ const char *filename);
+ void (* local_file_moved) (GVfs *vfs,
+ const char *source,
+ const char *dest);
+ GIcon * (* deserialize_icon) (GVfs *vfs,
+ GVariant *value);
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_vfs_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_vfs_is_active (GVfs *vfs);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_vfs_get_file_for_path (GVfs *vfs,
+ const char *path);
+GLIB_AVAILABLE_IN_ALL
+GFile * g_vfs_get_file_for_uri (GVfs *vfs,
+ const char *uri);
+GLIB_AVAILABLE_IN_ALL
+const gchar* const * g_vfs_get_supported_uri_schemes (GVfs *vfs);
+
+GLIB_AVAILABLE_IN_ALL
+GFile * g_vfs_parse_name (GVfs *vfs,
+ const char *parse_name);
+
+GLIB_AVAILABLE_IN_ALL
+GVfs * g_vfs_get_default (void);
+GLIB_AVAILABLE_IN_ALL
+GVfs * g_vfs_get_local (void);
+
+GLIB_AVAILABLE_IN_2_50
+gboolean g_vfs_register_uri_scheme (GVfs *vfs,
+ const char *scheme,
+ GVfsFileLookupFunc uri_func,
+ gpointer uri_data,
+ GDestroyNotify uri_destroy,
+ GVfsFileLookupFunc parse_name_func,
+ gpointer parse_name_data,
+ GDestroyNotify parse_name_destroy);
+GLIB_AVAILABLE_IN_2_50
+gboolean g_vfs_unregister_uri_scheme (GVfs *vfs,
+ const char *scheme);
+
+
+G_END_DECLS
+
+#endif /* __G_VFS_H__ */
diff --git a/include/glib/gio/gvolume.h b/include/glib/gio/gvolume.h
new file mode 100644
index 0000000000..e153b7c38c
--- /dev/null
+++ b/include/glib/gio/gvolume.h
@@ -0,0 +1,253 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ * David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_VOLUME_H__
+#define __G_VOLUME_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_VOLUME_IDENTIFIER_KIND_HAL_UDI:
+ *
+ * The string used to obtain a Hal UDI with g_volume_get_identifier().
+ *
+ * Deprecated: 2.58: Do not use, HAL is deprecated.
+ */
+#define G_VOLUME_IDENTIFIER_KIND_HAL_UDI "hal-udi" GLIB_DEPRECATED_MACRO_IN_2_58
+
+/**
+ * G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE:
+ *
+ * The string used to obtain a Unix device path with g_volume_get_identifier().
+ */
+#define G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE "unix-device"
+
+/**
+ * G_VOLUME_IDENTIFIER_KIND_LABEL:
+ *
+ * The string used to obtain a filesystem label with g_volume_get_identifier().
+ */
+#define G_VOLUME_IDENTIFIER_KIND_LABEL "label"
+
+/**
+ * G_VOLUME_IDENTIFIER_KIND_UUID:
+ *
+ * The string used to obtain a UUID with g_volume_get_identifier().
+ */
+#define G_VOLUME_IDENTIFIER_KIND_UUID "uuid"
+
+/**
+ * G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT:
+ *
+ * The string used to obtain a NFS mount with g_volume_get_identifier().
+ */
+#define G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT "nfs-mount"
+
+/**
+ * G_VOLUME_IDENTIFIER_KIND_CLASS:
+ *
+ * The string used to obtain the volume class with g_volume_get_identifier().
+ *
+ * Known volume classes include `device`, `network`, and `loop`. Other
+ * classes may be added in the future.
+ *
+ * This is intended to be used by applications to classify #GVolume
+ * instances into different sections - for example a file manager or
+ * file chooser can use this information to show `network` volumes under
+ * a "Network" heading and `device` volumes under a "Devices" heading.
+ */
+#define G_VOLUME_IDENTIFIER_KIND_CLASS "class"
+
+
+#define G_TYPE_VOLUME (g_volume_get_type ())
+#define G_VOLUME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_VOLUME, GVolume))
+#define G_IS_VOLUME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_VOLUME))
+#define G_VOLUME_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_VOLUME, GVolumeIface))
+
+/**
+ * GVolumeIface:
+ * @g_iface: The parent interface.
+ * @changed: Changed signal that is emitted when the volume's state has changed.
+ * @removed: The removed signal that is emitted when the #GVolume have been removed. If the recipient is holding references to the object they should release them so the object can be finalized.
+ * @get_name: Gets a string containing the name of the #GVolume.
+ * @get_icon: Gets a #GIcon for the #GVolume.
+ * @get_uuid: Gets the UUID for the #GVolume. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns %NULL if there is no UUID available.
+ * @get_drive: Gets a #GDrive the volume is located on. Returns %NULL if the #GVolume is not associated with a #GDrive.
+ * @get_mount: Gets a #GMount representing the mounted volume. Returns %NULL if the #GVolume is not mounted.
+ * @can_mount: Returns %TRUE if the #GVolume can be mounted.
+ * @can_eject: Checks if a #GVolume can be ejected.
+ * @mount_fn: Mounts a given #GVolume.
+ * #GVolume implementations must emit the #GMountOperation::aborted
+ * signal before completing a mount operation that is aborted while
+ * awaiting input from the user through a #GMountOperation instance.
+ * @mount_finish: Finishes a mount operation.
+ * @eject: Ejects a given #GVolume.
+ * @eject_finish: Finishes an eject operation.
+ * @get_identifier: Returns the [identifier][volume-identifier] of the given kind, or %NULL if
+ * the #GVolume doesn't have one.
+ * @enumerate_identifiers: Returns an array strings listing the kinds
+ * of [identifiers][volume-identifier] which the #GVolume has.
+ * @should_automount: Returns %TRUE if the #GVolume should be automatically mounted.
+ * @get_activation_root: Returns the activation root for the #GVolume if it is known in advance or %NULL if
+ * it is not known.
+ * @eject_with_operation: Starts ejecting a #GVolume using a #GMountOperation. Since 2.22.
+ * @eject_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
+ * @get_sort_key: Gets a key used for sorting #GVolume instance or %NULL if no such key exists. Since 2.32.
+ * @get_symbolic_icon: Gets a symbolic #GIcon for the #GVolume. Since 2.34.
+ *
+ * Interface for implementing operations for mountable volumes.
+ **/
+typedef struct _GVolumeIface GVolumeIface;
+
+struct _GVolumeIface
+{
+ GTypeInterface g_iface;
+
+ /* signals */
+
+ void (* changed) (GVolume *volume);
+ void (* removed) (GVolume *volume);
+
+ /* Virtual Table */
+
+ char * (* get_name) (GVolume *volume);
+ GIcon * (* get_icon) (GVolume *volume);
+ char * (* get_uuid) (GVolume *volume);
+ GDrive * (* get_drive) (GVolume *volume);
+ GMount * (* get_mount) (GVolume *volume);
+ gboolean (* can_mount) (GVolume *volume);
+ gboolean (* can_eject) (GVolume *volume);
+ void (* mount_fn) (GVolume *volume,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* mount_finish) (GVolume *volume,
+ GAsyncResult *result,
+ GError **error);
+ void (* eject) (GVolume *volume,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_finish) (GVolume *volume,
+ GAsyncResult *result,
+ GError **error);
+
+ char * (* get_identifier) (GVolume *volume,
+ const char *kind);
+ char ** (* enumerate_identifiers) (GVolume *volume);
+
+ gboolean (* should_automount) (GVolume *volume);
+
+ GFile * (* get_activation_root) (GVolume *volume);
+
+ void (* eject_with_operation) (GVolume *volume,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (* eject_with_operation_finish) (GVolume *volume,
+ GAsyncResult *result,
+ GError **error);
+
+ const gchar * (* get_sort_key) (GVolume *volume);
+ GIcon * (* get_symbolic_icon) (GVolume *volume);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_volume_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+char * g_volume_get_name (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_volume_get_icon (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+GIcon * g_volume_get_symbolic_icon (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+char * g_volume_get_uuid (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+GDrive * g_volume_get_drive (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+GMount * g_volume_get_mount (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_volume_can_mount (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_volume_can_eject (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_volume_should_automount (GVolume *volume);
+GLIB_AVAILABLE_IN_ALL
+void g_volume_mount (GVolume *volume,
+ GMountMountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_volume_mount_finish (GVolume *volume,
+ GAsyncResult *result,
+ GError **error);
+GLIB_DEPRECATED_FOR(g_volume_eject_with_operation)
+void g_volume_eject (GVolume *volume,
+ GMountUnmountFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GLIB_DEPRECATED_FOR(g_volume_eject_with_operation_finish)
+gboolean g_volume_eject_finish (GVolume *volume,
+ GAsyncResult *result,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+char * g_volume_get_identifier (GVolume *volume,
+ const char *kind);
+GLIB_AVAILABLE_IN_ALL
+char ** g_volume_enumerate_identifiers (GVolume *volume);
+
+GLIB_AVAILABLE_IN_ALL
+GFile * g_volume_get_activation_root (GVolume *volume);
+
+GLIB_AVAILABLE_IN_ALL
+void g_volume_eject_with_operation (GVolume *volume,
+ GMountUnmountFlags flags,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_volume_eject_with_operation_finish (GVolume *volume,
+ GAsyncResult *result,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_32
+const gchar *g_volume_get_sort_key (GVolume *volume);
+
+G_END_DECLS
+
+#endif /* __G_VOLUME_H__ */
diff --git a/include/glib/gio/gvolumemonitor.h b/include/glib/gio/gvolumemonitor.h
new file mode 100644
index 0000000000..899942f6cb
--- /dev/null
+++ b/include/glib/gio/gvolumemonitor.h
@@ -0,0 +1,154 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ * David Zeuthen <davidz@redhat.com>
+ */
+
+#ifndef __G_VOLUME_MONITOR_H__
+#define __G_VOLUME_MONITOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_VOLUME_MONITOR (g_volume_monitor_get_type ())
+#define G_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor))
+#define G_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
+#define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
+#define G_IS_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR))
+#define G_IS_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR))
+
+/**
+ * G_VOLUME_MONITOR_EXTENSION_POINT_NAME:
+ *
+ * Extension point for volume monitor functionality.
+ * See [Extending GIO][extending-gio].
+ */
+#define G_VOLUME_MONITOR_EXTENSION_POINT_NAME "gio-volume-monitor"
+
+/**
+ * GVolumeMonitor:
+ *
+ * A Volume Monitor that watches for volume events.
+ **/
+typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
+
+struct _GVolumeMonitor
+{
+ GObject parent_instance;
+
+ /*< private >*/
+ gpointer priv;
+};
+
+struct _GVolumeMonitorClass
+{
+ GObjectClass parent_class;
+
+ /*< public >*/
+ /* signals */
+ void (* volume_added) (GVolumeMonitor *volume_monitor,
+ GVolume *volume);
+ void (* volume_removed) (GVolumeMonitor *volume_monitor,
+ GVolume *volume);
+ void (* volume_changed) (GVolumeMonitor *volume_monitor,
+ GVolume *volume);
+
+ void (* mount_added) (GVolumeMonitor *volume_monitor,
+ GMount *mount);
+ void (* mount_removed) (GVolumeMonitor *volume_monitor,
+ GMount *mount);
+ void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor,
+ GMount *mount);
+ void (* mount_changed) (GVolumeMonitor *volume_monitor,
+ GMount *mount);
+
+ void (* drive_connected) (GVolumeMonitor *volume_monitor,
+ GDrive *drive);
+ void (* drive_disconnected) (GVolumeMonitor *volume_monitor,
+ GDrive *drive);
+ void (* drive_changed) (GVolumeMonitor *volume_monitor,
+ GDrive *drive);
+
+ /* Vtable */
+
+ gboolean (* is_supported) (void);
+
+ GList * (* get_connected_drives) (GVolumeMonitor *volume_monitor);
+ GList * (* get_volumes) (GVolumeMonitor *volume_monitor);
+ GList * (* get_mounts) (GVolumeMonitor *volume_monitor);
+
+ GVolume * (* get_volume_for_uuid) (GVolumeMonitor *volume_monitor,
+ const char *uuid);
+
+ GMount * (* get_mount_for_uuid) (GVolumeMonitor *volume_monitor,
+ const char *uuid);
+
+
+ /* These arguments are unfortunately backwards by mistake (bug #520169). Deprecated in 2.20. */
+ GVolume * (* adopt_orphan_mount) (GMount *mount,
+ GVolumeMonitor *volume_monitor);
+
+ /* signal added in 2.17 */
+ void (* drive_eject_button) (GVolumeMonitor *volume_monitor,
+ GDrive *drive);
+
+ /* signal added in 2.21 */
+ void (* drive_stop_button) (GVolumeMonitor *volume_monitor,
+ GDrive *drive);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*_g_reserved1) (void);
+ void (*_g_reserved2) (void);
+ void (*_g_reserved3) (void);
+ void (*_g_reserved4) (void);
+ void (*_g_reserved5) (void);
+ void (*_g_reserved6) (void);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_volume_monitor_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GVolumeMonitor *g_volume_monitor_get (void);
+GLIB_AVAILABLE_IN_ALL
+GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
+GLIB_AVAILABLE_IN_ALL
+GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor);
+GLIB_AVAILABLE_IN_ALL
+GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor);
+GLIB_AVAILABLE_IN_ALL
+GVolume * g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
+ const char *uuid);
+GLIB_AVAILABLE_IN_ALL
+GMount * g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor,
+ const char *uuid);
+
+GLIB_DEPRECATED
+GVolume * g_volume_monitor_adopt_orphan_mount (GMount *mount);
+
+G_END_DECLS
+
+#endif /* __G_VOLUME_MONITOR_H__ */
diff --git a/include/glib/gio/gzlibcompressor.h b/include/glib/gio/gzlibcompressor.h
new file mode 100644
index 0000000000..f89b30f204
--- /dev/null
+++ b/include/glib/gio/gzlibcompressor.h
@@ -0,0 +1,62 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_ZLIB_COMPRESSOR_H__
+#define __G_ZLIB_COMPRESSOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gconverter.h>
+#include <gio/gfileinfo.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ZLIB_COMPRESSOR (g_zlib_compressor_get_type ())
+#define G_ZLIB_COMPRESSOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_ZLIB_COMPRESSOR, GZlibCompressor))
+#define G_ZLIB_COMPRESSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_ZLIB_COMPRESSOR, GZlibCompressorClass))
+#define G_IS_ZLIB_COMPRESSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_ZLIB_COMPRESSOR))
+#define G_IS_ZLIB_COMPRESSOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_ZLIB_COMPRESSOR))
+#define G_ZLIB_COMPRESSOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_ZLIB_COMPRESSOR, GZlibCompressorClass))
+
+typedef struct _GZlibCompressorClass GZlibCompressorClass;
+
+struct _GZlibCompressorClass
+{
+ GObjectClass parent_class;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_zlib_compressor_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GZlibCompressor *g_zlib_compressor_new (GZlibCompressorFormat format,
+ int level);
+
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_zlib_compressor_get_file_info (GZlibCompressor *compressor);
+GLIB_AVAILABLE_IN_ALL
+void g_zlib_compressor_set_file_info (GZlibCompressor *compressor,
+ GFileInfo *file_info);
+
+G_END_DECLS
+
+#endif /* __G_ZLIB_COMPRESSOR_H__ */
diff --git a/include/glib/gio/gzlibdecompressor.h b/include/glib/gio/gzlibdecompressor.h
new file mode 100644
index 0000000000..373ac67d18
--- /dev/null
+++ b/include/glib/gio/gzlibdecompressor.h
@@ -0,0 +1,58 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_ZLIB_DECOMPRESSOR_H__
+#define __G_ZLIB_DECOMPRESSOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/gconverter.h>
+#include <gio/gfileinfo.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ZLIB_DECOMPRESSOR (g_zlib_decompressor_get_type ())
+#define G_ZLIB_DECOMPRESSOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_ZLIB_DECOMPRESSOR, GZlibDecompressor))
+#define G_ZLIB_DECOMPRESSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_ZLIB_DECOMPRESSOR, GZlibDecompressorClass))
+#define G_IS_ZLIB_DECOMPRESSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_ZLIB_DECOMPRESSOR))
+#define G_IS_ZLIB_DECOMPRESSOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_ZLIB_DECOMPRESSOR))
+#define G_ZLIB_DECOMPRESSOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_ZLIB_DECOMPRESSOR, GZlibDecompressorClass))
+
+typedef struct _GZlibDecompressorClass GZlibDecompressorClass;
+
+struct _GZlibDecompressorClass
+{
+ GObjectClass parent_class;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GType g_zlib_decompressor_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GZlibDecompressor *g_zlib_decompressor_new (GZlibCompressorFormat format);
+
+GLIB_AVAILABLE_IN_ALL
+GFileInfo *g_zlib_decompressor_get_file_info (GZlibDecompressor *decompressor);
+
+G_END_DECLS
+
+#endif /* __G_ZLIB_DECOMPRESSOR_H__ */
diff --git a/include/glib/glib-object.h b/include/glib/glib-object.h
new file mode 100644
index 0000000000..9561a65289
--- /dev/null
+++ b/include/glib/glib-object.h
@@ -0,0 +1,43 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1998, 1999, 2000 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __GLIB_GOBJECT_H__
+#define __GLIB_GOBJECT_H__
+
+#define __GLIB_GOBJECT_H_INSIDE__
+
+/* topmost include file for GObject header files */
+#include <gobject/gbinding.h>
+#include <gobject/gboxed.h>
+#include <gobject/genums.h>
+#include <gobject/gobject.h>
+#include <gobject/gparam.h>
+#include <gobject/gparamspecs.h>
+#include <gobject/gsignal.h>
+#include <gobject/gsourceclosure.h>
+#include <gobject/gtype.h>
+#include <gobject/gtypemodule.h>
+#include <gobject/gtypeplugin.h>
+#include <gobject/gvalue.h>
+#include <gobject/gvaluearray.h>
+#include <gobject/gvaluetypes.h>
+#include <gobject/glib-enumtypes.h>
+
+#include <gobject/gobject-autocleanups.h>
+
+#undef __GLIB_GOBJECT_H_INSIDE__
+
+#endif /* __GLIB_GOBJECT_H__ */
diff --git a/include/glib/glib-unix.h b/include/glib/glib-unix.h
new file mode 100644
index 0000000000..ef8702d798
--- /dev/null
+++ b/include/glib/glib-unix.h
@@ -0,0 +1,119 @@
+/* glib-unix.h - Unix specific integration
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_UNIX_H__
+#define __G_UNIX_H__
+
+/* We need to include the UNIX headers needed to use the APIs below,
+ * but we also take this opportunity to include a wide selection of
+ * other UNIX headers. If one of the headers below is broken on some
+ * system, work around it here (or better, fix the system or tell
+ * people to use a better one).
+ */
+#include <unistd.h>
+#include <errno.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <fcntl.h>
+
+#include <glib.h>
+
+#ifndef G_OS_UNIX
+#error "This header may only be used on UNIX"
+#endif
+
+G_BEGIN_DECLS
+
+/**
+ * G_UNIX_ERROR:
+ *
+ * Error domain for API in the g_unix_ namespace. Note that there is no
+ * exported enumeration mapping %errno. Instead, all functions ensure that
+ * %errno is relevant. The code for all #G_UNIX_ERROR is always 0, and the
+ * error message is always generated via g_strerror().
+ *
+ * It is expected that most code will not look at %errno from these APIs.
+ * Important cases where one would want to differentiate between errors are
+ * already covered by existing cross-platform GLib API, such as e.g. #GFile
+ * wrapping `ENOENT`. However, it is provided for completeness, at least.
+ */
+#define G_UNIX_ERROR (g_unix_error_quark())
+
+GLIB_AVAILABLE_IN_2_30
+GQuark g_unix_error_quark (void);
+
+GLIB_AVAILABLE_IN_2_30
+gboolean g_unix_open_pipe (gint *fds,
+ gint flags,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_30
+gboolean g_unix_set_fd_nonblocking (gint fd,
+ gboolean nonblock,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_30
+GSource *g_unix_signal_source_new (gint signum);
+
+GLIB_AVAILABLE_IN_2_30
+guint g_unix_signal_add_full (gint priority,
+ gint signum,
+ GSourceFunc handler,
+ gpointer user_data,
+ GDestroyNotify notify);
+
+GLIB_AVAILABLE_IN_2_30
+guint g_unix_signal_add (gint signum,
+ GSourceFunc handler,
+ gpointer user_data);
+
+/**
+ * GUnixFDSourceFunc:
+ * @fd: the fd that triggered the event
+ * @condition: the IO conditions reported on @fd
+ * @user_data: user data passed to g_unix_fd_add()
+ *
+ * The type of functions to be called when a UNIX fd watch source
+ * triggers.
+ *
+ * Returns: %FALSE if the source should be removed
+ **/
+typedef gboolean (*GUnixFDSourceFunc) (gint fd,
+ GIOCondition condition,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_36
+GSource *g_unix_fd_source_new (gint fd,
+ GIOCondition condition);
+
+GLIB_AVAILABLE_IN_2_36
+guint g_unix_fd_add_full (gint priority,
+ gint fd,
+ GIOCondition condition,
+ GUnixFDSourceFunc function,
+ gpointer user_data,
+ GDestroyNotify notify);
+
+GLIB_AVAILABLE_IN_2_36
+guint g_unix_fd_add (gint fd,
+ GIOCondition condition,
+ GUnixFDSourceFunc function,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __G_UNIX_H__ */
diff --git a/include/glib/glib.h b/include/glib/glib.h
new file mode 100644
index 0000000000..5c21b6bf65
--- /dev/null
+++ b/include/glib/glib.h
@@ -0,0 +1,116 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_LIB_H__
+#define __G_LIB_H__
+
+#define __GLIB_H_INSIDE__
+
+#include <glib/galloca.h>
+#include <glib/garray.h>
+#include <glib/gasyncqueue.h>
+#include <glib/gatomic.h>
+#include <glib/gbacktrace.h>
+#include <glib/gbase64.h>
+#include <glib/gbitlock.h>
+#include <glib/gbookmarkfile.h>
+#include <glib/gbytes.h>
+#include <glib/gcharset.h>
+#include <glib/gchecksum.h>
+#include <glib/gconvert.h>
+#include <glib/gdataset.h>
+#include <glib/gdate.h>
+#include <glib/gdatetime.h>
+#include <glib/gdir.h>
+#include <glib/genviron.h>
+#include <glib/gerror.h>
+#include <glib/gfileutils.h>
+#include <glib/ggettext.h>
+#include <glib/ghash.h>
+#include <glib/ghmac.h>
+#include <glib/ghook.h>
+#include <glib/ghostutils.h>
+#include <glib/giochannel.h>
+#include <glib/gkeyfile.h>
+#include <glib/glist.h>
+#include <glib/gmacros.h>
+#include <glib/gmain.h>
+#include <glib/gmappedfile.h>
+#include <glib/gmarkup.h>
+#include <glib/gmem.h>
+#include <glib/gmessages.h>
+#include <glib/gnode.h>
+#include <glib/goption.h>
+#include <glib/gpattern.h>
+#include <glib/gpoll.h>
+#include <glib/gprimes.h>
+#include <glib/gqsort.h>
+#include <glib/gquark.h>
+#include <glib/gqueue.h>
+#include <glib/grand.h>
+#include <glib/grcbox.h>
+#include <glib/grefcount.h>
+#include <glib/grefstring.h>
+#include <glib/gregex.h>
+#include <glib/gscanner.h>
+#include <glib/gsequence.h>
+#include <glib/gshell.h>
+#include <glib/gslice.h>
+#include <glib/gslist.h>
+#include <glib/gspawn.h>
+#include <glib/gstrfuncs.h>
+#include <glib/gstring.h>
+#include <glib/gstringchunk.h>
+#include <glib/gtestutils.h>
+#include <glib/gthread.h>
+#include <glib/gthreadpool.h>
+#include <glib/gtimer.h>
+#include <glib/gtimezone.h>
+#include <glib/gtrashstack.h>
+#include <glib/gtree.h>
+#include <glib/gtypes.h>
+#include <glib/gunicode.h>
+#include <glib/gurifuncs.h>
+#include <glib/gutils.h>
+#include <glib/guuid.h>
+#include <glib/gvarianttype.h>
+#include <glib/gvariant.h>
+#include <glib/gversion.h>
+#include <glib/gversionmacros.h>
+#ifdef G_PLATFORM_WIN32
+#include <glib/gwin32.h>
+#endif
+
+#include <glib/deprecated/gallocator.h>
+#include <glib/deprecated/gcache.h>
+#include <glib/deprecated/gcompletion.h>
+#include <glib/deprecated/gmain.h>
+#include <glib/deprecated/grel.h>
+#include <glib/deprecated/gthread.h>
+
+#include <glib/glib-autocleanups.h>
+
+#undef __GLIB_H_INSIDE__
+
+#endif /* __G_LIB_H__ */
diff --git a/include/glib/glib/deprecated/gallocator.h b/include/glib/glib/deprecated/gallocator.h
new file mode 100644
index 0000000000..005e92b6eb
--- /dev/null
+++ b/include/glib/glib/deprecated/gallocator.h
@@ -0,0 +1,88 @@
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_ALLOCATOR_H__
+#define __G_ALLOCATOR_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GAllocator GAllocator;
+typedef struct _GMemChunk GMemChunk;
+
+#define G_ALLOC_ONLY 1
+#define G_ALLOC_AND_FREE 2
+#define G_ALLOCATOR_LIST 1
+#define G_ALLOCATOR_SLIST 2
+#define G_ALLOCATOR_NODE 3
+
+#define g_chunk_new(type, chunk) ((type *) g_mem_chunk_alloc (chunk))
+#define g_chunk_new0(type, chunk) ((type *) g_mem_chunk_alloc0 (chunk))
+#define g_chunk_free(mem, mem_chunk) (g_mem_chunk_free (mem_chunk, mem))
+#define g_mem_chunk_create(type, x, y) (g_mem_chunk_new (NULL, sizeof (type), 0, 0))
+
+
+GLIB_DEPRECATED
+GMemChunk * g_mem_chunk_new (const gchar *name,
+ gint atom_size,
+ gsize area_size,
+ gint type);
+GLIB_DEPRECATED
+void g_mem_chunk_destroy (GMemChunk *mem_chunk);
+GLIB_DEPRECATED
+gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
+GLIB_DEPRECATED
+gpointer g_mem_chunk_alloc0 (GMemChunk *mem_chunk);
+GLIB_DEPRECATED
+void g_mem_chunk_free (GMemChunk *mem_chunk,
+ gpointer mem);
+GLIB_DEPRECATED
+void g_mem_chunk_clean (GMemChunk *mem_chunk);
+GLIB_DEPRECATED
+void g_mem_chunk_reset (GMemChunk *mem_chunk);
+GLIB_DEPRECATED
+void g_mem_chunk_print (GMemChunk *mem_chunk);
+GLIB_DEPRECATED
+void g_mem_chunk_info (void);
+GLIB_DEPRECATED
+void g_blow_chunks (void);
+
+
+GLIB_DEPRECATED
+GAllocator * g_allocator_new (const gchar *name,
+ guint n_preallocs);
+GLIB_DEPRECATED
+void g_allocator_free (GAllocator *allocator);
+GLIB_DEPRECATED
+void g_list_push_allocator (GAllocator *allocator);
+GLIB_DEPRECATED
+void g_list_pop_allocator (void);
+GLIB_DEPRECATED
+void g_slist_push_allocator (GAllocator *allocator);
+GLIB_DEPRECATED
+void g_slist_pop_allocator (void);
+GLIB_DEPRECATED
+void g_node_push_allocator (GAllocator *allocator);
+GLIB_DEPRECATED
+void g_node_pop_allocator (void);
+
+G_END_DECLS
+
+#endif /* __G_ALLOCATOR_H__ */
diff --git a/include/glib/glib/deprecated/gcache.h b/include/glib/glib/deprecated/gcache.h
new file mode 100644
index 0000000000..e1c1f2cde6
--- /dev/null
+++ b/include/glib/glib/deprecated/gcache.h
@@ -0,0 +1,75 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_CACHE_H__
+#define __G_CACHE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/glist.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GCache GCache GLIB_DEPRECATED_TYPE_IN_2_26_FOR(GHashTable);
+
+typedef gpointer (*GCacheNewFunc) (gpointer key) GLIB_DEPRECATED_TYPE_IN_2_26;
+typedef gpointer (*GCacheDupFunc) (gpointer value) GLIB_DEPRECATED_TYPE_IN_2_26;
+typedef void (*GCacheDestroyFunc) (gpointer value) GLIB_DEPRECATED_TYPE_IN_2_26;
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+/* Caches
+ */
+GLIB_DEPRECATED
+GCache* g_cache_new (GCacheNewFunc value_new_func,
+ GCacheDestroyFunc value_destroy_func,
+ GCacheDupFunc key_dup_func,
+ GCacheDestroyFunc key_destroy_func,
+ GHashFunc hash_key_func,
+ GHashFunc hash_value_func,
+ GEqualFunc key_equal_func);
+GLIB_DEPRECATED
+void g_cache_destroy (GCache *cache);
+GLIB_DEPRECATED
+gpointer g_cache_insert (GCache *cache,
+ gpointer key);
+GLIB_DEPRECATED
+void g_cache_remove (GCache *cache,
+ gconstpointer value);
+GLIB_DEPRECATED
+void g_cache_key_foreach (GCache *cache,
+ GHFunc func,
+ gpointer user_data);
+GLIB_DEPRECATED
+void g_cache_value_foreach (GCache *cache,
+ GHFunc func,
+ gpointer user_data);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+G_END_DECLS
+
+#endif /* __G_CACHE_H__ */
diff --git a/include/glib/glib/deprecated/gcompletion.h b/include/glib/glib/deprecated/gcompletion.h
new file mode 100644
index 0000000000..2fd1f0393f
--- /dev/null
+++ b/include/glib/glib/deprecated/gcompletion.h
@@ -0,0 +1,83 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_COMPLETION_H__
+#define __G_COMPLETION_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/glist.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GCompletion GCompletion;
+
+typedef gchar* (*GCompletionFunc) (gpointer);
+
+/* GCompletion
+ */
+
+typedef gint (*GCompletionStrncmpFunc) (const gchar *s1,
+ const gchar *s2,
+ gsize n);
+
+struct _GCompletion
+{
+ GList* items;
+ GCompletionFunc func;
+
+ gchar* prefix;
+ GList* cache;
+ GCompletionStrncmpFunc strncmp_func;
+};
+
+GLIB_DEPRECATED_IN_2_26
+GCompletion* g_completion_new (GCompletionFunc func);
+GLIB_DEPRECATED_IN_2_26
+void g_completion_add_items (GCompletion* cmp,
+ GList* items);
+GLIB_DEPRECATED_IN_2_26
+void g_completion_remove_items (GCompletion* cmp,
+ GList* items);
+GLIB_DEPRECATED_IN_2_26
+void g_completion_clear_items (GCompletion* cmp);
+GLIB_DEPRECATED_IN_2_26
+GList* g_completion_complete (GCompletion* cmp,
+ const gchar* prefix,
+ gchar** new_prefix);
+GLIB_DEPRECATED_IN_2_26
+GList* g_completion_complete_utf8 (GCompletion *cmp,
+ const gchar* prefix,
+ gchar** new_prefix);
+GLIB_DEPRECATED_IN_2_26
+void g_completion_set_compare (GCompletion *cmp,
+ GCompletionStrncmpFunc strncmp_func);
+GLIB_DEPRECATED_IN_2_26
+void g_completion_free (GCompletion* cmp);
+
+G_END_DECLS
+
+#endif /* __G_COMPLETION_H__ */
diff --git a/include/glib/glib/deprecated/gmain.h b/include/glib/glib/deprecated/gmain.h
new file mode 100644
index 0000000000..2199328fd2
--- /dev/null
+++ b/include/glib/glib/deprecated/gmain.h
@@ -0,0 +1,135 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_DEPRECATED_MAIN_H__
+#define __G_DEPRECATED_MAIN_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gmain.h>
+
+G_BEGIN_DECLS
+
+/* ============== Compat main loop stuff ================== */
+
+/**
+ * g_main_new:
+ * @is_running: set to %TRUE to indicate that the loop is running. This
+ * is not very important since calling g_main_run() will set this
+ * to %TRUE anyway.
+ *
+ * Creates a new #GMainLoop for th default main context.
+ *
+ * Returns: a new #GMainLoop
+ *
+ * Deprecated: 2.2: Use g_main_loop_new() instead
+ */
+#define g_main_new(is_running) g_main_loop_new (NULL, is_running) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_new)
+
+/**
+ * g_main_run:
+ * @loop: a #GMainLoop
+ *
+ * Runs a main loop until it stops running.
+ *
+ * Deprecated: 2.2: Use g_main_loop_run() instead
+ */
+#define g_main_run(loop) g_main_loop_run(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_run)
+
+/**
+ * g_main_quit:
+ * @loop: a #GMainLoop
+ *
+ * Stops the #GMainLoop.
+ * If g_main_run() was called to run the #GMainLoop, it will now return.
+ *
+ * Deprecated: 2.2: Use g_main_loop_quit() instead
+ */
+#define g_main_quit(loop) g_main_loop_quit(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_quit)
+
+/**
+ * g_main_destroy:
+ * @loop: a #GMainLoop
+ *
+ * Frees the memory allocated for the #GMainLoop.
+ *
+ * Deprecated: 2.2: Use g_main_loop_unref() instead
+ */
+#define g_main_destroy(loop) g_main_loop_unref(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_unref)
+
+/**
+ * g_main_is_running:
+ * @loop: a #GMainLoop
+ *
+ * Checks if the main loop is running.
+ *
+ * Returns: %TRUE if the main loop is running
+ *
+ * Deprecated: 2.2: Use g_main_loop_is_running() instead
+ */
+#define g_main_is_running(loop) g_main_loop_is_running(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_is_running)
+
+/**
+ * g_main_iteration:
+ * @may_block: set to %TRUE if it should block (i.e. wait) until an event
+ * source becomes ready. It will return after an event source has been
+ * processed. If set to %FALSE it will return immediately if no event
+ * source is ready to be processed.
+ *
+ * Runs a single iteration for the default #GMainContext.
+ *
+ * Returns: %TRUE if more events are pending.
+ *
+ * Deprecated: 2.2: Use g_main_context_iteration() instead.
+ */
+#define g_main_iteration(may_block) g_main_context_iteration (NULL, may_block) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_iteration)
+
+/**
+ * g_main_pending:
+ *
+ * Checks if any events are pending for the default #GMainContext
+ * (i.e. ready to be processed).
+ *
+ * Returns: %TRUE if any events are pending.
+ *
+ * Deprected: 2.2: Use g_main_context_pending() instead.
+ */
+#define g_main_pending() g_main_context_pending (NULL) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_pending)
+
+/**
+ * g_main_set_poll_func:
+ * @func: the function to call to poll all file descriptors
+ *
+ * Sets the function to use for the handle polling of file descriptors
+ * for the default main context.
+ *
+ * Deprecated: 2.2: Use g_main_context_set_poll_func() again
+ */
+#define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_set_poll_func)
+
+G_END_DECLS
+
+#endif /* __G_DEPRECATED_MAIN_H__ */
diff --git a/include/glib/glib/deprecated/grel.h b/include/glib/glib/deprecated/grel.h
new file mode 100644
index 0000000000..3a65240c1f
--- /dev/null
+++ b/include/glib/glib/deprecated/grel.h
@@ -0,0 +1,105 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_REL_H__
+#define __G_REL_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GRelation GRelation;
+typedef struct _GTuples GTuples;
+
+struct _GTuples
+{
+ guint len;
+};
+
+/* GRelation
+ *
+ * Indexed Relations. Imagine a really simple table in a
+ * database. Relations are not ordered. This data type is meant for
+ * maintaining a N-way mapping.
+ *
+ * g_relation_new() creates a relation with FIELDS fields
+ *
+ * g_relation_destroy() frees all resources
+ * g_tuples_destroy() frees the result of g_relation_select()
+ *
+ * g_relation_index() indexes relation FIELD with the provided
+ * equality and hash functions. this must be done before any
+ * calls to insert are made.
+ *
+ * g_relation_insert() inserts a new tuple. you are expected to
+ * provide the right number of fields.
+ *
+ * g_relation_delete() deletes all relations with KEY in FIELD
+ * g_relation_select() returns ...
+ * g_relation_count() counts ...
+ */
+
+GLIB_DEPRECATED_IN_2_26
+GRelation* g_relation_new (gint fields);
+GLIB_DEPRECATED_IN_2_26
+void g_relation_destroy (GRelation *relation);
+GLIB_DEPRECATED_IN_2_26
+void g_relation_index (GRelation *relation,
+ gint field,
+ GHashFunc hash_func,
+ GEqualFunc key_equal_func);
+GLIB_DEPRECATED_IN_2_26
+void g_relation_insert (GRelation *relation,
+ ...);
+GLIB_DEPRECATED_IN_2_26
+gint g_relation_delete (GRelation *relation,
+ gconstpointer key,
+ gint field);
+GLIB_DEPRECATED_IN_2_26
+GTuples* g_relation_select (GRelation *relation,
+ gconstpointer key,
+ gint field);
+GLIB_DEPRECATED_IN_2_26
+gint g_relation_count (GRelation *relation,
+ gconstpointer key,
+ gint field);
+GLIB_DEPRECATED_IN_2_26
+gboolean g_relation_exists (GRelation *relation,
+ ...);
+GLIB_DEPRECATED_IN_2_26
+void g_relation_print (GRelation *relation);
+GLIB_DEPRECATED_IN_2_26
+void g_tuples_destroy (GTuples *tuples);
+GLIB_DEPRECATED_IN_2_26
+gpointer g_tuples_index (GTuples *tuples,
+ gint index_,
+ gint field);
+
+G_END_DECLS
+
+#endif /* __G_REL_H__ */
diff --git a/include/glib/glib/deprecated/gthread.h b/include/glib/glib/deprecated/gthread.h
new file mode 100644
index 0000000000..33b422240d
--- /dev/null
+++ b/include/glib/glib/deprecated/gthread.h
@@ -0,0 +1,289 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_DEPRECATED_THREAD_H__
+#define __G_DEPRECATED_THREAD_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gthread.h>
+
+G_BEGIN_DECLS
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+typedef enum
+{
+ G_THREAD_PRIORITY_LOW,
+ G_THREAD_PRIORITY_NORMAL,
+ G_THREAD_PRIORITY_HIGH,
+ G_THREAD_PRIORITY_URGENT
+} GThreadPriority GLIB_DEPRECATED_TYPE_IN_2_32;
+
+struct _GThread
+{
+ /*< private >*/
+ GThreadFunc func;
+ gpointer data;
+ gboolean joinable;
+ GThreadPriority priority;
+};
+
+typedef struct _GThreadFunctions GThreadFunctions GLIB_DEPRECATED_TYPE_IN_2_32;
+struct _GThreadFunctions
+{
+ GMutex* (*mutex_new) (void);
+ void (*mutex_lock) (GMutex *mutex);
+ gboolean (*mutex_trylock) (GMutex *mutex);
+ void (*mutex_unlock) (GMutex *mutex);
+ void (*mutex_free) (GMutex *mutex);
+ GCond* (*cond_new) (void);
+ void (*cond_signal) (GCond *cond);
+ void (*cond_broadcast) (GCond *cond);
+ void (*cond_wait) (GCond *cond,
+ GMutex *mutex);
+ gboolean (*cond_timed_wait) (GCond *cond,
+ GMutex *mutex,
+ GTimeVal *end_time);
+ void (*cond_free) (GCond *cond);
+ GPrivate* (*private_new) (GDestroyNotify destructor);
+ gpointer (*private_get) (GPrivate *private_key);
+ void (*private_set) (GPrivate *private_key,
+ gpointer data);
+ void (*thread_create) (GThreadFunc func,
+ gpointer data,
+ gulong stack_size,
+ gboolean joinable,
+ gboolean bound,
+ GThreadPriority priority,
+ gpointer thread,
+ GError **error);
+ void (*thread_yield) (void);
+ void (*thread_join) (gpointer thread);
+ void (*thread_exit) (void);
+ void (*thread_set_priority)(gpointer thread,
+ GThreadPriority priority);
+ void (*thread_self) (gpointer thread);
+ gboolean (*thread_equal) (gpointer thread1,
+ gpointer thread2);
+} GLIB_DEPRECATED_TYPE_IN_2_32;
+
+GLIB_VAR GThreadFunctions g_thread_functions_for_glib_use;
+GLIB_VAR gboolean g_thread_use_default_impl;
+
+GLIB_VAR guint64 (*g_thread_gettime) (void);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
+GThread *g_thread_create (GThreadFunc func,
+ gpointer data,
+ gboolean joinable,
+ GError **error);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
+GThread *g_thread_create_full (GThreadFunc func,
+ gpointer data,
+ gulong stack_size,
+ gboolean joinable,
+ gboolean bound,
+ GThreadPriority priority,
+ GError **error);
+
+GLIB_DEPRECATED_IN_2_32
+void g_thread_set_priority (GThread *thread,
+ GThreadPriority priority);
+
+GLIB_DEPRECATED_IN_2_32
+void g_thread_foreach (GFunc thread_func,
+ gpointer user_data);
+
+#ifndef G_OS_WIN32
+#include <sys/types.h>
+#include <pthread.h>
+#endif
+
+#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl GLIB_DEPRECATED_MACRO_IN_2_32
+#define G_STATIC_MUTEX_INIT { NULL } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init)
+typedef struct
+{
+ GMutex *mutex;
+#ifndef G_OS_WIN32
+ /* only for ABI compatibility reasons */
+ pthread_mutex_t unused;
+#endif
+} GStaticMutex GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GMutex);
+
+#define g_static_mutex_lock(mutex) \
+ g_mutex_lock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_lock)
+#define g_static_mutex_trylock(mutex) \
+ g_mutex_trylock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_trylock)
+#define g_static_mutex_unlock(mutex) \
+ g_mutex_unlock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_unlock)
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_init)
+void g_static_mutex_init (GStaticMutex *mutex);
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_clear)
+void g_static_mutex_free (GStaticMutex *mutex);
+GLIB_DEPRECATED_IN_2_32_FOR(GMutex)
+GMutex *g_static_mutex_get_mutex_impl (GStaticMutex *mutex);
+
+typedef struct _GStaticRecMutex GStaticRecMutex GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRecMutex);
+struct _GStaticRecMutex
+{
+ /*< private >*/
+ GStaticMutex mutex;
+ guint depth;
+
+ /* ABI compat only */
+ union {
+#ifdef G_OS_WIN32
+ void *owner;
+#else
+ pthread_t owner;
+#endif
+ gdouble dummy;
+ } unused;
+} GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRecMutex);
+
+#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rec_mutex_init)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init)
+void g_static_rec_mutex_init (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_lock)
+void g_static_rec_mutex_lock (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_try_lock)
+gboolean g_static_rec_mutex_trylock (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_unlock)
+void g_static_rec_mutex_unlock (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32
+void g_static_rec_mutex_lock_full (GStaticRecMutex *mutex,
+ guint depth);
+
+GLIB_DEPRECATED_IN_2_32
+guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_free)
+void g_static_rec_mutex_free (GStaticRecMutex *mutex);
+
+typedef struct _GStaticRWLock GStaticRWLock GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRWLock);
+struct _GStaticRWLock
+{
+ /*< private >*/
+ GStaticMutex mutex;
+ GCond *read_cond;
+ GCond *write_cond;
+ guint read_counter;
+ gboolean have_writer;
+ guint want_to_read;
+ guint want_to_write;
+} GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRWLock);
+
+#define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rw_lock_init)
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_init)
+void g_static_rw_lock_init (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_lock)
+void g_static_rw_lock_reader_lock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_trylock)
+gboolean g_static_rw_lock_reader_trylock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_unlock)
+void g_static_rw_lock_reader_unlock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_lock)
+void g_static_rw_lock_writer_lock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_trylock)
+gboolean g_static_rw_lock_writer_trylock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_unlock)
+void g_static_rw_lock_writer_unlock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_free)
+void g_static_rw_lock_free (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32
+GPrivate * g_private_new (GDestroyNotify notify);
+
+typedef struct _GStaticPrivate GStaticPrivate GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GPrivate);
+struct _GStaticPrivate
+{
+ /*< private >*/
+ guint index;
+} GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GPrivate);
+
+#define G_STATIC_PRIVATE_INIT { 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(G_PRIVATE_INIT)
+GLIB_DEPRECATED_IN_2_32
+void g_static_private_init (GStaticPrivate *private_key);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_get)
+gpointer g_static_private_get (GStaticPrivate *private_key);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_set)
+void g_static_private_set (GStaticPrivate *private_key,
+ gpointer data,
+ GDestroyNotify notify);
+
+GLIB_DEPRECATED_IN_2_32
+void g_static_private_free (GStaticPrivate *private_key);
+
+GLIB_DEPRECATED_IN_2_32
+gboolean g_once_init_enter_impl (volatile gsize *location);
+
+GLIB_DEPRECATED_IN_2_32
+void g_thread_init (gpointer vtable);
+GLIB_DEPRECATED_IN_2_32
+void g_thread_init_with_errorcheck_mutexes (gpointer vtable);
+
+GLIB_DEPRECATED_IN_2_32
+gboolean g_thread_get_initialized (void);
+
+GLIB_VAR gboolean g_threads_got_initialized;
+
+#define g_thread_supported() (1) GLIB_DEPRECATED_MACRO_IN_2_32
+
+GLIB_DEPRECATED_IN_2_32
+GMutex * g_mutex_new (void);
+GLIB_DEPRECATED_IN_2_32
+void g_mutex_free (GMutex *mutex);
+GLIB_DEPRECATED_IN_2_32
+GCond * g_cond_new (void);
+GLIB_DEPRECATED_IN_2_32
+void g_cond_free (GCond *cond);
+GLIB_DEPRECATED_IN_2_32
+gboolean g_cond_timed_wait (GCond *cond,
+ GMutex *mutex,
+ GTimeVal *timeval);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+G_END_DECLS
+
+#endif /* __G_DEPRECATED_THREAD_H__ */
diff --git a/include/glib/glib/galloca.h b/include/glib/glib/galloca.h
new file mode 100644
index 0000000000..47151ee8b6
--- /dev/null
+++ b/include/glib/glib/galloca.h
@@ -0,0 +1,103 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_ALLOCA_H__
+#define __G_ALLOCA_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+#if defined(__BIONIC__) && defined (GLIB_HAVE_ALLOCA_H)
+# include <alloca.h>
+#elif defined(__GNUC__)
+/* GCC does the right thing */
+# undef alloca
+# define alloca(size) __builtin_alloca (size)
+#elif defined (GLIB_HAVE_ALLOCA_H)
+/* a native and working alloca.h is there */
+# include <alloca.h>
+#else /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
+# if defined(_MSC_VER) || defined(__DMC__)
+# include <malloc.h>
+# define alloca _alloca
+# else /* !_MSC_VER && !__DMC__ */
+# ifdef _AIX
+# pragma alloca
+# else /* !_AIX */
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+G_BEGIN_DECLS
+char *alloca ();
+G_END_DECLS
+# endif /* !alloca */
+# endif /* !_AIX */
+# endif /* !_MSC_VER && !__DMC__ */
+#endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
+
+/**
+ * g_alloca:
+ * @size: number of bytes to allocate.
+ *
+ * Allocates @size bytes on the stack; these bytes will be freed when the current
+ * stack frame is cleaned up. This macro essentially just wraps the alloca()
+ * function present on most UNIX variants.
+ * Thus it provides the same advantages and pitfalls as alloca():
+ *
+ * - alloca() is very fast, as on most systems it's implemented by just adjusting
+ * the stack pointer register.
+ *
+ * - It doesn't cause any memory fragmentation, within its scope, separate alloca()
+ * blocks just build up and are released together at function end.
+ *
+ * - Allocation sizes have to fit into the current stack frame. For instance in a
+ * threaded environment on Linux, the per-thread stack size is limited to 2 Megabytes,
+ * so be sparse with alloca() uses.
+ *
+ * - Allocation failure due to insufficient stack space is not indicated with a %NULL
+ * return like e.g. with malloc(). Instead, most systems probably handle it the same
+ * way as out of stack space situations from infinite function recursion, i.e.
+ * with a segmentation fault.
+ *
+ * - Special care has to be taken when mixing alloca() with GNU C variable sized arrays.
+ * Stack space allocated with alloca() in the same scope as a variable sized array
+ * will be freed together with the variable sized array upon exit of that scope, and
+ * not upon exit of the enclosing function scope.
+ *
+ * Returns: space for @size bytes, allocated on the stack
+ */
+#define g_alloca(size) alloca (size)
+/**
+ * g_newa:
+ * @struct_type: Type of memory chunks to be allocated
+ * @n_structs: Number of chunks to be allocated
+ *
+ * Wraps g_alloca() in a more typesafe manner.
+ *
+ * Returns: Pointer to stack space for @n_structs chunks of type @struct_type
+ */
+#define g_newa(struct_type, n_structs) ((struct_type*) g_alloca (sizeof (struct_type) * (gsize) (n_structs)))
+
+#endif /* __G_ALLOCA_H__ */
diff --git a/include/glib/glib/garray.h b/include/glib/glib/garray.h
new file mode 100644
index 0000000000..3e7ce77321
--- /dev/null
+++ b/include/glib/glib/garray.h
@@ -0,0 +1,272 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_ARRAY_H__
+#define __G_ARRAY_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GBytes GBytes;
+typedef struct _GArray GArray;
+typedef struct _GByteArray GByteArray;
+typedef struct _GPtrArray GPtrArray;
+
+struct _GArray
+{
+ gchar *data;
+ guint len;
+};
+
+struct _GByteArray
+{
+ guint8 *data;
+ guint len;
+};
+
+struct _GPtrArray
+{
+ gpointer *pdata;
+ guint len;
+};
+
+/* Resizable arrays. remove fills any cleared spot and shortens the
+ * array, while preserving the order. remove_fast will distort the
+ * order by moving the last element to the position of the removed.
+ */
+
+#define g_array_append_val(a,v) g_array_append_vals (a, &(v), 1)
+#define g_array_prepend_val(a,v) g_array_prepend_vals (a, &(v), 1)
+#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1)
+#define g_array_index(a,t,i) (((t*) (void *) (a)->data) [(i)])
+
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_new (gboolean zero_terminated,
+ gboolean clear_,
+ guint element_size);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_sized_new (gboolean zero_terminated,
+ gboolean clear_,
+ guint element_size,
+ guint reserved_size);
+GLIB_AVAILABLE_IN_2_62
+GArray* g_array_copy (GArray *array);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_array_free (GArray *array,
+ gboolean free_segment);
+GLIB_AVAILABLE_IN_ALL
+GArray *g_array_ref (GArray *array);
+GLIB_AVAILABLE_IN_ALL
+void g_array_unref (GArray *array);
+GLIB_AVAILABLE_IN_ALL
+guint g_array_get_element_size (GArray *array);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_append_vals (GArray *array,
+ gconstpointer data,
+ guint len);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_prepend_vals (GArray *array,
+ gconstpointer data,
+ guint len);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_insert_vals (GArray *array,
+ guint index_,
+ gconstpointer data,
+ guint len);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_set_size (GArray *array,
+ guint length);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_remove_index (GArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_remove_index_fast (GArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_ALL
+GArray* g_array_remove_range (GArray *array,
+ guint index_,
+ guint length);
+GLIB_AVAILABLE_IN_ALL
+void g_array_sort (GArray *array,
+ GCompareFunc compare_func);
+GLIB_AVAILABLE_IN_ALL
+void g_array_sort_with_data (GArray *array,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_62
+gboolean g_array_binary_search (GArray *array,
+ gconstpointer target,
+ GCompareFunc compare_func,
+ guint *out_match_index);
+GLIB_AVAILABLE_IN_ALL
+void g_array_set_clear_func (GArray *array,
+ GDestroyNotify clear_func);
+
+/* Resizable pointer array. This interface is much less complicated
+ * than the above. Add appends a pointer. Remove fills any cleared
+ * spot and shortens the array. remove_fast will again distort order.
+ */
+#define g_ptr_array_index(array,index_) ((array)->pdata)[index_]
+GLIB_AVAILABLE_IN_ALL
+GPtrArray* g_ptr_array_new (void);
+GLIB_AVAILABLE_IN_ALL
+GPtrArray* g_ptr_array_new_with_free_func (GDestroyNotify element_free_func);
+GLIB_AVAILABLE_IN_2_62
+GPtrArray *g_ptr_array_copy (GPtrArray *array,
+ GCopyFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GPtrArray* g_ptr_array_sized_new (guint reserved_size);
+GLIB_AVAILABLE_IN_ALL
+GPtrArray* g_ptr_array_new_full (guint reserved_size,
+ GDestroyNotify element_free_func);
+GLIB_AVAILABLE_IN_ALL
+gpointer* g_ptr_array_free (GPtrArray *array,
+ gboolean free_seg);
+GLIB_AVAILABLE_IN_ALL
+GPtrArray* g_ptr_array_ref (GPtrArray *array);
+GLIB_AVAILABLE_IN_ALL
+void g_ptr_array_unref (GPtrArray *array);
+GLIB_AVAILABLE_IN_ALL
+void g_ptr_array_set_free_func (GPtrArray *array,
+ GDestroyNotify element_free_func);
+GLIB_AVAILABLE_IN_ALL
+void g_ptr_array_set_size (GPtrArray *array,
+ gint length);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_ptr_array_remove_index (GPtrArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_ptr_array_remove_index_fast (GPtrArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_ptr_array_steal_index (GPtrArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_ptr_array_steal_index_fast (GPtrArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_ptr_array_remove (GPtrArray *array,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_ptr_array_remove_fast (GPtrArray *array,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+GPtrArray *g_ptr_array_remove_range (GPtrArray *array,
+ guint index_,
+ guint length);
+GLIB_AVAILABLE_IN_ALL
+void g_ptr_array_add (GPtrArray *array,
+ gpointer data);
+GLIB_AVAILABLE_IN_2_62
+void g_ptr_array_extend (GPtrArray *array_to_extend,
+ GPtrArray *array,
+ GCopyFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_62
+void g_ptr_array_extend_and_steal (GPtrArray *array_to_extend,
+ GPtrArray *array);
+GLIB_AVAILABLE_IN_2_40
+void g_ptr_array_insert (GPtrArray *array,
+ gint index_,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_ptr_array_sort (GPtrArray *array,
+ GCompareFunc compare_func);
+GLIB_AVAILABLE_IN_ALL
+void g_ptr_array_sort_with_data (GPtrArray *array,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+void g_ptr_array_foreach (GPtrArray *array,
+ GFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_54
+gboolean g_ptr_array_find (GPtrArray *haystack,
+ gconstpointer needle,
+ guint *index_);
+GLIB_AVAILABLE_IN_2_54
+gboolean g_ptr_array_find_with_equal_func (GPtrArray *haystack,
+ gconstpointer needle,
+ GEqualFunc equal_func,
+ guint *index_);
+
+
+/* Byte arrays, an array of guint8. Implemented as a GArray,
+ * but type-safe.
+ */
+
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_new (void);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_new_take (guint8 *data,
+ gsize len);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_sized_new (guint reserved_size);
+GLIB_AVAILABLE_IN_ALL
+guint8* g_byte_array_free (GByteArray *array,
+ gboolean free_segment);
+GLIB_AVAILABLE_IN_ALL
+GBytes* g_byte_array_free_to_bytes (GByteArray *array);
+GLIB_AVAILABLE_IN_ALL
+GByteArray *g_byte_array_ref (GByteArray *array);
+GLIB_AVAILABLE_IN_ALL
+void g_byte_array_unref (GByteArray *array);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_append (GByteArray *array,
+ const guint8 *data,
+ guint len);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_prepend (GByteArray *array,
+ const guint8 *data,
+ guint len);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_set_size (GByteArray *array,
+ guint length);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_remove_index (GByteArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_remove_index_fast (GByteArray *array,
+ guint index_);
+GLIB_AVAILABLE_IN_ALL
+GByteArray* g_byte_array_remove_range (GByteArray *array,
+ guint index_,
+ guint length);
+GLIB_AVAILABLE_IN_ALL
+void g_byte_array_sort (GByteArray *array,
+ GCompareFunc compare_func);
+GLIB_AVAILABLE_IN_ALL
+void g_byte_array_sort_with_data (GByteArray *array,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __G_ARRAY_H__ */
diff --git a/include/glib/glib/gasyncqueue.h b/include/glib/glib/gasyncqueue.h
new file mode 100644
index 0000000000..73e537b079
--- /dev/null
+++ b/include/glib/glib/gasyncqueue.h
@@ -0,0 +1,124 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_ASYNCQUEUE_H__
+#define __G_ASYNCQUEUE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gthread.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GAsyncQueue GAsyncQueue;
+
+GLIB_AVAILABLE_IN_ALL
+GAsyncQueue *g_async_queue_new (void);
+GLIB_AVAILABLE_IN_ALL
+GAsyncQueue *g_async_queue_new_full (GDestroyNotify item_free_func);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_lock (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_unlock (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+GAsyncQueue *g_async_queue_ref (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_unref (GAsyncQueue *queue);
+
+GLIB_DEPRECATED_FOR(g_async_queue_ref)
+void g_async_queue_ref_unlocked (GAsyncQueue *queue);
+
+GLIB_DEPRECATED_FOR(g_async_queue_unref)
+void g_async_queue_unref_and_unlock (GAsyncQueue *queue);
+
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_push (GAsyncQueue *queue,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_push_unlocked (GAsyncQueue *queue,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_push_sorted (GAsyncQueue *queue,
+ gpointer data,
+ GCompareDataFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_push_sorted_unlocked (GAsyncQueue *queue,
+ gpointer data,
+ GCompareDataFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_async_queue_pop (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_async_queue_pop_unlocked (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_async_queue_try_pop (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_async_queue_try_pop_unlocked (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_async_queue_timeout_pop (GAsyncQueue *queue,
+ guint64 timeout);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_async_queue_timeout_pop_unlocked (GAsyncQueue *queue,
+ guint64 timeout);
+GLIB_AVAILABLE_IN_ALL
+gint g_async_queue_length (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gint g_async_queue_length_unlocked (GAsyncQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_sort (GAsyncQueue *queue,
+ GCompareDataFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+void g_async_queue_sort_unlocked (GAsyncQueue *queue,
+ GCompareDataFunc func,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_46
+gboolean g_async_queue_remove (GAsyncQueue *queue,
+ gpointer item);
+GLIB_AVAILABLE_IN_2_46
+gboolean g_async_queue_remove_unlocked (GAsyncQueue *queue,
+ gpointer item);
+GLIB_AVAILABLE_IN_2_46
+void g_async_queue_push_front (GAsyncQueue *queue,
+ gpointer item);
+GLIB_AVAILABLE_IN_2_46
+void g_async_queue_push_front_unlocked (GAsyncQueue *queue,
+ gpointer item);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_FOR(g_async_queue_timeout_pop)
+gpointer g_async_queue_timed_pop (GAsyncQueue *queue,
+ GTimeVal *end_time);
+GLIB_DEPRECATED_FOR(g_async_queue_timeout_pop_unlocked)
+gpointer g_async_queue_timed_pop_unlocked (GAsyncQueue *queue,
+ GTimeVal *end_time);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+G_END_DECLS
+
+#endif /* __G_ASYNCQUEUE_H__ */
diff --git a/include/glib/glib/gatomic.h b/include/glib/glib/gatomic.h
new file mode 100644
index 0000000000..971176eb99
--- /dev/null
+++ b/include/glib/glib/gatomic.h
@@ -0,0 +1,291 @@
+/*
+ * Copyright © 2011 Ryan Lortie
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_ATOMIC_H__
+#define __G_ATOMIC_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+gint g_atomic_int_get (const volatile gint *atomic);
+GLIB_AVAILABLE_IN_ALL
+void g_atomic_int_set (volatile gint *atomic,
+ gint newval);
+GLIB_AVAILABLE_IN_ALL
+void g_atomic_int_inc (volatile gint *atomic);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_atomic_int_dec_and_test (volatile gint *atomic);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_atomic_int_compare_and_exchange (volatile gint *atomic,
+ gint oldval,
+ gint newval);
+GLIB_AVAILABLE_IN_ALL
+gint g_atomic_int_add (volatile gint *atomic,
+ gint val);
+GLIB_AVAILABLE_IN_2_30
+guint g_atomic_int_and (volatile guint *atomic,
+ guint val);
+GLIB_AVAILABLE_IN_2_30
+guint g_atomic_int_or (volatile guint *atomic,
+ guint val);
+GLIB_AVAILABLE_IN_ALL
+guint g_atomic_int_xor (volatile guint *atomic,
+ guint val);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_atomic_pointer_get (const volatile void *atomic);
+GLIB_AVAILABLE_IN_ALL
+void g_atomic_pointer_set (volatile void *atomic,
+ gpointer newval);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_atomic_pointer_compare_and_exchange (volatile void *atomic,
+ gpointer oldval,
+ gpointer newval);
+GLIB_AVAILABLE_IN_ALL
+gssize g_atomic_pointer_add (volatile void *atomic,
+ gssize val);
+GLIB_AVAILABLE_IN_2_30
+gsize g_atomic_pointer_and (volatile void *atomic,
+ gsize val);
+GLIB_AVAILABLE_IN_2_30
+gsize g_atomic_pointer_or (volatile void *atomic,
+ gsize val);
+GLIB_AVAILABLE_IN_ALL
+gsize g_atomic_pointer_xor (volatile void *atomic,
+ gsize val);
+
+GLIB_DEPRECATED_IN_2_30_FOR(g_atomic_int_add)
+gint g_atomic_int_exchange_and_add (volatile gint *atomic,
+ gint val);
+
+G_END_DECLS
+
+#if defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+
+/* We prefer the new C11-style atomic extension of GCC if available */
+#if defined(__ATOMIC_SEQ_CST) && !defined(__clang__)
+
+/* This assumes sizeof(int) is 4: gatomic.c statically
+ * asserts that (using G_STATIC_ASSERT at top-level in a header was
+ * problematic, see #730932) */
+
+#define g_atomic_int_get(atomic) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ *(atomic) : 1); \
+ (gint) __atomic_load_4 ((atomic), __ATOMIC_SEQ_CST); \
+ }))
+#define g_atomic_int_set(atomic, newval) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ (newval) : 1); \
+ __atomic_store_4 ((atomic), (newval), __ATOMIC_SEQ_CST); \
+ }))
+
+#if GLIB_SIZEOF_VOID_P == 8
+
+#define g_atomic_pointer_get(atomic) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ guint64 gapg_temp = __atomic_load_8 ((atomic), __ATOMIC_SEQ_CST); \
+ (gpointer) gapg_temp; \
+ }))
+#define g_atomic_pointer_set(atomic, newval) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ __atomic_store_8 ((atomic), (gsize) (newval), __ATOMIC_SEQ_CST); \
+ }))
+
+#else /* GLIB_SIZEOF_VOID_P == 8 */
+
+/* This assumes that if sizeof(void *) is not 8, then it is 4:
+ * gatomic.c statically asserts that (using G_STATIC_ASSERT
+ * at top-level in a header was problematic, see #730932) */
+
+#define g_atomic_pointer_get(atomic) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ guint32 gapg_temp = __atomic_load_4 ((atomic), __ATOMIC_SEQ_CST); \
+ (gpointer) gapg_temp; \
+ }))
+#define g_atomic_pointer_set(atomic, newval) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ __atomic_store_4 ((atomic), (gsize) (newval), __ATOMIC_SEQ_CST); \
+ }))
+
+#endif /* GLIB_SIZEOF_VOID_P == 8 */
+
+#else /* defined(__ATOMIC_SEQ_CST) */
+
+#define g_atomic_int_get(atomic) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ *(atomic) : 1); \
+ __sync_synchronize (); \
+ (gint) *(atomic); \
+ }))
+#define g_atomic_int_set(atomic, newval) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ (newval) : 1); \
+ *(atomic) = (newval); \
+ __sync_synchronize (); \
+ }))
+#define g_atomic_pointer_get(atomic) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ __sync_synchronize (); \
+ (gpointer) *(atomic); \
+ }))
+#define g_atomic_pointer_set(atomic, newval) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ *(atomic) = (__typeof__ (*(atomic))) (gsize) (newval); \
+ __sync_synchronize (); \
+ }))
+
+#endif /* !defined(__ATOMIC_SEQ_CST) */
+
+#define g_atomic_int_inc(atomic) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ *(atomic) : 1); \
+ (void) __sync_fetch_and_add ((atomic), 1); \
+ }))
+#define g_atomic_int_dec_and_test(atomic) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ *(atomic) : 1); \
+ __sync_fetch_and_sub ((atomic), 1) == 1; \
+ }))
+#define g_atomic_int_compare_and_exchange(atomic, oldval, newval) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ (newval) ^ (oldval) : 1); \
+ __sync_bool_compare_and_swap ((atomic), (oldval), (newval)) ? TRUE : FALSE; \
+ }))
+#define g_atomic_int_add(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ (val) : 1); \
+ (gint) __sync_fetch_and_add ((atomic), (val)); \
+ }))
+#define g_atomic_int_and(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ (val) : 1); \
+ (guint) __sync_fetch_and_and ((atomic), (val)); \
+ }))
+#define g_atomic_int_or(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ (val) : 1); \
+ (guint) __sync_fetch_and_or ((atomic), (val)); \
+ }))
+#define g_atomic_int_xor(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
+ (void) (0 ? *(atomic) ^ (val) : 1); \
+ (guint) __sync_fetch_and_xor ((atomic), (val)); \
+ }))
+
+#define g_atomic_pointer_compare_and_exchange(atomic, oldval, newval) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ __sync_bool_compare_and_swap ((atomic), (oldval), (newval)) ? TRUE : FALSE; \
+ }))
+#define g_atomic_pointer_add(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ (void) (0 ? (val) ^ (val) : 1); \
+ (gssize) __sync_fetch_and_add ((atomic), (val)); \
+ }))
+#define g_atomic_pointer_and(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ (void) (0 ? (val) ^ (val) : 1); \
+ (gsize) __sync_fetch_and_and ((atomic), (val)); \
+ }))
+#define g_atomic_pointer_or(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ (void) (0 ? (val) ^ (val) : 1); \
+ (gsize) __sync_fetch_and_or ((atomic), (val)); \
+ }))
+#define g_atomic_pointer_xor(atomic, val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(atomic) : NULL); \
+ (void) (0 ? (val) ^ (val) : 1); \
+ (gsize) __sync_fetch_and_xor ((atomic), (val)); \
+ }))
+
+#else /* defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) */
+
+#define g_atomic_int_get(atomic) \
+ (g_atomic_int_get ((gint *) (atomic)))
+#define g_atomic_int_set(atomic, newval) \
+ (g_atomic_int_set ((gint *) (atomic), (gint) (newval)))
+#define g_atomic_int_compare_and_exchange(atomic, oldval, newval) \
+ (g_atomic_int_compare_and_exchange ((gint *) (atomic), (oldval), (newval)))
+#define g_atomic_int_add(atomic, val) \
+ (g_atomic_int_add ((gint *) (atomic), (val)))
+#define g_atomic_int_and(atomic, val) \
+ (g_atomic_int_and ((guint *) (atomic), (val)))
+#define g_atomic_int_or(atomic, val) \
+ (g_atomic_int_or ((guint *) (atomic), (val)))
+#define g_atomic_int_xor(atomic, val) \
+ (g_atomic_int_xor ((guint *) (atomic), (val)))
+#define g_atomic_int_inc(atomic) \
+ (g_atomic_int_inc ((gint *) (atomic)))
+#define g_atomic_int_dec_and_test(atomic) \
+ (g_atomic_int_dec_and_test ((gint *) (atomic)))
+
+#define g_atomic_pointer_get(atomic) \
+ (g_atomic_pointer_get (atomic))
+#define g_atomic_pointer_set(atomic, newval) \
+ (g_atomic_pointer_set ((atomic), (gpointer) (newval)))
+#define g_atomic_pointer_compare_and_exchange(atomic, oldval, newval) \
+ (g_atomic_pointer_compare_and_exchange ((atomic), (gpointer) (oldval), (gpointer) (newval)))
+#define g_atomic_pointer_add(atomic, val) \
+ (g_atomic_pointer_add ((atomic), (gssize) (val)))
+#define g_atomic_pointer_and(atomic, val) \
+ (g_atomic_pointer_and ((atomic), (gsize) (val)))
+#define g_atomic_pointer_or(atomic, val) \
+ (g_atomic_pointer_or ((atomic), (gsize) (val)))
+#define g_atomic_pointer_xor(atomic, val) \
+ (g_atomic_pointer_xor ((atomic), (gsize) (val)))
+
+#endif /* defined(__GNUC__) && defined(G_ATOMIC_OP_USE_GCC_BUILTINS) */
+
+#endif /* __G_ATOMIC_H__ */
diff --git a/include/glib/glib/gbacktrace.h b/include/glib/glib/gbacktrace.h
new file mode 100644
index 0000000000..9e9cba151c
--- /dev/null
+++ b/include/glib/glib/gbacktrace.h
@@ -0,0 +1,72 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_BACKTRACE_H__
+#define __G_BACKTRACE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+#ifdef __sun__
+#include <sys/select.h>
+#endif
+#include <signal.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+void g_on_error_query (const gchar *prg_name);
+GLIB_AVAILABLE_IN_ALL
+void g_on_error_stack_trace (const gchar *prg_name);
+
+/**
+ * G_BREAKPOINT:
+ *
+ * Inserts a breakpoint instruction into the code.
+ *
+ * On architectures which support it, this is implemented as a soft interrupt
+ * and on other architectures it raises a `SIGTRAP` signal.
+ *
+ * `SIGTRAP` is used rather than abort() to allow breakpoints to be skipped past
+ * in a debugger if they are not the desired target of debugging.
+ */
+#if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2
+# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END
+#elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86)
+# define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END
+#elif defined (_MSC_VER)
+# define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END
+#elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2
+# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
+#elif defined (__APPLE__)
+# define G_BREAKPOINT() G_STMT_START{ __builtin_trap(); }G_STMT_END
+#else /* !__i386__ && !__alpha__ */
+# define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END
+#endif /* __i386__ */
+
+G_END_DECLS
+
+#endif /* __G_BACKTRACE_H__ */
diff --git a/include/glib/glib/gbase64.h b/include/glib/glib/gbase64.h
new file mode 100644
index 0000000000..662c597ff9
--- /dev/null
+++ b/include/glib/glib/gbase64.h
@@ -0,0 +1,61 @@
+/* gbase64.h - Base64 coding functions
+ *
+ * Copyright (C) 2005 Alexander Larsson <alexl@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_BASE64_H__
+#define __G_BASE64_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+gsize g_base64_encode_step (const guchar *in,
+ gsize len,
+ gboolean break_lines,
+ gchar *out,
+ gint *state,
+ gint *save);
+GLIB_AVAILABLE_IN_ALL
+gsize g_base64_encode_close (gboolean break_lines,
+ gchar *out,
+ gint *state,
+ gint *save);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_base64_encode (const guchar *data,
+ gsize len) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gsize g_base64_decode_step (const gchar *in,
+ gsize len,
+ guchar *out,
+ gint *state,
+ guint *save);
+GLIB_AVAILABLE_IN_ALL
+guchar *g_base64_decode (const gchar *text,
+ gsize *out_len) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+guchar *g_base64_decode_inplace (gchar *text,
+ gsize *out_len);
+
+
+G_END_DECLS
+
+#endif /* __G_BASE64_H__ */
diff --git a/include/glib/glib/gbitlock.h b/include/glib/glib/gbitlock.h
new file mode 100644
index 0000000000..8054bc8ae5
--- /dev/null
+++ b/include/glib/glib/gbitlock.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright © 2008 Ryan Lortie
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_BITLOCK_H__
+#define __G_BITLOCK_H__
+
+#include <glib/gtypes.h>
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+void g_bit_lock (volatile gint *address,
+ gint lock_bit);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bit_trylock (volatile gint *address,
+ gint lock_bit);
+GLIB_AVAILABLE_IN_ALL
+void g_bit_unlock (volatile gint *address,
+ gint lock_bit);
+
+GLIB_AVAILABLE_IN_ALL
+void g_pointer_bit_lock (volatile void *address,
+ gint lock_bit);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pointer_bit_trylock (volatile void *address,
+ gint lock_bit);
+GLIB_AVAILABLE_IN_ALL
+void g_pointer_bit_unlock (volatile void *address,
+ gint lock_bit);
+
+#ifdef __GNUC__
+
+#define g_pointer_bit_lock(address, lock_bit) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(address) == sizeof (gpointer)); \
+ g_pointer_bit_lock ((address), (lock_bit)); \
+ }))
+
+#define g_pointer_bit_trylock(address, lock_bit) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(address) == sizeof (gpointer)); \
+ g_pointer_bit_trylock ((address), (lock_bit)); \
+ }))
+
+#define g_pointer_bit_unlock(address, lock_bit) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(address) == sizeof (gpointer)); \
+ g_pointer_bit_unlock ((address), (lock_bit)); \
+ }))
+
+#endif
+
+G_END_DECLS
+
+#endif /* __G_BITLOCK_H_ */
diff --git a/include/glib/glib/gbookmarkfile.h b/include/glib/glib/gbookmarkfile.h
new file mode 100644
index 0000000000..8dd93a1dcc
--- /dev/null
+++ b/include/glib/glib/gbookmarkfile.h
@@ -0,0 +1,254 @@
+/* gbookmarkfile.h: parsing and building desktop bookmarks
+ *
+ * Copyright (C) 2005-2006 Emmanuele Bassi
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_BOOKMARK_FILE_H__
+#define __G_BOOKMARK_FILE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+#include <time.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_BOOKMARK_FILE_ERROR:
+ *
+ * Error domain for bookmark file parsing.
+ * Errors in this domain will be from the #GBookmarkFileError
+ * enumeration. See #GError for information on error domains.
+ */
+#define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ())
+
+
+/**
+ * GBookmarkFileError:
+ * @G_BOOKMARK_FILE_ERROR_INVALID_URI: URI was ill-formed
+ * @G_BOOKMARK_FILE_ERROR_INVALID_VALUE: a requested field was not found
+ * @G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED: a requested application did
+ * not register a bookmark
+ * @G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND: a requested URI was not found
+ * @G_BOOKMARK_FILE_ERROR_READ: document was ill formed
+ * @G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING: the text being parsed was
+ * in an unknown encoding
+ * @G_BOOKMARK_FILE_ERROR_WRITE: an error occurred while writing
+ * @G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND: requested file was not found
+ *
+ * Error codes returned by bookmark file parsing.
+ */
+typedef enum
+{
+ G_BOOKMARK_FILE_ERROR_INVALID_URI,
+ G_BOOKMARK_FILE_ERROR_INVALID_VALUE,
+ G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
+ G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
+ G_BOOKMARK_FILE_ERROR_READ,
+ G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING,
+ G_BOOKMARK_FILE_ERROR_WRITE,
+ G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
+} GBookmarkFileError;
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_bookmark_file_error_quark (void);
+
+/**
+ * GBookmarkFile:
+ *
+ * The `GBookmarkFile` structure contains only
+ * private data and should not be directly accessed.
+ */
+typedef struct _GBookmarkFile GBookmarkFile;
+
+GLIB_AVAILABLE_IN_ALL
+GBookmarkFile *g_bookmark_file_new (void);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_free (GBookmarkFile *bookmark);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_load_from_file (GBookmarkFile *bookmark,
+ const gchar *filename,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_load_from_data (GBookmarkFile *bookmark,
+ const gchar *data,
+ gsize length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_load_from_data_dirs (GBookmarkFile *bookmark,
+ const gchar *file,
+ gchar **full_path,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_bookmark_file_to_data (GBookmarkFile *bookmark,
+ gsize *length,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_to_file (GBookmarkFile *bookmark,
+ const gchar *filename,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_title (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *title);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_bookmark_file_get_title (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_description (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *description);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_bookmark_file_get_description (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_mime_type (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *mime_type);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_bookmark_file_get_mime_type (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_groups (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar **groups,
+ gsize length);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_add_group (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *group);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_has_group (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *group,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_bookmark_file_get_groups (GBookmarkFile *bookmark,
+ const gchar *uri,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_add_application (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *name,
+ const gchar *exec);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_has_application (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *name,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_bookmark_file_get_applications (GBookmarkFile *bookmark,
+ const gchar *uri,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *name,
+ const gchar *exec,
+ gint count,
+ time_t stamp,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *name,
+ gchar **exec,
+ guint *count,
+ time_t *stamp,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_is_private (GBookmarkFile *bookmark,
+ const gchar *uri,
+ gboolean is_private);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_get_is_private (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_icon (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *href,
+ const gchar *mime_type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_get_icon (GBookmarkFile *bookmark,
+ const gchar *uri,
+ gchar **href,
+ gchar **mime_type,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_added (GBookmarkFile *bookmark,
+ const gchar *uri,
+ time_t added);
+GLIB_AVAILABLE_IN_ALL
+time_t g_bookmark_file_get_added (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_modified (GBookmarkFile *bookmark,
+ const gchar *uri,
+ time_t modified);
+GLIB_AVAILABLE_IN_ALL
+time_t g_bookmark_file_get_modified (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_bookmark_file_set_visited (GBookmarkFile *bookmark,
+ const gchar *uri,
+ time_t visited);
+GLIB_AVAILABLE_IN_ALL
+time_t g_bookmark_file_get_visited (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_has_item (GBookmarkFile *bookmark,
+ const gchar *uri);
+GLIB_AVAILABLE_IN_ALL
+gint g_bookmark_file_get_size (GBookmarkFile *bookmark);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_bookmark_file_get_uris (GBookmarkFile *bookmark,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_remove_group (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *group,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_remove_application (GBookmarkFile *bookmark,
+ const gchar *uri,
+ const gchar *name,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_remove_item (GBookmarkFile *bookmark,
+ const gchar *uri,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bookmark_file_move_item (GBookmarkFile *bookmark,
+ const gchar *old_uri,
+ const gchar *new_uri,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_BOOKMARK_FILE_H__ */
diff --git a/include/glib/glib/gbytes.h b/include/glib/glib/gbytes.h
new file mode 100644
index 0000000000..0bb1517b91
--- /dev/null
+++ b/include/glib/glib/gbytes.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright © 2009, 2010 Codethink Limited
+ * Copyright © 2011 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ * Stef Walter <stefw@collabora.co.uk>
+ */
+
+#ifndef __G_BYTES_H__
+#define __G_BYTES_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+#include <glib/garray.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+GBytes * g_bytes_new (gconstpointer data,
+ gsize size);
+
+GLIB_AVAILABLE_IN_ALL
+GBytes * g_bytes_new_take (gpointer data,
+ gsize size);
+
+GLIB_AVAILABLE_IN_ALL
+GBytes * g_bytes_new_static (gconstpointer data,
+ gsize size);
+
+GLIB_AVAILABLE_IN_ALL
+GBytes * g_bytes_new_with_free_func (gconstpointer data,
+ gsize size,
+ GDestroyNotify free_func,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+GBytes * g_bytes_new_from_bytes (GBytes *bytes,
+ gsize offset,
+ gsize length);
+
+GLIB_AVAILABLE_IN_ALL
+gconstpointer g_bytes_get_data (GBytes *bytes,
+ gsize *size);
+
+GLIB_AVAILABLE_IN_ALL
+gsize g_bytes_get_size (GBytes *bytes);
+
+GLIB_AVAILABLE_IN_ALL
+GBytes * g_bytes_ref (GBytes *bytes);
+
+GLIB_AVAILABLE_IN_ALL
+void g_bytes_unref (GBytes *bytes);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_bytes_unref_to_data (GBytes *bytes,
+ gsize *size);
+
+GLIB_AVAILABLE_IN_ALL
+GByteArray * g_bytes_unref_to_array (GBytes *bytes);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_bytes_hash (gconstpointer bytes);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_bytes_equal (gconstpointer bytes1,
+ gconstpointer bytes2);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_bytes_compare (gconstpointer bytes1,
+ gconstpointer bytes2);
+
+G_END_DECLS
+
+#endif /* __G_BYTES_H__ */
diff --git a/include/glib/glib/gcharset.h b/include/glib/glib/gcharset.h
new file mode 100644
index 0000000000..82020f6047
--- /dev/null
+++ b/include/glib/glib/gcharset.h
@@ -0,0 +1,47 @@
+/* gcharset.h - Charset functions
+ *
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_CHARSET_H__
+#define __G_CHARSET_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_get_charset (const char **charset);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_get_codeset (void);
+GLIB_AVAILABLE_IN_2_62
+gboolean g_get_console_charset (const char **charset);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * const * g_get_language_names (void);
+GLIB_AVAILABLE_IN_2_58
+const gchar * const * g_get_language_names_with_category
+ (const gchar *category_name);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_get_locale_variants (const gchar *locale);
+
+G_END_DECLS
+
+#endif /* __G_CHARSET_H__ */
diff --git a/include/glib/glib/gchecksum.h b/include/glib/glib/gchecksum.h
new file mode 100644
index 0000000000..599f439c1e
--- /dev/null
+++ b/include/glib/glib/gchecksum.h
@@ -0,0 +1,103 @@
+/* gchecksum.h - data hashing functions
+ *
+ * Copyright (C) 2007 Emmanuele Bassi <ebassi@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_CHECKSUM_H__
+#define __G_CHECKSUM_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+#include <glib/gbytes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GChecksumType:
+ * @G_CHECKSUM_MD5: Use the MD5 hashing algorithm
+ * @G_CHECKSUM_SHA1: Use the SHA-1 hashing algorithm
+ * @G_CHECKSUM_SHA256: Use the SHA-256 hashing algorithm
+ * @G_CHECKSUM_SHA384: Use the SHA-384 hashing algorithm (Since: 2.51)
+ * @G_CHECKSUM_SHA512: Use the SHA-512 hashing algorithm (Since: 2.36)
+ *
+ * The hashing algorithm to be used by #GChecksum when performing the
+ * digest of some data.
+ *
+ * Note that the #GChecksumType enumeration may be extended at a later
+ * date to include new hashing algorithm types.
+ *
+ * Since: 2.16
+ */
+typedef enum {
+ G_CHECKSUM_MD5,
+ G_CHECKSUM_SHA1,
+ G_CHECKSUM_SHA256,
+ G_CHECKSUM_SHA512,
+ G_CHECKSUM_SHA384
+} GChecksumType;
+
+/**
+ * GChecksum:
+ *
+ * An opaque structure representing a checksumming operation.
+ * To create a new GChecksum, use g_checksum_new(). To free
+ * a GChecksum, use g_checksum_free().
+ *
+ * Since: 2.16
+ */
+typedef struct _GChecksum GChecksum;
+
+GLIB_AVAILABLE_IN_ALL
+gssize g_checksum_type_get_length (GChecksumType checksum_type);
+
+GLIB_AVAILABLE_IN_ALL
+GChecksum * g_checksum_new (GChecksumType checksum_type);
+GLIB_AVAILABLE_IN_ALL
+void g_checksum_reset (GChecksum *checksum);
+GLIB_AVAILABLE_IN_ALL
+GChecksum * g_checksum_copy (const GChecksum *checksum);
+GLIB_AVAILABLE_IN_ALL
+void g_checksum_free (GChecksum *checksum);
+GLIB_AVAILABLE_IN_ALL
+void g_checksum_update (GChecksum *checksum,
+ const guchar *data,
+ gssize length);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_checksum_get_string (GChecksum *checksum);
+GLIB_AVAILABLE_IN_ALL
+void g_checksum_get_digest (GChecksum *checksum,
+ guint8 *buffer,
+ gsize *digest_len);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_compute_checksum_for_data (GChecksumType checksum_type,
+ const guchar *data,
+ gsize length);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_compute_checksum_for_string (GChecksumType checksum_type,
+ const gchar *str,
+ gssize length);
+
+GLIB_AVAILABLE_IN_2_34
+gchar *g_compute_checksum_for_bytes (GChecksumType checksum_type,
+ GBytes *data);
+
+G_END_DECLS
+
+#endif /* __G_CHECKSUM_H__ */
diff --git a/include/glib/glib/gconvert.h b/include/glib/glib/gconvert.h
new file mode 100644
index 0000000000..be58ecfbe1
--- /dev/null
+++ b/include/glib/glib/gconvert.h
@@ -0,0 +1,177 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_CONVERT_H__
+#define __G_CONVERT_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GConvertError:
+ * @G_CONVERT_ERROR_NO_CONVERSION: Conversion between the requested character
+ * sets is not supported.
+ * @G_CONVERT_ERROR_ILLEGAL_SEQUENCE: Invalid byte sequence in conversion input;
+ * or the character sequence could not be represented in the target
+ * character set.
+ * @G_CONVERT_ERROR_FAILED: Conversion failed for some reason.
+ * @G_CONVERT_ERROR_PARTIAL_INPUT: Partial character sequence at end of input.
+ * @G_CONVERT_ERROR_BAD_URI: URI is invalid.
+ * @G_CONVERT_ERROR_NOT_ABSOLUTE_PATH: Pathname is not an absolute path.
+ * @G_CONVERT_ERROR_NO_MEMORY: No memory available. Since: 2.40
+ * @G_CONVERT_ERROR_EMBEDDED_NUL: An embedded NUL character is present in
+ * conversion output where a NUL-terminated string is expected.
+ * Since: 2.56
+ *
+ * Error codes returned by character set conversion routines.
+ */
+typedef enum
+{
+ G_CONVERT_ERROR_NO_CONVERSION,
+ G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+ G_CONVERT_ERROR_FAILED,
+ G_CONVERT_ERROR_PARTIAL_INPUT,
+ G_CONVERT_ERROR_BAD_URI,
+ G_CONVERT_ERROR_NOT_ABSOLUTE_PATH,
+ G_CONVERT_ERROR_NO_MEMORY,
+ G_CONVERT_ERROR_EMBEDDED_NUL
+} GConvertError;
+
+/**
+ * G_CONVERT_ERROR:
+ *
+ * Error domain for character set conversions. Errors in this domain will
+ * be from the #GConvertError enumeration. See #GError for information on
+ * error domains.
+ */
+#define G_CONVERT_ERROR g_convert_error_quark()
+GLIB_AVAILABLE_IN_ALL
+GQuark g_convert_error_quark (void);
+
+/**
+ * GIConv: (skip)
+ *
+ * The GIConv struct wraps an iconv() conversion descriptor. It contains
+ * private data and should only be accessed using the following functions.
+ */
+typedef struct _GIConv *GIConv;
+
+GLIB_AVAILABLE_IN_ALL
+GIConv g_iconv_open (const gchar *to_codeset,
+ const gchar *from_codeset);
+GLIB_AVAILABLE_IN_ALL
+gsize g_iconv (GIConv converter,
+ gchar **inbuf,
+ gsize *inbytes_left,
+ gchar **outbuf,
+ gsize *outbytes_left);
+GLIB_AVAILABLE_IN_ALL
+gint g_iconv_close (GIConv converter);
+
+
+GLIB_AVAILABLE_IN_ALL
+gchar* g_convert (const gchar *str,
+ gssize len,
+ const gchar *to_codeset,
+ const gchar *from_codeset,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_convert_with_iconv (const gchar *str,
+ gssize len,
+ GIConv converter,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_convert_with_fallback (const gchar *str,
+ gssize len,
+ const gchar *to_codeset,
+ const gchar *from_codeset,
+ const gchar *fallback,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error) G_GNUC_MALLOC;
+
+
+/* Convert between libc's idea of strings and UTF-8.
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_locale_to_utf8 (const gchar *opsysstring,
+ gssize len,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_locale_from_utf8 (const gchar *utf8string,
+ gssize len,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error) G_GNUC_MALLOC;
+
+/* Convert between the operating system (or C runtime)
+ * representation of file names and UTF-8.
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_filename_to_utf8 (const gchar *opsysstring,
+ gssize len,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_filename_from_utf8 (const gchar *utf8string,
+ gssize len,
+ gsize *bytes_read,
+ gsize *bytes_written,
+ GError **error) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_filename_from_uri (const gchar *uri,
+ gchar **hostname,
+ GError **error) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_filename_to_uri (const gchar *filename,
+ const gchar *hostname,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_filename_display_name (const gchar *filename) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_get_filename_charsets (const gchar ***filename_charsets);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_filename_display_basename (const gchar *filename) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gchar **g_uri_list_extract_uris (const gchar *uri_list);
+
+G_END_DECLS
+
+#endif /* __G_CONVERT_H__ */
diff --git a/include/glib/glib/gdataset.h b/include/glib/glib/gdataset.h
new file mode 100644
index 0000000000..89a34c71af
--- /dev/null
+++ b/include/glib/glib/gdataset.h
@@ -0,0 +1,150 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_DATASET_H__
+#define __G_DATASET_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gquark.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GData GData;
+
+typedef void (*GDataForeachFunc) (GQuark key_id,
+ gpointer data,
+ gpointer user_data);
+
+/* Keyed Data List
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_datalist_init (GData **datalist);
+GLIB_AVAILABLE_IN_ALL
+void g_datalist_clear (GData **datalist);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_datalist_id_get_data (GData **datalist,
+ GQuark key_id);
+GLIB_AVAILABLE_IN_ALL
+void g_datalist_id_set_data_full (GData **datalist,
+ GQuark key_id,
+ gpointer data,
+ GDestroyNotify destroy_func);
+
+typedef gpointer (*GDuplicateFunc) (gpointer data, gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_34
+gpointer g_datalist_id_dup_data (GData **datalist,
+ GQuark key_id,
+ GDuplicateFunc dup_func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_datalist_id_replace_data (GData **datalist,
+ GQuark key_id,
+ gpointer oldval,
+ gpointer newval,
+ GDestroyNotify destroy,
+ GDestroyNotify *old_destroy);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_datalist_id_remove_no_notify (GData **datalist,
+ GQuark key_id);
+GLIB_AVAILABLE_IN_ALL
+void g_datalist_foreach (GData **datalist,
+ GDataForeachFunc func,
+ gpointer user_data);
+
+/**
+ * G_DATALIST_FLAGS_MASK:
+ *
+ * A bitmask that restricts the possible flags passed to
+ * g_datalist_set_flags(). Passing a flags value where
+ * flags & ~G_DATALIST_FLAGS_MASK != 0 is an error.
+ */
+#define G_DATALIST_FLAGS_MASK 0x3
+
+GLIB_AVAILABLE_IN_ALL
+void g_datalist_set_flags (GData **datalist,
+ guint flags);
+GLIB_AVAILABLE_IN_ALL
+void g_datalist_unset_flags (GData **datalist,
+ guint flags);
+GLIB_AVAILABLE_IN_ALL
+guint g_datalist_get_flags (GData **datalist);
+
+#define g_datalist_id_set_data(dl, q, d) \
+ g_datalist_id_set_data_full ((dl), (q), (d), NULL)
+#define g_datalist_id_remove_data(dl, q) \
+ g_datalist_id_set_data ((dl), (q), NULL)
+#define g_datalist_set_data_full(dl, k, d, f) \
+ g_datalist_id_set_data_full ((dl), g_quark_from_string (k), (d), (f))
+#define g_datalist_remove_no_notify(dl, k) \
+ g_datalist_id_remove_no_notify ((dl), g_quark_try_string (k))
+#define g_datalist_set_data(dl, k, d) \
+ g_datalist_set_data_full ((dl), (k), (d), NULL)
+#define g_datalist_remove_data(dl, k) \
+ g_datalist_id_set_data ((dl), g_quark_try_string (k), NULL)
+
+/* Location Associated Keyed Data
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_dataset_destroy (gconstpointer dataset_location);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_dataset_id_get_data (gconstpointer dataset_location,
+ GQuark key_id);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_datalist_get_data (GData **datalist,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+void g_dataset_id_set_data_full (gconstpointer dataset_location,
+ GQuark key_id,
+ gpointer data,
+ GDestroyNotify destroy_func);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_dataset_id_remove_no_notify (gconstpointer dataset_location,
+ GQuark key_id);
+GLIB_AVAILABLE_IN_ALL
+void g_dataset_foreach (gconstpointer dataset_location,
+ GDataForeachFunc func,
+ gpointer user_data);
+#define g_dataset_id_set_data(l, k, d) \
+ g_dataset_id_set_data_full ((l), (k), (d), NULL)
+#define g_dataset_id_remove_data(l, k) \
+ g_dataset_id_set_data ((l), (k), NULL)
+#define g_dataset_get_data(l, k) \
+ (g_dataset_id_get_data ((l), g_quark_try_string (k)))
+#define g_dataset_set_data_full(l, k, d, f) \
+ g_dataset_id_set_data_full ((l), g_quark_from_string (k), (d), (f))
+#define g_dataset_remove_no_notify(l, k) \
+ g_dataset_id_remove_no_notify ((l), g_quark_try_string (k))
+#define g_dataset_set_data(l, k, d) \
+ g_dataset_set_data_full ((l), (k), (d), NULL)
+#define g_dataset_remove_data(l, k) \
+ g_dataset_id_set_data ((l), g_quark_try_string (k), NULL)
+
+G_END_DECLS
+
+#endif /* __G_DATASET_H__ */
diff --git a/include/glib/glib/gdate.h b/include/glib/glib/gdate.h
new file mode 100644
index 0000000000..3bc07bf5c3
--- /dev/null
+++ b/include/glib/glib/gdate.h
@@ -0,0 +1,307 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_DATE_H__
+#define __G_DATE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <time.h>
+
+#include <glib/gtypes.h>
+#include <glib/gquark.h>
+
+G_BEGIN_DECLS
+
+/* GDate
+ *
+ * Date calculations (not time for now, to be resolved). These are a
+ * mutant combination of Steffen Beyer's DateCalc routines
+ * (http://www.perl.com/CPAN/authors/id/STBEY/) and Jon Trowbridge's
+ * date routines (written for in-house software). Written by Havoc
+ * Pennington <hp@pobox.com>
+ */
+
+typedef gint32 GTime GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
+typedef guint16 GDateYear;
+typedef guint8 GDateDay; /* day of the month */
+typedef struct _GDate GDate;
+
+/* enum used to specify order of appearance in parsed date strings */
+typedef enum
+{
+ G_DATE_DAY = 0,
+ G_DATE_MONTH = 1,
+ G_DATE_YEAR = 2
+} GDateDMY;
+
+/* actual week and month values */
+typedef enum
+{
+ G_DATE_BAD_WEEKDAY = 0,
+ G_DATE_MONDAY = 1,
+ G_DATE_TUESDAY = 2,
+ G_DATE_WEDNESDAY = 3,
+ G_DATE_THURSDAY = 4,
+ G_DATE_FRIDAY = 5,
+ G_DATE_SATURDAY = 6,
+ G_DATE_SUNDAY = 7
+} GDateWeekday;
+typedef enum
+{
+ G_DATE_BAD_MONTH = 0,
+ G_DATE_JANUARY = 1,
+ G_DATE_FEBRUARY = 2,
+ G_DATE_MARCH = 3,
+ G_DATE_APRIL = 4,
+ G_DATE_MAY = 5,
+ G_DATE_JUNE = 6,
+ G_DATE_JULY = 7,
+ G_DATE_AUGUST = 8,
+ G_DATE_SEPTEMBER = 9,
+ G_DATE_OCTOBER = 10,
+ G_DATE_NOVEMBER = 11,
+ G_DATE_DECEMBER = 12
+} GDateMonth;
+
+#define G_DATE_BAD_JULIAN 0U
+#define G_DATE_BAD_DAY 0U
+#define G_DATE_BAD_YEAR 0U
+
+/* Note: directly manipulating structs is generally a bad idea, but
+ * in this case it's an *incredibly* bad idea, because all or part
+ * of this struct can be invalid at any given time. Use the functions,
+ * or you will get hosed, I promise.
+ */
+struct _GDate
+{
+ guint julian_days : 32; /* julian days representation - we use a
+ * bitfield hoping that 64 bit platforms
+ * will pack this whole struct in one big
+ * int
+ */
+
+ guint julian : 1; /* julian is valid */
+ guint dmy : 1; /* dmy is valid */
+
+ /* DMY representation */
+ guint day : 6;
+ guint month : 4;
+ guint year : 16;
+};
+
+/* g_date_new() returns an invalid date, you then have to _set() stuff
+ * to get a usable object. You can also allocate a GDate statically,
+ * then call g_date_clear() to initialize.
+ */
+GLIB_AVAILABLE_IN_ALL
+GDate* g_date_new (void);
+GLIB_AVAILABLE_IN_ALL
+GDate* g_date_new_dmy (GDateDay day,
+ GDateMonth month,
+ GDateYear year);
+GLIB_AVAILABLE_IN_ALL
+GDate* g_date_new_julian (guint32 julian_day);
+GLIB_AVAILABLE_IN_ALL
+void g_date_free (GDate *date);
+GLIB_AVAILABLE_IN_2_56
+GDate* g_date_copy (const GDate *date);
+
+/* check g_date_valid() after doing an operation that might fail, like
+ * _parse. Almost all g_date operations are undefined on invalid
+ * dates (the exceptions are the mutators, since you need those to
+ * return to validity).
+ */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_valid (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_valid_day (GDateDay day) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_valid_month (GDateMonth month) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_valid_year (GDateYear year) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_valid_weekday (GDateWeekday weekday) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_valid_julian (guint32 julian_date) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_valid_dmy (GDateDay day,
+ GDateMonth month,
+ GDateYear year) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GDateWeekday g_date_get_weekday (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+GDateMonth g_date_get_month (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+GDateYear g_date_get_year (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+GDateDay g_date_get_day (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+guint32 g_date_get_julian (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+guint g_date_get_day_of_year (const GDate *date);
+/* First monday/sunday is the start of week 1; if we haven't reached
+ * that day, return 0. These are not ISO weeks of the year; that
+ * routine needs to be added.
+ * these functions return the number of weeks, starting on the
+ * corrsponding day
+ */
+GLIB_AVAILABLE_IN_ALL
+guint g_date_get_monday_week_of_year (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+guint g_date_get_sunday_week_of_year (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+guint g_date_get_iso8601_week_of_year (const GDate *date);
+
+/* If you create a static date struct you need to clear it to get it
+ * in a sane state before use. You can clear a whole array at
+ * once with the ndates argument.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_date_clear (GDate *date,
+ guint n_dates);
+
+/* The parse routine is meant for dates typed in by a user, so it
+ * permits many formats but tries to catch common typos. If your data
+ * needs to be strictly validated, it is not an appropriate function.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_date_set_parse (GDate *date,
+ const gchar *str);
+GLIB_AVAILABLE_IN_ALL
+void g_date_set_time_t (GDate *date,
+ time_t timet);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62_FOR(g_date_set_time_t)
+void g_date_set_time_val (GDate *date,
+ GTimeVal *timeval);
+GLIB_DEPRECATED_FOR(g_date_set_time_t)
+void g_date_set_time (GDate *date,
+ GTime time_);
+G_GNUC_END_IGNORE_DEPRECATIONS
+GLIB_AVAILABLE_IN_ALL
+void g_date_set_month (GDate *date,
+ GDateMonth month);
+GLIB_AVAILABLE_IN_ALL
+void g_date_set_day (GDate *date,
+ GDateDay day);
+GLIB_AVAILABLE_IN_ALL
+void g_date_set_year (GDate *date,
+ GDateYear year);
+GLIB_AVAILABLE_IN_ALL
+void g_date_set_dmy (GDate *date,
+ GDateDay day,
+ GDateMonth month,
+ GDateYear y);
+GLIB_AVAILABLE_IN_ALL
+void g_date_set_julian (GDate *date,
+ guint32 julian_date);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_is_first_of_month (const GDate *date);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_is_last_of_month (const GDate *date);
+
+/* To go forward by some number of weeks just go forward weeks*7 days */
+GLIB_AVAILABLE_IN_ALL
+void g_date_add_days (GDate *date,
+ guint n_days);
+GLIB_AVAILABLE_IN_ALL
+void g_date_subtract_days (GDate *date,
+ guint n_days);
+
+/* If you add/sub months while day > 28, the day might change */
+GLIB_AVAILABLE_IN_ALL
+void g_date_add_months (GDate *date,
+ guint n_months);
+GLIB_AVAILABLE_IN_ALL
+void g_date_subtract_months (GDate *date,
+ guint n_months);
+
+/* If it's feb 29, changing years can move you to the 28th */
+GLIB_AVAILABLE_IN_ALL
+void g_date_add_years (GDate *date,
+ guint n_years);
+GLIB_AVAILABLE_IN_ALL
+void g_date_subtract_years (GDate *date,
+ guint n_years);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_is_leap_year (GDateYear year) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+guint8 g_date_get_days_in_month (GDateMonth month,
+ GDateYear year) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+guint8 g_date_get_monday_weeks_in_year (GDateYear year) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+guint8 g_date_get_sunday_weeks_in_year (GDateYear year) G_GNUC_CONST;
+
+/* Returns the number of days between the two dates. If date2 comes
+ before date1, a negative value is return. */
+GLIB_AVAILABLE_IN_ALL
+gint g_date_days_between (const GDate *date1,
+ const GDate *date2);
+
+/* qsort-friendly (with a cast...) */
+GLIB_AVAILABLE_IN_ALL
+gint g_date_compare (const GDate *lhs,
+ const GDate *rhs);
+GLIB_AVAILABLE_IN_ALL
+void g_date_to_struct_tm (const GDate *date,
+ struct tm *tm);
+
+GLIB_AVAILABLE_IN_ALL
+void g_date_clamp (GDate *date,
+ const GDate *min_date,
+ const GDate *max_date);
+
+/* Swap date1 and date2's values if date1 > date2. */
+GLIB_AVAILABLE_IN_ALL
+void g_date_order (GDate *date1, GDate *date2);
+
+/* Just like strftime() except you can only use date-related formats.
+ * Using a time format is undefined.
+ */
+GLIB_AVAILABLE_IN_ALL
+gsize g_date_strftime (gchar *s,
+ gsize slen,
+ const gchar *format,
+ const GDate *date);
+
+#define g_date_weekday g_date_get_weekday GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_weekday)
+#define g_date_month g_date_get_month GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_month)
+#define g_date_year g_date_get_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_year)
+#define g_date_day g_date_get_day GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_day)
+#define g_date_julian g_date_get_julian GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_julian)
+#define g_date_day_of_year g_date_get_day_of_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_day_of_year)
+#define g_date_monday_week_of_year g_date_get_monday_week_of_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_monday_week_of_year)
+#define g_date_sunday_week_of_year g_date_get_sunday_week_of_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_sunday_week_of_year)
+#define g_date_days_in_month g_date_get_days_in_month GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_days_in_month)
+#define g_date_monday_weeks_in_year g_date_get_monday_weeks_in_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_monday_weeks_in_year)
+#define g_date_sunday_weeks_in_year g_date_get_sunday_weeks_in_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_sunday_weeks_in_year)
+
+G_END_DECLS
+
+#endif /* __G_DATE_H__ */
diff --git a/include/glib/glib/gdatetime.h b/include/glib/glib/gdatetime.h
new file mode 100644
index 0000000000..fa43d85314
--- /dev/null
+++ b/include/glib/glib/gdatetime.h
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2009-2010 Christian Hergert <chris@dronelabs.com>
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * licence, or (at your option) any later version.
+ *
+ * This is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Christian Hergert <chris@dronelabs.com>
+ * Thiago Santos <thiago.sousa.santos@collabora.co.uk>
+ * Emmanuele Bassi <ebassi@linux.intel.com>
+ * Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_DATE_TIME_H__
+#define __G_DATE_TIME_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtimezone.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_TIME_SPAN_DAY:
+ *
+ * Evaluates to a time span of one day.
+ *
+ * Since: 2.26
+ */
+#define G_TIME_SPAN_DAY (G_GINT64_CONSTANT (86400000000))
+
+/**
+ * G_TIME_SPAN_HOUR:
+ *
+ * Evaluates to a time span of one hour.
+ *
+ * Since: 2.26
+ */
+#define G_TIME_SPAN_HOUR (G_GINT64_CONSTANT (3600000000))
+
+/**
+ * G_TIME_SPAN_MINUTE:
+ *
+ * Evaluates to a time span of one minute.
+ *
+ * Since: 2.26
+ */
+#define G_TIME_SPAN_MINUTE (G_GINT64_CONSTANT (60000000))
+
+/**
+ * G_TIME_SPAN_SECOND:
+ *
+ * Evaluates to a time span of one second.
+ *
+ * Since: 2.26
+ */
+#define G_TIME_SPAN_SECOND (G_GINT64_CONSTANT (1000000))
+
+/**
+ * G_TIME_SPAN_MILLISECOND:
+ *
+ * Evaluates to a time span of one millisecond.
+ *
+ * Since: 2.26
+ */
+#define G_TIME_SPAN_MILLISECOND (G_GINT64_CONSTANT (1000))
+
+/**
+ * GTimeSpan:
+ *
+ * A value representing an interval of time, in microseconds.
+ *
+ * Since: 2.26
+ */
+typedef gint64 GTimeSpan;
+
+/**
+ * GDateTime:
+ *
+ * `GDateTime` is an opaque structure whose members
+ * cannot be accessed directly.
+ *
+ * Since: 2.26
+ */
+typedef struct _GDateTime GDateTime;
+
+GLIB_AVAILABLE_IN_ALL
+void g_date_time_unref (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_ref (GDateTime *datetime);
+
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new_now (GTimeZone *tz);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new_now_local (void);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new_now_utc (void);
+
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new_from_unix_local (gint64 t);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new_from_unix_utc (gint64 t);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62_FOR(g_date_time_new_from_unix_local)
+GDateTime * g_date_time_new_from_timeval_local (const GTimeVal *tv);
+GLIB_DEPRECATED_IN_2_62_FOR(g_date_time_new_from_unix_utc)
+GDateTime * g_date_time_new_from_timeval_utc (const GTimeVal *tv);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_2_56
+GDateTime * g_date_time_new_from_iso8601 (const gchar *text,
+ GTimeZone *default_tz);
+
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new (GTimeZone *tz,
+ gint year,
+ gint month,
+ gint day,
+ gint hour,
+ gint minute,
+ gdouble seconds);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new_local (gint year,
+ gint month,
+ gint day,
+ gint hour,
+ gint minute,
+ gdouble seconds);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_new_utc (gint year,
+ gint month,
+ gint day,
+ gint hour,
+ gint minute,
+ gdouble seconds);
+
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add (GDateTime *datetime,
+ GTimeSpan timespan);
+
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_years (GDateTime *datetime,
+ gint years);
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_months (GDateTime *datetime,
+ gint months);
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_weeks (GDateTime *datetime,
+ gint weeks);
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_days (GDateTime *datetime,
+ gint days);
+
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_hours (GDateTime *datetime,
+ gint hours);
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_minutes (GDateTime *datetime,
+ gint minutes);
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_seconds (GDateTime *datetime,
+ gdouble seconds);
+
+GLIB_AVAILABLE_IN_ALL
+G_GNUC_WARN_UNUSED_RESULT
+GDateTime * g_date_time_add_full (GDateTime *datetime,
+ gint years,
+ gint months,
+ gint days,
+ gint hours,
+ gint minutes,
+ gdouble seconds);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_compare (gconstpointer dt1,
+ gconstpointer dt2);
+GLIB_AVAILABLE_IN_ALL
+GTimeSpan g_date_time_difference (GDateTime *end,
+ GDateTime *begin);
+GLIB_AVAILABLE_IN_ALL
+guint g_date_time_hash (gconstpointer datetime);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_time_equal (gconstpointer dt1,
+ gconstpointer dt2);
+
+GLIB_AVAILABLE_IN_ALL
+void g_date_time_get_ymd (GDateTime *datetime,
+ gint *year,
+ gint *month,
+ gint *day);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_year (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_month (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_day_of_month (GDateTime *datetime);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_week_numbering_year (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_week_of_year (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_day_of_week (GDateTime *datetime);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_day_of_year (GDateTime *datetime);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_hour (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_minute (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_second (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gint g_date_time_get_microsecond (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_date_time_get_seconds (GDateTime *datetime);
+
+GLIB_AVAILABLE_IN_ALL
+gint64 g_date_time_to_unix (GDateTime *datetime);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62_FOR(g_date_time_to_unix)
+gboolean g_date_time_to_timeval (GDateTime *datetime,
+ GTimeVal *tv);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_ALL
+GTimeSpan g_date_time_get_utc_offset (GDateTime *datetime);
+GLIB_AVAILABLE_IN_2_58
+GTimeZone * g_date_time_get_timezone (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_date_time_get_timezone_abbreviation (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_date_time_is_daylight_savings (GDateTime *datetime);
+
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_to_timezone (GDateTime *datetime,
+ GTimeZone *tz);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_to_local (GDateTime *datetime);
+GLIB_AVAILABLE_IN_ALL
+GDateTime * g_date_time_to_utc (GDateTime *datetime);
+
+GLIB_AVAILABLE_IN_ALL
+gchar * g_date_time_format (GDateTime *datetime,
+ const gchar *format) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_2_62
+gchar * g_date_time_format_iso8601 (GDateTime *datetime) G_GNUC_MALLOC;
+
+G_END_DECLS
+
+#endif /* __G_DATE_TIME_H__ */
diff --git a/include/glib/glib/gdir.h b/include/glib/glib/gdir.h
new file mode 100644
index 0000000000..8f9d6bd7cc
--- /dev/null
+++ b/include/glib/glib/gdir.h
@@ -0,0 +1,52 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * gdir.c: Simplified wrapper around the DIRENT functions.
+ *
+ * Copyright 2001 Hans Breuer
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_DIR_H__
+#define __G_DIR_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+
+#ifdef G_OS_UNIX
+#include <dirent.h>
+#endif
+
+G_BEGIN_DECLS
+
+typedef struct _GDir GDir;
+
+GLIB_AVAILABLE_IN_ALL
+GDir * g_dir_open (const gchar *path,
+ guint flags,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_dir_read_name (GDir *dir);
+GLIB_AVAILABLE_IN_ALL
+void g_dir_rewind (GDir *dir);
+GLIB_AVAILABLE_IN_ALL
+void g_dir_close (GDir *dir);
+
+G_END_DECLS
+
+#endif /* __G_DIR_H__ */
diff --git a/include/glib/glib/genviron.h b/include/glib/glib/genviron.h
new file mode 100644
index 0000000000..c4bf01a5ab
--- /dev/null
+++ b/include/glib/glib/genviron.h
@@ -0,0 +1,63 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_ENVIRON_H__
+#define __G_ENVIRON_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_getenv (const gchar *variable);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_setenv (const gchar *variable,
+ const gchar *value,
+ gboolean overwrite);
+GLIB_AVAILABLE_IN_ALL
+void g_unsetenv (const gchar *variable);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_listenv (void);
+
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_get_environ (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_environ_getenv (gchar **envp,
+ const gchar *variable);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_environ_setenv (gchar **envp,
+ const gchar *variable,
+ const gchar *value,
+ gboolean overwrite) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_environ_unsetenv (gchar **envp,
+ const gchar *variable) G_GNUC_WARN_UNUSED_RESULT;
+
+G_END_DECLS
+
+#endif /* __G_ENVIRON_H__ */
diff --git a/include/glib/glib/gerror.h b/include/glib/glib/gerror.h
new file mode 100644
index 0000000000..8ecff04e16
--- /dev/null
+++ b/include/glib/glib/gerror.h
@@ -0,0 +1,117 @@
+/* gerror.h - Error reporting system
+ *
+ * Copyright 2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_ERROR_H__
+#define __G_ERROR_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <stdarg.h>
+
+#include <glib/gquark.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GError:
+ * @domain: error domain, e.g. #G_FILE_ERROR
+ * @code: error code, e.g. %G_FILE_ERROR_NOENT
+ * @message: human-readable informative error message
+ *
+ * The `GError` structure contains information about
+ * an error that has occurred.
+ */
+typedef struct _GError GError;
+
+struct _GError
+{
+ GQuark domain;
+ gint code;
+ gchar *message;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GError* g_error_new (GQuark domain,
+ gint code,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (3, 4);
+
+GLIB_AVAILABLE_IN_ALL
+GError* g_error_new_literal (GQuark domain,
+ gint code,
+ const gchar *message);
+GLIB_AVAILABLE_IN_ALL
+GError* g_error_new_valist (GQuark domain,
+ gint code,
+ const gchar *format,
+ va_list args) G_GNUC_PRINTF(3, 0);
+
+GLIB_AVAILABLE_IN_ALL
+void g_error_free (GError *error);
+GLIB_AVAILABLE_IN_ALL
+GError* g_error_copy (const GError *error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_error_matches (const GError *error,
+ GQuark domain,
+ gint code);
+
+/* if (err) *err = g_error_new(domain, code, format, ...), also has
+ * some sanity checks.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_set_error (GError **err,
+ GQuark domain,
+ gint code,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (4, 5);
+
+GLIB_AVAILABLE_IN_ALL
+void g_set_error_literal (GError **err,
+ GQuark domain,
+ gint code,
+ const gchar *message);
+
+/* if (dest) *dest = src; also has some sanity checks.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_propagate_error (GError **dest,
+ GError *src);
+
+/* if (err && *err) { g_error_free(*err); *err = NULL; } */
+GLIB_AVAILABLE_IN_ALL
+void g_clear_error (GError **err);
+
+/* if (err) prefix the formatted string to the ->message */
+GLIB_AVAILABLE_IN_ALL
+void g_prefix_error (GError **err,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (2, 3);
+
+/* g_propagate_error then g_error_prefix on dest */
+GLIB_AVAILABLE_IN_ALL
+void g_propagate_prefixed_error (GError **dest,
+ GError *src,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (3, 4);
+
+G_END_DECLS
+
+#endif /* __G_ERROR_H__ */
diff --git a/include/glib/glib/gfileutils.h b/include/glib/glib/gfileutils.h
new file mode 100644
index 0000000000..f60fad8584
--- /dev/null
+++ b/include/glib/glib/gfileutils.h
@@ -0,0 +1,179 @@
+/* gfileutils.h - File utility functions
+ *
+ * Copyright 2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_FILEUTILS_H__
+#define __G_FILEUTILS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glibconfig.h>
+#include <glib/gerror.h>
+
+G_BEGIN_DECLS
+
+#define G_FILE_ERROR g_file_error_quark ()
+
+typedef enum
+{
+ G_FILE_ERROR_EXIST,
+ G_FILE_ERROR_ISDIR,
+ G_FILE_ERROR_ACCES,
+ G_FILE_ERROR_NAMETOOLONG,
+ G_FILE_ERROR_NOENT,
+ G_FILE_ERROR_NOTDIR,
+ G_FILE_ERROR_NXIO,
+ G_FILE_ERROR_NODEV,
+ G_FILE_ERROR_ROFS,
+ G_FILE_ERROR_TXTBSY,
+ G_FILE_ERROR_FAULT,
+ G_FILE_ERROR_LOOP,
+ G_FILE_ERROR_NOSPC,
+ G_FILE_ERROR_NOMEM,
+ G_FILE_ERROR_MFILE,
+ G_FILE_ERROR_NFILE,
+ G_FILE_ERROR_BADF,
+ G_FILE_ERROR_INVAL,
+ G_FILE_ERROR_PIPE,
+ G_FILE_ERROR_AGAIN,
+ G_FILE_ERROR_INTR,
+ G_FILE_ERROR_IO,
+ G_FILE_ERROR_PERM,
+ G_FILE_ERROR_NOSYS,
+ G_FILE_ERROR_FAILED
+} GFileError;
+
+/* For backward-compat reasons, these are synced to an old
+ * anonymous enum in libgnome. But don't use that enum
+ * in new code.
+ */
+typedef enum
+{
+ G_FILE_TEST_IS_REGULAR = 1 << 0,
+ G_FILE_TEST_IS_SYMLINK = 1 << 1,
+ G_FILE_TEST_IS_DIR = 1 << 2,
+ G_FILE_TEST_IS_EXECUTABLE = 1 << 3,
+ G_FILE_TEST_EXISTS = 1 << 4
+} GFileTest;
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_file_error_quark (void);
+/* So other code can generate a GFileError */
+GLIB_AVAILABLE_IN_ALL
+GFileError g_file_error_from_errno (gint err_no);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_test (const gchar *filename,
+ GFileTest test);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_get_contents (const gchar *filename,
+ gchar **contents,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_file_set_contents (const gchar *filename,
+ const gchar *contents,
+ gssize length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_file_read_link (const gchar *filename,
+ GError **error);
+
+/* Wrapper / workalike for mkdtemp() */
+GLIB_AVAILABLE_IN_2_30
+gchar *g_mkdtemp (gchar *tmpl);
+GLIB_AVAILABLE_IN_2_30
+gchar *g_mkdtemp_full (gchar *tmpl,
+ gint mode);
+
+/* Wrapper / workalike for mkstemp() */
+GLIB_AVAILABLE_IN_ALL
+gint g_mkstemp (gchar *tmpl);
+GLIB_AVAILABLE_IN_ALL
+gint g_mkstemp_full (gchar *tmpl,
+ gint flags,
+ gint mode);
+
+/* Wrappers for g_mkstemp and g_mkdtemp() */
+GLIB_AVAILABLE_IN_ALL
+gint g_file_open_tmp (const gchar *tmpl,
+ gchar **name_used,
+ GError **error);
+GLIB_AVAILABLE_IN_2_30
+gchar *g_dir_make_tmp (const gchar *tmpl,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_build_path (const gchar *separator,
+ const gchar *first_element,
+ ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_build_pathv (const gchar *separator,
+ gchar **args) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_build_filename (const gchar *first_element,
+ ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_build_filenamev (gchar **args) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_2_56
+gchar *g_build_filename_valist (const gchar *first_element,
+ va_list *args) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gint g_mkdir_with_parents (const gchar *pathname,
+ gint mode);
+
+#ifdef G_OS_WIN32
+
+/* On Win32, the canonical directory separator is the backslash, and
+ * the search path separator is the semicolon. Note that also the
+ * (forward) slash works as directory separator.
+ */
+#define G_IS_DIR_SEPARATOR(c) ((c) == G_DIR_SEPARATOR || (c) == '/')
+
+#else /* !G_OS_WIN32 */
+
+#define G_IS_DIR_SEPARATOR(c) ((c) == G_DIR_SEPARATOR)
+
+#endif /* !G_OS_WIN32 */
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_path_is_absolute (const gchar *file_name);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_path_skip_root (const gchar *file_name);
+
+GLIB_DEPRECATED_FOR(g_path_get_basename)
+const gchar *g_basename (const gchar *file_name);
+#define g_dirname g_path_get_dirname GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_path_get_dirname)
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_get_current_dir (void);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_path_get_basename (const gchar *file_name) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_path_get_dirname (const gchar *file_name) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_2_58
+gchar *g_canonicalize_filename (const gchar *filename,
+ const gchar *relative_to) G_GNUC_MALLOC;
+
+G_END_DECLS
+
+#endif /* __G_FILEUTILS_H__ */
diff --git a/include/glib/glib/ggettext.h b/include/glib/glib/ggettext.h
new file mode 100644
index 0000000000..036f9d5348
--- /dev/null
+++ b/include/glib/glib/ggettext.h
@@ -0,0 +1,63 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_GETTEXT_H__
+#define __G_GETTEXT_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_strip_context (const gchar *msgid,
+ const gchar *msgval) G_GNUC_FORMAT(1);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dgettext (const gchar *domain,
+ const gchar *msgid) G_GNUC_FORMAT(2);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dcgettext (const gchar *domain,
+ const gchar *msgid,
+ gint category) G_GNUC_FORMAT(2);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dngettext (const gchar *domain,
+ const gchar *msgid,
+ const gchar *msgid_plural,
+ gulong n) G_GNUC_FORMAT(3);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dpgettext (const gchar *domain,
+ const gchar *msgctxtid,
+ gsize msgidoffset) G_GNUC_FORMAT(2);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_dpgettext2 (const gchar *domain,
+ const gchar *context,
+ const gchar *msgid) G_GNUC_FORMAT(3);
+
+G_END_DECLS
+
+#endif /* __G_GETTEXT_H__ */
diff --git a/include/glib/glib/ghash.h b/include/glib/glib/ghash.h
new file mode 100644
index 0000000000..e9ce64505f
--- /dev/null
+++ b/include/glib/glib/ghash.h
@@ -0,0 +1,188 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_HASH_H__
+#define __G_HASH_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+#include <glib/glist.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GHashTable GHashTable;
+
+typedef gboolean (*GHRFunc) (gpointer key,
+ gpointer value,
+ gpointer user_data);
+
+typedef struct _GHashTableIter GHashTableIter;
+
+struct _GHashTableIter
+{
+ /*< private >*/
+ gpointer dummy1;
+ gpointer dummy2;
+ gpointer dummy3;
+ int dummy4;
+ gboolean dummy5;
+ gpointer dummy6;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GHashTable* g_hash_table_new (GHashFunc hash_func,
+ GEqualFunc key_equal_func);
+GLIB_AVAILABLE_IN_ALL
+GHashTable* g_hash_table_new_full (GHashFunc hash_func,
+ GEqualFunc key_equal_func,
+ GDestroyNotify key_destroy_func,
+ GDestroyNotify value_destroy_func);
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_destroy (GHashTable *hash_table);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_insert (GHashTable *hash_table,
+ gpointer key,
+ gpointer value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_replace (GHashTable *hash_table,
+ gpointer key,
+ gpointer value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_add (GHashTable *hash_table,
+ gpointer key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_remove (GHashTable *hash_table,
+ gconstpointer key);
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_remove_all (GHashTable *hash_table);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_steal (GHashTable *hash_table,
+ gconstpointer key);
+GLIB_AVAILABLE_IN_2_58
+gboolean g_hash_table_steal_extended (GHashTable *hash_table,
+ gconstpointer lookup_key,
+ gpointer *stolen_key,
+ gpointer *stolen_value);
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_steal_all (GHashTable *hash_table);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_hash_table_lookup (GHashTable *hash_table,
+ gconstpointer key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_contains (GHashTable *hash_table,
+ gconstpointer key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_lookup_extended (GHashTable *hash_table,
+ gconstpointer lookup_key,
+ gpointer *orig_key,
+ gpointer *value);
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_foreach (GHashTable *hash_table,
+ GHFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_hash_table_find (GHashTable *hash_table,
+ GHRFunc predicate,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+guint g_hash_table_foreach_remove (GHashTable *hash_table,
+ GHRFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+guint g_hash_table_foreach_steal (GHashTable *hash_table,
+ GHRFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+guint g_hash_table_size (GHashTable *hash_table);
+GLIB_AVAILABLE_IN_ALL
+GList * g_hash_table_get_keys (GHashTable *hash_table);
+GLIB_AVAILABLE_IN_ALL
+GList * g_hash_table_get_values (GHashTable *hash_table);
+GLIB_AVAILABLE_IN_2_40
+gpointer * g_hash_table_get_keys_as_array (GHashTable *hash_table,
+ guint *length);
+
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_iter_init (GHashTableIter *iter,
+ GHashTable *hash_table);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hash_table_iter_next (GHashTableIter *iter,
+ gpointer *key,
+ gpointer *value);
+GLIB_AVAILABLE_IN_ALL
+GHashTable* g_hash_table_iter_get_hash_table (GHashTableIter *iter);
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_iter_remove (GHashTableIter *iter);
+GLIB_AVAILABLE_IN_2_30
+void g_hash_table_iter_replace (GHashTableIter *iter,
+ gpointer value);
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_iter_steal (GHashTableIter *iter);
+
+GLIB_AVAILABLE_IN_ALL
+GHashTable* g_hash_table_ref (GHashTable *hash_table);
+GLIB_AVAILABLE_IN_ALL
+void g_hash_table_unref (GHashTable *hash_table);
+
+#define g_hash_table_freeze(hash_table) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26
+#define g_hash_table_thaw(hash_table) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26
+
+/* Hash Functions
+ */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_str_equal (gconstpointer v1,
+ gconstpointer v2);
+GLIB_AVAILABLE_IN_ALL
+guint g_str_hash (gconstpointer v);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_int_equal (gconstpointer v1,
+ gconstpointer v2);
+GLIB_AVAILABLE_IN_ALL
+guint g_int_hash (gconstpointer v);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_int64_equal (gconstpointer v1,
+ gconstpointer v2);
+GLIB_AVAILABLE_IN_ALL
+guint g_int64_hash (gconstpointer v);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_double_equal (gconstpointer v1,
+ gconstpointer v2);
+GLIB_AVAILABLE_IN_ALL
+guint g_double_hash (gconstpointer v);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_direct_hash (gconstpointer v) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_direct_equal (gconstpointer v1,
+ gconstpointer v2) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __G_HASH_H__ */
diff --git a/include/glib/glib/ghmac.h b/include/glib/glib/ghmac.h
new file mode 100644
index 0000000000..36e24eb29b
--- /dev/null
+++ b/include/glib/glib/ghmac.h
@@ -0,0 +1,83 @@
+/* ghmac.h - secure data hashing
+ *
+ * Copyright (C) 2011 Stef Walter <stefw@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_HMAC_H__
+#define __G_HMAC_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+#include "gchecksum.h"
+
+G_BEGIN_DECLS
+
+/**
+ * GHmac:
+ *
+ * An opaque structure representing a HMAC operation.
+ * To create a new GHmac, use g_hmac_new(). To free
+ * a GHmac, use g_hmac_unref().
+ *
+ * Since: 2.30
+ */
+typedef struct _GHmac GHmac;
+
+GLIB_AVAILABLE_IN_2_30
+GHmac * g_hmac_new (GChecksumType digest_type,
+ const guchar *key,
+ gsize key_len);
+GLIB_AVAILABLE_IN_2_30
+GHmac * g_hmac_copy (const GHmac *hmac);
+GLIB_AVAILABLE_IN_2_30
+GHmac * g_hmac_ref (GHmac *hmac);
+GLIB_AVAILABLE_IN_2_30
+void g_hmac_unref (GHmac *hmac);
+GLIB_AVAILABLE_IN_2_30
+void g_hmac_update (GHmac *hmac,
+ const guchar *data,
+ gssize length);
+GLIB_AVAILABLE_IN_2_30
+const gchar * g_hmac_get_string (GHmac *hmac);
+GLIB_AVAILABLE_IN_2_30
+void g_hmac_get_digest (GHmac *hmac,
+ guint8 *buffer,
+ gsize *digest_len);
+
+GLIB_AVAILABLE_IN_2_30
+gchar *g_compute_hmac_for_data (GChecksumType digest_type,
+ const guchar *key,
+ gsize key_len,
+ const guchar *data,
+ gsize length);
+GLIB_AVAILABLE_IN_2_30
+gchar *g_compute_hmac_for_string (GChecksumType digest_type,
+ const guchar *key,
+ gsize key_len,
+ const gchar *str,
+ gssize length);
+GLIB_AVAILABLE_IN_2_50
+gchar *g_compute_hmac_for_bytes (GChecksumType digest_type,
+ GBytes *key,
+ GBytes *data);
+
+
+G_END_DECLS
+
+#endif /* __G_CHECKSUM_H__ */
diff --git a/include/glib/glib/ghook.h b/include/glib/glib/ghook.h
new file mode 100644
index 0000000000..83ad1bdefc
--- /dev/null
+++ b/include/glib/glib/ghook.h
@@ -0,0 +1,202 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_HOOK_H__
+#define __G_HOOK_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gmem.h>
+
+G_BEGIN_DECLS
+
+
+/* --- typedefs --- */
+typedef struct _GHook GHook;
+typedef struct _GHookList GHookList;
+
+typedef gint (*GHookCompareFunc) (GHook *new_hook,
+ GHook *sibling);
+typedef gboolean (*GHookFindFunc) (GHook *hook,
+ gpointer data);
+typedef void (*GHookMarshaller) (GHook *hook,
+ gpointer marshal_data);
+typedef gboolean (*GHookCheckMarshaller) (GHook *hook,
+ gpointer marshal_data);
+typedef void (*GHookFunc) (gpointer data);
+typedef gboolean (*GHookCheckFunc) (gpointer data);
+typedef void (*GHookFinalizeFunc) (GHookList *hook_list,
+ GHook *hook);
+typedef enum
+{
+ G_HOOK_FLAG_ACTIVE = 1 << 0,
+ G_HOOK_FLAG_IN_CALL = 1 << 1,
+ G_HOOK_FLAG_MASK = 0x0f
+} GHookFlagMask;
+#define G_HOOK_FLAG_USER_SHIFT (4)
+
+
+/* --- structures --- */
+struct _GHookList
+{
+ gulong seq_id;
+ guint hook_size : 16;
+ guint is_setup : 1;
+ GHook *hooks;
+ gpointer dummy3;
+ GHookFinalizeFunc finalize_hook;
+ gpointer dummy[2];
+};
+struct _GHook
+{
+ gpointer data;
+ GHook *next;
+ GHook *prev;
+ guint ref_count;
+ gulong hook_id;
+ guint flags;
+ gpointer func;
+ GDestroyNotify destroy;
+};
+
+
+/* --- macros --- */
+#define G_HOOK(hook) ((GHook*) (hook))
+#define G_HOOK_FLAGS(hook) (G_HOOK (hook)->flags)
+#define G_HOOK_ACTIVE(hook) ((G_HOOK_FLAGS (hook) & \
+ G_HOOK_FLAG_ACTIVE) != 0)
+#define G_HOOK_IN_CALL(hook) ((G_HOOK_FLAGS (hook) & \
+ G_HOOK_FLAG_IN_CALL) != 0)
+#define G_HOOK_IS_VALID(hook) (G_HOOK (hook)->hook_id != 0 && \
+ (G_HOOK_FLAGS (hook) & \
+ G_HOOK_FLAG_ACTIVE))
+#define G_HOOK_IS_UNLINKED(hook) (G_HOOK (hook)->next == NULL && \
+ G_HOOK (hook)->prev == NULL && \
+ G_HOOK (hook)->hook_id == 0 && \
+ G_HOOK (hook)->ref_count == 0)
+
+
+/* --- prototypes --- */
+/* callback maintenance functions */
+GLIB_AVAILABLE_IN_ALL
+void g_hook_list_init (GHookList *hook_list,
+ guint hook_size);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_list_clear (GHookList *hook_list);
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_alloc (GHookList *hook_list);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_free (GHookList *hook_list,
+ GHook *hook);
+GLIB_AVAILABLE_IN_ALL
+GHook * g_hook_ref (GHookList *hook_list,
+ GHook *hook);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_unref (GHookList *hook_list,
+ GHook *hook);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hook_destroy (GHookList *hook_list,
+ gulong hook_id);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_destroy_link (GHookList *hook_list,
+ GHook *hook);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_prepend (GHookList *hook_list,
+ GHook *hook);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_insert_before (GHookList *hook_list,
+ GHook *sibling,
+ GHook *hook);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_insert_sorted (GHookList *hook_list,
+ GHook *hook,
+ GHookCompareFunc func);
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_get (GHookList *hook_list,
+ gulong hook_id);
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_find (GHookList *hook_list,
+ gboolean need_valids,
+ GHookFindFunc func,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_find_data (GHookList *hook_list,
+ gboolean need_valids,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_find_func (GHookList *hook_list,
+ gboolean need_valids,
+ gpointer func);
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_find_func_data (GHookList *hook_list,
+ gboolean need_valids,
+ gpointer func,
+ gpointer data);
+/* return the first valid hook, and increment its reference count */
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_first_valid (GHookList *hook_list,
+ gboolean may_be_in_call);
+/* return the next valid hook with incremented reference count, and
+ * decrement the reference count of the original hook
+ */
+GLIB_AVAILABLE_IN_ALL
+GHook* g_hook_next_valid (GHookList *hook_list,
+ GHook *hook,
+ gboolean may_be_in_call);
+/* GHookCompareFunc implementation to insert hooks sorted by their id */
+GLIB_AVAILABLE_IN_ALL
+gint g_hook_compare_ids (GHook *new_hook,
+ GHook *sibling);
+/* convenience macros */
+#define g_hook_append( hook_list, hook ) \
+ g_hook_insert_before ((hook_list), NULL, (hook))
+/* invoke all valid hooks with the (*GHookFunc) signature.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_hook_list_invoke (GHookList *hook_list,
+ gboolean may_recurse);
+/* invoke all valid hooks with the (*GHookCheckFunc) signature,
+ * and destroy the hook if FALSE is returned.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_hook_list_invoke_check (GHookList *hook_list,
+ gboolean may_recurse);
+/* invoke a marshaller on all valid hooks.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_hook_list_marshal (GHookList *hook_list,
+ gboolean may_recurse,
+ GHookMarshaller marshaller,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_hook_list_marshal_check (GHookList *hook_list,
+ gboolean may_recurse,
+ GHookCheckMarshaller marshaller,
+ gpointer marshal_data);
+
+G_END_DECLS
+
+#endif /* __G_HOOK_H__ */
diff --git a/include/glib/glib/ghostutils.h b/include/glib/glib/ghostutils.h
new file mode 100644
index 0000000000..59d2d41edc
--- /dev/null
+++ b/include/glib/glib/ghostutils.h
@@ -0,0 +1,43 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_HOST_UTILS_H__
+#define __G_HOST_UTILS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hostname_is_non_ascii (const gchar *hostname);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hostname_is_ascii_encoded (const gchar *hostname);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_hostname_is_ip_address (const gchar *hostname);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_hostname_to_ascii (const gchar *hostname);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_hostname_to_unicode (const gchar *hostname);
+
+G_END_DECLS
+
+#endif /* __G_HOST_UTILS_H__ */
diff --git a/include/glib/glib/gi18n-lib.h b/include/glib/glib/gi18n-lib.h
new file mode 100644
index 0000000000..74e50a3a8c
--- /dev/null
+++ b/include/glib/glib/gi18n-lib.h
@@ -0,0 +1,36 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_I18N_LIB_H__
+#define __G_I18N_LIB_H__
+
+#include <glib.h>
+
+#include <libintl.h>
+#include <string.h>
+
+#ifndef GETTEXT_PACKAGE
+#error You must define GETTEXT_PACKAGE before including gi18n-lib.h. Did you forget to include config.h?
+#endif
+
+#define _(String) ((char *) g_dgettext (GETTEXT_PACKAGE, String))
+#define Q_(String) g_dpgettext (GETTEXT_PACKAGE, String, 0)
+#define N_(String) (String)
+#define C_(Context,String) g_dpgettext (GETTEXT_PACKAGE, Context "\004" String, strlen (Context) + 1)
+#define NC_(Context, String) (String)
+
+#endif /* __G_I18N_LIB_H__ */
diff --git a/include/glib/glib/gi18n.h b/include/glib/glib/gi18n.h
new file mode 100644
index 0000000000..5f996d24e8
--- /dev/null
+++ b/include/glib/glib/gi18n.h
@@ -0,0 +1,32 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_I18N_H__
+#define __G_I18N_H__
+
+#include <glib.h>
+
+#include <libintl.h>
+#include <string.h>
+
+#define _(String) gettext (String)
+#define Q_(String) g_dpgettext (NULL, String, 0)
+#define N_(String) (String)
+#define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1)
+#define NC_(Context, String) (String)
+
+#endif /* __G_I18N_H__ */
diff --git a/include/glib/glib/giochannel.h b/include/glib/glib/giochannel.h
new file mode 100644
index 0000000000..82743602a7
--- /dev/null
+++ b/include/glib/glib/giochannel.h
@@ -0,0 +1,404 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_IOCHANNEL_H__
+#define __G_IOCHANNEL_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gconvert.h>
+#include <glib/gmain.h>
+#include <glib/gstring.h>
+
+G_BEGIN_DECLS
+
+/* GIOChannel
+ */
+
+typedef struct _GIOChannel GIOChannel;
+typedef struct _GIOFuncs GIOFuncs;
+
+typedef enum
+{
+ G_IO_ERROR_NONE,
+ G_IO_ERROR_AGAIN,
+ G_IO_ERROR_INVAL,
+ G_IO_ERROR_UNKNOWN
+} GIOError;
+
+#define G_IO_CHANNEL_ERROR g_io_channel_error_quark()
+
+typedef enum
+{
+ /* Derived from errno */
+ G_IO_CHANNEL_ERROR_FBIG,
+ G_IO_CHANNEL_ERROR_INVAL,
+ G_IO_CHANNEL_ERROR_IO,
+ G_IO_CHANNEL_ERROR_ISDIR,
+ G_IO_CHANNEL_ERROR_NOSPC,
+ G_IO_CHANNEL_ERROR_NXIO,
+ G_IO_CHANNEL_ERROR_OVERFLOW,
+ G_IO_CHANNEL_ERROR_PIPE,
+ /* Other */
+ G_IO_CHANNEL_ERROR_FAILED
+} GIOChannelError;
+
+typedef enum
+{
+ G_IO_STATUS_ERROR,
+ G_IO_STATUS_NORMAL,
+ G_IO_STATUS_EOF,
+ G_IO_STATUS_AGAIN
+} GIOStatus;
+
+typedef enum
+{
+ G_SEEK_CUR,
+ G_SEEK_SET,
+ G_SEEK_END
+} GSeekType;
+
+typedef enum
+{
+ G_IO_FLAG_APPEND = 1 << 0,
+ G_IO_FLAG_NONBLOCK = 1 << 1,
+ G_IO_FLAG_IS_READABLE = 1 << 2, /* Read only flag */
+ G_IO_FLAG_IS_WRITABLE = 1 << 3, /* Read only flag */
+ G_IO_FLAG_IS_WRITEABLE = 1 << 3, /* Misspelling in 2.29.10 and earlier */
+ G_IO_FLAG_IS_SEEKABLE = 1 << 4, /* Read only flag */
+ G_IO_FLAG_MASK = (1 << 5) - 1,
+ G_IO_FLAG_GET_MASK = G_IO_FLAG_MASK,
+ G_IO_FLAG_SET_MASK = G_IO_FLAG_APPEND | G_IO_FLAG_NONBLOCK
+} GIOFlags;
+
+struct _GIOChannel
+{
+ /*< private >*/
+ gint ref_count;
+ GIOFuncs *funcs;
+
+ gchar *encoding;
+ GIConv read_cd;
+ GIConv write_cd;
+ gchar *line_term; /* String which indicates the end of a line of text */
+ guint line_term_len; /* So we can have null in the line term */
+
+ gsize buf_size;
+ GString *read_buf; /* Raw data from the channel */
+ GString *encoded_read_buf; /* Channel data converted to UTF-8 */
+ GString *write_buf; /* Data ready to be written to the file */
+ gchar partial_write_buf[6]; /* UTF-8 partial characters, null terminated */
+
+ /* Group the flags together, immediately after partial_write_buf, to save memory */
+
+ guint use_buffer : 1; /* The encoding uses the buffers */
+ guint do_encode : 1; /* The encoding uses the GIConv coverters */
+ guint close_on_unref : 1; /* Close the channel on final unref */
+ guint is_readable : 1; /* Cached GIOFlag */
+ guint is_writeable : 1; /* ditto */
+ guint is_seekable : 1; /* ditto */
+
+ gpointer reserved1;
+ gpointer reserved2;
+};
+
+typedef gboolean (*GIOFunc) (GIOChannel *source,
+ GIOCondition condition,
+ gpointer data);
+struct _GIOFuncs
+{
+ GIOStatus (*io_read) (GIOChannel *channel,
+ gchar *buf,
+ gsize count,
+ gsize *bytes_read,
+ GError **err);
+ GIOStatus (*io_write) (GIOChannel *channel,
+ const gchar *buf,
+ gsize count,
+ gsize *bytes_written,
+ GError **err);
+ GIOStatus (*io_seek) (GIOChannel *channel,
+ gint64 offset,
+ GSeekType type,
+ GError **err);
+ GIOStatus (*io_close) (GIOChannel *channel,
+ GError **err);
+ GSource* (*io_create_watch) (GIOChannel *channel,
+ GIOCondition condition);
+ void (*io_free) (GIOChannel *channel);
+ GIOStatus (*io_set_flags) (GIOChannel *channel,
+ GIOFlags flags,
+ GError **err);
+ GIOFlags (*io_get_flags) (GIOChannel *channel);
+};
+
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_init (GIOChannel *channel);
+GLIB_AVAILABLE_IN_ALL
+GIOChannel *g_io_channel_ref (GIOChannel *channel);
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_unref (GIOChannel *channel);
+
+GLIB_DEPRECATED_FOR(g_io_channel_read_chars)
+GIOError g_io_channel_read (GIOChannel *channel,
+ gchar *buf,
+ gsize count,
+ gsize *bytes_read);
+
+GLIB_DEPRECATED_FOR(g_io_channel_write_chars)
+GIOError g_io_channel_write (GIOChannel *channel,
+ const gchar *buf,
+ gsize count,
+ gsize *bytes_written);
+
+GLIB_DEPRECATED_FOR(g_io_channel_seek_position)
+GIOError g_io_channel_seek (GIOChannel *channel,
+ gint64 offset,
+ GSeekType type);
+
+GLIB_DEPRECATED_FOR(g_io_channel_shutdown)
+void g_io_channel_close (GIOChannel *channel);
+
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_shutdown (GIOChannel *channel,
+ gboolean flush,
+ GError **err);
+GLIB_AVAILABLE_IN_ALL
+guint g_io_add_watch_full (GIOChannel *channel,
+ gint priority,
+ GIOCondition condition,
+ GIOFunc func,
+ gpointer user_data,
+ GDestroyNotify notify);
+GLIB_AVAILABLE_IN_ALL
+GSource * g_io_create_watch (GIOChannel *channel,
+ GIOCondition condition);
+GLIB_AVAILABLE_IN_ALL
+guint g_io_add_watch (GIOChannel *channel,
+ GIOCondition condition,
+ GIOFunc func,
+ gpointer user_data);
+
+/* character encoding conversion involved functions.
+ */
+
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_set_buffer_size (GIOChannel *channel,
+ gsize size);
+GLIB_AVAILABLE_IN_ALL
+gsize g_io_channel_get_buffer_size (GIOChannel *channel);
+GLIB_AVAILABLE_IN_ALL
+GIOCondition g_io_channel_get_buffer_condition (GIOChannel *channel);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_set_flags (GIOChannel *channel,
+ GIOFlags flags,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOFlags g_io_channel_get_flags (GIOChannel *channel);
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_set_line_term (GIOChannel *channel,
+ const gchar *line_term,
+ gint length);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_io_channel_get_line_term (GIOChannel *channel,
+ gint *length);
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_set_buffered (GIOChannel *channel,
+ gboolean buffered);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_channel_get_buffered (GIOChannel *channel);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_set_encoding (GIOChannel *channel,
+ const gchar *encoding,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_io_channel_get_encoding (GIOChannel *channel);
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_set_close_on_unref (GIOChannel *channel,
+ gboolean do_close);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_io_channel_get_close_on_unref (GIOChannel *channel);
+
+
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_flush (GIOChannel *channel,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_read_line (GIOChannel *channel,
+ gchar **str_return,
+ gsize *length,
+ gsize *terminator_pos,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_read_line_string (GIOChannel *channel,
+ GString *buffer,
+ gsize *terminator_pos,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_read_to_end (GIOChannel *channel,
+ gchar **str_return,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_read_chars (GIOChannel *channel,
+ gchar *buf,
+ gsize count,
+ gsize *bytes_read,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_read_unichar (GIOChannel *channel,
+ gunichar *thechar,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_write_chars (GIOChannel *channel,
+ const gchar *buf,
+ gssize count,
+ gsize *bytes_written,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_write_unichar (GIOChannel *channel,
+ gunichar thechar,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOStatus g_io_channel_seek_position (GIOChannel *channel,
+ gint64 offset,
+ GSeekType type,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GIOChannel* g_io_channel_new_file (const gchar *filename,
+ const gchar *mode,
+ GError **error);
+
+/* Error handling */
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_io_channel_error_quark (void);
+GLIB_AVAILABLE_IN_ALL
+GIOChannelError g_io_channel_error_from_errno (gint en);
+
+/* On Unix, IO channels created with this function for any file
+ * descriptor or socket.
+ *
+ * On Win32, this can be used either for files opened with the MSVCRT
+ * (the Microsoft run-time C library) _open() or _pipe, including file
+ * descriptors 0, 1 and 2 (corresponding to stdin, stdout and stderr),
+ * or for Winsock SOCKETs. If the parameter is a legal file
+ * descriptor, it is assumed to be such, otherwise it should be a
+ * SOCKET. This relies on SOCKETs and file descriptors not
+ * overlapping. If you want to be certain, call either
+ * g_io_channel_win32_new_fd() or g_io_channel_win32_new_socket()
+ * instead as appropriate.
+ *
+ * The term file descriptor as used in the context of Win32 refers to
+ * the emulated Unix-like file descriptors MSVCRT provides. The native
+ * corresponding concept is file HANDLE. There isn't as of yet a way to
+ * get GIOChannels for Win32 file HANDLEs.
+ */
+GLIB_AVAILABLE_IN_ALL
+GIOChannel* g_io_channel_unix_new (int fd);
+GLIB_AVAILABLE_IN_ALL
+gint g_io_channel_unix_get_fd (GIOChannel *channel);
+
+
+/* Hook for GClosure / GSource integration. Don't touch */
+GLIB_VAR GSourceFuncs g_io_watch_funcs;
+
+#ifdef G_OS_WIN32
+
+/* You can use this "pseudo file descriptor" in a GPollFD to add
+ * polling for Windows messages. GTK applications should not do that.
+ */
+
+#define G_WIN32_MSG_HANDLE 19981206
+
+/* Use this to get a GPollFD from a GIOChannel, so that you can call
+ * g_io_channel_win32_poll(). After calling this you should only use
+ * g_io_channel_read() to read from the GIOChannel, i.e. never read()
+ * from the underlying file descriptor. For SOCKETs, it is possible to call
+ * recv().
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_win32_make_pollfd (GIOChannel *channel,
+ GIOCondition condition,
+ GPollFD *fd);
+
+/* This can be used to wait until at least one of the channels is readable.
+ * On Unix you would do a select() on the file descriptors of the channels.
+ */
+GLIB_AVAILABLE_IN_ALL
+gint g_io_channel_win32_poll (GPollFD *fds,
+ gint n_fds,
+ gint timeout_);
+
+/* Create an IO channel for Windows messages for window handle hwnd. */
+#if GLIB_SIZEOF_VOID_P == 8
+/* We use gsize here so that it is still an integer type and not a
+ * pointer, like the guint in the traditional prototype. We can't use
+ * intptr_t as that is not portable enough.
+ */
+GLIB_AVAILABLE_IN_ALL
+GIOChannel *g_io_channel_win32_new_messages (gsize hwnd);
+#else
+GLIB_AVAILABLE_IN_ALL
+GIOChannel *g_io_channel_win32_new_messages (guint hwnd);
+#endif
+
+/* Create an IO channel for C runtime (emulated Unix-like) file
+ * descriptors. After calling g_io_add_watch() on a IO channel
+ * returned by this function, you shouldn't call read() on the file
+ * descriptor. This is because adding polling for a file descriptor is
+ * implemented on Win32 by starting a thread that sits blocked in a
+ * read() from the file descriptor most of the time. All reads from
+ * the file descriptor should be done by this internal GLib
+ * thread. Your code should call only g_io_channel_read_chars().
+ */
+GLIB_AVAILABLE_IN_ALL
+GIOChannel* g_io_channel_win32_new_fd (gint fd);
+
+/* Get the C runtime file descriptor of a channel. */
+GLIB_AVAILABLE_IN_ALL
+gint g_io_channel_win32_get_fd (GIOChannel *channel);
+
+/* Create an IO channel for a winsock socket. The parameter should be
+ * a SOCKET. Contrary to IO channels for file descriptors (on *Win32),
+ * you can use normal recv() or recvfrom() on sockets even if GLib
+ * is polling them.
+ */
+GLIB_AVAILABLE_IN_ALL
+GIOChannel *g_io_channel_win32_new_socket (gint socket);
+
+GLIB_DEPRECATED_FOR(g_io_channel_win32_new_socket)
+GIOChannel *g_io_channel_win32_new_stream_socket (gint socket);
+
+GLIB_AVAILABLE_IN_ALL
+void g_io_channel_win32_set_debug (GIOChannel *channel,
+ gboolean flag);
+
+#endif
+
+G_END_DECLS
+
+#endif /* __G_IOCHANNEL_H__ */
diff --git a/include/glib/glib/gkeyfile.h b/include/glib/glib/gkeyfile.h
new file mode 100644
index 0000000000..7a1004841a
--- /dev/null
+++ b/include/glib/glib/gkeyfile.h
@@ -0,0 +1,330 @@
+/* gkeyfile.h - desktop entry file parser
+ *
+ * Copyright 2004 Red Hat, Inc.
+ *
+ * Ray Strode <halfline@hawaii.rr.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_KEY_FILE_H__
+#define __G_KEY_FILE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gbytes.h>
+#include <glib/gerror.h>
+
+G_BEGIN_DECLS
+
+typedef enum
+{
+ G_KEY_FILE_ERROR_UNKNOWN_ENCODING,
+ G_KEY_FILE_ERROR_PARSE,
+ G_KEY_FILE_ERROR_NOT_FOUND,
+ G_KEY_FILE_ERROR_KEY_NOT_FOUND,
+ G_KEY_FILE_ERROR_GROUP_NOT_FOUND,
+ G_KEY_FILE_ERROR_INVALID_VALUE
+} GKeyFileError;
+
+#define G_KEY_FILE_ERROR g_key_file_error_quark()
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_key_file_error_quark (void);
+
+typedef struct _GKeyFile GKeyFile;
+
+typedef enum
+{
+ G_KEY_FILE_NONE = 0,
+ G_KEY_FILE_KEEP_COMMENTS = 1 << 0,
+ G_KEY_FILE_KEEP_TRANSLATIONS = 1 << 1
+} GKeyFileFlags;
+
+GLIB_AVAILABLE_IN_ALL
+GKeyFile *g_key_file_new (void);
+GLIB_AVAILABLE_IN_ALL
+GKeyFile *g_key_file_ref (GKeyFile *key_file);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_unref (GKeyFile *key_file);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_free (GKeyFile *key_file);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_list_separator (GKeyFile *key_file,
+ gchar separator);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_load_from_file (GKeyFile *key_file,
+ const gchar *file,
+ GKeyFileFlags flags,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_load_from_data (GKeyFile *key_file,
+ const gchar *data,
+ gsize length,
+ GKeyFileFlags flags,
+ GError **error);
+GLIB_AVAILABLE_IN_2_50
+gboolean g_key_file_load_from_bytes (GKeyFile *key_file,
+ GBytes *bytes,
+ GKeyFileFlags flags,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_load_from_dirs (GKeyFile *key_file,
+ const gchar *file,
+ const gchar **search_dirs,
+ gchar **full_path,
+ GKeyFileFlags flags,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_load_from_data_dirs (GKeyFile *key_file,
+ const gchar *file,
+ gchar **full_path,
+ GKeyFileFlags flags,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_key_file_to_data (GKeyFile *key_file,
+ gsize *length,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_2_40
+gboolean g_key_file_save_to_file (GKeyFile *key_file,
+ const gchar *filename,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_key_file_get_start_group (GKeyFile *key_file) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar **g_key_file_get_groups (GKeyFile *key_file,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_key_file_get_keys (GKeyFile *key_file,
+ const gchar *group_name,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_has_group (GKeyFile *key_file,
+ const gchar *group_name);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_has_key (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_key_file_get_value (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_value (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *value);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_key_file_get_string (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_string (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_key_file_get_locale_string (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *locale,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_2_56
+gchar *g_key_file_get_locale_for_key (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *locale) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_locale_string (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *locale,
+ const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_get_boolean (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_boolean (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gboolean value);
+GLIB_AVAILABLE_IN_ALL
+gint g_key_file_get_integer (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_integer (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gint value);
+GLIB_AVAILABLE_IN_ALL
+gint64 g_key_file_get_int64 (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_int64 (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gint64 value);
+GLIB_AVAILABLE_IN_ALL
+guint64 g_key_file_get_uint64 (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_uint64 (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ guint64 value);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_key_file_get_double (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_double (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gdouble value);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_key_file_get_string_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_string_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar * const list[],
+ gsize length);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_key_file_get_locale_string_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *locale,
+ gsize *length,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_locale_string_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *locale,
+ const gchar * const list[],
+ gsize length);
+GLIB_AVAILABLE_IN_ALL
+gboolean *g_key_file_get_boolean_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gsize *length,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_boolean_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gboolean list[],
+ gsize length);
+GLIB_AVAILABLE_IN_ALL
+gint *g_key_file_get_integer_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gsize *length,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_double_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gdouble list[],
+ gsize length);
+GLIB_AVAILABLE_IN_ALL
+gdouble *g_key_file_get_double_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gsize *length,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_key_file_set_integer_list (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ gint list[],
+ gsize length);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_set_comment (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ const gchar *comment,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_key_file_get_comment (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_remove_comment (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_remove_key (GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_key_file_remove_group (GKeyFile *key_file,
+ const gchar *group_name,
+ GError **error);
+
+/* Defines for handling freedesktop.org Desktop files */
+#define G_KEY_FILE_DESKTOP_GROUP "Desktop Entry"
+
+#define G_KEY_FILE_DESKTOP_KEY_TYPE "Type"
+#define G_KEY_FILE_DESKTOP_KEY_VERSION "Version"
+#define G_KEY_FILE_DESKTOP_KEY_NAME "Name"
+#define G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME "GenericName"
+#define G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY "NoDisplay"
+#define G_KEY_FILE_DESKTOP_KEY_COMMENT "Comment"
+#define G_KEY_FILE_DESKTOP_KEY_ICON "Icon"
+#define G_KEY_FILE_DESKTOP_KEY_HIDDEN "Hidden"
+#define G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN "OnlyShowIn"
+#define G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN "NotShowIn"
+#define G_KEY_FILE_DESKTOP_KEY_TRY_EXEC "TryExec"
+#define G_KEY_FILE_DESKTOP_KEY_EXEC "Exec"
+#define G_KEY_FILE_DESKTOP_KEY_PATH "Path"
+#define G_KEY_FILE_DESKTOP_KEY_TERMINAL "Terminal"
+#define G_KEY_FILE_DESKTOP_KEY_MIME_TYPE "MimeType"
+#define G_KEY_FILE_DESKTOP_KEY_CATEGORIES "Categories"
+#define G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY "StartupNotify"
+#define G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS "StartupWMClass"
+#define G_KEY_FILE_DESKTOP_KEY_URL "URL"
+#define G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE "DBusActivatable"
+#define G_KEY_FILE_DESKTOP_KEY_ACTIONS "Actions"
+
+#define G_KEY_FILE_DESKTOP_TYPE_APPLICATION "Application"
+#define G_KEY_FILE_DESKTOP_TYPE_LINK "Link"
+#define G_KEY_FILE_DESKTOP_TYPE_DIRECTORY "Directory"
+
+G_END_DECLS
+
+#endif /* __G_KEY_FILE_H__ */
diff --git a/include/glib/glib/glib-autocleanups.h b/include/glib/glib/glib-autocleanups.h
new file mode 100644
index 0000000000..efa4a99ab6
--- /dev/null
+++ b/include/glib/glib/glib-autocleanups.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright © 2015 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+static inline void
+g_autoptr_cleanup_generic_gfree (void *p)
+{
+ void **pp = (void**)p;
+ g_free (*pp);
+}
+
+static inline void
+g_autoptr_cleanup_gstring_free (GString *string)
+{
+ if (string)
+ g_string_free (string, TRUE);
+}
+
+/* If adding a cleanup here, please also add a test case to
+ * glib/tests/autoptr.c
+ */
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncQueue, g_async_queue_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBookmarkFile, g_bookmark_file_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBytes, g_bytes_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GChecksum, g_checksum_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDateTime, g_date_time_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDir, g_dir_close)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GError, g_error_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHashTable, g_hash_table_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHmac, g_hmac_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOChannel, g_io_channel_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GKeyFile, g_key_file_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GList, g_list_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GArray, g_array_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPtrArray, g_ptr_array_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GByteArray, g_byte_array_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainContext, g_main_context_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainLoop, g_main_loop_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSource, g_source_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMappedFile, g_mapped_file_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMarkupParseContext, g_markup_parse_context_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNode, g_node_destroy)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionContext, g_option_context_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionGroup, g_option_group_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPatternSpec, g_pattern_spec_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GQueue, g_queue_free)
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GQueue, g_queue_clear)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRand, g_rand_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRegex, g_regex_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMatchInfo, g_match_info_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GScanner, g_scanner_destroy)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSequence, g_sequence_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSList, g_slist_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GString, g_autoptr_cleanup_gstring_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GStringChunk, g_string_chunk_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThread, g_thread_unref)
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GMutex, g_mutex_clear)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMutexLocker, g_mutex_locker_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRecMutexLocker, g_rec_mutex_locker_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRWLockWriterLocker, g_rw_lock_writer_locker_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRWLockReaderLocker, g_rw_lock_reader_locker_free)
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GCond, g_cond_clear)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimer, g_timer_destroy)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimeZone, g_time_zone_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTree, g_tree_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariant, g_variant_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantBuilder, g_variant_builder_unref)
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantBuilder, g_variant_builder_clear)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantIter, g_variant_iter_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref)
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free)
+G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GRefString, g_ref_string_release)
diff --git a/include/glib/glib/glist.h b/include/glib/glib/glist.h
new file mode 100644
index 0000000000..8b4703e171
--- /dev/null
+++ b/include/glib/glib/glist.h
@@ -0,0 +1,156 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_LIST_H__
+#define __G_LIST_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gmem.h>
+#include <glib/gnode.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GList GList;
+
+struct _GList
+{
+ gpointer data;
+ GList *next;
+ GList *prev;
+};
+
+/* Doubly linked lists
+ */
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_alloc (void) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+void g_list_free (GList *list);
+GLIB_AVAILABLE_IN_ALL
+void g_list_free_1 (GList *list);
+#define g_list_free1 g_list_free_1
+GLIB_AVAILABLE_IN_ALL
+void g_list_free_full (GList *list,
+ GDestroyNotify free_func);
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_append (GList *list,
+ gpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_prepend (GList *list,
+ gpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_insert (GList *list,
+ gpointer data,
+ gint position) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_insert_sorted (GList *list,
+ gpointer data,
+ GCompareFunc func) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_insert_sorted_with_data (GList *list,
+ gpointer data,
+ GCompareDataFunc func,
+ gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_insert_before (GList *list,
+ GList *sibling,
+ gpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_2_62
+GList* g_list_insert_before_link (GList *list,
+ GList *sibling,
+ GList *link_) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_concat (GList *list1,
+ GList *list2) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_remove (GList *list,
+ gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_remove_all (GList *list,
+ gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_remove_link (GList *list,
+ GList *llink) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_delete_link (GList *list,
+ GList *link_) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_reverse (GList *list) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_copy (GList *list) G_GNUC_WARN_UNUSED_RESULT;
+
+GLIB_AVAILABLE_IN_2_34
+GList* g_list_copy_deep (GList *list,
+ GCopyFunc func,
+ gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
+
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_nth (GList *list,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_nth_prev (GList *list,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_find (GList *list,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_find_custom (GList *list,
+ gconstpointer data,
+ GCompareFunc func);
+GLIB_AVAILABLE_IN_ALL
+gint g_list_position (GList *list,
+ GList *llink);
+GLIB_AVAILABLE_IN_ALL
+gint g_list_index (GList *list,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_last (GList *list);
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_first (GList *list);
+GLIB_AVAILABLE_IN_ALL
+guint g_list_length (GList *list);
+GLIB_AVAILABLE_IN_ALL
+void g_list_foreach (GList *list,
+ GFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_sort (GList *list,
+ GCompareFunc compare_func) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GList* g_list_sort_with_data (GList *list,
+ GCompareDataFunc compare_func,
+ gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+gpointer g_list_nth_data (GList *list,
+ guint n);
+
+
+#define g_list_previous(list) ((list) ? (((GList *)(list))->prev) : NULL)
+#define g_list_next(list) ((list) ? (((GList *)(list))->next) : NULL)
+
+G_END_DECLS
+
+#endif /* __G_LIST_H__ */
diff --git a/include/glib/glib/gmacros.h b/include/glib/glib/gmacros.h
new file mode 100644
index 0000000000..79077e23bd
--- /dev/null
+++ b/include/glib/glib/gmacros.h
@@ -0,0 +1,1099 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+/* This file must not include any other glib header file and must thus
+ * not refer to variables from glibconfig.h
+ */
+
+#ifndef __G_MACROS_H__
+#define __G_MACROS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+/* We include stddef.h to get the system's definition of NULL
+ */
+#include <stddef.h>
+
+#ifdef __GNUC__
+#define G_GNUC_CHECK_VERSION(major, minor) \
+ ((__GNUC__ > (major)) || \
+ ((__GNUC__ == (major)) && \
+ (__GNUC_MINOR__ >= (minor))))
+#else
+#define G_GNUC_CHECK_VERSION(major, minor) 0
+#endif
+
+/* Here we provide G_GNUC_EXTENSION as an alias for __extension__,
+ * where this is valid. This allows for warningless compilation of
+ * "long long" types even in the presence of '-ansi -pedantic'.
+ */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+#define G_GNUC_EXTENSION __extension__
+#else
+#define G_GNUC_EXTENSION
+#endif
+
+/* Every compiler that we target supports inlining, but some of them may
+ * complain about it if we don't say "__inline". If we have C99, or if
+ * we are using C++, then we can use "inline" directly. Unfortunately
+ * Visual Studio does not support __STDC_VERSION__, so we need to check
+ * whether we are on Visual Studio 2013 or earlier to see that we need to
+ * say "__inline" in C mode.
+ * Otherwise, we say "__inline" to avoid the warning.
+ */
+#define G_CAN_INLINE
+#ifndef __cplusplus
+# ifdef _MSC_VER
+# if (_MSC_VER < 1900)
+# define G_INLINE_DEFINE_NEEDED
+# endif
+# elif !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199900)
+# define G_INLINE_DEFINE_NEEDED
+# endif
+#endif
+
+#ifdef G_INLINE_DEFINE_NEEDED
+# undef inline
+# define inline __inline
+#endif
+
+#undef G_INLINE_DEFINE_NEEDED
+
+/**
+ * G_INLINE_FUNC:
+ *
+ * This macro used to be used to conditionally define inline functions
+ * in a compatible way before this feature was supported in all
+ * compilers. These days, GLib requires inlining support from the
+ * compiler, so your GLib-using programs can safely assume that the
+ * "inline" keywork works properly.
+ *
+ * Never use this macro anymore. Just say "static inline".
+ *
+ * Deprecated: 2.48: Use "static inline" instead
+ */
+
+/* For historical reasons we need to continue to support those who
+ * define G_IMPLEMENT_INLINES to mean "don't implement this here".
+ */
+#ifdef G_IMPLEMENT_INLINES
+# define G_INLINE_FUNC extern GLIB_DEPRECATED_MACRO_IN_2_48_FOR(static inline)
+# undef G_CAN_INLINE
+#else
+# define G_INLINE_FUNC static inline GLIB_DEPRECATED_MACRO_IN_2_48_FOR(static inline)
+#endif /* G_IMPLEMENT_INLINES */
+
+/* Provide macros to feature the GCC function attribute.
+ */
+
+/**
+ * G_GNUC_PURE:
+ *
+ * Expands to the GNU C `pure` function attribute if the compiler is gcc.
+ * Declaring a function as `pure` enables better optimization of calls to
+ * the function. A `pure` function has no effects except its return value
+ * and the return value depends only on the parameters and/or global
+ * variables.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * gboolean g_type_check_value (const GValue *value) G_GNUC_PURE;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute) for more details.
+ */
+
+/**
+ * G_GNUC_MALLOC:
+ *
+ * Expands to the
+ * [GNU C `malloc` function attribute](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-functions-that-behave-like-malloc)
+ * if the compiler is gcc.
+ * Declaring a function as `malloc` enables better optimization of the function,
+ * but must only be done if the allocation behaviour of the function is fully
+ * understood, otherwise miscompilation can result.
+ *
+ * A function can have the `malloc` attribute if it returns a pointer which is
+ * guaranteed to not alias with any other pointer valid when the function
+ * returns, and moreover no pointers to valid objects occur in any storage
+ * addressed by the returned pointer.
+ *
+ * In practice, this means that `G_GNUC_MALLOC` can be used with any function
+ * which returns unallocated or zeroed-out memory, but not with functions which
+ * return initialised structures containing other pointers, or with functions
+ * that reallocate memory. This definition changed in GLib 2.58 to match the
+ * stricter definition introduced around GCC 5.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * gpointer g_malloc (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+ * ]|
+ *
+ * See the
+ * [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-functions-that-behave-like-malloc)
+ * for more details.
+ *
+ * Since: 2.6
+ */
+
+/**
+ * G_GNUC_NO_INLINE:
+ *
+ * Expands to the GNU C `noinline` function attribute if the compiler is gcc.
+ * If the compiler is not gcc, this macro expands to nothing.
+ *
+ * Declaring a function as `noinline` prevents the function from being
+ * considered for inlining.
+ *
+ * The attribute may be placed before the declaration or definition,
+ * right before the `static` keyword.
+ *
+ * |[<!-- language="C" -->
+ * G_GNUC_NO_INLINE
+ * static int
+ * do_not_inline_this (void)
+ * {
+ * ...
+ * }
+ * ]|
+ *
+ * See the
+ * [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noinline-function-attribute)
+ * for more details.
+ *
+ * Since: 2.58
+ */
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+#define G_GNUC_PURE __attribute__((__pure__))
+#define G_GNUC_MALLOC __attribute__((__malloc__))
+#define G_GNUC_NO_INLINE __attribute__((noinline))
+#else
+#define G_GNUC_PURE
+#define G_GNUC_MALLOC
+#define G_GNUC_NO_INLINE
+#endif
+
+/**
+ * G_GNUC_NULL_TERMINATED:
+ *
+ * Expands to the GNU C `sentinel` function attribute if the compiler is gcc.
+ * This function attribute only applies to variadic functions and instructs
+ * the compiler to check that the argument list is terminated with an
+ * explicit %NULL.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * gchar *g_strconcat (const gchar *string1,
+ * ...) G_GNUC_NULL_TERMINATED;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-sentinel-function-attribute) for more details.
+ *
+ * Since: 2.8
+ */
+#if __GNUC__ >= 4
+#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
+#else
+#define G_GNUC_NULL_TERMINATED
+#endif
+
+/*
+ * We can only use __typeof__ on GCC >= 4.8, and not when compiling C++. Since
+ * __typeof__ is used in a few places in GLib, provide a pre-processor symbol
+ * to factor the check out from callers.
+ *
+ * This symbol is private.
+ */
+#undef g_has_typeof
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && !defined(__cplusplus)
+#define g_has_typeof
+#endif
+
+/*
+ * Clang feature detection: http://clang.llvm.org/docs/LanguageExtensions.html
+ * These are not available on GCC, but since the pre-processor doesn't do
+ * operator short-circuiting, we can't use it in a statement or we'll get:
+ *
+ * error: missing binary operator before token "("
+ *
+ * So we define it to 0 to satisfy the pre-processor.
+ */
+
+#ifdef __has_attribute
+#define g_macro__has_attribute __has_attribute
+#else
+#define g_macro__has_attribute(x) 0
+#endif
+
+#ifdef __has_feature
+#define g_macro__has_feature __has_feature
+#else
+#define g_macro__has_feature(x) 0
+#endif
+
+#ifdef __has_builtin
+#define g_macro__has_builtin __has_builtin
+#else
+#define g_macro__has_builtin(x) 0
+#endif
+
+/**
+ * G_GNUC_ALLOC_SIZE:
+ * @x: the index of the argument specifying the allocation size
+ *
+ * Expands to the GNU C `alloc_size` function attribute if the compiler
+ * is a new enough gcc. This attribute tells the compiler that the
+ * function returns a pointer to memory of a size that is specified
+ * by the @xth function parameter.
+ *
+ * Place the attribute after the function declaration, just before the
+ * semicolon.
+ *
+ * |[<!-- language="C" -->
+ * gpointer g_malloc (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alloc_005fsize-function-attribute) for more details.
+ *
+ * Since: 2.18
+ */
+
+/**
+ * G_GNUC_ALLOC_SIZE2:
+ * @x: the index of the argument specifying one factor of the allocation size
+ * @y: the index of the argument specifying the second factor of the allocation size
+ *
+ * Expands to the GNU C `alloc_size` function attribute if the compiler is a
+ * new enough gcc. This attribute tells the compiler that the function returns
+ * a pointer to memory of a size that is specified by the product of two
+ * function parameters.
+ *
+ * Place the attribute after the function declaration, just before the
+ * semicolon.
+ *
+ * |[<!-- language="C" -->
+ * gpointer g_malloc_n (gsize n_blocks,
+ * gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1, 2);
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alloc_005fsize-function-attribute) for more details.
+ *
+ * Since: 2.18
+ */
+#if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
+ (defined(__clang__) && g_macro__has_attribute(__alloc_size__))
+#define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+#define G_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
+#else
+#define G_GNUC_ALLOC_SIZE(x)
+#define G_GNUC_ALLOC_SIZE2(x,y)
+#endif
+
+/**
+ * G_GNUC_PRINTF:
+ * @format_idx: the index of the argument corresponding to the
+ * format string (the arguments are numbered from 1)
+ * @arg_idx: the index of the first of the format arguments, or 0 if
+ * there are no format arguments
+ *
+ * Expands to the GNU C `format` function attribute if the compiler is gcc.
+ * This is used for declaring functions which take a variable number of
+ * arguments, with the same syntax as `printf()`. It allows the compiler
+ * to type-check the arguments passed to the function.
+ *
+ * Place the attribute after the function declaration, just before the
+ * semicolon.
+ *
+ * See the
+ * [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-Wformat-3288)
+ * for more details.
+ *
+ * |[<!-- language="C" -->
+ * gint g_snprintf (gchar *string,
+ * gulong n,
+ * gchar const *format,
+ * ...) G_GNUC_PRINTF (3, 4);
+ * ]|
+ */
+
+/**
+ * G_GNUC_SCANF:
+ * @format_idx: the index of the argument corresponding to
+ * the format string (the arguments are numbered from 1)
+ * @arg_idx: the index of the first of the format arguments, or 0 if
+ * there are no format arguments
+ *
+ * Expands to the GNU C `format` function attribute if the compiler is gcc.
+ * This is used for declaring functions which take a variable number of
+ * arguments, with the same syntax as `scanf()`. It allows the compiler
+ * to type-check the arguments passed to the function.
+ *
+ * |[<!-- language="C" -->
+ * int my_scanf (MyStream *stream,
+ * const char *format,
+ * ...) G_GNUC_SCANF (2, 3);
+ * int my_vscanf (MyStream *stream,
+ * const char *format,
+ * va_list ap) G_GNUC_SCANF (2, 0);
+ * ]|
+ *
+ * See the
+ * [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-Wformat-3288)
+ * for details.
+ */
+
+/**
+ * G_GNUC_STRFTIME:
+ * @format_idx: the index of the argument corresponding to
+ * the format string (the arguments are numbered from 1)
+ *
+ * Expands to the GNU C `strftime` format function attribute if the compiler
+ * is gcc. This is used for declaring functions which take a format argument
+ * which is passed to `strftime()` or an API implementing its formats. It allows
+ * the compiler check the format passed to the function.
+ *
+ * |[<!-- language="C" -->
+ * gsize my_strftime (MyBuffer *buffer,
+ * const char *format,
+ * const struct tm *tm) G_GNUC_STRFTIME (2);
+ * ]|
+ *
+ * See the
+ * [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-Wformat-3288)
+ * for details.
+ *
+ * Since: 2.60
+ */
+
+/**
+ * G_GNUC_FORMAT:
+ * @arg_idx: the index of the argument
+ *
+ * Expands to the GNU C `format_arg` function attribute if the compiler
+ * is gcc. This function attribute specifies that a function takes a
+ * format string for a `printf()`, `scanf()`, `strftime()` or `strfmon()` style
+ * function and modifies it, so that the result can be passed to a `printf()`,
+ * `scanf()`, `strftime()` or `strfmon()` style function (with the remaining
+ * arguments to the format function the same as they would have been
+ * for the unmodified string).
+ *
+ * Place the attribute after the function declaration, just before the
+ * semicolon.
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-Wformat-nonliteral-1) for more details.
+ *
+ * |[<!-- language="C" -->
+ * gchar *g_dgettext (gchar *domain_name, gchar *msgid) G_GNUC_FORMAT (2);
+ * ]|
+ */
+
+/**
+ * G_GNUC_NORETURN:
+ *
+ * Expands to the GNU C `noreturn` function attribute if the compiler is gcc.
+ * It is used for declaring functions which never return. It enables
+ * optimization of the function, and avoids possible compiler warnings.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * void g_abort (void) G_GNUC_NORETURN;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noreturn-function-attribute) for more details.
+ */
+
+/**
+ * G_GNUC_CONST:
+ *
+ * Expands to the GNU C `const` function attribute if the compiler is gcc.
+ * Declaring a function as `const` enables better optimization of calls to
+ * the function. A `const` function doesn't examine any values except its
+ * parameters, and has no effects except its return value.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * gchar g_ascii_tolower (gchar c) G_GNUC_CONST;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute) for more details.
+ *
+ * A function that has pointer arguments and examines the data pointed to
+ * must not be declared `const`. Likewise, a function that calls a non-`const`
+ * function usually must not be `const`. It doesn't make sense for a `const`
+ * function to return `void`.
+ */
+
+/**
+ * G_GNUC_UNUSED:
+ *
+ * Expands to the GNU C `unused` function attribute if the compiler is gcc.
+ * It is used for declaring functions and arguments which may never be used.
+ * It avoids possible compiler warnings.
+ *
+ * For functions, place the attribute after the declaration, just before the
+ * semicolon. For arguments, place the attribute at the beginning of the
+ * argument declaration.
+ *
+ * |[<!-- language="C" -->
+ * void my_unused_function (G_GNUC_UNUSED gint unused_argument,
+ * gint other_argument) G_GNUC_UNUSED;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-unused-function-attribute) for more details.
+ */
+
+/**
+ * G_GNUC_NO_INSTRUMENT:
+ *
+ * Expands to the GNU C `no_instrument_function` function attribute if the
+ * compiler is gcc. Functions with this attribute will not be instrumented
+ * for profiling, when the compiler is called with the
+ * `-finstrument-functions` option.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * int do_uninteresting_things (void) G_GNUC_NO_INSTRUMENT;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005finstrument_005ffunction-function-attribute) for more details.
+ */
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#if !defined (__clang__) && G_GNUC_CHECK_VERSION (4, 4)
+#define G_GNUC_PRINTF( format_idx, arg_idx ) \
+ __attribute__((__format__ (gnu_printf, format_idx, arg_idx)))
+#define G_GNUC_SCANF( format_idx, arg_idx ) \
+ __attribute__((__format__ (gnu_scanf, format_idx, arg_idx)))
+#define G_GNUC_STRFTIME( format_idx ) \
+ __attribute__((__format__ (gnu_strftime, format_idx, 0)))
+#else
+#define G_GNUC_PRINTF( format_idx, arg_idx ) \
+ __attribute__((__format__ (__printf__, format_idx, arg_idx)))
+#define G_GNUC_SCANF( format_idx, arg_idx ) \
+ __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
+#define G_GNUC_STRFTIME( format_idx ) \
+ __attribute__((__format__ (__strftime__, format_idx, 0)))
+#endif
+#define G_GNUC_FORMAT( arg_idx ) \
+ __attribute__((__format_arg__ (arg_idx)))
+#define G_GNUC_NORETURN \
+ __attribute__((__noreturn__))
+#define G_GNUC_CONST \
+ __attribute__((__const__))
+#define G_GNUC_UNUSED \
+ __attribute__((__unused__))
+#define G_GNUC_NO_INSTRUMENT \
+ __attribute__((__no_instrument_function__))
+#else /* !__GNUC__ */
+#define G_GNUC_PRINTF( format_idx, arg_idx )
+#define G_GNUC_SCANF( format_idx, arg_idx )
+#define G_GNUC_STRFTIME( format_idx )
+#define G_GNUC_FORMAT( arg_idx )
+/* NOTE: MSVC has __declspec(noreturn) but unlike GCC __attribute__,
+ * __declspec can only be placed at the start of the function prototype
+ * and not at the end, so we can't use it without breaking API.
+ */
+#define G_GNUC_NORETURN
+#define G_GNUC_CONST
+#define G_GNUC_UNUSED
+#define G_GNUC_NO_INSTRUMENT
+#endif /* !__GNUC__ */
+
+/**
+ * G_GNUC_FALLTHROUGH:
+ *
+ * Expands to the GNU C `fallthrough` statement attribute if the compiler is gcc.
+ * This allows declaring case statement to explicitly fall through in switch
+ * statements. To enable this feature, use `-Wimplicit-fallthrough` during
+ * compilation.
+ *
+ * Put the attribute right before the case statement you want to fall through
+ * to.
+ *
+ * |[<!-- language="C" -->
+ * switch (foo)
+ * {
+ * case 1:
+ * g_message ("it's 1");
+ * G_GNUC_FALLTHROUGH;
+ * case 2:
+ * g_message ("it's either 1 or 2");
+ * break;
+ * }
+ * ]|
+ *
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#index-fallthrough-statement-attribute) for more details.
+ *
+ * Since: 2.60
+ */
+#if __GNUC__ > 6
+#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
+#else
+#define G_GNUC_FALLTHROUGH
+#endif /* __GNUC__ */
+
+/**
+ * G_GNUC_DEPRECATED:
+ *
+ * Expands to the GNU C `deprecated` attribute if the compiler is gcc.
+ * It can be used to mark `typedef`s, variables and functions as deprecated.
+ * When called with the `-Wdeprecated-declarations` option,
+ * gcc will generate warnings when deprecated interfaces are used.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * int my_mistake (void) G_GNUC_DEPRECATED;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-deprecated-function-attribute) for more details.
+ *
+ * Since: 2.2
+ */
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || defined (__clang__)
+#define G_GNUC_DEPRECATED __attribute__((__deprecated__))
+#else
+#define G_GNUC_DEPRECATED
+#endif /* __GNUC__ */
+
+/**
+ * G_GNUC_DEPRECATED_FOR:
+ * @f: the intended replacement for the deprecated symbol,
+ * such as the name of a function
+ *
+ * Like %G_GNUC_DEPRECATED, but names the intended replacement for the
+ * deprecated symbol if the version of gcc in use is new enough to support
+ * custom deprecation messages.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * int my_mistake (void) G_GNUC_DEPRECATED_FOR(my_replacement);
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-deprecated-function-attribute) for more details.
+ *
+ * Note that if @f is a macro, it will be expanded in the warning message.
+ * You can enclose it in quotes to prevent this. (The quotes will show up
+ * in the warning, but it's better than showing the macro expansion.)
+ *
+ * Since: 2.26
+ */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined (__clang__)
+#define G_GNUC_DEPRECATED_FOR(f) \
+ __attribute__((deprecated("Use " #f " instead")))
+#else
+#define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED
+#endif /* __GNUC__ */
+
+#ifdef __ICC
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ _Pragma ("warning (push)") \
+ _Pragma ("warning (disable:1478)")
+#define G_GNUC_END_IGNORE_DEPRECATIONS \
+ _Pragma ("warning (pop)")
+#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+#define G_GNUC_END_IGNORE_DEPRECATIONS \
+ _Pragma ("GCC diagnostic pop")
+#elif defined (_MSC_VER) && (_MSC_VER >= 1500) && !defined (__clang__)
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ __pragma (warning (push)) \
+ __pragma (warning (disable : 4996))
+#define G_GNUC_END_IGNORE_DEPRECATIONS \
+ __pragma (warning (pop))
+#elif defined (__clang__)
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
+#define G_GNUC_END_IGNORE_DEPRECATIONS \
+ _Pragma("clang diagnostic pop")
+#else
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#define G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
+
+/**
+ * G_GNUC_MAY_ALIAS:
+ *
+ * Expands to the GNU C `may_alias` type attribute if the compiler is gcc.
+ * Types with this attribute will not be subjected to type-based alias
+ * analysis, but are assumed to alias with any other type, just like `char`.
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-may_005falias-type-attribute) for details.
+ *
+ * Since: 2.14
+ */
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+#define G_GNUC_MAY_ALIAS __attribute__((may_alias))
+#else
+#define G_GNUC_MAY_ALIAS
+#endif
+
+/**
+ * G_GNUC_WARN_UNUSED_RESULT:
+ *
+ * Expands to the GNU C `warn_unused_result` function attribute if the compiler
+ * is gcc. This function attribute makes the compiler emit a warning if the
+ * result of a function call is ignored.
+ *
+ * Place the attribute after the declaration, just before the semicolon.
+ *
+ * |[<!-- language="C" -->
+ * GList *g_list_append (GList *list,
+ * gpointer data) G_GNUC_WARN_UNUSED_RESULT;
+ * ]|
+ *
+ * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warn_005funused_005fresult-function-attribute) for more details.
+ *
+ * Since: 2.10
+ */
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+#define G_GNUC_WARN_UNUSED_RESULT
+#endif /* __GNUC__ */
+
+/**
+ * G_GNUC_FUNCTION:
+ *
+ * Expands to "" on all modern compilers, and to __FUNCTION__ on gcc
+ * version 2.x. Don't use it.
+ *
+ * Deprecated: 2.16: Use G_STRFUNC() instead
+ */
+
+/**
+ * G_GNUC_PRETTY_FUNCTION:
+ *
+ * Expands to "" on all modern compilers, and to __PRETTY_FUNCTION__
+ * on gcc version 2.x. Don't use it.
+ *
+ * Deprecated: 2.16: Use G_STRFUNC() instead
+ */
+
+/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
+ * macros, so we can refer to them as strings unconditionally.
+ * usage not-recommended since gcc-3.0
+ *
+ * Mark them as deprecated since 2.26, since that’s when version macros were
+ * introduced.
+ */
+#if defined (__GNUC__) && (__GNUC__ < 3)
+#define G_GNUC_FUNCTION __FUNCTION__ GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC)
+#define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__ GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC)
+#else /* !__GNUC__ */
+#define G_GNUC_FUNCTION "" GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC)
+#define G_GNUC_PRETTY_FUNCTION "" GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC)
+#endif /* !__GNUC__ */
+
+#if g_macro__has_feature(attribute_analyzer_noreturn) && defined(__clang_analyzer__)
+#define G_ANALYZER_ANALYZING 1
+#define G_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
+#else
+#define G_ANALYZER_ANALYZING 0
+#define G_ANALYZER_NORETURN
+#endif
+
+#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
+#define G_STRINGIFY_ARG(contents) #contents
+
+#ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
+#define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
+#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+#define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
+#elif (defined(__cplusplus) && __cplusplus >= 201103L) || \
+ (defined(__cplusplus) && defined (_MSC_VER) && (_MSC_VER >= 1600)) || \
+ (defined (_MSC_VER) && (_MSC_VER >= 1800))
+#define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false")
+#else
+#ifdef __COUNTER__
+#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
+#else
+#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __LINE__)[(expr) ? 1 : -1] G_GNUC_UNUSED
+#endif
+#endif /* __STDC_VERSION__ */
+#define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
+#endif /* !__GI_SCANNER__ */
+
+/* Provide a string identifying the current code position */
+#if defined(__GNUC__) && (__GNUC__ < 3) && !defined(__cplusplus)
+#define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"
+#else
+#define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+
+/* Provide a string identifying the current function, non-concatenatable */
+#if defined (__GNUC__) && defined (__cplusplus)
+#define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__))
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define G_STRFUNC ((const char*) (__func__))
+#elif defined (__GNUC__) || (defined(_MSC_VER) && (_MSC_VER > 1300))
+#define G_STRFUNC ((const char*) (__FUNCTION__))
+#else
+#define G_STRFUNC ((const char*) ("???"))
+#endif
+
+/* Guard C code in headers, while including them from C++ */
+#ifdef __cplusplus
+#define G_BEGIN_DECLS extern "C" {
+#define G_END_DECLS }
+#else
+#define G_BEGIN_DECLS
+#define G_END_DECLS
+#endif
+
+/* Provide definitions for some commonly used macros.
+ * Some of them are only provided if they haven't already
+ * been defined. It is assumed that if they are already
+ * defined then the current definition is correct.
+ */
+#ifndef NULL
+# ifdef __cplusplus
+# define NULL (0L)
+# else /* !__cplusplus */
+# define NULL ((void*) 0)
+# endif /* !__cplusplus */
+#endif
+
+#ifndef FALSE
+#define FALSE (0)
+#endif
+
+#ifndef TRUE
+#define TRUE (!FALSE)
+#endif
+
+#undef MAX
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#undef MIN
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+#undef ABS
+#define ABS(a) (((a) < 0) ? -(a) : (a))
+
+#undef CLAMP
+#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
+
+#define G_APPROX_VALUE(a, b, epsilon) \
+ (((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon))
+
+/* Count the number of elements in an array. The array must be defined
+ * as such; using this with a dynamically allocated array will give
+ * incorrect results.
+ */
+#define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
+
+/* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
+ */
+#define GPOINTER_TO_SIZE(p) ((gsize) (p))
+#define GSIZE_TO_POINTER(s) ((gpointer) (gsize) (s))
+
+/* Provide convenience macros for handling structure
+ * fields through their offsets.
+ */
+
+#if (defined(__GNUC__) && __GNUC__ >= 4) || defined (_MSC_VER)
+#define G_STRUCT_OFFSET(struct_type, member) \
+ ((glong) offsetof (struct_type, member))
+#else
+#define G_STRUCT_OFFSET(struct_type, member) \
+ ((glong) ((guint8*) &((struct_type*) 0)->member))
+#endif
+
+#define G_STRUCT_MEMBER_P(struct_p, struct_offset) \
+ ((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
+#define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) \
+ (*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
+
+/* Provide simple macro statement wrappers:
+ * G_STMT_START { statements; } G_STMT_END;
+ * This can be used as a single statement, like:
+ * if (x) G_STMT_START { ... } G_STMT_END; else ...
+ * This intentionally does not use compiler extensions like GCC's '({...})' to
+ * avoid portability issue or side effects when compiled with different compilers.
+ * MSVC complains about "while(0)": C4127: "Conditional expression is constant",
+ * so we use __pragma to avoid the warning since the use here is intentional.
+ */
+#if !(defined (G_STMT_START) && defined (G_STMT_END))
+#define G_STMT_START do
+#if defined (_MSC_VER) && (_MSC_VER >= 1500)
+#define G_STMT_END \
+ __pragma(warning(push)) \
+ __pragma(warning(disable:4127)) \
+ while(0) \
+ __pragma(warning(pop))
+#else
+#define G_STMT_END while (0)
+#endif
+#endif
+
+/* Provide G_ALIGNOF alignment macro.
+ *
+ * Note we cannot use the gcc __alignof__ operator here, as that returns the
+ * preferred alignment rather than the minimal alignment. See
+ * https://gitlab.gnome.org/GNOME/glib/merge_requests/538/diffs#note_390790.
+ */
+
+/**
+ * G_ALIGNOF
+ * @type: a type-name
+ *
+ * Return the minimal alignment required by the platform ABI for values of the given
+ * type. The address of a variable or struct member of the given type must always be
+ * a multiple of this alignment. For example, most platforms require int variables
+ * to be aligned at a 4-byte boundary, so `G_ALIGNOF (int)` is 4 on most platforms.
+ *
+ * Note this is not necessarily the same as the value returned by GCC’s
+ * `__alignof__` operator, which returns the preferred alignment for a type.
+ * The preferred alignment may be a stricter alignment than the minimal
+ * alignment.
+ *
+ * Since: 2.60
+ */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
+#define G_ALIGNOF(type) _Alignof (type)
+#else
+#define G_ALIGNOF(type) (G_STRUCT_OFFSET (struct { char a; type b; }, b))
+#endif
+
+/**
+ * G_CONST_RETURN:
+ *
+ * If %G_DISABLE_CONST_RETURNS is defined, this macro expands
+ * to nothing. By default, the macro expands to const. The macro
+ * can be used in place of const for functions that return a value
+ * that should not be modified. The purpose of this macro is to allow
+ * us to turn on const for returned constant strings by default, while
+ * allowing programmers who find that annoying to turn it off. This macro
+ * should only be used for return values and for "out" parameters, it
+ * doesn't make sense for "in" parameters.
+ *
+ * Deprecated: 2.30: API providers should replace all existing uses with
+ * const and API consumers should adjust their code accordingly
+ */
+#ifdef G_DISABLE_CONST_RETURNS
+#define G_CONST_RETURN GLIB_DEPRECATED_MACRO_IN_2_30_FOR(const)
+#else
+#define G_CONST_RETURN const GLIB_DEPRECATED_MACRO_IN_2_30_FOR(const)
+#endif
+
+/*
+ * The G_LIKELY and G_UNLIKELY macros let the programmer give hints to
+ * the compiler about the expected result of an expression. Some compilers
+ * can use this information for optimizations.
+ *
+ * The _G_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
+ * putting assignments in g_return_if_fail ().
+ */
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+#define _G_BOOLEAN_EXPR(expr) \
+ G_GNUC_EXTENSION ({ \
+ int _g_boolean_var_; \
+ if (expr) \
+ _g_boolean_var_ = 1; \
+ else \
+ _g_boolean_var_ = 0; \
+ _g_boolean_var_; \
+})
+#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
+#define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 0))
+#else
+#define G_LIKELY(expr) (expr)
+#define G_UNLIKELY(expr) (expr)
+#endif
+
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || defined (__clang__)
+#define G_DEPRECATED __attribute__((__deprecated__))
+#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
+#define G_DEPRECATED __declspec(deprecated)
+#else
+#define G_DEPRECATED
+#endif
+
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined (__clang__)
+#define G_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
+#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
+#define G_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
+#else
+#define G_DEPRECATED_FOR(f) G_DEPRECATED
+#endif
+
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined (__clang__)
+#define G_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available before " #maj "." #min)))
+#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
+#define G_UNAVAILABLE(maj,min) __declspec(deprecated("is not available before " #maj "." #min))
+#else
+#define G_UNAVAILABLE(maj,min) G_DEPRECATED
+#endif
+
+#ifndef _GLIB_EXTERN
+#define _GLIB_EXTERN extern
+#endif
+
+/* These macros are used to mark deprecated symbols in GLib headers,
+ * and thus have to be exposed in installed headers. But please
+ * do *not* use them in other projects. Instead, use G_DEPRECATED
+ * or define your own wrappers around it.
+ */
+
+#ifdef GLIB_DISABLE_DEPRECATION_WARNINGS
+#define GLIB_DEPRECATED _GLIB_EXTERN
+#define GLIB_DEPRECATED_FOR(f) _GLIB_EXTERN
+#define GLIB_UNAVAILABLE(maj,min) _GLIB_EXTERN
+#else
+#define GLIB_DEPRECATED G_DEPRECATED _GLIB_EXTERN
+#define GLIB_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GLIB_EXTERN
+#define GLIB_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GLIB_EXTERN
+#endif
+
+#if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || \
+ __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))
+#define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x))
+#define GLIB_DEPRECATED_MACRO _GLIB_GNUC_DO_PRAGMA(GCC warning "Deprecated pre-processor symbol")
+#define GLIB_DEPRECATED_MACRO_FOR(f) _GLIB_GNUC_DO_PRAGMA(GCC warning #f)
+#define GLIB_UNAVAILABLE_MACRO(maj,min) _GLIB_GNUC_DO_PRAGMA(GCC warning "Not available before " #maj "." #min)
+#else
+#define GLIB_DEPRECATED_MACRO
+#define GLIB_DEPRECATED_MACRO_FOR(f)
+#define GLIB_UNAVAILABLE_MACRO(maj,min)
+#endif
+
+#if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \
+ ((defined (__GNUC__) && (__GNUC__ > 6 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1))) || \
+ (defined (__clang_major__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0))))
+#define GLIB_DEPRECATED_ENUMERATOR G_DEPRECATED
+#define GLIB_DEPRECATED_ENUMERATOR_FOR(f) G_DEPRECATED_FOR(f)
+#define GLIB_UNAVAILABLE_ENUMERATOR(maj,min) G_UNAVAILABLE(maj,min)
+#else
+#define GLIB_DEPRECATED_ENUMERATOR
+#define GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+#define GLIB_UNAVAILABLE_ENUMERATOR(maj,min)
+#endif
+
+#if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \
+ ((defined (__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || \
+ (defined (__clang_major__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0))))
+#define GLIB_DEPRECATED_TYPE G_DEPRECATED
+#define GLIB_DEPRECATED_TYPE_FOR(f) G_DEPRECATED_FOR(f)
+#define GLIB_UNAVAILABLE_TYPE(maj,min) G_UNAVAILABLE(maj,min)
+#else
+#define GLIB_DEPRECATED_TYPE
+#define GLIB_DEPRECATED_TYPE_FOR(f)
+#define GLIB_UNAVAILABLE_TYPE(maj,min)
+#endif
+
+#ifndef __GI_SCANNER__
+
+#if defined (__GNUC__) || defined (__clang__)
+
+/* these macros are private */
+#define _GLIB_AUTOPTR_FUNC_NAME(TypeName) glib_autoptr_cleanup_##TypeName
+#define _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) glib_autoptr_clear_##TypeName
+#define _GLIB_AUTOPTR_TYPENAME(TypeName) TypeName##_autoptr
+#define _GLIB_AUTOPTR_LIST_FUNC_NAME(TypeName) glib_listautoptr_cleanup_##TypeName
+#define _GLIB_AUTOPTR_LIST_TYPENAME(TypeName) TypeName##_listautoptr
+#define _GLIB_AUTOPTR_SLIST_FUNC_NAME(TypeName) glib_slistautoptr_cleanup_##TypeName
+#define _GLIB_AUTOPTR_SLIST_TYPENAME(TypeName) TypeName##_slistautoptr
+#define _GLIB_AUTOPTR_QUEUE_FUNC_NAME(TypeName) glib_queueautoptr_cleanup_##TypeName
+#define _GLIB_AUTOPTR_QUEUE_TYPENAME(TypeName) TypeName##_queueautoptr
+#define _GLIB_AUTO_FUNC_NAME(TypeName) glib_auto_cleanup_##TypeName
+#define _GLIB_CLEANUP(func) __attribute__((cleanup(func)))
+#define _GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS(TypeName, ParentName, cleanup) \
+ typedef TypeName *_GLIB_AUTOPTR_TYPENAME(TypeName); \
+ typedef GList *_GLIB_AUTOPTR_LIST_TYPENAME(TypeName); \
+ typedef GSList *_GLIB_AUTOPTR_SLIST_TYPENAME(TypeName); \
+ typedef GQueue *_GLIB_AUTOPTR_QUEUE_TYPENAME(TypeName); \
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) (TypeName *_ptr) \
+ { if (_ptr) (cleanup) ((ParentName *) _ptr); } \
+ static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_FUNC_NAME(TypeName) (TypeName **_ptr) \
+ { _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) (*_ptr); } \
+ static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_LIST_FUNC_NAME(TypeName) (GList **_l) \
+ { g_list_free_full (*_l, (GDestroyNotify) (void(*)(void)) cleanup); } \
+ static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_SLIST_FUNC_NAME(TypeName) (GSList **_l) \
+ { g_slist_free_full (*_l, (GDestroyNotify) (void(*)(void)) cleanup); } \
+ static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_QUEUE_FUNC_NAME(TypeName) (GQueue **_q) \
+ { if (*_q) g_queue_free_full (*_q, (GDestroyNotify) (void(*)(void)) cleanup); } \
+ G_GNUC_END_IGNORE_DEPRECATIONS
+#define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName) \
+ _GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS(ModuleObjName, ParentName, _GLIB_AUTOPTR_CLEAR_FUNC_NAME(ParentName))
+
+
+/* these macros are API */
+#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func) \
+ _GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS(TypeName, TypeName, func)
+#define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func) \
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { (func) (_ptr); } \
+ G_GNUC_END_IGNORE_DEPRECATIONS
+#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none) \
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { if (*_ptr != none) (func) (*_ptr); } \
+ G_GNUC_END_IGNORE_DEPRECATIONS
+#define g_autoptr(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_TYPENAME(TypeName)
+#define g_autolist(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_LIST_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_LIST_TYPENAME(TypeName)
+#define g_autoslist(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_SLIST_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_SLIST_TYPENAME(TypeName)
+#define g_autoqueue(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_QUEUE_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_QUEUE_TYPENAME(TypeName)
+#define g_auto(TypeName) _GLIB_CLEANUP(_GLIB_AUTO_FUNC_NAME(TypeName)) TypeName
+#define g_autofree _GLIB_CLEANUP(g_autoptr_cleanup_generic_gfree)
+
+#else /* not GNU C */
+/* this (dummy) macro is private */
+#define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName)
+
+/* these (dummy) macros are API */
+#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
+#define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func)
+#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)
+
+/* no declaration of g_auto() or g_autoptr() here */
+#endif /* __GNUC__ */
+
+#else
+
+#define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName)
+
+#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
+#define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func)
+#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)
+
+#endif /* __GI_SCANNER__ */
+
+#endif /* __G_MACROS_H__ */
diff --git a/include/glib/glib/gmain.h b/include/glib/glib/gmain.h
new file mode 100644
index 0000000000..6325ecbe3f
--- /dev/null
+++ b/include/glib/glib/gmain.h
@@ -0,0 +1,689 @@
+/* gmain.h - the GLib Main loop
+ * Copyright (C) 1998-2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_MAIN_H__
+#define __G_MAIN_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gpoll.h>
+#include <glib/gslist.h>
+#include <glib/gthread.h>
+
+G_BEGIN_DECLS
+
+typedef enum /*< flags >*/
+{
+ G_IO_IN GLIB_SYSDEF_POLLIN,
+ G_IO_OUT GLIB_SYSDEF_POLLOUT,
+ G_IO_PRI GLIB_SYSDEF_POLLPRI,
+ G_IO_ERR GLIB_SYSDEF_POLLERR,
+ G_IO_HUP GLIB_SYSDEF_POLLHUP,
+ G_IO_NVAL GLIB_SYSDEF_POLLNVAL
+} GIOCondition;
+
+
+/**
+ * GMainContext:
+ *
+ * The `GMainContext` struct is an opaque data
+ * type representing a set of sources to be handled in a main loop.
+ */
+typedef struct _GMainContext GMainContext;
+
+/**
+ * GMainLoop:
+ *
+ * The `GMainLoop` struct is an opaque data type
+ * representing the main event loop of a GLib or GTK+ application.
+ */
+typedef struct _GMainLoop GMainLoop;
+
+/**
+ * GSource:
+ *
+ * The `GSource` struct is an opaque data type
+ * representing an event source.
+ */
+typedef struct _GSource GSource;
+typedef struct _GSourcePrivate GSourcePrivate;
+
+/**
+ * GSourceCallbackFuncs:
+ * @ref: Called when a reference is added to the callback object
+ * @unref: Called when a reference to the callback object is dropped
+ * @get: Called to extract the callback function and data from the
+ * callback object.
+ *
+ * The `GSourceCallbackFuncs` struct contains
+ * functions for managing callback objects.
+ */
+typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs;
+
+/**
+ * GSourceFuncs:
+ * @prepare: Called before all the file descriptors are polled. If the
+ * source can determine that it is ready here (without waiting for the
+ * results of the poll() call) it should return %TRUE. It can also return
+ * a @timeout_ value which should be the maximum timeout (in milliseconds)
+ * which should be passed to the poll() call. The actual timeout used will
+ * be -1 if all sources returned -1, or it will be the minimum of all
+ * the @timeout_ values returned which were >= 0. Since 2.36 this may
+ * be %NULL, in which case the effect is as if the function always returns
+ * %FALSE with a timeout of -1. If @prepare returns a
+ * timeout and the source also has a ready time set, then the
+ * lower of the two will be used.
+ * @check: Called after all the file descriptors are polled. The source
+ * should return %TRUE if it is ready to be dispatched. Note that some
+ * time may have passed since the previous prepare function was called,
+ * so the source should be checked again here. Since 2.36 this may
+ * be %NULL, in which case the effect is as if the function always returns
+ * %FALSE.
+ * @dispatch: Called to dispatch the event source, after it has returned
+ * %TRUE in either its @prepare or its @check function, or if a ready time
+ * has been reached. The @dispatch function receives a callback function and
+ * user data. The callback function may be %NULL if the source was never
+ * connected to a callback using g_source_set_callback(). The @dispatch
+ * function should call the callback function with @user_data and whatever
+ * additional parameters are needed for this type of event source. The
+ * return value of the @dispatch function should be #G_SOURCE_REMOVE if the
+ * source should be removed or #G_SOURCE_CONTINUE to keep it.
+ * @finalize: Called when the source is finalized. At this point, the source
+ * will have been destroyed, had its callback cleared, and have been removed
+ * from its #GMainContext, but it will still have its final reference count,
+ * so methods can be called on it from within this function.
+ *
+ * The `GSourceFuncs` struct contains a table of
+ * functions used to handle event sources in a generic manner.
+ *
+ * For idle sources, the prepare and check functions always return %TRUE
+ * to indicate that the source is always ready to be processed. The prepare
+ * function also returns a timeout value of 0 to ensure that the poll() call
+ * doesn't block (since that would be time wasted which could have been spent
+ * running the idle function).
+ *
+ * For timeout sources, the prepare and check functions both return %TRUE
+ * if the timeout interval has expired. The prepare function also returns
+ * a timeout value to ensure that the poll() call doesn't block too long
+ * and miss the next timeout.
+ *
+ * For file descriptor sources, the prepare function typically returns %FALSE,
+ * since it must wait until poll() has been called before it knows whether
+ * any events need to be processed. It sets the returned timeout to -1 to
+ * indicate that it doesn't mind how long the poll() call blocks. In the
+ * check function, it tests the results of the poll() call to see if the
+ * required condition has been met, and returns %TRUE if so.
+ */
+typedef struct _GSourceFuncs GSourceFuncs;
+
+/**
+ * GPid:
+ *
+ * A type which is used to hold a process identification.
+ *
+ * On UNIX, processes are identified by a process id (an integer),
+ * while Windows uses process handles (which are pointers).
+ *
+ * GPid is used in GLib only for descendant processes spawned with
+ * the g_spawn functions.
+ */
+/* defined in glibconfig.h */
+
+/**
+ * G_PID_FORMAT:
+ *
+ * A format specifier that can be used in printf()-style format strings
+ * when printing a #GPid.
+ *
+ * Since: 2.50
+ */
+/* defined in glibconfig.h */
+
+/**
+ * GSourceFunc:
+ * @user_data: data passed to the function, set when the source was
+ * created with one of the above functions
+ *
+ * Specifies the type of function passed to g_timeout_add(),
+ * g_timeout_add_full(), g_idle_add(), and g_idle_add_full().
+ *
+ * When calling g_source_set_callback(), you may need to cast a function of a
+ * different type to this type. Use G_SOURCE_FUNC() to avoid warnings about
+ * incompatible function types.
+ *
+ * Returns: %FALSE if the source should be removed. #G_SOURCE_CONTINUE and
+ * #G_SOURCE_REMOVE are more memorable names for the return value.
+ */
+typedef gboolean (*GSourceFunc) (gpointer user_data);
+
+/**
+ * G_SOURCE_FUNC:
+ * @f: a function pointer.
+ *
+ * Cast a function pointer to a #GSourceFunc, suppressing warnings from GCC 8
+ * onwards with `-Wextra` or `-Wcast-function-type` enabled about the function
+ * types being incompatible.
+ *
+ * For example, the correct type of callback for a source created by
+ * g_child_watch_source_new() is #GChildWatchFunc, which accepts more arguments
+ * than #GSourceFunc. Casting the function with `(GSourceFunc)` to call
+ * g_source_set_callback() will trigger a warning, even though it will be cast
+ * back to the correct type before it is called by the source.
+ *
+ * Since: 2.58
+ */
+#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f))
+
+/**
+ * GChildWatchFunc:
+ * @pid: the process id of the child process
+ * @status: Status information about the child process, encoded
+ * in a platform-specific manner
+ * @user_data: user data passed to g_child_watch_add()
+ *
+ * Prototype of a #GChildWatchSource callback, called when a child
+ * process has exited. To interpret @status, see the documentation
+ * for g_spawn_check_exit_status().
+ */
+typedef void (*GChildWatchFunc) (GPid pid,
+ gint status,
+ gpointer user_data);
+struct _GSource
+{
+ /*< private >*/
+ gpointer callback_data;
+ GSourceCallbackFuncs *callback_funcs;
+
+ const GSourceFuncs *source_funcs;
+ guint ref_count;
+
+ GMainContext *context;
+
+ gint priority;
+ guint flags;
+ guint source_id;
+
+ GSList *poll_fds;
+
+ GSource *prev;
+ GSource *next;
+
+ char *name;
+
+ GSourcePrivate *priv;
+};
+
+struct _GSourceCallbackFuncs
+{
+ void (*ref) (gpointer cb_data);
+ void (*unref) (gpointer cb_data);
+ void (*get) (gpointer cb_data,
+ GSource *source,
+ GSourceFunc *func,
+ gpointer *data);
+};
+
+/**
+ * GSourceDummyMarshal:
+ *
+ * This is just a placeholder for #GClosureMarshal,
+ * which cannot be used here for dependency reasons.
+ */
+typedef void (*GSourceDummyMarshal) (void);
+
+struct _GSourceFuncs
+{
+ gboolean (*prepare) (GSource *source,
+ gint *timeout_);
+ gboolean (*check) (GSource *source);
+ gboolean (*dispatch) (GSource *source,
+ GSourceFunc callback,
+ gpointer user_data);
+ void (*finalize) (GSource *source); /* Can be NULL */
+
+ /*< private >*/
+ /* For use by g_source_set_closure */
+ GSourceFunc closure_callback;
+ GSourceDummyMarshal closure_marshal; /* Really is of type GClosureMarshal */
+};
+
+/* Standard priorities */
+
+/**
+ * G_PRIORITY_HIGH:
+ *
+ * Use this for high priority event sources.
+ *
+ * It is not used within GLib or GTK+.
+ */
+#define G_PRIORITY_HIGH -100
+
+/**
+ * G_PRIORITY_DEFAULT:
+ *
+ * Use this for default priority event sources.
+ *
+ * In GLib this priority is used when adding timeout functions
+ * with g_timeout_add(). In GDK this priority is used for events
+ * from the X server.
+ */
+#define G_PRIORITY_DEFAULT 0
+
+/**
+ * G_PRIORITY_HIGH_IDLE:
+ *
+ * Use this for high priority idle functions.
+ *
+ * GTK+ uses #G_PRIORITY_HIGH_IDLE + 10 for resizing operations,
+ * and #G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is
+ * done to ensure that any pending resizes are processed before any
+ * pending redraws, so that widgets are not redrawn twice unnecessarily.)
+ */
+#define G_PRIORITY_HIGH_IDLE 100
+
+/**
+ * G_PRIORITY_DEFAULT_IDLE:
+ *
+ * Use this for default priority idle functions.
+ *
+ * In GLib this priority is used when adding idle functions with
+ * g_idle_add().
+ */
+#define G_PRIORITY_DEFAULT_IDLE 200
+
+/**
+ * G_PRIORITY_LOW:
+ *
+ * Use this for very low priority background tasks.
+ *
+ * It is not used within GLib or GTK+.
+ */
+#define G_PRIORITY_LOW 300
+
+/**
+ * G_SOURCE_REMOVE:
+ *
+ * Use this macro as the return value of a #GSourceFunc to remove
+ * the #GSource from the main loop.
+ *
+ * Since: 2.32
+ */
+#define G_SOURCE_REMOVE FALSE
+
+/**
+ * G_SOURCE_CONTINUE:
+ *
+ * Use this macro as the return value of a #GSourceFunc to leave
+ * the #GSource in the main loop.
+ *
+ * Since: 2.32
+ */
+#define G_SOURCE_CONTINUE TRUE
+
+/* GMainContext: */
+
+GLIB_AVAILABLE_IN_ALL
+GMainContext *g_main_context_new (void);
+GLIB_AVAILABLE_IN_ALL
+GMainContext *g_main_context_ref (GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_unref (GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+GMainContext *g_main_context_default (void);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_main_context_iteration (GMainContext *context,
+ gboolean may_block);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_main_context_pending (GMainContext *context);
+
+/* For implementation of legacy interfaces
+ */
+GLIB_AVAILABLE_IN_ALL
+GSource *g_main_context_find_source_by_id (GMainContext *context,
+ guint source_id);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_main_context_find_source_by_user_data (GMainContext *context,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_main_context_find_source_by_funcs_user_data (GMainContext *context,
+ GSourceFuncs *funcs,
+ gpointer user_data);
+
+/* Low level functions for implementing custom main loops.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_wakeup (GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_main_context_acquire (GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_release (GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_main_context_is_owner (GMainContext *context);
+GLIB_DEPRECATED_IN_2_58_FOR(g_main_context_is_owner)
+gboolean g_main_context_wait (GMainContext *context,
+ GCond *cond,
+ GMutex *mutex);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_main_context_prepare (GMainContext *context,
+ gint *priority);
+GLIB_AVAILABLE_IN_ALL
+gint g_main_context_query (GMainContext *context,
+ gint max_priority,
+ gint *timeout_,
+ GPollFD *fds,
+ gint n_fds);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_main_context_check (GMainContext *context,
+ gint max_priority,
+ GPollFD *fds,
+ gint n_fds);
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_dispatch (GMainContext *context);
+
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_set_poll_func (GMainContext *context,
+ GPollFunc func);
+GLIB_AVAILABLE_IN_ALL
+GPollFunc g_main_context_get_poll_func (GMainContext *context);
+
+/* Low level functions for use by source implementations
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_add_poll (GMainContext *context,
+ GPollFD *fd,
+ gint priority);
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_remove_poll (GMainContext *context,
+ GPollFD *fd);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_main_depth (void);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_main_current_source (void);
+
+/* GMainContexts for other threads
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_push_thread_default (GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_pop_thread_default (GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+GMainContext *g_main_context_get_thread_default (void);
+GLIB_AVAILABLE_IN_ALL
+GMainContext *g_main_context_ref_thread_default (void);
+
+/* GMainLoop: */
+
+GLIB_AVAILABLE_IN_ALL
+GMainLoop *g_main_loop_new (GMainContext *context,
+ gboolean is_running);
+GLIB_AVAILABLE_IN_ALL
+void g_main_loop_run (GMainLoop *loop);
+GLIB_AVAILABLE_IN_ALL
+void g_main_loop_quit (GMainLoop *loop);
+GLIB_AVAILABLE_IN_ALL
+GMainLoop *g_main_loop_ref (GMainLoop *loop);
+GLIB_AVAILABLE_IN_ALL
+void g_main_loop_unref (GMainLoop *loop);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_main_loop_is_running (GMainLoop *loop);
+GLIB_AVAILABLE_IN_ALL
+GMainContext *g_main_loop_get_context (GMainLoop *loop);
+
+/* GSource: */
+
+GLIB_AVAILABLE_IN_ALL
+GSource *g_source_new (GSourceFuncs *source_funcs,
+ guint struct_size);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_source_ref (GSource *source);
+GLIB_AVAILABLE_IN_ALL
+void g_source_unref (GSource *source);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_source_attach (GSource *source,
+ GMainContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_source_destroy (GSource *source);
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_priority (GSource *source,
+ gint priority);
+GLIB_AVAILABLE_IN_ALL
+gint g_source_get_priority (GSource *source);
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_can_recurse (GSource *source,
+ gboolean can_recurse);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_source_get_can_recurse (GSource *source);
+GLIB_AVAILABLE_IN_ALL
+guint g_source_get_id (GSource *source);
+
+GLIB_AVAILABLE_IN_ALL
+GMainContext *g_source_get_context (GSource *source);
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_callback (GSource *source,
+ GSourceFunc func,
+ gpointer data,
+ GDestroyNotify notify);
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_funcs (GSource *source,
+ GSourceFuncs *funcs);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_source_is_destroyed (GSource *source);
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_name (GSource *source,
+ const char *name);
+GLIB_AVAILABLE_IN_ALL
+const char * g_source_get_name (GSource *source);
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_name_by_id (guint tag,
+ const char *name);
+
+GLIB_AVAILABLE_IN_2_36
+void g_source_set_ready_time (GSource *source,
+ gint64 ready_time);
+GLIB_AVAILABLE_IN_2_36
+gint64 g_source_get_ready_time (GSource *source);
+
+#ifdef G_OS_UNIX
+GLIB_AVAILABLE_IN_2_36
+gpointer g_source_add_unix_fd (GSource *source,
+ gint fd,
+ GIOCondition events);
+GLIB_AVAILABLE_IN_2_36
+void g_source_modify_unix_fd (GSource *source,
+ gpointer tag,
+ GIOCondition new_events);
+GLIB_AVAILABLE_IN_2_36
+void g_source_remove_unix_fd (GSource *source,
+ gpointer tag);
+GLIB_AVAILABLE_IN_2_36
+GIOCondition g_source_query_unix_fd (GSource *source,
+ gpointer tag);
+#endif
+
+/* Used to implement g_source_connect_closure and internally*/
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_callback_indirect (GSource *source,
+ gpointer callback_data,
+ GSourceCallbackFuncs *callback_funcs);
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_add_poll (GSource *source,
+ GPollFD *fd);
+GLIB_AVAILABLE_IN_ALL
+void g_source_remove_poll (GSource *source,
+ GPollFD *fd);
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_add_child_source (GSource *source,
+ GSource *child_source);
+GLIB_AVAILABLE_IN_ALL
+void g_source_remove_child_source (GSource *source,
+ GSource *child_source);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_28_FOR(g_source_get_time)
+void g_source_get_current_time (GSource *source,
+ GTimeVal *timeval);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_ALL
+gint64 g_source_get_time (GSource *source);
+
+ /* void g_source_connect_closure (GSource *source,
+ GClosure *closure);
+ */
+
+/* Specific source types
+ */
+GLIB_AVAILABLE_IN_ALL
+GSource *g_idle_source_new (void);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_child_watch_source_new (GPid pid);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_timeout_source_new (guint interval);
+GLIB_AVAILABLE_IN_ALL
+GSource *g_timeout_source_new_seconds (guint interval);
+
+/* Miscellaneous functions
+ */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62_FOR(g_get_real_time)
+void g_get_current_time (GTimeVal *result);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_ALL
+gint64 g_get_monotonic_time (void);
+GLIB_AVAILABLE_IN_ALL
+gint64 g_get_real_time (void);
+
+
+/* Source manipulation by ID */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_source_remove (guint tag);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_source_remove_by_user_data (gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
+ gpointer user_data);
+
+/**
+ * GClearHandleFunc:
+ * @handle_id: the handle ID to clear
+ *
+ * Specifies the type of function passed to g_clear_handle_id().
+ * The implementation is expected to free the resource identified
+ * by @handle_id; for instance, if @handle_id is a #GSource ID,
+ * g_source_remove() can be used.
+ *
+ * Since: 2.56
+ */
+typedef void (* GClearHandleFunc) (guint handle_id);
+
+GLIB_AVAILABLE_IN_2_56
+void g_clear_handle_id (guint *tag_ptr,
+ GClearHandleFunc clear_func);
+
+#define g_clear_handle_id(tag_ptr, clear_func) \
+ G_STMT_START { \
+ G_STATIC_ASSERT (sizeof *(tag_ptr) == sizeof (guint)); \
+ guint *_tag_ptr = (guint *) (tag_ptr); \
+ guint _handle_id; \
+ \
+ _handle_id = *_tag_ptr; \
+ if (_handle_id > 0) \
+ { \
+ *_tag_ptr = 0; \
+ clear_func (_handle_id); \
+ } \
+ } G_STMT_END \
+ GLIB_AVAILABLE_MACRO_IN_2_56
+
+/* Idles, child watchers and timeouts */
+GLIB_AVAILABLE_IN_ALL
+guint g_timeout_add_full (gint priority,
+ guint interval,
+ GSourceFunc function,
+ gpointer data,
+ GDestroyNotify notify);
+GLIB_AVAILABLE_IN_ALL
+guint g_timeout_add (guint interval,
+ GSourceFunc function,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_timeout_add_seconds_full (gint priority,
+ guint interval,
+ GSourceFunc function,
+ gpointer data,
+ GDestroyNotify notify);
+GLIB_AVAILABLE_IN_ALL
+guint g_timeout_add_seconds (guint interval,
+ GSourceFunc function,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_child_watch_add_full (gint priority,
+ GPid pid,
+ GChildWatchFunc function,
+ gpointer data,
+ GDestroyNotify notify);
+GLIB_AVAILABLE_IN_ALL
+guint g_child_watch_add (GPid pid,
+ GChildWatchFunc function,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_idle_add (GSourceFunc function,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_idle_add_full (gint priority,
+ GSourceFunc function,
+ gpointer data,
+ GDestroyNotify notify);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_idle_remove_by_data (gpointer data);
+
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_invoke_full (GMainContext *context,
+ gint priority,
+ GSourceFunc function,
+ gpointer data,
+ GDestroyNotify notify);
+GLIB_AVAILABLE_IN_ALL
+void g_main_context_invoke (GMainContext *context,
+ GSourceFunc function,
+ 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_UNIX
+GLIB_VAR GSourceFuncs g_unix_signal_funcs;
+GLIB_VAR GSourceFuncs g_unix_fd_source_funcs;
+#endif
+
+G_END_DECLS
+
+#endif /* __G_MAIN_H__ */
diff --git a/include/glib/glib/gmappedfile.h b/include/glib/glib/gmappedfile.h
new file mode 100644
index 0000000000..8256811e6c
--- /dev/null
+++ b/include/glib/glib/gmappedfile.h
@@ -0,0 +1,58 @@
+/* GLIB - Library of useful routines for C programming
+ * gmappedfile.h: Simplified wrapper around the mmap function
+ *
+ * Copyright 2005 Matthias Clasen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_MAPPED_FILE_H__
+#define __G_MAPPED_FILE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gbytes.h>
+#include <glib/gerror.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GMappedFile GMappedFile;
+
+GLIB_AVAILABLE_IN_ALL
+GMappedFile *g_mapped_file_new (const gchar *filename,
+ gboolean writable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GMappedFile *g_mapped_file_new_from_fd (gint fd,
+ gboolean writable,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gsize g_mapped_file_get_length (GMappedFile *file);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_mapped_file_get_contents (GMappedFile *file);
+GLIB_AVAILABLE_IN_2_34
+GBytes * g_mapped_file_get_bytes (GMappedFile *file);
+GLIB_AVAILABLE_IN_ALL
+GMappedFile *g_mapped_file_ref (GMappedFile *file);
+GLIB_AVAILABLE_IN_ALL
+void g_mapped_file_unref (GMappedFile *file);
+
+GLIB_DEPRECATED_FOR(g_mapped_file_unref)
+void g_mapped_file_free (GMappedFile *file);
+
+G_END_DECLS
+
+#endif /* __G_MAPPED_FILE_H__ */
diff --git a/include/glib/glib/gmarkup.h b/include/glib/glib/gmarkup.h
new file mode 100644
index 0000000000..96375b55a1
--- /dev/null
+++ b/include/glib/glib/gmarkup.h
@@ -0,0 +1,261 @@
+/* gmarkup.h - Simple XML-like string parser/writer
+ *
+ * Copyright 2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_MARKUP_H__
+#define __G_MARKUP_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <stdarg.h>
+
+#include <glib/gerror.h>
+#include <glib/gslist.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GMarkupError:
+ * @G_MARKUP_ERROR_BAD_UTF8: text being parsed was not valid UTF-8
+ * @G_MARKUP_ERROR_EMPTY: document contained nothing, or only whitespace
+ * @G_MARKUP_ERROR_PARSE: document was ill-formed
+ * @G_MARKUP_ERROR_UNKNOWN_ELEMENT: error should be set by #GMarkupParser
+ * functions; element wasn't known
+ * @G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE: error should be set by #GMarkupParser
+ * functions; attribute wasn't known
+ * @G_MARKUP_ERROR_INVALID_CONTENT: error should be set by #GMarkupParser
+ * functions; content was invalid
+ * @G_MARKUP_ERROR_MISSING_ATTRIBUTE: error should be set by #GMarkupParser
+ * functions; a required attribute was missing
+ *
+ * Error codes returned by markup parsing.
+ */
+typedef enum
+{
+ G_MARKUP_ERROR_BAD_UTF8,
+ G_MARKUP_ERROR_EMPTY,
+ G_MARKUP_ERROR_PARSE,
+ /* The following are primarily intended for specific GMarkupParser
+ * implementations to set.
+ */
+ G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+ G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
+ G_MARKUP_ERROR_INVALID_CONTENT,
+ G_MARKUP_ERROR_MISSING_ATTRIBUTE
+} GMarkupError;
+
+/**
+ * G_MARKUP_ERROR:
+ *
+ * Error domain for markup parsing.
+ * Errors in this domain will be from the #GMarkupError enumeration.
+ * See #GError for information on error domains.
+ */
+#define G_MARKUP_ERROR g_markup_error_quark ()
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_markup_error_quark (void);
+
+/**
+ * GMarkupParseFlags:
+ * @G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: flag you should not use
+ * @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked
+ * sections are not passed literally to the @passthrough function of
+ * the parser. Instead, the content of the section (without the
+ * `<![CDATA[` and `]]>`) is
+ * passed to the @text function. This flag was added in GLib 2.12
+ * @G_MARKUP_PREFIX_ERROR_POSITION: Normally errors caught by GMarkup
+ * itself have line/column information prefixed to them to let the
+ * caller know the location of the error. When this flag is set the
+ * location information is also prefixed to errors generated by the
+ * #GMarkupParser implementation functions
+ * @G_MARKUP_IGNORE_QUALIFIED: Ignore (don't report) qualified
+ * attributes and tags, along with their contents. A qualified
+ * attribute or tag is one that contains ':' in its name (ie: is in
+ * another namespace). Since: 2.40.
+ *
+ * Flags that affect the behaviour of the parser.
+ */
+typedef enum
+{
+ G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
+ G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1,
+ G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2,
+ G_MARKUP_IGNORE_QUALIFIED = 1 << 3
+} GMarkupParseFlags;
+
+/**
+ * GMarkupParseContext:
+ *
+ * A parse context is used to parse a stream of bytes that
+ * you expect to contain marked-up text.
+ *
+ * See g_markup_parse_context_new(), #GMarkupParser, and so
+ * on for more details.
+ */
+typedef struct _GMarkupParseContext GMarkupParseContext;
+typedef struct _GMarkupParser GMarkupParser;
+
+/**
+ * GMarkupParser:
+ * @start_element: Callback to invoke when the opening tag of an element
+ * is seen. The callback's @attribute_names and @attribute_values parameters
+ * are %NULL-terminated.
+ * @end_element: Callback to invoke when the closing tag of an element
+ * is seen. Note that this is also called for empty tags like
+ * `<empty/>`.
+ * @text: Callback to invoke when some text is seen (text is always
+ * inside an element). Note that the text of an element may be spread
+ * over multiple calls of this function. If the
+ * %G_MARKUP_TREAT_CDATA_AS_TEXT flag is set, this function is also
+ * called for the content of CDATA marked sections.
+ * @passthrough: Callback to invoke for comments, processing instructions
+ * and doctype declarations; if you're re-writing the parsed document,
+ * write the passthrough text back out in the same position. If the
+ * %G_MARKUP_TREAT_CDATA_AS_TEXT flag is not set, this function is also
+ * called for CDATA marked sections.
+ * @error: Callback to invoke when an error occurs.
+ *
+ * Any of the fields in #GMarkupParser can be %NULL, in which case they
+ * will be ignored. Except for the @error function, any of these callbacks
+ * can set an error; in particular the %G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+ * %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, and %G_MARKUP_ERROR_INVALID_CONTENT
+ * errors are intended to be set from these callbacks. If you set an error
+ * from a callback, g_markup_parse_context_parse() will report that error
+ * back to its caller.
+ */
+struct _GMarkupParser
+{
+ /* Called for open tags <foo bar="baz"> */
+ void (*start_element) (GMarkupParseContext *context,
+ const gchar *element_name,
+ const gchar **attribute_names,
+ const gchar **attribute_values,
+ gpointer user_data,
+ GError **error);
+
+ /* Called for close tags </foo> */
+ void (*end_element) (GMarkupParseContext *context,
+ const gchar *element_name,
+ gpointer user_data,
+ GError **error);
+
+ /* Called for character data */
+ /* text is not nul-terminated */
+ void (*text) (GMarkupParseContext *context,
+ const gchar *text,
+ gsize text_len,
+ gpointer user_data,
+ GError **error);
+
+ /* Called for strings that should be re-saved verbatim in this same
+ * position, but are not otherwise interpretable. At the moment
+ * this includes comments and processing instructions.
+ */
+ /* text is not nul-terminated. */
+ void (*passthrough) (GMarkupParseContext *context,
+ const gchar *passthrough_text,
+ gsize text_len,
+ gpointer user_data,
+ GError **error);
+
+ /* Called on error, including one set by other
+ * methods in the vtable. The GError should not be freed.
+ */
+ void (*error) (GMarkupParseContext *context,
+ GError *error,
+ gpointer user_data);
+};
+
+GLIB_AVAILABLE_IN_ALL
+GMarkupParseContext *g_markup_parse_context_new (const GMarkupParser *parser,
+ GMarkupParseFlags flags,
+ gpointer user_data,
+ GDestroyNotify user_data_dnotify);
+GLIB_AVAILABLE_IN_2_36
+GMarkupParseContext *g_markup_parse_context_ref (GMarkupParseContext *context);
+GLIB_AVAILABLE_IN_2_36
+void g_markup_parse_context_unref (GMarkupParseContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_markup_parse_context_free (GMarkupParseContext *context);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_markup_parse_context_parse (GMarkupParseContext *context,
+ const gchar *text,
+ gssize text_len,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_markup_parse_context_push (GMarkupParseContext *context,
+ const GMarkupParser *parser,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_markup_parse_context_pop (GMarkupParseContext *context);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_markup_parse_context_get_element (GMarkupParseContext *context);
+GLIB_AVAILABLE_IN_ALL
+const GSList * g_markup_parse_context_get_element_stack (GMarkupParseContext *context);
+
+/* For user-constructed error messages, has no precise semantics */
+GLIB_AVAILABLE_IN_ALL
+void g_markup_parse_context_get_position (GMarkupParseContext *context,
+ gint *line_number,
+ gint *char_number);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_markup_parse_context_get_user_data (GMarkupParseContext *context);
+
+/* useful when saving */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_markup_escape_text (const gchar *text,
+ gssize length);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_markup_printf_escaped (const char *format,
+ ...) G_GNUC_PRINTF (1, 2);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_markup_vprintf_escaped (const char *format,
+ va_list args) G_GNUC_PRINTF(1, 0);
+
+typedef enum
+{
+ G_MARKUP_COLLECT_INVALID,
+ G_MARKUP_COLLECT_STRING,
+ G_MARKUP_COLLECT_STRDUP,
+ G_MARKUP_COLLECT_BOOLEAN,
+ G_MARKUP_COLLECT_TRISTATE,
+
+ G_MARKUP_COLLECT_OPTIONAL = (1 << 16)
+} GMarkupCollectType;
+
+
+/* useful from start_element */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_markup_collect_attributes (const gchar *element_name,
+ const gchar **attribute_names,
+ const gchar **attribute_values,
+ GError **error,
+ GMarkupCollectType first_type,
+ const gchar *first_attr,
+ ...);
+
+G_END_DECLS
+
+#endif /* __G_MARKUP_H__ */
diff --git a/include/glib/glib/gmem.h b/include/glib/glib/gmem.h
new file mode 100644
index 0000000000..953a0182d5
--- /dev/null
+++ b/include/glib/glib/gmem.h
@@ -0,0 +1,392 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_MEM_H__
+#define __G_MEM_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gutils.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GMemVTable:
+ * @malloc: function to use for allocating memory.
+ * @realloc: function to use for reallocating memory.
+ * @free: function to use to free memory.
+ * @calloc: function to use for allocating zero-filled memory.
+ * @try_malloc: function to use for allocating memory without a default error handler.
+ * @try_realloc: function to use for reallocating memory without a default error handler.
+ *
+ * A set of functions used to perform memory allocation. The same #GMemVTable must
+ * be used for all allocations in the same program; a call to g_mem_set_vtable(),
+ * if it exists, should be prior to any use of GLib.
+ *
+ * This functions related to this has been deprecated in 2.46, and no longer work.
+ */
+typedef struct _GMemVTable GMemVTable;
+
+
+#if GLIB_SIZEOF_VOID_P > GLIB_SIZEOF_LONG
+/**
+ * G_MEM_ALIGN:
+ *
+ * Indicates the number of bytes to which memory will be aligned on the
+ * current platform.
+ */
+# define G_MEM_ALIGN GLIB_SIZEOF_VOID_P
+#else /* GLIB_SIZEOF_VOID_P <= GLIB_SIZEOF_LONG */
+# define G_MEM_ALIGN GLIB_SIZEOF_LONG
+#endif /* GLIB_SIZEOF_VOID_P <= GLIB_SIZEOF_LONG */
+
+
+/* Memory allocation functions
+ */
+
+GLIB_AVAILABLE_IN_ALL
+void g_free (gpointer mem);
+
+GLIB_AVAILABLE_IN_2_34
+void g_clear_pointer (gpointer *pp,
+ GDestroyNotify destroy);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_malloc (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_malloc0 (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_realloc (gpointer mem,
+ gsize n_bytes) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+gpointer g_try_malloc (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_try_malloc0 (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_try_realloc (gpointer mem,
+ gsize n_bytes) G_GNUC_WARN_UNUSED_RESULT;
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_malloc_n (gsize n_blocks,
+ gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_malloc0_n (gsize n_blocks,
+ gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_realloc_n (gpointer mem,
+ gsize n_blocks,
+ gsize n_block_bytes) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+gpointer g_try_malloc_n (gsize n_blocks,
+ gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_try_malloc0_n (gsize n_blocks,
+ gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_try_realloc_n (gpointer mem,
+ gsize n_blocks,
+ gsize n_block_bytes) G_GNUC_WARN_UNUSED_RESULT;
+
+#if defined(g_has_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58
+#define g_clear_pointer(pp, destroy) \
+ G_STMT_START { \
+ G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
+ __typeof__((pp)) _pp = (pp); \
+ __typeof__(*(pp)) _ptr = *_pp; \
+ *_pp = NULL; \
+ if (_ptr) \
+ (destroy) (_ptr); \
+ } G_STMT_END \
+ GLIB_AVAILABLE_MACRO_IN_2_34
+#else /* __GNUC__ */
+#define g_clear_pointer(pp, destroy) \
+ G_STMT_START { \
+ G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
+ /* Only one access, please; work around type aliasing */ \
+ union { char *in; gpointer *out; } _pp; \
+ gpointer _p; \
+ /* This assignment is needed to avoid a gcc warning */ \
+ GDestroyNotify _destroy = (GDestroyNotify) (destroy); \
+ \
+ _pp.in = (char *) (pp); \
+ _p = *_pp.out; \
+ if (_p) \
+ { \
+ *_pp.out = NULL; \
+ _destroy (_p); \
+ } \
+ } G_STMT_END \
+ GLIB_AVAILABLE_MACRO_IN_2_34
+#endif /* __GNUC__ */
+
+/**
+ * g_steal_pointer:
+ * @pp: (not nullable): a pointer to a pointer
+ *
+ * Sets @pp to %NULL, returning the value that was there before.
+ *
+ * Conceptually, this transfers the ownership of the pointer from the
+ * referenced variable to the "caller" of the macro (ie: "steals" the
+ * reference).
+ *
+ * The return value will be properly typed, according to the type of
+ * @pp.
+ *
+ * This can be very useful when combined with g_autoptr() to prevent the
+ * return value of a function from being automatically freed. Consider
+ * the following example (which only works on GCC and clang):
+ *
+ * |[
+ * GObject *
+ * create_object (void)
+ * {
+ * g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL);
+ *
+ * if (early_error_case)
+ * return NULL;
+ *
+ * return g_steal_pointer (&obj);
+ * }
+ * ]|
+ *
+ * It can also be used in similar ways for 'out' parameters and is
+ * particularly useful for dealing with optional out parameters:
+ *
+ * |[
+ * gboolean
+ * get_object (GObject **obj_out)
+ * {
+ * g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL);
+ *
+ * if (early_error_case)
+ * return FALSE;
+ *
+ * if (obj_out)
+ * *obj_out = g_steal_pointer (&obj);
+ *
+ * return TRUE;
+ * }
+ * ]|
+ *
+ * In the above example, the object will be automatically freed in the
+ * early error case and also in the case that %NULL was given for
+ * @obj_out.
+ *
+ * Since: 2.44
+ */
+static inline gpointer
+g_steal_pointer (gpointer pp)
+{
+ gpointer *ptr = (gpointer *) pp;
+ gpointer ref;
+
+ ref = *ptr;
+ *ptr = NULL;
+
+ return ref;
+}
+
+/* type safety */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && !defined(__cplusplus) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58
+#define g_steal_pointer(pp) ((__typeof__(*pp)) (g_steal_pointer) (pp))
+#else /* __GNUC__ */
+/* This version does not depend on gcc extensions, but gcc does not warn
+ * about incompatible-pointer-types: */
+#define g_steal_pointer(pp) \
+ (0 ? (*(pp)) : (g_steal_pointer) (pp))
+#endif /* __GNUC__ */
+
+/* Optimise: avoid the call to the (slower) _n function if we can
+ * determine at compile-time that no overflow happens.
+ */
+#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
+# define _G_NEW(struct_type, n_structs, func) \
+ (struct_type *) (G_GNUC_EXTENSION ({ \
+ gsize __n = (gsize) (n_structs); \
+ gsize __s = sizeof (struct_type); \
+ gpointer __p; \
+ if (__s == 1) \
+ __p = g_##func (__n); \
+ else if (__builtin_constant_p (__n) && \
+ (__s == 0 || __n <= G_MAXSIZE / __s)) \
+ __p = g_##func (__n * __s); \
+ else \
+ __p = g_##func##_n (__n, __s); \
+ __p; \
+ }))
+# define _G_RENEW(struct_type, mem, n_structs, func) \
+ (struct_type *) (G_GNUC_EXTENSION ({ \
+ gsize __n = (gsize) (n_structs); \
+ gsize __s = sizeof (struct_type); \
+ gpointer __p = (gpointer) (mem); \
+ if (__s == 1) \
+ __p = g_##func (__p, __n); \
+ else if (__builtin_constant_p (__n) && \
+ (__s == 0 || __n <= G_MAXSIZE / __s)) \
+ __p = g_##func (__p, __n * __s); \
+ else \
+ __p = g_##func##_n (__p, __n, __s); \
+ __p; \
+ }))
+
+#else
+
+/* Unoptimised version: always call the _n() function. */
+
+#define _G_NEW(struct_type, n_structs, func) \
+ ((struct_type *) g_##func##_n ((n_structs), sizeof (struct_type)))
+#define _G_RENEW(struct_type, mem, n_structs, func) \
+ ((struct_type *) g_##func##_n (mem, (n_structs), sizeof (struct_type)))
+
+#endif
+
+/**
+ * g_new:
+ * @struct_type: the type of the elements to allocate
+ * @n_structs: the number of elements to allocate
+ *
+ * Allocates @n_structs elements of type @struct_type.
+ * The returned pointer is cast to a pointer to the given type.
+ * If @n_structs is 0 it returns %NULL.
+ * Care is taken to avoid overflow when calculating the size of the allocated block.
+ *
+ * Since the returned pointer is already casted to the right type,
+ * it is normally unnecessary to cast it explicitly, and doing
+ * so might hide memory allocation errors.
+ *
+ * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type
+ */
+#define g_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc)
+/**
+ * g_new0:
+ * @struct_type: the type of the elements to allocate.
+ * @n_structs: the number of elements to allocate.
+ *
+ * Allocates @n_structs elements of type @struct_type, initialized to 0's.
+ * The returned pointer is cast to a pointer to the given type.
+ * If @n_structs is 0 it returns %NULL.
+ * Care is taken to avoid overflow when calculating the size of the allocated block.
+ *
+ * Since the returned pointer is already casted to the right type,
+ * it is normally unnecessary to cast it explicitly, and doing
+ * so might hide memory allocation errors.
+ *
+ * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type.
+ */
+#define g_new0(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc0)
+/**
+ * g_renew:
+ * @struct_type: the type of the elements to allocate
+ * @mem: the currently allocated memory
+ * @n_structs: the number of elements to allocate
+ *
+ * Reallocates the memory pointed to by @mem, so that it now has space for
+ * @n_structs elements of type @struct_type. It returns the new address of
+ * the memory, which may have been moved.
+ * Care is taken to avoid overflow when calculating the size of the allocated block.
+ *
+ * Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type
+ */
+#define g_renew(struct_type, mem, n_structs) _G_RENEW (struct_type, mem, n_structs, realloc)
+/**
+ * g_try_new:
+ * @struct_type: the type of the elements to allocate
+ * @n_structs: the number of elements to allocate
+ *
+ * Attempts to allocate @n_structs elements of type @struct_type, and returns
+ * %NULL on failure. Contrast with g_new(), which aborts the program on failure.
+ * The returned pointer is cast to a pointer to the given type.
+ * The function returns %NULL when @n_structs is 0 of if an overflow occurs.
+ *
+ * Since: 2.8
+ * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type
+ */
+#define g_try_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, try_malloc)
+/**
+ * g_try_new0:
+ * @struct_type: the type of the elements to allocate
+ * @n_structs: the number of elements to allocate
+ *
+ * Attempts to allocate @n_structs elements of type @struct_type, initialized
+ * to 0's, and returns %NULL on failure. Contrast with g_new0(), which aborts
+ * the program on failure.
+ * The returned pointer is cast to a pointer to the given type.
+ * The function returns %NULL when @n_structs is 0 or if an overflow occurs.
+ *
+ * Since: 2.8
+ * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type
+ */
+#define g_try_new0(struct_type, n_structs) _G_NEW (struct_type, n_structs, try_malloc0)
+/**
+ * g_try_renew:
+ * @struct_type: the type of the elements to allocate
+ * @mem: the currently allocated memory
+ * @n_structs: the number of elements to allocate
+ *
+ * Attempts to reallocate the memory pointed to by @mem, so that it now has
+ * space for @n_structs elements of type @struct_type, and returns %NULL on
+ * failure. Contrast with g_renew(), which aborts the program on failure.
+ * It returns the new address of the memory, which may have been moved.
+ * The function returns %NULL if an overflow occurs.
+ *
+ * Since: 2.8
+ * Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type
+ */
+#define g_try_renew(struct_type, mem, n_structs) _G_RENEW (struct_type, mem, n_structs, try_realloc)
+
+
+/* Memory allocation virtualization for debugging purposes
+ * g_mem_set_vtable() has to be the very first GLib function called
+ * if being used
+ */
+struct _GMemVTable {
+ gpointer (*malloc) (gsize n_bytes);
+ gpointer (*realloc) (gpointer mem,
+ gsize n_bytes);
+ void (*free) (gpointer mem);
+ /* optional; set to NULL if not used ! */
+ gpointer (*calloc) (gsize n_blocks,
+ gsize n_block_bytes);
+ gpointer (*try_malloc) (gsize n_bytes);
+ gpointer (*try_realloc) (gpointer mem,
+ gsize n_bytes);
+};
+GLIB_DEPRECATED_IN_2_46
+void g_mem_set_vtable (GMemVTable *vtable);
+GLIB_DEPRECATED_IN_2_46
+gboolean g_mem_is_system_malloc (void);
+
+GLIB_VAR gboolean g_mem_gc_friendly;
+
+/* Memory profiler and checker, has to be enabled via g_mem_set_vtable()
+ */
+GLIB_VAR GMemVTable *glib_mem_profiler_table;
+GLIB_DEPRECATED_IN_2_46
+void g_mem_profile (void);
+
+G_END_DECLS
+
+#endif /* __G_MEM_H__ */
diff --git a/include/glib/glib/gmessages.h b/include/glib/glib/gmessages.h
new file mode 100644
index 0000000000..95d60c5bee
--- /dev/null
+++ b/include/glib/glib/gmessages.h
@@ -0,0 +1,636 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_MESSAGES_H__
+#define __G_MESSAGES_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <stdarg.h>
+#include <glib/gtypes.h>
+#include <glib/gmacros.h>
+#include <glib/gvariant.h>
+
+G_BEGIN_DECLS
+
+/* calculate a string size, guaranteed to fit format + args.
+ */
+GLIB_AVAILABLE_IN_ALL
+gsize g_printf_string_upper_bound (const gchar* format,
+ va_list args) G_GNUC_PRINTF(1, 0);
+
+/* Log level shift offset for user defined
+ * log levels (0-7 are used by GLib).
+ */
+#define G_LOG_LEVEL_USER_SHIFT (8)
+
+/* Glib log levels and flags.
+ */
+typedef enum
+{
+ /* log flags */
+ G_LOG_FLAG_RECURSION = 1 << 0,
+ G_LOG_FLAG_FATAL = 1 << 1,
+
+ /* GLib log levels */
+ G_LOG_LEVEL_ERROR = 1 << 2, /* always fatal */
+ G_LOG_LEVEL_CRITICAL = 1 << 3,
+ G_LOG_LEVEL_WARNING = 1 << 4,
+ G_LOG_LEVEL_MESSAGE = 1 << 5,
+ G_LOG_LEVEL_INFO = 1 << 6,
+ G_LOG_LEVEL_DEBUG = 1 << 7,
+
+ G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
+} GLogLevelFlags;
+
+/* GLib log levels that are considered fatal by default */
+#define G_LOG_FATAL_MASK (G_LOG_FLAG_RECURSION | G_LOG_LEVEL_ERROR)
+
+typedef void (*GLogFunc) (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer user_data);
+
+/* Logging mechanism
+ */
+GLIB_AVAILABLE_IN_ALL
+guint g_log_set_handler (const gchar *log_domain,
+ GLogLevelFlags log_levels,
+ GLogFunc log_func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_46
+guint g_log_set_handler_full (const gchar *log_domain,
+ GLogLevelFlags log_levels,
+ GLogFunc log_func,
+ gpointer user_data,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_ALL
+void g_log_remove_handler (const gchar *log_domain,
+ guint handler_id);
+GLIB_AVAILABLE_IN_ALL
+void g_log_default_handler (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer unused_data);
+GLIB_AVAILABLE_IN_ALL
+GLogFunc g_log_set_default_handler (GLogFunc log_func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+void g_log (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (3, 4);
+GLIB_AVAILABLE_IN_ALL
+void g_logv (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *format,
+ va_list args) G_GNUC_PRINTF(3, 0);
+GLIB_AVAILABLE_IN_ALL
+GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain,
+ GLogLevelFlags fatal_mask);
+GLIB_AVAILABLE_IN_ALL
+GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
+
+/* Structured logging mechanism. */
+
+/**
+ * GLogWriterOutput:
+ * @G_LOG_WRITER_HANDLED: Log writer has handled the log entry.
+ * @G_LOG_WRITER_UNHANDLED: Log writer could not handle the log entry.
+ *
+ * Return values from #GLogWriterFuncs to indicate whether the given log entry
+ * was successfully handled by the writer, or whether there was an error in
+ * handling it (and hence a fallback writer should be used).
+ *
+ * If a #GLogWriterFunc ignores a log entry, it should return
+ * %G_LOG_WRITER_HANDLED.
+ *
+ * Since: 2.50
+ */
+typedef enum
+{
+ G_LOG_WRITER_HANDLED = 1,
+ G_LOG_WRITER_UNHANDLED = 0,
+} GLogWriterOutput;
+
+/**
+ * GLogField:
+ * @key: field name (UTF-8 string)
+ * @value: field value (arbitrary bytes)
+ * @length: length of @value, in bytes, or -1 if it is nul-terminated
+ *
+ * Structure representing a single field in a structured log entry. See
+ * g_log_structured() for details.
+ *
+ * Log fields may contain arbitrary values, including binary with embedded nul
+ * bytes. If the field contains a string, the string must be UTF-8 encoded and
+ * have a trailing nul byte. Otherwise, @length must be set to a non-negative
+ * value.
+ *
+ * Since: 2.50
+ */
+typedef struct _GLogField GLogField;
+struct _GLogField
+{
+ const gchar *key;
+ gconstpointer value;
+ gssize length;
+};
+
+/**
+ * GLogWriterFunc:
+ * @log_level: log level of the message
+ * @fields: (array length=n_fields): fields forming the message
+ * @n_fields: number of @fields
+ * @user_data: user data passed to g_log_set_writer_func()
+ *
+ * Writer function for log entries. A log entry is a collection of one or more
+ * #GLogFields, using the standard [field names from journal
+ * specification](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html).
+ * See g_log_structured() for more information.
+ *
+ * Writer functions must ignore fields which they do not recognise, unless they
+ * can write arbitrary binary output, as field values may be arbitrary binary.
+ *
+ * @log_level is guaranteed to be included in @fields as the `PRIORITY` field,
+ * but is provided separately for convenience of deciding whether or where to
+ * output the log entry.
+ *
+ * Writer functions should return %G_LOG_WRITER_HANDLED if they handled the log
+ * message successfully or if they deliberately ignored it. If there was an
+ * error handling the message (for example, if the writer function is meant to
+ * send messages to a remote logging server and there is a network error), it
+ * should return %G_LOG_WRITER_UNHANDLED. This allows writer functions to be
+ * chained and fall back to simpler handlers in case of failure.
+ *
+ * Returns: %G_LOG_WRITER_HANDLED if the log entry was handled successfully;
+ * %G_LOG_WRITER_UNHANDLED otherwise
+ * Since: 2.50
+ */
+typedef GLogWriterOutput (*GLogWriterFunc) (GLogLevelFlags log_level,
+ const GLogField *fields,
+ gsize n_fields,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_50
+void g_log_structured (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ ...);
+GLIB_AVAILABLE_IN_2_50
+void g_log_structured_array (GLogLevelFlags log_level,
+ const GLogField *fields,
+ gsize n_fields);
+
+GLIB_AVAILABLE_IN_2_50
+void g_log_variant (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ GVariant *fields);
+
+GLIB_AVAILABLE_IN_2_50
+void g_log_set_writer_func (GLogWriterFunc func,
+ gpointer user_data,
+ GDestroyNotify user_data_free);
+
+GLIB_AVAILABLE_IN_2_50
+gboolean g_log_writer_supports_color (gint output_fd);
+GLIB_AVAILABLE_IN_2_50
+gboolean g_log_writer_is_journald (gint output_fd);
+
+GLIB_AVAILABLE_IN_2_50
+gchar *g_log_writer_format_fields (GLogLevelFlags log_level,
+ const GLogField *fields,
+ gsize n_fields,
+ gboolean use_color);
+
+GLIB_AVAILABLE_IN_2_50
+GLogWriterOutput g_log_writer_journald (GLogLevelFlags log_level,
+ const GLogField *fields,
+ gsize n_fields,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_50
+GLogWriterOutput g_log_writer_standard_streams (GLogLevelFlags log_level,
+ const GLogField *fields,
+ gsize n_fields,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_50
+GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
+ const GLogField *fields,
+ gsize n_fields,
+ gpointer user_data);
+
+/**
+ * G_DEBUG_HERE:
+ *
+ * A convenience form of g_log_structured(), recommended to be added to
+ * functions when debugging. It prints the current monotonic time and the code
+ * location using %G_STRLOC.
+ *
+ * Since: 2.50
+ */
+#define G_DEBUG_HERE() \
+ g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
+ "CODE_FILE", __FILE__, \
+ "CODE_LINE", G_STRINGIFY (__LINE__), \
+ "CODE_FUNC", G_STRFUNC, \
+ "MESSAGE", "%" G_GINT64_FORMAT ": %s", \
+ g_get_monotonic_time (), G_STRLOC)
+
+/* internal */
+void _g_log_fallback_handler (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer unused_data);
+
+/* Internal functions, used to implement the following macros */
+GLIB_AVAILABLE_IN_ALL
+void g_return_if_fail_warning (const char *log_domain,
+ const char *pretty_function,
+ const char *expression) G_ANALYZER_NORETURN;
+GLIB_AVAILABLE_IN_ALL
+void g_warn_message (const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *warnexpr) G_ANALYZER_NORETURN;
+GLIB_DEPRECATED
+void g_assert_warning (const char *log_domain,
+ const char *file,
+ const int line,
+ const char *pretty_function,
+ const char *expression) G_GNUC_NORETURN;
+
+GLIB_AVAILABLE_IN_2_56
+void g_log_structured_standard (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *file,
+ const gchar *line,
+ const gchar *func,
+ const gchar *message_format,
+ ...) G_GNUC_PRINTF (6, 7);
+
+#ifndef G_LOG_DOMAIN
+#define G_LOG_DOMAIN ((gchar*) 0)
+#endif /* G_LOG_DOMAIN */
+
+#if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING
+#if defined(G_LOG_USE_STRUCTURED) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56
+#define g_error(...) G_STMT_START { \
+ g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, __VA_ARGS__); \
+ for (;;) ; \
+ } G_STMT_END
+#define g_message(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, __VA_ARGS__)
+#define g_critical(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, __VA_ARGS__)
+#define g_warning(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, __VA_ARGS__)
+#define g_info(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, __VA_ARGS__)
+#define g_debug(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, __VA_ARGS__)
+#else
+/* for(;;) ; so that GCC knows that control doesn't go past g_error().
+ * Put space before ending semicolon to avoid C++ build warnings.
+ */
+#define g_error(...) G_STMT_START { \
+ g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_ERROR, \
+ __VA_ARGS__); \
+ for (;;) ; \
+ } G_STMT_END
+#define g_message(...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_MESSAGE, \
+ __VA_ARGS__)
+#define g_critical(...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_CRITICAL, \
+ __VA_ARGS__)
+#define g_warning(...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_WARNING, \
+ __VA_ARGS__)
+#define g_info(...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_INFO, \
+ __VA_ARGS__)
+#define g_debug(...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_DEBUG, \
+ __VA_ARGS__)
+#endif
+#elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING
+#if defined(G_LOG_USE_STRUCTURED) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56
+#define g_error(format...) G_STMT_START { \
+ g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, format); \
+ for (;;) ; \
+ } G_STMT_END
+#define g_message(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, format)
+#define g_critical(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, format)
+#define g_warning(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, format)
+#define g_info(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, format)
+#define g_debug(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, format)
+#else
+#define g_error(format...) G_STMT_START { \
+ g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_ERROR, \
+ format); \
+ for (;;) ; \
+ } G_STMT_END
+
+#define g_message(format...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_MESSAGE, \
+ format)
+#define g_critical(format...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_CRITICAL, \
+ format)
+#define g_warning(format...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_WARNING, \
+ format)
+#define g_info(format...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_INFO, \
+ format)
+#define g_debug(format...) g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_DEBUG, \
+ format)
+#endif
+#else /* no varargs macros */
+static void g_error (const gchar *format, ...) G_GNUC_NORETURN G_ANALYZER_NORETURN;
+static void g_critical (const gchar *format, ...) G_ANALYZER_NORETURN;
+
+static inline void
+g_error (const gchar *format,
+ ...)
+{
+ va_list args;
+ va_start (args, format);
+ g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
+ va_end (args);
+
+ for(;;) ;
+}
+static inline void
+g_message (const gchar *format,
+ ...)
+{
+ va_list args;
+ va_start (args, format);
+ g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, args);
+ va_end (args);
+}
+static inline void
+g_critical (const gchar *format,
+ ...)
+{
+ va_list args;
+ va_start (args, format);
+ g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, args);
+ va_end (args);
+}
+static inline void
+g_warning (const gchar *format,
+ ...)
+{
+ va_list args;
+ va_start (args, format);
+ g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, args);
+ va_end (args);
+}
+static inline void
+g_info (const gchar *format,
+ ...)
+{
+ va_list args;
+ va_start (args, format);
+ g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format, args);
+ va_end (args);
+}
+static inline void
+g_debug (const gchar *format,
+ ...)
+{
+ va_list args;
+ va_start (args, format);
+ g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args);
+ va_end (args);
+}
+#endif /* !__GNUC__ */
+
+/**
+ * GPrintFunc:
+ * @string: the message to output
+ *
+ * Specifies the type of the print handler functions.
+ * These are called with the complete formatted string to output.
+ */
+typedef void (*GPrintFunc) (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+void g_print (const gchar *format,
+ ...) G_GNUC_PRINTF (1, 2);
+GLIB_AVAILABLE_IN_ALL
+GPrintFunc g_set_print_handler (GPrintFunc func);
+GLIB_AVAILABLE_IN_ALL
+void g_printerr (const gchar *format,
+ ...) G_GNUC_PRINTF (1, 2);
+GLIB_AVAILABLE_IN_ALL
+GPrintFunc g_set_printerr_handler (GPrintFunc func);
+
+/**
+ * g_warn_if_reached:
+ *
+ * Logs a warning.
+ *
+ * Since: 2.16
+ */
+#define g_warn_if_reached() \
+ do { \
+ g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); \
+ } while (0)
+
+/**
+ * g_warn_if_fail:
+ * @expr: the expression to check
+ *
+ * Logs a warning if the expression is not true.
+ *
+ * Since: 2.16
+ */
+#define g_warn_if_fail(expr) \
+ do { \
+ if G_LIKELY (expr) ; \
+ else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, #expr); \
+ } while (0)
+
+#ifdef G_DISABLE_CHECKS
+
+/**
+ * g_return_if_fail:
+ * @expr: the expression to check
+ *
+ * Verifies that the expression @expr, usually representing a precondition,
+ * evaluates to %TRUE. If the function returns a value, use
+ * g_return_val_if_fail() instead.
+ *
+ * If @expr evaluates to %FALSE, the current function should be considered to
+ * have undefined behaviour (a programmer error). The only correct solution
+ * to such an error is to change the module that is calling the current
+ * function, so that it avoids this incorrect call.
+ *
+ * To make this undefined behaviour visible, if @expr evaluates to %FALSE,
+ * the result is usually that a critical message is logged and the current
+ * function returns.
+ *
+ * If `G_DISABLE_CHECKS` is defined then the check is not performed. You
+ * should therefore not depend on any side effects of @expr.
+ *
+ * To debug failure of a g_return_if_fail() check, run the code under a debugger
+ * with `G_DEBUG=fatal-criticals` or `G_DEBUG=fatal-warnings` defined in the
+ * environment (see [Running GLib Applications](glib-running.html)):
+ *
+ * |[
+ * G_DEBUG=fatal-warnings gdb ./my-program
+ * ]|
+ *
+ * Any unrelated failures can be skipped over in
+ * [gdb](https://www.gnu.org/software/gdb/) using the `continue` command.
+ */
+#define g_return_if_fail(expr) G_STMT_START{ (void)0; }G_STMT_END
+
+/**
+ * g_return_val_if_fail:
+ * @expr: the expression to check
+ * @val: the value to return from the current function
+ * if the expression is not true
+ *
+ * Verifies that the expression @expr, usually representing a precondition,
+ * evaluates to %TRUE. If the function does not return a value, use
+ * g_return_if_fail() instead.
+ *
+ * If @expr evaluates to %FALSE, the current function should be considered to
+ * have undefined behaviour (a programmer error). The only correct solution
+ * to such an error is to change the module that is calling the current
+ * function, so that it avoids this incorrect call.
+ *
+ * To make this undefined behaviour visible, if @expr evaluates to %FALSE,
+ * the result is usually that a critical message is logged and @val is
+ * returned from the current function.
+ *
+ * If `G_DISABLE_CHECKS` is defined then the check is not performed. You
+ * should therefore not depend on any side effects of @expr.
+ *
+ * See g_return_if_fail() for guidance on how to debug failure of this check.
+ */
+#define g_return_val_if_fail(expr,val) G_STMT_START{ (void)0; }G_STMT_END
+
+/**
+ * g_return_if_reached:
+ *
+ * Logs a critical message and returns from the current function.
+ * This can only be used in functions which do not return a value.
+ *
+ * See g_return_if_fail() for guidance on how to debug failure of this check.
+ */
+#define g_return_if_reached() G_STMT_START{ return; }G_STMT_END
+
+/**
+ * g_return_val_if_reached:
+ * @val: the value to return from the current function
+ *
+ * Logs a critical message and returns @val.
+ *
+ * See g_return_if_fail() for guidance on how to debug failure of this check.
+ */
+#define g_return_val_if_reached(val) G_STMT_START{ return (val); }G_STMT_END
+
+#else /* !G_DISABLE_CHECKS */
+
+#define g_return_if_fail(expr) \
+ G_STMT_START { \
+ if (G_LIKELY (expr)) \
+ { } \
+ else \
+ { \
+ g_return_if_fail_warning (G_LOG_DOMAIN, \
+ G_STRFUNC, \
+ #expr); \
+ return; \
+ } \
+ } G_STMT_END
+
+#define g_return_val_if_fail(expr, val) \
+ G_STMT_START { \
+ if (G_LIKELY (expr)) \
+ { } \
+ else \
+ { \
+ g_return_if_fail_warning (G_LOG_DOMAIN, \
+ G_STRFUNC, \
+ #expr); \
+ return (val); \
+ } \
+ } G_STMT_END
+
+#define g_return_if_reached() \
+ G_STMT_START { \
+ g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_CRITICAL, \
+ "file %s: line %d (%s): should not be reached", \
+ __FILE__, \
+ __LINE__, \
+ G_STRFUNC); \
+ return; \
+ } G_STMT_END
+
+#define g_return_val_if_reached(val) \
+ G_STMT_START { \
+ g_log (G_LOG_DOMAIN, \
+ G_LOG_LEVEL_CRITICAL, \
+ "file %s: line %d (%s): should not be reached", \
+ __FILE__, \
+ __LINE__, \
+ G_STRFUNC); \
+ return (val); \
+ } G_STMT_END
+
+#endif /* !G_DISABLE_CHECKS */
+
+G_END_DECLS
+
+#endif /* __G_MESSAGES_H__ */
diff --git a/include/glib/glib/gnode.h b/include/glib/glib/gnode.h
new file mode 100644
index 0000000000..693e6154da
--- /dev/null
+++ b/include/glib/glib/gnode.h
@@ -0,0 +1,307 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_NODE_H__
+#define __G_NODE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gmem.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GNode GNode;
+
+/* Tree traverse flags */
+typedef enum
+{
+ G_TRAVERSE_LEAVES = 1 << 0,
+ G_TRAVERSE_NON_LEAVES = 1 << 1,
+ G_TRAVERSE_ALL = G_TRAVERSE_LEAVES | G_TRAVERSE_NON_LEAVES,
+ G_TRAVERSE_MASK = 0x03,
+ G_TRAVERSE_LEAFS = G_TRAVERSE_LEAVES,
+ G_TRAVERSE_NON_LEAFS = G_TRAVERSE_NON_LEAVES
+} GTraverseFlags;
+
+/* Tree traverse orders */
+typedef enum
+{
+ G_IN_ORDER,
+ G_PRE_ORDER,
+ G_POST_ORDER,
+ G_LEVEL_ORDER
+} GTraverseType;
+
+typedef gboolean (*GNodeTraverseFunc) (GNode *node,
+ gpointer data);
+typedef void (*GNodeForeachFunc) (GNode *node,
+ gpointer data);
+
+/* N-way tree implementation
+ */
+struct _GNode
+{
+ gpointer data;
+ GNode *next;
+ GNode *prev;
+ GNode *parent;
+ GNode *children;
+};
+
+/**
+ * G_NODE_IS_ROOT:
+ * @node: a #GNode
+ *
+ * Returns %TRUE if a #GNode is the root of a tree.
+ *
+ * Returns: %TRUE if the #GNode is the root of a tree
+ * (i.e. it has no parent or siblings)
+ */
+#define G_NODE_IS_ROOT(node) (((GNode*) (node))->parent == NULL && \
+ ((GNode*) (node))->prev == NULL && \
+ ((GNode*) (node))->next == NULL)
+
+/**
+ * G_NODE_IS_LEAF:
+ * @node: a #GNode
+ *
+ * Returns %TRUE if a #GNode is a leaf node.
+ *
+ * Returns: %TRUE if the #GNode is a leaf node
+ * (i.e. it has no children)
+ */
+#define G_NODE_IS_LEAF(node) (((GNode*) (node))->children == NULL)
+
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_new (gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_node_destroy (GNode *root);
+GLIB_AVAILABLE_IN_ALL
+void g_node_unlink (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_copy_deep (GNode *node,
+ GCopyFunc copy_func,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_copy (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_insert (GNode *parent,
+ gint position,
+ GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_insert_before (GNode *parent,
+ GNode *sibling,
+ GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_insert_after (GNode *parent,
+ GNode *sibling,
+ GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_prepend (GNode *parent,
+ GNode *node);
+GLIB_AVAILABLE_IN_ALL
+guint g_node_n_nodes (GNode *root,
+ GTraverseFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_get_root (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_node_is_ancestor (GNode *node,
+ GNode *descendant);
+GLIB_AVAILABLE_IN_ALL
+guint g_node_depth (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_find (GNode *root,
+ GTraverseType order,
+ GTraverseFlags flags,
+ gpointer data);
+
+/* convenience macros */
+/**
+ * g_node_append:
+ * @parent: the #GNode to place the new #GNode under
+ * @node: the #GNode to insert
+ *
+ * Inserts a #GNode as the last child of the given parent.
+ *
+ * Returns: the inserted #GNode
+ */
+#define g_node_append(parent, node) \
+ g_node_insert_before ((parent), NULL, (node))
+
+/**
+ * g_node_insert_data:
+ * @parent: the #GNode to place the new #GNode under
+ * @position: the position to place the new #GNode at. If position is -1,
+ * the new #GNode is inserted as the last child of @parent
+ * @data: the data for the new #GNode
+ *
+ * Inserts a new #GNode at the given position.
+ *
+ * Returns: the new #GNode
+ */
+#define g_node_insert_data(parent, position, data) \
+ g_node_insert ((parent), (position), g_node_new (data))
+
+/**
+ * g_node_insert_data_after:
+ * @parent: the #GNode to place the new #GNode under
+ * @sibling: the sibling #GNode to place the new #GNode after
+ * @data: the data for the new #GNode
+ *
+ * Inserts a new #GNode after the given sibling.
+ *
+ * Returns: the new #GNode
+ */
+
+#define g_node_insert_data_after(parent, sibling, data) \
+ g_node_insert_after ((parent), (sibling), g_node_new (data))
+/**
+ * g_node_insert_data_before:
+ * @parent: the #GNode to place the new #GNode under
+ * @sibling: the sibling #GNode to place the new #GNode before
+ * @data: the data for the new #GNode
+ *
+ * Inserts a new #GNode before the given sibling.
+ *
+ * Returns: the new #GNode
+ */
+#define g_node_insert_data_before(parent, sibling, data) \
+ g_node_insert_before ((parent), (sibling), g_node_new (data))
+
+/**
+ * g_node_prepend_data:
+ * @parent: the #GNode to place the new #GNode under
+ * @data: the data for the new #GNode
+ *
+ * Inserts a new #GNode as the first child of the given parent.
+ *
+ * Returns: the new #GNode
+ */
+#define g_node_prepend_data(parent, data) \
+ g_node_prepend ((parent), g_node_new (data))
+
+/**
+ * g_node_append_data:
+ * @parent: the #GNode to place the new #GNode under
+ * @data: the data for the new #GNode
+ *
+ * Inserts a new #GNode as the last child of the given parent.
+ *
+ * Returns: the new #GNode
+ */
+#define g_node_append_data(parent, data) \
+ g_node_insert_before ((parent), NULL, g_node_new (data))
+
+/* traversal function, assumes that 'node' is root
+ * (only traverses 'node' and its subtree).
+ * this function is just a high level interface to
+ * low level traversal functions, optimized for speed.
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_node_traverse (GNode *root,
+ GTraverseType order,
+ GTraverseFlags flags,
+ gint max_depth,
+ GNodeTraverseFunc func,
+ gpointer data);
+
+/* return the maximum tree height starting with 'node', this is an expensive
+ * operation, since we need to visit all nodes. this could be shortened by
+ * adding 'guint height' to struct _GNode, but then again, this is not very
+ * often needed, and would make g_node_insert() more time consuming.
+ */
+GLIB_AVAILABLE_IN_ALL
+guint g_node_max_height (GNode *root);
+
+GLIB_AVAILABLE_IN_ALL
+void g_node_children_foreach (GNode *node,
+ GTraverseFlags flags,
+ GNodeForeachFunc func,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_node_reverse_children (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+guint g_node_n_children (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_nth_child (GNode *node,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_last_child (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_find_child (GNode *node,
+ GTraverseFlags flags,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+gint g_node_child_position (GNode *node,
+ GNode *child);
+GLIB_AVAILABLE_IN_ALL
+gint g_node_child_index (GNode *node,
+ gpointer data);
+
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_first_sibling (GNode *node);
+GLIB_AVAILABLE_IN_ALL
+GNode* g_node_last_sibling (GNode *node);
+
+/**
+ * g_node_prev_sibling:
+ * @node: a #GNode
+ *
+ * Gets the previous sibling of a #GNode.
+ *
+ * Returns: the previous sibling of @node, or %NULL if @node is the first
+ * node or %NULL
+ */
+#define g_node_prev_sibling(node) ((node) ? \
+ ((GNode*) (node))->prev : NULL)
+
+/**
+ * g_node_next_sibling:
+ * @node: a #GNode
+ *
+ * Gets the next sibling of a #GNode.
+ *
+ * Returns: the next sibling of @node, or %NULL if @node is the last node
+ * or %NULL
+ */
+#define g_node_next_sibling(node) ((node) ? \
+ ((GNode*) (node))->next : NULL)
+
+/**
+ * g_node_first_child:
+ * @node: a #GNode
+ *
+ * Gets the first child of a #GNode.
+ *
+ * Returns: the first child of @node, or %NULL if @node is %NULL
+ * or has no children
+ */
+#define g_node_first_child(node) ((node) ? \
+ ((GNode*) (node))->children : NULL)
+
+G_END_DECLS
+
+#endif /* __G_NODE_H__ */
diff --git a/include/glib/glib/goption.h b/include/glib/glib/goption.h
new file mode 100644
index 0000000000..63552fb0d5
--- /dev/null
+++ b/include/glib/glib/goption.h
@@ -0,0 +1,388 @@
+/* goption.h - Option parser
+ *
+ * Copyright (C) 2004 Anders Carlsson <andersca@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_OPTION_H__
+#define __G_OPTION_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+#include <glib/gquark.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GOptionContext:
+ *
+ * A `GOptionContext` struct defines which options
+ * are accepted by the commandline option parser. The struct has only private
+ * fields and should not be directly accessed.
+ */
+typedef struct _GOptionContext GOptionContext;
+
+/**
+ * GOptionGroup:
+ *
+ * A `GOptionGroup` struct defines the options in a single
+ * group. The struct has only private fields and should not be directly accessed.
+ *
+ * All options in a group share the same translation function. Libraries which
+ * need to parse commandline options are expected to provide a function for
+ * getting a `GOptionGroup` holding their options, which
+ * the application can then add to its #GOptionContext.
+ */
+typedef struct _GOptionGroup GOptionGroup;
+typedef struct _GOptionEntry GOptionEntry;
+
+/**
+ * GOptionFlags:
+ * @G_OPTION_FLAG_NONE: No flags. Since: 2.42.
+ * @G_OPTION_FLAG_HIDDEN: The option doesn't appear in `--help` output.
+ * @G_OPTION_FLAG_IN_MAIN: The option appears in the main section of the
+ * `--help` output, even if it is defined in a group.
+ * @G_OPTION_FLAG_REVERSE: For options of the %G_OPTION_ARG_NONE kind, this
+ * flag indicates that the sense of the option is reversed.
+ * @G_OPTION_FLAG_NO_ARG: For options of the %G_OPTION_ARG_CALLBACK kind,
+ * this flag indicates that the callback does not take any argument
+ * (like a %G_OPTION_ARG_NONE option). Since 2.8
+ * @G_OPTION_FLAG_FILENAME: For options of the %G_OPTION_ARG_CALLBACK
+ * kind, this flag indicates that the argument should be passed to the
+ * callback in the GLib filename encoding rather than UTF-8. Since 2.8
+ * @G_OPTION_FLAG_OPTIONAL_ARG: For options of the %G_OPTION_ARG_CALLBACK
+ * kind, this flag indicates that the argument supply is optional.
+ * If no argument is given then data of %GOptionParseFunc will be
+ * set to NULL. Since 2.8
+ * @G_OPTION_FLAG_NOALIAS: This flag turns off the automatic conflict
+ * resolution which prefixes long option names with `groupname-` if
+ * there is a conflict. This option should only be used in situations
+ * where aliasing is necessary to model some legacy commandline interface.
+ * It is not safe to use this option, unless all option groups are under
+ * your direct control. Since 2.8.
+ *
+ * Flags which modify individual options.
+ */
+typedef enum
+{
+ G_OPTION_FLAG_NONE = 0,
+ G_OPTION_FLAG_HIDDEN = 1 << 0,
+ G_OPTION_FLAG_IN_MAIN = 1 << 1,
+ G_OPTION_FLAG_REVERSE = 1 << 2,
+ G_OPTION_FLAG_NO_ARG = 1 << 3,
+ G_OPTION_FLAG_FILENAME = 1 << 4,
+ G_OPTION_FLAG_OPTIONAL_ARG = 1 << 5,
+ G_OPTION_FLAG_NOALIAS = 1 << 6
+} GOptionFlags;
+
+/**
+ * GOptionArg:
+ * @G_OPTION_ARG_NONE: No extra argument. This is useful for simple flags.
+ * @G_OPTION_ARG_STRING: The option takes a UTF-8 string argument.
+ * @G_OPTION_ARG_INT: The option takes an integer argument.
+ * @G_OPTION_ARG_CALLBACK: The option provides a callback (of type
+ * #GOptionArgFunc) to parse the extra argument.
+ * @G_OPTION_ARG_FILENAME: The option takes a filename as argument, which will
+ be in the GLib filename encoding rather than UTF-8.
+ * @G_OPTION_ARG_STRING_ARRAY: The option takes a string argument, multiple
+ * uses of the option are collected into an array of strings.
+ * @G_OPTION_ARG_FILENAME_ARRAY: The option takes a filename as argument,
+ * multiple uses of the option are collected into an array of strings.
+ * @G_OPTION_ARG_DOUBLE: The option takes a double argument. The argument
+ * can be formatted either for the user's locale or for the "C" locale.
+ * Since 2.12
+ * @G_OPTION_ARG_INT64: The option takes a 64-bit integer. Like
+ * %G_OPTION_ARG_INT but for larger numbers. The number can be in
+ * decimal base, or in hexadecimal (when prefixed with `0x`, for
+ * example, `0xffffffff`). Since 2.12
+ *
+ * The #GOptionArg enum values determine which type of extra argument the
+ * options expect to find. If an option expects an extra argument, it can
+ * be specified in several ways; with a short option: `-x arg`, with a long
+ * option: `--name arg` or combined in a single argument: `--name=arg`.
+ */
+typedef enum
+{
+ G_OPTION_ARG_NONE,
+ G_OPTION_ARG_STRING,
+ G_OPTION_ARG_INT,
+ G_OPTION_ARG_CALLBACK,
+ G_OPTION_ARG_FILENAME,
+ G_OPTION_ARG_STRING_ARRAY,
+ G_OPTION_ARG_FILENAME_ARRAY,
+ G_OPTION_ARG_DOUBLE,
+ G_OPTION_ARG_INT64
+} GOptionArg;
+
+/**
+ * GOptionArgFunc:
+ * @option_name: The name of the option being parsed. This will be either a
+ * single dash followed by a single letter (for a short name) or two dashes
+ * followed by a long option name.
+ * @value: The value to be parsed.
+ * @data: User data added to the #GOptionGroup containing the option when it
+ * was created with g_option_group_new()
+ * @error: A return location for errors. The error code %G_OPTION_ERROR_FAILED
+ * is intended to be used for errors in #GOptionArgFunc callbacks.
+ *
+ * The type of function to be passed as callback for %G_OPTION_ARG_CALLBACK
+ * options.
+ *
+ * Returns: %TRUE if the option was successfully parsed, %FALSE if an error
+ * occurred, in which case @error should be set with g_set_error()
+ */
+typedef gboolean (*GOptionArgFunc) (const gchar *option_name,
+ const gchar *value,
+ gpointer data,
+ GError **error);
+
+/**
+ * GOptionParseFunc:
+ * @context: The active #GOptionContext
+ * @group: The group to which the function belongs
+ * @data: User data added to the #GOptionGroup containing the option when it
+ * was created with g_option_group_new()
+ * @error: A return location for error details
+ *
+ * The type of function that can be called before and after parsing.
+ *
+ * Returns: %TRUE if the function completed successfully, %FALSE if an error
+ * occurred, in which case @error should be set with g_set_error()
+ */
+typedef gboolean (*GOptionParseFunc) (GOptionContext *context,
+ GOptionGroup *group,
+ gpointer data,
+ GError **error);
+
+/**
+ * GOptionErrorFunc:
+ * @context: The active #GOptionContext
+ * @group: The group to which the function belongs
+ * @data: User data added to the #GOptionGroup containing the option when it
+ * was created with g_option_group_new()
+ * @error: The #GError containing details about the parse error
+ *
+ * The type of function to be used as callback when a parse error occurs.
+ */
+typedef void (*GOptionErrorFunc) (GOptionContext *context,
+ GOptionGroup *group,
+ gpointer data,
+ GError **error);
+
+/**
+ * G_OPTION_ERROR:
+ *
+ * Error domain for option parsing. Errors in this domain will
+ * be from the #GOptionError enumeration. See #GError for information on
+ * error domains.
+ */
+#define G_OPTION_ERROR (g_option_error_quark ())
+
+/**
+ * GOptionError:
+ * @G_OPTION_ERROR_UNKNOWN_OPTION: An option was not known to the parser.
+ * This error will only be reported, if the parser hasn't been instructed
+ * to ignore unknown options, see g_option_context_set_ignore_unknown_options().
+ * @G_OPTION_ERROR_BAD_VALUE: A value couldn't be parsed.
+ * @G_OPTION_ERROR_FAILED: A #GOptionArgFunc callback failed.
+ *
+ * Error codes returned by option parsing.
+ */
+typedef enum
+{
+ G_OPTION_ERROR_UNKNOWN_OPTION,
+ G_OPTION_ERROR_BAD_VALUE,
+ G_OPTION_ERROR_FAILED
+} GOptionError;
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_option_error_quark (void);
+
+/**
+ * GOptionEntry:
+ * @long_name: The long name of an option can be used to specify it
+ * in a commandline as `--long_name`. Every option must have a
+ * long name. To resolve conflicts if multiple option groups contain
+ * the same long name, it is also possible to specify the option as
+ * `--groupname-long_name`.
+ * @short_name: If an option has a short name, it can be specified
+ * `-short_name` in a commandline. @short_name must be a printable
+ * ASCII character different from '-', or zero if the option has no
+ * short name.
+ * @flags: Flags from #GOptionFlags
+ * @arg: The type of the option, as a #GOptionArg
+ * @arg_data: If the @arg type is %G_OPTION_ARG_CALLBACK, then @arg_data
+ * must point to a #GOptionArgFunc callback function, which will be
+ * called to handle the extra argument. Otherwise, @arg_data is a
+ * pointer to a location to store the value, the required type of
+ * the location depends on the @arg type:
+ * - %G_OPTION_ARG_NONE: %gboolean
+ * - %G_OPTION_ARG_STRING: %gchar*
+ * - %G_OPTION_ARG_INT: %gint
+ * - %G_OPTION_ARG_FILENAME: %gchar*
+ * - %G_OPTION_ARG_STRING_ARRAY: %gchar**
+ * - %G_OPTION_ARG_FILENAME_ARRAY: %gchar**
+ * - %G_OPTION_ARG_DOUBLE: %gdouble
+ * If @arg type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_FILENAME,
+ * the location will contain a newly allocated string if the option
+ * was given. That string needs to be freed by the callee using g_free().
+ * Likewise if @arg type is %G_OPTION_ARG_STRING_ARRAY or
+ * %G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev().
+ * @description: the description for the option in `--help`
+ * output. The @description is translated using the @translate_func
+ * of the group, see g_option_group_set_translation_domain().
+ * @arg_description: The placeholder to use for the extra argument parsed
+ * by the option in `--help` output. The @arg_description is translated
+ * using the @translate_func of the group, see
+ * g_option_group_set_translation_domain().
+ *
+ * A GOptionEntry struct defines a single option. To have an effect, they
+ * must be added to a #GOptionGroup with g_option_context_add_main_entries()
+ * or g_option_group_add_entries().
+ */
+struct _GOptionEntry
+{
+ const gchar *long_name;
+ gchar short_name;
+ gint flags;
+
+ GOptionArg arg;
+ gpointer arg_data;
+
+ const gchar *description;
+ const gchar *arg_description;
+};
+
+/**
+ * G_OPTION_REMAINING:
+ *
+ * If a long option in the main group has this name, it is not treated as a
+ * regular option. Instead it collects all non-option arguments which would
+ * otherwise be left in `argv`. The option must be of type
+ * %G_OPTION_ARG_CALLBACK, %G_OPTION_ARG_STRING_ARRAY
+ * or %G_OPTION_ARG_FILENAME_ARRAY.
+ *
+ *
+ * Using #G_OPTION_REMAINING instead of simply scanning `argv`
+ * for leftover arguments has the advantage that GOption takes care of
+ * necessary encoding conversions for strings or filenames.
+ *
+ * Since: 2.6
+ */
+#define G_OPTION_REMAINING ""
+
+GLIB_AVAILABLE_IN_ALL
+GOptionContext *g_option_context_new (const gchar *parameter_string);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_set_summary (GOptionContext *context,
+ const gchar *summary);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_option_context_get_summary (GOptionContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_set_description (GOptionContext *context,
+ const gchar *description);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_option_context_get_description (GOptionContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_free (GOptionContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_set_help_enabled (GOptionContext *context,
+ gboolean help_enabled);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_option_context_get_help_enabled (GOptionContext *context);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_set_ignore_unknown_options (GOptionContext *context,
+ gboolean ignore_unknown);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_option_context_get_ignore_unknown_options (GOptionContext *context);
+
+GLIB_AVAILABLE_IN_2_44
+void g_option_context_set_strict_posix (GOptionContext *context,
+ gboolean strict_posix);
+GLIB_AVAILABLE_IN_2_44
+gboolean g_option_context_get_strict_posix (GOptionContext *context);
+
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_add_main_entries (GOptionContext *context,
+ const GOptionEntry *entries,
+ const gchar *translation_domain);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_option_context_parse (GOptionContext *context,
+ gint *argc,
+ gchar ***argv,
+ GError **error);
+GLIB_AVAILABLE_IN_2_40
+gboolean g_option_context_parse_strv (GOptionContext *context,
+ gchar ***arguments,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_set_translate_func (GOptionContext *context,
+ GTranslateFunc func,
+ gpointer data,
+ GDestroyNotify destroy_notify);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_set_translation_domain (GOptionContext *context,
+ const gchar *domain);
+
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_add_group (GOptionContext *context,
+ GOptionGroup *group);
+GLIB_AVAILABLE_IN_ALL
+void g_option_context_set_main_group (GOptionContext *context,
+ GOptionGroup *group);
+GLIB_AVAILABLE_IN_ALL
+GOptionGroup *g_option_context_get_main_group (GOptionContext *context);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_option_context_get_help (GOptionContext *context,
+ gboolean main_help,
+ GOptionGroup *group);
+
+GLIB_AVAILABLE_IN_ALL
+GOptionGroup *g_option_group_new (const gchar *name,
+ const gchar *description,
+ const gchar *help_description,
+ gpointer user_data,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_ALL
+void g_option_group_set_parse_hooks (GOptionGroup *group,
+ GOptionParseFunc pre_parse_func,
+ GOptionParseFunc post_parse_func);
+GLIB_AVAILABLE_IN_ALL
+void g_option_group_set_error_hook (GOptionGroup *group,
+ GOptionErrorFunc error_func);
+GLIB_DEPRECATED_IN_2_44
+void g_option_group_free (GOptionGroup *group);
+GLIB_AVAILABLE_IN_2_44
+GOptionGroup *g_option_group_ref (GOptionGroup *group);
+GLIB_AVAILABLE_IN_2_44
+void g_option_group_unref (GOptionGroup *group);
+GLIB_AVAILABLE_IN_ALL
+void g_option_group_add_entries (GOptionGroup *group,
+ const GOptionEntry *entries);
+GLIB_AVAILABLE_IN_ALL
+void g_option_group_set_translate_func (GOptionGroup *group,
+ GTranslateFunc func,
+ gpointer data,
+ GDestroyNotify destroy_notify);
+GLIB_AVAILABLE_IN_ALL
+void g_option_group_set_translation_domain (GOptionGroup *group,
+ const gchar *domain);
+
+G_END_DECLS
+
+#endif /* __G_OPTION_H__ */
diff --git a/include/glib/glib/gpattern.h b/include/glib/glib/gpattern.h
new file mode 100644
index 0000000000..bd9e4a7afe
--- /dev/null
+++ b/include/glib/glib/gpattern.h
@@ -0,0 +1,53 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997, 1999 Peter Mattis, Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_PATTERN_H__
+#define __G_PATTERN_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+
+typedef struct _GPatternSpec GPatternSpec;
+
+GLIB_AVAILABLE_IN_ALL
+GPatternSpec* g_pattern_spec_new (const gchar *pattern);
+GLIB_AVAILABLE_IN_ALL
+void g_pattern_spec_free (GPatternSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pattern_spec_equal (GPatternSpec *pspec1,
+ GPatternSpec *pspec2);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pattern_match (GPatternSpec *pspec,
+ guint string_length,
+ const gchar *string,
+ const gchar *string_reversed);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pattern_match_string (GPatternSpec *pspec,
+ const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_pattern_match_simple (const gchar *pattern,
+ const gchar *string);
+
+G_END_DECLS
+
+#endif /* __G_PATTERN_H__ */
diff --git a/include/glib/glib/gpoll.h b/include/glib/glib/gpoll.h
new file mode 100644
index 0000000000..2cbd697298
--- /dev/null
+++ b/include/glib/glib/gpoll.h
@@ -0,0 +1,120 @@
+/* gpoll.h - poll(2) support
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_POLL_H__
+#define __G_POLL_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (__G_MAIN_H__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glibconfig.h>
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/* Any definitions using GPollFD or GPollFunc are primarily
+ * for Unix and not guaranteed to be the compatible on all
+ * operating systems on which GLib runs. Right now, the
+ * GLib does use these functions on Win32 as well, but interprets
+ * them in a fairly different way than on Unix. If you use
+ * these definitions, you are should be prepared to recode
+ * for different operating systems.
+ *
+ * Note that on systems with a working poll(2), that function is used
+ * in place of g_poll(). Thus g_poll() must have the same signature as
+ * poll(), meaning GPollFD must have the same layout as struct pollfd.
+ *
+ * On Win32, the fd in a GPollFD should be Win32 HANDLE (*not* a file
+ * descriptor as provided by the C runtime) that can be used by
+ * MsgWaitForMultipleObjects. This does *not* include file handles
+ * from CreateFile, SOCKETs, nor pipe handles. (But you can use
+ * 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.
+ *
+ * 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
+ * to GDK events.
+ *
+ * So, unless you really know what you are doing, it's best not to try
+ * to use the main loop polling stuff for your own needs on
+ * Windows.
+ */
+typedef struct _GPollFD GPollFD;
+
+/**
+ * GPollFunc:
+ * @ufds: an array of #GPollFD elements
+ * @nfsd: the number of elements in @ufds
+ * @timeout_: the maximum time to wait for an event of the file descriptors.
+ * A negative value indicates an infinite timeout.
+ *
+ * Specifies the type of function passed to g_main_context_set_poll_func().
+ * The semantics of the function should match those of the poll() system call.
+ *
+ * Returns: the number of #GPollFD elements which have events or errors
+ * reported, or -1 if an error occurred.
+ */
+typedef gint (*GPollFunc) (GPollFD *ufds,
+ guint nfsd,
+ gint timeout_);
+
+/**
+ * GPollFD:
+ * @fd: the file descriptor to poll (or a HANDLE on Win32)
+ * @events: a bitwise combination from #GIOCondition, specifying which
+ * events should be polled for. Typically for reading from a file
+ * descriptor you would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and
+ * for writing you would use %G_IO_OUT | %G_IO_ERR.
+ * @revents: a bitwise combination of flags from #GIOCondition, returned
+ * from the poll() function to indicate which events occurred.
+ *
+ * Represents a file descriptor, which events to poll for, and which events
+ * occurred.
+ */
+struct _GPollFD
+{
+#if defined (G_OS_WIN32) && GLIB_SIZEOF_VOID_P == 8
+#ifndef __GTK_DOC_IGNORE__
+ gint64 fd;
+#endif
+#else
+ gint fd;
+#endif
+ gushort events;
+ gushort revents;
+};
+
+/**
+ * G_POLLFD_FORMAT:
+ *
+ * A format specifier that can be used in printf()-style format strings
+ * when printing the @fd member of a #GPollFD.
+ */
+/* defined in glibconfig.h */
+
+GLIB_AVAILABLE_IN_ALL
+gint
+g_poll (GPollFD *fds,
+ guint nfds,
+ gint timeout);
+
+G_END_DECLS
+
+#endif /* __G_POLL_H__ */
diff --git a/include/glib/glib/gprimes.h b/include/glib/glib/gprimes.h
new file mode 100644
index 0000000000..0b6ea850db
--- /dev/null
+++ b/include/glib/glib/gprimes.h
@@ -0,0 +1,50 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_PRIMES_H__
+#define __G_PRIMES_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/* Prime numbers.
+ */
+
+/* This function returns prime numbers spaced by approximately 1.5-2.0
+ * and is for use in resizing data structures which prefer
+ * prime-valued sizes. The closest spaced prime function returns the
+ * next largest prime, or the highest it knows about which is about
+ * MAXINT/4.
+ */
+GLIB_AVAILABLE_IN_ALL
+guint g_spaced_primes_closest (guint num) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __G_PRIMES_H__ */
diff --git a/include/glib/glib/gprintf.h b/include/glib/glib/gprintf.h
new file mode 100644
index 0000000000..429de7a24e
--- /dev/null
+++ b/include/glib/glib/gprintf.h
@@ -0,0 +1,57 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_PRINTF_H__
+#define __G_PRINTF_H__
+
+#include <glib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+gint g_printf (gchar const *format,
+ ...) G_GNUC_PRINTF (1, 2);
+GLIB_AVAILABLE_IN_ALL
+gint g_fprintf (FILE *file,
+ gchar const *format,
+ ...) G_GNUC_PRINTF (2, 3);
+GLIB_AVAILABLE_IN_ALL
+gint g_sprintf (gchar *string,
+ gchar const *format,
+ ...) G_GNUC_PRINTF (2, 3);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_vprintf (gchar const *format,
+ va_list args) G_GNUC_PRINTF(1, 0);
+GLIB_AVAILABLE_IN_ALL
+gint g_vfprintf (FILE *file,
+ gchar const *format,
+ va_list args) G_GNUC_PRINTF(2, 0);
+GLIB_AVAILABLE_IN_ALL
+gint g_vsprintf (gchar *string,
+ gchar const *format,
+ va_list args) G_GNUC_PRINTF(2, 0);
+GLIB_AVAILABLE_IN_ALL
+gint g_vasprintf (gchar **string,
+ gchar const *format,
+ va_list args) G_GNUC_PRINTF(2, 0);
+
+G_END_DECLS
+
+#endif /* __G_PRINTF_H__ */
diff --git a/include/glib/glib/gqsort.h b/include/glib/glib/gqsort.h
new file mode 100644
index 0000000000..2ecd75fae0
--- /dev/null
+++ b/include/glib/glib/gqsort.h
@@ -0,0 +1,45 @@
+ /* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_QSORT_H__
+#define __G_QSORT_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+void g_qsort_with_data (gconstpointer pbase,
+ gint total_elems,
+ gsize size,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __G_QSORT_H__ */
diff --git a/include/glib/glib/gquark.h b/include/glib/glib/gquark.h
new file mode 100644
index 0000000000..1822c4bf7b
--- /dev/null
+++ b/include/glib/glib/gquark.h
@@ -0,0 +1,68 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_QUARK_H__
+#define __G_QUARK_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef guint32 GQuark;
+
+/* Quarks (string<->id association)
+ */
+GLIB_AVAILABLE_IN_ALL
+GQuark g_quark_try_string (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+GQuark g_quark_from_static_string (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+GQuark g_quark_from_string (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_quark_to_string (GQuark quark) G_GNUC_CONST;
+
+#define G_DEFINE_QUARK(QN, q_n) \
+GQuark \
+q_n##_quark (void) \
+{ \
+ static GQuark q; \
+ \
+ if G_UNLIKELY (q == 0) \
+ q = g_quark_from_static_string (#QN); \
+ \
+ return q; \
+}
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_intern_string (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_intern_static_string (const gchar *string);
+
+G_END_DECLS
+
+#endif /* __G_QUARK_H__ */
diff --git a/include/glib/glib/gqueue.h b/include/glib/glib/gqueue.h
new file mode 100644
index 0000000000..65d609f1ae
--- /dev/null
+++ b/include/glib/glib/gqueue.h
@@ -0,0 +1,203 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_QUEUE_H__
+#define __G_QUEUE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/glist.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GQueue GQueue;
+
+/**
+ * GQueue:
+ * @head: a pointer to the first element of the queue
+ * @tail: a pointer to the last element of the queue
+ * @length: the number of elements in the queue
+ *
+ * Contains the public fields of a
+ * [Queue][glib-Double-ended-Queues].
+ */
+struct _GQueue
+{
+ GList *head;
+ GList *tail;
+ guint length;
+};
+
+/**
+ * G_QUEUE_INIT:
+ *
+ * A statically-allocated #GQueue must be initialized with this
+ * macro before it can be used. This macro can be used to initialize
+ * a variable, but it cannot be assigned to a variable. In that case
+ * you have to use g_queue_init().
+ *
+ * |[
+ * GQueue my_queue = G_QUEUE_INIT;
+ * ]|
+ *
+ * Since: 2.14
+ */
+#define G_QUEUE_INIT { NULL, NULL, 0 }
+
+/* Queues
+ */
+GLIB_AVAILABLE_IN_ALL
+GQueue* g_queue_new (void);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_free (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_free_full (GQueue *queue,
+ GDestroyNotify free_func);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_init (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_clear (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_queue_is_empty (GQueue *queue);
+GLIB_AVAILABLE_IN_2_60
+void g_queue_clear_full (GQueue *queue,
+ GDestroyNotify free_func);
+GLIB_AVAILABLE_IN_ALL
+guint g_queue_get_length (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_reverse (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+GQueue * g_queue_copy (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_foreach (GQueue *queue,
+ GFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GList * g_queue_find (GQueue *queue,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+GList * g_queue_find_custom (GQueue *queue,
+ gconstpointer data,
+ GCompareFunc func);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_sort (GQueue *queue,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+void g_queue_push_head (GQueue *queue,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_push_tail (GQueue *queue,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_push_nth (GQueue *queue,
+ gpointer data,
+ gint n);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_queue_pop_head (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_queue_pop_tail (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_queue_pop_nth (GQueue *queue,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_queue_peek_head (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_queue_peek_tail (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_queue_peek_nth (GQueue *queue,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+gint g_queue_index (GQueue *queue,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_queue_remove (GQueue *queue,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_queue_remove_all (GQueue *queue,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_insert_before (GQueue *queue,
+ GList *sibling,
+ gpointer data);
+GLIB_AVAILABLE_IN_2_62
+void g_queue_insert_before_link
+ (GQueue *queue,
+ GList *sibling,
+ GList *link_);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_insert_after (GQueue *queue,
+ GList *sibling,
+ gpointer data);
+GLIB_AVAILABLE_IN_2_62
+void g_queue_insert_after_link
+ (GQueue *queue,
+ GList *sibling,
+ GList *link_);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_insert_sorted (GQueue *queue,
+ gpointer data,
+ GCompareDataFunc func,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+void g_queue_push_head_link (GQueue *queue,
+ GList *link_);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_push_tail_link (GQueue *queue,
+ GList *link_);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_push_nth_link (GQueue *queue,
+ gint n,
+ GList *link_);
+GLIB_AVAILABLE_IN_ALL
+GList* g_queue_pop_head_link (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+GList* g_queue_pop_tail_link (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+GList* g_queue_pop_nth_link (GQueue *queue,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+GList* g_queue_peek_head_link (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+GList* g_queue_peek_tail_link (GQueue *queue);
+GLIB_AVAILABLE_IN_ALL
+GList* g_queue_peek_nth_link (GQueue *queue,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+gint g_queue_link_index (GQueue *queue,
+ GList *link_);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_unlink (GQueue *queue,
+ GList *link_);
+GLIB_AVAILABLE_IN_ALL
+void g_queue_delete_link (GQueue *queue,
+ GList *link_);
+
+G_END_DECLS
+
+#endif /* __G_QUEUE_H__ */
diff --git a/include/glib/glib/grand.h b/include/glib/glib/grand.h
new file mode 100644
index 0000000000..82528c77b5
--- /dev/null
+++ b/include/glib/glib/grand.h
@@ -0,0 +1,99 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_RAND_H__
+#define __G_RAND_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GRand GRand;
+
+/* GRand - a good and fast random number generator: Mersenne Twister
+ * see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for more info.
+ * The range functions return a value in the intervall [begin, end).
+ * int -> [0..2^32-1]
+ * int_range -> [begin..end-1]
+ * double -> [0..1)
+ * double_range -> [begin..end)
+ */
+
+GLIB_AVAILABLE_IN_ALL
+GRand* g_rand_new_with_seed (guint32 seed);
+GLIB_AVAILABLE_IN_ALL
+GRand* g_rand_new_with_seed_array (const guint32 *seed,
+ guint seed_length);
+GLIB_AVAILABLE_IN_ALL
+GRand* g_rand_new (void);
+GLIB_AVAILABLE_IN_ALL
+void g_rand_free (GRand *rand_);
+GLIB_AVAILABLE_IN_ALL
+GRand* g_rand_copy (GRand *rand_);
+GLIB_AVAILABLE_IN_ALL
+void g_rand_set_seed (GRand *rand_,
+ guint32 seed);
+GLIB_AVAILABLE_IN_ALL
+void g_rand_set_seed_array (GRand *rand_,
+ const guint32 *seed,
+ guint seed_length);
+
+#define g_rand_boolean(rand_) ((g_rand_int (rand_) & (1 << 15)) != 0)
+
+GLIB_AVAILABLE_IN_ALL
+guint32 g_rand_int (GRand *rand_);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_rand_int_range (GRand *rand_,
+ gint32 begin,
+ gint32 end);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_rand_double (GRand *rand_);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_rand_double_range (GRand *rand_,
+ gdouble begin,
+ gdouble end);
+GLIB_AVAILABLE_IN_ALL
+void g_random_set_seed (guint32 seed);
+
+#define g_random_boolean() ((g_random_int () & (1 << 15)) != 0)
+
+GLIB_AVAILABLE_IN_ALL
+guint32 g_random_int (void);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_random_int_range (gint32 begin,
+ gint32 end);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_random_double (void);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_random_double_range (gdouble begin,
+ gdouble end);
+
+
+G_END_DECLS
+
+#endif /* __G_RAND_H__ */
diff --git a/include/glib/glib/grcbox.h b/include/glib/glib/grcbox.h
new file mode 100644
index 0000000000..c92791260a
--- /dev/null
+++ b/include/glib/glib/grcbox.h
@@ -0,0 +1,88 @@
+/* grcbox.h: Reference counted data
+ *
+ * Copyright 2018 Emmanuele Bassi
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gmem.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_58
+gpointer g_rc_box_alloc (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_rc_box_alloc0 (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_rc_box_dup (gsize block_size,
+ gconstpointer mem_block) G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_rc_box_acquire (gpointer mem_block);
+GLIB_AVAILABLE_IN_2_58
+void g_rc_box_release (gpointer mem_block);
+GLIB_AVAILABLE_IN_2_58
+void g_rc_box_release_full (gpointer mem_block,
+ GDestroyNotify clear_func);
+
+GLIB_AVAILABLE_IN_2_58
+gsize g_rc_box_get_size (gpointer mem_block);
+
+GLIB_AVAILABLE_IN_2_58
+gpointer g_atomic_rc_box_alloc (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_atomic_rc_box_alloc0 (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_atomic_rc_box_dup (gsize block_size,
+ gconstpointer mem_block) G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_2_58
+gpointer g_atomic_rc_box_acquire (gpointer mem_block);
+GLIB_AVAILABLE_IN_2_58
+void g_atomic_rc_box_release (gpointer mem_block);
+GLIB_AVAILABLE_IN_2_58
+void g_atomic_rc_box_release_full (gpointer mem_block,
+ GDestroyNotify clear_func);
+
+GLIB_AVAILABLE_IN_2_58
+gsize g_atomic_rc_box_get_size (gpointer mem_block);
+
+#define g_rc_box_new(type) \
+ ((type *) g_rc_box_alloc (sizeof (type)))
+#define g_rc_box_new0(type) \
+ ((type *) g_rc_box_alloc0 (sizeof (type)))
+#define g_atomic_rc_box_new(type) \
+ ((type *) g_atomic_rc_box_alloc (sizeof (type)))
+#define g_atomic_rc_box_new0(type) \
+ ((type *) g_atomic_rc_box_alloc0 (sizeof (type)))
+
+#ifdef g_has_typeof
+/* Type check to avoid assigning references to different types */
+# define g_rc_box_acquire(mem_block) \
+ ((__typeof__(mem_block)) (g_rc_box_acquire) (mem_block))
+# define g_atomic_rc_box_acquire(mem_block) \
+ ((__typeof__(mem_block)) (g_atomic_rc_box_acquire) (mem_block))
+
+/* Type check to avoid duplicating data to different types */
+# define g_rc_box_dup(block_size,mem_block) \
+ ((__typeof__(mem_block)) (g_rc_box_dup) (block_size,mem_block))
+# define g_atomic_rc_box_dup(block_size,mem_block) \
+ ((__typeof__(mem_block)) (g_atomic_rc_box_dup) (block_size,mem_block))
+#endif
+
+G_END_DECLS
diff --git a/include/glib/glib/grefcount.h b/include/glib/glib/grefcount.h
new file mode 100644
index 0000000000..599dac978e
--- /dev/null
+++ b/include/glib/glib/grefcount.h
@@ -0,0 +1,123 @@
+/* grefcount.h: Reference counting
+ *
+ * Copyright 2018 Emmanuele Bassi
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GREFCOUNT_H__
+#define __GREFCOUNT_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gatomic.h>
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_58
+void g_ref_count_init (grefcount *rc);
+GLIB_AVAILABLE_IN_2_58
+void g_ref_count_inc (grefcount *rc);
+GLIB_AVAILABLE_IN_2_58
+gboolean g_ref_count_dec (grefcount *rc);
+GLIB_AVAILABLE_IN_2_58
+gboolean g_ref_count_compare (grefcount *rc,
+ gint val);
+
+GLIB_AVAILABLE_IN_2_58
+void g_atomic_ref_count_init (gatomicrefcount *arc);
+GLIB_AVAILABLE_IN_2_58
+void g_atomic_ref_count_inc (gatomicrefcount *arc);
+GLIB_AVAILABLE_IN_2_58
+gboolean g_atomic_ref_count_dec (gatomicrefcount *arc);
+GLIB_AVAILABLE_IN_2_58
+gboolean g_atomic_ref_count_compare (gatomicrefcount *arc,
+ gint val);
+
+/* On GCC we can use __extension__ to inline the API without using
+ * ancillary functions; we only do this when disabling checks, as
+ * it disables warnings when saturating the reference counters
+ */
+#if defined(__GNUC__) && defined(G_DISABLE_CHECKS)
+
+# define g_ref_count_init(rc) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
+ (void) (0 ? *(rc) ^ *(rc) : 1); \
+ *(rc) = -1; \
+ }))
+
+# define g_ref_count_inc(rc) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
+ (void) (0 ? *(rc) ^ *(rc) : 1); \
+ if (*(rc) == G_MININT) ; else { \
+ *(rc) -= 1; \
+ } \
+ }))
+
+# define g_ref_count_dec(rc) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
+ grefcount __rc = *(rc); \
+ __rc += 1; \
+ if (__rc == 0) ; else { \
+ *(rc) = __rc; \
+ } \
+ (gboolean) (__rc == 0); \
+ }))
+
+# define g_ref_count_compare(rc,val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
+ (void) (0 ? *(rc) ^ (val) : 1); \
+ (gboolean) (*(rc) == -(val)); \
+ }))
+
+# define g_atomic_ref_count_init(rc) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
+ (void) (0 ? *(rc) ^ *(rc) : 1); \
+ *(rc) = 1; \
+ }))
+
+# define g_atomic_ref_count_inc(rc) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
+ (void) (0 ? *(rc) ^ *(rc) : 1); \
+ (void) (g_atomic_int_get (rc) == G_MAXINT ? 0 : g_atomic_int_inc ((rc))); \
+ }))
+
+# define g_atomic_ref_count_dec(rc) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
+ (void) (0 ? *(rc) ^ *(rc) : 1); \
+ g_atomic_int_dec_and_test ((rc)); \
+ }))
+
+# define g_atomic_ref_count_compare(rc,val) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
+ (void) (0 ? *(rc) ^ (val) : 1); \
+ (gboolean) (g_atomic_int_get (rc) == (val)); \
+ }))
+
+#endif /* __GNUC__ && G_DISABLE_CHECKS */
+
+G_END_DECLS
+
+#endif /* __GREFCOUNT_H__ */
diff --git a/include/glib/glib/grefstring.h b/include/glib/glib/grefstring.h
new file mode 100644
index 0000000000..c27767c71c
--- /dev/null
+++ b/include/glib/glib/grefstring.h
@@ -0,0 +1,57 @@
+/* grefstring.h: Reference counted strings
+ *
+ * Copyright 2018 Emmanuele Bassi
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "gmem.h"
+#include "gmacros.h"
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_58
+char * g_ref_string_new (const char *str);
+GLIB_AVAILABLE_IN_2_58
+char * g_ref_string_new_len (const char *str,
+ gssize len);
+GLIB_AVAILABLE_IN_2_58
+char * g_ref_string_new_intern (const char *str);
+
+GLIB_AVAILABLE_IN_2_58
+char * g_ref_string_acquire (char *str);
+GLIB_AVAILABLE_IN_2_58
+void g_ref_string_release (char *str);
+
+GLIB_AVAILABLE_IN_2_58
+gsize g_ref_string_length (char *str);
+
+/**
+ * GRefString:
+ *
+ * A typedef for a reference-counted string. A pointer to a #GRefString can be
+ * treated like a standard `char*` array by all code, but can additionally have
+ * `g_ref_string_*()` methods called on it. `g_ref_string_*()` methods cannot be
+ * called on `char*` arrays not allocated using g_ref_string_new().
+ *
+ * If using #GRefString with autocleanups, g_autoptr() must be used rather than
+ * g_autofree(), so that the reference counting metadata is also freed.
+ *
+ * Since: 2.58
+ */
+typedef char GRefString;
+
+G_END_DECLS
diff --git a/include/glib/glib/gregex.h b/include/glib/glib/gregex.h
new file mode 100644
index 0000000000..45e198df69
--- /dev/null
+++ b/include/glib/glib/gregex.h
@@ -0,0 +1,609 @@
+/* GRegex -- regular expression API wrapper around PCRE.
+ *
+ * Copyright (C) 1999, 2000 Scott Wimer
+ * Copyright (C) 2004, Matthias Clasen <mclasen@redhat.com>
+ * Copyright (C) 2005 - 2007, Marco Barisione <marco@barisione.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_REGEX_H__
+#define __G_REGEX_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+#include <glib/gstring.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GRegexError:
+ * @G_REGEX_ERROR_COMPILE: Compilation of the regular expression failed.
+ * @G_REGEX_ERROR_OPTIMIZE: Optimization of the regular expression failed.
+ * @G_REGEX_ERROR_REPLACE: Replacement failed due to an ill-formed replacement
+ * string.
+ * @G_REGEX_ERROR_MATCH: The match process failed.
+ * @G_REGEX_ERROR_INTERNAL: Internal error of the regular expression engine.
+ * Since 2.16
+ * @G_REGEX_ERROR_STRAY_BACKSLASH: "\\" at end of pattern. Since 2.16
+ * @G_REGEX_ERROR_MISSING_CONTROL_CHAR: "\\c" at end of pattern. Since 2.16
+ * @G_REGEX_ERROR_UNRECOGNIZED_ESCAPE: Unrecognized character follows "\\".
+ * Since 2.16
+ * @G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER: Numbers out of order in "{}"
+ * quantifier. Since 2.16
+ * @G_REGEX_ERROR_QUANTIFIER_TOO_BIG: Number too big in "{}" quantifier.
+ * Since 2.16
+ * @G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS: Missing terminating "]" for
+ * character class. Since 2.16
+ * @G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS: Invalid escape sequence
+ * in character class. Since 2.16
+ * @G_REGEX_ERROR_RANGE_OUT_OF_ORDER: Range out of order in character class.
+ * Since 2.16
+ * @G_REGEX_ERROR_NOTHING_TO_REPEAT: Nothing to repeat. Since 2.16
+ * @G_REGEX_ERROR_UNRECOGNIZED_CHARACTER: Unrecognized character after "(?",
+ * "(?<" or "(?P". Since 2.16
+ * @G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS: POSIX named classes are
+ * supported only within a class. Since 2.16
+ * @G_REGEX_ERROR_UNMATCHED_PARENTHESIS: Missing terminating ")" or ")"
+ * without opening "(". Since 2.16
+ * @G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE: Reference to non-existent
+ * subpattern. Since 2.16
+ * @G_REGEX_ERROR_UNTERMINATED_COMMENT: Missing terminating ")" after comment.
+ * Since 2.16
+ * @G_REGEX_ERROR_EXPRESSION_TOO_LARGE: Regular expression too large.
+ * Since 2.16
+ * @G_REGEX_ERROR_MEMORY_ERROR: Failed to get memory. Since 2.16
+ * @G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND: Lookbehind assertion is not
+ * fixed length. Since 2.16
+ * @G_REGEX_ERROR_MALFORMED_CONDITION: Malformed number or name after "(?(".
+ * Since 2.16
+ * @G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES: Conditional group contains
+ * more than two branches. Since 2.16
+ * @G_REGEX_ERROR_ASSERTION_EXPECTED: Assertion expected after "(?(".
+ * Since 2.16
+ * @G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME: Unknown POSIX class name.
+ * Since 2.16
+ * @G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED: POSIX collating
+ * elements are not supported. Since 2.16
+ * @G_REGEX_ERROR_HEX_CODE_TOO_LARGE: Character value in "\\x{...}" sequence
+ * is too large. Since 2.16
+ * @G_REGEX_ERROR_INVALID_CONDITION: Invalid condition "(?(0)". Since 2.16
+ * @G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND: \\C not allowed in
+ * lookbehind assertion. Since 2.16
+ * @G_REGEX_ERROR_INFINITE_LOOP: Recursive call could loop indefinitely.
+ * Since 2.16
+ * @G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR: Missing terminator
+ * in subpattern name. Since 2.16
+ * @G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME: Two named subpatterns have
+ * the same name. Since 2.16
+ * @G_REGEX_ERROR_MALFORMED_PROPERTY: Malformed "\\P" or "\\p" sequence.
+ * Since 2.16
+ * @G_REGEX_ERROR_UNKNOWN_PROPERTY: Unknown property name after "\\P" or
+ * "\\p". Since 2.16
+ * @G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG: Subpattern name is too long
+ * (maximum 32 characters). Since 2.16
+ * @G_REGEX_ERROR_TOO_MANY_SUBPATTERNS: Too many named subpatterns (maximum
+ * 10,000). Since 2.16
+ * @G_REGEX_ERROR_INVALID_OCTAL_VALUE: Octal value is greater than "\\377".
+ * Since 2.16
+ * @G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE: "DEFINE" group contains more
+ * than one branch. Since 2.16
+ * @G_REGEX_ERROR_DEFINE_REPETION: Repeating a "DEFINE" group is not allowed.
+ * This error is never raised. Since: 2.16 Deprecated: 2.34
+ * @G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS: Inconsistent newline options.
+ * Since 2.16
+ * @G_REGEX_ERROR_MISSING_BACK_REFERENCE: "\\g" is not followed by a braced,
+ * angle-bracketed, or quoted name or number, or by a plain number. Since: 2.16
+ * @G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE: relative reference must not be zero. Since: 2.34
+ * @G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN: the backtracing
+ * control verb used does not allow an argument. Since: 2.34
+ * @G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB: unknown backtracing
+ * control verb. Since: 2.34
+ * @G_REGEX_ERROR_NUMBER_TOO_BIG: number is too big in escape sequence. Since: 2.34
+ * @G_REGEX_ERROR_MISSING_SUBPATTERN_NAME: Missing subpattern name. Since: 2.34
+ * @G_REGEX_ERROR_MISSING_DIGIT: Missing digit. Since 2.34
+ * @G_REGEX_ERROR_INVALID_DATA_CHARACTER: In JavaScript compatibility mode,
+ * "[" is an invalid data character. Since: 2.34
+ * @G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME: different names for subpatterns of the
+ * same number are not allowed. Since: 2.34
+ * @G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED: the backtracing control
+ * verb requires an argument. Since: 2.34
+ * @G_REGEX_ERROR_INVALID_CONTROL_CHAR: "\\c" must be followed by an ASCII
+ * character. Since: 2.34
+ * @G_REGEX_ERROR_MISSING_NAME: "\\k" is not followed by a braced, angle-bracketed, or
+ * quoted name. Since: 2.34
+ * @G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS: "\\N" is not supported in a class. Since: 2.34
+ * @G_REGEX_ERROR_TOO_MANY_FORWARD_REFERENCES: too many forward references. Since: 2.34
+ * @G_REGEX_ERROR_NAME_TOO_LONG: the name is too long in "(*MARK)", "(*PRUNE)",
+ * "(*SKIP)", or "(*THEN)". Since: 2.34
+ * @G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE: the character value in the \\u sequence is
+ * too large. Since: 2.34
+ *
+ * Error codes returned by regular expressions functions.
+ *
+ * Since: 2.14
+ */
+typedef enum
+{
+ G_REGEX_ERROR_COMPILE,
+ G_REGEX_ERROR_OPTIMIZE,
+ G_REGEX_ERROR_REPLACE,
+ G_REGEX_ERROR_MATCH,
+ G_REGEX_ERROR_INTERNAL,
+
+ /* These are the error codes from PCRE + 100 */
+ G_REGEX_ERROR_STRAY_BACKSLASH = 101,
+ G_REGEX_ERROR_MISSING_CONTROL_CHAR = 102,
+ G_REGEX_ERROR_UNRECOGNIZED_ESCAPE = 103,
+ G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER = 104,
+ G_REGEX_ERROR_QUANTIFIER_TOO_BIG = 105,
+ G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS = 106,
+ G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS = 107,
+ G_REGEX_ERROR_RANGE_OUT_OF_ORDER = 108,
+ G_REGEX_ERROR_NOTHING_TO_REPEAT = 109,
+ G_REGEX_ERROR_UNRECOGNIZED_CHARACTER = 112,
+ G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS = 113,
+ G_REGEX_ERROR_UNMATCHED_PARENTHESIS = 114,
+ G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE = 115,
+ G_REGEX_ERROR_UNTERMINATED_COMMENT = 118,
+ G_REGEX_ERROR_EXPRESSION_TOO_LARGE = 120,
+ G_REGEX_ERROR_MEMORY_ERROR = 121,
+ G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND = 125,
+ G_REGEX_ERROR_MALFORMED_CONDITION = 126,
+ G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES = 127,
+ G_REGEX_ERROR_ASSERTION_EXPECTED = 128,
+ G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME = 130,
+ G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED = 131,
+ G_REGEX_ERROR_HEX_CODE_TOO_LARGE = 134,
+ G_REGEX_ERROR_INVALID_CONDITION = 135,
+ G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND = 136,
+ G_REGEX_ERROR_INFINITE_LOOP = 140,
+ G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR = 142,
+ G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME = 143,
+ G_REGEX_ERROR_MALFORMED_PROPERTY = 146,
+ G_REGEX_ERROR_UNKNOWN_PROPERTY = 147,
+ G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG = 148,
+ G_REGEX_ERROR_TOO_MANY_SUBPATTERNS = 149,
+ G_REGEX_ERROR_INVALID_OCTAL_VALUE = 151,
+ G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE = 154,
+ G_REGEX_ERROR_DEFINE_REPETION = 155,
+ G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS = 156,
+ G_REGEX_ERROR_MISSING_BACK_REFERENCE = 157,
+ G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE = 158,
+ G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN = 159,
+ G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB = 160,
+ G_REGEX_ERROR_NUMBER_TOO_BIG = 161,
+ G_REGEX_ERROR_MISSING_SUBPATTERN_NAME = 162,
+ G_REGEX_ERROR_MISSING_DIGIT = 163,
+ G_REGEX_ERROR_INVALID_DATA_CHARACTER = 164,
+ G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME = 165,
+ G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED = 166,
+ G_REGEX_ERROR_INVALID_CONTROL_CHAR = 168,
+ G_REGEX_ERROR_MISSING_NAME = 169,
+ G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS = 171,
+ G_REGEX_ERROR_TOO_MANY_FORWARD_REFERENCES = 172,
+ G_REGEX_ERROR_NAME_TOO_LONG = 175,
+ G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE = 176
+} GRegexError;
+
+/**
+ * G_REGEX_ERROR:
+ *
+ * Error domain for regular expressions. Errors in this domain will be
+ * from the #GRegexError enumeration. See #GError for information on
+ * error domains.
+ *
+ * Since: 2.14
+ */
+#define G_REGEX_ERROR g_regex_error_quark ()
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_regex_error_quark (void);
+
+/**
+ * GRegexCompileFlags:
+ * @G_REGEX_CASELESS: Letters in the pattern match both upper- and
+ * lowercase letters. This option can be changed within a pattern
+ * by a "(?i)" option setting.
+ * @G_REGEX_MULTILINE: By default, GRegex treats the strings as consisting
+ * of a single line of characters (even if it actually contains
+ * newlines). The "start of line" metacharacter ("^") matches only
+ * at the start of the string, while the "end of line" metacharacter
+ * ("$") matches only at the end of the string, or before a terminating
+ * newline (unless #G_REGEX_DOLLAR_ENDONLY is set). When
+ * #G_REGEX_MULTILINE is set, the "start of line" and "end of line"
+ * constructs match immediately following or immediately before any
+ * newline in the string, respectively, as well as at the very start
+ * and end. This can be changed within a pattern by a "(?m)" option
+ * setting.
+ * @G_REGEX_DOTALL: A dot metacharacter (".") in the pattern matches all
+ * characters, including newlines. Without it, newlines are excluded.
+ * This option can be changed within a pattern by a ("?s") option setting.
+ * @G_REGEX_EXTENDED: Whitespace data characters in the pattern are
+ * totally ignored except when escaped or inside a character class.
+ * Whitespace does not include the VT character (code 11). In addition,
+ * characters between an unescaped "#" outside a character class and
+ * the next newline character, inclusive, are also ignored. This can
+ * be changed within a pattern by a "(?x)" option setting.
+ * @G_REGEX_ANCHORED: The pattern is forced to be "anchored", that is,
+ * it is constrained to match only at the first matching point in the
+ * string that is being searched. This effect can also be achieved by
+ * appropriate constructs in the pattern itself such as the "^"
+ * metacharacter.
+ * @G_REGEX_DOLLAR_ENDONLY: A dollar metacharacter ("$") in the pattern
+ * matches only at the end of the string. Without this option, a
+ * dollar also matches immediately before the final character if
+ * it is a newline (but not before any other newlines). This option
+ * is ignored if #G_REGEX_MULTILINE is set.
+ * @G_REGEX_UNGREEDY: Inverts the "greediness" of the quantifiers so that
+ * they are not greedy by default, but become greedy if followed by "?".
+ * It can also be set by a "(?U)" option setting within the pattern.
+ * @G_REGEX_RAW: Usually strings must be valid UTF-8 strings, using this
+ * flag they are considered as a raw sequence of bytes.
+ * @G_REGEX_NO_AUTO_CAPTURE: Disables the use of numbered capturing
+ * parentheses in the pattern. Any opening parenthesis that is not
+ * followed by "?" behaves as if it were followed by "?:" but named
+ * parentheses can still be used for capturing (and they acquire numbers
+ * in the usual way).
+ * @G_REGEX_OPTIMIZE: Optimize the regular expression. If the pattern will
+ * be used many times, then it may be worth the effort to optimize it
+ * to improve the speed of matches.
+ * @G_REGEX_FIRSTLINE: Limits an unanchored pattern to match before (or at) the
+ * first newline. Since: 2.34
+ * @G_REGEX_DUPNAMES: Names used to identify capturing subpatterns need not
+ * be unique. This can be helpful for certain types of pattern when it
+ * is known that only one instance of the named subpattern can ever be
+ * matched.
+ * @G_REGEX_NEWLINE_CR: Usually any newline character or character sequence is
+ * recognized. If this option is set, the only recognized newline character
+ * is '\r'.
+ * @G_REGEX_NEWLINE_LF: Usually any newline character or character sequence is
+ * recognized. If this option is set, the only recognized newline character
+ * is '\n'.
+ * @G_REGEX_NEWLINE_CRLF: Usually any newline character or character sequence is
+ * recognized. If this option is set, the only recognized newline character
+ * sequence is '\r\n'.
+ * @G_REGEX_NEWLINE_ANYCRLF: Usually any newline character or character sequence
+ * is recognized. If this option is set, the only recognized newline character
+ * sequences are '\r', '\n', and '\r\n'. Since: 2.34
+ * @G_REGEX_BSR_ANYCRLF: Usually any newline character or character sequence
+ * is recognised. If this option is set, then "\R" only recognizes the newline
+ * characters '\r', '\n' and '\r\n'. Since: 2.34
+ * @G_REGEX_JAVASCRIPT_COMPAT: Changes behaviour so that it is compatible with
+ * JavaScript rather than PCRE. Since: 2.34
+ *
+ * Flags specifying compile-time options.
+ *
+ * Since: 2.14
+ */
+/* Remember to update G_REGEX_COMPILE_MASK in gregex.c after
+ * adding a new flag.
+ */
+typedef enum
+{
+ G_REGEX_CASELESS = 1 << 0,
+ G_REGEX_MULTILINE = 1 << 1,
+ G_REGEX_DOTALL = 1 << 2,
+ G_REGEX_EXTENDED = 1 << 3,
+ G_REGEX_ANCHORED = 1 << 4,
+ G_REGEX_DOLLAR_ENDONLY = 1 << 5,
+ G_REGEX_UNGREEDY = 1 << 9,
+ G_REGEX_RAW = 1 << 11,
+ G_REGEX_NO_AUTO_CAPTURE = 1 << 12,
+ G_REGEX_OPTIMIZE = 1 << 13,
+ G_REGEX_FIRSTLINE = 1 << 18,
+ G_REGEX_DUPNAMES = 1 << 19,
+ G_REGEX_NEWLINE_CR = 1 << 20,
+ G_REGEX_NEWLINE_LF = 1 << 21,
+ G_REGEX_NEWLINE_CRLF = G_REGEX_NEWLINE_CR | G_REGEX_NEWLINE_LF,
+ G_REGEX_NEWLINE_ANYCRLF = G_REGEX_NEWLINE_CR | 1 << 22,
+ G_REGEX_BSR_ANYCRLF = 1 << 23,
+ G_REGEX_JAVASCRIPT_COMPAT = 1 << 25
+} GRegexCompileFlags;
+
+/**
+ * GRegexMatchFlags:
+ * @G_REGEX_MATCH_ANCHORED: The pattern is forced to be "anchored", that is,
+ * it is constrained to match only at the first matching point in the
+ * string that is being searched. This effect can also be achieved by
+ * appropriate constructs in the pattern itself such as the "^"
+ * metacharacter.
+ * @G_REGEX_MATCH_NOTBOL: Specifies that first character of the string is
+ * not the beginning of a line, so the circumflex metacharacter should
+ * not match before it. Setting this without #G_REGEX_MULTILINE (at
+ * compile time) causes circumflex never to match. This option affects
+ * only the behaviour of the circumflex metacharacter, it does not
+ * affect "\A".
+ * @G_REGEX_MATCH_NOTEOL: Specifies that the end of the subject string is
+ * not the end of a line, so the dollar metacharacter should not match
+ * it nor (except in multiline mode) a newline immediately before it.
+ * Setting this without #G_REGEX_MULTILINE (at compile time) causes
+ * dollar never to match. This option affects only the behaviour of
+ * the dollar metacharacter, it does not affect "\Z" or "\z".
+ * @G_REGEX_MATCH_NOTEMPTY: An empty string is not considered to be a valid
+ * match if this option is set. If there are alternatives in the pattern,
+ * they are tried. If all the alternatives match the empty string, the
+ * entire match fails. For example, if the pattern "a?b?" is applied to
+ * a string not beginning with "a" or "b", it matches the empty string
+ * at the start of the string. With this flag set, this match is not
+ * valid, so GRegex searches further into the string for occurrences
+ * of "a" or "b".
+ * @G_REGEX_MATCH_PARTIAL: Turns on the partial matching feature, for more
+ * documentation on partial matching see g_match_info_is_partial_match().
+ * @G_REGEX_MATCH_NEWLINE_CR: Overrides the newline definition set when
+ * creating a new #GRegex, setting the '\r' character as line terminator.
+ * @G_REGEX_MATCH_NEWLINE_LF: Overrides the newline definition set when
+ * creating a new #GRegex, setting the '\n' character as line terminator.
+ * @G_REGEX_MATCH_NEWLINE_CRLF: Overrides the newline definition set when
+ * creating a new #GRegex, setting the '\r\n' characters sequence as line terminator.
+ * @G_REGEX_MATCH_NEWLINE_ANY: Overrides the newline definition set when
+ * creating a new #GRegex, any Unicode newline sequence
+ * is recognised as a newline. These are '\r', '\n' and '\rn', and the
+ * single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ * U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
+ * U+2029 PARAGRAPH SEPARATOR.
+ * @G_REGEX_MATCH_NEWLINE_ANYCRLF: Overrides the newline definition set when
+ * creating a new #GRegex; any '\r', '\n', or '\r\n' character sequence
+ * is recognized as a newline. Since: 2.34
+ * @G_REGEX_MATCH_BSR_ANYCRLF: Overrides the newline definition for "\R" set when
+ * creating a new #GRegex; only '\r', '\n', or '\r\n' character sequences
+ * are recognized as a newline by "\R". Since: 2.34
+ * @G_REGEX_MATCH_BSR_ANY: Overrides the newline definition for "\R" set when
+ * creating a new #GRegex; any Unicode newline character or character sequence
+ * are recognized as a newline by "\R". These are '\r', '\n' and '\rn', and the
+ * single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ * U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
+ * U+2029 PARAGRAPH SEPARATOR. Since: 2.34
+ * @G_REGEX_MATCH_PARTIAL_SOFT: An alias for #G_REGEX_MATCH_PARTIAL. Since: 2.34
+ * @G_REGEX_MATCH_PARTIAL_HARD: Turns on the partial matching feature. In contrast to
+ * to #G_REGEX_MATCH_PARTIAL_SOFT, this stops matching as soon as a partial match
+ * is found, without continuing to search for a possible complete match. See
+ * g_match_info_is_partial_match() for more information. Since: 2.34
+ * @G_REGEX_MATCH_NOTEMPTY_ATSTART: Like #G_REGEX_MATCH_NOTEMPTY, but only applied to
+ * the start of the matched string. For anchored
+ * patterns this can only happen for pattern containing "\K". Since: 2.34
+ *
+ * Flags specifying match-time options.
+ *
+ * Since: 2.14
+ */
+/* Remember to update G_REGEX_MATCH_MASK in gregex.c after
+ * adding a new flag. */
+typedef enum
+{
+ G_REGEX_MATCH_ANCHORED = 1 << 4,
+ G_REGEX_MATCH_NOTBOL = 1 << 7,
+ G_REGEX_MATCH_NOTEOL = 1 << 8,
+ G_REGEX_MATCH_NOTEMPTY = 1 << 10,
+ G_REGEX_MATCH_PARTIAL = 1 << 15,
+ G_REGEX_MATCH_NEWLINE_CR = 1 << 20,
+ G_REGEX_MATCH_NEWLINE_LF = 1 << 21,
+ G_REGEX_MATCH_NEWLINE_CRLF = G_REGEX_MATCH_NEWLINE_CR | G_REGEX_MATCH_NEWLINE_LF,
+ G_REGEX_MATCH_NEWLINE_ANY = 1 << 22,
+ G_REGEX_MATCH_NEWLINE_ANYCRLF = G_REGEX_MATCH_NEWLINE_CR | G_REGEX_MATCH_NEWLINE_ANY,
+ G_REGEX_MATCH_BSR_ANYCRLF = 1 << 23,
+ G_REGEX_MATCH_BSR_ANY = 1 << 24,
+ G_REGEX_MATCH_PARTIAL_SOFT = G_REGEX_MATCH_PARTIAL,
+ G_REGEX_MATCH_PARTIAL_HARD = 1 << 27,
+ G_REGEX_MATCH_NOTEMPTY_ATSTART = 1 << 28
+} GRegexMatchFlags;
+
+/**
+ * GRegex:
+ *
+ * A GRegex is the "compiled" form of a regular expression pattern.
+ * This structure is opaque and its fields cannot be accessed directly.
+ *
+ * Since: 2.14
+ */
+typedef struct _GRegex GRegex;
+
+
+/**
+ * GMatchInfo:
+ *
+ * A GMatchInfo is an opaque struct used to return information about
+ * matches.
+ */
+typedef struct _GMatchInfo GMatchInfo;
+
+/**
+ * GRegexEvalCallback:
+ * @match_info: the #GMatchInfo generated by the match.
+ * Use g_match_info_get_regex() and g_match_info_get_string() if you
+ * need the #GRegex or the matched string.
+ * @result: a #GString containing the new string
+ * @user_data: user data passed to g_regex_replace_eval()
+ *
+ * Specifies the type of the function passed to g_regex_replace_eval().
+ * It is called for each occurrence of the pattern in the string passed
+ * to g_regex_replace_eval(), and it should append the replacement to
+ * @result.
+ *
+ * Returns: %FALSE to continue the replacement process, %TRUE to stop it
+ *
+ * Since: 2.14
+ */
+typedef gboolean (*GRegexEvalCallback) (const GMatchInfo *match_info,
+ GString *result,
+ gpointer user_data);
+
+
+GLIB_AVAILABLE_IN_ALL
+GRegex *g_regex_new (const gchar *pattern,
+ GRegexCompileFlags compile_options,
+ GRegexMatchFlags match_options,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GRegex *g_regex_ref (GRegex *regex);
+GLIB_AVAILABLE_IN_ALL
+void g_regex_unref (GRegex *regex);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_regex_get_pattern (const GRegex *regex);
+GLIB_AVAILABLE_IN_ALL
+gint g_regex_get_max_backref (const GRegex *regex);
+GLIB_AVAILABLE_IN_ALL
+gint g_regex_get_capture_count (const GRegex *regex);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_regex_get_has_cr_or_lf (const GRegex *regex);
+GLIB_AVAILABLE_IN_2_38
+gint g_regex_get_max_lookbehind (const GRegex *regex);
+GLIB_AVAILABLE_IN_ALL
+gint g_regex_get_string_number (const GRegex *regex,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_regex_escape_string (const gchar *string,
+ gint length);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_regex_escape_nul (const gchar *string,
+ gint length);
+
+GLIB_AVAILABLE_IN_ALL
+GRegexCompileFlags g_regex_get_compile_flags (const GRegex *regex);
+GLIB_AVAILABLE_IN_ALL
+GRegexMatchFlags g_regex_get_match_flags (const GRegex *regex);
+
+/* Matching. */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_regex_match_simple (const gchar *pattern,
+ const gchar *string,
+ GRegexCompileFlags compile_options,
+ GRegexMatchFlags match_options);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_regex_match (const GRegex *regex,
+ const gchar *string,
+ GRegexMatchFlags match_options,
+ GMatchInfo **match_info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_regex_match_full (const GRegex *regex,
+ const gchar *string,
+ gssize string_len,
+ gint start_position,
+ GRegexMatchFlags match_options,
+ GMatchInfo **match_info,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_regex_match_all (const GRegex *regex,
+ const gchar *string,
+ GRegexMatchFlags match_options,
+ GMatchInfo **match_info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_regex_match_all_full (const GRegex *regex,
+ const gchar *string,
+ gssize string_len,
+ gint start_position,
+ GRegexMatchFlags match_options,
+ GMatchInfo **match_info,
+ GError **error);
+
+/* String splitting. */
+GLIB_AVAILABLE_IN_ALL
+gchar **g_regex_split_simple (const gchar *pattern,
+ const gchar *string,
+ GRegexCompileFlags compile_options,
+ GRegexMatchFlags match_options);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_regex_split (const GRegex *regex,
+ const gchar *string,
+ GRegexMatchFlags match_options);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_regex_split_full (const GRegex *regex,
+ const gchar *string,
+ gssize string_len,
+ gint start_position,
+ GRegexMatchFlags match_options,
+ gint max_tokens,
+ GError **error);
+
+/* String replacement. */
+GLIB_AVAILABLE_IN_ALL
+gchar *g_regex_replace (const GRegex *regex,
+ const gchar *string,
+ gssize string_len,
+ gint start_position,
+ const gchar *replacement,
+ GRegexMatchFlags match_options,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_regex_replace_literal (const GRegex *regex,
+ const gchar *string,
+ gssize string_len,
+ gint start_position,
+ const gchar *replacement,
+ GRegexMatchFlags match_options,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_regex_replace_eval (const GRegex *regex,
+ const gchar *string,
+ gssize string_len,
+ gint start_position,
+ GRegexMatchFlags match_options,
+ GRegexEvalCallback eval,
+ gpointer user_data,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_regex_check_replacement (const gchar *replacement,
+ gboolean *has_references,
+ GError **error);
+
+/* Match info */
+GLIB_AVAILABLE_IN_ALL
+GRegex *g_match_info_get_regex (const GMatchInfo *match_info);
+GLIB_AVAILABLE_IN_ALL
+const gchar *g_match_info_get_string (const GMatchInfo *match_info);
+
+GLIB_AVAILABLE_IN_ALL
+GMatchInfo *g_match_info_ref (GMatchInfo *match_info);
+GLIB_AVAILABLE_IN_ALL
+void g_match_info_unref (GMatchInfo *match_info);
+GLIB_AVAILABLE_IN_ALL
+void g_match_info_free (GMatchInfo *match_info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_match_info_next (GMatchInfo *match_info,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_match_info_matches (const GMatchInfo *match_info);
+GLIB_AVAILABLE_IN_ALL
+gint g_match_info_get_match_count (const GMatchInfo *match_info);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_match_info_is_partial_match (const GMatchInfo *match_info);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_match_info_expand_references(const GMatchInfo *match_info,
+ const gchar *string_to_expand,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_match_info_fetch (const GMatchInfo *match_info,
+ gint match_num);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_match_info_fetch_pos (const GMatchInfo *match_info,
+ gint match_num,
+ gint *start_pos,
+ gint *end_pos);
+GLIB_AVAILABLE_IN_ALL
+gchar *g_match_info_fetch_named (const GMatchInfo *match_info,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_match_info_fetch_named_pos (const GMatchInfo *match_info,
+ const gchar *name,
+ gint *start_pos,
+ gint *end_pos);
+GLIB_AVAILABLE_IN_ALL
+gchar **g_match_info_fetch_all (const GMatchInfo *match_info);
+
+G_END_DECLS
+
+#endif /* __G_REGEX_H__ */
diff --git a/include/glib/glib/gscanner.h b/include/glib/glib/gscanner.h
new file mode 100644
index 0000000000..d87b4533ec
--- /dev/null
+++ b/include/glib/glib/gscanner.h
@@ -0,0 +1,299 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_SCANNER_H__
+#define __G_SCANNER_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gdataset.h>
+#include <glib/ghash.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GScanner GScanner;
+typedef struct _GScannerConfig GScannerConfig;
+typedef union _GTokenValue GTokenValue;
+
+typedef void (*GScannerMsgFunc) (GScanner *scanner,
+ gchar *message,
+ gboolean error);
+
+/* GScanner: Flexible lexical scanner for general purpose.
+ */
+
+/* Character sets */
+#define G_CSET_A_2_Z "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define G_CSET_a_2_z "abcdefghijklmnopqrstuvwxyz"
+#define G_CSET_DIGITS "0123456789"
+#define G_CSET_LATINC "\300\301\302\303\304\305\306"\
+ "\307\310\311\312\313\314\315\316\317\320"\
+ "\321\322\323\324\325\326"\
+ "\330\331\332\333\334\335\336"
+#define G_CSET_LATINS "\337\340\341\342\343\344\345\346"\
+ "\347\350\351\352\353\354\355\356\357\360"\
+ "\361\362\363\364\365\366"\
+ "\370\371\372\373\374\375\376\377"
+
+/* Error types */
+typedef enum
+{
+ G_ERR_UNKNOWN,
+ G_ERR_UNEXP_EOF,
+ G_ERR_UNEXP_EOF_IN_STRING,
+ G_ERR_UNEXP_EOF_IN_COMMENT,
+ G_ERR_NON_DIGIT_IN_CONST,
+ G_ERR_DIGIT_RADIX,
+ G_ERR_FLOAT_RADIX,
+ G_ERR_FLOAT_MALFORMED
+} GErrorType;
+
+/* Token types */
+typedef enum
+{
+ G_TOKEN_EOF = 0,
+
+ G_TOKEN_LEFT_PAREN = '(',
+ G_TOKEN_RIGHT_PAREN = ')',
+ G_TOKEN_LEFT_CURLY = '{',
+ G_TOKEN_RIGHT_CURLY = '}',
+ G_TOKEN_LEFT_BRACE = '[',
+ G_TOKEN_RIGHT_BRACE = ']',
+ G_TOKEN_EQUAL_SIGN = '=',
+ G_TOKEN_COMMA = ',',
+
+ G_TOKEN_NONE = 256,
+
+ G_TOKEN_ERROR,
+
+ G_TOKEN_CHAR,
+ G_TOKEN_BINARY,
+ G_TOKEN_OCTAL,
+ G_TOKEN_INT,
+ G_TOKEN_HEX,
+ G_TOKEN_FLOAT,
+ G_TOKEN_STRING,
+
+ G_TOKEN_SYMBOL,
+ G_TOKEN_IDENTIFIER,
+ G_TOKEN_IDENTIFIER_NULL,
+
+ G_TOKEN_COMMENT_SINGLE,
+ G_TOKEN_COMMENT_MULTI,
+
+ /*< private >*/
+ G_TOKEN_LAST
+} GTokenType;
+
+union _GTokenValue
+{
+ gpointer v_symbol;
+ gchar *v_identifier;
+ gulong v_binary;
+ gulong v_octal;
+ gulong v_int;
+ guint64 v_int64;
+ gdouble v_float;
+ gulong v_hex;
+ gchar *v_string;
+ gchar *v_comment;
+ guchar v_char;
+ guint v_error;
+};
+
+struct _GScannerConfig
+{
+ /* Character sets
+ */
+ gchar *cset_skip_characters; /* default: " \t\n" */
+ gchar *cset_identifier_first;
+ gchar *cset_identifier_nth;
+ gchar *cpair_comment_single; /* default: "#\n" */
+
+ /* Should symbol lookup work case sensitive?
+ */
+ guint case_sensitive : 1;
+
+ /* Boolean values to be adjusted "on the fly"
+ * to configure scanning behaviour.
+ */
+ guint skip_comment_multi : 1; /* C like comment */
+ guint skip_comment_single : 1; /* single line comment */
+ guint scan_comment_multi : 1; /* scan multi line comments? */
+ guint scan_identifier : 1;
+ guint scan_identifier_1char : 1;
+ guint scan_identifier_NULL : 1;
+ guint scan_symbols : 1;
+ guint scan_binary : 1;
+ guint scan_octal : 1;
+ guint scan_float : 1;
+ guint scan_hex : 1; /* '0x0ff0' */
+ guint scan_hex_dollar : 1; /* '$0ff0' */
+ guint scan_string_sq : 1; /* string: 'anything' */
+ guint scan_string_dq : 1; /* string: "\\-escapes!\n" */
+ guint numbers_2_int : 1; /* bin, octal, hex => int */
+ guint int_2_float : 1; /* int => G_TOKEN_FLOAT? */
+ guint identifier_2_string : 1;
+ guint char_2_token : 1; /* return G_TOKEN_CHAR? */
+ guint symbol_2_token : 1;
+ guint scope_0_fallback : 1; /* try scope 0 on lookups? */
+ guint store_int64 : 1; /* use value.v_int64 rather than v_int */
+
+ /*< private >*/
+ guint padding_dummy;
+};
+
+struct _GScanner
+{
+ /* unused fields */
+ gpointer user_data;
+ guint max_parse_errors;
+
+ /* g_scanner_error() increments this field */
+ guint parse_errors;
+
+ /* name of input stream, featured by the default message handler */
+ const gchar *input_name;
+
+ /* quarked data */
+ GData *qdata;
+
+ /* link into the scanner configuration */
+ GScannerConfig *config;
+
+ /* fields filled in after g_scanner_get_next_token() */
+ GTokenType token;
+ GTokenValue value;
+ guint line;
+ guint position;
+
+ /* fields filled in after g_scanner_peek_next_token() */
+ GTokenType next_token;
+ GTokenValue next_value;
+ guint next_line;
+ guint next_position;
+
+ /*< private >*/
+ /* to be considered private */
+ GHashTable *symbol_table;
+ gint input_fd;
+ const gchar *text;
+ const gchar *text_end;
+ gchar *buffer;
+ guint scope_id;
+
+ /*< public >*/
+ /* handler function for _warn and _error */
+ GScannerMsgFunc msg_handler;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GScanner* g_scanner_new (const GScannerConfig *config_templ);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_destroy (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_input_file (GScanner *scanner,
+ gint input_fd);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_sync_file_offset (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_input_text (GScanner *scanner,
+ const gchar *text,
+ guint text_len);
+GLIB_AVAILABLE_IN_ALL
+GTokenType g_scanner_get_next_token (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+GTokenType g_scanner_peek_next_token (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+GTokenType g_scanner_cur_token (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+GTokenValue g_scanner_cur_value (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+guint g_scanner_cur_line (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+guint g_scanner_cur_position (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_scanner_eof (GScanner *scanner);
+GLIB_AVAILABLE_IN_ALL
+guint g_scanner_set_scope (GScanner *scanner,
+ guint scope_id);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_scope_add_symbol (GScanner *scanner,
+ guint scope_id,
+ const gchar *symbol,
+ gpointer value);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_scope_remove_symbol (GScanner *scanner,
+ guint scope_id,
+ const gchar *symbol);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_scanner_scope_lookup_symbol (GScanner *scanner,
+ guint scope_id,
+ const gchar *symbol);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_scope_foreach_symbol (GScanner *scanner,
+ guint scope_id,
+ GHFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_scanner_lookup_symbol (GScanner *scanner,
+ const gchar *symbol);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_unexp_token (GScanner *scanner,
+ GTokenType expected_token,
+ const gchar *identifier_spec,
+ const gchar *symbol_spec,
+ const gchar *symbol_name,
+ const gchar *message,
+ gint is_error);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_error (GScanner *scanner,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (2,3);
+GLIB_AVAILABLE_IN_ALL
+void g_scanner_warn (GScanner *scanner,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (2,3);
+
+/* keep downward source compatibility */
+#define g_scanner_add_symbol( scanner, symbol, value ) G_STMT_START { \
+ g_scanner_scope_add_symbol ((scanner), 0, (symbol), (value)); \
+} G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_scanner_scope_add_symbol)
+#define g_scanner_remove_symbol( scanner, symbol ) G_STMT_START { \
+ g_scanner_scope_remove_symbol ((scanner), 0, (symbol)); \
+} G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_scanner_scope_remove_symbol)
+#define g_scanner_foreach_symbol( scanner, func, data ) G_STMT_START { \
+ g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \
+} G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_scanner_scope_foreach_symbol)
+
+/* The following two functions are deprecated and will be removed in
+ * the next major release. They do no good. */
+#define g_scanner_freeze_symbol_table(scanner) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26
+#define g_scanner_thaw_symbol_table(scanner) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26
+
+G_END_DECLS
+
+#endif /* __G_SCANNER_H__ */
diff --git a/include/glib/glib/gsequence.h b/include/glib/glib/gsequence.h
new file mode 100644
index 0000000000..6dce2f4fba
--- /dev/null
+++ b/include/glib/glib/gsequence.h
@@ -0,0 +1,173 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ * Soeren Sandmann (sandmann@daimi.au.dk)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SEQUENCE_H__
+#define __G_SEQUENCE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GSequence GSequence;
+typedef struct _GSequenceNode GSequenceIter;
+
+typedef gint (* GSequenceIterCompareFunc) (GSequenceIter *a,
+ GSequenceIter *b,
+ gpointer data);
+
+
+/* GSequence */
+GLIB_AVAILABLE_IN_ALL
+GSequence * g_sequence_new (GDestroyNotify data_destroy);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_free (GSequence *seq);
+GLIB_AVAILABLE_IN_ALL
+gint g_sequence_get_length (GSequence *seq);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_foreach (GSequence *seq,
+ GFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_foreach_range (GSequenceIter *begin,
+ GSequenceIter *end,
+ GFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_sort (GSequence *seq,
+ GCompareDataFunc cmp_func,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_sort_iter (GSequence *seq,
+ GSequenceIterCompareFunc cmp_func,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_2_48
+gboolean g_sequence_is_empty (GSequence *seq);
+
+
+/* Getting iters */
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_get_begin_iter (GSequence *seq);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_get_end_iter (GSequence *seq);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_get_iter_at_pos (GSequence *seq,
+ gint pos);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_append (GSequence *seq,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_prepend (GSequence *seq,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_insert_before (GSequenceIter *iter,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_move (GSequenceIter *src,
+ GSequenceIter *dest);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_swap (GSequenceIter *a,
+ GSequenceIter *b);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_insert_sorted (GSequence *seq,
+ gpointer data,
+ GCompareDataFunc cmp_func,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_insert_sorted_iter (GSequence *seq,
+ gpointer data,
+ GSequenceIterCompareFunc iter_cmp,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_sort_changed (GSequenceIter *iter,
+ GCompareDataFunc cmp_func,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_sort_changed_iter (GSequenceIter *iter,
+ GSequenceIterCompareFunc iter_cmp,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_remove (GSequenceIter *iter);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_remove_range (GSequenceIter *begin,
+ GSequenceIter *end);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_move_range (GSequenceIter *dest,
+ GSequenceIter *begin,
+ GSequenceIter *end);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_search (GSequence *seq,
+ gpointer data,
+ GCompareDataFunc cmp_func,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_search_iter (GSequence *seq,
+ gpointer data,
+ GSequenceIterCompareFunc iter_cmp,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_lookup (GSequence *seq,
+ gpointer data,
+ GCompareDataFunc cmp_func,
+ gpointer cmp_data);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_lookup_iter (GSequence *seq,
+ gpointer data,
+ GSequenceIterCompareFunc iter_cmp,
+ gpointer cmp_data);
+
+
+/* Dereferencing */
+GLIB_AVAILABLE_IN_ALL
+gpointer g_sequence_get (GSequenceIter *iter);
+GLIB_AVAILABLE_IN_ALL
+void g_sequence_set (GSequenceIter *iter,
+ gpointer data);
+
+/* Operations on GSequenceIter * */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_sequence_iter_is_begin (GSequenceIter *iter);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_sequence_iter_is_end (GSequenceIter *iter);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_iter_next (GSequenceIter *iter);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_iter_prev (GSequenceIter *iter);
+GLIB_AVAILABLE_IN_ALL
+gint g_sequence_iter_get_position (GSequenceIter *iter);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_iter_move (GSequenceIter *iter,
+ gint delta);
+GLIB_AVAILABLE_IN_ALL
+GSequence * g_sequence_iter_get_sequence (GSequenceIter *iter);
+
+
+/* Search */
+GLIB_AVAILABLE_IN_ALL
+gint g_sequence_iter_compare (GSequenceIter *a,
+ GSequenceIter *b);
+GLIB_AVAILABLE_IN_ALL
+GSequenceIter *g_sequence_range_get_midpoint (GSequenceIter *begin,
+ GSequenceIter *end);
+
+G_END_DECLS
+
+#endif /* __G_SEQUENCE_H__ */
diff --git a/include/glib/glib/gshell.h b/include/glib/glib/gshell.h
new file mode 100644
index 0000000000..798dd78084
--- /dev/null
+++ b/include/glib/glib/gshell.h
@@ -0,0 +1,57 @@
+/* gshell.h - Shell-related utilities
+ *
+ * Copyright 2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SHELL_H__
+#define __G_SHELL_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+
+G_BEGIN_DECLS
+
+#define G_SHELL_ERROR g_shell_error_quark ()
+
+typedef enum
+{
+ /* mismatched or otherwise mangled quoting */
+ G_SHELL_ERROR_BAD_QUOTING,
+ /* string to be parsed was empty */
+ G_SHELL_ERROR_EMPTY_STRING,
+ G_SHELL_ERROR_FAILED
+} GShellError;
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_shell_error_quark (void);
+
+GLIB_AVAILABLE_IN_ALL
+gchar* g_shell_quote (const gchar *unquoted_string);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_shell_unquote (const gchar *quoted_string,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_shell_parse_argv (const gchar *command_line,
+ gint *argcp,
+ gchar ***argvp,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_SHELL_H__ */
diff --git a/include/glib/glib/gslice.h b/include/glib/glib/gslice.h
new file mode 100644
index 0000000000..ff8b02a65d
--- /dev/null
+++ b/include/glib/glib/gslice.h
@@ -0,0 +1,99 @@
+/* GLIB sliced memory - fast threaded memory chunk allocator
+ * Copyright (C) 2005 Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SLICE_H__
+#define __G_SLICE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/* slices - fast allocation/release of small memory blocks
+ */
+GLIB_AVAILABLE_IN_ALL
+gpointer g_slice_alloc (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_slice_alloc0 (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_slice_copy (gsize block_size,
+ gconstpointer mem_block) G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
+void g_slice_free1 (gsize block_size,
+ gpointer mem_block);
+GLIB_AVAILABLE_IN_ALL
+void g_slice_free_chain_with_offset (gsize block_size,
+ gpointer mem_chain,
+ gsize next_offset);
+#define g_slice_new(type) ((type*) g_slice_alloc (sizeof (type)))
+#define g_slice_new0(type) ((type*) g_slice_alloc0 (sizeof (type)))
+/* MemoryBlockType *
+ * g_slice_dup (MemoryBlockType,
+ * MemoryBlockType *mem_block);
+ * g_slice_free (MemoryBlockType,
+ * MemoryBlockType *mem_block);
+ * g_slice_free_chain (MemoryBlockType,
+ * MemoryBlockType *first_chain_block,
+ * memory_block_next_field);
+ * pseudo prototypes for the macro
+ * definitions following below.
+ */
+
+/* we go through extra hoops to ensure type safety */
+#define g_slice_dup(type, mem) \
+ (1 ? (type*) g_slice_copy (sizeof (type), (mem)) \
+ : ((void) ((type*) 0 == (mem)), (type*) 0))
+#define g_slice_free(type, mem) \
+G_STMT_START { \
+ if (1) g_slice_free1 (sizeof (type), (mem)); \
+ else (void) ((type*) 0 == (mem)); \
+} G_STMT_END
+#define g_slice_free_chain(type, mem_chain, next) \
+G_STMT_START { \
+ if (1) g_slice_free_chain_with_offset (sizeof (type), \
+ (mem_chain), G_STRUCT_OFFSET (type, next)); \
+ else (void) ((type*) 0 == (mem_chain)); \
+} G_STMT_END
+
+/* --- internal debugging API --- */
+typedef enum {
+ G_SLICE_CONFIG_ALWAYS_MALLOC = 1,
+ G_SLICE_CONFIG_BYPASS_MAGAZINES,
+ G_SLICE_CONFIG_WORKING_SET_MSECS,
+ G_SLICE_CONFIG_COLOR_INCREMENT,
+ G_SLICE_CONFIG_CHUNK_SIZES,
+ G_SLICE_CONFIG_CONTENTION_COUNTER
+} GSliceConfig;
+
+GLIB_DEPRECATED_IN_2_34
+void g_slice_set_config (GSliceConfig ckey, gint64 value);
+GLIB_DEPRECATED_IN_2_34
+gint64 g_slice_get_config (GSliceConfig ckey);
+GLIB_DEPRECATED_IN_2_34
+gint64* g_slice_get_config_state (GSliceConfig ckey, gint64 address, guint *n_values);
+
+#ifdef G_ENABLE_DEBUG
+GLIB_AVAILABLE_IN_ALL
+void g_slice_debug_tree_statistics (void);
+#endif
+
+G_END_DECLS
+
+#endif /* __G_SLICE_H__ */
diff --git a/include/glib/glib/gslist.h b/include/glib/glib/gslist.h
new file mode 100644
index 0000000000..2704ef7d35
--- /dev/null
+++ b/include/glib/glib/gslist.h
@@ -0,0 +1,143 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_SLIST_H__
+#define __G_SLIST_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gmem.h>
+#include <glib/gnode.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GSList GSList;
+
+struct _GSList
+{
+ gpointer data;
+ GSList *next;
+};
+
+/* Singly linked lists
+ */
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_alloc (void) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+void g_slist_free (GSList *list);
+GLIB_AVAILABLE_IN_ALL
+void g_slist_free_1 (GSList *list);
+#define g_slist_free1 g_slist_free_1
+GLIB_AVAILABLE_IN_ALL
+void g_slist_free_full (GSList *list,
+ GDestroyNotify free_func);
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_append (GSList *list,
+ gpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_prepend (GSList *list,
+ gpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_insert (GSList *list,
+ gpointer data,
+ gint position) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_insert_sorted (GSList *list,
+ gpointer data,
+ GCompareFunc func) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_insert_sorted_with_data (GSList *list,
+ gpointer data,
+ GCompareDataFunc func,
+ gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_insert_before (GSList *slist,
+ GSList *sibling,
+ gpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_concat (GSList *list1,
+ GSList *list2) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_remove (GSList *list,
+ gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_remove_all (GSList *list,
+ gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_remove_link (GSList *list,
+ GSList *link_) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_delete_link (GSList *list,
+ GSList *link_) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_reverse (GSList *list) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_copy (GSList *list) G_GNUC_WARN_UNUSED_RESULT;
+
+GLIB_AVAILABLE_IN_2_34
+GSList* g_slist_copy_deep (GSList *list,
+ GCopyFunc func,
+ gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_nth (GSList *list,
+ guint n);
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_find (GSList *list,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_find_custom (GSList *list,
+ gconstpointer data,
+ GCompareFunc func);
+GLIB_AVAILABLE_IN_ALL
+gint g_slist_position (GSList *list,
+ GSList *llink);
+GLIB_AVAILABLE_IN_ALL
+gint g_slist_index (GSList *list,
+ gconstpointer data);
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_last (GSList *list);
+GLIB_AVAILABLE_IN_ALL
+guint g_slist_length (GSList *list);
+GLIB_AVAILABLE_IN_ALL
+void g_slist_foreach (GSList *list,
+ GFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_sort (GSList *list,
+ GCompareFunc compare_func) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+GSList* g_slist_sort_with_data (GSList *list,
+ GCompareDataFunc compare_func,
+ gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
+gpointer g_slist_nth_data (GSList *list,
+ guint n);
+
+#define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL)
+
+G_END_DECLS
+
+#endif /* __G_SLIST_H__ */
diff --git a/include/glib/glib/gspawn.h b/include/glib/glib/gspawn.h
new file mode 100644
index 0000000000..240aae768e
--- /dev/null
+++ b/include/glib/glib/gspawn.h
@@ -0,0 +1,265 @@
+/* gspawn.h - Process launching
+ *
+ * Copyright 2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_SPAWN_H__
+#define __G_SPAWN_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+
+G_BEGIN_DECLS
+
+
+/* I'm not sure I remember our proposed naming convention here. */
+/**
+ * G_SPAWN_ERROR:
+ *
+ * Error domain for spawning processes. Errors in this domain will
+ * be from the #GSpawnError enumeration. See #GError for information on
+ * error domains.
+ */
+#define G_SPAWN_ERROR g_spawn_error_quark ()
+
+/**
+ * GSpawnError:
+ * @G_SPAWN_ERROR_FORK: Fork failed due to lack of memory.
+ * @G_SPAWN_ERROR_READ: Read or select on pipes failed.
+ * @G_SPAWN_ERROR_CHDIR: Changing to working directory failed.
+ * @G_SPAWN_ERROR_ACCES: execv() returned `EACCES`
+ * @G_SPAWN_ERROR_PERM: execv() returned `EPERM`
+ * @G_SPAWN_ERROR_TOO_BIG: execv() returned `E2BIG`
+ * @G_SPAWN_ERROR_2BIG: deprecated alias for %G_SPAWN_ERROR_TOO_BIG (deprecated since GLib 2.32)
+ * @G_SPAWN_ERROR_NOEXEC: execv() returned `ENOEXEC`
+ * @G_SPAWN_ERROR_NAMETOOLONG: execv() returned `ENAMETOOLONG`
+ * @G_SPAWN_ERROR_NOENT: execv() returned `ENOENT`
+ * @G_SPAWN_ERROR_NOMEM: execv() returned `ENOMEM`
+ * @G_SPAWN_ERROR_NOTDIR: execv() returned `ENOTDIR`
+ * @G_SPAWN_ERROR_LOOP: execv() returned `ELOOP`
+ * @G_SPAWN_ERROR_TXTBUSY: execv() returned `ETXTBUSY`
+ * @G_SPAWN_ERROR_IO: execv() returned `EIO`
+ * @G_SPAWN_ERROR_NFILE: execv() returned `ENFILE`
+ * @G_SPAWN_ERROR_MFILE: execv() returned `EMFILE`
+ * @G_SPAWN_ERROR_INVAL: execv() returned `EINVAL`
+ * @G_SPAWN_ERROR_ISDIR: execv() returned `EISDIR`
+ * @G_SPAWN_ERROR_LIBBAD: execv() returned `ELIBBAD`
+ * @G_SPAWN_ERROR_FAILED: Some other fatal failure,
+ * `error->message` should explain.
+ *
+ * Error codes returned by spawning processes.
+ */
+typedef enum
+{
+ G_SPAWN_ERROR_FORK, /* fork failed due to lack of memory */
+ G_SPAWN_ERROR_READ, /* read or select on pipes failed */
+ G_SPAWN_ERROR_CHDIR, /* changing to working dir failed */
+ G_SPAWN_ERROR_ACCES, /* execv() returned EACCES */
+ G_SPAWN_ERROR_PERM, /* execv() returned EPERM */
+ G_SPAWN_ERROR_TOO_BIG,/* execv() returned E2BIG */
+ G_SPAWN_ERROR_2BIG GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(G_SPAWN_ERROR_TOO_BIG) = G_SPAWN_ERROR_TOO_BIG,
+ G_SPAWN_ERROR_NOEXEC, /* execv() returned ENOEXEC */
+ G_SPAWN_ERROR_NAMETOOLONG, /* "" "" ENAMETOOLONG */
+ G_SPAWN_ERROR_NOENT, /* "" "" ENOENT */
+ G_SPAWN_ERROR_NOMEM, /* "" "" ENOMEM */
+ G_SPAWN_ERROR_NOTDIR, /* "" "" ENOTDIR */
+ G_SPAWN_ERROR_LOOP, /* "" "" ELOOP */
+ G_SPAWN_ERROR_TXTBUSY, /* "" "" ETXTBUSY */
+ G_SPAWN_ERROR_IO, /* "" "" EIO */
+ G_SPAWN_ERROR_NFILE, /* "" "" ENFILE */
+ G_SPAWN_ERROR_MFILE, /* "" "" EMFLE */
+ G_SPAWN_ERROR_INVAL, /* "" "" EINVAL */
+ G_SPAWN_ERROR_ISDIR, /* "" "" EISDIR */
+ G_SPAWN_ERROR_LIBBAD, /* "" "" ELIBBAD */
+ G_SPAWN_ERROR_FAILED /* other fatal failure, error->message
+ * should explain
+ */
+} GSpawnError;
+
+/**
+ * G_SPAWN_EXIT_ERROR:
+ *
+ * Error domain used by g_spawn_check_exit_status(). The code
+ * will be the program exit code.
+ */
+#define G_SPAWN_EXIT_ERROR g_spawn_exit_error_quark ()
+
+/**
+ * GSpawnChildSetupFunc:
+ * @user_data: (closure): user data to pass to the function.
+ *
+ * Specifies the type of the setup function passed to g_spawn_async(),
+ * g_spawn_sync() and g_spawn_async_with_pipes(), which can, in very
+ * limited ways, be used to affect the child's execution.
+ *
+ * On POSIX platforms, the function is called in the child after GLib
+ * has performed all the setup it plans to perform, but before calling
+ * exec(). Actions taken in this function will only affect the child,
+ * not the parent.
+ *
+ * On Windows, the function is called in the parent. Its usefulness on
+ * Windows is thus questionable. In many cases executing the child setup
+ * function in the parent can have ill effects, and you should be very
+ * careful when porting software to Windows that uses child setup
+ * functions.
+ *
+ * However, even on POSIX, you are extremely limited in what you can
+ * safely do from a #GSpawnChildSetupFunc, because any mutexes that were
+ * held by other threads in the parent process at the time of the fork()
+ * will still be locked in the child process, and they will never be
+ * unlocked (since the threads that held them don't exist in the child).
+ * POSIX allows only async-signal-safe functions (see signal(7)) to be
+ * called in the child between fork() and exec(), which drastically limits
+ * the usefulness of child setup functions.
+ *
+ * In particular, it is not safe to call any function which may
+ * call malloc(), which includes POSIX functions such as setenv().
+ * If you need to set up the child environment differently from
+ * the parent, you should use g_get_environ(), g_environ_setenv(),
+ * and g_environ_unsetenv(), and then pass the complete environment
+ * list to the `g_spawn...` function.
+ */
+typedef void (* GSpawnChildSetupFunc) (gpointer user_data);
+
+/**
+ * GSpawnFlags:
+ * @G_SPAWN_DEFAULT: no flags, default behaviour
+ * @G_SPAWN_LEAVE_DESCRIPTORS_OPEN: the parent's open file descriptors will
+ * be inherited by the child; otherwise all descriptors except stdin,
+ * stdout and stderr will be closed before calling exec() in the child.
+ * @G_SPAWN_DO_NOT_REAP_CHILD: the child will not be automatically reaped;
+ * you must use g_child_watch_add() yourself (or call waitpid() or handle
+ * `SIGCHLD` yourself), or the child will become a zombie.
+ * @G_SPAWN_SEARCH_PATH: `argv[0]` need not be an absolute path, it will be
+ * looked for in the user's `PATH`.
+ * @G_SPAWN_STDOUT_TO_DEV_NULL: the child's standard output will be discarded,
+ * instead of going to the same location as the parent's standard output.
+ * @G_SPAWN_STDERR_TO_DEV_NULL: the child's standard error will be discarded.
+ * @G_SPAWN_CHILD_INHERITS_STDIN: the child will inherit the parent's standard
+ * input (by default, the child's standard input is attached to `/dev/null`).
+ * @G_SPAWN_FILE_AND_ARGV_ZERO: the first element of `argv` is the file to
+ * execute, while the remaining elements are the actual argument vector
+ * to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
+ * as the file to execute, and passes all of `argv` to the child.
+ * @G_SPAWN_SEARCH_PATH_FROM_ENVP: if `argv[0]` is not an abolute path,
+ * it will be looked for in the `PATH` from the passed child environment.
+ * Since: 2.34
+ * @G_SPAWN_CLOEXEC_PIPES: create all pipes with the `O_CLOEXEC` flag set.
+ * Since: 2.40
+ *
+ * Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
+ */
+typedef enum
+{
+ G_SPAWN_DEFAULT = 0,
+ G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 << 0,
+ G_SPAWN_DO_NOT_REAP_CHILD = 1 << 1,
+ /* look for argv[0] in the path i.e. use execvp() */
+ G_SPAWN_SEARCH_PATH = 1 << 2,
+ /* Dump output to /dev/null */
+ G_SPAWN_STDOUT_TO_DEV_NULL = 1 << 3,
+ G_SPAWN_STDERR_TO_DEV_NULL = 1 << 4,
+ G_SPAWN_CHILD_INHERITS_STDIN = 1 << 5,
+ G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6,
+ G_SPAWN_SEARCH_PATH_FROM_ENVP = 1 << 7,
+ G_SPAWN_CLOEXEC_PIPES = 1 << 8
+} GSpawnFlags;
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_spawn_error_quark (void);
+GLIB_AVAILABLE_IN_ALL
+GQuark g_spawn_exit_error_quark (void);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_spawn_async (const gchar *working_directory,
+ gchar **argv,
+ gchar **envp,
+ GSpawnFlags flags,
+ GSpawnChildSetupFunc child_setup,
+ gpointer user_data,
+ GPid *child_pid,
+ GError **error);
+
+
+/* Opens pipes for non-NULL standard_output, standard_input, standard_error,
+ * and returns the parent's end of the pipes.
+ */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_spawn_async_with_pipes (const gchar *working_directory,
+ gchar **argv,
+ gchar **envp,
+ GSpawnFlags flags,
+ GSpawnChildSetupFunc child_setup,
+ gpointer user_data,
+ GPid *child_pid,
+ gint *standard_input,
+ gint *standard_output,
+ gint *standard_error,
+ GError **error);
+
+/* Lets you provide fds for stdin/stdout/stderr */
+GLIB_AVAILABLE_IN_2_58
+gboolean g_spawn_async_with_fds (const gchar *working_directory,
+ gchar **argv,
+ gchar **envp,
+ GSpawnFlags flags,
+ GSpawnChildSetupFunc child_setup,
+ gpointer user_data,
+ GPid *child_pid,
+ gint stdin_fd,
+ gint stdout_fd,
+ gint stderr_fd,
+ GError **error);
+
+/* If standard_output or standard_error are non-NULL, the full
+ * standard output or error of the command will be placed there.
+ */
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_spawn_sync (const gchar *working_directory,
+ gchar **argv,
+ gchar **envp,
+ GSpawnFlags flags,
+ GSpawnChildSetupFunc child_setup,
+ gpointer user_data,
+ gchar **standard_output,
+ gchar **standard_error,
+ gint *exit_status,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_spawn_command_line_sync (const gchar *command_line,
+ gchar **standard_output,
+ gchar **standard_error,
+ gint *exit_status,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_spawn_command_line_async (const gchar *command_line,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_34
+gboolean g_spawn_check_exit_status (gint exit_status,
+ GError **error);
+
+GLIB_AVAILABLE_IN_ALL
+void g_spawn_close_pid (GPid pid);
+
+G_END_DECLS
+
+#endif /* __G_SPAWN_H__ */
diff --git a/include/glib/glib/gstdio.h b/include/glib/glib/gstdio.h
new file mode 100644
index 0000000000..f1781f3e92
--- /dev/null
+++ b/include/glib/glib/gstdio.h
@@ -0,0 +1,177 @@
+/* gstdio.h - GFilename wrappers for C library functions
+ *
+ * Copyright 2004 Tor Lillqvist
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_STDIO_H__
+#define __G_STDIO_H__
+
+#include <glib/gprintf.h>
+
+#include <sys/stat.h>
+
+G_BEGIN_DECLS
+
+#if (defined (__MINGW64_VERSION_MAJOR) || defined (_MSC_VER)) && !defined(_WIN64)
+
+/* Make it clear that we mean the struct with 32-bit st_size and
+ * 32-bit st_*time fields as that is how the 32-bit GLib DLL normally
+ * has been compiled. If you get a compiler warning when calling
+ * g_stat(), do take it seriously and make sure that the type of
+ * struct stat the code in GLib fills in matches the struct the type
+ * of struct stat you pass to g_stat(). To avoid hassle, to get file
+ * attributes just use the GIO API instead which doesn't use struct
+ * stat.
+ *
+ * Sure, it would be nicer to use a struct with 64-bit st_size and
+ * 64-bit st_*time fields, but changing that now would break ABI. And
+ * in MinGW, a plain "struct stat" is the one with 32-bit st_size and
+ * st_*time fields.
+ */
+
+typedef struct _stat32 GStatBuf;
+
+#elif defined(__MINGW64_VERSION_MAJOR) && defined(_WIN64)
+
+typedef struct _stat64 GStatBuf;
+
+#else
+
+typedef struct stat GStatBuf;
+
+#endif
+
+#if defined(G_OS_UNIX) && !defined(G_STDIO_WRAP_ON_UNIX)
+
+/* Just pass on to the system functions, so there's no potential for data
+ * format mismatches, especially with large file interfaces.
+ * A few functions can't be handled in this way, since they are not defined
+ * in a portable system header that we could include here.
+ *
+ * #G_STDIO_WRAP_ON_UNIX is not public API and its behaviour is not guaranteed
+ * in future.
+ */
+
+#ifndef __GTK_DOC_IGNORE__
+#define g_chmod chmod
+#define g_open open
+#define g_creat creat
+#define g_rename rename
+#define g_mkdir mkdir
+#define g_stat stat
+#define g_lstat lstat
+#define g_remove remove
+#define g_fopen fopen
+#define g_freopen freopen
+#define g_utime utime
+#endif
+
+GLIB_AVAILABLE_IN_ALL
+int g_access (const gchar *filename,
+ int mode);
+
+GLIB_AVAILABLE_IN_ALL
+int g_chdir (const gchar *path);
+
+GLIB_AVAILABLE_IN_ALL
+int g_unlink (const gchar *filename);
+
+GLIB_AVAILABLE_IN_ALL
+int g_rmdir (const gchar *filename);
+
+#else /* ! G_OS_UNIX */
+
+/* Wrappers for C library functions that take pathname arguments. On
+ * Unix, the pathname is a file name as it literally is in the file
+ * system. On well-maintained systems with consistent users who know
+ * what they are doing and no exchange of files with others this would
+ * be a well-defined encoding, preferably UTF-8. On Windows, the
+ * pathname is always in UTF-8, even if that is not the on-disk
+ * encoding, and not the encoding accepted by the C library or Win32
+ * API.
+ */
+
+GLIB_AVAILABLE_IN_ALL
+int g_access (const gchar *filename,
+ int mode);
+
+GLIB_AVAILABLE_IN_ALL
+int g_chmod (const gchar *filename,
+ int mode);
+
+GLIB_AVAILABLE_IN_ALL
+int g_open (const gchar *filename,
+ int flags,
+ int mode);
+
+GLIB_AVAILABLE_IN_ALL
+int g_creat (const gchar *filename,
+ int mode);
+
+GLIB_AVAILABLE_IN_ALL
+int g_rename (const gchar *oldfilename,
+ const gchar *newfilename);
+
+GLIB_AVAILABLE_IN_ALL
+int g_mkdir (const gchar *filename,
+ int mode);
+
+GLIB_AVAILABLE_IN_ALL
+int g_chdir (const gchar *path);
+
+GLIB_AVAILABLE_IN_ALL
+int g_stat (const gchar *filename,
+ GStatBuf *buf);
+
+GLIB_AVAILABLE_IN_ALL
+int g_lstat (const gchar *filename,
+ GStatBuf *buf);
+
+GLIB_AVAILABLE_IN_ALL
+int g_unlink (const gchar *filename);
+
+GLIB_AVAILABLE_IN_ALL
+int g_remove (const gchar *filename);
+
+GLIB_AVAILABLE_IN_ALL
+int g_rmdir (const gchar *filename);
+
+GLIB_AVAILABLE_IN_ALL
+FILE *g_fopen (const gchar *filename,
+ const gchar *mode);
+
+GLIB_AVAILABLE_IN_ALL
+FILE *g_freopen (const gchar *filename,
+ const gchar *mode,
+ FILE *stream);
+
+struct utimbuf; /* Don't need the real definition of struct utimbuf when just
+ * including this header.
+ */
+
+GLIB_AVAILABLE_IN_ALL
+int g_utime (const gchar *filename,
+ struct utimbuf *utb);
+
+#endif /* G_OS_UNIX */
+
+GLIB_AVAILABLE_IN_2_36
+gboolean g_close (gint fd,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_STDIO_H__ */
diff --git a/include/glib/glib/gstrfuncs.h b/include/glib/glib/gstrfuncs.h
new file mode 100644
index 0000000000..fc88cc1c52
--- /dev/null
+++ b/include/glib/glib/gstrfuncs.h
@@ -0,0 +1,362 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_STRFUNCS_H__
+#define __G_STRFUNCS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <stdarg.h>
+#include <glib/gmacros.h>
+#include <glib/gtypes.h>
+#include <glib/gerror.h>
+
+G_BEGIN_DECLS
+
+/* Functions like the ones in <ctype.h> that are not affected by locale. */
+typedef enum {
+ G_ASCII_ALNUM = 1 << 0,
+ G_ASCII_ALPHA = 1 << 1,
+ G_ASCII_CNTRL = 1 << 2,
+ G_ASCII_DIGIT = 1 << 3,
+ G_ASCII_GRAPH = 1 << 4,
+ G_ASCII_LOWER = 1 << 5,
+ G_ASCII_PRINT = 1 << 6,
+ G_ASCII_PUNCT = 1 << 7,
+ G_ASCII_SPACE = 1 << 8,
+ G_ASCII_UPPER = 1 << 9,
+ G_ASCII_XDIGIT = 1 << 10
+} GAsciiType;
+
+GLIB_VAR const guint16 * const g_ascii_table;
+
+#define g_ascii_isalnum(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_ALNUM) != 0)
+
+#define g_ascii_isalpha(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_ALPHA) != 0)
+
+#define g_ascii_iscntrl(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_CNTRL) != 0)
+
+#define g_ascii_isdigit(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_DIGIT) != 0)
+
+#define g_ascii_isgraph(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_GRAPH) != 0)
+
+#define g_ascii_islower(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_LOWER) != 0)
+
+#define g_ascii_isprint(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_PRINT) != 0)
+
+#define g_ascii_ispunct(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_PUNCT) != 0)
+
+#define g_ascii_isspace(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_SPACE) != 0)
+
+#define g_ascii_isupper(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_UPPER) != 0)
+
+#define g_ascii_isxdigit(c) \
+ ((g_ascii_table[(guchar) (c)] & G_ASCII_XDIGIT) != 0)
+
+GLIB_AVAILABLE_IN_ALL
+gchar g_ascii_tolower (gchar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gchar g_ascii_toupper (gchar c) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gint g_ascii_digit_value (gchar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gint g_ascii_xdigit_value (gchar c) G_GNUC_CONST;
+
+/* String utility functions that modify a string argument or
+ * return a constant string that must not be freed.
+ */
+#define G_STR_DELIMITERS "_-|> <."
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strdelimit (gchar *string,
+ const gchar *delimiters,
+ gchar new_delimiter);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strcanon (gchar *string,
+ const gchar *valid_chars,
+ gchar substitutor);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_strerror (gint errnum) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_strsignal (gint signum) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gchar * g_strreverse (gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gsize g_strlcpy (gchar *dest,
+ const gchar *src,
+ gsize dest_size);
+GLIB_AVAILABLE_IN_ALL
+gsize g_strlcat (gchar *dest,
+ const gchar *src,
+ gsize dest_size);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_strstr_len (const gchar *haystack,
+ gssize haystack_len,
+ const gchar *needle);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_strrstr (const gchar *haystack,
+ const gchar *needle);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_strrstr_len (const gchar *haystack,
+ gssize haystack_len,
+ const gchar *needle);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_str_has_suffix (const gchar *str,
+ const gchar *suffix);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_str_has_prefix (const gchar *str,
+ const gchar *prefix);
+
+/* String to/from double conversion functions */
+
+GLIB_AVAILABLE_IN_ALL
+gdouble g_strtod (const gchar *nptr,
+ gchar **endptr);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_ascii_strtod (const gchar *nptr,
+ gchar **endptr);
+GLIB_AVAILABLE_IN_ALL
+guint64 g_ascii_strtoull (const gchar *nptr,
+ gchar **endptr,
+ guint base);
+GLIB_AVAILABLE_IN_ALL
+gint64 g_ascii_strtoll (const gchar *nptr,
+ gchar **endptr,
+ guint base);
+/* 29 bytes should enough for all possible values that
+ * g_ascii_dtostr can produce.
+ * Then add 10 for good measure */
+#define G_ASCII_DTOSTR_BUF_SIZE (29 + 10)
+GLIB_AVAILABLE_IN_ALL
+gchar * g_ascii_dtostr (gchar *buffer,
+ gint buf_len,
+ gdouble d);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_ascii_formatd (gchar *buffer,
+ gint buf_len,
+ const gchar *format,
+ gdouble d);
+
+/* removes leading spaces */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strchug (gchar *string);
+/* removes trailing spaces */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strchomp (gchar *string);
+/* removes leading & trailing spaces */
+#define g_strstrip( string ) g_strchomp (g_strchug (string))
+
+GLIB_AVAILABLE_IN_ALL
+gint g_ascii_strcasecmp (const gchar *s1,
+ const gchar *s2);
+GLIB_AVAILABLE_IN_ALL
+gint g_ascii_strncasecmp (const gchar *s1,
+ const gchar *s2,
+ gsize n);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_ascii_strdown (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_ascii_strup (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_str_is_ascii (const gchar *str);
+
+GLIB_DEPRECATED
+gint g_strcasecmp (const gchar *s1,
+ const gchar *s2);
+GLIB_DEPRECATED
+gint g_strncasecmp (const gchar *s1,
+ const gchar *s2,
+ guint n);
+GLIB_DEPRECATED
+gchar* g_strdown (gchar *string);
+GLIB_DEPRECATED
+gchar* g_strup (gchar *string);
+
+
+/* String utility functions that return a newly allocated string which
+ * ought to be freed with g_free from the caller at some point.
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strdup (const gchar *str) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strdup_printf (const gchar *format,
+ ...) G_GNUC_PRINTF (1, 2) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strdup_vprintf (const gchar *format,
+ va_list args) G_GNUC_PRINTF(1, 0) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strndup (const gchar *str,
+ gsize n) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strnfill (gsize length,
+ gchar fill_char) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strconcat (const gchar *string1,
+ ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strjoin (const gchar *separator,
+ ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
+
+/* Make a copy of a string interpreting C string -style escape
+ * sequences. Inverse of g_strescape. The recognized sequences are \b
+ * \f \n \r \t \\ \" and the octal format.
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strcompress (const gchar *source) G_GNUC_MALLOC;
+
+/* Copy a string escaping nonprintable characters like in C strings.
+ * Inverse of g_strcompress. The exceptions parameter, if non-NULL, points
+ * to a string containing characters that are not to be escaped.
+ *
+ * Deprecated API: gchar* g_strescape (const gchar *source);
+ * Luckily this function wasn't used much, using NULL as second parameter
+ * provides mostly identical semantics.
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strescape (const gchar *source,
+ const gchar *exceptions) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_memdup (gconstpointer mem,
+ guint byte_size) G_GNUC_ALLOC_SIZE(2);
+
+/* NULL terminated string arrays.
+ * g_strsplit(), g_strsplit_set() split up string into max_tokens tokens
+ * at delim and return a newly allocated string array.
+ * g_strjoinv() concatenates all of str_array's strings, sliding in an
+ * optional separator, the returned string is newly allocated.
+ * g_strfreev() frees the array itself and all of its strings.
+ * g_strdupv() copies a NULL-terminated array of strings
+ * g_strv_length() returns the length of a NULL-terminated array of strings
+ */
+typedef gchar** GStrv;
+GLIB_AVAILABLE_IN_ALL
+gchar** g_strsplit (const gchar *string,
+ const gchar *delimiter,
+ gint max_tokens);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_strsplit_set (const gchar *string,
+ const gchar *delimiters,
+ gint max_tokens);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strjoinv (const gchar *separator,
+ gchar **str_array) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+void g_strfreev (gchar **str_array);
+GLIB_AVAILABLE_IN_ALL
+gchar** g_strdupv (gchar **str_array);
+GLIB_AVAILABLE_IN_ALL
+guint g_strv_length (gchar **str_array);
+
+GLIB_AVAILABLE_IN_ALL
+gchar* g_stpcpy (gchar *dest,
+ const char *src);
+
+GLIB_AVAILABLE_IN_2_40
+gchar * g_str_to_ascii (const gchar *str,
+ const gchar *from_locale);
+
+GLIB_AVAILABLE_IN_2_40
+gchar ** g_str_tokenize_and_fold (const gchar *string,
+ const gchar *translit_locale,
+ gchar ***ascii_alternates);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_str_match_string (const gchar *search_term,
+ const gchar *potential_hit,
+ gboolean accept_alternates);
+
+GLIB_AVAILABLE_IN_2_44
+gboolean g_strv_contains (const gchar * const *strv,
+ const gchar *str);
+
+GLIB_AVAILABLE_IN_2_60
+gboolean g_strv_equal (const gchar * const *strv1,
+ const gchar * const *strv2);
+
+/* Convenience ASCII string to number API */
+
+/**
+ * GNumberParserError:
+ * @G_NUMBER_PARSER_ERROR_INVALID: String was not a valid number.
+ * @G_NUMBER_PARSER_ERROR_OUT_OF_BOUNDS: String was a number, but out of bounds.
+ *
+ * Error codes returned by functions converting a string to a number.
+ *
+ * Since: 2.54
+ */
+typedef enum
+ {
+ G_NUMBER_PARSER_ERROR_INVALID,
+ G_NUMBER_PARSER_ERROR_OUT_OF_BOUNDS,
+ } GNumberParserError;
+
+/**
+ * G_NUMBER_PARSER_ERROR:
+ *
+ * Domain for errors returned by functions converting a string to a
+ * number.
+ *
+ * Since: 2.54
+ */
+#define G_NUMBER_PARSER_ERROR (g_number_parser_error_quark ())
+
+GLIB_AVAILABLE_IN_2_54
+GQuark g_number_parser_error_quark (void);
+
+GLIB_AVAILABLE_IN_2_54
+gboolean g_ascii_string_to_signed (const gchar *str,
+ guint base,
+ gint64 min,
+ gint64 max,
+ gint64 *out_num,
+ GError **error);
+
+GLIB_AVAILABLE_IN_2_54
+gboolean g_ascii_string_to_unsigned (const gchar *str,
+ guint base,
+ guint64 min,
+ guint64 max,
+ guint64 *out_num,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __G_STRFUNCS_H__ */
diff --git a/include/glib/glib/gstring.h b/include/glib/glib/gstring.h
new file mode 100644
index 0000000000..e1b2e7fca7
--- /dev/null
+++ b/include/glib/glib/gstring.h
@@ -0,0 +1,187 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_STRING_H__
+#define __G_STRING_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+#include <glib/gunicode.h>
+#include <glib/gbytes.h>
+#include <glib/gutils.h> /* for G_CAN_INLINE */
+
+G_BEGIN_DECLS
+
+typedef struct _GString GString;
+
+struct _GString
+{
+ gchar *str;
+ gsize len;
+ gsize allocated_len;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_new (const gchar *init);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_new_len (const gchar *init,
+ gssize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_sized_new (gsize dfl_size);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_string_free (GString *string,
+ gboolean free_segment);
+GLIB_AVAILABLE_IN_2_34
+GBytes* g_string_free_to_bytes (GString *string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_string_equal (const GString *v,
+ const GString *v2);
+GLIB_AVAILABLE_IN_ALL
+guint g_string_hash (const GString *str);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_assign (GString *string,
+ const gchar *rval);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_truncate (GString *string,
+ gsize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_set_size (GString *string,
+ gsize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_insert_len (GString *string,
+ gssize pos,
+ const gchar *val,
+ gssize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_append (GString *string,
+ const gchar *val);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_append_len (GString *string,
+ const gchar *val,
+ gssize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_append_c (GString *string,
+ gchar c);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_append_unichar (GString *string,
+ gunichar wc);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_prepend (GString *string,
+ const gchar *val);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_prepend_c (GString *string,
+ gchar c);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_prepend_unichar (GString *string,
+ gunichar wc);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_prepend_len (GString *string,
+ const gchar *val,
+ gssize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_insert (GString *string,
+ gssize pos,
+ const gchar *val);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_insert_c (GString *string,
+ gssize pos,
+ gchar c);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_insert_unichar (GString *string,
+ gssize pos,
+ gunichar wc);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_overwrite (GString *string,
+ gsize pos,
+ const gchar *val);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_overwrite_len (GString *string,
+ gsize pos,
+ const gchar *val,
+ gssize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_erase (GString *string,
+ gssize pos,
+ gssize len);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_ascii_down (GString *string);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_ascii_up (GString *string);
+GLIB_AVAILABLE_IN_ALL
+void g_string_vprintf (GString *string,
+ const gchar *format,
+ va_list args)
+ G_GNUC_PRINTF(2, 0);
+GLIB_AVAILABLE_IN_ALL
+void g_string_printf (GString *string,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (2, 3);
+GLIB_AVAILABLE_IN_ALL
+void g_string_append_vprintf (GString *string,
+ const gchar *format,
+ va_list args)
+ G_GNUC_PRINTF(2, 0);
+GLIB_AVAILABLE_IN_ALL
+void g_string_append_printf (GString *string,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (2, 3);
+GLIB_AVAILABLE_IN_ALL
+GString* g_string_append_uri_escaped (GString *string,
+ const gchar *unescaped,
+ const gchar *reserved_chars_allowed,
+ gboolean allow_utf8);
+
+/* -- optimize g_strig_append_c --- */
+#ifdef G_CAN_INLINE
+static inline GString*
+g_string_append_c_inline (GString *gstring,
+ gchar c)
+{
+ if (gstring->len + 1 < gstring->allocated_len)
+ {
+ gstring->str[gstring->len++] = c;
+ gstring->str[gstring->len] = 0;
+ }
+ else
+ g_string_insert_c (gstring, -1, c);
+ return gstring;
+}
+#define g_string_append_c(gstr,c) g_string_append_c_inline (gstr, c)
+#endif /* G_CAN_INLINE */
+
+
+GLIB_DEPRECATED
+GString *g_string_down (GString *string);
+GLIB_DEPRECATED
+GString *g_string_up (GString *string);
+
+#define g_string_sprintf g_string_printf GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_string_printf)
+#define g_string_sprintfa g_string_append_printf GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_string_append_printf)
+
+G_END_DECLS
+
+#endif /* __G_STRING_H__ */
diff --git a/include/glib/glib/gstringchunk.h b/include/glib/glib/gstringchunk.h
new file mode 100644
index 0000000000..8d445e349c
--- /dev/null
+++ b/include/glib/glib/gstringchunk.h
@@ -0,0 +1,57 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_STRINGCHUNK_H__
+#define __G_STRINGCHUNK_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GStringChunk GStringChunk;
+
+GLIB_AVAILABLE_IN_ALL
+GStringChunk* g_string_chunk_new (gsize size);
+GLIB_AVAILABLE_IN_ALL
+void g_string_chunk_free (GStringChunk *chunk);
+GLIB_AVAILABLE_IN_ALL
+void g_string_chunk_clear (GStringChunk *chunk);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_string_chunk_insert (GStringChunk *chunk,
+ const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_string_chunk_insert_len (GStringChunk *chunk,
+ const gchar *string,
+ gssize len);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_string_chunk_insert_const (GStringChunk *chunk,
+ const gchar *string);
+
+G_END_DECLS
+
+#endif /* __G_STRING_H__ */
diff --git a/include/glib/glib/gtestutils.h b/include/glib/glib/gtestutils.h
new file mode 100644
index 0000000000..6c475e5f4f
--- /dev/null
+++ b/include/glib/glib/gtestutils.h
@@ -0,0 +1,605 @@
+/* GLib testing utilities
+ * Copyright (C) 2007 Imendio AB
+ * Authors: Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_TEST_UTILS_H__
+#define __G_TEST_UTILS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gmessages.h>
+#include <glib/gstring.h>
+#include <glib/gerror.h>
+#include <glib/gslist.h>
+#include <string.h>
+
+G_BEGIN_DECLS
+
+typedef struct GTestCase GTestCase;
+typedef struct GTestSuite GTestSuite;
+typedef void (*GTestFunc) (void);
+typedef void (*GTestDataFunc) (gconstpointer user_data);
+typedef void (*GTestFixtureFunc) (gpointer fixture,
+ gconstpointer user_data);
+
+/* assertion API */
+#define g_assert_cmpstr(s1, cmp, s2) G_STMT_START { \
+ const char *__s1 = (s1), *__s2 = (s2); \
+ if (g_strcmp0 (__s1, __s2) cmp 0) ; else \
+ g_assertion_message_cmpstr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #s1 " " #cmp " " #s2, __s1, #cmp, __s2); \
+ } G_STMT_END
+#define g_assert_cmpint(n1, cmp, n2) G_STMT_START { \
+ gint64 __n1 = (n1), __n2 = (n2); \
+ if (__n1 cmp __n2) ; else \
+ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'i'); \
+ } G_STMT_END
+#define g_assert_cmpuint(n1, cmp, n2) G_STMT_START { \
+ guint64 __n1 = (n1), __n2 = (n2); \
+ if (__n1 cmp __n2) ; else \
+ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'i'); \
+ } G_STMT_END
+#define g_assert_cmphex(n1, cmp, n2) G_STMT_START {\
+ guint64 __n1 = (n1), __n2 = (n2); \
+ if (__n1 cmp __n2) ; else \
+ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'x'); \
+ } G_STMT_END
+#define g_assert_cmpfloat(n1,cmp,n2) G_STMT_START { \
+ long double __n1 = (long double) (n1), __n2 = (long double) (n2); \
+ if (__n1 cmp __n2) ; else \
+ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'f'); \
+ } G_STMT_END
+#define g_assert_cmpfloat_with_epsilon(n1,n2,epsilon) \
+ G_STMT_START { \
+ double __n1 = (n1), __n2 = (n2), __epsilon = (epsilon); \
+ if (G_APPROX_VALUE (__n1, __n2, __epsilon)) ; else \
+ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #n1 " == " #n2 " (+/- " #epsilon ")", __n1, "==", __n2, 'f'); \
+ } G_STMT_END
+#define g_assert_cmpmem(m1, l1, m2, l2) G_STMT_START {\
+ gconstpointer __m1 = m1, __m2 = m2; \
+ int __l1 = l1, __l2 = l2; \
+ if (__l1 != __l2) \
+ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #l1 " (len(" #m1 ")) == " #l2 " (len(" #m2 "))", \
+ (long double) __l1, "==", (long double) __l2, 'i'); \
+ else if (__l1 != 0 && __m2 != NULL && memcmp (__m1, __m2, __l1) != 0) \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "assertion failed (" #m1 " == " #m2 ")"); \
+ } G_STMT_END
+#define g_assert_cmpvariant(v1, v2) \
+ G_STMT_START \
+ { \
+ GVariant *__v1 = (v1), *__v2 = (v2); \
+ if (!g_variant_equal (__v1, __v2)) \
+ { \
+ gchar *__s1, *__s2, *__msg; \
+ __s1 = g_variant_print (__v1, TRUE); \
+ __s2 = g_variant_print (__v2, TRUE); \
+ __msg = g_strdup_printf ("assertion failed (" #v1 " == " #v2 "): %s does not equal %s", __s1, __s2); \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, __msg); \
+ g_free (__s1); \
+ g_free (__s2); \
+ g_free (__msg); \
+ } \
+ } \
+ G_STMT_END
+#define g_assert_no_error(err) G_STMT_START { \
+ if (err) \
+ g_assertion_message_error (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #err, err, 0, 0); \
+ } G_STMT_END
+#define g_assert_error(err, dom, c) G_STMT_START { \
+ if (!err || (err)->domain != dom || (err)->code != c) \
+ g_assertion_message_error (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #err, err, dom, c); \
+ } G_STMT_END
+#define g_assert_true(expr) G_STMT_START { \
+ if G_LIKELY (expr) ; else \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should be TRUE"); \
+ } G_STMT_END
+#define g_assert_false(expr) G_STMT_START { \
+ if G_LIKELY (!(expr)) ; else \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should be FALSE"); \
+ } G_STMT_END
+
+/* Use nullptr in C++ to catch misuse of these macros. */
+#if defined(__cplusplus) && __cplusplus >= 201100L
+#define g_assert_null(expr) G_STMT_START { if G_LIKELY ((expr) == nullptr) ; else \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should be nullptr"); \
+ } G_STMT_END
+#define g_assert_nonnull(expr) G_STMT_START { \
+ if G_LIKELY ((expr) != nullptr) ; else \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should not be nullptr"); \
+ } G_STMT_END
+#else /* not C++ */
+#define g_assert_null(expr) G_STMT_START { if G_LIKELY ((expr) == NULL) ; else \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should be NULL"); \
+ } G_STMT_END
+#define g_assert_nonnull(expr) G_STMT_START { \
+ if G_LIKELY ((expr) != NULL) ; else \
+ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should not be NULL"); \
+ } G_STMT_END
+#endif
+
+#ifdef G_DISABLE_ASSERT
+/* https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005funreachable
+ * GCC 5 is not a strict lower bound for versions of GCC which provide __builtin_unreachable(). */
+#if __GNUC__ >= 5 || g_macro__has_builtin(__builtin_unreachable)
+#define g_assert_not_reached() G_STMT_START { (void) 0; __builtin_unreachable (); } G_STMT_END
+#else /* if __builtin_unreachable() is not supported: */
+#define g_assert_not_reached() G_STMT_START { (void) 0; } G_STMT_END
+#endif
+
+#define g_assert(expr) G_STMT_START { (void) 0; } G_STMT_END
+#else /* !G_DISABLE_ASSERT */
+#define g_assert_not_reached() G_STMT_START { g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } G_STMT_END
+#define g_assert(expr) G_STMT_START { \
+ if G_LIKELY (expr) ; else \
+ g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #expr); \
+ } G_STMT_END
+#endif /* !G_DISABLE_ASSERT */
+
+GLIB_AVAILABLE_IN_ALL
+int g_strcmp0 (const char *str1,
+ const char *str2);
+
+/* report performance results */
+GLIB_AVAILABLE_IN_ALL
+void g_test_minimized_result (double minimized_quantity,
+ const char *format,
+ ...) G_GNUC_PRINTF (2, 3);
+GLIB_AVAILABLE_IN_ALL
+void g_test_maximized_result (double maximized_quantity,
+ const char *format,
+ ...) G_GNUC_PRINTF (2, 3);
+
+/* initialize testing framework */
+GLIB_AVAILABLE_IN_ALL
+void g_test_init (int *argc,
+ char ***argv,
+ ...) G_GNUC_NULL_TERMINATED;
+
+/**
+ * G_TEST_OPTION_ISOLATE_DIRS:
+ *
+ * Creates a unique temporary directory for each unit test and uses
+ * g_set_user_dirs() to set XDG directories to point into subdirectories of it
+ * for the duration of the unit test. The directory tree is cleaned up after the
+ * test finishes successfully. Note that this doesn’t take effect until
+ * g_test_run() is called, so calls to (for example) g_get_user_home_dir() will
+ * return the system-wide value when made in a test program’s main() function.
+ *
+ * The following functions will return subdirectories of the temporary directory
+ * when this option is used. The specific subdirectory paths in use are not
+ * guaranteed to be stable API — always use a getter function to retrieve them.
+ *
+ * - g_get_home_dir()
+ * - g_get_user_cache_dir()
+ * - g_get_system_config_dirs()
+ * - g_get_user_config_dir()
+ * - g_get_system_data_dirs()
+ * - g_get_user_data_dir()
+ * - g_get_user_runtime_dir()
+ *
+ * The subdirectories may not be created by the test harness; as with normal
+ * calls to functions like g_get_user_cache_dir(), the caller must be prepared
+ * to create the directory if it doesn’t exist.
+ *
+ * Since: 2.60
+ */
+#define G_TEST_OPTION_ISOLATE_DIRS "isolate_dirs"
+
+/* While we discourage its use, g_assert() is often used in unit tests
+ * (especially in legacy code). g_assert_*() should really be used instead.
+ * g_assert() can be disabled at client program compile time, which can render
+ * tests useless. Highlight that to the user. */
+#ifdef G_DISABLE_ASSERT
+#if defined(G_HAVE_ISO_VARARGS)
+#define g_test_init(argc, argv, ...) \
+ G_STMT_START { \
+ g_printerr ("Tests were compiled with G_DISABLE_ASSERT and are likely no-ops. Aborting.\n"); \
+ exit (1); \
+ } G_STMT_END
+#elif defined(G_HAVE_GNUC_VARARGS)
+#define g_test_init(argc, argv...) \
+ G_STMT_START { \
+ g_printerr ("Tests were compiled with G_DISABLE_ASSERT and are likely no-ops. Aborting.\n"); \
+ exit (1); \
+ } G_STMT_END
+#else /* no varargs */
+ /* do nothing */
+#endif /* varargs support */
+#endif /* G_DISABLE_ASSERT */
+
+/* query testing framework config */
+#define g_test_initialized() (g_test_config_vars->test_initialized)
+#define g_test_quick() (g_test_config_vars->test_quick)
+#define g_test_slow() (!g_test_config_vars->test_quick)
+#define g_test_thorough() (!g_test_config_vars->test_quick)
+#define g_test_perf() (g_test_config_vars->test_perf)
+#define g_test_verbose() (g_test_config_vars->test_verbose)
+#define g_test_quiet() (g_test_config_vars->test_quiet)
+#define g_test_undefined() (g_test_config_vars->test_undefined)
+GLIB_AVAILABLE_IN_2_38
+gboolean g_test_subprocess (void);
+
+/* run all tests under toplevel suite (path: /) */
+GLIB_AVAILABLE_IN_ALL
+int g_test_run (void);
+/* hook up a test functions under test path */
+GLIB_AVAILABLE_IN_ALL
+void g_test_add_func (const char *testpath,
+ GTestFunc test_func);
+
+GLIB_AVAILABLE_IN_ALL
+void g_test_add_data_func (const char *testpath,
+ gconstpointer test_data,
+ GTestDataFunc test_func);
+
+GLIB_AVAILABLE_IN_2_34
+void g_test_add_data_func_full (const char *testpath,
+ gpointer test_data,
+ GTestDataFunc test_func,
+ GDestroyNotify data_free_func);
+
+/* tell about failure */
+GLIB_AVAILABLE_IN_2_30
+void g_test_fail (void);
+GLIB_AVAILABLE_IN_2_38
+void g_test_incomplete (const gchar *msg);
+GLIB_AVAILABLE_IN_2_38
+void g_test_skip (const gchar *msg);
+GLIB_AVAILABLE_IN_2_38
+gboolean g_test_failed (void);
+GLIB_AVAILABLE_IN_2_38
+void g_test_set_nonfatal_assertions (void);
+
+/**
+ * g_test_add:
+ * @testpath: The test path for a new test case.
+ * @Fixture: The type of a fixture data structure.
+ * @tdata: Data argument for the test functions.
+ * @fsetup: The function to set up the fixture data.
+ * @ftest: The actual test function.
+ * @fteardown: The function to tear down the fixture data.
+ *
+ * Hook up a new test case at @testpath, similar to g_test_add_func().
+ * A fixture data structure with setup and teardown functions may be provided,
+ * similar to g_test_create_case().
+ *
+ * g_test_add() is implemented as a macro, so that the fsetup(), ftest() and
+ * fteardown() callbacks can expect a @Fixture pointer as their first argument
+ * in a type safe manner. They otherwise have type #GTestFixtureFunc.
+ *
+ * Since: 2.16
+ */
+#define g_test_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
+ G_STMT_START { \
+ void (*add_vtable) (const char*, \
+ gsize, \
+ gconstpointer, \
+ void (*) (Fixture*, gconstpointer), \
+ void (*) (Fixture*, gconstpointer), \
+ void (*) (Fixture*, gconstpointer)) = (void (*) (const gchar *, gsize, gconstpointer, void (*) (Fixture*, gconstpointer), void (*) (Fixture*, gconstpointer), void (*) (Fixture*, gconstpointer))) g_test_add_vtable; \
+ add_vtable \
+ (testpath, sizeof (Fixture), tdata, fsetup, ftest, fteardown); \
+ } G_STMT_END
+
+/* add test messages to the test report */
+GLIB_AVAILABLE_IN_ALL
+void g_test_message (const char *format,
+ ...) G_GNUC_PRINTF (1, 2);
+GLIB_AVAILABLE_IN_ALL
+void g_test_bug_base (const char *uri_pattern);
+GLIB_AVAILABLE_IN_ALL
+void g_test_bug (const char *bug_uri_snippet);
+GLIB_AVAILABLE_IN_2_62
+void g_test_summary (const char *summary);
+/* measure test timings */
+GLIB_AVAILABLE_IN_ALL
+void g_test_timer_start (void);
+GLIB_AVAILABLE_IN_ALL
+double g_test_timer_elapsed (void); /* elapsed seconds */
+GLIB_AVAILABLE_IN_ALL
+double g_test_timer_last (void); /* repeat last elapsed() result */
+
+/* automatically g_free or g_object_unref upon teardown */
+GLIB_AVAILABLE_IN_ALL
+void g_test_queue_free (gpointer gfree_pointer);
+GLIB_AVAILABLE_IN_ALL
+void g_test_queue_destroy (GDestroyNotify destroy_func,
+ gpointer destroy_data);
+#define g_test_queue_unref(gobject) g_test_queue_destroy (g_object_unref, gobject)
+
+/**
+ * GTestTrapFlags:
+ * @G_TEST_TRAP_SILENCE_STDOUT: Redirect stdout of the test child to
+ * `/dev/null` so it cannot be observed on the console during test
+ * runs. The actual output is still captured though to allow later
+ * tests with g_test_trap_assert_stdout().
+ * @G_TEST_TRAP_SILENCE_STDERR: Redirect stderr of the test child to
+ * `/dev/null` so it cannot be observed on the console during test
+ * runs. The actual output is still captured though to allow later
+ * tests with g_test_trap_assert_stderr().
+ * @G_TEST_TRAP_INHERIT_STDIN: If this flag is given, stdin of the
+ * child process is shared with stdin of its parent process.
+ * It is redirected to `/dev/null` otherwise.
+ *
+ * Test traps are guards around forked tests.
+ * These flags determine what traps to set.
+ *
+ * Deprecated: 2.38: #GTestTrapFlags is used only with g_test_trap_fork(),
+ * which is deprecated. g_test_trap_subprocess() uses
+ * #GTestSubprocessFlags.
+ */
+typedef enum {
+ G_TEST_TRAP_SILENCE_STDOUT = 1 << 7,
+ G_TEST_TRAP_SILENCE_STDERR = 1 << 8,
+ G_TEST_TRAP_INHERIT_STDIN = 1 << 9
+} GTestTrapFlags GLIB_DEPRECATED_TYPE_IN_2_38_FOR(GTestSubprocessFlags);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+GLIB_DEPRECATED_IN_2_38_FOR (g_test_trap_subprocess)
+gboolean g_test_trap_fork (guint64 usec_timeout,
+ GTestTrapFlags test_trap_flags);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+typedef enum {
+ G_TEST_SUBPROCESS_INHERIT_STDIN = 1 << 0,
+ G_TEST_SUBPROCESS_INHERIT_STDOUT = 1 << 1,
+ G_TEST_SUBPROCESS_INHERIT_STDERR = 1 << 2
+} GTestSubprocessFlags;
+
+GLIB_AVAILABLE_IN_2_38
+void g_test_trap_subprocess (const char *test_path,
+ guint64 usec_timeout,
+ GTestSubprocessFlags test_flags);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_test_trap_has_passed (void);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_test_trap_reached_timeout (void);
+#define g_test_trap_assert_passed() g_test_trap_assertions (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, 0, 0)
+#define g_test_trap_assert_failed() g_test_trap_assertions (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, 1, 0)
+#define g_test_trap_assert_stdout(soutpattern) g_test_trap_assertions (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, 2, soutpattern)
+#define g_test_trap_assert_stdout_unmatched(soutpattern) g_test_trap_assertions (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, 3, soutpattern)
+#define g_test_trap_assert_stderr(serrpattern) g_test_trap_assertions (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, 4, serrpattern)
+#define g_test_trap_assert_stderr_unmatched(serrpattern) g_test_trap_assertions (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, 5, serrpattern)
+
+/* provide seed-able random numbers for tests */
+#define g_test_rand_bit() (0 != (g_test_rand_int() & (1 << 15)))
+GLIB_AVAILABLE_IN_ALL
+gint32 g_test_rand_int (void);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_test_rand_int_range (gint32 begin,
+ gint32 end);
+GLIB_AVAILABLE_IN_ALL
+double g_test_rand_double (void);
+GLIB_AVAILABLE_IN_ALL
+double g_test_rand_double_range (double range_start,
+ double range_end);
+
+/*
+ * semi-internal API: non-documented symbols with stable ABI. You
+ * should use the non-internal helper macros instead. However, for
+ * compatibility reason, you may use this semi-internal API.
+ */
+GLIB_AVAILABLE_IN_ALL
+GTestCase* g_test_create_case (const char *test_name,
+ gsize data_size,
+ gconstpointer test_data,
+ GTestFixtureFunc data_setup,
+ GTestFixtureFunc data_test,
+ GTestFixtureFunc data_teardown);
+GLIB_AVAILABLE_IN_ALL
+GTestSuite* g_test_create_suite (const char *suite_name);
+GLIB_AVAILABLE_IN_ALL
+GTestSuite* g_test_get_root (void);
+GLIB_AVAILABLE_IN_ALL
+void g_test_suite_add (GTestSuite *suite,
+ GTestCase *test_case);
+GLIB_AVAILABLE_IN_ALL
+void g_test_suite_add_suite (GTestSuite *suite,
+ GTestSuite *nestedsuite);
+GLIB_AVAILABLE_IN_ALL
+int g_test_run_suite (GTestSuite *suite);
+
+GLIB_AVAILABLE_IN_ALL
+void g_test_trap_assertions (const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ guint64 assertion_flags, /* 0-pass, 1-fail, 2-outpattern, 4-errpattern */
+ const char *pattern);
+GLIB_AVAILABLE_IN_ALL
+void g_assertion_message (const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *message);
+GLIB_AVAILABLE_IN_ALL
+void g_assertion_message_expr (const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *expr) G_GNUC_NORETURN;
+GLIB_AVAILABLE_IN_ALL
+void g_assertion_message_cmpstr (const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *expr,
+ const char *arg1,
+ const char *cmp,
+ const char *arg2);
+GLIB_AVAILABLE_IN_ALL
+void g_assertion_message_cmpnum (const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *expr,
+ long double arg1,
+ const char *cmp,
+ long double arg2,
+ char numtype);
+GLIB_AVAILABLE_IN_ALL
+void g_assertion_message_error (const char *domain,
+ const char *file,
+ int line,
+ const char *func,
+ const char *expr,
+ const GError *error,
+ GQuark error_domain,
+ int error_code);
+GLIB_AVAILABLE_IN_ALL
+void g_test_add_vtable (const char *testpath,
+ gsize data_size,
+ gconstpointer test_data,
+ GTestFixtureFunc data_setup,
+ GTestFixtureFunc data_test,
+ GTestFixtureFunc data_teardown);
+typedef struct {
+ gboolean test_initialized;
+ gboolean test_quick; /* disable thorough tests */
+ gboolean test_perf; /* run performance tests */
+ gboolean test_verbose; /* extra info */
+ gboolean test_quiet; /* reduce output */
+ gboolean test_undefined; /* run tests that are meant to assert */
+} GTestConfig;
+GLIB_VAR const GTestConfig * const g_test_config_vars;
+
+/* internal logging API */
+typedef enum {
+ G_TEST_RUN_SUCCESS,
+ G_TEST_RUN_SKIPPED,
+ G_TEST_RUN_FAILURE,
+ G_TEST_RUN_INCOMPLETE
+} GTestResult;
+
+typedef enum {
+ G_TEST_LOG_NONE,
+ G_TEST_LOG_ERROR, /* s:msg */
+ G_TEST_LOG_START_BINARY, /* s:binaryname s:seed */
+ G_TEST_LOG_LIST_CASE, /* s:testpath */
+ G_TEST_LOG_SKIP_CASE, /* s:testpath */
+ G_TEST_LOG_START_CASE, /* s:testpath */
+ G_TEST_LOG_STOP_CASE, /* d:status d:nforks d:elapsed */
+ G_TEST_LOG_MIN_RESULT, /* s:blurb d:result */
+ G_TEST_LOG_MAX_RESULT, /* s:blurb d:result */
+ G_TEST_LOG_MESSAGE, /* s:blurb */
+ G_TEST_LOG_START_SUITE,
+ G_TEST_LOG_STOP_SUITE
+} GTestLogType;
+
+typedef struct {
+ GTestLogType log_type;
+ guint n_strings;
+ gchar **strings; /* NULL terminated */
+ guint n_nums;
+ long double *nums;
+} GTestLogMsg;
+typedef struct {
+ /*< private >*/
+ GString *data;
+ GSList *msgs;
+} GTestLogBuffer;
+
+GLIB_AVAILABLE_IN_ALL
+const char* g_test_log_type_name (GTestLogType log_type);
+GLIB_AVAILABLE_IN_ALL
+GTestLogBuffer* g_test_log_buffer_new (void);
+GLIB_AVAILABLE_IN_ALL
+void g_test_log_buffer_free (GTestLogBuffer *tbuffer);
+GLIB_AVAILABLE_IN_ALL
+void g_test_log_buffer_push (GTestLogBuffer *tbuffer,
+ guint n_bytes,
+ const guint8 *bytes);
+GLIB_AVAILABLE_IN_ALL
+GTestLogMsg* g_test_log_buffer_pop (GTestLogBuffer *tbuffer);
+GLIB_AVAILABLE_IN_ALL
+void g_test_log_msg_free (GTestLogMsg *tmsg);
+
+/**
+ * GTestLogFatalFunc:
+ * @log_domain: the log domain of the message
+ * @log_level: the log level of the message (including the fatal and recursion flags)
+ * @message: the message to process
+ * @user_data: user data, set in g_test_log_set_fatal_handler()
+ *
+ * Specifies the prototype of fatal log handler functions.
+ *
+ * Returns: %TRUE if the program should abort, %FALSE otherwise
+ *
+ * Since: 2.22
+ */
+typedef gboolean (*GTestLogFatalFunc) (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+void
+g_test_log_set_fatal_handler (GTestLogFatalFunc log_func,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_2_34
+void g_test_expect_message (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *pattern);
+GLIB_AVAILABLE_IN_2_34
+void g_test_assert_expected_messages_internal (const char *domain,
+ const char *file,
+ int line,
+ const char *func);
+
+typedef enum
+{
+ G_TEST_DIST,
+ G_TEST_BUILT
+} GTestFileType;
+
+GLIB_AVAILABLE_IN_2_38
+gchar * g_test_build_filename (GTestFileType file_type,
+ const gchar *first_path,
+ ...) G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_2_38
+const gchar *g_test_get_dir (GTestFileType file_type);
+GLIB_AVAILABLE_IN_2_38
+const gchar *g_test_get_filename (GTestFileType file_type,
+ const gchar *first_path,
+ ...) G_GNUC_NULL_TERMINATED;
+
+#define g_test_assert_expected_messages() g_test_assert_expected_messages_internal (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC)
+
+G_END_DECLS
+
+#endif /* __G_TEST_UTILS_H__ */
diff --git a/include/glib/glib/gthread.h b/include/glib/glib/gthread.h
new file mode 100644
index 0000000000..c8761c5e6c
--- /dev/null
+++ b/include/glib/glib/gthread.h
@@ -0,0 +1,556 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_THREAD_H__
+#define __G_THREAD_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gatomic.h>
+#include <glib/gerror.h>
+#include <glib/gutils.h>
+
+G_BEGIN_DECLS
+
+#define G_THREAD_ERROR g_thread_error_quark ()
+GLIB_AVAILABLE_IN_ALL
+GQuark g_thread_error_quark (void);
+
+typedef enum
+{
+ G_THREAD_ERROR_AGAIN /* Resource temporarily unavailable */
+} GThreadError;
+
+typedef gpointer (*GThreadFunc) (gpointer data);
+
+typedef struct _GThread GThread;
+
+typedef union _GMutex GMutex;
+typedef struct _GRecMutex GRecMutex;
+typedef struct _GRWLock GRWLock;
+typedef struct _GCond GCond;
+typedef struct _GPrivate GPrivate;
+typedef struct _GOnce GOnce;
+
+union _GMutex
+{
+ /*< private >*/
+ gpointer p;
+ guint i[2];
+};
+
+struct _GRWLock
+{
+ /*< private >*/
+ gpointer p;
+ guint i[2];
+};
+
+struct _GCond
+{
+ /*< private >*/
+ gpointer p;
+ guint i[2];
+};
+
+struct _GRecMutex
+{
+ /*< private >*/
+ gpointer p;
+ guint i[2];
+};
+
+#define G_PRIVATE_INIT(notify) { NULL, (notify), { NULL, NULL } }
+struct _GPrivate
+{
+ /*< private >*/
+ gpointer p;
+ GDestroyNotify notify;
+ gpointer future[2];
+};
+
+typedef enum
+{
+ G_ONCE_STATUS_NOTCALLED,
+ G_ONCE_STATUS_PROGRESS,
+ G_ONCE_STATUS_READY
+} GOnceStatus;
+
+#define G_ONCE_INIT { G_ONCE_STATUS_NOTCALLED, NULL }
+struct _GOnce
+{
+ volatile GOnceStatus status;
+ volatile gpointer retval;
+};
+
+#define G_LOCK_NAME(name) g__ ## name ## _lock
+#define G_LOCK_DEFINE_STATIC(name) static G_LOCK_DEFINE (name)
+#define G_LOCK_DEFINE(name) GMutex G_LOCK_NAME (name)
+#define G_LOCK_EXTERN(name) extern GMutex G_LOCK_NAME (name)
+
+#ifdef G_DEBUG_LOCKS
+# define G_LOCK(name) G_STMT_START{ \
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
+ "file %s: line %d (%s): locking: %s ", \
+ __FILE__, __LINE__, G_STRFUNC, \
+ #name); \
+ g_mutex_lock (&G_LOCK_NAME (name)); \
+ }G_STMT_END
+# define G_UNLOCK(name) G_STMT_START{ \
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
+ "file %s: line %d (%s): unlocking: %s ", \
+ __FILE__, __LINE__, G_STRFUNC, \
+ #name); \
+ g_mutex_unlock (&G_LOCK_NAME (name)); \
+ }G_STMT_END
+# define G_TRYLOCK(name) \
+ (g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
+ "file %s: line %d (%s): try locking: %s ", \
+ __FILE__, __LINE__, G_STRFUNC, \
+ #name), g_mutex_trylock (&G_LOCK_NAME (name)))
+#else /* !G_DEBUG_LOCKS */
+# define G_LOCK(name) g_mutex_lock (&G_LOCK_NAME (name))
+# define G_UNLOCK(name) g_mutex_unlock (&G_LOCK_NAME (name))
+# define G_TRYLOCK(name) g_mutex_trylock (&G_LOCK_NAME (name))
+#endif /* !G_DEBUG_LOCKS */
+
+GLIB_AVAILABLE_IN_2_32
+GThread * g_thread_ref (GThread *thread);
+GLIB_AVAILABLE_IN_2_32
+void g_thread_unref (GThread *thread);
+GLIB_AVAILABLE_IN_2_32
+GThread * g_thread_new (const gchar *name,
+ GThreadFunc func,
+ gpointer data);
+GLIB_AVAILABLE_IN_2_32
+GThread * g_thread_try_new (const gchar *name,
+ GThreadFunc func,
+ gpointer data,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GThread * g_thread_self (void);
+GLIB_AVAILABLE_IN_ALL
+void g_thread_exit (gpointer retval);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_thread_join (GThread *thread);
+GLIB_AVAILABLE_IN_ALL
+void g_thread_yield (void);
+
+
+GLIB_AVAILABLE_IN_2_32
+void g_mutex_init (GMutex *mutex);
+GLIB_AVAILABLE_IN_2_32
+void g_mutex_clear (GMutex *mutex);
+GLIB_AVAILABLE_IN_ALL
+void g_mutex_lock (GMutex *mutex);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_mutex_trylock (GMutex *mutex);
+GLIB_AVAILABLE_IN_ALL
+void g_mutex_unlock (GMutex *mutex);
+
+GLIB_AVAILABLE_IN_2_32
+void g_rw_lock_init (GRWLock *rw_lock);
+GLIB_AVAILABLE_IN_2_32
+void g_rw_lock_clear (GRWLock *rw_lock);
+GLIB_AVAILABLE_IN_2_32
+void g_rw_lock_writer_lock (GRWLock *rw_lock);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_rw_lock_writer_trylock (GRWLock *rw_lock);
+GLIB_AVAILABLE_IN_2_32
+void g_rw_lock_writer_unlock (GRWLock *rw_lock);
+GLIB_AVAILABLE_IN_2_32
+void g_rw_lock_reader_lock (GRWLock *rw_lock);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_rw_lock_reader_trylock (GRWLock *rw_lock);
+GLIB_AVAILABLE_IN_2_32
+void g_rw_lock_reader_unlock (GRWLock *rw_lock);
+
+GLIB_AVAILABLE_IN_2_32
+void g_rec_mutex_init (GRecMutex *rec_mutex);
+GLIB_AVAILABLE_IN_2_32
+void g_rec_mutex_clear (GRecMutex *rec_mutex);
+GLIB_AVAILABLE_IN_2_32
+void g_rec_mutex_lock (GRecMutex *rec_mutex);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_rec_mutex_trylock (GRecMutex *rec_mutex);
+GLIB_AVAILABLE_IN_2_32
+void g_rec_mutex_unlock (GRecMutex *rec_mutex);
+
+GLIB_AVAILABLE_IN_2_32
+void g_cond_init (GCond *cond);
+GLIB_AVAILABLE_IN_2_32
+void g_cond_clear (GCond *cond);
+GLIB_AVAILABLE_IN_ALL
+void g_cond_wait (GCond *cond,
+ GMutex *mutex);
+GLIB_AVAILABLE_IN_ALL
+void g_cond_signal (GCond *cond);
+GLIB_AVAILABLE_IN_ALL
+void g_cond_broadcast (GCond *cond);
+GLIB_AVAILABLE_IN_2_32
+gboolean g_cond_wait_until (GCond *cond,
+ GMutex *mutex,
+ gint64 end_time);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_private_get (GPrivate *key);
+GLIB_AVAILABLE_IN_ALL
+void g_private_set (GPrivate *key,
+ gpointer value);
+GLIB_AVAILABLE_IN_2_32
+void g_private_replace (GPrivate *key,
+ gpointer value);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_once_impl (GOnce *once,
+ GThreadFunc func,
+ gpointer arg);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_once_init_enter (volatile void *location);
+GLIB_AVAILABLE_IN_ALL
+void g_once_init_leave (volatile void *location,
+ gsize result);
+
+#ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
+# define g_once(once, func, arg) g_once_impl ((once), (func), (arg))
+#else /* !G_ATOMIC_OP_MEMORY_BARRIER_NEEDED*/
+# define g_once(once, func, arg) \
+ (((once)->status == G_ONCE_STATUS_READY) ? \
+ (once)->retval : \
+ g_once_impl ((once), (func), (arg)))
+#endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */
+
+#ifdef __GNUC__
+# define g_once_init_enter(location) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(location) == sizeof (gpointer)); \
+ (void) (0 ? (gpointer) *(location) : 0); \
+ (!g_atomic_pointer_get (location) && \
+ g_once_init_enter (location)); \
+ }))
+# define g_once_init_leave(location, result) \
+ (G_GNUC_EXTENSION ({ \
+ G_STATIC_ASSERT (sizeof *(location) == sizeof (gpointer)); \
+ (void) (0 ? *(location) = (result) : 0); \
+ g_once_init_leave ((location), (gsize) (result)); \
+ }))
+#else
+# define g_once_init_enter(location) \
+ (g_once_init_enter((location)))
+# define g_once_init_leave(location, result) \
+ (g_once_init_leave((location), (gsize) (result)))
+#endif
+
+GLIB_AVAILABLE_IN_2_36
+guint g_get_num_processors (void);
+
+/**
+ * GMutexLocker:
+ *
+ * Opaque type. See g_mutex_locker_new() for details.
+ * Since: 2.44
+ */
+typedef void GMutexLocker;
+
+/**
+ * g_mutex_locker_new:
+ * @mutex: a mutex to lock
+ *
+ * Lock @mutex and return a new #GMutexLocker. Unlock with
+ * g_mutex_locker_free(). Using g_mutex_unlock() on @mutex
+ * while a #GMutexLocker exists can lead to undefined behaviour.
+ *
+ * This is intended to be used with g_autoptr(). Note that g_autoptr()
+ * is only available when using GCC or clang, so the following example
+ * will only work with those compilers:
+ * |[
+ * typedef struct
+ * {
+ * ...
+ * GMutex mutex;
+ * ...
+ * } MyObject;
+ *
+ * static void
+ * my_object_do_stuff (MyObject *self)
+ * {
+ * g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&self->mutex);
+ *
+ * // Code with mutex locked here
+ *
+ * if (cond)
+ * // No need to unlock
+ * return;
+ *
+ * // Optionally early unlock
+ * g_clear_pointer (&locker, g_mutex_locker_free);
+ *
+ * // Code with mutex unlocked here
+ * }
+ * ]|
+ *
+ * Returns: a #GMutexLocker
+ * Since: 2.44
+ */
+static inline GMutexLocker *
+g_mutex_locker_new (GMutex *mutex)
+{
+ g_mutex_lock (mutex);
+ return (GMutexLocker *) mutex;
+}
+
+/**
+ * g_mutex_locker_free:
+ * @locker: a GMutexLocker
+ *
+ * Unlock @locker's mutex. See g_mutex_locker_new() for details.
+ *
+ * Since: 2.44
+ */
+static inline void
+g_mutex_locker_free (GMutexLocker *locker)
+{
+ g_mutex_unlock ((GMutex *) locker);
+}
+
+/**
+ * GRecMutexLocker:
+ *
+ * Opaque type. See g_rec_mutex_locker_new() for details.
+ * Since: 2.60
+ */
+typedef void GRecMutexLocker;
+
+/**
+ * g_rec_mutex_locker_new:
+ * @rec_mutex: a recursive mutex to lock
+ *
+ * Lock @rec_mutex and return a new #GRecMutexLocker. Unlock with
+ * g_rec_mutex_locker_free(). Using g_rec_mutex_unlock() on @rec_mutex
+ * while a #GRecMutexLocker exists can lead to undefined behaviour.
+ *
+ * This is intended to be used with g_autoptr(). Note that g_autoptr()
+ * is only available when using GCC or clang, so the following example
+ * will only work with those compilers:
+ * |[
+ * typedef struct
+ * {
+ * ...
+ * GRecMutex rec_mutex;
+ * ...
+ * } MyObject;
+ *
+ * static void
+ * my_object_do_stuff (MyObject *self)
+ * {
+ * g_autoptr(GRecMutexLocker) locker = g_rec_mutex_locker_new (&self->rec_mutex);
+ *
+ * // Code with rec_mutex locked here
+ *
+ * if (cond)
+ * // No need to unlock
+ * return;
+ *
+ * // Optionally early unlock
+ * g_clear_pointer (&locker, g_rec_mutex_locker_free);
+ *
+ * // Code with rec_mutex unlocked here
+ * }
+ * ]|
+ *
+ * Returns: a #GRecMutexLocker
+ * Since: 2.60
+ */
+static inline GRecMutexLocker *
+g_rec_mutex_locker_new (GRecMutex *rec_mutex)
+{
+ g_rec_mutex_lock (rec_mutex);
+ return (GRecMutexLocker *) rec_mutex;
+}
+
+/**
+ * g_rec_mutex_locker_free:
+ * @locker: a GRecMutexLocker
+ *
+ * Unlock @locker's recursive mutex. See g_rec_mutex_locker_new() for details.
+ *
+ * Since: 2.60
+ */
+static inline void
+g_rec_mutex_locker_free (GRecMutexLocker *locker)
+{
+ g_rec_mutex_unlock ((GRecMutex *) locker);
+}
+
+/**
+ * GRWLockWriterLocker:
+ *
+ * Opaque type. See g_rw_lock_writer_locker_new() for details.
+ * Since: 2.62
+ */
+typedef void GRWLockWriterLocker;
+
+/**
+ * g_rw_lock_writer_locker_new:
+ * @rw_lock: a #GRWLock
+ *
+ * Obtain a write lock on @rw_lock and return a new #GRWLockWriterLocker.
+ * Unlock with g_rw_lock_writer_locker_free(). Using g_rw_lock_writer_unlock()
+ * on @rw_lock while a #GRWLockWriterLocker exists can lead to undefined
+ * behaviour.
+ *
+ * This is intended to be used with g_autoptr(). Note that g_autoptr()
+ * is only available when using GCC or clang, so the following example
+ * will only work with those compilers:
+ * |[
+ * typedef struct
+ * {
+ * ...
+ * GRWLock rw_lock;
+ * GPtrArray *array;
+ * ...
+ * } MyObject;
+ *
+ * static gchar *
+ * my_object_get_data (MyObject *self, guint index)
+ * {
+ * g_autoptr(GRWLockReaderLocker) locker = g_rw_lock_reader_locker_new (&self->rw_lock);
+ *
+ * // Code with a read lock obtained on rw_lock here
+ *
+ * if (self->array == NULL)
+ * // No need to unlock
+ * return NULL;
+ *
+ * if (index < self->array->len)
+ * // No need to unlock
+ * return g_ptr_array_index (self->array, index);
+ *
+ * // Optionally early unlock
+ * g_clear_pointer (&locker, g_rw_lock_reader_locker_free);
+ *
+ * // Code with rw_lock unlocked here
+ * return NULL;
+ * }
+ *
+ * static void
+ * my_object_set_data (MyObject *self, guint index, gpointer data)
+ * {
+ * g_autoptr(GRWLockWriterLocker) locker = g_rw_lock_writer_locker_new (&self->rw_lock);
+ *
+ * // Code with a write lock obtained on rw_lock here
+ *
+ * if (self->array == NULL)
+ * self->array = g_ptr_array_new ();
+ *
+ * if (cond)
+ * // No need to unlock
+ * return;
+ *
+ * if (index >= self->array->len)
+ * g_ptr_array_set_size (self->array, index+1);
+ * g_ptr_array_index (self->array, index) = data;
+ *
+ * // Optionally early unlock
+ * g_clear_pointer (&locker, g_rw_lock_writer_locker_free);
+ *
+ * // Code with rw_lock unlocked here
+ * }
+ * ]|
+ *
+ * Returns: a #GRWLockWriterLocker
+ * Since: 2.62
+ */
+static inline GRWLockWriterLocker *
+g_rw_lock_writer_locker_new (GRWLock *rw_lock)
+{
+ g_rw_lock_writer_lock (rw_lock);
+ return (GRWLockWriterLocker *) rw_lock;
+}
+
+/**
+ * g_rw_lock_writer_locker_free:
+ * @locker: a GRWLockWriterLocker
+ *
+ * Release a write lock on @locker's read-write lock. See
+ * g_rw_lock_writer_locker_new() for details.
+ *
+ * Since: 2.62
+ */
+static inline void
+g_rw_lock_writer_locker_free (GRWLockWriterLocker *locker)
+{
+ g_rw_lock_writer_unlock ((GRWLock *) locker);
+}
+
+/**
+ * GRWLockReaderLocker:
+ *
+ * Opaque type. See g_rw_lock_reader_locker_new() for details.
+ * Since: 2.62
+ */
+typedef void GRWLockReaderLocker;
+
+/**
+ * g_rw_lock_reader_locker_new:
+ * @rw_lock: a #GRWLock
+ *
+ * Obtain a read lock on @rw_lock and return a new #GRWLockReaderLocker.
+ * Unlock with g_rw_lock_reader_locker_free(). Using g_rw_lock_reader_unlock()
+ * on @rw_lock while a #GRWLockReaderLocker exists can lead to undefined
+ * behaviour.
+ *
+ * This is intended to be used with g_autoptr(). For a code sample, see
+ * g_rw_lock_writer_locker_new().
+ *
+ * Returns: a #GRWLockReaderLocker
+ * Since: 2.62
+ */
+static inline GRWLockReaderLocker *
+g_rw_lock_reader_locker_new (GRWLock *rw_lock)
+{
+ g_rw_lock_reader_lock (rw_lock);
+ return (GRWLockReaderLocker *) rw_lock;
+}
+
+/**
+ * g_rw_lock_reader_locker_free:
+ * @locker: a GRWLockReaderLocker
+ *
+ * Release a read lock on @locker's read-write lock. See
+ * g_rw_lock_reader_locker_new() for details.
+ *
+ * Since: 2.62
+ */
+static inline void
+g_rw_lock_reader_locker_free (GRWLockReaderLocker *locker)
+{
+ g_rw_lock_reader_unlock ((GRWLock *) locker);
+}
+
+G_END_DECLS
+
+#endif /* __G_THREAD_H__ */
diff --git a/include/glib/glib/gthreadpool.h b/include/glib/glib/gthreadpool.h
new file mode 100644
index 0000000000..11c3d1d164
--- /dev/null
+++ b/include/glib/glib/gthreadpool.h
@@ -0,0 +1,96 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_THREADPOOL_H__
+#define __G_THREADPOOL_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gthread.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GThreadPool GThreadPool;
+
+/* Thread Pools
+ */
+
+struct _GThreadPool
+{
+ GFunc func;
+ gpointer user_data;
+ gboolean exclusive;
+};
+
+GLIB_AVAILABLE_IN_ALL
+GThreadPool * g_thread_pool_new (GFunc func,
+ gpointer user_data,
+ gint max_threads,
+ gboolean exclusive,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+void g_thread_pool_free (GThreadPool *pool,
+ gboolean immediate,
+ gboolean wait_);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_thread_pool_push (GThreadPool *pool,
+ gpointer data,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+guint g_thread_pool_unprocessed (GThreadPool *pool);
+GLIB_AVAILABLE_IN_ALL
+void g_thread_pool_set_sort_function (GThreadPool *pool,
+ GCompareDataFunc func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_46
+gboolean g_thread_pool_move_to_front (GThreadPool *pool,
+ gpointer data);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_thread_pool_set_max_threads (GThreadPool *pool,
+ gint max_threads,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+gint g_thread_pool_get_max_threads (GThreadPool *pool);
+GLIB_AVAILABLE_IN_ALL
+guint g_thread_pool_get_num_threads (GThreadPool *pool);
+
+GLIB_AVAILABLE_IN_ALL
+void g_thread_pool_set_max_unused_threads (gint max_threads);
+GLIB_AVAILABLE_IN_ALL
+gint g_thread_pool_get_max_unused_threads (void);
+GLIB_AVAILABLE_IN_ALL
+guint g_thread_pool_get_num_unused_threads (void);
+GLIB_AVAILABLE_IN_ALL
+void g_thread_pool_stop_unused_threads (void);
+GLIB_AVAILABLE_IN_ALL
+void g_thread_pool_set_max_idle_time (guint interval);
+GLIB_AVAILABLE_IN_ALL
+guint g_thread_pool_get_max_idle_time (void);
+
+G_END_DECLS
+
+#endif /* __G_THREADPOOL_H__ */
diff --git a/include/glib/glib/gtimer.h b/include/glib/glib/gtimer.h
new file mode 100644
index 0000000000..28794d167e
--- /dev/null
+++ b/include/glib/glib/gtimer.h
@@ -0,0 +1,78 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_TIMER_H__
+#define __G_TIMER_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/* Timer
+ */
+
+/* microseconds per second */
+typedef struct _GTimer GTimer;
+
+#define G_USEC_PER_SEC 1000000
+
+GLIB_AVAILABLE_IN_ALL
+GTimer* g_timer_new (void);
+GLIB_AVAILABLE_IN_ALL
+void g_timer_destroy (GTimer *timer);
+GLIB_AVAILABLE_IN_ALL
+void g_timer_start (GTimer *timer);
+GLIB_AVAILABLE_IN_ALL
+void g_timer_stop (GTimer *timer);
+GLIB_AVAILABLE_IN_ALL
+void g_timer_reset (GTimer *timer);
+GLIB_AVAILABLE_IN_ALL
+void g_timer_continue (GTimer *timer);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_timer_elapsed (GTimer *timer,
+ gulong *microseconds);
+GLIB_AVAILABLE_IN_2_62
+gboolean g_timer_is_active (GTimer *timer);
+
+GLIB_AVAILABLE_IN_ALL
+void g_usleep (gulong microseconds);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62
+void g_time_val_add (GTimeVal *time_,
+ glong microseconds);
+GLIB_DEPRECATED_IN_2_62_FOR(g_date_time_new_from_iso8601)
+gboolean g_time_val_from_iso8601 (const gchar *iso_date,
+ GTimeVal *time_);
+GLIB_DEPRECATED_IN_2_62_FOR(g_date_time_format)
+gchar* g_time_val_to_iso8601 (GTimeVal *time_) G_GNUC_MALLOC;
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+G_END_DECLS
+
+#endif /* __G_TIMER_H__ */
diff --git a/include/glib/glib/gtimezone.h b/include/glib/glib/gtimezone.h
new file mode 100644
index 0000000000..4e8b10a715
--- /dev/null
+++ b/include/glib/glib/gtimezone.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright © 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_TIME_ZONE_H__
+#define __G_TIME_ZONE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GTimeZone GTimeZone;
+
+/**
+ * GTimeType:
+ * @G_TIME_TYPE_STANDARD: the time is in local standard time
+ * @G_TIME_TYPE_DAYLIGHT: the time is in local daylight time
+ * @G_TIME_TYPE_UNIVERSAL: the time is in UTC
+ *
+ * Disambiguates a given time in two ways.
+ *
+ * First, specifies if the given time is in universal or local time.
+ *
+ * Second, if the time is in local time, specifies if it is local
+ * standard time or local daylight time. This is important for the case
+ * where the same local time occurs twice (during daylight savings time
+ * transitions, for example).
+ */
+typedef enum
+{
+ G_TIME_TYPE_STANDARD,
+ G_TIME_TYPE_DAYLIGHT,
+ G_TIME_TYPE_UNIVERSAL
+} GTimeType;
+
+GLIB_AVAILABLE_IN_ALL
+GTimeZone * g_time_zone_new (const gchar *identifier);
+GLIB_AVAILABLE_IN_ALL
+GTimeZone * g_time_zone_new_utc (void);
+GLIB_AVAILABLE_IN_ALL
+GTimeZone * g_time_zone_new_local (void);
+GLIB_AVAILABLE_IN_2_58
+GTimeZone * g_time_zone_new_offset (gint32 seconds);
+
+GLIB_AVAILABLE_IN_ALL
+GTimeZone * g_time_zone_ref (GTimeZone *tz);
+GLIB_AVAILABLE_IN_ALL
+void g_time_zone_unref (GTimeZone *tz);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_time_zone_find_interval (GTimeZone *tz,
+ GTimeType type,
+ gint64 time_);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_time_zone_adjust_time (GTimeZone *tz,
+ GTimeType type,
+ gint64 *time_);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_time_zone_get_abbreviation (GTimeZone *tz,
+ gint interval);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_time_zone_get_offset (GTimeZone *tz,
+ gint interval);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_time_zone_is_dst (GTimeZone *tz,
+ gint interval);
+GLIB_AVAILABLE_IN_2_58
+const gchar * g_time_zone_get_identifier (GTimeZone *tz);
+
+G_END_DECLS
+
+#endif /* __G_TIME_ZONE_H__ */
diff --git a/include/glib/glib/gtrashstack.h b/include/glib/glib/gtrashstack.h
new file mode 100644
index 0000000000..0730ec296a
--- /dev/null
+++ b/include/glib/glib/gtrashstack.h
@@ -0,0 +1,58 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_TRASH_STACK_H__
+#define __G_TRASH_STACK_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gutils.h>
+
+G_BEGIN_DECLS
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+typedef struct _GTrashStack GTrashStack GLIB_DEPRECATED_TYPE_IN_2_48;
+struct _GTrashStack
+{
+ GTrashStack *next;
+} GLIB_DEPRECATED_TYPE_IN_2_48;
+
+GLIB_DEPRECATED_IN_2_48
+void g_trash_stack_push (GTrashStack **stack_p,
+ gpointer data_p);
+GLIB_DEPRECATED_IN_2_48
+gpointer g_trash_stack_pop (GTrashStack **stack_p);
+GLIB_DEPRECATED_IN_2_48
+gpointer g_trash_stack_peek (GTrashStack **stack_p);
+GLIB_DEPRECATED_IN_2_48
+guint g_trash_stack_height (GTrashStack **stack_p);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+G_END_DECLS
+
+#endif /* __G_TRASH_STACK_H_ */
diff --git a/include/glib/glib/gtree.h b/include/glib/glib/gtree.h
new file mode 100644
index 0000000000..ceb148d6b1
--- /dev/null
+++ b/include/glib/glib/gtree.h
@@ -0,0 +1,104 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_TREE_H__
+#define __G_TREE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gnode.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GTree GTree;
+
+typedef gboolean (*GTraverseFunc) (gpointer key,
+ gpointer value,
+ gpointer data);
+
+/* Balanced binary trees
+ */
+GLIB_AVAILABLE_IN_ALL
+GTree* g_tree_new (GCompareFunc key_compare_func);
+GLIB_AVAILABLE_IN_ALL
+GTree* g_tree_new_with_data (GCompareDataFunc key_compare_func,
+ gpointer key_compare_data);
+GLIB_AVAILABLE_IN_ALL
+GTree* g_tree_new_full (GCompareDataFunc key_compare_func,
+ gpointer key_compare_data,
+ GDestroyNotify key_destroy_func,
+ GDestroyNotify value_destroy_func);
+GLIB_AVAILABLE_IN_ALL
+GTree* g_tree_ref (GTree *tree);
+GLIB_AVAILABLE_IN_ALL
+void g_tree_unref (GTree *tree);
+GLIB_AVAILABLE_IN_ALL
+void g_tree_destroy (GTree *tree);
+GLIB_AVAILABLE_IN_ALL
+void g_tree_insert (GTree *tree,
+ gpointer key,
+ gpointer value);
+GLIB_AVAILABLE_IN_ALL
+void g_tree_replace (GTree *tree,
+ gpointer key,
+ gpointer value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tree_remove (GTree *tree,
+ gconstpointer key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tree_steal (GTree *tree,
+ gconstpointer key);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_tree_lookup (GTree *tree,
+ gconstpointer key);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_tree_lookup_extended (GTree *tree,
+ gconstpointer lookup_key,
+ gpointer *orig_key,
+ gpointer *value);
+GLIB_AVAILABLE_IN_ALL
+void g_tree_foreach (GTree *tree,
+ GTraverseFunc func,
+ gpointer user_data);
+
+GLIB_DEPRECATED
+void g_tree_traverse (GTree *tree,
+ GTraverseFunc traverse_func,
+ GTraverseType traverse_type,
+ gpointer user_data);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_tree_search (GTree *tree,
+ GCompareFunc search_func,
+ gconstpointer user_data);
+GLIB_AVAILABLE_IN_ALL
+gint g_tree_height (GTree *tree);
+GLIB_AVAILABLE_IN_ALL
+gint g_tree_nnodes (GTree *tree);
+
+G_END_DECLS
+
+#endif /* __G_TREE_H__ */
diff --git a/include/glib/glib/gtypes.h b/include/glib/glib/gtypes.h
new file mode 100644
index 0000000000..111f1ad3ec
--- /dev/null
+++ b/include/glib/glib/gtypes.h
@@ -0,0 +1,585 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_TYPES_H__
+#define __G_TYPES_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glibconfig.h>
+#include <glib/gmacros.h>
+#include <glib/gversionmacros.h>
+#include <time.h>
+
+G_BEGIN_DECLS
+
+/* Provide type definitions for commonly used types.
+ * These are useful because a "gint8" can be adjusted
+ * to be 1 byte (8 bits) on all platforms. Similarly and
+ * more importantly, "gint32" can be adjusted to be
+ * 4 bytes (32 bits) on all platforms.
+ */
+
+typedef char gchar;
+typedef short gshort;
+typedef long glong;
+typedef int gint;
+typedef gint gboolean;
+
+typedef unsigned char guchar;
+typedef unsigned short gushort;
+typedef unsigned long gulong;
+typedef unsigned int guint;
+
+typedef float gfloat;
+typedef double gdouble;
+
+/* Define min and max constants for the fixed size numerical types */
+/**
+ * G_MININT8: (value -128)
+ *
+ * The minimum value which can be held in a #gint8.
+ *
+ * Since: 2.4
+ */
+#define G_MININT8 ((gint8) (-G_MAXINT8 - 1))
+#define G_MAXINT8 ((gint8) 0x7f)
+#define G_MAXUINT8 ((guint8) 0xff)
+
+/**
+ * G_MININT16: (value -32768)
+ *
+ * The minimum value which can be held in a #gint16.
+ *
+ * Since: 2.4
+ */
+#define G_MININT16 ((gint16) (-G_MAXINT16 - 1))
+#define G_MAXINT16 ((gint16) 0x7fff)
+#define G_MAXUINT16 ((guint16) 0xffff)
+
+/**
+ * G_MININT32: (value -2147483648)
+ *
+ * The minimum value which can be held in a #gint32.
+ *
+ * Since: 2.4
+ */
+#define G_MININT32 ((gint32) (-G_MAXINT32 - 1))
+#define G_MAXINT32 ((gint32) 0x7fffffff)
+#define G_MAXUINT32 ((guint32) 0xffffffff)
+
+/**
+ * G_MININT64: (value -9223372036854775808)
+ *
+ * The minimum value which can be held in a #gint64.
+ */
+#define G_MININT64 ((gint64) (-G_MAXINT64 - G_GINT64_CONSTANT(1)))
+#define G_MAXINT64 G_GINT64_CONSTANT(0x7fffffffffffffff)
+#define G_MAXUINT64 G_GUINT64_CONSTANT(0xffffffffffffffff)
+
+typedef void* gpointer;
+typedef const void *gconstpointer;
+
+typedef gint (*GCompareFunc) (gconstpointer a,
+ gconstpointer b);
+typedef gint (*GCompareDataFunc) (gconstpointer a,
+ gconstpointer b,
+ gpointer user_data);
+typedef gboolean (*GEqualFunc) (gconstpointer a,
+ gconstpointer b);
+typedef void (*GDestroyNotify) (gpointer data);
+typedef void (*GFunc) (gpointer data,
+ gpointer user_data);
+typedef guint (*GHashFunc) (gconstpointer key);
+typedef void (*GHFunc) (gpointer key,
+ gpointer value,
+ gpointer user_data);
+
+/**
+ * GCopyFunc:
+ * @src: (not nullable): A pointer to the data which should be copied
+ * @data: Additional data
+ *
+ * A function of this signature is used to copy the node data
+ * when doing a deep-copy of a tree.
+ *
+ * Returns: (not nullable): A pointer to the copy
+ *
+ * Since: 2.4
+ */
+typedef gpointer (*GCopyFunc) (gconstpointer src,
+ gpointer data);
+/**
+ * GFreeFunc:
+ * @data: a data pointer
+ *
+ * Declares a type of function which takes an arbitrary
+ * data pointer argument and has no return value. It is
+ * not currently used in GLib or GTK+.
+ */
+typedef void (*GFreeFunc) (gpointer data);
+
+/**
+ * GTranslateFunc:
+ * @str: the untranslated string
+ * @data: user data specified when installing the function, e.g.
+ * in g_option_group_set_translate_func()
+ *
+ * The type of functions which are used to translate user-visible
+ * strings, for <option>--help</option> output.
+ *
+ * Returns: a translation of the string for the current locale.
+ * The returned string is owned by GLib and must not be freed.
+ */
+typedef const gchar * (*GTranslateFunc) (const gchar *str,
+ gpointer data);
+
+
+/* Define some mathematical constants that aren't available
+ * symbolically in some strict ISO C implementations.
+ *
+ * Note that the large number of digits used in these definitions
+ * doesn't imply that GLib or current computers in general would be
+ * able to handle floating point numbers with an accuracy like this.
+ * It's mostly an exercise in futility and future proofing. For
+ * extended precision floating point support, look somewhere else
+ * than GLib.
+ */
+#define G_E 2.7182818284590452353602874713526624977572470937000
+#define G_LN2 0.69314718055994530941723212145817656807550013436026
+#define G_LN10 2.3025850929940456840179914546843642076011014886288
+#define G_PI 3.1415926535897932384626433832795028841971693993751
+#define G_PI_2 1.5707963267948966192313216916397514420985846996876
+#define G_PI_4 0.78539816339744830961566084581987572104929234984378
+#define G_SQRT2 1.4142135623730950488016887242096980785696718753769
+
+/* Portable endian checks and conversions
+ *
+ * glibconfig.h defines G_BYTE_ORDER which expands to one of
+ * the below macros.
+ */
+#define G_LITTLE_ENDIAN 1234
+#define G_BIG_ENDIAN 4321
+#define G_PDP_ENDIAN 3412 /* unused, need specific PDP check */
+
+
+/* Basic bit swapping functions
+ */
+#define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \
+ (guint16) ((guint16) (val) >> 8) | \
+ (guint16) ((guint16) (val) << 8)))
+
+#define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \
+ (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \
+ (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \
+ (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \
+ (((guint32) (val) & (guint32) 0xff000000U) >> 24)))
+
+#define GUINT64_SWAP_LE_BE_CONSTANT(val) ((guint64) ( \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0x00000000000000ffU)) << 56) | \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0x000000000000ff00U)) << 40) | \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0x0000000000ff0000U)) << 24) | \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0x00000000ff000000U)) << 8) | \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0x000000ff00000000U)) >> 8) | \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0x0000ff0000000000U)) >> 24) | \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0x00ff000000000000U)) >> 40) | \
+ (((guint64) (val) & \
+ (guint64) G_GINT64_CONSTANT (0xff00000000000000U)) >> 56)))
+
+/* Arch specific stuff for speed
+ */
+#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
+
+# if __GNUC__ >= 4 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 3
+# define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((guint32) (val)))
+# define GUINT64_SWAP_LE_BE(val) ((guint64) __builtin_bswap64 ((guint64) (val)))
+# endif
+
+# if defined (__i386__)
+# define GUINT16_SWAP_LE_BE_IA32(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint16 __v, __x = ((guint16) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ ("rorw $8, %w0" \
+ : "=r" (__v) \
+ : "0" (__x) \
+ : "cc"); \
+ __v; }))
+# if !defined (__i486__) && !defined (__i586__) \
+ && !defined (__pentium__) && !defined (__i686__) \
+ && !defined (__pentiumpro__) && !defined (__pentium4__)
+# define GUINT32_SWAP_LE_BE_IA32(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint32 __v, __x = ((guint32) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ ("rorw $8, %w0\n\t" \
+ "rorl $16, %0\n\t" \
+ "rorw $8, %w0" \
+ : "=r" (__v) \
+ : "0" (__x) \
+ : "cc"); \
+ __v; }))
+# else /* 486 and higher has bswap */
+# define GUINT32_SWAP_LE_BE_IA32(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint32 __v, __x = ((guint32) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ ("bswap %0" \
+ : "=r" (__v) \
+ : "0" (__x)); \
+ __v; }))
+# endif /* processor specific 32-bit stuff */
+# define GUINT64_SWAP_LE_BE_IA32(val) \
+ (G_GNUC_EXTENSION \
+ ({ union { guint64 __ll; \
+ guint32 __l[2]; } __w, __r; \
+ __w.__ll = ((guint64) (val)); \
+ if (__builtin_constant_p (__w.__ll)) \
+ __r.__ll = GUINT64_SWAP_LE_BE_CONSTANT (__w.__ll); \
+ else \
+ { \
+ __r.__l[0] = GUINT32_SWAP_LE_BE (__w.__l[1]); \
+ __r.__l[1] = GUINT32_SWAP_LE_BE (__w.__l[0]); \
+ } \
+ __r.__ll; }))
+ /* Possibly just use the constant version and let gcc figure it out? */
+# define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val))
+# ifndef GUINT32_SWAP_LE_BE
+# define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val))
+# endif
+# ifndef GUINT64_SWAP_LE_BE
+# define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_IA32 (val))
+# endif
+# elif defined (__ia64__)
+# define GUINT16_SWAP_LE_BE_IA64(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint16 __v, __x = ((guint16) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ __volatile__ ("shl %0 = %1, 48 ;;" \
+ "mux1 %0 = %0, @rev ;;" \
+ : "=r" (__v) \
+ : "r" (__x)); \
+ __v; }))
+# define GUINT32_SWAP_LE_BE_IA64(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint32 __v, __x = ((guint32) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ __volatile__ ("shl %0 = %1, 32 ;;" \
+ "mux1 %0 = %0, @rev ;;" \
+ : "=r" (__v) \
+ : "r" (__x)); \
+ __v; }))
+# define GUINT64_SWAP_LE_BE_IA64(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint64 __v, __x = ((guint64) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT64_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ __volatile__ ("mux1 %0 = %1, @rev ;;" \
+ : "=r" (__v) \
+ : "r" (__x)); \
+ __v; }))
+# define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA64 (val))
+# ifndef GUINT32_SWAP_LE_BE
+# define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA64 (val))
+# endif
+# ifndef GUINT64_SWAP_LE_BE
+# define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_IA64 (val))
+# endif
+# elif defined (__x86_64__)
+# define GUINT32_SWAP_LE_BE_X86_64(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint32 __v, __x = ((guint32) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ ("bswapl %0" \
+ : "=r" (__v) \
+ : "0" (__x)); \
+ __v; }))
+# define GUINT64_SWAP_LE_BE_X86_64(val) \
+ (G_GNUC_EXTENSION \
+ ({ guint64 __v, __x = ((guint64) (val)); \
+ if (__builtin_constant_p (__x)) \
+ __v = GUINT64_SWAP_LE_BE_CONSTANT (__x); \
+ else \
+ __asm__ ("bswapq %0" \
+ : "=r" (__v) \
+ : "0" (__x)); \
+ __v; }))
+ /* gcc seems to figure out optimal code for this on its own */
+# define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_CONSTANT (val))
+# ifndef GUINT32_SWAP_LE_BE
+# define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_X86_64 (val))
+# endif
+# ifndef GUINT64_SWAP_LE_BE
+# define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_X86_64 (val))
+# endif
+# else /* generic gcc */
+# define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_CONSTANT (val))
+# ifndef GUINT32_SWAP_LE_BE
+# define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_CONSTANT (val))
+# endif
+# ifndef GUINT64_SWAP_LE_BE
+# define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_CONSTANT (val))
+# endif
+# endif
+#else /* generic */
+# define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_CONSTANT (val))
+# define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_CONSTANT (val))
+# define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_CONSTANT (val))
+#endif /* generic */
+
+#define GUINT16_SWAP_LE_PDP(val) ((guint16) (val))
+#define GUINT16_SWAP_BE_PDP(val) (GUINT16_SWAP_LE_BE (val))
+#define GUINT32_SWAP_LE_PDP(val) ((guint32) ( \
+ (((guint32) (val) & (guint32) 0x0000ffffU) << 16) | \
+ (((guint32) (val) & (guint32) 0xffff0000U) >> 16)))
+#define GUINT32_SWAP_BE_PDP(val) ((guint32) ( \
+ (((guint32) (val) & (guint32) 0x00ff00ffU) << 8) | \
+ (((guint32) (val) & (guint32) 0xff00ff00U) >> 8)))
+
+/* The G*_TO_?E() macros are defined in glibconfig.h.
+ * The transformation is symmetric, so the FROM just maps to the TO.
+ */
+#define GINT16_FROM_LE(val) (GINT16_TO_LE (val))
+#define GUINT16_FROM_LE(val) (GUINT16_TO_LE (val))
+#define GINT16_FROM_BE(val) (GINT16_TO_BE (val))
+#define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val))
+#define GINT32_FROM_LE(val) (GINT32_TO_LE (val))
+#define GUINT32_FROM_LE(val) (GUINT32_TO_LE (val))
+#define GINT32_FROM_BE(val) (GINT32_TO_BE (val))
+#define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val))
+
+#define GINT64_FROM_LE(val) (GINT64_TO_LE (val))
+#define GUINT64_FROM_LE(val) (GUINT64_TO_LE (val))
+#define GINT64_FROM_BE(val) (GINT64_TO_BE (val))
+#define GUINT64_FROM_BE(val) (GUINT64_TO_BE (val))
+
+#define GLONG_FROM_LE(val) (GLONG_TO_LE (val))
+#define GULONG_FROM_LE(val) (GULONG_TO_LE (val))
+#define GLONG_FROM_BE(val) (GLONG_TO_BE (val))
+#define GULONG_FROM_BE(val) (GULONG_TO_BE (val))
+
+#define GINT_FROM_LE(val) (GINT_TO_LE (val))
+#define GUINT_FROM_LE(val) (GUINT_TO_LE (val))
+#define GINT_FROM_BE(val) (GINT_TO_BE (val))
+#define GUINT_FROM_BE(val) (GUINT_TO_BE (val))
+
+#define GSIZE_FROM_LE(val) (GSIZE_TO_LE (val))
+#define GSSIZE_FROM_LE(val) (GSSIZE_TO_LE (val))
+#define GSIZE_FROM_BE(val) (GSIZE_TO_BE (val))
+#define GSSIZE_FROM_BE(val) (GSSIZE_TO_BE (val))
+
+/* Portable versions of host-network order stuff
+ */
+#define g_ntohl(val) (GUINT32_FROM_BE (val))
+#define g_ntohs(val) (GUINT16_FROM_BE (val))
+#define g_htonl(val) (GUINT32_TO_BE (val))
+#define g_htons(val) (GUINT16_TO_BE (val))
+
+/* Overflow-checked unsigned integer arithmetic
+ */
+#ifndef _GLIB_TEST_OVERFLOW_FALLBACK
+/* https://bugzilla.gnome.org/show_bug.cgi?id=769104 */
+#if __GNUC__ >= 5 && !defined(__INTEL_COMPILER)
+#define _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS
+#elif g_macro__has_builtin(__builtin_uadd_overflow)
+#define _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS
+#endif
+#endif
+
+#define g_uint_checked_add(dest, a, b) \
+ _GLIB_CHECKED_ADD_U32(dest, a, b)
+#define g_uint_checked_mul(dest, a, b) \
+ _GLIB_CHECKED_MUL_U32(dest, a, b)
+
+#define g_uint64_checked_add(dest, a, b) \
+ _GLIB_CHECKED_ADD_U64(dest, a, b)
+#define g_uint64_checked_mul(dest, a, b) \
+ _GLIB_CHECKED_MUL_U64(dest, a, b)
+
+#if GLIB_SIZEOF_SIZE_T == 8
+#define g_size_checked_add(dest, a, b) \
+ _GLIB_CHECKED_ADD_U64(dest, a, b)
+#define g_size_checked_mul(dest, a, b) \
+ _GLIB_CHECKED_MUL_U64(dest, a, b)
+#else
+#define g_size_checked_add(dest, a, b) \
+ _GLIB_CHECKED_ADD_U32(dest, a, b)
+#define g_size_checked_mul(dest, a, b) \
+ _GLIB_CHECKED_MUL_U32(dest, a, b)
+#endif
+
+/* FIXME: Hide this from gtkdoc scanner because it confuses its poor regexes.
+ * https://gitlab.gnome.org/GNOME/gtk-doc/issues/90 */
+#ifndef __GTK_DOC_IGNORE__
+/* The names of the following inlines are private. Use the macro
+ * definitions above.
+ */
+#ifdef _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS
+static inline gboolean _GLIB_CHECKED_ADD_U32 (guint32 *dest, guint32 a, guint32 b) {
+ return !__builtin_uadd_overflow(a, b, dest); }
+static inline gboolean _GLIB_CHECKED_MUL_U32 (guint32 *dest, guint32 a, guint32 b) {
+ return !__builtin_umul_overflow(a, b, dest); }
+static inline gboolean _GLIB_CHECKED_ADD_U64 (guint64 *dest, guint64 a, guint64 b) {
+ G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
+ return !__builtin_uaddll_overflow(a, b, (unsigned long long *) dest); }
+static inline gboolean _GLIB_CHECKED_MUL_U64 (guint64 *dest, guint64 a, guint64 b) {
+ return !__builtin_umulll_overflow(a, b, (unsigned long long *) dest); }
+#else
+static inline gboolean _GLIB_CHECKED_ADD_U32 (guint32 *dest, guint32 a, guint32 b) {
+ *dest = a + b; return *dest >= a; }
+static inline gboolean _GLIB_CHECKED_MUL_U32 (guint32 *dest, guint32 a, guint32 b) {
+ *dest = a * b; return !a || *dest / a == b; }
+static inline gboolean _GLIB_CHECKED_ADD_U64 (guint64 *dest, guint64 a, guint64 b) {
+ *dest = a + b; return *dest >= a; }
+static inline gboolean _GLIB_CHECKED_MUL_U64 (guint64 *dest, guint64 a, guint64 b) {
+ *dest = a * b; return !a || *dest / a == b; }
+#endif
+#endif /* __GTK_DOC_IGNORE__ */
+
+/* IEEE Standard 754 Single Precision Storage Format (gfloat):
+ *
+ * 31 30 23 22 0
+ * +--------+---------------+---------------+
+ * | s 1bit | e[30:23] 8bit | f[22:0] 23bit |
+ * +--------+---------------+---------------+
+ * B0------------------->B1------->B2-->B3-->
+ *
+ * IEEE Standard 754 Double Precision Storage Format (gdouble):
+ *
+ * 63 62 52 51 32 31 0
+ * +--------+----------------+----------------+ +---------------+
+ * | s 1bit | e[62:52] 11bit | f[51:32] 20bit | | f[31:0] 32bit |
+ * +--------+----------------+----------------+ +---------------+
+ * B0--------------->B1---------->B2--->B3----> B4->B5->B6->B7->
+ */
+/* subtract from biased_exponent to form base2 exponent (normal numbers) */
+typedef union _GDoubleIEEE754 GDoubleIEEE754;
+typedef union _GFloatIEEE754 GFloatIEEE754;
+#define G_IEEE754_FLOAT_BIAS (127)
+#define G_IEEE754_DOUBLE_BIAS (1023)
+/* multiply with base2 exponent to get base10 exponent (normal numbers) */
+#define G_LOG_2_BASE_10 (0.30102999566398119521)
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+union _GFloatIEEE754
+{
+ gfloat v_float;
+ struct {
+ guint mantissa : 23;
+ guint biased_exponent : 8;
+ guint sign : 1;
+ } mpn;
+};
+union _GDoubleIEEE754
+{
+ gdouble v_double;
+ struct {
+ guint mantissa_low : 32;
+ guint mantissa_high : 20;
+ guint biased_exponent : 11;
+ guint sign : 1;
+ } mpn;
+};
+#elif G_BYTE_ORDER == G_BIG_ENDIAN
+union _GFloatIEEE754
+{
+ gfloat v_float;
+ struct {
+ guint sign : 1;
+ guint biased_exponent : 8;
+ guint mantissa : 23;
+ } mpn;
+};
+union _GDoubleIEEE754
+{
+ gdouble v_double;
+ struct {
+ guint sign : 1;
+ guint biased_exponent : 11;
+ guint mantissa_high : 20;
+ guint mantissa_low : 32;
+ } mpn;
+};
+#else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
+#error unknown ENDIAN type
+#endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
+
+typedef struct _GTimeVal GTimeVal GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
+
+struct _GTimeVal
+{
+ glong tv_sec;
+ glong tv_usec;
+} GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
+
+typedef gint grefcount;
+typedef volatile gint gatomicrefcount;
+
+G_END_DECLS
+
+/* We prefix variable declarations so they can
+ * properly get exported in Windows DLLs.
+ */
+#ifndef GLIB_VAR
+# ifdef G_PLATFORM_WIN32
+# ifdef GLIB_STATIC_COMPILATION
+# define GLIB_VAR extern
+# else /* !GLIB_STATIC_COMPILATION */
+# ifdef GLIB_COMPILATION
+# ifdef DLL_EXPORT
+# define GLIB_VAR extern __declspec(dllexport)
+# else /* !DLL_EXPORT */
+# define GLIB_VAR extern
+# endif /* !DLL_EXPORT */
+# else /* !GLIB_COMPILATION */
+# define GLIB_VAR extern __declspec(dllimport)
+# endif /* !GLIB_COMPILATION */
+# endif /* !GLIB_STATIC_COMPILATION */
+# else /* !G_PLATFORM_WIN32 */
+# define GLIB_VAR _GLIB_EXTERN
+# endif /* !G_PLATFORM_WIN32 */
+#endif /* GLIB_VAR */
+
+#endif /* __G_TYPES_H__ */
diff --git a/include/glib/glib/gunicode.h b/include/glib/glib/gunicode.h
new file mode 100644
index 0000000000..5663aec7ee
--- /dev/null
+++ b/include/glib/glib/gunicode.h
@@ -0,0 +1,929 @@
+/* gunicode.h - Unicode manipulation functions
+ *
+ * Copyright (C) 1999, 2000 Tom Tromey
+ * Copyright 2000, 2005 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_UNICODE_H__
+#define __G_UNICODE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gerror.h>
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * gunichar:
+ *
+ * A type which can hold any UTF-32 or UCS-4 character code,
+ * also known as a Unicode code point.
+ *
+ * If you want to produce the UTF-8 representation of a #gunichar,
+ * use g_ucs4_to_utf8(). See also g_utf8_to_ucs4() for the reverse
+ * process.
+ *
+ * To print/scan values of this type as integer, use
+ * %G_GINT32_MODIFIER and/or %G_GUINT32_FORMAT.
+ *
+ * The notation to express a Unicode code point in running text is
+ * as a hexadecimal number with four to six digits and uppercase
+ * letters, prefixed by the string "U+". Leading zeros are omitted,
+ * unless the code point would have fewer than four hexadecimal digits.
+ * For example, "U+0041 LATIN CAPITAL LETTER A". To print a code point
+ * in the U+-notation, use the format string "U+\%04"G_GINT32_FORMAT"X".
+ * To scan, use the format string "U+\%06"G_GINT32_FORMAT"X".
+ *
+ * |[
+ * gunichar c;
+ * sscanf ("U+0041", "U+%06"G_GINT32_FORMAT"X", &amp;c)
+ * g_print ("Read U+%04"G_GINT32_FORMAT"X", c);
+ * ]|
+ */
+typedef guint32 gunichar;
+
+/**
+ * gunichar2:
+ *
+ * A type which can hold any UTF-16 code
+ * point<footnote id="utf16_surrogate_pairs">UTF-16 also has so called
+ * <firstterm>surrogate pairs</firstterm> to encode characters beyond
+ * the BMP as pairs of 16bit numbers. Surrogate pairs cannot be stored
+ * in a single gunichar2 field, but all GLib functions accepting gunichar2
+ * arrays will correctly interpret surrogate pairs.</footnote>.
+ *
+ * To print/scan values of this type to/from text you need to convert
+ * to/from UTF-8, using g_utf16_to_utf8()/g_utf8_to_utf16().
+ *
+ * To print/scan values of this type as integer, use
+ * %G_GINT16_MODIFIER and/or %G_GUINT16_FORMAT.
+ */
+typedef guint16 gunichar2;
+
+/**
+ * GUnicodeType:
+ * @G_UNICODE_CONTROL: General category "Other, Control" (Cc)
+ * @G_UNICODE_FORMAT: General category "Other, Format" (Cf)
+ * @G_UNICODE_UNASSIGNED: General category "Other, Not Assigned" (Cn)
+ * @G_UNICODE_PRIVATE_USE: General category "Other, Private Use" (Co)
+ * @G_UNICODE_SURROGATE: General category "Other, Surrogate" (Cs)
+ * @G_UNICODE_LOWERCASE_LETTER: General category "Letter, Lowercase" (Ll)
+ * @G_UNICODE_MODIFIER_LETTER: General category "Letter, Modifier" (Lm)
+ * @G_UNICODE_OTHER_LETTER: General category "Letter, Other" (Lo)
+ * @G_UNICODE_TITLECASE_LETTER: General category "Letter, Titlecase" (Lt)
+ * @G_UNICODE_UPPERCASE_LETTER: General category "Letter, Uppercase" (Lu)
+ * @G_UNICODE_SPACING_MARK: General category "Mark, Spacing" (Mc)
+ * @G_UNICODE_ENCLOSING_MARK: General category "Mark, Enclosing" (Me)
+ * @G_UNICODE_NON_SPACING_MARK: General category "Mark, Nonspacing" (Mn)
+ * @G_UNICODE_DECIMAL_NUMBER: General category "Number, Decimal Digit" (Nd)
+ * @G_UNICODE_LETTER_NUMBER: General category "Number, Letter" (Nl)
+ * @G_UNICODE_OTHER_NUMBER: General category "Number, Other" (No)
+ * @G_UNICODE_CONNECT_PUNCTUATION: General category "Punctuation, Connector" (Pc)
+ * @G_UNICODE_DASH_PUNCTUATION: General category "Punctuation, Dash" (Pd)
+ * @G_UNICODE_CLOSE_PUNCTUATION: General category "Punctuation, Close" (Pe)
+ * @G_UNICODE_FINAL_PUNCTUATION: General category "Punctuation, Final quote" (Pf)
+ * @G_UNICODE_INITIAL_PUNCTUATION: General category "Punctuation, Initial quote" (Pi)
+ * @G_UNICODE_OTHER_PUNCTUATION: General category "Punctuation, Other" (Po)
+ * @G_UNICODE_OPEN_PUNCTUATION: General category "Punctuation, Open" (Ps)
+ * @G_UNICODE_CURRENCY_SYMBOL: General category "Symbol, Currency" (Sc)
+ * @G_UNICODE_MODIFIER_SYMBOL: General category "Symbol, Modifier" (Sk)
+ * @G_UNICODE_MATH_SYMBOL: General category "Symbol, Math" (Sm)
+ * @G_UNICODE_OTHER_SYMBOL: General category "Symbol, Other" (So)
+ * @G_UNICODE_LINE_SEPARATOR: General category "Separator, Line" (Zl)
+ * @G_UNICODE_PARAGRAPH_SEPARATOR: General category "Separator, Paragraph" (Zp)
+ * @G_UNICODE_SPACE_SEPARATOR: General category "Separator, Space" (Zs)
+ *
+ * These are the possible character classifications from the
+ * Unicode specification.
+ * See [Unicode Character Database](http://www.unicode.org/reports/tr44/#General_Category_Values).
+ */
+typedef enum
+{
+ G_UNICODE_CONTROL,
+ G_UNICODE_FORMAT,
+ G_UNICODE_UNASSIGNED,
+ G_UNICODE_PRIVATE_USE,
+ G_UNICODE_SURROGATE,
+ G_UNICODE_LOWERCASE_LETTER,
+ G_UNICODE_MODIFIER_LETTER,
+ G_UNICODE_OTHER_LETTER,
+ G_UNICODE_TITLECASE_LETTER,
+ G_UNICODE_UPPERCASE_LETTER,
+ G_UNICODE_SPACING_MARK,
+ G_UNICODE_ENCLOSING_MARK,
+ G_UNICODE_NON_SPACING_MARK,
+ G_UNICODE_DECIMAL_NUMBER,
+ G_UNICODE_LETTER_NUMBER,
+ G_UNICODE_OTHER_NUMBER,
+ G_UNICODE_CONNECT_PUNCTUATION,
+ G_UNICODE_DASH_PUNCTUATION,
+ G_UNICODE_CLOSE_PUNCTUATION,
+ G_UNICODE_FINAL_PUNCTUATION,
+ G_UNICODE_INITIAL_PUNCTUATION,
+ G_UNICODE_OTHER_PUNCTUATION,
+ G_UNICODE_OPEN_PUNCTUATION,
+ G_UNICODE_CURRENCY_SYMBOL,
+ G_UNICODE_MODIFIER_SYMBOL,
+ G_UNICODE_MATH_SYMBOL,
+ G_UNICODE_OTHER_SYMBOL,
+ G_UNICODE_LINE_SEPARATOR,
+ G_UNICODE_PARAGRAPH_SEPARATOR,
+ G_UNICODE_SPACE_SEPARATOR
+} GUnicodeType;
+
+/**
+ * G_UNICODE_COMBINING_MARK:
+ *
+ * Older name for %G_UNICODE_SPACING_MARK.
+ *
+ * Deprecated: 2.30: Use %G_UNICODE_SPACING_MARK.
+ */
+#define G_UNICODE_COMBINING_MARK G_UNICODE_SPACING_MARK GLIB_DEPRECATED_MACRO_IN_2_30_FOR(G_UNICODE_SPACING_MARK)
+
+/**
+ * GUnicodeBreakType:
+ * @G_UNICODE_BREAK_MANDATORY: Mandatory Break (BK)
+ * @G_UNICODE_BREAK_CARRIAGE_RETURN: Carriage Return (CR)
+ * @G_UNICODE_BREAK_LINE_FEED: Line Feed (LF)
+ * @G_UNICODE_BREAK_COMBINING_MARK: Attached Characters and Combining Marks (CM)
+ * @G_UNICODE_BREAK_SURROGATE: Surrogates (SG)
+ * @G_UNICODE_BREAK_ZERO_WIDTH_SPACE: Zero Width Space (ZW)
+ * @G_UNICODE_BREAK_INSEPARABLE: Inseparable (IN)
+ * @G_UNICODE_BREAK_NON_BREAKING_GLUE: Non-breaking ("Glue") (GL)
+ * @G_UNICODE_BREAK_CONTINGENT: Contingent Break Opportunity (CB)
+ * @G_UNICODE_BREAK_SPACE: Space (SP)
+ * @G_UNICODE_BREAK_AFTER: Break Opportunity After (BA)
+ * @G_UNICODE_BREAK_BEFORE: Break Opportunity Before (BB)
+ * @G_UNICODE_BREAK_BEFORE_AND_AFTER: Break Opportunity Before and After (B2)
+ * @G_UNICODE_BREAK_HYPHEN: Hyphen (HY)
+ * @G_UNICODE_BREAK_NON_STARTER: Nonstarter (NS)
+ * @G_UNICODE_BREAK_OPEN_PUNCTUATION: Opening Punctuation (OP)
+ * @G_UNICODE_BREAK_CLOSE_PUNCTUATION: Closing Punctuation (CL)
+ * @G_UNICODE_BREAK_QUOTATION: Ambiguous Quotation (QU)
+ * @G_UNICODE_BREAK_EXCLAMATION: Exclamation/Interrogation (EX)
+ * @G_UNICODE_BREAK_IDEOGRAPHIC: Ideographic (ID)
+ * @G_UNICODE_BREAK_NUMERIC: Numeric (NU)
+ * @G_UNICODE_BREAK_INFIX_SEPARATOR: Infix Separator (Numeric) (IS)
+ * @G_UNICODE_BREAK_SYMBOL: Symbols Allowing Break After (SY)
+ * @G_UNICODE_BREAK_ALPHABETIC: Ordinary Alphabetic and Symbol Characters (AL)
+ * @G_UNICODE_BREAK_PREFIX: Prefix (Numeric) (PR)
+ * @G_UNICODE_BREAK_POSTFIX: Postfix (Numeric) (PO)
+ * @G_UNICODE_BREAK_COMPLEX_CONTEXT: Complex Content Dependent (South East Asian) (SA)
+ * @G_UNICODE_BREAK_AMBIGUOUS: Ambiguous (Alphabetic or Ideographic) (AI)
+ * @G_UNICODE_BREAK_UNKNOWN: Unknown (XX)
+ * @G_UNICODE_BREAK_NEXT_LINE: Next Line (NL)
+ * @G_UNICODE_BREAK_WORD_JOINER: Word Joiner (WJ)
+ * @G_UNICODE_BREAK_HANGUL_L_JAMO: Hangul L Jamo (JL)
+ * @G_UNICODE_BREAK_HANGUL_V_JAMO: Hangul V Jamo (JV)
+ * @G_UNICODE_BREAK_HANGUL_T_JAMO: Hangul T Jamo (JT)
+ * @G_UNICODE_BREAK_HANGUL_LV_SYLLABLE: Hangul LV Syllable (H2)
+ * @G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE: Hangul LVT Syllable (H3)
+ * @G_UNICODE_BREAK_CLOSE_PARANTHESIS: Closing Parenthesis (CP). Since 2.28
+ * @G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER: Conditional Japanese Starter (CJ). Since: 2.32
+ * @G_UNICODE_BREAK_HEBREW_LETTER: Hebrew Letter (HL). Since: 2.32
+ * @G_UNICODE_BREAK_REGIONAL_INDICATOR: Regional Indicator (RI). Since: 2.36
+ * @G_UNICODE_BREAK_EMOJI_BASE: Emoji Base (EB). Since: 2.50
+ * @G_UNICODE_BREAK_EMOJI_MODIFIER: Emoji Modifier (EM). Since: 2.50
+ * @G_UNICODE_BREAK_ZERO_WIDTH_JOINER: Zero Width Joiner (ZWJ). Since: 2.50
+ *
+ * These are the possible line break classifications.
+ *
+ * Since new unicode versions may add new types here, applications should be ready
+ * to handle unknown values. They may be regarded as %G_UNICODE_BREAK_UNKNOWN.
+ *
+ * See [Unicode Line Breaking Algorithm](http://www.unicode.org/unicode/reports/tr14/).
+ */
+typedef enum
+{
+ G_UNICODE_BREAK_MANDATORY,
+ G_UNICODE_BREAK_CARRIAGE_RETURN,
+ G_UNICODE_BREAK_LINE_FEED,
+ G_UNICODE_BREAK_COMBINING_MARK,
+ G_UNICODE_BREAK_SURROGATE,
+ G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
+ G_UNICODE_BREAK_INSEPARABLE,
+ G_UNICODE_BREAK_NON_BREAKING_GLUE,
+ G_UNICODE_BREAK_CONTINGENT,
+ G_UNICODE_BREAK_SPACE,
+ G_UNICODE_BREAK_AFTER,
+ G_UNICODE_BREAK_BEFORE,
+ G_UNICODE_BREAK_BEFORE_AND_AFTER,
+ G_UNICODE_BREAK_HYPHEN,
+ G_UNICODE_BREAK_NON_STARTER,
+ G_UNICODE_BREAK_OPEN_PUNCTUATION,
+ G_UNICODE_BREAK_CLOSE_PUNCTUATION,
+ G_UNICODE_BREAK_QUOTATION,
+ G_UNICODE_BREAK_EXCLAMATION,
+ G_UNICODE_BREAK_IDEOGRAPHIC,
+ G_UNICODE_BREAK_NUMERIC,
+ G_UNICODE_BREAK_INFIX_SEPARATOR,
+ G_UNICODE_BREAK_SYMBOL,
+ G_UNICODE_BREAK_ALPHABETIC,
+ G_UNICODE_BREAK_PREFIX,
+ G_UNICODE_BREAK_POSTFIX,
+ G_UNICODE_BREAK_COMPLEX_CONTEXT,
+ G_UNICODE_BREAK_AMBIGUOUS,
+ G_UNICODE_BREAK_UNKNOWN,
+ G_UNICODE_BREAK_NEXT_LINE,
+ G_UNICODE_BREAK_WORD_JOINER,
+ G_UNICODE_BREAK_HANGUL_L_JAMO,
+ G_UNICODE_BREAK_HANGUL_V_JAMO,
+ G_UNICODE_BREAK_HANGUL_T_JAMO,
+ G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
+ G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE,
+ G_UNICODE_BREAK_CLOSE_PARANTHESIS,
+ G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER,
+ G_UNICODE_BREAK_HEBREW_LETTER,
+ G_UNICODE_BREAK_REGIONAL_INDICATOR,
+ G_UNICODE_BREAK_EMOJI_BASE,
+ G_UNICODE_BREAK_EMOJI_MODIFIER,
+ G_UNICODE_BREAK_ZERO_WIDTH_JOINER
+} GUnicodeBreakType;
+
+/**
+ * GUnicodeScript:
+ * @G_UNICODE_SCRIPT_INVALID_CODE:
+ * a value never returned from g_unichar_get_script()
+ * @G_UNICODE_SCRIPT_COMMON: a character used by multiple different scripts
+ * @G_UNICODE_SCRIPT_INHERITED: a mark glyph that takes its script from the
+ * base glyph to which it is attached
+ * @G_UNICODE_SCRIPT_ARABIC: Arabic
+ * @G_UNICODE_SCRIPT_ARMENIAN: Armenian
+ * @G_UNICODE_SCRIPT_BENGALI: Bengali
+ * @G_UNICODE_SCRIPT_BOPOMOFO: Bopomofo
+ * @G_UNICODE_SCRIPT_CHEROKEE: Cherokee
+ * @G_UNICODE_SCRIPT_COPTIC: Coptic
+ * @G_UNICODE_SCRIPT_CYRILLIC: Cyrillic
+ * @G_UNICODE_SCRIPT_DESERET: Deseret
+ * @G_UNICODE_SCRIPT_DEVANAGARI: Devanagari
+ * @G_UNICODE_SCRIPT_ETHIOPIC: Ethiopic
+ * @G_UNICODE_SCRIPT_GEORGIAN: Georgian
+ * @G_UNICODE_SCRIPT_GOTHIC: Gothic
+ * @G_UNICODE_SCRIPT_GREEK: Greek
+ * @G_UNICODE_SCRIPT_GUJARATI: Gujarati
+ * @G_UNICODE_SCRIPT_GURMUKHI: Gurmukhi
+ * @G_UNICODE_SCRIPT_HAN: Han
+ * @G_UNICODE_SCRIPT_HANGUL: Hangul
+ * @G_UNICODE_SCRIPT_HEBREW: Hebrew
+ * @G_UNICODE_SCRIPT_HIRAGANA: Hiragana
+ * @G_UNICODE_SCRIPT_KANNADA: Kannada
+ * @G_UNICODE_SCRIPT_KATAKANA: Katakana
+ * @G_UNICODE_SCRIPT_KHMER: Khmer
+ * @G_UNICODE_SCRIPT_LAO: Lao
+ * @G_UNICODE_SCRIPT_LATIN: Latin
+ * @G_UNICODE_SCRIPT_MALAYALAM: Malayalam
+ * @G_UNICODE_SCRIPT_MONGOLIAN: Mongolian
+ * @G_UNICODE_SCRIPT_MYANMAR: Myanmar
+ * @G_UNICODE_SCRIPT_OGHAM: Ogham
+ * @G_UNICODE_SCRIPT_OLD_ITALIC: Old Italic
+ * @G_UNICODE_SCRIPT_ORIYA: Oriya
+ * @G_UNICODE_SCRIPT_RUNIC: Runic
+ * @G_UNICODE_SCRIPT_SINHALA: Sinhala
+ * @G_UNICODE_SCRIPT_SYRIAC: Syriac
+ * @G_UNICODE_SCRIPT_TAMIL: Tamil
+ * @G_UNICODE_SCRIPT_TELUGU: Telugu
+ * @G_UNICODE_SCRIPT_THAANA: Thaana
+ * @G_UNICODE_SCRIPT_THAI: Thai
+ * @G_UNICODE_SCRIPT_TIBETAN: Tibetan
+ * @G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL:
+ * Canadian Aboriginal
+ * @G_UNICODE_SCRIPT_YI: Yi
+ * @G_UNICODE_SCRIPT_TAGALOG: Tagalog
+ * @G_UNICODE_SCRIPT_HANUNOO: Hanunoo
+ * @G_UNICODE_SCRIPT_BUHID: Buhid
+ * @G_UNICODE_SCRIPT_TAGBANWA: Tagbanwa
+ * @G_UNICODE_SCRIPT_BRAILLE: Braille
+ * @G_UNICODE_SCRIPT_CYPRIOT: Cypriot
+ * @G_UNICODE_SCRIPT_LIMBU: Limbu
+ * @G_UNICODE_SCRIPT_OSMANYA: Osmanya
+ * @G_UNICODE_SCRIPT_SHAVIAN: Shavian
+ * @G_UNICODE_SCRIPT_LINEAR_B: Linear B
+ * @G_UNICODE_SCRIPT_TAI_LE: Tai Le
+ * @G_UNICODE_SCRIPT_UGARITIC: Ugaritic
+ * @G_UNICODE_SCRIPT_NEW_TAI_LUE:
+ * New Tai Lue
+ * @G_UNICODE_SCRIPT_BUGINESE: Buginese
+ * @G_UNICODE_SCRIPT_GLAGOLITIC: Glagolitic
+ * @G_UNICODE_SCRIPT_TIFINAGH: Tifinagh
+ * @G_UNICODE_SCRIPT_SYLOTI_NAGRI:
+ * Syloti Nagri
+ * @G_UNICODE_SCRIPT_OLD_PERSIAN:
+ * Old Persian
+ * @G_UNICODE_SCRIPT_KHAROSHTHI: Kharoshthi
+ * @G_UNICODE_SCRIPT_UNKNOWN: an unassigned code point
+ * @G_UNICODE_SCRIPT_BALINESE: Balinese
+ * @G_UNICODE_SCRIPT_CUNEIFORM: Cuneiform
+ * @G_UNICODE_SCRIPT_PHOENICIAN: Phoenician
+ * @G_UNICODE_SCRIPT_PHAGS_PA: Phags-pa
+ * @G_UNICODE_SCRIPT_NKO: N'Ko
+ * @G_UNICODE_SCRIPT_KAYAH_LI: Kayah Li. Since 2.16.3
+ * @G_UNICODE_SCRIPT_LEPCHA: Lepcha. Since 2.16.3
+ * @G_UNICODE_SCRIPT_REJANG: Rejang. Since 2.16.3
+ * @G_UNICODE_SCRIPT_SUNDANESE: Sundanese. Since 2.16.3
+ * @G_UNICODE_SCRIPT_SAURASHTRA: Saurashtra. Since 2.16.3
+ * @G_UNICODE_SCRIPT_CHAM: Cham. Since 2.16.3
+ * @G_UNICODE_SCRIPT_OL_CHIKI: Ol Chiki. Since 2.16.3
+ * @G_UNICODE_SCRIPT_VAI: Vai. Since 2.16.3
+ * @G_UNICODE_SCRIPT_CARIAN: Carian. Since 2.16.3
+ * @G_UNICODE_SCRIPT_LYCIAN: Lycian. Since 2.16.3
+ * @G_UNICODE_SCRIPT_LYDIAN: Lydian. Since 2.16.3
+ * @G_UNICODE_SCRIPT_AVESTAN: Avestan. Since 2.26
+ * @G_UNICODE_SCRIPT_BAMUM: Bamum. Since 2.26
+ * @G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS:
+ * Egyptian Hieroglpyhs. Since 2.26
+ * @G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC:
+ * Imperial Aramaic. Since 2.26
+ * @G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI:
+ * Inscriptional Pahlavi. Since 2.26
+ * @G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN:
+ * Inscriptional Parthian. Since 2.26
+ * @G_UNICODE_SCRIPT_JAVANESE: Javanese. Since 2.26
+ * @G_UNICODE_SCRIPT_KAITHI: Kaithi. Since 2.26
+ * @G_UNICODE_SCRIPT_LISU: Lisu. Since 2.26
+ * @G_UNICODE_SCRIPT_MEETEI_MAYEK:
+ * Meetei Mayek. Since 2.26
+ * @G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN:
+ * Old South Arabian. Since 2.26
+ * @G_UNICODE_SCRIPT_OLD_TURKIC: Old Turkic. Since 2.28
+ * @G_UNICODE_SCRIPT_SAMARITAN: Samaritan. Since 2.26
+ * @G_UNICODE_SCRIPT_TAI_THAM: Tai Tham. Since 2.26
+ * @G_UNICODE_SCRIPT_TAI_VIET: Tai Viet. Since 2.26
+ * @G_UNICODE_SCRIPT_BATAK: Batak. Since 2.28
+ * @G_UNICODE_SCRIPT_BRAHMI: Brahmi. Since 2.28
+ * @G_UNICODE_SCRIPT_MANDAIC: Mandaic. Since 2.28
+ * @G_UNICODE_SCRIPT_CHAKMA: Chakma. Since: 2.32
+ * @G_UNICODE_SCRIPT_MEROITIC_CURSIVE: Meroitic Cursive. Since: 2.32
+ * @G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS: Meroitic Hieroglyphs. Since: 2.32
+ * @G_UNICODE_SCRIPT_MIAO: Miao. Since: 2.32
+ * @G_UNICODE_SCRIPT_SHARADA: Sharada. Since: 2.32
+ * @G_UNICODE_SCRIPT_SORA_SOMPENG: Sora Sompeng. Since: 2.32
+ * @G_UNICODE_SCRIPT_TAKRI: Takri. Since: 2.32
+ * @G_UNICODE_SCRIPT_BASSA_VAH: Bassa. Since: 2.42
+ * @G_UNICODE_SCRIPT_CAUCASIAN_ALBANIAN: Caucasian Albanian. Since: 2.42
+ * @G_UNICODE_SCRIPT_DUPLOYAN: Duployan. Since: 2.42
+ * @G_UNICODE_SCRIPT_ELBASAN: Elbasan. Since: 2.42
+ * @G_UNICODE_SCRIPT_GRANTHA: Grantha. Since: 2.42
+ * @G_UNICODE_SCRIPT_KHOJKI: Kjohki. Since: 2.42
+ * @G_UNICODE_SCRIPT_KHUDAWADI: Khudawadi, Sindhi. Since: 2.42
+ * @G_UNICODE_SCRIPT_LINEAR_A: Linear A. Since: 2.42
+ * @G_UNICODE_SCRIPT_MAHAJANI: Mahajani. Since: 2.42
+ * @G_UNICODE_SCRIPT_MANICHAEAN: Manichaean. Since: 2.42
+ * @G_UNICODE_SCRIPT_MENDE_KIKAKUI: Mende Kikakui. Since: 2.42
+ * @G_UNICODE_SCRIPT_MODI: Modi. Since: 2.42
+ * @G_UNICODE_SCRIPT_MRO: Mro. Since: 2.42
+ * @G_UNICODE_SCRIPT_NABATAEAN: Nabataean. Since: 2.42
+ * @G_UNICODE_SCRIPT_OLD_NORTH_ARABIAN: Old North Arabian. Since: 2.42
+ * @G_UNICODE_SCRIPT_OLD_PERMIC: Old Permic. Since: 2.42
+ * @G_UNICODE_SCRIPT_PAHAWH_HMONG: Pahawh Hmong. Since: 2.42
+ * @G_UNICODE_SCRIPT_PALMYRENE: Palmyrene. Since: 2.42
+ * @G_UNICODE_SCRIPT_PAU_CIN_HAU: Pau Cin Hau. Since: 2.42
+ * @G_UNICODE_SCRIPT_PSALTER_PAHLAVI: Psalter Pahlavi. Since: 2.42
+ * @G_UNICODE_SCRIPT_SIDDHAM: Siddham. Since: 2.42
+ * @G_UNICODE_SCRIPT_TIRHUTA: Tirhuta. Since: 2.42
+ * @G_UNICODE_SCRIPT_WARANG_CITI: Warang Citi. Since: 2.42
+ * @G_UNICODE_SCRIPT_AHOM: Ahom. Since: 2.48
+ * @G_UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS: Anatolian Hieroglyphs. Since: 2.48
+ * @G_UNICODE_SCRIPT_HATRAN: Hatran. Since: 2.48
+ * @G_UNICODE_SCRIPT_MULTANI: Multani. Since: 2.48
+ * @G_UNICODE_SCRIPT_OLD_HUNGARIAN: Old Hungarian. Since: 2.48
+ * @G_UNICODE_SCRIPT_SIGNWRITING: Signwriting. Since: 2.48
+ * @G_UNICODE_SCRIPT_ADLAM: Adlam. Since: 2.50
+ * @G_UNICODE_SCRIPT_BHAIKSUKI: Bhaiksuki. Since: 2.50
+ * @G_UNICODE_SCRIPT_MARCHEN: Marchen. Since: 2.50
+ * @G_UNICODE_SCRIPT_NEWA: Newa. Since: 2.50
+ * @G_UNICODE_SCRIPT_OSAGE: Osage. Since: 2.50
+ * @G_UNICODE_SCRIPT_TANGUT: Tangut. Since: 2.50
+ * @G_UNICODE_SCRIPT_MASARAM_GONDI: Masaram Gondi. Since: 2.54
+ * @G_UNICODE_SCRIPT_NUSHU: Nushu. Since: 2.54
+ * @G_UNICODE_SCRIPT_SOYOMBO: Soyombo. Since: 2.54
+ * @G_UNICODE_SCRIPT_ZANABAZAR_SQUARE: Zanabazar Square. Since: 2.54
+ * @G_UNICODE_SCRIPT_DOGRA: Dogra. Since: 2.58
+ * @G_UNICODE_SCRIPT_GUNJALA_GONDI: Gunjala Gondi. Since: 2.58
+ * @G_UNICODE_SCRIPT_HANIFI_ROHINGYA: Hanifi Rohingya. Since: 2.58
+ * @G_UNICODE_SCRIPT_MAKASAR: Makasar. Since: 2.58
+ * @G_UNICODE_SCRIPT_MEDEFAIDRIN: Medefaidrin. Since: 2.58
+ * @G_UNICODE_SCRIPT_OLD_SOGDIAN: Old Sogdian. Since: 2.58
+ * @G_UNICODE_SCRIPT_SOGDIAN: Sogdian. Since: 2.58
+ * @G_UNICODE_SCRIPT_ELYMAIC: Elym. Since: 2.62
+ * @G_UNICODE_SCRIPT_NANDINAGARI: Nand. Since: 2.62
+ * @G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG: Rohg. Since: 2.62
+ * @G_UNICODE_SCRIPT_WANCHO: Wcho. Since: 2.62
+ *
+ * The #GUnicodeScript enumeration identifies different writing
+ * systems. The values correspond to the names as defined in the
+ * Unicode standard. The enumeration has been added in GLib 2.14,
+ * and is interchangeable with #PangoScript.
+ *
+ * Note that new types may be added in the future. Applications
+ * should be ready to handle unknown values.
+ * See [Unicode Standard Annex #24: Script names](http://www.unicode.org/reports/tr24/).
+ */
+typedef enum
+{ /* ISO 15924 code */
+ G_UNICODE_SCRIPT_INVALID_CODE = -1,
+ G_UNICODE_SCRIPT_COMMON = 0, /* Zyyy */
+ G_UNICODE_SCRIPT_INHERITED, /* Zinh (Qaai) */
+ G_UNICODE_SCRIPT_ARABIC, /* Arab */
+ G_UNICODE_SCRIPT_ARMENIAN, /* Armn */
+ G_UNICODE_SCRIPT_BENGALI, /* Beng */
+ G_UNICODE_SCRIPT_BOPOMOFO, /* Bopo */
+ G_UNICODE_SCRIPT_CHEROKEE, /* Cher */
+ G_UNICODE_SCRIPT_COPTIC, /* Copt (Qaac) */
+ G_UNICODE_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
+ G_UNICODE_SCRIPT_DESERET, /* Dsrt */
+ G_UNICODE_SCRIPT_DEVANAGARI, /* Deva */
+ G_UNICODE_SCRIPT_ETHIOPIC, /* Ethi */
+ G_UNICODE_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
+ G_UNICODE_SCRIPT_GOTHIC, /* Goth */
+ G_UNICODE_SCRIPT_GREEK, /* Grek */
+ G_UNICODE_SCRIPT_GUJARATI, /* Gujr */
+ G_UNICODE_SCRIPT_GURMUKHI, /* Guru */
+ G_UNICODE_SCRIPT_HAN, /* Hani */
+ G_UNICODE_SCRIPT_HANGUL, /* Hang */
+ G_UNICODE_SCRIPT_HEBREW, /* Hebr */
+ G_UNICODE_SCRIPT_HIRAGANA, /* Hira */
+ G_UNICODE_SCRIPT_KANNADA, /* Knda */
+ G_UNICODE_SCRIPT_KATAKANA, /* Kana */
+ G_UNICODE_SCRIPT_KHMER, /* Khmr */
+ G_UNICODE_SCRIPT_LAO, /* Laoo */
+ G_UNICODE_SCRIPT_LATIN, /* Latn (Latf, Latg) */
+ G_UNICODE_SCRIPT_MALAYALAM, /* Mlym */
+ G_UNICODE_SCRIPT_MONGOLIAN, /* Mong */
+ G_UNICODE_SCRIPT_MYANMAR, /* Mymr */
+ G_UNICODE_SCRIPT_OGHAM, /* Ogam */
+ G_UNICODE_SCRIPT_OLD_ITALIC, /* Ital */
+ G_UNICODE_SCRIPT_ORIYA, /* Orya */
+ G_UNICODE_SCRIPT_RUNIC, /* Runr */
+ G_UNICODE_SCRIPT_SINHALA, /* Sinh */
+ G_UNICODE_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
+ G_UNICODE_SCRIPT_TAMIL, /* Taml */
+ G_UNICODE_SCRIPT_TELUGU, /* Telu */
+ G_UNICODE_SCRIPT_THAANA, /* Thaa */
+ G_UNICODE_SCRIPT_THAI, /* Thai */
+ G_UNICODE_SCRIPT_TIBETAN, /* Tibt */
+ G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
+ G_UNICODE_SCRIPT_YI, /* Yiii */
+ G_UNICODE_SCRIPT_TAGALOG, /* Tglg */
+ G_UNICODE_SCRIPT_HANUNOO, /* Hano */
+ G_UNICODE_SCRIPT_BUHID, /* Buhd */
+ G_UNICODE_SCRIPT_TAGBANWA, /* Tagb */
+
+ /* Unicode-4.0 additions */
+ G_UNICODE_SCRIPT_BRAILLE, /* Brai */
+ G_UNICODE_SCRIPT_CYPRIOT, /* Cprt */
+ G_UNICODE_SCRIPT_LIMBU, /* Limb */
+ G_UNICODE_SCRIPT_OSMANYA, /* Osma */
+ G_UNICODE_SCRIPT_SHAVIAN, /* Shaw */
+ G_UNICODE_SCRIPT_LINEAR_B, /* Linb */
+ G_UNICODE_SCRIPT_TAI_LE, /* Tale */
+ G_UNICODE_SCRIPT_UGARITIC, /* Ugar */
+
+ /* Unicode-4.1 additions */
+ G_UNICODE_SCRIPT_NEW_TAI_LUE, /* Talu */
+ G_UNICODE_SCRIPT_BUGINESE, /* Bugi */
+ G_UNICODE_SCRIPT_GLAGOLITIC, /* Glag */
+ G_UNICODE_SCRIPT_TIFINAGH, /* Tfng */
+ G_UNICODE_SCRIPT_SYLOTI_NAGRI, /* Sylo */
+ G_UNICODE_SCRIPT_OLD_PERSIAN, /* Xpeo */
+ G_UNICODE_SCRIPT_KHAROSHTHI, /* Khar */
+
+ /* Unicode-5.0 additions */
+ G_UNICODE_SCRIPT_UNKNOWN, /* Zzzz */
+ G_UNICODE_SCRIPT_BALINESE, /* Bali */
+ G_UNICODE_SCRIPT_CUNEIFORM, /* Xsux */
+ G_UNICODE_SCRIPT_PHOENICIAN, /* Phnx */
+ G_UNICODE_SCRIPT_PHAGS_PA, /* Phag */
+ G_UNICODE_SCRIPT_NKO, /* Nkoo */
+
+ /* Unicode-5.1 additions */
+ G_UNICODE_SCRIPT_KAYAH_LI, /* Kali */
+ G_UNICODE_SCRIPT_LEPCHA, /* Lepc */
+ G_UNICODE_SCRIPT_REJANG, /* Rjng */
+ G_UNICODE_SCRIPT_SUNDANESE, /* Sund */
+ G_UNICODE_SCRIPT_SAURASHTRA, /* Saur */
+ G_UNICODE_SCRIPT_CHAM, /* Cham */
+ G_UNICODE_SCRIPT_OL_CHIKI, /* Olck */
+ G_UNICODE_SCRIPT_VAI, /* Vaii */
+ G_UNICODE_SCRIPT_CARIAN, /* Cari */
+ G_UNICODE_SCRIPT_LYCIAN, /* Lyci */
+ G_UNICODE_SCRIPT_LYDIAN, /* Lydi */
+
+ /* Unicode-5.2 additions */
+ G_UNICODE_SCRIPT_AVESTAN, /* Avst */
+ G_UNICODE_SCRIPT_BAMUM, /* Bamu */
+ G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */
+ G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC, /* Armi */
+ G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */
+ G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */
+ G_UNICODE_SCRIPT_JAVANESE, /* Java */
+ G_UNICODE_SCRIPT_KAITHI, /* Kthi */
+ G_UNICODE_SCRIPT_LISU, /* Lisu */
+ G_UNICODE_SCRIPT_MEETEI_MAYEK, /* Mtei */
+ G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */
+ G_UNICODE_SCRIPT_OLD_TURKIC, /* Orkh */
+ G_UNICODE_SCRIPT_SAMARITAN, /* Samr */
+ G_UNICODE_SCRIPT_TAI_THAM, /* Lana */
+ G_UNICODE_SCRIPT_TAI_VIET, /* Tavt */
+
+ /* Unicode-6.0 additions */
+ G_UNICODE_SCRIPT_BATAK, /* Batk */
+ G_UNICODE_SCRIPT_BRAHMI, /* Brah */
+ G_UNICODE_SCRIPT_MANDAIC, /* Mand */
+
+ /* Unicode-6.1 additions */
+ G_UNICODE_SCRIPT_CHAKMA, /* Cakm */
+ G_UNICODE_SCRIPT_MEROITIC_CURSIVE, /* Merc */
+ G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS, /* Mero */
+ G_UNICODE_SCRIPT_MIAO, /* Plrd */
+ G_UNICODE_SCRIPT_SHARADA, /* Shrd */
+ G_UNICODE_SCRIPT_SORA_SOMPENG, /* Sora */
+ G_UNICODE_SCRIPT_TAKRI, /* Takr */
+
+ /* Unicode 7.0 additions */
+ G_UNICODE_SCRIPT_BASSA_VAH, /* Bass */
+ G_UNICODE_SCRIPT_CAUCASIAN_ALBANIAN, /* Aghb */
+ G_UNICODE_SCRIPT_DUPLOYAN, /* Dupl */
+ G_UNICODE_SCRIPT_ELBASAN, /* Elba */
+ G_UNICODE_SCRIPT_GRANTHA, /* Gran */
+ G_UNICODE_SCRIPT_KHOJKI, /* Khoj */
+ G_UNICODE_SCRIPT_KHUDAWADI, /* Sind */
+ G_UNICODE_SCRIPT_LINEAR_A, /* Lina */
+ G_UNICODE_SCRIPT_MAHAJANI, /* Mahj */
+ G_UNICODE_SCRIPT_MANICHAEAN, /* Mani */
+ G_UNICODE_SCRIPT_MENDE_KIKAKUI, /* Mend */
+ G_UNICODE_SCRIPT_MODI, /* Modi */
+ G_UNICODE_SCRIPT_MRO, /* Mroo */
+ G_UNICODE_SCRIPT_NABATAEAN, /* Nbat */
+ G_UNICODE_SCRIPT_OLD_NORTH_ARABIAN, /* Narb */
+ G_UNICODE_SCRIPT_OLD_PERMIC, /* Perm */
+ G_UNICODE_SCRIPT_PAHAWH_HMONG, /* Hmng */
+ G_UNICODE_SCRIPT_PALMYRENE, /* Palm */
+ G_UNICODE_SCRIPT_PAU_CIN_HAU, /* Pauc */
+ G_UNICODE_SCRIPT_PSALTER_PAHLAVI, /* Phlp */
+ G_UNICODE_SCRIPT_SIDDHAM, /* Sidd */
+ G_UNICODE_SCRIPT_TIRHUTA, /* Tirh */
+ G_UNICODE_SCRIPT_WARANG_CITI, /* Wara */
+
+ /* Unicode 8.0 additions */
+ G_UNICODE_SCRIPT_AHOM, /* Ahom */
+ G_UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS, /* Hluw */
+ G_UNICODE_SCRIPT_HATRAN, /* Hatr */
+ G_UNICODE_SCRIPT_MULTANI, /* Mult */
+ G_UNICODE_SCRIPT_OLD_HUNGARIAN, /* Hung */
+ G_UNICODE_SCRIPT_SIGNWRITING, /* Sgnw */
+
+ /* Unicode 9.0 additions */
+ G_UNICODE_SCRIPT_ADLAM, /* Adlm */
+ G_UNICODE_SCRIPT_BHAIKSUKI, /* Bhks */
+ G_UNICODE_SCRIPT_MARCHEN, /* Marc */
+ G_UNICODE_SCRIPT_NEWA, /* Newa */
+ G_UNICODE_SCRIPT_OSAGE, /* Osge */
+ G_UNICODE_SCRIPT_TANGUT, /* Tang */
+
+ /* Unicode 10.0 additions */
+ G_UNICODE_SCRIPT_MASARAM_GONDI, /* Gonm */
+ G_UNICODE_SCRIPT_NUSHU, /* Nshu */
+ G_UNICODE_SCRIPT_SOYOMBO, /* Soyo */
+ G_UNICODE_SCRIPT_ZANABAZAR_SQUARE, /* Zanb */
+
+ /* Unicode 11.0 additions */
+ G_UNICODE_SCRIPT_DOGRA, /* Dogr */
+ G_UNICODE_SCRIPT_GUNJALA_GONDI, /* Gong */
+ G_UNICODE_SCRIPT_HANIFI_ROHINGYA, /* Rohg */
+ G_UNICODE_SCRIPT_MAKASAR, /* Maka */
+ G_UNICODE_SCRIPT_MEDEFAIDRIN, /* Medf */
+ G_UNICODE_SCRIPT_OLD_SOGDIAN, /* Sogo */
+ G_UNICODE_SCRIPT_SOGDIAN, /* Sogd */
+
+ /* Unicode 12.0 additions */
+ G_UNICODE_SCRIPT_ELYMAIC, /* Elym */
+ G_UNICODE_SCRIPT_NANDINAGARI, /* Nand */
+ G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG, /* Rohg */
+ G_UNICODE_SCRIPT_WANCHO /* Wcho */
+} GUnicodeScript;
+
+GLIB_AVAILABLE_IN_ALL
+guint32 g_unicode_script_to_iso15924 (GUnicodeScript script);
+GLIB_AVAILABLE_IN_ALL
+GUnicodeScript g_unicode_script_from_iso15924 (guint32 iso15924);
+
+/* These are all analogs of the <ctype.h> functions.
+ */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isalnum (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isalpha (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_iscntrl (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isdigit (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isgraph (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_islower (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isprint (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_ispunct (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isspace (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isupper (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isxdigit (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_istitle (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_isdefined (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_iswide (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_iswide_cjk(gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_iszerowidth(gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_ismark (gunichar c) G_GNUC_CONST;
+
+/* More <ctype.h> functions. These convert between the three cases.
+ * See the Unicode book to understand title case. */
+GLIB_AVAILABLE_IN_ALL
+gunichar g_unichar_toupper (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gunichar g_unichar_tolower (gunichar c) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gunichar g_unichar_totitle (gunichar c) G_GNUC_CONST;
+
+/* If C is a digit (according to 'g_unichar_isdigit'), then return its
+ numeric value. Otherwise return -1. */
+GLIB_AVAILABLE_IN_ALL
+gint g_unichar_digit_value (gunichar c) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gint g_unichar_xdigit_value (gunichar c) G_GNUC_CONST;
+
+/* Return the Unicode character type of a given character. */
+GLIB_AVAILABLE_IN_ALL
+GUnicodeType g_unichar_type (gunichar c) G_GNUC_CONST;
+
+/* Return the line break property for a given character */
+GLIB_AVAILABLE_IN_ALL
+GUnicodeBreakType g_unichar_break_type (gunichar c) G_GNUC_CONST;
+
+/* Returns the combining class for a given character */
+GLIB_AVAILABLE_IN_ALL
+gint g_unichar_combining_class (gunichar uc) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_get_mirror_char (gunichar ch,
+ gunichar *mirrored_ch);
+
+GLIB_AVAILABLE_IN_ALL
+GUnicodeScript g_unichar_get_script (gunichar ch) G_GNUC_CONST;
+
+/* Validate a Unicode character */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_validate (gunichar ch) G_GNUC_CONST;
+
+/* Pairwise canonical compose/decompose */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_compose (gunichar a,
+ gunichar b,
+ gunichar *ch);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_unichar_decompose (gunichar ch,
+ gunichar *a,
+ gunichar *b);
+
+GLIB_AVAILABLE_IN_ALL
+gsize g_unichar_fully_decompose (gunichar ch,
+ gboolean compat,
+ gunichar *result,
+ gsize result_len);
+
+/**
+ * G_UNICHAR_MAX_DECOMPOSITION_LENGTH:
+ *
+ * The maximum length (in codepoints) of a compatibility or canonical
+ * decomposition of a single Unicode character.
+ *
+ * This is as defined by Unicode 6.1.
+ *
+ * Since: 2.32
+ */
+#define G_UNICHAR_MAX_DECOMPOSITION_LENGTH 18 /* codepoints */
+
+/* Compute canonical ordering of a string in-place. This rearranges
+ decomposed characters in the string according to their combining
+ classes. See the Unicode manual for more information. */
+GLIB_AVAILABLE_IN_ALL
+void g_unicode_canonical_ordering (gunichar *string,
+ gsize len);
+
+
+GLIB_DEPRECATED_IN_2_30
+gunichar *g_unicode_canonical_decomposition (gunichar ch,
+ gsize *result_len) G_GNUC_MALLOC;
+
+/* Array of skip-bytes-per-initial character.
+ */
+GLIB_VAR const gchar * const g_utf8_skip;
+
+/**
+ * g_utf8_next_char:
+ * @p: Pointer to the start of a valid UTF-8 character
+ *
+ * Skips to the next character in a UTF-8 string. The string must be
+ * valid; this macro is as fast as possible, and has no error-checking.
+ * You would use this macro to iterate over a string character by
+ * character. The macro returns the start of the next UTF-8 character.
+ * Before using this macro, use g_utf8_validate() to validate strings
+ * that may contain invalid UTF-8.
+ */
+#define g_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(const guchar *)(p)])
+
+GLIB_AVAILABLE_IN_ALL
+gunichar g_utf8_get_char (const gchar *p) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gunichar g_utf8_get_char_validated (const gchar *p,
+ gssize max_len) G_GNUC_PURE;
+
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf8_offset_to_pointer (const gchar *str,
+ glong offset) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+glong g_utf8_pointer_to_offset (const gchar *str,
+ const gchar *pos) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf8_prev_char (const gchar *p) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf8_find_next_char (const gchar *p,
+ const gchar *end) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf8_find_prev_char (const gchar *str,
+ const gchar *p) G_GNUC_PURE;
+
+GLIB_AVAILABLE_IN_ALL
+glong g_utf8_strlen (const gchar *p,
+ gssize max) G_GNUC_PURE;
+
+GLIB_AVAILABLE_IN_2_30
+gchar *g_utf8_substring (const gchar *str,
+ glong start_pos,
+ glong end_pos) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_utf8_strncpy (gchar *dest,
+ const gchar *src,
+ gsize n);
+
+/* Find the UTF-8 character corresponding to ch, in string p. These
+ functions are equivalants to strchr and strrchr */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf8_strchr (const gchar *p,
+ gssize len,
+ gunichar c);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf8_strrchr (const gchar *p,
+ gssize len,
+ gunichar c);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf8_strreverse (const gchar *str,
+ gssize len);
+
+GLIB_AVAILABLE_IN_ALL
+gunichar2 *g_utf8_to_utf16 (const gchar *str,
+ glong len,
+ glong *items_read,
+ glong *items_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gunichar * g_utf8_to_ucs4 (const gchar *str,
+ glong len,
+ glong *items_read,
+ glong *items_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gunichar * g_utf8_to_ucs4_fast (const gchar *str,
+ glong len,
+ glong *items_written) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gunichar * g_utf16_to_ucs4 (const gunichar2 *str,
+ glong len,
+ glong *items_read,
+ glong *items_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_utf16_to_utf8 (const gunichar2 *str,
+ glong len,
+ glong *items_read,
+ glong *items_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gunichar2 *g_ucs4_to_utf16 (const gunichar *str,
+ glong len,
+ glong *items_read,
+ glong *items_written,
+ GError **error) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar* g_ucs4_to_utf8 (const gunichar *str,
+ glong len,
+ glong *items_read,
+ glong *items_written,
+ GError **error) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gint g_unichar_to_utf8 (gunichar c,
+ gchar *outbuf);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_utf8_validate (const gchar *str,
+ gssize max_len,
+ const gchar **end);
+GLIB_AVAILABLE_IN_2_60
+gboolean g_utf8_validate_len (const gchar *str,
+ gsize max_len,
+ const gchar **end);
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_utf8_strup (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_utf8_strdown (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_utf8_casefold (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+
+/**
+ * GNormalizeMode:
+ * @G_NORMALIZE_DEFAULT: standardize differences that do not affect the
+ * text content, such as the above-mentioned accent representation
+ * @G_NORMALIZE_NFD: another name for %G_NORMALIZE_DEFAULT
+ * @G_NORMALIZE_DEFAULT_COMPOSE: like %G_NORMALIZE_DEFAULT, but with
+ * composed forms rather than a maximally decomposed form
+ * @G_NORMALIZE_NFC: another name for %G_NORMALIZE_DEFAULT_COMPOSE
+ * @G_NORMALIZE_ALL: beyond %G_NORMALIZE_DEFAULT also standardize the
+ * "compatibility" characters in Unicode, such as SUPERSCRIPT THREE
+ * to the standard forms (in this case DIGIT THREE). Formatting
+ * information may be lost but for most text operations such
+ * characters should be considered the same
+ * @G_NORMALIZE_NFKD: another name for %G_NORMALIZE_ALL
+ * @G_NORMALIZE_ALL_COMPOSE: like %G_NORMALIZE_ALL, but with composed
+ * forms rather than a maximally decomposed form
+ * @G_NORMALIZE_NFKC: another name for %G_NORMALIZE_ALL_COMPOSE
+ *
+ * Defines how a Unicode string is transformed in a canonical
+ * form, standardizing such issues as whether a character with
+ * an accent is represented as a base character and combining
+ * accent or as a single precomposed character. Unicode strings
+ * should generally be normalized before comparing them.
+ */
+typedef enum {
+ G_NORMALIZE_DEFAULT,
+ G_NORMALIZE_NFD = G_NORMALIZE_DEFAULT,
+ G_NORMALIZE_DEFAULT_COMPOSE,
+ G_NORMALIZE_NFC = G_NORMALIZE_DEFAULT_COMPOSE,
+ G_NORMALIZE_ALL,
+ G_NORMALIZE_NFKD = G_NORMALIZE_ALL,
+ G_NORMALIZE_ALL_COMPOSE,
+ G_NORMALIZE_NFKC = G_NORMALIZE_ALL_COMPOSE
+} GNormalizeMode;
+
+GLIB_AVAILABLE_IN_ALL
+gchar *g_utf8_normalize (const gchar *str,
+ gssize len,
+ GNormalizeMode mode) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_ALL
+gint g_utf8_collate (const gchar *str1,
+ const gchar *str2) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_utf8_collate_key (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+GLIB_AVAILABLE_IN_ALL
+gchar *g_utf8_collate_key_for_filename (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+
+GLIB_AVAILABLE_IN_2_52
+gchar *g_utf8_make_valid (const gchar *str,
+ gssize len) G_GNUC_MALLOC;
+
+G_END_DECLS
+
+#endif /* __G_UNICODE_H__ */
diff --git a/include/glib/glib/gurifuncs.h b/include/glib/glib/gurifuncs.h
new file mode 100644
index 0000000000..e59a43c877
--- /dev/null
+++ b/include/glib/glib/gurifuncs.h
@@ -0,0 +1,83 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2006-2007 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Alexander Larsson <alexl@redhat.com>
+ */
+
+#ifndef __G_URI_FUNCS_H__
+#define __G_URI_FUNCS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_URI_RESERVED_CHARS_GENERIC_DELIMITERS:
+ *
+ * Generic delimiters characters as defined in RFC 3986. Includes ":/?#[]@".
+ **/
+#define G_URI_RESERVED_CHARS_GENERIC_DELIMITERS ":/?#[]@"
+
+/**
+ * G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS:
+ *
+ * Subcomponent delimiter characters as defined in RFC 3986. Includes "!$&'()*+,;=".
+ **/
+#define G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS "!$&'()*+,;="
+
+/**
+ * G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT:
+ *
+ * Allowed characters in path elements. Includes "!$&'()*+,;=:@".
+ **/
+#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":@"
+
+/**
+ * G_URI_RESERVED_CHARS_ALLOWED_IN_PATH:
+ *
+ * Allowed characters in a path. Includes "!$&'()*+,;=:@/".
+ **/
+#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT "/"
+
+/**
+ * G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO:
+ *
+ * Allowed characters in userinfo as defined in RFC 3986. Includes "!$&'()*+,;=:".
+ **/
+#define G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":"
+
+GLIB_AVAILABLE_IN_ALL
+char * g_uri_unescape_string (const char *escaped_string,
+ const char *illegal_characters);
+GLIB_AVAILABLE_IN_ALL
+char * g_uri_unescape_segment (const char *escaped_string,
+ const char *escaped_string_end,
+ const char *illegal_characters);
+GLIB_AVAILABLE_IN_ALL
+char * g_uri_parse_scheme (const char *uri);
+GLIB_AVAILABLE_IN_ALL
+char * g_uri_escape_string (const char *unescaped,
+ const char *reserved_chars_allowed,
+ gboolean allow_utf8);
+
+G_END_DECLS
+
+#endif /* __G_URI_FUNCS_H__ */
diff --git a/include/glib/glib/gutils.h b/include/glib/glib/gutils.h
new file mode 100644
index 0000000000..560a84e3ac
--- /dev/null
+++ b/include/glib/glib/gutils.h
@@ -0,0 +1,364 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_UTILS_H__
+#define __G_UTILS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+#include <stdarg.h>
+
+G_BEGIN_DECLS
+
+/* Define G_VA_COPY() to do the right thing for copying va_list variables.
+ * glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy.
+ */
+#if !defined (G_VA_COPY)
+# if defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
+# define G_VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
+# elif defined (G_VA_COPY_AS_ARRAY)
+# define G_VA_COPY(ap1, ap2) memmove ((ap1), (ap2), sizeof (va_list))
+# else /* va_list is a pointer */
+# define G_VA_COPY(ap1, ap2) ((ap1) = (ap2))
+# endif /* va_list is a pointer */
+#endif /* !G_VA_COPY */
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_user_name (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_real_name (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_home_dir (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_tmp_dir (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_host_name (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_prgname (void);
+GLIB_AVAILABLE_IN_ALL
+void g_set_prgname (const gchar *prgname);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_application_name (void);
+GLIB_AVAILABLE_IN_ALL
+void g_set_application_name (const gchar *application_name);
+
+GLIB_AVAILABLE_IN_ALL
+void g_reload_user_special_dirs_cache (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_user_data_dir (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_user_config_dir (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_user_cache_dir (void);
+GLIB_AVAILABLE_IN_ALL
+const gchar * const * g_get_system_data_dirs (void);
+
+#ifdef G_OS_WIN32
+/* This function is not part of the public GLib API */
+GLIB_AVAILABLE_IN_ALL
+const gchar * const * g_win32_get_system_data_dirs_for_module (void (*address_of_function)(void));
+#endif
+
+#if defined (G_OS_WIN32) && defined (G_CAN_INLINE)
+/* This function is not part of the public GLib API either. Just call
+ * g_get_system_data_dirs() in your code, never mind that that is
+ * actually a macro and you will in fact call this inline function.
+ */
+static inline const gchar * const *
+_g_win32_get_system_data_dirs (void)
+{
+ return g_win32_get_system_data_dirs_for_module ((void (*)(void)) &_g_win32_get_system_data_dirs);
+}
+#define g_get_system_data_dirs _g_win32_get_system_data_dirs
+#endif
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * const * g_get_system_config_dirs (void);
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_user_runtime_dir (void);
+
+/**
+ * GUserDirectory:
+ * @G_USER_DIRECTORY_DESKTOP: the user's Desktop directory
+ * @G_USER_DIRECTORY_DOCUMENTS: the user's Documents directory
+ * @G_USER_DIRECTORY_DOWNLOAD: the user's Downloads directory
+ * @G_USER_DIRECTORY_MUSIC: the user's Music directory
+ * @G_USER_DIRECTORY_PICTURES: the user's Pictures directory
+ * @G_USER_DIRECTORY_PUBLIC_SHARE: the user's shared directory
+ * @G_USER_DIRECTORY_TEMPLATES: the user's Templates directory
+ * @G_USER_DIRECTORY_VIDEOS: the user's Movies directory
+ * @G_USER_N_DIRECTORIES: the number of enum values
+ *
+ * These are logical ids for special directories which are defined
+ * depending on the platform used. You should use g_get_user_special_dir()
+ * to retrieve the full path associated to the logical id.
+ *
+ * The #GUserDirectory enumeration can be extended at later date. Not
+ * every platform has a directory for every logical id in this
+ * enumeration.
+ *
+ * Since: 2.14
+ */
+typedef enum {
+ G_USER_DIRECTORY_DESKTOP,
+ G_USER_DIRECTORY_DOCUMENTS,
+ G_USER_DIRECTORY_DOWNLOAD,
+ G_USER_DIRECTORY_MUSIC,
+ G_USER_DIRECTORY_PICTURES,
+ G_USER_DIRECTORY_PUBLIC_SHARE,
+ G_USER_DIRECTORY_TEMPLATES,
+ G_USER_DIRECTORY_VIDEOS,
+
+ G_USER_N_DIRECTORIES
+} GUserDirectory;
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_get_user_special_dir (GUserDirectory directory);
+
+/**
+ * GDebugKey:
+ * @key: the string
+ * @value: the flag
+ *
+ * Associates a string with a bit flag.
+ * Used in g_parse_debug_string().
+ */
+typedef struct _GDebugKey GDebugKey;
+struct _GDebugKey
+{
+ const gchar *key;
+ guint value;
+};
+
+/* Miscellaneous utility functions
+ */
+GLIB_AVAILABLE_IN_ALL
+guint g_parse_debug_string (const gchar *string,
+ const GDebugKey *keys,
+ guint nkeys);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_snprintf (gchar *string,
+ gulong n,
+ gchar const *format,
+ ...) G_GNUC_PRINTF (3, 4);
+GLIB_AVAILABLE_IN_ALL
+gint g_vsnprintf (gchar *string,
+ gulong n,
+ gchar const *format,
+ va_list args)
+ G_GNUC_PRINTF(3, 0);
+
+GLIB_AVAILABLE_IN_ALL
+void g_nullify_pointer (gpointer *nullify_location);
+
+typedef enum
+{
+ G_FORMAT_SIZE_DEFAULT = 0,
+ G_FORMAT_SIZE_LONG_FORMAT = 1 << 0,
+ G_FORMAT_SIZE_IEC_UNITS = 1 << 1,
+ G_FORMAT_SIZE_BITS = 1 << 2
+} GFormatSizeFlags;
+
+GLIB_AVAILABLE_IN_2_30
+gchar *g_format_size_full (guint64 size,
+ GFormatSizeFlags flags);
+GLIB_AVAILABLE_IN_2_30
+gchar *g_format_size (guint64 size);
+
+GLIB_DEPRECATED_IN_2_30_FOR(g_format_size)
+gchar *g_format_size_for_display (goffset size);
+
+#define g_ATEXIT(proc) (atexit (proc)) GLIB_DEPRECATED_MACRO_IN_2_32
+#define g_memmove(dest,src,len) \
+ G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_40_FOR(memmove)
+
+/**
+ * GVoidFunc:
+ *
+ * Declares a type of function which takes no arguments
+ * and has no return value. It is used to specify the type
+ * function passed to g_atexit().
+ */
+typedef void (*GVoidFunc) (void) GLIB_DEPRECATED_TYPE_IN_2_32;
+#define ATEXIT(proc) g_ATEXIT(proc) GLIB_DEPRECATED_MACRO_IN_2_32
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED
+void g_atexit (GVoidFunc func);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+#ifdef G_OS_WIN32
+/* It's a bad idea to wrap atexit() on Windows. If the GLib DLL calls
+ * atexit(), the function will be called when the GLib DLL is detached
+ * from the program, which is not what the caller wants. The caller
+ * wants the function to be called when it *itself* exits (or is
+ * detached, in case the caller, too, is a DLL).
+ */
+#if (defined(__MINGW_H) && !defined(_STDLIB_H_)) || (defined(_MSC_VER) && !defined(_INC_STDLIB))
+int atexit (void (*)(void));
+#endif
+#define g_atexit(func) atexit(func) GLIB_DEPRECATED_MACRO_IN_2_32
+#endif
+
+
+/* Look for an executable in PATH, following execvp() rules */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_find_program_in_path (const gchar *program);
+
+/* Bit tests
+ *
+ * These are defined in a convoluted way because we want the compiler to
+ * be able to inline the code for performance reasons, but for
+ * historical reasons, we must continue to provide non-inline versions
+ * on our ABI.
+ *
+ * We define these as functions in gutils.c which are just implemented
+ * as calls to the _impl() versions in order to preserve the ABI.
+ */
+
+#define g_bit_nth_lsf(mask, nth_bit) g_bit_nth_lsf_impl(mask, nth_bit)
+#define g_bit_nth_msf(mask, nth_bit) g_bit_nth_msf_impl(mask, nth_bit)
+#define g_bit_storage(number) g_bit_storage_impl(number)
+
+GLIB_AVAILABLE_IN_ALL
+gint (g_bit_nth_lsf) (gulong mask,
+ gint nth_bit);
+GLIB_AVAILABLE_IN_ALL
+gint (g_bit_nth_msf) (gulong mask,
+ gint nth_bit);
+GLIB_AVAILABLE_IN_ALL
+guint (g_bit_storage) (gulong number);
+
+static inline gint
+g_bit_nth_lsf_impl (gulong mask,
+ gint nth_bit)
+{
+ if (G_UNLIKELY (nth_bit < -1))
+ nth_bit = -1;
+ while (nth_bit < ((GLIB_SIZEOF_LONG * 8) - 1))
+ {
+ nth_bit++;
+ if (mask & (1UL << nth_bit))
+ return nth_bit;
+ }
+ return -1;
+}
+
+static inline gint
+g_bit_nth_msf_impl (gulong mask,
+ gint nth_bit)
+{
+ if (nth_bit < 0 || G_UNLIKELY (nth_bit > GLIB_SIZEOF_LONG * 8))
+ nth_bit = GLIB_SIZEOF_LONG * 8;
+ while (nth_bit > 0)
+ {
+ nth_bit--;
+ if (mask & (1UL << nth_bit))
+ return nth_bit;
+ }
+ return -1;
+}
+
+static inline guint
+g_bit_storage_impl (gulong number)
+{
+#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
+ return G_LIKELY (number) ?
+ ((GLIB_SIZEOF_LONG * 8U - 1) ^ (guint) __builtin_clzl(number)) + 1 : 1;
+#else
+ guint n_bits = 0;
+
+ do
+ {
+ n_bits++;
+ number >>= 1;
+ }
+ while (number);
+ return n_bits;
+#endif
+}
+
+/* Crashes the program. */
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_50
+#ifndef G_OS_WIN32
+# include <stdlib.h>
+# define g_abort() abort ()
+#else
+GLIB_AVAILABLE_IN_2_50
+void g_abort (void) G_GNUC_NORETURN G_ANALYZER_NORETURN;
+#endif
+#endif
+
+/*
+ * This macro is deprecated. This DllMain() is too complex. It is
+ * recommended to write an explicit minimal DLlMain() that just saves
+ * the handle to the DLL and then use that handle instead, for
+ * instance passing it to
+ * g_win32_get_package_installation_directory_of_module().
+ *
+ * On Windows, this macro defines a DllMain function that stores the
+ * actual DLL name that the code being compiled will be included in.
+ * STATIC should be empty or 'static'. DLL_NAME is the name of the
+ * (pointer to the) char array where the DLL name will be stored. If
+ * this is used, you must also include <windows.h>. If you need a more complex
+ * DLL entry point function, you cannot use this.
+ *
+ * On non-Windows platforms, expands to nothing.
+ */
+
+#ifndef G_PLATFORM_WIN32
+# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) GLIB_DEPRECATED_MACRO_IN_2_26
+#else
+# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) \
+static char *dll_name; \
+ \
+BOOL WINAPI \
+DllMain (HINSTANCE hinstDLL, \
+ DWORD fdwReason, \
+ LPVOID lpvReserved) \
+{ \
+ wchar_t wcbfr[1000]; \
+ char *tem; \
+ switch (fdwReason) \
+ { \
+ case DLL_PROCESS_ATTACH: \
+ GetModuleFileNameW ((HMODULE) hinstDLL, wcbfr, G_N_ELEMENTS (wcbfr)); \
+ tem = g_utf16_to_utf8 (wcbfr, -1, NULL, NULL, NULL); \
+ dll_name = g_path_get_basename (tem); \
+ g_free (tem); \
+ break; \
+ } \
+ \
+ return TRUE; \
+} GLIB_DEPRECATED_MACRO_IN_2_26
+#endif /* G_PLATFORM_WIN32 */
+
+G_END_DECLS
+
+#endif /* __G_UTILS_H__ */
diff --git a/include/glib/glib/guuid.h b/include/glib/glib/guuid.h
new file mode 100644
index 0000000000..c653188a0e
--- /dev/null
+++ b/include/glib/glib/guuid.h
@@ -0,0 +1,42 @@
+/* guuid.h - UUID functions
+ *
+ * Copyright (C) 2013-2015, 2017 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * licence, or (at your option) any later version.
+ *
+ * This is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA.
+ *
+ * Authors: Marc-André Lureau <marcandre.lureau@redhat.com>
+ */
+
+#ifndef __G_UUID_H__
+#define __G_UUID_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_2_52
+gboolean g_uuid_string_is_valid (const gchar *str);
+
+GLIB_AVAILABLE_IN_2_52
+gchar * g_uuid_string_random (void);
+
+G_END_DECLS
+
+#endif /* __G_UUID_H__ */
diff --git a/include/glib/glib/gvariant.h b/include/glib/glib/gvariant.h
new file mode 100644
index 0000000000..99e2470e90
--- /dev/null
+++ b/include/glib/glib/gvariant.h
@@ -0,0 +1,521 @@
+/*
+ * Copyright © 2007, 2008 Ryan Lortie
+ * Copyright © 2009, 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_VARIANT_H__
+#define __G_VARIANT_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gvarianttype.h>
+#include <glib/gstring.h>
+#include <glib/gbytes.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GVariant GVariant;
+
+typedef enum
+{
+ G_VARIANT_CLASS_BOOLEAN = 'b',
+ G_VARIANT_CLASS_BYTE = 'y',
+ G_VARIANT_CLASS_INT16 = 'n',
+ G_VARIANT_CLASS_UINT16 = 'q',
+ G_VARIANT_CLASS_INT32 = 'i',
+ G_VARIANT_CLASS_UINT32 = 'u',
+ G_VARIANT_CLASS_INT64 = 'x',
+ G_VARIANT_CLASS_UINT64 = 't',
+ G_VARIANT_CLASS_HANDLE = 'h',
+ G_VARIANT_CLASS_DOUBLE = 'd',
+ G_VARIANT_CLASS_STRING = 's',
+ G_VARIANT_CLASS_OBJECT_PATH = 'o',
+ G_VARIANT_CLASS_SIGNATURE = 'g',
+ G_VARIANT_CLASS_VARIANT = 'v',
+ G_VARIANT_CLASS_MAYBE = 'm',
+ G_VARIANT_CLASS_ARRAY = 'a',
+ G_VARIANT_CLASS_TUPLE = '(',
+ G_VARIANT_CLASS_DICT_ENTRY = '{'
+} GVariantClass;
+
+GLIB_AVAILABLE_IN_ALL
+void g_variant_unref (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_ref (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_ref_sink (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_is_floating (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_take_ref (GVariant *value);
+
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_variant_get_type (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_variant_get_type_string (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_is_of_type (GVariant *value,
+ const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_is_container (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariantClass g_variant_classify (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_boolean (gboolean value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_byte (guint8 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_int16 (gint16 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_uint16 (guint16 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_int32 (gint32 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_uint32 (guint32 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_int64 (gint64 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_uint64 (guint64 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_handle (gint32 value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_double (gdouble value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_string (const gchar *string);
+GLIB_AVAILABLE_IN_2_38
+GVariant * g_variant_new_take_string (gchar *string);
+GLIB_AVAILABLE_IN_2_38
+GVariant * g_variant_new_printf (const gchar *format_string,
+ ...) G_GNUC_PRINTF (1, 2);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_object_path (const gchar *object_path);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_is_object_path (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_signature (const gchar *signature);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_is_signature (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_variant (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_strv (const gchar * const *strv,
+ gssize length);
+GLIB_AVAILABLE_IN_2_30
+GVariant * g_variant_new_objv (const gchar * const *strv,
+ gssize length);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_bytestring (const gchar *string);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_bytestring_array (const gchar * const *strv,
+ gssize length);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_fixed_array (const GVariantType *element_type,
+ gconstpointer elements,
+ gsize n_elements,
+ gsize element_size);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_get_boolean (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+guint8 g_variant_get_byte (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gint16 g_variant_get_int16 (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+guint16 g_variant_get_uint16 (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_variant_get_int32 (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+guint32 g_variant_get_uint32 (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gint64 g_variant_get_int64 (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+guint64 g_variant_get_uint64 (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gint32 g_variant_get_handle (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_variant_get_double (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_get_variant (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_variant_get_string (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_variant_dup_string (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+const gchar ** g_variant_get_strv (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_variant_dup_strv (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_2_30
+const gchar ** g_variant_get_objv (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_variant_dup_objv (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_variant_get_bytestring (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_variant_dup_bytestring (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+const gchar ** g_variant_get_bytestring_array (GVariant *value,
+ gsize *length);
+GLIB_AVAILABLE_IN_ALL
+gchar ** g_variant_dup_bytestring_array (GVariant *value,
+ gsize *length);
+
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_maybe (const GVariantType *child_type,
+ GVariant *child);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_array (const GVariantType *child_type,
+ GVariant * const *children,
+ gsize n_children);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_tuple (GVariant * const *children,
+ gsize n_children);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_dict_entry (GVariant *key,
+ GVariant *value);
+
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_get_maybe (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gsize g_variant_n_children (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_get_child (GVariant *value,
+ gsize index_,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_get_child_value (GVariant *value,
+ gsize index_);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_lookup (GVariant *dictionary,
+ const gchar *key,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_lookup_value (GVariant *dictionary,
+ const gchar *key,
+ const GVariantType *expected_type);
+GLIB_AVAILABLE_IN_ALL
+gconstpointer g_variant_get_fixed_array (GVariant *value,
+ gsize *n_elements,
+ gsize element_size);
+
+GLIB_AVAILABLE_IN_ALL
+gsize g_variant_get_size (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gconstpointer g_variant_get_data (GVariant *value);
+GLIB_AVAILABLE_IN_2_36
+GBytes * g_variant_get_data_as_bytes (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_store (GVariant *value,
+ gpointer data);
+
+GLIB_AVAILABLE_IN_ALL
+gchar * g_variant_print (GVariant *value,
+ gboolean type_annotate);
+GLIB_AVAILABLE_IN_ALL
+GString * g_variant_print_string (GVariant *value,
+ GString *string,
+ gboolean type_annotate);
+
+GLIB_AVAILABLE_IN_ALL
+guint g_variant_hash (gconstpointer value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_equal (gconstpointer one,
+ gconstpointer two);
+
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_get_normal_form (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_is_normal_form (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_byteswap (GVariant *value);
+
+GLIB_AVAILABLE_IN_2_36
+GVariant * g_variant_new_from_bytes (const GVariantType *type,
+ GBytes *bytes,
+ gboolean trusted);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_from_data (const GVariantType *type,
+ gconstpointer data,
+ gsize size,
+ gboolean trusted,
+ GDestroyNotify notify,
+ gpointer user_data);
+
+typedef struct _GVariantIter GVariantIter;
+struct _GVariantIter {
+ /*< private >*/
+ gsize x[16];
+};
+
+GLIB_AVAILABLE_IN_ALL
+GVariantIter * g_variant_iter_new (GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+gsize g_variant_iter_init (GVariantIter *iter,
+ GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+GVariantIter * g_variant_iter_copy (GVariantIter *iter);
+GLIB_AVAILABLE_IN_ALL
+gsize g_variant_iter_n_children (GVariantIter *iter);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_iter_free (GVariantIter *iter);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_iter_next_value (GVariantIter *iter);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_iter_next (GVariantIter *iter,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_iter_loop (GVariantIter *iter,
+ const gchar *format_string,
+ ...);
+
+
+typedef struct _GVariantBuilder GVariantBuilder;
+struct _GVariantBuilder {
+ /*< private >*/
+ union
+ {
+ struct {
+ gsize partial_magic;
+ const GVariantType *type;
+ gsize y[14];
+ } s;
+ gsize x[16];
+ } u;
+};
+
+typedef enum
+{
+ G_VARIANT_PARSE_ERROR_FAILED,
+ G_VARIANT_PARSE_ERROR_BASIC_TYPE_EXPECTED,
+ G_VARIANT_PARSE_ERROR_CANNOT_INFER_TYPE,
+ G_VARIANT_PARSE_ERROR_DEFINITE_TYPE_EXPECTED,
+ G_VARIANT_PARSE_ERROR_INPUT_NOT_AT_END,
+ G_VARIANT_PARSE_ERROR_INVALID_CHARACTER,
+ G_VARIANT_PARSE_ERROR_INVALID_FORMAT_STRING,
+ G_VARIANT_PARSE_ERROR_INVALID_OBJECT_PATH,
+ G_VARIANT_PARSE_ERROR_INVALID_SIGNATURE,
+ G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRING,
+ G_VARIANT_PARSE_ERROR_NO_COMMON_TYPE,
+ G_VARIANT_PARSE_ERROR_NUMBER_OUT_OF_RANGE,
+ G_VARIANT_PARSE_ERROR_NUMBER_TOO_BIG,
+ G_VARIANT_PARSE_ERROR_TYPE_ERROR,
+ G_VARIANT_PARSE_ERROR_UNEXPECTED_TOKEN,
+ G_VARIANT_PARSE_ERROR_UNKNOWN_KEYWORD,
+ G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT,
+ G_VARIANT_PARSE_ERROR_VALUE_EXPECTED
+} GVariantParseError;
+#define G_VARIANT_PARSE_ERROR (g_variant_parse_error_quark ())
+
+GLIB_DEPRECATED_IN_2_38_FOR(g_variant_parse_error_quark)
+GQuark g_variant_parser_get_error_quark (void);
+
+GLIB_AVAILABLE_IN_ALL
+GQuark g_variant_parse_error_quark (void);
+
+/**
+ * G_VARIANT_BUILDER_INIT:
+ * @variant_type: a const GVariantType*
+ *
+ * A stack-allocated #GVariantBuilder must be initialized if it is
+ * used together with g_auto() to avoid warnings or crashes if
+ * function returns before g_variant_builder_init() is called on the
+ * builder. This macro can be used as initializer instead of an
+ * explicit zeroing a variable when declaring it and a following
+ * g_variant_builder_init(), but it cannot be assigned to a variable.
+ *
+ * The passed @variant_type should be a static GVariantType to avoid
+ * lifetime issues, as copying the @variant_type does not happen in
+ * the G_VARIANT_BUILDER_INIT() call, but rather in functions that
+ * make sure that #GVariantBuilder is valid.
+ *
+ * |[
+ * g_auto(GVariantBuilder) builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_BYTESTRING);
+ * ]|
+ *
+ * Since: 2.50
+ */
+#define G_VARIANT_BUILDER_INIT(variant_type) { { { 2942751021u, variant_type, { 0, } } } }
+
+GLIB_AVAILABLE_IN_ALL
+GVariantBuilder * g_variant_builder_new (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_unref (GVariantBuilder *builder);
+GLIB_AVAILABLE_IN_ALL
+GVariantBuilder * g_variant_builder_ref (GVariantBuilder *builder);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_init (GVariantBuilder *builder,
+ const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_builder_end (GVariantBuilder *builder);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_clear (GVariantBuilder *builder);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_open (GVariantBuilder *builder,
+ const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_close (GVariantBuilder *builder);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_add_value (GVariantBuilder *builder,
+ GVariant *value);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_add (GVariantBuilder *builder,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_builder_add_parsed (GVariantBuilder *builder,
+ const gchar *format,
+ ...);
+
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new (const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_get (GVariant *value,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_va (const gchar *format_string,
+ const gchar **endptr,
+ va_list *app);
+GLIB_AVAILABLE_IN_ALL
+void g_variant_get_va (GVariant *value,
+ const gchar *format_string,
+ const gchar **endptr,
+ va_list *app);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_variant_check_format_string (GVariant *value,
+ const gchar *format_string,
+ gboolean copy_only);
+
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_parse (const GVariantType *type,
+ const gchar *text,
+ const gchar *limit,
+ const gchar **endptr,
+ GError **error);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_parsed (const gchar *format,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+GVariant * g_variant_new_parsed_va (const gchar *format,
+ va_list *app);
+
+GLIB_AVAILABLE_IN_2_40
+gchar * g_variant_parse_error_print_context (GError *error,
+ const gchar *source_str);
+
+GLIB_AVAILABLE_IN_ALL
+gint g_variant_compare (gconstpointer one,
+ gconstpointer two);
+
+typedef struct _GVariantDict GVariantDict;
+struct _GVariantDict {
+ /*< private >*/
+ union
+ {
+ struct {
+ GVariant *asv;
+ gsize partial_magic;
+ gsize y[14];
+ } s;
+ gsize x[16];
+ } u;
+};
+
+/**
+ * G_VARIANT_DICT_INIT:
+ * @asv: (nullable): a GVariant*
+ *
+ * A stack-allocated #GVariantDict must be initialized if it is used
+ * together with g_auto() to avoid warnings or crashes if function
+ * returns before g_variant_dict_init() is called on the builder.
+ * This macro can be used as initializer instead of an explicit
+ * zeroing a variable when declaring it and a following
+ * g_variant_dict_init(), but it cannot be assigned to a variable.
+ *
+ * The passed @asv has to live long enough for #GVariantDict to gather
+ * the entries from, as the gathering does not happen in the
+ * G_VARIANT_DICT_INIT() call, but rather in functions that make sure
+ * that #GVariantDict is valid. In context where the initialization
+ * value has to be a constant expression, the only possible value of
+ * @asv is %NULL. It is still possible to call g_variant_dict_init()
+ * safely with a different @asv right after the variable was
+ * initialized with G_VARIANT_DICT_INIT().
+ *
+ * |[
+ * g_autoptr(GVariant) variant = get_asv_variant ();
+ * g_auto(GVariantDict) dict = G_VARIANT_DICT_INIT (variant);
+ * ]|
+ *
+ * Since: 2.50
+ */
+#define G_VARIANT_DICT_INIT(asv) { { { asv, 3488698669u, { 0, } } } }
+
+GLIB_AVAILABLE_IN_2_40
+GVariantDict * g_variant_dict_new (GVariant *from_asv);
+
+GLIB_AVAILABLE_IN_2_40
+void g_variant_dict_init (GVariantDict *dict,
+ GVariant *from_asv);
+
+GLIB_AVAILABLE_IN_2_40
+gboolean g_variant_dict_lookup (GVariantDict *dict,
+ const gchar *key,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_2_40
+GVariant * g_variant_dict_lookup_value (GVariantDict *dict,
+ const gchar *key,
+ const GVariantType *expected_type);
+GLIB_AVAILABLE_IN_2_40
+gboolean g_variant_dict_contains (GVariantDict *dict,
+ const gchar *key);
+GLIB_AVAILABLE_IN_2_40
+void g_variant_dict_insert (GVariantDict *dict,
+ const gchar *key,
+ const gchar *format_string,
+ ...);
+GLIB_AVAILABLE_IN_2_40
+void g_variant_dict_insert_value (GVariantDict *dict,
+ const gchar *key,
+ GVariant *value);
+GLIB_AVAILABLE_IN_2_40
+gboolean g_variant_dict_remove (GVariantDict *dict,
+ const gchar *key);
+GLIB_AVAILABLE_IN_2_40
+void g_variant_dict_clear (GVariantDict *dict);
+GLIB_AVAILABLE_IN_2_40
+GVariant * g_variant_dict_end (GVariantDict *dict);
+GLIB_AVAILABLE_IN_2_40
+GVariantDict * g_variant_dict_ref (GVariantDict *dict);
+GLIB_AVAILABLE_IN_2_40
+void g_variant_dict_unref (GVariantDict *dict);
+
+G_END_DECLS
+
+#endif /* __G_VARIANT_H__ */
diff --git a/include/glib/glib/gvarianttype.h b/include/glib/glib/gvarianttype.h
new file mode 100644
index 0000000000..fdc3641660
--- /dev/null
+++ b/include/glib/glib/gvarianttype.h
@@ -0,0 +1,382 @@
+/*
+ * Copyright © 2007, 2008 Ryan Lortie
+ * Copyright © 2009, 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_VARIANT_TYPE_H__
+#define __G_VARIANT_TYPE_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GVariantType:
+ *
+ * A type in the GVariant type system.
+ *
+ * Two types may not be compared by value; use g_variant_type_equal() or
+ * g_variant_type_is_subtype_of(). May be copied using
+ * g_variant_type_copy() and freed using g_variant_type_free().
+ **/
+typedef struct _GVariantType GVariantType;
+
+/**
+ * G_VARIANT_TYPE_BOOLEAN:
+ *
+ * The type of a value that can be either %TRUE or %FALSE.
+ **/
+#define G_VARIANT_TYPE_BOOLEAN ((const GVariantType *) "b")
+
+/**
+ * G_VARIANT_TYPE_BYTE:
+ *
+ * The type of an integer value that can range from 0 to 255.
+ **/
+#define G_VARIANT_TYPE_BYTE ((const GVariantType *) "y")
+
+/**
+ * G_VARIANT_TYPE_INT16:
+ *
+ * The type of an integer value that can range from -32768 to 32767.
+ **/
+#define G_VARIANT_TYPE_INT16 ((const GVariantType *) "n")
+
+/**
+ * G_VARIANT_TYPE_UINT16:
+ *
+ * The type of an integer value that can range from 0 to 65535.
+ * There were about this many people living in Toronto in the 1870s.
+ **/
+#define G_VARIANT_TYPE_UINT16 ((const GVariantType *) "q")
+
+/**
+ * G_VARIANT_TYPE_INT32:
+ *
+ * The type of an integer value that can range from -2147483648 to
+ * 2147483647.
+ **/
+#define G_VARIANT_TYPE_INT32 ((const GVariantType *) "i")
+
+/**
+ * G_VARIANT_TYPE_UINT32:
+ *
+ * The type of an integer value that can range from 0 to 4294967295.
+ * That's one number for everyone who was around in the late 1970s.
+ **/
+#define G_VARIANT_TYPE_UINT32 ((const GVariantType *) "u")
+
+/**
+ * G_VARIANT_TYPE_INT64:
+ *
+ * The type of an integer value that can range from
+ * -9223372036854775808 to 9223372036854775807.
+ **/
+#define G_VARIANT_TYPE_INT64 ((const GVariantType *) "x")
+
+/**
+ * G_VARIANT_TYPE_UINT64:
+ *
+ * The type of an integer value that can range from 0
+ * to 18446744073709551615 (inclusive). That's a really big number,
+ * but a Rubik's cube can have a bit more than twice as many possible
+ * positions.
+ **/
+#define G_VARIANT_TYPE_UINT64 ((const GVariantType *) "t")
+
+/**
+ * G_VARIANT_TYPE_DOUBLE:
+ *
+ * The type of a double precision IEEE754 floating point number.
+ * These guys go up to about 1.80e308 (plus and minus) but miss out on
+ * some numbers in between. In any case, that's far greater than the
+ * estimated number of fundamental particles in the observable
+ * universe.
+ **/
+#define G_VARIANT_TYPE_DOUBLE ((const GVariantType *) "d")
+
+/**
+ * G_VARIANT_TYPE_STRING:
+ *
+ * The type of a string. "" is a string. %NULL is not a string.
+ **/
+#define G_VARIANT_TYPE_STRING ((const GVariantType *) "s")
+
+/**
+ * G_VARIANT_TYPE_OBJECT_PATH:
+ *
+ * The type of a D-Bus object reference. These are strings of a
+ * specific format used to identify objects at a given destination on
+ * the bus.
+ *
+ * If you are not interacting with D-Bus, then there is no reason to make
+ * use of this type. If you are, then the D-Bus specification contains a
+ * precise description of valid object paths.
+ **/
+#define G_VARIANT_TYPE_OBJECT_PATH ((const GVariantType *) "o")
+
+/**
+ * G_VARIANT_TYPE_SIGNATURE:
+ *
+ * The type of a D-Bus type signature. These are strings of a specific
+ * format used as type signatures for D-Bus methods and messages.
+ *
+ * If you are not interacting with D-Bus, then there is no reason to make
+ * use of this type. If you are, then the D-Bus specification contains a
+ * precise description of valid signature strings.
+ **/
+#define G_VARIANT_TYPE_SIGNATURE ((const GVariantType *) "g")
+
+/**
+ * G_VARIANT_TYPE_VARIANT:
+ *
+ * The type of a box that contains any other value (including another
+ * variant).
+ **/
+#define G_VARIANT_TYPE_VARIANT ((const GVariantType *) "v")
+
+/**
+ * G_VARIANT_TYPE_HANDLE:
+ *
+ * The type of a 32bit signed integer value, that by convention, is used
+ * as an index into an array of file descriptors that are sent alongside
+ * a D-Bus message.
+ *
+ * If you are not interacting with D-Bus, then there is no reason to make
+ * use of this type.
+ **/
+#define G_VARIANT_TYPE_HANDLE ((const GVariantType *) "h")
+
+/**
+ * G_VARIANT_TYPE_UNIT:
+ *
+ * The empty tuple type. Has only one instance. Known also as "triv"
+ * or "void".
+ **/
+#define G_VARIANT_TYPE_UNIT ((const GVariantType *) "()")
+
+/**
+ * G_VARIANT_TYPE_ANY:
+ *
+ * An indefinite type that is a supertype of every type (including
+ * itself).
+ **/
+#define G_VARIANT_TYPE_ANY ((const GVariantType *) "*")
+
+/**
+ * G_VARIANT_TYPE_BASIC:
+ *
+ * An indefinite type that is a supertype of every basic (ie:
+ * non-container) type.
+ **/
+#define G_VARIANT_TYPE_BASIC ((const GVariantType *) "?")
+
+/**
+ * G_VARIANT_TYPE_MAYBE:
+ *
+ * An indefinite type that is a supertype of every maybe type.
+ **/
+#define G_VARIANT_TYPE_MAYBE ((const GVariantType *) "m*")
+
+/**
+ * G_VARIANT_TYPE_ARRAY:
+ *
+ * An indefinite type that is a supertype of every array type.
+ **/
+#define G_VARIANT_TYPE_ARRAY ((const GVariantType *) "a*")
+
+/**
+ * G_VARIANT_TYPE_TUPLE:
+ *
+ * An indefinite type that is a supertype of every tuple type,
+ * regardless of the number of items in the tuple.
+ **/
+#define G_VARIANT_TYPE_TUPLE ((const GVariantType *) "r")
+
+/**
+ * G_VARIANT_TYPE_DICT_ENTRY:
+ *
+ * An indefinite type that is a supertype of every dictionary entry
+ * type.
+ **/
+#define G_VARIANT_TYPE_DICT_ENTRY ((const GVariantType *) "{?*}")
+
+/**
+ * G_VARIANT_TYPE_DICTIONARY:
+ *
+ * An indefinite type that is a supertype of every dictionary type --
+ * that is, any array type that has an element type equal to any
+ * dictionary entry type.
+ **/
+#define G_VARIANT_TYPE_DICTIONARY ((const GVariantType *) "a{?*}")
+
+/**
+ * G_VARIANT_TYPE_STRING_ARRAY:
+ *
+ * The type of an array of strings.
+ **/
+#define G_VARIANT_TYPE_STRING_ARRAY ((const GVariantType *) "as")
+
+/**
+ * G_VARIANT_TYPE_OBJECT_PATH_ARRAY:
+ *
+ * The type of an array of object paths.
+ **/
+#define G_VARIANT_TYPE_OBJECT_PATH_ARRAY ((const GVariantType *) "ao")
+
+/**
+ * G_VARIANT_TYPE_BYTESTRING:
+ *
+ * The type of an array of bytes. This type is commonly used to pass
+ * around strings that may not be valid utf8. In that case, the
+ * convention is that the nul terminator character should be included as
+ * the last character in the array.
+ **/
+#define G_VARIANT_TYPE_BYTESTRING ((const GVariantType *) "ay")
+
+/**
+ * G_VARIANT_TYPE_BYTESTRING_ARRAY:
+ *
+ * The type of an array of byte strings (an array of arrays of bytes).
+ **/
+#define G_VARIANT_TYPE_BYTESTRING_ARRAY ((const GVariantType *) "aay")
+
+/**
+ * G_VARIANT_TYPE_VARDICT:
+ *
+ * The type of a dictionary mapping strings to variants (the ubiquitous
+ * "a{sv}" type).
+ *
+ * Since: 2.30
+ **/
+#define G_VARIANT_TYPE_VARDICT ((const GVariantType *) "a{sv}")
+
+
+/**
+ * G_VARIANT_TYPE:
+ * @type_string: a well-formed #GVariantType type string
+ *
+ * Converts a string to a const #GVariantType. Depending on the
+ * current debugging level, this function may perform a runtime check
+ * to ensure that @string is a valid GVariant type string.
+ *
+ * It is always a programmer error to use this macro with an invalid
+ * type string. If in doubt, use g_variant_type_string_is_valid() to
+ * check if the string is valid.
+ *
+ * Since 2.24
+ **/
+#ifndef G_DISABLE_CHECKS
+# define G_VARIANT_TYPE(type_string) (g_variant_type_checked_ ((type_string)))
+#else
+# define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string))
+#endif
+
+/* type string checking */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_string_is_valid (const gchar *type_string);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_string_scan (const gchar *string,
+ const gchar *limit,
+ const gchar **endptr);
+
+/* create/destroy */
+GLIB_AVAILABLE_IN_ALL
+void g_variant_type_free (GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+GVariantType * g_variant_type_copy (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+GVariantType * g_variant_type_new (const gchar *type_string);
+
+/* getters */
+GLIB_AVAILABLE_IN_ALL
+gsize g_variant_type_get_string_length (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_variant_type_peek_string (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gchar * g_variant_type_dup_string (const GVariantType *type);
+
+/* classification */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_definite (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_container (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_basic (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_maybe (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_array (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_tuple (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_dict_entry (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_variant (const GVariantType *type);
+
+/* for hash tables */
+GLIB_AVAILABLE_IN_ALL
+guint g_variant_type_hash (gconstpointer type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_equal (gconstpointer type1,
+ gconstpointer type2);
+
+/* subtypes */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_variant_type_is_subtype_of (const GVariantType *type,
+ const GVariantType *supertype);
+
+/* type iterator interface */
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_variant_type_element (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_variant_type_first (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_variant_type_next (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+gsize g_variant_type_n_items (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_variant_type_key (const GVariantType *type);
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_variant_type_value (const GVariantType *type);
+
+/* constructors */
+GLIB_AVAILABLE_IN_ALL
+GVariantType * g_variant_type_new_array (const GVariantType *element);
+GLIB_AVAILABLE_IN_ALL
+GVariantType * g_variant_type_new_maybe (const GVariantType *element);
+GLIB_AVAILABLE_IN_ALL
+GVariantType * g_variant_type_new_tuple (const GVariantType * const *items,
+ gint length);
+GLIB_AVAILABLE_IN_ALL
+GVariantType * g_variant_type_new_dict_entry (const GVariantType *key,
+ const GVariantType *value);
+
+/*< private >*/
+GLIB_AVAILABLE_IN_ALL
+const GVariantType * g_variant_type_checked_ (const gchar *);
+GLIB_AVAILABLE_IN_2_60
+gsize g_variant_type_string_get_depth_ (const gchar *type_string);
+
+G_END_DECLS
+
+#endif /* __G_VARIANT_TYPE_H__ */
diff --git a/include/glib/glib/gversion.h b/include/glib/glib/gversion.h
new file mode 100644
index 0000000000..68343f7278
--- /dev/null
+++ b/include/glib/glib/gversion.h
@@ -0,0 +1,55 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_VERSION_H__
+#define __G_VERSION_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+GLIB_VAR const guint glib_major_version;
+GLIB_VAR const guint glib_minor_version;
+GLIB_VAR const guint glib_micro_version;
+GLIB_VAR const guint glib_interface_age;
+GLIB_VAR const guint glib_binary_age;
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * glib_check_version (guint required_major,
+ guint required_minor,
+ guint required_micro);
+
+#define GLIB_CHECK_VERSION(major,minor,micro) \
+ (GLIB_MAJOR_VERSION > (major) || \
+ (GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION > (minor)) || \
+ (GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION == (minor) && \
+ GLIB_MICRO_VERSION >= (micro)))
+
+G_END_DECLS
+
+#endif /* __G_VERSION_H__ */
diff --git a/include/glib/glib/gversionmacros.h b/include/glib/glib/gversionmacros.h
new file mode 100644
index 0000000000..ee91f6d5b2
--- /dev/null
+++ b/include/glib/glib/gversionmacros.h
@@ -0,0 +1,923 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_VERSION_MACROS_H__
+#define __G_VERSION_MACROS_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+/* Version boundaries checks */
+
+#define G_ENCODE_VERSION(major,minor) ((major) << 16 | (minor) << 8)
+
+/* XXX: Every new stable minor release bump should add a macro here */
+
+/**
+ * GLIB_VERSION_2_26:
+ *
+ * A macro that evaluates to the 2.26 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.32
+ */
+#define GLIB_VERSION_2_26 (G_ENCODE_VERSION (2, 26))
+
+/**
+ * GLIB_VERSION_2_28:
+ *
+ * A macro that evaluates to the 2.28 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.32
+ */
+#define GLIB_VERSION_2_28 (G_ENCODE_VERSION (2, 28))
+
+/**
+ * GLIB_VERSION_2_30:
+ *
+ * A macro that evaluates to the 2.30 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.32
+ */
+#define GLIB_VERSION_2_30 (G_ENCODE_VERSION (2, 30))
+
+/**
+ * GLIB_VERSION_2_32:
+ *
+ * A macro that evaluates to the 2.32 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.32
+ */
+#define GLIB_VERSION_2_32 (G_ENCODE_VERSION (2, 32))
+
+/**
+ * GLIB_VERSION_2_34:
+ *
+ * A macro that evaluates to the 2.34 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.34
+ */
+#define GLIB_VERSION_2_34 (G_ENCODE_VERSION (2, 34))
+
+/**
+ * GLIB_VERSION_2_36:
+ *
+ * A macro that evaluates to the 2.36 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.36
+ */
+#define GLIB_VERSION_2_36 (G_ENCODE_VERSION (2, 36))
+
+/**
+ * GLIB_VERSION_2_38:
+ *
+ * A macro that evaluates to the 2.38 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.38
+ */
+#define GLIB_VERSION_2_38 (G_ENCODE_VERSION (2, 38))
+
+/**
+ * GLIB_VERSION_2_40:
+ *
+ * A macro that evaluates to the 2.40 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.40
+ */
+#define GLIB_VERSION_2_40 (G_ENCODE_VERSION (2, 40))
+
+/**
+ * GLIB_VERSION_2_42:
+ *
+ * A macro that evaluates to the 2.42 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.42
+ */
+#define GLIB_VERSION_2_42 (G_ENCODE_VERSION (2, 42))
+
+/**
+ * GLIB_VERSION_2_44:
+ *
+ * A macro that evaluates to the 2.44 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.44
+ */
+#define GLIB_VERSION_2_44 (G_ENCODE_VERSION (2, 44))
+
+/**
+ * GLIB_VERSION_2_46:
+ *
+ * A macro that evaluates to the 2.46 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.46
+ */
+#define GLIB_VERSION_2_46 (G_ENCODE_VERSION (2, 46))
+
+/**
+ * GLIB_VERSION_2_48:
+ *
+ * A macro that evaluates to the 2.48 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.48
+ */
+#define GLIB_VERSION_2_48 (G_ENCODE_VERSION (2, 48))
+
+/**
+ * GLIB_VERSION_2_50:
+ *
+ * A macro that evaluates to the 2.50 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.50
+ */
+#define GLIB_VERSION_2_50 (G_ENCODE_VERSION (2, 50))
+
+/**
+ * GLIB_VERSION_2_52:
+ *
+ * A macro that evaluates to the 2.52 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.52
+ */
+#define GLIB_VERSION_2_52 (G_ENCODE_VERSION (2, 52))
+
+/**
+ * GLIB_VERSION_2_54:
+ *
+ * A macro that evaluates to the 2.54 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.54
+ */
+#define GLIB_VERSION_2_54 (G_ENCODE_VERSION (2, 54))
+
+/**
+ * GLIB_VERSION_2_56:
+ *
+ * A macro that evaluates to the 2.56 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.56
+ */
+#define GLIB_VERSION_2_56 (G_ENCODE_VERSION (2, 56))
+
+/**
+ * GLIB_VERSION_2_58:
+ *
+ * A macro that evaluates to the 2.58 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.58
+ */
+#define GLIB_VERSION_2_58 (G_ENCODE_VERSION (2, 58))
+
+/**
+ * GLIB_VERSION_2_60:
+ *
+ * A macro that evaluates to the 2.60 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.60
+ */
+#define GLIB_VERSION_2_60 (G_ENCODE_VERSION (2, 60))
+
+/**
+ * GLIB_VERSION_2_62:
+ *
+ * A macro that evaluates to the 2.62 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.62
+ */
+#define GLIB_VERSION_2_62 (G_ENCODE_VERSION (2, 62))
+
+/* evaluates to the current stable version; for development cycles,
+ * this means the next stable target
+ */
+#if (GLIB_MINOR_VERSION % 2)
+#define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION + 1))
+#else
+#define GLIB_VERSION_CUR_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION))
+#endif
+
+/* evaluates to the previous stable version */
+#if (GLIB_MINOR_VERSION % 2)
+#define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 1))
+#else
+#define GLIB_VERSION_PREV_STABLE (G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION - 2))
+#endif
+
+/**
+ * GLIB_VERSION_MIN_REQUIRED:
+ *
+ * A macro that should be defined by the user prior to including
+ * the glib.h header.
+ * The definition should be one of the predefined GLib version
+ * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
+ *
+ * This macro defines the earliest version of GLib that the package is
+ * required to be able to compile against.
+ *
+ * If the compiler is configured to warn about the use of deprecated
+ * functions, then using functions that were deprecated in version
+ * %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
+ * using functions deprecated in later releases will not).
+ *
+ * Since: 2.32
+ */
+/* If the package sets GLIB_VERSION_MIN_REQUIRED to some future
+ * GLIB_VERSION_X_Y value that we don't know about, it will compare as
+ * 0 in preprocessor tests.
+ */
+#ifndef GLIB_VERSION_MIN_REQUIRED
+# define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
+#elif GLIB_VERSION_MIN_REQUIRED == 0
+# undef GLIB_VERSION_MIN_REQUIRED
+# define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE + 2)
+#endif
+
+/**
+ * GLIB_VERSION_MAX_ALLOWED:
+ *
+ * A macro that should be defined by the user prior to including
+ * the glib.h header.
+ * The definition should be one of the predefined GLib version
+ * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
+ *
+ * This macro defines the latest version of the GLib API that the
+ * package is allowed to make use of.
+ *
+ * If the compiler is configured to warn about the use of deprecated
+ * functions, then using functions added after version
+ * %GLIB_VERSION_MAX_ALLOWED will cause warnings.
+ *
+ * Unless you are using GLIB_CHECK_VERSION() or the like to compile
+ * different code depending on the GLib version, then this should be
+ * set to the same value as %GLIB_VERSION_MIN_REQUIRED.
+ *
+ * Since: 2.32
+ */
+#if !defined (GLIB_VERSION_MAX_ALLOWED) || (GLIB_VERSION_MAX_ALLOWED == 0)
+# undef GLIB_VERSION_MAX_ALLOWED
+# define GLIB_VERSION_MAX_ALLOWED (GLIB_VERSION_CUR_STABLE)
+#endif
+
+/* sanity checks */
+#if GLIB_VERSION_MIN_REQUIRED > GLIB_VERSION_CUR_STABLE
+#error "GLIB_VERSION_MIN_REQUIRED must be <= GLIB_VERSION_CUR_STABLE"
+#endif
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_MIN_REQUIRED
+#error "GLIB_VERSION_MAX_ALLOWED must be >= GLIB_VERSION_MIN_REQUIRED"
+#endif
+#if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_26
+#error "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
+#endif
+
+/* These macros are used to mark deprecated functions in GLib headers,
+ * and thus have to be exposed in installed headers. But please
+ * do *not* use them in other projects. Instead, use G_DEPRECATED
+ * or define your own wrappers around it.
+ */
+#define GLIB_AVAILABLE_IN_ALL _GLIB_EXTERN
+
+/* XXX: Every new stable minor release should add a set of macros here */
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_26
+# define GLIB_DEPRECATED_IN_2_26 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_26_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_26 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_26_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_26 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_26_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_26 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_26_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_26
+# define GLIB_DEPRECATED_MACRO_IN_2_26_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_26
+# define GLIB_DEPRECATED_TYPE_IN_2_26_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_26
+# define GLIB_AVAILABLE_IN_2_26 GLIB_UNAVAILABLE(2, 26)
+# define GLIB_AVAILABLE_MACRO_IN_2_26 GLIB_UNAVAILABLE_MACRO(2, 26)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_26 GLIB_UNAVAILABLE_ENUMERATOR(2, 26)
+# define GLIB_AVAILABLE_TYPE_IN_2_26 GLIB_UNAVAILABLE_TYPE(2, 26)
+#else
+# define GLIB_AVAILABLE_IN_2_26 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_26
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_26
+# define GLIB_AVAILABLE_TYPE_IN_2_26
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_28
+# define GLIB_DEPRECATED_IN_2_28 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_28_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_28 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_28_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_28 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_28_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_28 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_28_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_28
+# define GLIB_DEPRECATED_MACRO_IN_2_28_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_28
+# define GLIB_DEPRECATED_TYPE_IN_2_28_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_28
+# define GLIB_AVAILABLE_IN_2_28 GLIB_UNAVAILABLE(2, 28)
+# define GLIB_AVAILABLE_MACRO_IN_2_28 GLIB_UNAVAILABLE_MACRO(2, 28)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_28 GLIB_UNAVAILABLE_ENUMERATOR(2, 28)
+# define GLIB_AVAILABLE_TYPE_IN_2_28 GLIB_UNAVAILABLE_TYPE(2, 28)
+#else
+# define GLIB_AVAILABLE_IN_2_28 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_28
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_28
+# define GLIB_AVAILABLE_TYPE_IN_2_28
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_30
+# define GLIB_DEPRECATED_IN_2_30 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_30_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_30 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_30_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_30 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_30_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_30 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_30_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_30
+# define GLIB_DEPRECATED_MACRO_IN_2_30_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_30
+# define GLIB_DEPRECATED_TYPE_IN_2_30_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_30
+# define GLIB_AVAILABLE_IN_2_30 GLIB_UNAVAILABLE(2, 30)
+# define GLIB_AVAILABLE_MACRO_IN_2_30 GLIB_UNAVAILABLE_MACRO(2, 30)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_30 GLIB_UNAVAILABLE_ENUMERATOR(2, 30)
+# define GLIB_AVAILABLE_TYPE_IN_2_30 GLIB_UNAVAILABLE_TYPE(2, 30)
+#else
+# define GLIB_AVAILABLE_IN_2_30 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_30
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_30
+# define GLIB_AVAILABLE_TYPE_IN_2_30
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32
+# define GLIB_DEPRECATED_IN_2_32 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_32_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_32 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_32_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_32 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_32_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_32 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_32_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_32
+# define GLIB_DEPRECATED_MACRO_IN_2_32_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_32
+# define GLIB_DEPRECATED_TYPE_IN_2_32_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_32
+# define GLIB_DEPRECATED_TYPE_IN_2_32_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32
+# define GLIB_AVAILABLE_IN_2_32 GLIB_UNAVAILABLE(2, 32)
+# define GLIB_AVAILABLE_MACRO_IN_2_32 GLIB_UNAVAILABLE_MACRO(2, 32)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_32 GLIB_UNAVAILABLE_ENUMERATOR(2, 32)
+# define GLIB_AVAILABLE_TYPE_IN_2_32 GLIB_UNAVAILABLE_TYPE(2, 32)
+#else
+# define GLIB_AVAILABLE_IN_2_32 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_32
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_32
+# define GLIB_AVAILABLE_TYPE_IN_2_32
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34
+# define GLIB_DEPRECATED_IN_2_34 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_34_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_34 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_34_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_34 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_34_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_34 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_34_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_34
+# define GLIB_DEPRECATED_MACRO_IN_2_34_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_34
+# define GLIB_DEPRECATED_TYPE_IN_2_34_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34
+# define GLIB_AVAILABLE_IN_2_34 GLIB_UNAVAILABLE(2, 34)
+# define GLIB_AVAILABLE_MACRO_IN_2_34 GLIB_UNAVAILABLE_MACRO(2, 34)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_34 GLIB_UNAVAILABLE_ENUMERATOR(2, 34)
+# define GLIB_AVAILABLE_TYPE_IN_2_34 GLIB_UNAVAILABLE_TYPE(2, 34)
+#else
+# define GLIB_AVAILABLE_IN_2_34 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_34
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_34
+# define GLIB_AVAILABLE_TYPE_IN_2_34
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36
+# define GLIB_DEPRECATED_IN_2_36 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_36_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_36 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_36_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_36 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_36_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_36 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_36_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_36
+# define GLIB_DEPRECATED_MACRO_IN_2_36_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_36
+# define GLIB_DEPRECATED_TYPE_IN_2_36_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36
+# define GLIB_AVAILABLE_IN_2_36 GLIB_UNAVAILABLE(2, 36)
+# define GLIB_AVAILABLE_MACRO_IN_2_36 GLIB_UNAVAILABLE_MACRO(2, 36)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_36 GLIB_UNAVAILABLE_ENUMERATOR(2, 36)
+# define GLIB_AVAILABLE_TYPE_IN_2_36 GLIB_UNAVAILABLE_TYPE(2, 36)
+#else
+# define GLIB_AVAILABLE_IN_2_36 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_36
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_36
+# define GLIB_AVAILABLE_TYPE_IN_2_36
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38
+# define GLIB_DEPRECATED_IN_2_38 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_38_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_38 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_38_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_38 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_38_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_38 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_38_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_38
+# define GLIB_DEPRECATED_MACRO_IN_2_38_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_38
+# define GLIB_DEPRECATED_TYPE_IN_2_38_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+# define GLIB_AVAILABLE_IN_2_38 GLIB_UNAVAILABLE(2, 38)
+# define GLIB_AVAILABLE_MACRO_IN_2_38 GLIB_UNAVAILABLE_MACRO(2, 38)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_38 GLIB_UNAVAILABLE_ENUMERATOR(2, 38)
+# define GLIB_AVAILABLE_TYPE_IN_2_38 GLIB_UNAVAILABLE_TYPE(2, 38)
+#else
+# define GLIB_AVAILABLE_IN_2_38 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_38
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_38
+# define GLIB_AVAILABLE_TYPE_IN_2_38
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40
+# define GLIB_DEPRECATED_IN_2_40 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_40_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_40 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_40_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_40 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_40_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_40 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_40_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_40
+# define GLIB_DEPRECATED_MACRO_IN_2_40_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_40
+# define GLIB_DEPRECATED_TYPE_IN_2_40_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40
+# define GLIB_AVAILABLE_IN_2_40 GLIB_UNAVAILABLE(2, 40)
+# define GLIB_AVAILABLE_MACRO_IN_2_40 GLIB_UNAVAILABLE_MACRO(2, 40)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_40 GLIB_UNAVAILABLE_ENUMERATOR(2, 40)
+# define GLIB_AVAILABLE_TYPE_IN_2_40 GLIB_UNAVAILABLE_TYPE(2, 40)
+#else
+# define GLIB_AVAILABLE_IN_2_40 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_40
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_40
+# define GLIB_AVAILABLE_TYPE_IN_2_40
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42
+# define GLIB_DEPRECATED_IN_2_42 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_42_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_42 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_42_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_42 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_42_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_42
+# define GLIB_DEPRECATED_MACRO_IN_2_42_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_42
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_42_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_42
+# define GLIB_DEPRECATED_TYPE_IN_2_42_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42
+# define GLIB_AVAILABLE_IN_2_42 GLIB_UNAVAILABLE(2, 42)
+# define GLIB_AVAILABLE_MACRO_IN_2_42 GLIB_UNAVAILABLE_MACRO(2, 42)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_42 GLIB_UNAVAILABLE_ENUMERATOR(2, 42)
+# define GLIB_AVAILABLE_TYPE_IN_2_42 GLIB_UNAVAILABLE_TYPE(2, 42)
+#else
+# define GLIB_AVAILABLE_IN_2_42 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_42
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_42
+# define GLIB_AVAILABLE_TYPE_IN_2_42
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_44
+# define GLIB_DEPRECATED_IN_2_44 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_44_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_44 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_44_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_44 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_44_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_44 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_44_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_44
+# define GLIB_DEPRECATED_MACRO_IN_2_44_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_44
+# define GLIB_DEPRECATED_TYPE_IN_2_44_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44
+# define GLIB_AVAILABLE_IN_2_44 GLIB_UNAVAILABLE(2, 44)
+# define GLIB_AVAILABLE_MACRO_IN_2_44 GLIB_UNAVAILABLE_MACRO(2, 44)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_44 GLIB_UNAVAILABLE_ENUMERATOR(2, 44)
+# define GLIB_AVAILABLE_TYPE_IN_2_44 GLIB_UNAVAILABLE_TYPE(2, 44)
+#else
+# define GLIB_AVAILABLE_IN_2_44 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_44
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_44
+# define GLIB_AVAILABLE_TYPE_IN_2_44
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_46
+# define GLIB_DEPRECATED_IN_2_46 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_46_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_46 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_46_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_46 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_46_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_46
+# define GLIB_DEPRECATED_MACRO_IN_2_46_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_46
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_46_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_46
+# define GLIB_DEPRECATED_TYPE_IN_2_46_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_46
+# define GLIB_AVAILABLE_IN_2_46 GLIB_UNAVAILABLE(2, 46)
+# define GLIB_AVAILABLE_MACRO_IN_2_46 GLIB_UNAVAILABLE_MACRO(2, 46)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_46 GLIB_UNAVAILABLE_ENUMERATOR(2, 46)
+# define GLIB_AVAILABLE_TYPE_IN_2_46 GLIB_UNAVAILABLE_TYPE(2, 46)
+#else
+# define GLIB_AVAILABLE_IN_2_46 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_46
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_46
+# define GLIB_AVAILABLE_TYPE_IN_2_46
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_48
+# define GLIB_DEPRECATED_IN_2_48 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_48_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_48 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_48_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_48 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_48_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_48 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_48_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_48
+# define GLIB_DEPRECATED_MACRO_IN_2_48_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_48
+# define GLIB_DEPRECATED_TYPE_IN_2_48_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_48
+# define GLIB_AVAILABLE_IN_2_48 GLIB_UNAVAILABLE(2, 48)
+# define GLIB_AVAILABLE_MACRO_IN_2_48 GLIB_UNAVAILABLE_MACRO(2, 48)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_48 GLIB_UNAVAILABLE_ENUMERATOR(2, 48)
+# define GLIB_AVAILABLE_TYPE_IN_2_48 GLIB_UNAVAILABLE_TYPE(2, 48)
+#else
+# define GLIB_AVAILABLE_IN_2_48 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_48
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_48
+# define GLIB_AVAILABLE_TYPE_IN_2_48
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_50
+# define GLIB_DEPRECATED_IN_2_50 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_50_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_50 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_50_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_50 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_50_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_50 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_50_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_50
+# define GLIB_DEPRECATED_MACRO_IN_2_50_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_50
+# define GLIB_DEPRECATED_TYPE_IN_2_50_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_50
+# define GLIB_AVAILABLE_IN_2_50 GLIB_UNAVAILABLE(2, 50)
+# define GLIB_AVAILABLE_MACRO_IN_2_50 GLIB_UNAVAILABLE_MACRO(2, 50)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_50 GLIB_UNAVAILABLE_ENUMERATOR(2, 50)
+# define GLIB_AVAILABLE_TYPE_IN_2_50 GLIB_UNAVAILABLE_TYPE(2, 50)
+#else
+# define GLIB_AVAILABLE_IN_2_50 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_50
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_50
+# define GLIB_AVAILABLE_TYPE_IN_2_50
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_52
+# define GLIB_DEPRECATED_IN_2_52 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_52_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_52 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_52_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_52 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_52_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_52 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_52_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_52
+# define GLIB_DEPRECATED_MACRO_IN_2_52_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_52
+# define GLIB_DEPRECATED_TYPE_IN_2_52_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_52
+# define GLIB_AVAILABLE_IN_2_52 GLIB_UNAVAILABLE(2, 52)
+# define GLIB_AVAILABLE_MACRO_IN_2_52 GLIB_UNAVAILABLE_MACRO(2, 52)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_52 GLIB_UNAVAILABLE_ENUMERATOR(2, 52)
+# define GLIB_AVAILABLE_TYPE_IN_2_52 GLIB_UNAVAILABLE_TYPE(2, 52)
+#else
+# define GLIB_AVAILABLE_IN_2_52 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_52
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_52
+# define GLIB_AVAILABLE_TYPE_IN_2_52
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_54
+# define GLIB_DEPRECATED_IN_2_54 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_54_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_54 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_54_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_54 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_54_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_54 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_54_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_54
+# define GLIB_DEPRECATED_MACRO_IN_2_54_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_54
+# define GLIB_DEPRECATED_TYPE_IN_2_54_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_54
+# define GLIB_AVAILABLE_IN_2_54 GLIB_UNAVAILABLE(2, 54)
+# define GLIB_AVAILABLE_MACRO_IN_2_54 GLIB_UNAVAILABLE_MACRO(2, 54)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_54 GLIB_UNAVAILABLE_ENUMERATOR(2, 54)
+# define GLIB_AVAILABLE_TYPE_IN_2_54 GLIB_UNAVAILABLE_TYPE(2, 54)
+#else
+# define GLIB_AVAILABLE_IN_2_54 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_54
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_54
+# define GLIB_AVAILABLE_TYPE_IN_2_54
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_56
+# define GLIB_DEPRECATED_IN_2_56 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_56_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_56 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_56_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_56 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_56_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_56 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_56_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_56
+# define GLIB_DEPRECATED_MACRO_IN_2_56_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_56
+# define GLIB_DEPRECATED_TYPE_IN_2_56_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_56
+# define GLIB_AVAILABLE_IN_2_56 GLIB_UNAVAILABLE(2, 56)
+# define GLIB_AVAILABLE_MACRO_IN_2_56 GLIB_UNAVAILABLE_MACRO(2, 56)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_56 GLIB_UNAVAILABLE_ENUMERATOR(2, 56)
+# define GLIB_AVAILABLE_TYPE_IN_2_56 GLIB_UNAVAILABLE_TYPE(2, 56)
+#else
+# define GLIB_AVAILABLE_IN_2_56 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_56
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_56
+# define GLIB_AVAILABLE_TYPE_IN_2_56
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_58
+# define GLIB_DEPRECATED_IN_2_58 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_58_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_58 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_58_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_58 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_58_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_58 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_58_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_58
+# define GLIB_DEPRECATED_MACRO_IN_2_58_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_58
+# define GLIB_DEPRECATED_TYPE_IN_2_58_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_58
+# define GLIB_AVAILABLE_IN_2_58 GLIB_UNAVAILABLE(2, 58)
+# define GLIB_AVAILABLE_MACRO_IN_2_58 GLIB_UNAVAILABLE_MACRO(2, 58)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_58 GLIB_UNAVAILABLE_ENUMERATOR(2, 58)
+# define GLIB_AVAILABLE_TYPE_IN_2_58 GLIB_UNAVAILABLE_TYPE(2, 58)
+#else
+# define GLIB_AVAILABLE_IN_2_58 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_58
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_58
+# define GLIB_AVAILABLE_TYPE_IN_2_58
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_60
+# define GLIB_DEPRECATED_IN_2_60 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_60_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_60 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_60_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_60 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_60_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_60 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_60_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_60
+# define GLIB_DEPRECATED_MACRO_IN_2_60_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_60
+# define GLIB_DEPRECATED_TYPE_IN_2_60_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_60
+# define GLIB_AVAILABLE_IN_2_60 GLIB_UNAVAILABLE(2, 60)
+# define GLIB_AVAILABLE_MACRO_IN_2_60 GLIB_UNAVAILABLE_MACRO(2, 60)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_60 GLIB_UNAVAILABLE_ENUMERATOR(2, 60)
+# define GLIB_AVAILABLE_TYPE_IN_2_60 GLIB_UNAVAILABLE_TYPE(2, 60)
+#else
+# define GLIB_AVAILABLE_IN_2_60 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_60
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_60
+# define GLIB_AVAILABLE_TYPE_IN_2_60
+#endif
+
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_62
+# define GLIB_DEPRECATED_IN_2_62 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_62_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_62 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_62_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_62 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_62_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_62 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_62_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_62
+# define GLIB_DEPRECATED_MACRO_IN_2_62_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_62
+# define GLIB_DEPRECATED_TYPE_IN_2_62_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_62
+# define GLIB_AVAILABLE_IN_2_62 GLIB_UNAVAILABLE(2, 62)
+# define GLIB_AVAILABLE_MACRO_IN_2_62 GLIB_UNAVAILABLE_MACRO(2, 62)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_62 GLIB_UNAVAILABLE_ENUMERATOR(2, 62)
+# define GLIB_AVAILABLE_TYPE_IN_2_62 GLIB_UNAVAILABLE_TYPE(2, 62)
+#else
+# define GLIB_AVAILABLE_IN_2_62 _GLIB_EXTERN
+# define GLIB_AVAILABLE_MACRO_IN_2_62
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_62
+# define GLIB_AVAILABLE_TYPE_IN_2_62
+#endif
+
+#endif /* __G_VERSION_MACROS_H__ */
diff --git a/include/glib/glib/gwin32.h b/include/glib/glib/gwin32.h
new file mode 100644
index 0000000000..6696afa9aa
--- /dev/null
+++ b/include/glib/glib/gwin32.h
@@ -0,0 +1,140 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_WIN32_H__
+#define __G_WIN32_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gtypes.h>
+
+#ifdef G_PLATFORM_WIN32
+
+G_BEGIN_DECLS
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+#ifdef G_OS_WIN32
+
+/*
+ * To get prototypes for the following POSIXish functions, you have to
+ * include the indicated non-POSIX headers. The functions are defined
+ * in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32). But note that
+ * for POSIX functions that take or return file names in the system
+ * codepage, in many cases you would want to use the GLib wrappers in
+ * gstdio.h and UTF-8 instead.
+ *
+ * getcwd: <direct.h> (MSVC), <io.h> (mingw32)
+ * getpid: <process.h>
+ * access: <io.h>
+ * unlink: <stdio.h> or <io.h>
+ * open, read, write, lseek, close: <io.h>
+ * rmdir: <io.h>
+ * pipe: <io.h> (actually, _pipe())
+ */
+
+/* For some POSIX functions that are not provided by the MS runtime,
+ * we provide emulation functions in glib, which are prefixed with
+ * g_win32_. Or that was the idea at some time, but there is just one
+ * of those:
+ */
+GLIB_AVAILABLE_IN_ALL
+gint g_win32_ftruncate (gint f,
+ guint size);
+#endif /* G_OS_WIN32 */
+
+/* The MS setlocale uses locale names of the form "English_United
+ * States.1252" etc. We want the Unixish standard form "en", "zh_TW"
+ * etc. This function gets the current thread locale from Windows and
+ * returns it as a string of the above form for use in forming file
+ * names etc. The returned string should be deallocated with g_free().
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_win32_getlocale (void);
+
+/* Translate a Win32 error code (as returned by GetLastError()) into
+ * the corresponding message. The returned string should be deallocated
+ * with g_free().
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_win32_error_message (gint error);
+
+GLIB_DEPRECATED
+gchar* g_win32_get_package_installation_directory (const gchar *package,
+ const gchar *dll_name);
+
+GLIB_DEPRECATED
+gchar* g_win32_get_package_installation_subdirectory (const gchar *package,
+ const gchar *dll_name,
+ const gchar *subdir);
+
+GLIB_AVAILABLE_IN_ALL
+gchar* g_win32_get_package_installation_directory_of_module (gpointer hmodule);
+
+GLIB_DEPRECATED_IN_2_44_FOR(g_win32_check_windows_version)
+guint g_win32_get_windows_version (void);
+
+GLIB_AVAILABLE_IN_ALL
+gchar* g_win32_locale_filename_from_utf8 (const gchar *utf8filename);
+
+GLIB_AVAILABLE_IN_2_40
+gchar ** g_win32_get_command_line (void);
+
+/* As of GLib 2.14 we only support NT-based Windows */
+#define G_WIN32_IS_NT_BASED() TRUE
+#define G_WIN32_HAVE_WIDECHAR_API() TRUE
+
+/**
+ * GWin32OSType:
+ * @G_WIN32_OS_ANY: The running system can be a workstation or a server edition of
+ * Windows. The type of the running system is therefore not checked.
+ * @G_WIN32_OS_WORKSTATION: The running system is a workstation edition of Windows,
+ * such as Windows 7 Professional.
+ * @G_WIN32_OS_SERVER: The running system is a server edition of Windows, such as
+ * Windows Server 2008 R2.
+ *
+ * Type of Windows edition to check for at run-time.
+ **/
+typedef enum
+{
+ G_WIN32_OS_ANY,
+ G_WIN32_OS_WORKSTATION,
+ G_WIN32_OS_SERVER,
+} GWin32OSType;
+
+GLIB_AVAILABLE_IN_2_44
+gboolean g_win32_check_windows_version (const gint major,
+ const gint minor,
+ const gint spver,
+ const GWin32OSType os_type);
+
+G_END_DECLS
+
+#endif /* G_PLATFORM_WIN32 */
+
+#endif /* __G_WIN32_H__ */
diff --git a/include/glib/glibconfig.h b/include/glib/glibconfig.h
new file mode 100644
index 0000000000..9d4394dc4c
--- /dev/null
+++ b/include/glib/glibconfig.h
@@ -0,0 +1,216 @@
+/* glibconfig.h
+ *
+ * This is a generated file. Please modify 'glibconfig.h.in'
+ */
+
+#ifndef __GLIBCONFIG_H__
+#define __GLIBCONFIG_H__
+
+#include <glib/gmacros.h>
+
+#include <limits.h>
+#include <float.h>
+/* #undef GLIB_HAVE_ALLOCA_H */
+
+/* Specifies that GLib's g_print*() functions wrap the
+ * system printf functions. This is useful to know, for example,
+ * when using glibc's register_printf_function().
+ */
+#undef GLIB_USING_SYSTEM_PRINTF
+
+/* #undef GLIB_STATIC_COMPILATION */
+/* #undef GOBJECT_STATIC_COMPILATION */
+
+G_BEGIN_DECLS
+
+#define G_MINFLOAT FLT_MIN
+#define G_MAXFLOAT FLT_MAX
+#define G_MINDOUBLE DBL_MIN
+#define G_MAXDOUBLE DBL_MAX
+#define G_MINSHORT SHRT_MIN
+#define G_MAXSHORT SHRT_MAX
+#define G_MAXUSHORT USHRT_MAX
+#define G_MININT INT_MIN
+#define G_MAXINT INT_MAX
+#define G_MAXUINT UINT_MAX
+#define G_MINLONG LONG_MIN
+#define G_MAXLONG LONG_MAX
+#define G_MAXULONG ULONG_MAX
+
+typedef signed char gint8;
+typedef unsigned char guint8;
+
+typedef signed short gint16;
+typedef unsigned short guint16;
+
+#define G_GINT16_MODIFIER "h"
+#define G_GINT16_FORMAT "hi"
+#define G_GUINT16_FORMAT "hu"
+
+
+typedef signed int gint32;
+typedef unsigned int guint32;
+
+#define G_GINT32_MODIFIER ""
+#define G_GINT32_FORMAT "i"
+#define G_GUINT32_FORMAT "u"
+
+
+#define G_HAVE_GINT64 1 /* deprecated, always true */
+
+G_GNUC_EXTENSION typedef signed long long gint64;
+G_GNUC_EXTENSION typedef unsigned long long guint64;
+
+#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL))
+#define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL))
+
+#define G_GINT64_MODIFIER "ll"
+#define G_GINT64_FORMAT "lli"
+#define G_GUINT64_FORMAT "llu"
+
+
+#define GLIB_SIZEOF_VOID_P 4
+#define GLIB_SIZEOF_LONG 4
+#define GLIB_SIZEOF_SIZE_T 4
+#define GLIB_SIZEOF_SSIZE_T 4
+
+typedef signed int gssize;
+typedef unsigned int gsize;
+#define G_GSIZE_MODIFIER ""
+#define G_GSSIZE_MODIFIER ""
+#define G_GSIZE_FORMAT "u"
+#define G_GSSIZE_FORMAT "i"
+
+#define G_MAXSIZE G_MAXUINT
+#define G_MINSSIZE G_MININT
+#define G_MAXSSIZE G_MAXINT
+
+typedef gint64 goffset;
+#define G_MINOFFSET G_MININT64
+#define G_MAXOFFSET G_MAXINT64
+
+#define G_GOFFSET_MODIFIER G_GINT64_MODIFIER
+#define G_GOFFSET_FORMAT G_GINT64_FORMAT
+#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)
+
+#define G_POLLFD_FORMAT "%#x"
+
+#define GPOINTER_TO_INT(p) ((gint) (gint) (p))
+#define GPOINTER_TO_UINT(p) ((guint) (guint) (p))
+
+#define GINT_TO_POINTER(i) ((gpointer) (gint) (i))
+#define GUINT_TO_POINTER(u) ((gpointer) (guint) (u))
+
+typedef signed int gintptr;
+typedef unsigned int guintptr;
+
+#define G_GINTPTR_MODIFIER ""
+#define G_GINTPTR_FORMAT "i"
+#define G_GUINTPTR_FORMAT "u"
+
+#define GLIB_MAJOR_VERSION 2
+#define GLIB_MINOR_VERSION 62
+#define GLIB_MICRO_VERSION 6
+
+#define G_OS_WIN32
+#define G_PLATFORM_WIN32
+
+/* #undef G_VA_COPY */
+
+
+#ifndef __cplusplus
+# define G_HAVE_ISO_VARARGS 1
+#endif
+
+#ifdef __cplusplus
+# define G_HAVE_ISO_VARARGS 1
+#endif
+
+/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
+ * is passed ISO vararg support is turned off, and there is no work
+ * around to turn it on, so we unconditionally turn it off.
+ */
+#if __GNUC__ == 2 && __GNUC_MINOR__ == 95
+# undef G_HAVE_ISO_VARARGS
+#endif
+
+#define G_HAVE_GROWING_STACK 0
+/* #undef G_HAVE_GNUC_VISIBILITY */
+
+#ifndef _MSC_VER
+# define G_HAVE_GNUC_VARARGS 1
+#endif
+
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define G_GNUC_INTERNAL __hidden
+#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY)
+#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
+#else
+#define G_GNUC_INTERNAL
+#endif
+
+#define G_THREADS_ENABLED
+#define G_THREADS_IMPL_WIN32
+
+#undef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
+#define G_ATOMIC_LOCK_FREE
+
+#define GINT16_TO_LE(val) ((gint16) (val))
+#define GUINT16_TO_LE(val) ((guint16) (val))
+#define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
+#define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val))
+
+#define GINT32_TO_LE(val) ((gint32) (val))
+#define GUINT32_TO_LE(val) ((guint32) (val))
+#define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
+#define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val))
+
+#define GINT64_TO_LE(val) ((gint64) (val))
+#define GUINT64_TO_LE(val) ((guint64) (val))
+#define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
+#define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val))
+
+#define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val))
+#define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val))
+#define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val))
+#define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val))
+#define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val))
+#define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val))
+#define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val))
+#define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val))
+#define GSIZE_TO_LE(val) ((gsize) GUINT32_TO_LE (val))
+#define GSSIZE_TO_LE(val) ((gssize) GINT32_TO_LE (val))
+#define GSIZE_TO_BE(val) ((gsize) GUINT32_TO_BE (val))
+#define GSSIZE_TO_BE(val) ((gssize) GINT32_TO_BE (val))
+#define G_BYTE_ORDER G_LITTLE_ENDIAN
+
+#define GLIB_SYSDEF_POLLIN =1
+#define GLIB_SYSDEF_POLLOUT =4
+#define GLIB_SYSDEF_POLLPRI =2
+#define GLIB_SYSDEF_POLLHUP =16
+#define GLIB_SYSDEF_POLLERR =8
+#define GLIB_SYSDEF_POLLNVAL =32
+
+#define G_MODULE_SUFFIX "dll"
+
+typedef void* GPid;
+#define G_PID_FORMAT "p"
+
+#define GLIB_SYSDEF_AF_UNIX 1
+#define GLIB_SYSDEF_AF_INET 2
+#define GLIB_SYSDEF_AF_INET6 23
+
+#define GLIB_SYSDEF_MSG_OOB 1
+#define GLIB_SYSDEF_MSG_PEEK 2
+#define GLIB_SYSDEF_MSG_DONTROUTE 4
+
+#define G_DIR_SEPARATOR '\\'
+#define G_DIR_SEPARATOR_S "\\"
+#define G_SEARCHPATH_SEPARATOR ';'
+#define G_SEARCHPATH_SEPARATOR_S ";"
+
+G_END_DECLS
+
+#endif /* __GLIBCONFIG_H__ */
diff --git a/include/glib/gmodule.h b/include/glib/gmodule.h
new file mode 100644
index 0000000000..8982f5952d
--- /dev/null
+++ b/include/glib/gmodule.h
@@ -0,0 +1,117 @@
+/* GMODULE - GLIB wrapper code for dynamic module loading
+ * Copyright (C) 1998 Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __GMODULE_H__
+#define __GMODULE_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/* exporting and importing functions, this is special cased
+ * to feature Windows dll stubs.
+ */
+#define G_MODULE_IMPORT extern
+#ifdef G_PLATFORM_WIN32
+# define G_MODULE_EXPORT __declspec(dllexport)
+#elif __GNUC__ >= 4
+# define G_MODULE_EXPORT __attribute__((visibility("default")))
+#else /* !G_PLATFORM_WIN32 && __GNUC__ < 4 */
+# define G_MODULE_EXPORT
+#endif /* !G_PLATFORM_WIN32 */
+
+/**
+ * GModuleFlags:
+ * @G_MODULE_BIND_LAZY: specifies that symbols are only resolved when
+ * needed. The default action is to bind all symbols when the module
+ * is loaded.
+ * @G_MODULE_BIND_LOCAL: specifies that symbols in the module should
+ * not be added to the global name space. The default action on most
+ * platforms is to place symbols in the module in the global name space,
+ * which may cause conflicts with existing symbols.
+ * @G_MODULE_BIND_MASK: mask for all flags.
+ *
+ * Flags passed to g_module_open().
+ * Note that these flags are not supported on all platforms.
+ */
+typedef enum
+{
+ G_MODULE_BIND_LAZY = 1 << 0,
+ G_MODULE_BIND_LOCAL = 1 << 1,
+ G_MODULE_BIND_MASK = 0x03
+} GModuleFlags;
+
+typedef struct _GModule GModule;
+typedef const gchar* (*GModuleCheckInit) (GModule *module);
+typedef void (*GModuleUnload) (GModule *module);
+
+/* return TRUE if dynamic module loading is supported */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_module_supported (void) G_GNUC_CONST;
+
+/* open a module 'file_name' and return handle, which is NULL on error */
+GLIB_AVAILABLE_IN_ALL
+GModule* g_module_open (const gchar *file_name,
+ GModuleFlags flags);
+
+/* close a previously opened module, returns TRUE on success */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_module_close (GModule *module);
+
+/* make a module resident so g_module_close on it will be ignored */
+GLIB_AVAILABLE_IN_ALL
+void g_module_make_resident (GModule *module);
+
+/* query the last module error as a string */
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_module_error (void);
+
+/* retrieve a symbol pointer from 'module', returns TRUE on success */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_module_symbol (GModule *module,
+ const gchar *symbol_name,
+ gpointer *symbol);
+
+/* retrieve the file name from an existing module */
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_module_name (GModule *module);
+
+/* Build the actual file name containing a module. 'directory' is the
+ * directory where the module file is supposed to be, or NULL or empty
+ * in which case it should either be in the current directory or, on
+ * some operating systems, in some standard place, for instance on the
+ * PATH. Hence, to be absoultely sure to get the correct module,
+ * always pass in a directory. The file name consists of the directory,
+ * if supplied, and 'module_name' suitably decorated according to
+ * the operating system's conventions (for instance lib*.so or *.dll).
+ *
+ * No checks are made that the file exists, or is of correct type.
+ */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_module_build_path (const gchar *directory,
+ const gchar *module_name);
+
+G_END_DECLS
+
+#endif /* __GMODULE_H__ */
diff --git a/include/glib/gobject/gbinding.h b/include/glib/gobject/gbinding.h
new file mode 100644
index 0000000000..b4eb233b34
--- /dev/null
+++ b/include/glib/gobject/gbinding.h
@@ -0,0 +1,149 @@
+/* gbinding.h: Binding for object properties
+ *
+ * Copyright (C) 2010 Intel Corp.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Emmanuele Bassi <ebassi@linux.intel.com>
+ */
+
+#ifndef __G_BINDING_H__
+#define __G_BINDING_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <glib.h>
+#include <gobject/gobject.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_BINDING_FLAGS (g_binding_flags_get_type ())
+
+#define G_TYPE_BINDING (g_binding_get_type ())
+#define G_BINDING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_BINDING, GBinding))
+#define G_IS_BINDING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_BINDING))
+
+/**
+ * GBinding:
+ *
+ * GBinding is an opaque structure whose members
+ * cannot be accessed directly.
+ *
+ * Since: 2.26
+ */
+typedef struct _GBinding GBinding;
+
+/**
+ * GBindingTransformFunc:
+ * @binding: a #GBinding
+ * @from_value: the #GValue containing the value to transform
+ * @to_value: the #GValue in which to store the transformed value
+ * @user_data: data passed to the transform function
+ *
+ * A function to be called to transform @from_value to @to_value. If
+ * this is the @transform_to function of a binding, then @from_value
+ * is the @source_property on the @source object, and @to_value is the
+ * @target_property on the @target object. If this is the
+ * @transform_from function of a %G_BINDING_BIDIRECTIONAL binding,
+ * then those roles are reversed.
+ *
+ * Returns: %TRUE if the transformation was successful, and %FALSE
+ * otherwise
+ *
+ * Since: 2.26
+ */
+typedef gboolean (* GBindingTransformFunc) (GBinding *binding,
+ const GValue *from_value,
+ GValue *to_value,
+ gpointer user_data);
+
+/**
+ * GBindingFlags:
+ * @G_BINDING_DEFAULT: The default binding; if the source property
+ * changes, the target property is updated with its value.
+ * @G_BINDING_BIDIRECTIONAL: Bidirectional binding; if either the
+ * property of the source or the property of the target changes,
+ * the other is updated.
+ * @G_BINDING_SYNC_CREATE: Synchronize the values of the source and
+ * target properties when creating the binding; the direction of
+ * the synchronization is always from the source to the target.
+ * @G_BINDING_INVERT_BOOLEAN: If the two properties being bound are
+ * booleans, setting one to %TRUE will result in the other being
+ * set to %FALSE and vice versa. This flag will only work for
+ * boolean properties, and cannot be used when passing custom
+ * transformation functions to g_object_bind_property_full().
+ *
+ * Flags to be passed to g_object_bind_property() or
+ * g_object_bind_property_full().
+ *
+ * This enumeration can be extended at later date.
+ *
+ * Since: 2.26
+ */
+typedef enum { /*< prefix=G_BINDING >*/
+ G_BINDING_DEFAULT = 0,
+
+ G_BINDING_BIDIRECTIONAL = 1 << 0,
+ G_BINDING_SYNC_CREATE = 1 << 1,
+ G_BINDING_INVERT_BOOLEAN = 1 << 2
+} GBindingFlags;
+
+GLIB_AVAILABLE_IN_ALL
+GType g_binding_flags_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_binding_get_type (void) G_GNUC_CONST;
+
+GLIB_AVAILABLE_IN_ALL
+GBindingFlags g_binding_get_flags (GBinding *binding);
+GLIB_AVAILABLE_IN_ALL
+GObject * g_binding_get_source (GBinding *binding);
+GLIB_AVAILABLE_IN_ALL
+GObject * g_binding_get_target (GBinding *binding);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_binding_get_source_property (GBinding *binding);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_binding_get_target_property (GBinding *binding);
+GLIB_AVAILABLE_IN_2_38
+void g_binding_unbind (GBinding *binding);
+
+GLIB_AVAILABLE_IN_ALL
+GBinding *g_object_bind_property (gpointer source,
+ const gchar *source_property,
+ gpointer target,
+ const gchar *target_property,
+ GBindingFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GBinding *g_object_bind_property_full (gpointer source,
+ const gchar *source_property,
+ gpointer target,
+ const gchar *target_property,
+ GBindingFlags flags,
+ GBindingTransformFunc transform_to,
+ GBindingTransformFunc transform_from,
+ gpointer user_data,
+ GDestroyNotify notify);
+GLIB_AVAILABLE_IN_ALL
+GBinding *g_object_bind_property_with_closures (gpointer source,
+ const gchar *source_property,
+ gpointer target,
+ const gchar *target_property,
+ GBindingFlags flags,
+ GClosure *transform_to,
+ GClosure *transform_from);
+
+G_END_DECLS
+
+#endif /* __G_BINDING_H__ */
diff --git a/include/glib/gobject/gboxed.h b/include/glib/gobject/gboxed.h
new file mode 100644
index 0000000000..bcaf0b01a2
--- /dev/null
+++ b/include/glib/gobject/gboxed.h
@@ -0,0 +1,122 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2000-2001 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_BOXED_H__
+#define __G_BOXED_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gtype.h>
+
+#ifndef __GI_SCANNER__
+#include <gobject/glib-types.h>
+#endif
+
+G_BEGIN_DECLS
+
+/* --- type macros --- */
+#define G_TYPE_IS_BOXED(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED)
+/**
+ * G_VALUE_HOLDS_BOXED:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values derived
+ * from type %G_TYPE_BOXED.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_BOXED(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOXED))
+
+
+/* --- typedefs --- */
+/**
+ * GBoxedCopyFunc:
+ * @boxed: (not nullable): The boxed structure to be copied.
+ *
+ * This function is provided by the user and should produce a copy
+ * of the passed in boxed structure.
+ *
+ * Returns: (not nullable): The newly created copy of the boxed structure.
+ */
+typedef gpointer (*GBoxedCopyFunc) (gpointer boxed);
+
+/**
+ * GBoxedFreeFunc:
+ * @boxed: (not nullable): The boxed structure to be freed.
+ *
+ * This function is provided by the user and should free the boxed
+ * structure passed.
+ */
+typedef void (*GBoxedFreeFunc) (gpointer boxed);
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+gpointer g_boxed_copy (GType boxed_type,
+ gconstpointer src_boxed);
+GLIB_AVAILABLE_IN_ALL
+void g_boxed_free (GType boxed_type,
+ gpointer boxed);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_boxed (GValue *value,
+ gconstpointer v_boxed);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_static_boxed (GValue *value,
+ gconstpointer v_boxed);
+GLIB_AVAILABLE_IN_ALL
+void g_value_take_boxed (GValue *value,
+ gconstpointer v_boxed);
+GLIB_DEPRECATED_FOR(g_value_take_boxed)
+void g_value_set_boxed_take_ownership (GValue *value,
+ gconstpointer v_boxed);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_value_get_boxed (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_value_dup_boxed (const GValue *value);
+
+
+/* --- convenience --- */
+GLIB_AVAILABLE_IN_ALL
+GType g_boxed_type_register_static (const gchar *name,
+ GBoxedCopyFunc boxed_copy,
+ GBoxedFreeFunc boxed_free);
+
+/* --- GObject boxed types --- */
+/**
+ * G_TYPE_CLOSURE:
+ *
+ * The #GType for #GClosure.
+ */
+#define G_TYPE_CLOSURE (g_closure_get_type ())
+
+/**
+ * G_TYPE_VALUE:
+ *
+ * The type ID of the "GValue" type which is a boxed type,
+ * used to pass around pointers to GValues.
+ */
+#define G_TYPE_VALUE (g_value_get_type ())
+
+GLIB_AVAILABLE_IN_ALL
+GType g_closure_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_value_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __G_BOXED_H__ */
diff --git a/include/glib/gobject/gclosure.h b/include/glib/gobject/gclosure.h
new file mode 100644
index 0000000000..a5c1c3fcb7
--- /dev/null
+++ b/include/glib/gobject/gclosure.h
@@ -0,0 +1,317 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2000-2001 Red Hat, Inc.
+ * Copyright (C) 2005 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_CLOSURE_H__
+#define __G_CLOSURE_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gtype.h>
+
+G_BEGIN_DECLS
+
+/* --- defines --- */
+/**
+ * G_CLOSURE_NEEDS_MARSHAL:
+ * @closure: a #GClosure
+ *
+ * Check if the closure still needs a marshaller. See g_closure_set_marshal().
+ *
+ * Returns: %TRUE if a #GClosureMarshal marshaller has not yet been set on
+ * @closure.
+ */
+#define G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL)
+/**
+ * G_CLOSURE_N_NOTIFIERS:
+ * @cl: a #GClosure
+ *
+ * Get the total number of notifiers connected with the closure @cl.
+ * The count includes the meta marshaller, the finalize and invalidate notifiers
+ * and the marshal guards. Note that each guard counts as two notifiers.
+ * See g_closure_set_meta_marshal(), g_closure_add_finalize_notifier(),
+ * g_closure_add_invalidate_notifier() and g_closure_add_marshal_guards().
+ *
+ * Returns: number of notifiers
+ */
+#define G_CLOSURE_N_NOTIFIERS(cl) (((cl)->n_guards << 1L) + \
+ (cl)->n_fnotifiers + (cl)->n_inotifiers)
+/**
+ * G_CCLOSURE_SWAP_DATA:
+ * @cclosure: a #GCClosure
+ *
+ * Checks whether the user data of the #GCClosure should be passed as the
+ * first parameter to the callback. See g_cclosure_new_swap().
+ *
+ * Returns: %TRUE if data has to be swapped.
+ */
+#define G_CCLOSURE_SWAP_DATA(cclosure) (((GClosure*) (cclosure))->derivative_flag)
+/**
+ * G_CALLBACK:
+ * @f: a function pointer.
+ *
+ * Cast a function pointer to a #GCallback.
+ */
+#define G_CALLBACK(f) ((GCallback) (f))
+
+
+/* -- typedefs --- */
+typedef struct _GClosure GClosure;
+typedef struct _GClosureNotifyData GClosureNotifyData;
+
+/**
+ * GCallback:
+ *
+ * The type used for callback functions in structure definitions and function
+ * signatures. This doesn't mean that all callback functions must take no
+ * parameters and return void. The required signature of a callback function
+ * is determined by the context in which is used (e.g. the signal to which it
+ * is connected). Use G_CALLBACK() to cast the callback function to a #GCallback.
+ */
+typedef void (*GCallback) (void);
+/**
+ * GClosureNotify:
+ * @data: data specified when registering the notification callback
+ * @closure: the #GClosure on which the notification is emitted
+ *
+ * The type used for the various notification callbacks which can be registered
+ * on closures.
+ */
+typedef void (*GClosureNotify) (gpointer data,
+ GClosure *closure);
+/**
+ * GClosureMarshal:
+ * @closure: the #GClosure to which the marshaller belongs
+ * @return_value: (nullable): a #GValue to store the return
+ * value. May be %NULL if the callback of @closure doesn't return a
+ * value.
+ * @n_param_values: the length of the @param_values array
+ * @param_values: (array length=n_param_values): an array of
+ * #GValues holding the arguments on which to invoke the
+ * callback of @closure
+ * @invocation_hint: (nullable): the invocation hint given as the
+ * last argument to g_closure_invoke()
+ * @marshal_data: (nullable): additional data specified when
+ * registering the marshaller, see g_closure_set_marshal() and
+ * g_closure_set_meta_marshal()
+ *
+ * The type used for marshaller functions.
+ */
+typedef void (*GClosureMarshal) (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+
+/**
+ * GVaClosureMarshal:
+ * @closure: the #GClosure to which the marshaller belongs
+ * @return_value: (nullable): a #GValue to store the return
+ * value. May be %NULL if the callback of @closure doesn't return a
+ * value.
+ * @instance: (type GObject.TypeInstance): the instance on which the closure is
+ * invoked.
+ * @args: va_list of arguments to be passed to the closure.
+ * @marshal_data: (nullable): additional data specified when
+ * registering the marshaller, see g_closure_set_marshal() and
+ * g_closure_set_meta_marshal()
+ * @n_params: the length of the @param_types array
+ * @param_types: (array length=n_params): the #GType of each argument from
+ * @args.
+ *
+ * This is the signature of va_list marshaller functions, an optional
+ * marshaller that can be used in some situations to avoid
+ * marshalling the signal argument into GValues.
+ */
+typedef void (* GVaClosureMarshal) (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/**
+ * GCClosure:
+ * @closure: the #GClosure
+ * @callback: the callback function
+ *
+ * A #GCClosure is a specialization of #GClosure for C function callbacks.
+ */
+typedef struct _GCClosure GCClosure;
+
+
+/* --- structures --- */
+struct _GClosureNotifyData
+{
+ gpointer data;
+ GClosureNotify notify;
+};
+/**
+ * GClosure:
+ * @in_marshal: Indicates whether the closure is currently being invoked with
+ * g_closure_invoke()
+ * @is_invalid: Indicates whether the closure has been invalidated by
+ * g_closure_invalidate()
+ *
+ * A #GClosure represents a callback supplied by the programmer.
+ */
+struct _GClosure
+{
+ /*< private >*/
+ volatile guint ref_count : 15;
+ /* meta_marshal is not used anymore but must be zero for historical reasons
+ as it was exposed in the G_CLOSURE_N_NOTIFIERS macro */
+ volatile guint meta_marshal_nouse : 1;
+ volatile guint n_guards : 1;
+ volatile guint n_fnotifiers : 2; /* finalization notifiers */
+ volatile guint n_inotifiers : 8; /* invalidation notifiers */
+ volatile guint in_inotify : 1;
+ volatile guint floating : 1;
+ /*< protected >*/
+ volatile guint derivative_flag : 1;
+ /*< public >*/
+ volatile guint in_marshal : 1;
+ volatile guint is_invalid : 1;
+
+ /*< private >*/ void (*marshal) (GClosure *closure,
+ GValue /*out*/ *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+ /*< protected >*/ gpointer data;
+
+ /*< private >*/ GClosureNotifyData *notifiers;
+
+ /* invariants/constraints:
+ * - ->marshal and ->data are _invalid_ as soon as ->is_invalid==TRUE
+ * - invocation of all inotifiers occours prior to fnotifiers
+ * - order of inotifiers is random
+ * inotifiers may _not_ free/invalidate parameter values (e.g. ->data)
+ * - order of fnotifiers is random
+ * - each notifier may only be removed before or during its invocation
+ * - reference counting may only happen prior to fnotify invocation
+ * (in that sense, fnotifiers are really finalization handlers)
+ */
+};
+/* closure for C function calls, callback() is the user function
+ */
+struct _GCClosure
+{
+ GClosure closure;
+ gpointer callback;
+};
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_cclosure_new (GCallback callback_func,
+ gpointer user_data,
+ GClosureNotify destroy_data);
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_cclosure_new_swap (GCallback callback_func,
+ gpointer user_data,
+ GClosureNotify destroy_data);
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_signal_type_cclosure_new (GType itype,
+ guint struct_offset);
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_closure_ref (GClosure *closure);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_sink (GClosure *closure);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_unref (GClosure *closure);
+/* intimidating */
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_closure_new_simple (guint sizeof_closure,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_add_finalize_notifier (GClosure *closure,
+ gpointer notify_data,
+ GClosureNotify notify_func);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_remove_finalize_notifier (GClosure *closure,
+ gpointer notify_data,
+ GClosureNotify notify_func);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_add_invalidate_notifier (GClosure *closure,
+ gpointer notify_data,
+ GClosureNotify notify_func);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_remove_invalidate_notifier (GClosure *closure,
+ gpointer notify_data,
+ GClosureNotify notify_func);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_add_marshal_guards (GClosure *closure,
+ gpointer pre_marshal_data,
+ GClosureNotify pre_marshal_notify,
+ gpointer post_marshal_data,
+ GClosureNotify post_marshal_notify);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_set_marshal (GClosure *closure,
+ GClosureMarshal marshal);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_set_meta_marshal (GClosure *closure,
+ gpointer marshal_data,
+ GClosureMarshal meta_marshal);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_invalidate (GClosure *closure);
+GLIB_AVAILABLE_IN_ALL
+void g_closure_invoke (GClosure *closure,
+ GValue /*out*/ *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint);
+
+/* FIXME:
+ OK: data_object::destroy -> closure_invalidate();
+ MIS: closure_invalidate() -> disconnect(closure);
+ MIS: disconnect(closure) -> (unlink) closure_unref();
+ OK: closure_finalize() -> g_free (data_string);
+
+ random remarks:
+ - need marshaller repo with decent aliasing to base types
+ - provide marshaller collection, virtually covering anything out there
+*/
+
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_generic (GClosure *closure,
+ GValue *return_gvalue,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_generic_va (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args_list,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+
+G_END_DECLS
+
+#endif /* __G_CLOSURE_H__ */
diff --git a/include/glib/gobject/genums.h b/include/glib/gobject/genums.h
new file mode 100644
index 0000000000..c66ce45c00
--- /dev/null
+++ b/include/glib/gobject/genums.h
@@ -0,0 +1,279 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_ENUMS_H__
+#define __G_ENUMS_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gtype.h>
+
+G_BEGIN_DECLS
+
+/* --- type macros --- */
+/**
+ * G_TYPE_IS_ENUM:
+ * @type: a #GType ID.
+ *
+ * Checks whether @type "is a" %G_TYPE_ENUM.
+ *
+ * Returns: %TRUE if @type "is a" %G_TYPE_ENUM.
+ */
+#define G_TYPE_IS_ENUM(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM)
+/**
+ * G_ENUM_CLASS:
+ * @class: a valid #GEnumClass
+ *
+ * Casts a derived #GEnumClass structure into a #GEnumClass structure.
+ */
+#define G_ENUM_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_ENUM, GEnumClass))
+/**
+ * G_IS_ENUM_CLASS:
+ * @class: a #GEnumClass
+ *
+ * Checks whether @class "is a" valid #GEnumClass structure of type %G_TYPE_ENUM
+ * or derived.
+ */
+#define G_IS_ENUM_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_ENUM))
+/**
+ * G_ENUM_CLASS_TYPE:
+ * @class: a #GEnumClass
+ *
+ * Get the type identifier from a given #GEnumClass structure.
+ *
+ * Returns: the #GType
+ */
+#define G_ENUM_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
+/**
+ * G_ENUM_CLASS_TYPE_NAME:
+ * @class: a #GEnumClass
+ *
+ * Get the static type name from a given #GEnumClass structure.
+ *
+ * Returns: the type name.
+ */
+#define G_ENUM_CLASS_TYPE_NAME(class) (g_type_name (G_ENUM_CLASS_TYPE (class)))
+
+
+/**
+ * G_TYPE_IS_FLAGS:
+ * @type: a #GType ID.
+ *
+ * Checks whether @type "is a" %G_TYPE_FLAGS.
+ *
+ * Returns: %TRUE if @type "is a" %G_TYPE_FLAGS.
+ */
+#define G_TYPE_IS_FLAGS(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_FLAGS)
+/**
+ * G_FLAGS_CLASS:
+ * @class: a valid #GFlagsClass
+ *
+ * Casts a derived #GFlagsClass structure into a #GFlagsClass structure.
+ */
+#define G_FLAGS_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_FLAGS, GFlagsClass))
+/**
+ * G_IS_FLAGS_CLASS:
+ * @class: a #GFlagsClass
+ *
+ * Checks whether @class "is a" valid #GFlagsClass structure of type %G_TYPE_FLAGS
+ * or derived.
+ */
+#define G_IS_FLAGS_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_FLAGS))
+/**
+ * G_FLAGS_CLASS_TYPE:
+ * @class: a #GFlagsClass
+ *
+ * Get the type identifier from a given #GFlagsClass structure.
+ *
+ * Returns: the #GType
+ */
+#define G_FLAGS_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
+/**
+ * G_FLAGS_CLASS_TYPE_NAME:
+ * @class: a #GFlagsClass
+ *
+ * Get the static type name from a given #GFlagsClass structure.
+ *
+ * Returns: the type name.
+ */
+#define G_FLAGS_CLASS_TYPE_NAME(class) (g_type_name (G_FLAGS_CLASS_TYPE (class)))
+
+
+/**
+ * G_VALUE_HOLDS_ENUM:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values derived from type %G_TYPE_ENUM.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_ENUM(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_ENUM))
+/**
+ * G_VALUE_HOLDS_FLAGS:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values derived from type %G_TYPE_FLAGS.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_FLAGS(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLAGS))
+
+
+/* --- enum/flag values & classes --- */
+typedef struct _GEnumClass GEnumClass;
+typedef struct _GFlagsClass GFlagsClass;
+typedef struct _GEnumValue GEnumValue;
+typedef struct _GFlagsValue GFlagsValue;
+
+/**
+ * GEnumClass:
+ * @g_type_class: the parent class
+ * @minimum: the smallest possible value.
+ * @maximum: the largest possible value.
+ * @n_values: the number of possible values.
+ * @values: an array of #GEnumValue structs describing the
+ * individual values.
+ *
+ * The class of an enumeration type holds information about its
+ * possible values.
+ */
+struct _GEnumClass
+{
+ GTypeClass g_type_class;
+
+ /*< public >*/
+ gint minimum;
+ gint maximum;
+ guint n_values;
+ GEnumValue *values;
+};
+/**
+ * GFlagsClass:
+ * @g_type_class: the parent class
+ * @mask: a mask covering all possible values.
+ * @n_values: the number of possible values.
+ * @values: an array of #GFlagsValue structs describing the
+ * individual values.
+ *
+ * The class of a flags type holds information about its
+ * possible values.
+ */
+struct _GFlagsClass
+{
+ GTypeClass g_type_class;
+
+ /*< public >*/
+ guint mask;
+ guint n_values;
+ GFlagsValue *values;
+};
+/**
+ * GEnumValue:
+ * @value: the enum value
+ * @value_name: the name of the value
+ * @value_nick: the nickname of the value
+ *
+ * A structure which contains a single enum value, its name, and its
+ * nickname.
+ */
+struct _GEnumValue
+{
+ gint value;
+ const gchar *value_name;
+ const gchar *value_nick;
+};
+/**
+ * GFlagsValue:
+ * @value: the flags value
+ * @value_name: the name of the value
+ * @value_nick: the nickname of the value
+ *
+ * A structure which contains a single flags value, its name, and its
+ * nickname.
+ */
+struct _GFlagsValue
+{
+ guint value;
+ const gchar *value_name;
+ const gchar *value_nick;
+};
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GEnumValue* g_enum_get_value (GEnumClass *enum_class,
+ gint value);
+GLIB_AVAILABLE_IN_ALL
+GEnumValue* g_enum_get_value_by_name (GEnumClass *enum_class,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+GEnumValue* g_enum_get_value_by_nick (GEnumClass *enum_class,
+ const gchar *nick);
+GLIB_AVAILABLE_IN_ALL
+GFlagsValue* g_flags_get_first_value (GFlagsClass *flags_class,
+ guint value);
+GLIB_AVAILABLE_IN_ALL
+GFlagsValue* g_flags_get_value_by_name (GFlagsClass *flags_class,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+GFlagsValue* g_flags_get_value_by_nick (GFlagsClass *flags_class,
+ const gchar *nick);
+GLIB_AVAILABLE_IN_2_54
+gchar *g_enum_to_string (GType g_enum_type,
+ gint value);
+GLIB_AVAILABLE_IN_2_54
+gchar *g_flags_to_string (GType flags_type,
+ guint value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_enum (GValue *value,
+ gint v_enum);
+GLIB_AVAILABLE_IN_ALL
+gint g_value_get_enum (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_flags (GValue *value,
+ guint v_flags);
+GLIB_AVAILABLE_IN_ALL
+guint g_value_get_flags (const GValue *value);
+
+
+
+/* --- registration functions --- */
+/* const_static_values is a NULL terminated array of enum/flags
+ * values that is taken over!
+ */
+GLIB_AVAILABLE_IN_ALL
+GType g_enum_register_static (const gchar *name,
+ const GEnumValue *const_static_values);
+GLIB_AVAILABLE_IN_ALL
+GType g_flags_register_static (const gchar *name,
+ const GFlagsValue *const_static_values);
+/* functions to complete the type information
+ * for enums/flags implemented by plugins
+ */
+GLIB_AVAILABLE_IN_ALL
+void g_enum_complete_type_info (GType g_enum_type,
+ GTypeInfo *info,
+ const GEnumValue *const_values);
+GLIB_AVAILABLE_IN_ALL
+void g_flags_complete_type_info (GType g_flags_type,
+ GTypeInfo *info,
+ const GFlagsValue *const_values);
+
+G_END_DECLS
+
+#endif /* __G_ENUMS_H__ */
diff --git a/include/glib/gobject/glib-enumtypes.h b/include/glib/gobject/glib-enumtypes.h
new file mode 100644
index 0000000000..9844954982
--- /dev/null
+++ b/include/glib/gobject/glib-enumtypes.h
@@ -0,0 +1,25 @@
+
+/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+
+#ifndef __GOBJECT_ENUM_TYPES_H__
+#define __GOBJECT_ENUM_TYPES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* enumerations from "../gobject/../glib/gunicode.h" */
+GLIB_AVAILABLE_IN_2_60 GType g_unicode_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type ())
+GLIB_AVAILABLE_IN_2_60 GType g_unicode_break_type_get_type (void) G_GNUC_CONST;
+#define G_TYPE_UNICODE_BREAK_TYPE (g_unicode_break_type_get_type ())
+GLIB_AVAILABLE_IN_2_60 GType g_unicode_script_get_type (void) G_GNUC_CONST;
+#define G_TYPE_UNICODE_SCRIPT (g_unicode_script_get_type ())
+GLIB_AVAILABLE_IN_2_60 GType g_normalize_mode_get_type (void) G_GNUC_CONST;
+#define G_TYPE_NORMALIZE_MODE (g_normalize_mode_get_type ())
+G_END_DECLS
+
+#endif /* __GOBJECT_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
diff --git a/include/glib/gobject/glib-types.h b/include/glib/gobject/glib-types.h
new file mode 100644
index 0000000000..78a199d1d1
--- /dev/null
+++ b/include/glib/gobject/glib-types.h
@@ -0,0 +1,362 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2000-2001 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __GLIB_TYPES_H__
+#define __GLIB_TYPES_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION) && !defined(GLIB_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/* A hack necesssary to preprocess this file with g-ir-scanner */
+#ifdef __GI_SCANNER__
+typedef gsize GType;
+#endif
+
+/* --- GLib boxed types --- */
+/**
+ * G_TYPE_DATE:
+ *
+ * The #GType for #GDate.
+ */
+#define G_TYPE_DATE (g_date_get_type ())
+
+/**
+ * G_TYPE_STRV:
+ *
+ * The #GType for a boxed type holding a %NULL-terminated array of strings.
+ *
+ * The code fragments in the following example show the use of a property of
+ * type #G_TYPE_STRV with g_object_class_install_property(), g_object_set()
+ * and g_object_get().
+ *
+ * |[
+ * g_object_class_install_property (object_class,
+ * PROP_AUTHORS,
+ * g_param_spec_boxed ("authors",
+ * _("Authors"),
+ * _("List of authors"),
+ * G_TYPE_STRV,
+ * G_PARAM_READWRITE));
+ *
+ * gchar *authors[] = { "Owen", "Tim", NULL };
+ * g_object_set (obj, "authors", authors, NULL);
+ *
+ * gchar *writers[];
+ * g_object_get (obj, "authors", &writers, NULL);
+ * /&ast; do something with writers &ast;/
+ * g_strfreev (writers);
+ * ]|
+ *
+ * Since: 2.4
+ */
+#define G_TYPE_STRV (g_strv_get_type ())
+
+/**
+ * G_TYPE_GSTRING:
+ *
+ * The #GType for #GString.
+ */
+#define G_TYPE_GSTRING (g_gstring_get_type ())
+
+/**
+ * G_TYPE_HASH_TABLE:
+ *
+ * The #GType for a boxed type holding a #GHashTable reference.
+ *
+ * Since: 2.10
+ */
+#define G_TYPE_HASH_TABLE (g_hash_table_get_type ())
+
+/**
+ * G_TYPE_REGEX:
+ *
+ * The #GType for a boxed type holding a #GRegex reference.
+ *
+ * Since: 2.14
+ */
+#define G_TYPE_REGEX (g_regex_get_type ())
+
+/**
+ * G_TYPE_MATCH_INFO:
+ *
+ * The #GType for a boxed type holding a #GMatchInfo reference.
+ *
+ * Since: 2.30
+ */
+#define G_TYPE_MATCH_INFO (g_match_info_get_type ())
+
+/**
+ * G_TYPE_ARRAY:
+ *
+ * The #GType for a boxed type holding a #GArray reference.
+ *
+ * Since: 2.22
+ */
+#define G_TYPE_ARRAY (g_array_get_type ())
+
+/**
+ * G_TYPE_BYTE_ARRAY:
+ *
+ * The #GType for a boxed type holding a #GByteArray reference.
+ *
+ * Since: 2.22
+ */
+#define G_TYPE_BYTE_ARRAY (g_byte_array_get_type ())
+
+/**
+ * G_TYPE_PTR_ARRAY:
+ *
+ * The #GType for a boxed type holding a #GPtrArray reference.
+ *
+ * Since: 2.22
+ */
+#define G_TYPE_PTR_ARRAY (g_ptr_array_get_type ())
+
+/**
+ * G_TYPE_BYTES:
+ *
+ * The #GType for #GBytes.
+ *
+ * Since: 2.32
+ */
+#define G_TYPE_BYTES (g_bytes_get_type ())
+
+/**
+ * G_TYPE_VARIANT_TYPE:
+ *
+ * The #GType for a boxed type holding a #GVariantType.
+ *
+ * Since: 2.24
+ */
+#define G_TYPE_VARIANT_TYPE (g_variant_type_get_gtype ())
+
+/**
+ * G_TYPE_ERROR:
+ *
+ * The #GType for a boxed type holding a #GError.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_ERROR (g_error_get_type ())
+
+/**
+ * G_TYPE_DATE_TIME:
+ *
+ * The #GType for a boxed type holding a #GDateTime.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_DATE_TIME (g_date_time_get_type ())
+
+/**
+ * G_TYPE_TIME_ZONE:
+ *
+ * The #GType for a boxed type holding a #GTimeZone.
+ *
+ * Since: 2.34
+ */
+#define G_TYPE_TIME_ZONE (g_time_zone_get_type ())
+
+/**
+ * G_TYPE_IO_CHANNEL:
+ *
+ * The #GType for #GIOChannel.
+ */
+#define G_TYPE_IO_CHANNEL (g_io_channel_get_type ())
+
+/**
+ * G_TYPE_IO_CONDITION:
+ *
+ * The #GType for #GIOCondition.
+ */
+#define G_TYPE_IO_CONDITION (g_io_condition_get_type ())
+
+/**
+ * G_TYPE_VARIANT_BUILDER:
+ *
+ * The #GType for a boxed type holding a #GVariantBuilder.
+ *
+ * Since: 2.30
+ */
+#define G_TYPE_VARIANT_BUILDER (g_variant_builder_get_type ())
+
+/**
+ * G_TYPE_VARIANT_DICT:
+ *
+ * The #GType for a boxed type holding a #GVariantDict.
+ *
+ * Since: 2.40
+ */
+#define G_TYPE_VARIANT_DICT (g_variant_dict_get_type ())
+
+/**
+ * G_TYPE_MAIN_LOOP:
+ *
+ * The #GType for a boxed type holding a #GMainLoop.
+ *
+ * Since: 2.30
+ */
+#define G_TYPE_MAIN_LOOP (g_main_loop_get_type ())
+
+/**
+ * G_TYPE_MAIN_CONTEXT:
+ *
+ * The #GType for a boxed type holding a #GMainContext.
+ *
+ * Since: 2.30
+ */
+#define G_TYPE_MAIN_CONTEXT (g_main_context_get_type ())
+
+/**
+ * G_TYPE_SOURCE:
+ *
+ * The #GType for a boxed type holding a #GSource.
+ *
+ * Since: 2.30
+ */
+#define G_TYPE_SOURCE (g_source_get_type ())
+
+/**
+ * G_TYPE_POLLFD:
+ *
+ * The #GType for a boxed type holding a #GPollFD.
+ *
+ * Since: 2.36
+ */
+#define G_TYPE_POLLFD (g_pollfd_get_type ())
+
+/**
+ * G_TYPE_MARKUP_PARSE_CONTEXT:
+ *
+ * The #GType for a boxed type holding a #GMarkupParseContext.
+ *
+ * Since: 2.36
+ */
+#define G_TYPE_MARKUP_PARSE_CONTEXT (g_markup_parse_context_get_type ())
+
+/**
+ * G_TYPE_KEY_FILE:
+ *
+ * The #GType for a boxed type holding a #GKeyFile.
+ *
+ * Since: 2.32
+ */
+#define G_TYPE_KEY_FILE (g_key_file_get_type ())
+
+/**
+ * G_TYPE_MAPPED_FILE:
+ *
+ * The #GType for a boxed type holding a #GMappedFile.
+ *
+ * Since: 2.40
+ */
+#define G_TYPE_MAPPED_FILE (g_mapped_file_get_type ())
+
+/**
+ * G_TYPE_THREAD:
+ *
+ * The #GType for a boxed type holding a #GThread.
+ *
+ * Since: 2.36
+ */
+#define G_TYPE_THREAD (g_thread_get_type ())
+
+/**
+ * G_TYPE_CHECKSUM:
+ *
+ * The #GType for a boxed type holding a #GChecksum.
+ *
+ * Since: 2.36
+ */
+#define G_TYPE_CHECKSUM (g_checksum_get_type ())
+
+/**
+ * G_TYPE_OPTION_GROUP:
+ *
+ * The #GType for a boxed type holding a #GOptionGroup.
+ *
+ * Since: 2.44
+ */
+#define G_TYPE_OPTION_GROUP (g_option_group_get_type ())
+
+GLIB_AVAILABLE_IN_ALL
+GType g_date_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_strv_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_gstring_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_hash_table_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_array_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_byte_array_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_ptr_array_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_bytes_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_variant_type_get_gtype (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_regex_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_30
+GType g_match_info_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_error_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_date_time_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_time_zone_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_io_channel_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_io_condition_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_variant_builder_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_40
+GType g_variant_dict_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+GType g_key_file_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_30
+GType g_main_loop_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_30
+GType g_main_context_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_30
+GType g_source_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_36
+GType g_pollfd_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_36
+GType g_thread_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_36
+GType g_checksum_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_36
+GType g_markup_parse_context_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_40
+GType g_mapped_file_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_2_44
+GType g_option_group_get_type (void) G_GNUC_CONST;
+
+GLIB_DEPRECATED_FOR('G_TYPE_VARIANT')
+GType g_variant_get_gtype (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GLIB_TYPES_H__ */
diff --git a/include/glib/gobject/gmarshal.h b/include/glib/gobject/gmarshal.h
new file mode 100644
index 0000000000..fdd6c042e1
--- /dev/null
+++ b/include/glib/gobject/gmarshal.h
@@ -0,0 +1,434 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_MARSHAL_H__
+#define __G_MARSHAL_H__
+
+G_BEGIN_DECLS
+
+/* VOID:VOID */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__VOID (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__VOIDv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:BOOLEAN */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__BOOLEAN (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__BOOLEANv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:CHAR */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__CHAR (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__CHARv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:UCHAR */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__UCHAR (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__UCHARv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:INT */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__INT (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__INTv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:UINT */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__UINT (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__UINTv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:LONG */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__LONG (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__LONGv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:ULONG */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__ULONG (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__ULONGv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:ENUM */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__ENUM (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__ENUMv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:FLAGS */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__FLAGS (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__FLAGSv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:FLOAT */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__FLOAT (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__FLOATv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:DOUBLE */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__DOUBLE (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__DOUBLEv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:STRING */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__STRING (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__STRINGv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:PARAM */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__PARAM (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__PARAMv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:BOXED */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__BOXED (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__BOXEDv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:POINTER */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__POINTERv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:OBJECT */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__OBJECT (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__OBJECTv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:VARIANT */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__VARIANT (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__VARIANTv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* VOID:UINT,POINTER */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__UINT_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_VOID__UINT_POINTERv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* BOOL:FLAGS */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_BOOLEAN__FLAGS (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_BOOLEAN__FLAGSv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/**
+ * g_cclosure_marshal_BOOL__FLAGS:
+ * @closure: A #GClosure.
+ * @return_value: A #GValue to store the return value. May be %NULL
+ * if the callback of closure doesn't return a value.
+ * @n_param_values: The length of the @param_values array.
+ * @param_values: An array of #GValues holding the arguments
+ * on which to invoke the callback of closure.
+ * @invocation_hint: The invocation hint given as the last argument to
+ * g_closure_invoke().
+ * @marshal_data: Additional data specified when registering the
+ * marshaller, see g_closure_set_marshal() and
+ * g_closure_set_meta_marshal()
+ *
+ * An old alias for g_cclosure_marshal_BOOLEAN__FLAGS().
+ */
+#define g_cclosure_marshal_BOOL__FLAGS g_cclosure_marshal_BOOLEAN__FLAGS
+
+/* STRING:OBJECT,POINTER */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_STRING__OBJECT_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_STRING__OBJECT_POINTERv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/* BOOL:BOXED,BOXED */
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_BOOLEAN__BOXED_BOXED (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+GLIB_AVAILABLE_IN_ALL
+void g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv (GClosure *closure,
+ GValue *return_value,
+ gpointer instance,
+ va_list args,
+ gpointer marshal_data,
+ int n_params,
+ GType *param_types);
+
+/**
+ * g_cclosure_marshal_BOOL__BOXED_BOXED:
+ * @closure: A #GClosure.
+ * @return_value: A #GValue to store the return value. May be %NULL
+ * if the callback of closure doesn't return a value.
+ * @n_param_values: The length of the @param_values array.
+ * @param_values: An array of #GValues holding the arguments
+ * on which to invoke the callback of closure.
+ * @invocation_hint: The invocation hint given as the last argument to
+ * g_closure_invoke().
+ * @marshal_data: Additional data specified when registering the
+ * marshaller, see g_closure_set_marshal() and
+ * g_closure_set_meta_marshal()
+ *
+ * An old alias for g_cclosure_marshal_BOOLEAN__BOXED_BOXED().
+ */
+#define g_cclosure_marshal_BOOL__BOXED_BOXED g_cclosure_marshal_BOOLEAN__BOXED_BOXED
+
+G_END_DECLS
+
+#endif /* __G_MARSHAL_H__ */
diff --git a/include/glib/gobject/gobject-autocleanups.h b/include/glib/gobject/gobject-autocleanups.h
new file mode 100644
index 0000000000..1613857ecd
--- /dev/null
+++ b/include/glib/gobject/gobject-autocleanups.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright © 2015 Canonical Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GClosure, g_closure_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GEnumClass, g_type_class_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFlagsClass, g_type_class_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitiallyUnowned, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GParamSpec, g_param_spec_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTypeClass, g_type_class_unref)
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)
diff --git a/include/glib/gobject/gobject.h b/include/glib/gobject/gobject.h
new file mode 100644
index 0000000000..91b9f63283
--- /dev/null
+++ b/include/glib/gobject/gobject.h
@@ -0,0 +1,899 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_OBJECT_H__
+#define __G_OBJECT_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gtype.h>
+#include <gobject/gvalue.h>
+#include <gobject/gparam.h>
+#include <gobject/gclosure.h>
+#include <gobject/gsignal.h>
+#include <gobject/gboxed.h>
+
+G_BEGIN_DECLS
+
+/* --- type macros --- */
+/**
+ * G_TYPE_IS_OBJECT:
+ * @type: Type id to check
+ *
+ * Check if the passed in type id is a %G_TYPE_OBJECT or derived from it.
+ *
+ * Returns: %FALSE or %TRUE, indicating whether @type is a %G_TYPE_OBJECT.
+ */
+#define G_TYPE_IS_OBJECT(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_OBJECT)
+/**
+ * G_OBJECT:
+ * @object: Object which is subject to casting.
+ *
+ * Casts a #GObject or derived pointer into a (GObject*) pointer.
+ * Depending on the current debugging level, this function may invoke
+ * certain runtime checks to identify invalid casts.
+ */
+#define G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject))
+/**
+ * G_OBJECT_CLASS:
+ * @class: a valid #GObjectClass
+ *
+ * Casts a derived #GObjectClass structure into a #GObjectClass structure.
+ */
+#define G_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_OBJECT, GObjectClass))
+/**
+ * G_IS_OBJECT:
+ * @object: Instance to check for being a %G_TYPE_OBJECT.
+ *
+ * Checks whether a valid #GTypeInstance pointer is of type %G_TYPE_OBJECT.
+ */
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_42
+#define G_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE ((object), G_TYPE_OBJECT))
+#else
+#define G_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_OBJECT))
+#endif
+/**
+ * G_IS_OBJECT_CLASS:
+ * @class: a #GObjectClass
+ *
+ * Checks whether @class "is a" valid #GObjectClass structure of type
+ * %G_TYPE_OBJECT or derived.
+ */
+#define G_IS_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_OBJECT))
+/**
+ * G_OBJECT_GET_CLASS:
+ * @object: a #GObject instance.
+ *
+ * Get the class structure associated to a #GObject instance.
+ *
+ * Returns: pointer to object class structure.
+ */
+#define G_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), G_TYPE_OBJECT, GObjectClass))
+/**
+ * G_OBJECT_TYPE:
+ * @object: Object to return the type id for.
+ *
+ * Get the type id of an object.
+ *
+ * Returns: Type id of @object.
+ */
+#define G_OBJECT_TYPE(object) (G_TYPE_FROM_INSTANCE (object))
+/**
+ * G_OBJECT_TYPE_NAME:
+ * @object: Object to return the type name for.
+ *
+ * Get the name of an object's type.
+ *
+ * Returns: Type name of @object. The string is owned by the type system and
+ * should not be freed.
+ */
+#define G_OBJECT_TYPE_NAME(object) (g_type_name (G_OBJECT_TYPE (object)))
+/**
+ * G_OBJECT_CLASS_TYPE:
+ * @class: a valid #GObjectClass
+ *
+ * Get the type id of a class structure.
+ *
+ * Returns: Type id of @class.
+ */
+#define G_OBJECT_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
+/**
+ * G_OBJECT_CLASS_NAME:
+ * @class: a valid #GObjectClass
+ *
+ * Return the name of a class structure's type.
+ *
+ * Returns: Type name of @class. The string is owned by the type system and
+ * should not be freed.
+ */
+#define G_OBJECT_CLASS_NAME(class) (g_type_name (G_OBJECT_CLASS_TYPE (class)))
+/**
+ * G_VALUE_HOLDS_OBJECT:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values derived from type %G_TYPE_OBJECT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_OBJECT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_OBJECT))
+
+/* --- type macros --- */
+/**
+ * G_TYPE_INITIALLY_UNOWNED:
+ *
+ * The type for #GInitiallyUnowned.
+ */
+#define G_TYPE_INITIALLY_UNOWNED (g_initially_unowned_get_type())
+/**
+ * G_INITIALLY_UNOWNED:
+ * @object: Object which is subject to casting.
+ *
+ * Casts a #GInitiallyUnowned or derived pointer into a (GInitiallyUnowned*)
+ * pointer. Depending on the current debugging level, this function may invoke
+ * certain runtime checks to identify invalid casts.
+ */
+#define G_INITIALLY_UNOWNED(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_INITIALLY_UNOWNED, GInitiallyUnowned))
+/**
+ * G_INITIALLY_UNOWNED_CLASS:
+ * @class: a valid #GInitiallyUnownedClass
+ *
+ * Casts a derived #GInitiallyUnownedClass structure into a
+ * #GInitiallyUnownedClass structure.
+ */
+#define G_INITIALLY_UNOWNED_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_INITIALLY_UNOWNED, GInitiallyUnownedClass))
+/**
+ * G_IS_INITIALLY_UNOWNED:
+ * @object: Instance to check for being a %G_TYPE_INITIALLY_UNOWNED.
+ *
+ * Checks whether a valid #GTypeInstance pointer is of type %G_TYPE_INITIALLY_UNOWNED.
+ */
+#define G_IS_INITIALLY_UNOWNED(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_INITIALLY_UNOWNED))
+/**
+ * G_IS_INITIALLY_UNOWNED_CLASS:
+ * @class: a #GInitiallyUnownedClass
+ *
+ * Checks whether @class "is a" valid #GInitiallyUnownedClass structure of type
+ * %G_TYPE_INITIALLY_UNOWNED or derived.
+ */
+#define G_IS_INITIALLY_UNOWNED_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_INITIALLY_UNOWNED))
+/**
+ * G_INITIALLY_UNOWNED_GET_CLASS:
+ * @object: a #GInitiallyUnowned instance.
+ *
+ * Get the class structure associated to a #GInitiallyUnowned instance.
+ *
+ * Returns: pointer to object class structure.
+ */
+#define G_INITIALLY_UNOWNED_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), G_TYPE_INITIALLY_UNOWNED, GInitiallyUnownedClass))
+/* GInitiallyUnowned ia a GObject with initially floating reference count */
+
+
+/* --- typedefs & structures --- */
+typedef struct _GObject GObject;
+typedef struct _GObjectClass GObjectClass;
+typedef struct _GObject GInitiallyUnowned;
+typedef struct _GObjectClass GInitiallyUnownedClass;
+typedef struct _GObjectConstructParam GObjectConstructParam;
+/**
+ * GObjectGetPropertyFunc:
+ * @object: a #GObject
+ * @property_id: the numeric id under which the property was registered with
+ * g_object_class_install_property().
+ * @value: a #GValue to return the property value in
+ * @pspec: the #GParamSpec describing the property
+ *
+ * The type of the @get_property function of #GObjectClass.
+ */
+typedef void (*GObjectGetPropertyFunc) (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+/**
+ * GObjectSetPropertyFunc:
+ * @object: a #GObject
+ * @property_id: the numeric id under which the property was registered with
+ * g_object_class_install_property().
+ * @value: the new value for the property
+ * @pspec: the #GParamSpec describing the property
+ *
+ * The type of the @set_property function of #GObjectClass.
+ */
+typedef void (*GObjectSetPropertyFunc) (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+/**
+ * GObjectFinalizeFunc:
+ * @object: the #GObject being finalized
+ *
+ * The type of the @finalize function of #GObjectClass.
+ */
+typedef void (*GObjectFinalizeFunc) (GObject *object);
+/**
+ * GWeakNotify:
+ * @data: data that was provided when the weak reference was established
+ * @where_the_object_was: the object being finalized
+ *
+ * A #GWeakNotify function can be added to an object as a callback that gets
+ * triggered when the object is finalized. Since the object is already being
+ * finalized when the #GWeakNotify is called, there's not much you could do
+ * with the object, apart from e.g. using its address as hash-index or the like.
+ */
+typedef void (*GWeakNotify) (gpointer data,
+ GObject *where_the_object_was);
+/**
+ * GObject:
+ *
+ * All the fields in the GObject structure are private
+ * to the #GObject implementation and should never be accessed directly.
+ */
+struct _GObject
+{
+ GTypeInstance g_type_instance;
+
+ /*< private >*/
+ volatile guint ref_count;
+ GData *qdata;
+};
+/**
+ * GObjectClass:
+ * @g_type_class: the parent class
+ * @constructor: the @constructor function is called by g_object_new () to
+ * complete the object initialization after all the construction properties are
+ * set. The first thing a @constructor implementation must do is chain up to the
+ * @constructor of the parent class. Overriding @constructor should be rarely
+ * needed, e.g. to handle construct properties, or to implement singletons.
+ * @set_property: the generic setter for all properties of this type. Should be
+ * overridden for every type with properties. If implementations of
+ * @set_property don't emit property change notification explicitly, this will
+ * be done implicitly by the type system. However, if the notify signal is
+ * emitted explicitly, the type system will not emit it a second time.
+ * @get_property: the generic getter for all properties of this type. Should be
+ * overridden for every type with properties.
+ * @dispose: the @dispose function is supposed to drop all references to other
+ * objects, but keep the instance otherwise intact, so that client method
+ * invocations still work. It may be run multiple times (due to reference
+ * loops). Before returning, @dispose should chain up to the @dispose method
+ * of the parent class.
+ * @finalize: instance finalization function, should finish the finalization of
+ * the instance begun in @dispose and chain up to the @finalize method of the
+ * parent class.
+ * @dispatch_properties_changed: emits property change notification for a bunch
+ * of properties. Overriding @dispatch_properties_changed should be rarely
+ * needed.
+ * @notify: the class closure for the notify signal
+ * @constructed: the @constructed function is called by g_object_new() as the
+ * final step of the object creation process. At the point of the call, all
+ * construction properties have been set on the object. The purpose of this
+ * call is to allow for object initialisation steps that can only be performed
+ * after construction properties have been set. @constructed implementors
+ * should chain up to the @constructed call of their parent class to allow it
+ * to complete its initialisation.
+ *
+ * The class structure for the GObject type.
+ *
+ * |[<!-- language="C" -->
+ * // Example of implementing a singleton using a constructor.
+ * static MySingleton *the_singleton = NULL;
+ *
+ * static GObject*
+ * my_singleton_constructor (GType type,
+ * guint n_construct_params,
+ * GObjectConstructParam *construct_params)
+ * {
+ * GObject *object;
+ *
+ * if (!the_singleton)
+ * {
+ * object = G_OBJECT_CLASS (parent_class)->constructor (type,
+ * n_construct_params,
+ * construct_params);
+ * the_singleton = MY_SINGLETON (object);
+ * }
+ * else
+ * object = g_object_ref (G_OBJECT (the_singleton));
+ *
+ * return object;
+ * }
+ * ]|
+ */
+struct _GObjectClass
+{
+ GTypeClass g_type_class;
+
+ /*< private >*/
+ GSList *construct_properties;
+
+ /*< public >*/
+ /* seldom overidden */
+ GObject* (*constructor) (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_properties);
+ /* overridable methods */
+ void (*set_property) (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+ void (*get_property) (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+ void (*dispose) (GObject *object);
+ void (*finalize) (GObject *object);
+ /* seldom overidden */
+ void (*dispatch_properties_changed) (GObject *object,
+ guint n_pspecs,
+ GParamSpec **pspecs);
+ /* signals */
+ void (*notify) (GObject *object,
+ GParamSpec *pspec);
+
+ /* called when done constructing */
+ void (*constructed) (GObject *object);
+
+ /*< private >*/
+ gsize flags;
+
+ /* padding */
+ gpointer pdummy[6];
+};
+/**
+ * GObjectConstructParam:
+ * @pspec: the #GParamSpec of the construct parameter
+ * @value: the value to set the parameter to
+ *
+ * The GObjectConstructParam struct is an auxiliary
+ * structure used to hand #GParamSpec/#GValue pairs to the @constructor of
+ * a #GObjectClass.
+ */
+struct _GObjectConstructParam
+{
+ GParamSpec *pspec;
+ GValue *value;
+};
+
+/**
+ * GInitiallyUnowned:
+ *
+ * All the fields in the GInitiallyUnowned structure
+ * are private to the #GInitiallyUnowned implementation and should never be
+ * accessed directly.
+ */
+/**
+ * GInitiallyUnownedClass:
+ *
+ * The class structure for the GInitiallyUnowned type.
+ */
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GType g_initially_unowned_get_type (void);
+GLIB_AVAILABLE_IN_ALL
+void g_object_class_install_property (GObjectClass *oclass,
+ guint property_id,
+ GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_object_class_find_property (GObjectClass *oclass,
+ const gchar *property_name);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec**g_object_class_list_properties (GObjectClass *oclass,
+ guint *n_properties);
+GLIB_AVAILABLE_IN_ALL
+void g_object_class_override_property (GObjectClass *oclass,
+ guint property_id,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+void g_object_class_install_properties (GObjectClass *oclass,
+ guint n_pspecs,
+ GParamSpec **pspecs);
+
+GLIB_AVAILABLE_IN_ALL
+void g_object_interface_install_property (gpointer g_iface,
+ GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_object_interface_find_property (gpointer g_iface,
+ const gchar *property_name);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec**g_object_interface_list_properties (gpointer g_iface,
+ guint *n_properties_p);
+
+GLIB_AVAILABLE_IN_ALL
+GType g_object_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_new (GType object_type,
+ const gchar *first_property_name,
+ ...);
+GLIB_AVAILABLE_IN_2_54
+GObject* g_object_new_with_properties (GType object_type,
+ guint n_properties,
+ const char *names[],
+ const GValue values[]);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties)
+gpointer g_object_newv (GType object_type,
+ guint n_parameters,
+ GParameter *parameters);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_ALL
+GObject* g_object_new_valist (GType object_type,
+ const gchar *first_property_name,
+ va_list var_args);
+GLIB_AVAILABLE_IN_ALL
+void g_object_set (gpointer object,
+ const gchar *first_property_name,
+ ...) G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_ALL
+void g_object_get (gpointer object,
+ const gchar *first_property_name,
+ ...) G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_connect (gpointer object,
+ const gchar *signal_spec,
+ ...) G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_ALL
+void g_object_disconnect (gpointer object,
+ const gchar *signal_spec,
+ ...) G_GNUC_NULL_TERMINATED;
+GLIB_AVAILABLE_IN_2_54
+void g_object_setv (GObject *object,
+ guint n_properties,
+ const gchar *names[],
+ const GValue values[]);
+GLIB_AVAILABLE_IN_ALL
+void g_object_set_valist (GObject *object,
+ const gchar *first_property_name,
+ va_list var_args);
+GLIB_AVAILABLE_IN_2_54
+void g_object_getv (GObject *object,
+ guint n_properties,
+ const gchar *names[],
+ GValue values[]);
+GLIB_AVAILABLE_IN_ALL
+void g_object_get_valist (GObject *object,
+ const gchar *first_property_name,
+ va_list var_args);
+GLIB_AVAILABLE_IN_ALL
+void g_object_set_property (GObject *object,
+ const gchar *property_name,
+ const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_object_get_property (GObject *object,
+ const gchar *property_name,
+ GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_object_freeze_notify (GObject *object);
+GLIB_AVAILABLE_IN_ALL
+void g_object_notify (GObject *object,
+ const gchar *property_name);
+GLIB_AVAILABLE_IN_ALL
+void g_object_notify_by_pspec (GObject *object,
+ GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+void g_object_thaw_notify (GObject *object);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_object_is_floating (gpointer object);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_ref_sink (gpointer object);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_ref (gpointer object);
+GLIB_AVAILABLE_IN_ALL
+void g_object_unref (gpointer object);
+GLIB_AVAILABLE_IN_ALL
+void g_object_weak_ref (GObject *object,
+ GWeakNotify notify,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_object_weak_unref (GObject *object,
+ GWeakNotify notify,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_object_add_weak_pointer (GObject *object,
+ gpointer *weak_pointer_location);
+GLIB_AVAILABLE_IN_ALL
+void g_object_remove_weak_pointer (GObject *object,
+ gpointer *weak_pointer_location);
+
+#if defined(g_has_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56
+/* Make reference APIs type safe with macros */
+#define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
+#define g_object_ref_sink(Obj) ((__typeof__(Obj)) (g_object_ref_sink) (Obj))
+#endif
+
+/**
+ * GToggleNotify:
+ * @data: Callback data passed to g_object_add_toggle_ref()
+ * @object: The object on which g_object_add_toggle_ref() was called.
+ * @is_last_ref: %TRUE if the toggle reference is now the
+ * last reference to the object. %FALSE if the toggle
+ * reference was the last reference and there are now other
+ * references.
+ *
+ * A callback function used for notification when the state
+ * of a toggle reference changes. See g_object_add_toggle_ref().
+ */
+typedef void (*GToggleNotify) (gpointer data,
+ GObject *object,
+ gboolean is_last_ref);
+
+GLIB_AVAILABLE_IN_ALL
+void g_object_add_toggle_ref (GObject *object,
+ GToggleNotify notify,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_object_remove_toggle_ref (GObject *object,
+ GToggleNotify notify,
+ gpointer data);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_get_qdata (GObject *object,
+ GQuark quark);
+GLIB_AVAILABLE_IN_ALL
+void g_object_set_qdata (GObject *object,
+ GQuark quark,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_object_set_qdata_full (GObject *object,
+ GQuark quark,
+ gpointer data,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_steal_qdata (GObject *object,
+ GQuark quark);
+
+GLIB_AVAILABLE_IN_2_34
+gpointer g_object_dup_qdata (GObject *object,
+ GQuark quark,
+ GDuplicateFunc dup_func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_object_replace_qdata (GObject *object,
+ GQuark quark,
+ gpointer oldval,
+ gpointer newval,
+ GDestroyNotify destroy,
+ GDestroyNotify *old_destroy);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_get_data (GObject *object,
+ const gchar *key);
+GLIB_AVAILABLE_IN_ALL
+void g_object_set_data (GObject *object,
+ const gchar *key,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_object_set_data_full (GObject *object,
+ const gchar *key,
+ gpointer data,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_object_steal_data (GObject *object,
+ const gchar *key);
+
+GLIB_AVAILABLE_IN_2_34
+gpointer g_object_dup_data (GObject *object,
+ const gchar *key,
+ GDuplicateFunc dup_func,
+ gpointer user_data);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_object_replace_data (GObject *object,
+ const gchar *key,
+ gpointer oldval,
+ gpointer newval,
+ GDestroyNotify destroy,
+ GDestroyNotify *old_destroy);
+
+
+GLIB_AVAILABLE_IN_ALL
+void g_object_watch_closure (GObject *object,
+ GClosure *closure);
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_cclosure_new_object (GCallback callback_func,
+ GObject *object);
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_cclosure_new_object_swap (GCallback callback_func,
+ GObject *object);
+GLIB_AVAILABLE_IN_ALL
+GClosure* g_closure_new_object (guint sizeof_closure,
+ GObject *object);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_object (GValue *value,
+ gpointer v_object);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_value_get_object (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_value_dup_object (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gulong g_signal_connect_object (gpointer instance,
+ const gchar *detailed_signal,
+ GCallback c_handler,
+ gpointer gobject,
+ GConnectFlags connect_flags);
+
+/*< protected >*/
+GLIB_AVAILABLE_IN_ALL
+void g_object_force_floating (GObject *object);
+GLIB_AVAILABLE_IN_ALL
+void g_object_run_dispose (GObject *object);
+
+
+GLIB_AVAILABLE_IN_ALL
+void g_value_take_object (GValue *value,
+ gpointer v_object);
+GLIB_DEPRECATED_FOR(g_value_take_object)
+void g_value_set_object_take_ownership (GValue *value,
+ gpointer v_object);
+
+GLIB_DEPRECATED
+gsize g_object_compat_control (gsize what,
+ gpointer data);
+
+/* --- implementation macros --- */
+#define G_OBJECT_WARN_INVALID_PSPEC(object, pname, property_id, pspec) \
+G_STMT_START { \
+ GObject *_glib__object = (GObject*) (object); \
+ GParamSpec *_glib__pspec = (GParamSpec*) (pspec); \
+ guint _glib__property_id = (property_id); \
+ g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'", \
+ __FILE__, __LINE__, \
+ (pname), \
+ _glib__property_id, \
+ _glib__pspec->name, \
+ g_type_name (G_PARAM_SPEC_TYPE (_glib__pspec)), \
+ G_OBJECT_TYPE_NAME (_glib__object)); \
+} G_STMT_END
+/**
+ * G_OBJECT_WARN_INVALID_PROPERTY_ID:
+ * @object: the #GObject on which set_property() or get_property() was called
+ * @property_id: the numeric id of the property
+ * @pspec: the #GParamSpec of the property
+ *
+ * This macro should be used to emit a standard warning about unexpected
+ * properties in set_property() and get_property() implementations.
+ */
+#define G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec) \
+ G_OBJECT_WARN_INVALID_PSPEC ((object), "property", (property_id), (pspec))
+
+GLIB_AVAILABLE_IN_ALL
+void g_clear_object (GObject **object_ptr);
+#define g_clear_object(object_ptr) g_clear_pointer ((object_ptr), g_object_unref)
+
+/**
+ * g_set_object: (skip)
+ * @object_ptr: a pointer to a #GObject reference
+ * @new_object: (nullable) (transfer none): a pointer to the new #GObject to
+ * assign to it, or %NULL to clear the pointer
+ *
+ * Updates a #GObject pointer to refer to @new_object. It increments the
+ * reference count of @new_object (if non-%NULL), decrements the reference
+ * count of the current value of @object_ptr (if non-%NULL), and assigns
+ * @new_object to @object_ptr. The assignment is not atomic.
+ *
+ * @object_ptr must not be %NULL.
+ *
+ * A macro is also included that allows this function to be used without
+ * pointer casts. The function itself is static inline, so its address may vary
+ * between compilation units.
+ *
+ * One convenient usage of this function is in implementing property setters:
+ * |[
+ * void
+ * foo_set_bar (Foo *foo,
+ * Bar *new_bar)
+ * {
+ * g_return_if_fail (IS_FOO (foo));
+ * g_return_if_fail (new_bar == NULL || IS_BAR (new_bar));
+ *
+ * if (g_set_object (&foo->bar, new_bar))
+ * g_object_notify (foo, "bar");
+ * }
+ * ]|
+ *
+ * Returns: %TRUE if the value of @object_ptr changed, %FALSE otherwise
+ *
+ * Since: 2.44
+ */
+static inline gboolean
+(g_set_object) (GObject **object_ptr,
+ GObject *new_object)
+{
+ GObject *old_object = *object_ptr;
+
+ /* rely on g_object_[un]ref() to check the pointers are actually GObjects;
+ * elide a (object_ptr != NULL) check because most of the time we will be
+ * operating on struct members with a constant offset, so a NULL check would
+ * not catch bugs
+ */
+
+ if (old_object == new_object)
+ return FALSE;
+
+ if (new_object != NULL)
+ g_object_ref (new_object);
+
+ *object_ptr = new_object;
+
+ if (old_object != NULL)
+ g_object_unref (old_object);
+
+ return TRUE;
+}
+
+#define g_set_object(object_ptr, new_object) \
+ (/* Check types match. */ \
+ 0 ? *(object_ptr) = (new_object), FALSE : \
+ (g_set_object) ((GObject **) (object_ptr), (GObject *) (new_object)) \
+ )
+
+/**
+ * g_assert_finalize_object: (skip)
+ * @object: (transfer full) (type GObject.Object): an object
+ *
+ * Assert that @object is non-%NULL, then release one reference to it with
+ * g_object_unref() and assert that it has been finalized (i.e. that there
+ * are no more references).
+ *
+ * If assertions are disabled via `G_DISABLE_ASSERT`,
+ * this macro just calls g_object_unref() without any further checks.
+ *
+ * This macro should only be used in regression tests.
+ *
+ * Since: 2.62
+ */
+static inline void
+(g_assert_finalize_object) (GObject *object)
+{
+ gpointer weak_pointer = object;
+
+ g_assert_true (G_IS_OBJECT (weak_pointer));
+ g_object_add_weak_pointer (object, &weak_pointer);
+ g_object_unref (weak_pointer);
+ g_assert_null (weak_pointer);
+}
+
+#ifdef G_DISABLE_ASSERT
+#define g_assert_finalize_object(object) g_object_unref (object)
+#else
+#define g_assert_finalize_object(object) (g_assert_finalize_object ((GObject *) object))
+#endif
+
+/**
+ * g_clear_weak_pointer: (skip)
+ * @weak_pointer_location: The memory address of a pointer
+ *
+ * Clears a weak reference to a #GObject.
+ *
+ * @weak_pointer_location must not be %NULL.
+ *
+ * If the weak reference is %NULL then this function does nothing.
+ * Otherwise, the weak reference to the object is removed for that location
+ * and the pointer is set to %NULL.
+ *
+ * A macro is also included that allows this function to be used without
+ * pointer casts. The function itself is static inline, so its address may vary
+ * between compilation units.
+ *
+ * Since: 2.56
+ */
+static inline void
+(g_clear_weak_pointer) (gpointer *weak_pointer_location)
+{
+ GObject *object = (GObject *) *weak_pointer_location;
+
+ if (object != NULL)
+ {
+ g_object_remove_weak_pointer (object, weak_pointer_location);
+ *weak_pointer_location = NULL;
+ }
+}
+
+#define g_clear_weak_pointer(weak_pointer_location) \
+ (/* Check types match. */ \
+ (g_clear_weak_pointer) ((gpointer *) (weak_pointer_location)) \
+ )
+
+/**
+ * g_set_weak_pointer: (skip)
+ * @weak_pointer_location: the memory address of a pointer
+ * @new_object: (nullable) (transfer none): a pointer to the new #GObject to
+ * assign to it, or %NULL to clear the pointer
+ *
+ * Updates a pointer to weakly refer to @new_object. It assigns @new_object
+ * to @weak_pointer_location and ensures that @weak_pointer_location will
+ * automaticaly be set to %NULL if @new_object gets destroyed. The assignment
+ * is not atomic. The weak reference is not thread-safe, see
+ * g_object_add_weak_pointer() for details.
+ *
+ * @weak_pointer_location must not be %NULL.
+ *
+ * A macro is also included that allows this function to be used without
+ * pointer casts. The function itself is static inline, so its address may vary
+ * between compilation units.
+ *
+ * One convenient usage of this function is in implementing property setters:
+ * |[
+ * void
+ * foo_set_bar (Foo *foo,
+ * Bar *new_bar)
+ * {
+ * g_return_if_fail (IS_FOO (foo));
+ * g_return_if_fail (new_bar == NULL || IS_BAR (new_bar));
+ *
+ * if (g_set_weak_pointer (&foo->bar, new_bar))
+ * g_object_notify (foo, "bar");
+ * }
+ * ]|
+ *
+ * Returns: %TRUE if the value of @weak_pointer_location changed, %FALSE otherwise
+ *
+ * Since: 2.56
+ */
+static inline gboolean
+(g_set_weak_pointer) (gpointer *weak_pointer_location,
+ GObject *new_object)
+{
+ GObject *old_object = (GObject *) *weak_pointer_location;
+
+ /* elide a (weak_pointer_location != NULL) check because most of the time we
+ * will be operating on struct members with a constant offset, so a NULL
+ * check would not catch bugs
+ */
+
+ if (old_object == new_object)
+ return FALSE;
+
+ if (old_object != NULL)
+ g_object_remove_weak_pointer (old_object, weak_pointer_location);
+
+ *weak_pointer_location = new_object;
+
+ if (new_object != NULL)
+ g_object_add_weak_pointer (new_object, weak_pointer_location);
+
+ return TRUE;
+}
+
+#define g_set_weak_pointer(weak_pointer_location, new_object) \
+ (/* Check types match. */ \
+ 0 ? *(weak_pointer_location) = (new_object), FALSE : \
+ (g_set_weak_pointer) ((gpointer *) (weak_pointer_location), (GObject *) (new_object)) \
+ )
+
+typedef struct {
+ /*<private>*/
+ union { gpointer p; } priv;
+} GWeakRef;
+
+GLIB_AVAILABLE_IN_ALL
+void g_weak_ref_init (GWeakRef *weak_ref,
+ gpointer object);
+GLIB_AVAILABLE_IN_ALL
+void g_weak_ref_clear (GWeakRef *weak_ref);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_weak_ref_get (GWeakRef *weak_ref);
+GLIB_AVAILABLE_IN_ALL
+void g_weak_ref_set (GWeakRef *weak_ref,
+ gpointer object);
+
+G_END_DECLS
+
+#endif /* __G_OBJECT_H__ */
diff --git a/include/glib/gobject/gobjectnotifyqueue.c b/include/glib/gobject/gobjectnotifyqueue.c
new file mode 100644
index 0000000000..1a7d23f266
--- /dev/null
+++ b/include/glib/gobject/gobjectnotifyqueue.c
@@ -0,0 +1,197 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* WARNING:
+ *
+ * This file is INSTALLED and other projects (outside of glib)
+ * #include its contents.
+ */
+
+#ifndef __G_OBJECT_NOTIFY_QUEUE_H__
+#define __G_OBJECT_NOTIFY_QUEUE_H__
+
+#include <string.h> /* memset */
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+
+/* --- typedefs --- */
+typedef struct _GObjectNotifyContext GObjectNotifyContext;
+typedef struct _GObjectNotifyQueue GObjectNotifyQueue;
+typedef void (*GObjectNotifyQueueDispatcher) (GObject *object,
+ guint n_pspecs,
+ GParamSpec **pspecs);
+
+
+/* --- structures --- */
+struct _GObjectNotifyContext
+{
+ GQuark quark_notify_queue;
+ GObjectNotifyQueueDispatcher dispatcher;
+ GTrashStack *_nqueue_trash; /* unused */
+};
+struct _GObjectNotifyQueue
+{
+ GObjectNotifyContext *context;
+ GSList *pspecs;
+ guint16 n_pspecs;
+ guint16 freeze_count;
+};
+
+G_LOCK_DEFINE_STATIC(notify_lock);
+
+/* --- functions --- */
+static void
+g_object_notify_queue_free (gpointer data)
+{
+ GObjectNotifyQueue *nqueue = data;
+
+ g_slist_free (nqueue->pspecs);
+ g_slice_free (GObjectNotifyQueue, nqueue);
+}
+
+static inline GObjectNotifyQueue*
+g_object_notify_queue_freeze (GObject *object,
+ GObjectNotifyContext *context)
+{
+ GObjectNotifyQueue *nqueue;
+
+ G_LOCK(notify_lock);
+ nqueue = g_datalist_id_get_data (&object->qdata, context->quark_notify_queue);
+ if (!nqueue)
+ {
+ nqueue = g_slice_new0 (GObjectNotifyQueue);
+ nqueue->context = context;
+ g_datalist_id_set_data_full (&object->qdata, context->quark_notify_queue,
+ nqueue, g_object_notify_queue_free);
+ }
+
+ if (nqueue->freeze_count >= 65535)
+ g_critical("Free queue for %s (%p) is larger than 65535,"
+ " called g_object_freeze_notify() too often."
+ " Forgot to call g_object_thaw_notify() or infinite loop",
+ G_OBJECT_TYPE_NAME (object), object);
+ else
+ nqueue->freeze_count++;
+ G_UNLOCK(notify_lock);
+
+ return nqueue;
+}
+
+static inline void
+g_object_notify_queue_thaw (GObject *object,
+ GObjectNotifyQueue *nqueue)
+{
+ GObjectNotifyContext *context = nqueue->context;
+ GParamSpec *pspecs_mem[16], **pspecs, **free_me = NULL;
+ GSList *slist;
+ guint n_pspecs = 0;
+
+ g_return_if_fail (nqueue->freeze_count > 0);
+ g_return_if_fail (g_atomic_int_get(&object->ref_count) > 0);
+
+ G_LOCK(notify_lock);
+
+ /* Just make sure we never get into some nasty race condition */
+ if (G_UNLIKELY(nqueue->freeze_count == 0)) {
+ G_UNLOCK(notify_lock);
+ g_warning ("%s: property-changed notification for %s(%p) is not frozen",
+ G_STRFUNC, G_OBJECT_TYPE_NAME (object), object);
+ return;
+ }
+
+ nqueue->freeze_count--;
+ if (nqueue->freeze_count) {
+ G_UNLOCK(notify_lock);
+ return;
+ }
+
+ pspecs = nqueue->n_pspecs > 16 ? free_me = g_new (GParamSpec*, nqueue->n_pspecs) : pspecs_mem;
+
+ for (slist = nqueue->pspecs; slist; slist = slist->next)
+ {
+ pspecs[n_pspecs++] = slist->data;
+ }
+ g_datalist_id_set_data (&object->qdata, context->quark_notify_queue, NULL);
+
+ G_UNLOCK(notify_lock);
+
+ if (n_pspecs)
+ context->dispatcher (object, n_pspecs, pspecs);
+ g_free (free_me);
+}
+
+static inline void
+g_object_notify_queue_clear (GObject *object,
+ GObjectNotifyQueue *nqueue)
+{
+ g_return_if_fail (nqueue->freeze_count > 0);
+
+ G_LOCK(notify_lock);
+
+ g_slist_free (nqueue->pspecs);
+ nqueue->pspecs = NULL;
+ nqueue->n_pspecs = 0;
+
+ G_UNLOCK(notify_lock);
+}
+
+static inline void
+g_object_notify_queue_add (GObject *object,
+ GObjectNotifyQueue *nqueue,
+ GParamSpec *pspec)
+{
+ if (pspec->flags & G_PARAM_READABLE)
+ {
+ GParamSpec *redirect;
+
+ G_LOCK(notify_lock);
+
+ g_return_if_fail (nqueue->n_pspecs < 65535);
+
+ redirect = g_param_spec_get_redirect_target (pspec);
+ if (redirect)
+ pspec = redirect;
+
+ /* we do the deduping in _thaw */
+ if (g_slist_find (nqueue->pspecs, pspec) == NULL)
+ {
+ nqueue->pspecs = g_slist_prepend (nqueue->pspecs, pspec);
+ nqueue->n_pspecs++;
+ }
+
+ G_UNLOCK(notify_lock);
+ }
+}
+
+/* NB: This function is not threadsafe, do not ever use it if
+ * you need a threadsafe notify queue.
+ * Use g_object_notify_queue_freeze() to acquire the queue and
+ * g_object_notify_queue_thaw() after you are done instead.
+ */
+static inline GObjectNotifyQueue*
+g_object_notify_queue_from_object (GObject *object,
+ GObjectNotifyContext *context)
+{
+ return g_datalist_id_get_data (&object->qdata, context->quark_notify_queue);
+}
+
+G_END_DECLS
+
+#endif /* __G_OBJECT_NOTIFY_QUEUE_H__ */
diff --git a/include/glib/gobject/gparam.h b/include/glib/gobject/gparam.h
new file mode 100644
index 0000000000..33f95f0c5c
--- /dev/null
+++ b/include/glib/gobject/gparam.h
@@ -0,0 +1,452 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * gparam.h: GParamSpec base class implementation
+ */
+#ifndef __G_PARAM_H__
+#define __G_PARAM_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gvalue.h>
+
+G_BEGIN_DECLS
+
+/* --- standard type macros --- */
+/**
+ * G_TYPE_IS_PARAM:
+ * @type: a #GType ID
+ *
+ * Checks whether @type "is a" %G_TYPE_PARAM.
+ */
+#define G_TYPE_IS_PARAM(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM)
+/**
+ * G_PARAM_SPEC:
+ * @pspec: a valid #GParamSpec
+ *
+ * Casts a derived #GParamSpec object (e.g. of type #GParamSpecInt) into
+ * a #GParamSpec object.
+ */
+#define G_PARAM_SPEC(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM, GParamSpec))
+/**
+ * G_IS_PARAM_SPEC:
+ * @pspec: a #GParamSpec
+ *
+ * Checks whether @pspec "is a" valid #GParamSpec structure of type %G_TYPE_PARAM
+ * or derived.
+ */
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_42
+#define G_IS_PARAM_SPEC(pspec) (G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE ((pspec), G_TYPE_PARAM))
+#else
+#define G_IS_PARAM_SPEC(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM))
+#endif
+/**
+ * G_PARAM_SPEC_CLASS:
+ * @pclass: a valid #GParamSpecClass
+ *
+ * Casts a derived #GParamSpecClass structure into a #GParamSpecClass structure.
+ */
+#define G_PARAM_SPEC_CLASS(pclass) (G_TYPE_CHECK_CLASS_CAST ((pclass), G_TYPE_PARAM, GParamSpecClass))
+/**
+ * G_IS_PARAM_SPEC_CLASS:
+ * @pclass: a #GParamSpecClass
+ *
+ * Checks whether @pclass "is a" valid #GParamSpecClass structure of type
+ * %G_TYPE_PARAM or derived.
+ */
+#define G_IS_PARAM_SPEC_CLASS(pclass) (G_TYPE_CHECK_CLASS_TYPE ((pclass), G_TYPE_PARAM))
+/**
+ * G_PARAM_SPEC_GET_CLASS:
+ * @pspec: a valid #GParamSpec
+ *
+ * Retrieves the #GParamSpecClass of a #GParamSpec.
+ */
+#define G_PARAM_SPEC_GET_CLASS(pspec) (G_TYPE_INSTANCE_GET_CLASS ((pspec), G_TYPE_PARAM, GParamSpecClass))
+
+
+/* --- convenience macros --- */
+/**
+ * G_PARAM_SPEC_TYPE:
+ * @pspec: a valid #GParamSpec
+ *
+ * Retrieves the #GType of this @pspec.
+ */
+#define G_PARAM_SPEC_TYPE(pspec) (G_TYPE_FROM_INSTANCE (pspec))
+/**
+ * G_PARAM_SPEC_TYPE_NAME:
+ * @pspec: a valid #GParamSpec
+ *
+ * Retrieves the #GType name of this @pspec.
+ */
+#define G_PARAM_SPEC_TYPE_NAME(pspec) (g_type_name (G_PARAM_SPEC_TYPE (pspec)))
+/**
+ * G_PARAM_SPEC_VALUE_TYPE:
+ * @pspec: a valid #GParamSpec
+ *
+ * Retrieves the #GType to initialize a #GValue for this parameter.
+ */
+#define G_PARAM_SPEC_VALUE_TYPE(pspec) (G_PARAM_SPEC (pspec)->value_type)
+/**
+ * G_VALUE_HOLDS_PARAM:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values derived from type %G_TYPE_PARAM.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_PARAM(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_PARAM))
+
+
+/* --- flags --- */
+/**
+ * GParamFlags:
+ * @G_PARAM_READABLE: the parameter is readable
+ * @G_PARAM_WRITABLE: the parameter is writable
+ * @G_PARAM_READWRITE: alias for %G_PARAM_READABLE | %G_PARAM_WRITABLE
+ * @G_PARAM_CONSTRUCT: the parameter will be set upon object construction
+ * @G_PARAM_CONSTRUCT_ONLY: the parameter can only be set upon object construction
+ * @G_PARAM_LAX_VALIDATION: upon parameter conversion (see g_param_value_convert())
+ * strict validation is not required
+ * @G_PARAM_STATIC_NAME: the string used as name when constructing the
+ * parameter is guaranteed to remain valid and
+ * unmodified for the lifetime of the parameter.
+ * Since 2.8
+ * @G_PARAM_STATIC_NICK: the string used as nick when constructing the
+ * parameter is guaranteed to remain valid and
+ * unmmodified for the lifetime of the parameter.
+ * Since 2.8
+ * @G_PARAM_STATIC_BLURB: the string used as blurb when constructing the
+ * parameter is guaranteed to remain valid and
+ * unmodified for the lifetime of the parameter.
+ * Since 2.8
+ * @G_PARAM_EXPLICIT_NOTIFY: calls to g_object_set_property() for this
+ * property will not automatically result in a "notify" signal being
+ * emitted: the implementation must call g_object_notify() themselves
+ * in case the property actually changes. Since: 2.42.
+ * @G_PARAM_PRIVATE: internal
+ * @G_PARAM_DEPRECATED: the parameter is deprecated and will be removed
+ * in a future version. A warning will be generated if it is used
+ * while running with G_ENABLE_DIAGNOSTIC=1.
+ * Since 2.26
+ *
+ * Through the #GParamFlags flag values, certain aspects of parameters
+ * can be configured. See also #G_PARAM_STATIC_STRINGS.
+ */
+typedef enum
+{
+ G_PARAM_READABLE = 1 << 0,
+ G_PARAM_WRITABLE = 1 << 1,
+ G_PARAM_READWRITE = (G_PARAM_READABLE | G_PARAM_WRITABLE),
+ G_PARAM_CONSTRUCT = 1 << 2,
+ G_PARAM_CONSTRUCT_ONLY = 1 << 3,
+ G_PARAM_LAX_VALIDATION = 1 << 4,
+ G_PARAM_STATIC_NAME = 1 << 5,
+ G_PARAM_PRIVATE GLIB_DEPRECATED_ENUMERATOR_IN_2_26 = G_PARAM_STATIC_NAME,
+ G_PARAM_STATIC_NICK = 1 << 6,
+ G_PARAM_STATIC_BLURB = 1 << 7,
+ /* User defined flags go here */
+ G_PARAM_EXPLICIT_NOTIFY = 1 << 30,
+ /* Avoid warning with -Wpedantic for gcc6 */
+ G_PARAM_DEPRECATED = (gint)(1u << 31)
+} GParamFlags;
+
+/**
+ * G_PARAM_STATIC_STRINGS:
+ *
+ * #GParamFlags value alias for %G_PARAM_STATIC_NAME | %G_PARAM_STATIC_NICK | %G_PARAM_STATIC_BLURB.
+ *
+ * Since 2.13.0
+ */
+#define G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
+/* bits in the range 0xffffff00 are reserved for 3rd party usage */
+/**
+ * G_PARAM_MASK:
+ *
+ * Mask containing the bits of #GParamSpec.flags which are reserved for GLib.
+ */
+#define G_PARAM_MASK (0x000000ff)
+/**
+ * G_PARAM_USER_SHIFT:
+ *
+ * Minimum shift count to be used for user defined flags, to be stored in
+ * #GParamSpec.flags. The maximum allowed is 10.
+ */
+#define G_PARAM_USER_SHIFT (8)
+
+/* --- typedefs & structures --- */
+typedef struct _GParamSpec GParamSpec;
+typedef struct _GParamSpecClass GParamSpecClass;
+typedef struct _GParameter GParameter GLIB_DEPRECATED_TYPE_IN_2_54;
+typedef struct _GParamSpecPool GParamSpecPool;
+/**
+ * GParamSpec: (ref-func g_param_spec_ref_sink) (unref-func g_param_spec_uref) (set-value-func g_value_set_param) (get-value-func g_value_get_param)
+ * @g_type_instance: private #GTypeInstance portion
+ * @name: name of this parameter: always an interned string
+ * @flags: #GParamFlags flags for this parameter
+ * @value_type: the #GValue type for this parameter
+ * @owner_type: #GType type that uses (introduces) this parameter
+ *
+ * All other fields of the GParamSpec struct are private and
+ * should not be used directly.
+ */
+struct _GParamSpec
+{
+ GTypeInstance g_type_instance;
+
+ const gchar *name; /* interned string */
+ GParamFlags flags;
+ GType value_type;
+ GType owner_type; /* class or interface using this property */
+
+ /*< private >*/
+ gchar *_nick;
+ gchar *_blurb;
+ GData *qdata;
+ guint ref_count;
+ guint param_id; /* sort-criteria */
+};
+/**
+ * GParamSpecClass:
+ * @g_type_class: the parent class
+ * @value_type: the #GValue type for this parameter
+ * @finalize: The instance finalization function (optional), should chain
+ * up to the finalize method of the parent class.
+ * @value_set_default: Resets a @value to the default value for this type
+ * (recommended, the default is g_value_reset()), see
+ * g_param_value_set_default().
+ * @value_validate: Ensures that the contents of @value comply with the
+ * specifications set out by this type (optional), see
+ * g_param_value_validate().
+ * @values_cmp: Compares @value1 with @value2 according to this type
+ * (recommended, the default is memcmp()), see g_param_values_cmp().
+ *
+ * The class structure for the GParamSpec type.
+ * Normally, GParamSpec classes are filled by
+ * g_param_type_register_static().
+ */
+struct _GParamSpecClass
+{
+ GTypeClass g_type_class;
+
+ GType value_type;
+
+ void (*finalize) (GParamSpec *pspec);
+
+ /* GParam methods */
+ void (*value_set_default) (GParamSpec *pspec,
+ GValue *value);
+ gboolean (*value_validate) (GParamSpec *pspec,
+ GValue *value);
+ gint (*values_cmp) (GParamSpec *pspec,
+ const GValue *value1,
+ const GValue *value2);
+ /*< private >*/
+ gpointer dummy[4];
+};
+/**
+ * GParameter:
+ * @name: the parameter name
+ * @value: the parameter value
+ *
+ * The GParameter struct is an auxiliary structure used
+ * to hand parameter name/value pairs to g_object_newv().
+ *
+ * Deprecated: 2.54: This type is not introspectable.
+ */
+struct _GParameter /* auxiliary structure for _setv() variants */
+{
+ const gchar *name;
+ GValue value;
+} GLIB_DEPRECATED_TYPE_IN_2_54;
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_ref (GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+void g_param_spec_unref (GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+void g_param_spec_sink (GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_ref_sink (GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_param_spec_get_qdata (GParamSpec *pspec,
+ GQuark quark);
+GLIB_AVAILABLE_IN_ALL
+void g_param_spec_set_qdata (GParamSpec *pspec,
+ GQuark quark,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+void g_param_spec_set_qdata_full (GParamSpec *pspec,
+ GQuark quark,
+ gpointer data,
+ GDestroyNotify destroy);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_param_spec_steal_qdata (GParamSpec *pspec,
+ GQuark quark);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_get_redirect_target (GParamSpec *pspec);
+
+GLIB_AVAILABLE_IN_ALL
+void g_param_value_set_default (GParamSpec *pspec,
+ GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_param_value_defaults (GParamSpec *pspec,
+ GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_param_value_validate (GParamSpec *pspec,
+ GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_param_value_convert (GParamSpec *pspec,
+ const GValue *src_value,
+ GValue *dest_value,
+ gboolean strict_validation);
+GLIB_AVAILABLE_IN_ALL
+gint g_param_values_cmp (GParamSpec *pspec,
+ const GValue *value1,
+ const GValue *value2);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_param_spec_get_name (GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_param_spec_get_nick (GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_param_spec_get_blurb (GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_param (GValue *value,
+ GParamSpec *param);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_value_get_param (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_value_dup_param (const GValue *value);
+
+
+GLIB_AVAILABLE_IN_ALL
+void g_value_take_param (GValue *value,
+ GParamSpec *param);
+GLIB_DEPRECATED_FOR(g_value_take_param)
+void g_value_set_param_take_ownership (GValue *value,
+ GParamSpec *param);
+GLIB_AVAILABLE_IN_2_36
+const GValue * g_param_spec_get_default_value (GParamSpec *pspec);
+
+GLIB_AVAILABLE_IN_2_46
+GQuark g_param_spec_get_name_quark (GParamSpec *pspec);
+
+/* --- convenience functions --- */
+typedef struct _GParamSpecTypeInfo GParamSpecTypeInfo;
+/**
+ * GParamSpecTypeInfo:
+ * @instance_size: Size of the instance (object) structure.
+ * @n_preallocs: Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10, it is ignored, since instances are allocated with the [slice allocator][glib-Memory-Slices] now.
+ * @instance_init: Location of the instance initialization function (optional).
+ * @value_type: The #GType of values conforming to this #GParamSpec
+ * @finalize: The instance finalization function (optional).
+ * @value_set_default: Resets a @value to the default value for @pspec
+ * (recommended, the default is g_value_reset()), see
+ * g_param_value_set_default().
+ * @value_validate: Ensures that the contents of @value comply with the
+ * specifications set out by @pspec (optional), see
+ * g_param_value_validate().
+ * @values_cmp: Compares @value1 with @value2 according to @pspec
+ * (recommended, the default is memcmp()), see g_param_values_cmp().
+ *
+ * This structure is used to provide the type system with the information
+ * required to initialize and destruct (finalize) a parameter's class and
+ * instances thereof.
+ * The initialized structure is passed to the g_param_type_register_static()
+ * The type system will perform a deep copy of this structure, so its memory
+ * does not need to be persistent across invocation of
+ * g_param_type_register_static().
+ */
+struct _GParamSpecTypeInfo
+{
+ /* type system portion */
+ guint16 instance_size; /* obligatory */
+ guint16 n_preallocs; /* optional */
+ void (*instance_init) (GParamSpec *pspec); /* optional */
+
+ /* class portion */
+ GType value_type; /* obligatory */
+ void (*finalize) (GParamSpec *pspec); /* optional */
+ void (*value_set_default) (GParamSpec *pspec, /* recommended */
+ GValue *value);
+ gboolean (*value_validate) (GParamSpec *pspec, /* optional */
+ GValue *value);
+ gint (*values_cmp) (GParamSpec *pspec, /* recommended */
+ const GValue *value1,
+ const GValue *value2);
+};
+GLIB_AVAILABLE_IN_ALL
+GType g_param_type_register_static (const gchar *name,
+ const GParamSpecTypeInfo *pspec_info);
+
+/* For registering builting types */
+GType _g_param_type_register_static_constant (const gchar *name,
+ const GParamSpecTypeInfo *pspec_info,
+ GType opt_type);
+
+
+/* --- protected --- */
+GLIB_AVAILABLE_IN_ALL
+gpointer g_param_spec_internal (GType param_type,
+ const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpecPool* g_param_spec_pool_new (gboolean type_prefixing);
+GLIB_AVAILABLE_IN_ALL
+void g_param_spec_pool_insert (GParamSpecPool *pool,
+ GParamSpec *pspec,
+ GType owner_type);
+GLIB_AVAILABLE_IN_ALL
+void g_param_spec_pool_remove (GParamSpecPool *pool,
+ GParamSpec *pspec);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_pool_lookup (GParamSpecPool *pool,
+ const gchar *param_name,
+ GType owner_type,
+ gboolean walk_ancestors);
+GLIB_AVAILABLE_IN_ALL
+GList* g_param_spec_pool_list_owned (GParamSpecPool *pool,
+ GType owner_type);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec** g_param_spec_pool_list (GParamSpecPool *pool,
+ GType owner_type,
+ guint *n_pspecs_p);
+
+
+/* contracts:
+ *
+ * gboolean value_validate (GParamSpec *pspec,
+ * GValue *value):
+ * modify value contents in the least destructive way, so
+ * that it complies with pspec's requirements (i.e.
+ * according to minimum/maximum ranges etc...). return
+ * whether modification was necessary.
+ *
+ * gint values_cmp (GParamSpec *pspec,
+ * const GValue *value1,
+ * const GValue *value2):
+ * return value1 - value2, i.e. (-1) if value1 < value2,
+ * (+1) if value1 > value2, and (0) otherwise (equality)
+ */
+
+G_END_DECLS
+
+#endif /* __G_PARAM_H__ */
diff --git a/include/glib/gobject/gparamspecs.h b/include/glib/gobject/gparamspecs.h
new file mode 100644
index 0000000000..d0e4d5953f
--- /dev/null
+++ b/include/glib/gobject/gparamspecs.h
@@ -0,0 +1,1170 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * gparamspecs.h: GLib default param specs
+ */
+#ifndef __G_PARAMSPECS_H__
+#define __G_PARAMSPECS_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gvalue.h>
+#include <gobject/genums.h>
+#include <gobject/gboxed.h>
+#include <gobject/gobject.h>
+
+G_BEGIN_DECLS
+
+/* --- type macros --- */
+/**
+ * G_TYPE_PARAM_CHAR:
+ *
+ * The #GType of #GParamSpecChar.
+ */
+#define G_TYPE_PARAM_CHAR (g_param_spec_types[0])
+/**
+ * G_IS_PARAM_SPEC_CHAR:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_CHAR.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR))
+/**
+ * G_PARAM_SPEC_CHAR:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecChar.
+ */
+#define G_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CHAR, GParamSpecChar))
+
+/**
+ * G_TYPE_PARAM_UCHAR:
+ *
+ * The #GType of #GParamSpecUChar.
+ */
+#define G_TYPE_PARAM_UCHAR (g_param_spec_types[1])
+/**
+ * G_IS_PARAM_SPEC_UCHAR:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UCHAR.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UCHAR))
+/**
+ * G_PARAM_SPEC_UCHAR:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecUChar.
+ */
+#define G_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UCHAR, GParamSpecUChar))
+
+/**
+ * G_TYPE_PARAM_BOOLEAN:
+ *
+ * The #GType of #GParamSpecBoolean.
+ */
+#define G_TYPE_PARAM_BOOLEAN (g_param_spec_types[2])
+/**
+ * G_IS_PARAM_SPEC_BOOLEAN:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_BOOLEAN.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOOLEAN))
+/**
+ * G_PARAM_SPEC_BOOLEAN:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecBoolean.
+ */
+#define G_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOOLEAN, GParamSpecBoolean))
+
+/**
+ * G_TYPE_PARAM_INT:
+ *
+ * The #GType of #GParamSpecInt.
+ */
+#define G_TYPE_PARAM_INT (g_param_spec_types[3])
+/**
+ * G_IS_PARAM_SPEC_INT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_INT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT))
+/**
+ * G_PARAM_SPEC_INT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecInt.
+ */
+#define G_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT, GParamSpecInt))
+
+/**
+ * G_TYPE_PARAM_UINT:
+ *
+ * The #GType of #GParamSpecUInt.
+ */
+#define G_TYPE_PARAM_UINT (g_param_spec_types[4])
+/**
+ * G_IS_PARAM_SPEC_UINT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UINT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT))
+/**
+ * G_PARAM_SPEC_UINT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecUInt.
+ */
+#define G_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT, GParamSpecUInt))
+
+/**
+ * G_TYPE_PARAM_LONG:
+ *
+ * The #GType of #GParamSpecLong.
+ */
+#define G_TYPE_PARAM_LONG (g_param_spec_types[5])
+/**
+ * G_IS_PARAM_SPEC_LONG:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_LONG.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_LONG))
+/**
+ * G_PARAM_SPEC_LONG:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecLong.
+ */
+#define G_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_LONG, GParamSpecLong))
+
+/**
+ * G_TYPE_PARAM_ULONG:
+ *
+ * The #GType of #GParamSpecULong.
+ */
+#define G_TYPE_PARAM_ULONG (g_param_spec_types[6])
+/**
+ * G_IS_PARAM_SPEC_ULONG:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_ULONG.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ULONG))
+/**
+ * G_PARAM_SPEC_ULONG:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecULong.
+ */
+#define G_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ULONG, GParamSpecULong))
+
+/**
+ * G_TYPE_PARAM_INT64:
+ *
+ * The #GType of #GParamSpecInt64.
+ */
+#define G_TYPE_PARAM_INT64 (g_param_spec_types[7])
+/**
+ * G_IS_PARAM_SPEC_INT64:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_INT64.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_INT64(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT64))
+/**
+ * G_PARAM_SPEC_INT64:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecInt64.
+ */
+#define G_PARAM_SPEC_INT64(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT64, GParamSpecInt64))
+
+/**
+ * G_TYPE_PARAM_UINT64:
+ *
+ * The #GType of #GParamSpecUInt64.
+ */
+#define G_TYPE_PARAM_UINT64 (g_param_spec_types[8])
+/**
+ * G_IS_PARAM_SPEC_UINT64:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UINT64.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_UINT64(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT64))
+/**
+ * G_PARAM_SPEC_UINT64:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecUInt64.
+ */
+#define G_PARAM_SPEC_UINT64(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT64, GParamSpecUInt64))
+
+/**
+ * G_TYPE_PARAM_UNICHAR:
+ *
+ * The #GType of #GParamSpecUnichar.
+ */
+#define G_TYPE_PARAM_UNICHAR (g_param_spec_types[9])
+/**
+ * G_PARAM_SPEC_UNICHAR:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecUnichar.
+ */
+#define G_PARAM_SPEC_UNICHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UNICHAR, GParamSpecUnichar))
+/**
+ * G_IS_PARAM_SPEC_UNICHAR:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UNICHAR.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_UNICHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UNICHAR))
+
+/**
+ * G_TYPE_PARAM_ENUM:
+ *
+ * The #GType of #GParamSpecEnum.
+ */
+#define G_TYPE_PARAM_ENUM (g_param_spec_types[10])
+/**
+ * G_IS_PARAM_SPEC_ENUM:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_ENUM.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ENUM))
+/**
+ * G_PARAM_SPEC_ENUM:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecEnum.
+ */
+#define G_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ENUM, GParamSpecEnum))
+
+/**
+ * G_TYPE_PARAM_FLAGS:
+ *
+ * The #GType of #GParamSpecFlags.
+ */
+#define G_TYPE_PARAM_FLAGS (g_param_spec_types[11])
+/**
+ * G_IS_PARAM_SPEC_FLAGS:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_FLAGS.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLAGS))
+/**
+ * G_PARAM_SPEC_FLAGS:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecFlags.
+ */
+#define G_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLAGS, GParamSpecFlags))
+
+/**
+ * G_TYPE_PARAM_FLOAT:
+ *
+ * The #GType of #GParamSpecFloat.
+ */
+#define G_TYPE_PARAM_FLOAT (g_param_spec_types[12])
+/**
+ * G_IS_PARAM_SPEC_FLOAT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_FLOAT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLOAT))
+/**
+ * G_PARAM_SPEC_FLOAT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecFloat.
+ */
+#define G_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLOAT, GParamSpecFloat))
+
+/**
+ * G_TYPE_PARAM_DOUBLE:
+ *
+ * The #GType of #GParamSpecDouble.
+ */
+#define G_TYPE_PARAM_DOUBLE (g_param_spec_types[13])
+/**
+ * G_IS_PARAM_SPEC_DOUBLE:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_DOUBLE.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_DOUBLE))
+/**
+ * G_PARAM_SPEC_DOUBLE:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecDouble.
+ */
+#define G_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_DOUBLE, GParamSpecDouble))
+
+/**
+ * G_TYPE_PARAM_STRING:
+ *
+ * The #GType of #GParamSpecString.
+ */
+#define G_TYPE_PARAM_STRING (g_param_spec_types[14])
+/**
+ * G_IS_PARAM_SPEC_STRING:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_STRING.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_STRING))
+/**
+ * G_PARAM_SPEC_STRING:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Casts a #GParamSpec instance into a #GParamSpecString.
+ */
+#define G_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_STRING, GParamSpecString))
+
+/**
+ * G_TYPE_PARAM_PARAM:
+ *
+ * The #GType of #GParamSpecParam.
+ */
+#define G_TYPE_PARAM_PARAM (g_param_spec_types[15])
+/**
+ * G_IS_PARAM_SPEC_PARAM:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_PARAM.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_PARAM(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_PARAM))
+/**
+ * G_PARAM_SPEC_PARAM:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Casts a #GParamSpec instance into a #GParamSpecParam.
+ */
+#define G_PARAM_SPEC_PARAM(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_PARAM, GParamSpecParam))
+
+/**
+ * G_TYPE_PARAM_BOXED:
+ *
+ * The #GType of #GParamSpecBoxed.
+ */
+#define G_TYPE_PARAM_BOXED (g_param_spec_types[16])
+/**
+ * G_IS_PARAM_SPEC_BOXED:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_BOXED.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_BOXED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOXED))
+/**
+ * G_PARAM_SPEC_BOXED:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecBoxed.
+ */
+#define G_PARAM_SPEC_BOXED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOXED, GParamSpecBoxed))
+
+/**
+ * G_TYPE_PARAM_POINTER:
+ *
+ * The #GType of #GParamSpecPointer.
+ */
+#define G_TYPE_PARAM_POINTER (g_param_spec_types[17])
+/**
+ * G_IS_PARAM_SPEC_POINTER:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_POINTER.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_POINTER(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_POINTER))
+/**
+ * G_PARAM_SPEC_POINTER:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Casts a #GParamSpec instance into a #GParamSpecPointer.
+ */
+#define G_PARAM_SPEC_POINTER(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_POINTER, GParamSpecPointer))
+
+/**
+ * G_TYPE_PARAM_VALUE_ARRAY:
+ *
+ * The #GType of #GParamSpecValueArray.
+ *
+ * Deprecated: 2.32: Use #GArray instead of #GValueArray
+ */
+#define G_TYPE_PARAM_VALUE_ARRAY (g_param_spec_types[18]) GLIB_DEPRECATED_MACRO_IN_2_32
+/**
+ * G_IS_PARAM_SPEC_VALUE_ARRAY:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VALUE_ARRAY.
+ *
+ * Returns: %TRUE on success.
+ *
+ * Deprecated: 2.32: Use #GArray instead of #GValueArray
+ */
+#define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY)) GLIB_DEPRECATED_MACRO_IN_2_32
+/**
+ * G_PARAM_SPEC_VALUE_ARRAY:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Cast a #GParamSpec instance into a #GParamSpecValueArray.
+ *
+ * Deprecated: 2.32: Use #GArray instead of #GValueArray
+ */
+#define G_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray)) GLIB_DEPRECATED_MACRO_IN_2_32
+
+/**
+ * G_TYPE_PARAM_OBJECT:
+ *
+ * The #GType of #GParamSpecObject.
+ */
+#define G_TYPE_PARAM_OBJECT (g_param_spec_types[19])
+/**
+ * G_IS_PARAM_SPEC_OBJECT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_OBJECT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OBJECT))
+/**
+ * G_PARAM_SPEC_OBJECT:
+ * @pspec: a valid #GParamSpec instance
+ *
+ * Casts a #GParamSpec instance into a #GParamSpecObject.
+ */
+#define G_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OBJECT, GParamSpecObject))
+
+/**
+ * G_TYPE_PARAM_OVERRIDE:
+ *
+ * The #GType of #GParamSpecOverride.
+ *
+ * Since: 2.4
+ */
+#define G_TYPE_PARAM_OVERRIDE (g_param_spec_types[20])
+/**
+ * G_IS_PARAM_SPEC_OVERRIDE:
+ * @pspec: a #GParamSpec
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_OVERRIDE.
+ *
+ * Since: 2.4
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_OVERRIDE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OVERRIDE))
+/**
+ * G_PARAM_SPEC_OVERRIDE:
+ * @pspec: a #GParamSpec
+ *
+ * Casts a #GParamSpec into a #GParamSpecOverride.
+ *
+ * Since: 2.4
+ */
+#define G_PARAM_SPEC_OVERRIDE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OVERRIDE, GParamSpecOverride))
+
+/**
+ * G_TYPE_PARAM_GTYPE:
+ *
+ * The #GType of #GParamSpecGType.
+ *
+ * Since: 2.10
+ */
+#define G_TYPE_PARAM_GTYPE (g_param_spec_types[21])
+/**
+ * G_IS_PARAM_SPEC_GTYPE:
+ * @pspec: a #GParamSpec
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_GTYPE.
+ *
+ * Since: 2.10
+ * Returns: %TRUE on success.
+ */
+#define G_IS_PARAM_SPEC_GTYPE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_GTYPE))
+/**
+ * G_PARAM_SPEC_GTYPE:
+ * @pspec: a #GParamSpec
+ *
+ * Casts a #GParamSpec into a #GParamSpecGType.
+ *
+ * Since: 2.10
+ */
+#define G_PARAM_SPEC_GTYPE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_GTYPE, GParamSpecGType))
+
+/**
+ * G_TYPE_PARAM_VARIANT:
+ *
+ * The #GType of #GParamSpecVariant.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_PARAM_VARIANT (g_param_spec_types[22])
+/**
+ * G_IS_PARAM_SPEC_VARIANT:
+ * @pspec: a #GParamSpec
+ *
+ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VARIANT.
+ *
+ * Returns: %TRUE on success
+ *
+ * Since: 2.26
+ */
+#define G_IS_PARAM_SPEC_VARIANT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VARIANT))
+/**
+ * G_PARAM_SPEC_VARIANT:
+ * @pspec: a #GParamSpec
+ *
+ * Casts a #GParamSpec into a #GParamSpecVariant.
+ *
+ * Since: 2.26
+ */
+#define G_PARAM_SPEC_VARIANT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VARIANT, GParamSpecVariant))
+
+/* --- typedefs & structures --- */
+typedef struct _GParamSpecChar GParamSpecChar;
+typedef struct _GParamSpecUChar GParamSpecUChar;
+typedef struct _GParamSpecBoolean GParamSpecBoolean;
+typedef struct _GParamSpecInt GParamSpecInt;
+typedef struct _GParamSpecUInt GParamSpecUInt;
+typedef struct _GParamSpecLong GParamSpecLong;
+typedef struct _GParamSpecULong GParamSpecULong;
+typedef struct _GParamSpecInt64 GParamSpecInt64;
+typedef struct _GParamSpecUInt64 GParamSpecUInt64;
+typedef struct _GParamSpecUnichar GParamSpecUnichar;
+typedef struct _GParamSpecEnum GParamSpecEnum;
+typedef struct _GParamSpecFlags GParamSpecFlags;
+typedef struct _GParamSpecFloat GParamSpecFloat;
+typedef struct _GParamSpecDouble GParamSpecDouble;
+typedef struct _GParamSpecString GParamSpecString;
+typedef struct _GParamSpecParam GParamSpecParam;
+typedef struct _GParamSpecBoxed GParamSpecBoxed;
+typedef struct _GParamSpecPointer GParamSpecPointer;
+typedef struct _GParamSpecValueArray GParamSpecValueArray;
+typedef struct _GParamSpecObject GParamSpecObject;
+typedef struct _GParamSpecOverride GParamSpecOverride;
+typedef struct _GParamSpecGType GParamSpecGType;
+typedef struct _GParamSpecVariant GParamSpecVariant;
+
+/**
+ * GParamSpecChar:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for character properties.
+ */
+struct _GParamSpecChar
+{
+ GParamSpec parent_instance;
+
+ gint8 minimum;
+ gint8 maximum;
+ gint8 default_value;
+};
+/**
+ * GParamSpecUChar:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for unsigned character properties.
+ */
+struct _GParamSpecUChar
+{
+ GParamSpec parent_instance;
+
+ guint8 minimum;
+ guint8 maximum;
+ guint8 default_value;
+};
+/**
+ * GParamSpecBoolean:
+ * @parent_instance: private #GParamSpec portion
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for boolean properties.
+ */
+struct _GParamSpecBoolean
+{
+ GParamSpec parent_instance;
+
+ gboolean default_value;
+};
+/**
+ * GParamSpecInt:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for integer properties.
+ */
+struct _GParamSpecInt
+{
+ GParamSpec parent_instance;
+
+ gint minimum;
+ gint maximum;
+ gint default_value;
+};
+/**
+ * GParamSpecUInt:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for unsigned integer properties.
+ */
+struct _GParamSpecUInt
+{
+ GParamSpec parent_instance;
+
+ guint minimum;
+ guint maximum;
+ guint default_value;
+};
+/**
+ * GParamSpecLong:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for long integer properties.
+ */
+struct _GParamSpecLong
+{
+ GParamSpec parent_instance;
+
+ glong minimum;
+ glong maximum;
+ glong default_value;
+};
+/**
+ * GParamSpecULong:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for unsigned long integer properties.
+ */
+struct _GParamSpecULong
+{
+ GParamSpec parent_instance;
+
+ gulong minimum;
+ gulong maximum;
+ gulong default_value;
+};
+/**
+ * GParamSpecInt64:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for 64bit integer properties.
+ */
+struct _GParamSpecInt64
+{
+ GParamSpec parent_instance;
+
+ gint64 minimum;
+ gint64 maximum;
+ gint64 default_value;
+};
+/**
+ * GParamSpecUInt64:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for unsigned 64bit integer properties.
+ */
+struct _GParamSpecUInt64
+{
+ GParamSpec parent_instance;
+
+ guint64 minimum;
+ guint64 maximum;
+ guint64 default_value;
+};
+/**
+ * GParamSpecUnichar:
+ * @parent_instance: private #GParamSpec portion
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for unichar (unsigned integer) properties.
+ */
+struct _GParamSpecUnichar
+{
+ GParamSpec parent_instance;
+
+ gunichar default_value;
+};
+/**
+ * GParamSpecEnum:
+ * @parent_instance: private #GParamSpec portion
+ * @enum_class: the #GEnumClass for the enum
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for enum
+ * properties.
+ */
+struct _GParamSpecEnum
+{
+ GParamSpec parent_instance;
+
+ GEnumClass *enum_class;
+ gint default_value;
+};
+/**
+ * GParamSpecFlags:
+ * @parent_instance: private #GParamSpec portion
+ * @flags_class: the #GFlagsClass for the flags
+ * @default_value: default value for the property specified
+ *
+ * A #GParamSpec derived structure that contains the meta data for flags
+ * properties.
+ */
+struct _GParamSpecFlags
+{
+ GParamSpec parent_instance;
+
+ GFlagsClass *flags_class;
+ guint default_value;
+};
+/**
+ * GParamSpecFloat:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ * @epsilon: values closer than @epsilon will be considered identical
+ * by g_param_values_cmp(); the default value is 1e-30.
+ *
+ * A #GParamSpec derived structure that contains the meta data for float properties.
+ */
+struct _GParamSpecFloat
+{
+ GParamSpec parent_instance;
+
+ gfloat minimum;
+ gfloat maximum;
+ gfloat default_value;
+ gfloat epsilon;
+};
+/**
+ * GParamSpecDouble:
+ * @parent_instance: private #GParamSpec portion
+ * @minimum: minimum value for the property specified
+ * @maximum: maximum value for the property specified
+ * @default_value: default value for the property specified
+ * @epsilon: values closer than @epsilon will be considered identical
+ * by g_param_values_cmp(); the default value is 1e-90.
+ *
+ * A #GParamSpec derived structure that contains the meta data for double properties.
+ */
+struct _GParamSpecDouble
+{
+ GParamSpec parent_instance;
+
+ gdouble minimum;
+ gdouble maximum;
+ gdouble default_value;
+ gdouble epsilon;
+};
+/**
+ * GParamSpecString:
+ * @parent_instance: private #GParamSpec portion
+ * @default_value: default value for the property specified
+ * @cset_first: a string containing the allowed values for the first byte
+ * @cset_nth: a string containing the allowed values for the subsequent bytes
+ * @substitutor: the replacement byte for bytes which don't match @cset_first or @cset_nth.
+ * @null_fold_if_empty: replace empty string by %NULL
+ * @ensure_non_null: replace %NULL strings by an empty string
+ *
+ * A #GParamSpec derived structure that contains the meta data for string
+ * properties.
+ */
+struct _GParamSpecString
+{
+ GParamSpec parent_instance;
+
+ gchar *default_value;
+ gchar *cset_first;
+ gchar *cset_nth;
+ gchar substitutor;
+ guint null_fold_if_empty : 1;
+ guint ensure_non_null : 1;
+};
+/**
+ * GParamSpecParam:
+ * @parent_instance: private #GParamSpec portion
+ *
+ * A #GParamSpec derived structure that contains the meta data for %G_TYPE_PARAM
+ * properties.
+ */
+struct _GParamSpecParam
+{
+ GParamSpec parent_instance;
+};
+/**
+ * GParamSpecBoxed:
+ * @parent_instance: private #GParamSpec portion
+ *
+ * A #GParamSpec derived structure that contains the meta data for boxed properties.
+ */
+struct _GParamSpecBoxed
+{
+ GParamSpec parent_instance;
+};
+/**
+ * GParamSpecPointer:
+ * @parent_instance: private #GParamSpec portion
+ *
+ * A #GParamSpec derived structure that contains the meta data for pointer properties.
+ */
+struct _GParamSpecPointer
+{
+ GParamSpec parent_instance;
+};
+/**
+ * GParamSpecValueArray:
+ * @parent_instance: private #GParamSpec portion
+ * @element_spec: a #GParamSpec describing the elements contained in arrays of this property, may be %NULL
+ * @fixed_n_elements: if greater than 0, arrays of this property will always have this many elements
+ *
+ * A #GParamSpec derived structure that contains the meta data for #GValueArray properties.
+ */
+struct _GParamSpecValueArray
+{
+ GParamSpec parent_instance;
+ GParamSpec *element_spec;
+ guint fixed_n_elements;
+};
+/**
+ * GParamSpecObject:
+ * @parent_instance: private #GParamSpec portion
+ *
+ * A #GParamSpec derived structure that contains the meta data for object properties.
+ */
+struct _GParamSpecObject
+{
+ GParamSpec parent_instance;
+};
+/**
+ * GParamSpecOverride:
+ *
+ * This is a type of #GParamSpec type that simply redirects operations to
+ * another paramspec. All operations other than getting or
+ * setting the value are redirected, including accessing the nick and
+ * blurb, validating a value, and so forth. See
+ * g_param_spec_get_redirect_target() for retrieving the overidden
+ * property. #GParamSpecOverride is used in implementing
+ * g_object_class_override_property(), and will not be directly useful
+ * unless you are implementing a new base type similar to GObject.
+ *
+ * Since: 2.4
+ */
+struct _GParamSpecOverride
+{
+ /*< private >*/
+ GParamSpec parent_instance;
+ GParamSpec *overridden;
+};
+/**
+ * GParamSpecGType:
+ * @parent_instance: private #GParamSpec portion
+ * @is_a_type: a #GType whose subtypes can occur as values
+ *
+ * A #GParamSpec derived structure that contains the meta data for #GType properties.
+ *
+ * Since: 2.10
+ */
+struct _GParamSpecGType
+{
+ GParamSpec parent_instance;
+ GType is_a_type;
+};
+/**
+ * GParamSpecVariant:
+ * @parent_instance: private #GParamSpec portion
+ * @type: a #GVariantType, or %NULL
+ * @default_value: a #GVariant, or %NULL
+ *
+ * A #GParamSpec derived structure that contains the meta data for #GVariant properties.
+ *
+ * When comparing values with g_param_values_cmp(), scalar values with the same
+ * type will be compared with g_variant_compare(). Other non-%NULL variants will
+ * be checked for equality with g_variant_equal(), and their sort order is
+ * otherwise undefined. %NULL is ordered before non-%NULL variants. Two %NULL
+ * values compare equal.
+ *
+ * Since: 2.26
+ */
+struct _GParamSpecVariant
+{
+ GParamSpec parent_instance;
+ GVariantType *type;
+ GVariant *default_value;
+
+ /*< private >*/
+ gpointer padding[4];
+};
+
+/* --- GParamSpec prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_char (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint8 minimum,
+ gint8 maximum,
+ gint8 default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_uchar (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint8 minimum,
+ guint8 maximum,
+ guint8 default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_boolean (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gboolean default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_int (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint minimum,
+ gint maximum,
+ gint default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_uint (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint minimum,
+ guint maximum,
+ guint default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_long (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ glong minimum,
+ glong maximum,
+ glong default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_ulong (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gulong minimum,
+ gulong maximum,
+ gulong default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_int64 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint64 minimum,
+ gint64 maximum,
+ gint64 default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_uint64 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint64 minimum,
+ guint64 maximum,
+ guint64 default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_unichar (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gunichar default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_enum (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GType enum_type,
+ gint default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_flags (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GType flags_type,
+ guint default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_float (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gfloat minimum,
+ gfloat maximum,
+ gfloat default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_double (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gdouble minimum,
+ gdouble maximum,
+ gdouble default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_string (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ const gchar *default_value,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_param (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GType param_type,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_boxed (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GType boxed_type,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_pointer (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_value_array (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GParamSpec *element_spec,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_object (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GType object_type,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_override (const gchar *name,
+ GParamSpec *overridden);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_gtype (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GType is_a_type,
+ GParamFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GParamSpec* g_param_spec_variant (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ const GVariantType *type,
+ GVariant *default_value,
+ GParamFlags flags);
+
+/* --- internal --- */
+/* We prefix variable declarations so they can
+ * properly get exported in windows dlls.
+ */
+#ifndef GOBJECT_VAR
+# ifdef G_PLATFORM_WIN32
+# ifdef GOBJECT_STATIC_COMPILATION
+# define GOBJECT_VAR extern
+# else /* !GOBJECT_STATIC_COMPILATION */
+# ifdef GOBJECT_COMPILATION
+# ifdef DLL_EXPORT
+# define GOBJECT_VAR extern __declspec(dllexport)
+# else /* !DLL_EXPORT */
+# define GOBJECT_VAR extern
+# endif /* !DLL_EXPORT */
+# else /* !GOBJECT_COMPILATION */
+# define GOBJECT_VAR extern __declspec(dllimport)
+# endif /* !GOBJECT_COMPILATION */
+# endif /* !GOBJECT_STATIC_COMPILATION */
+# else /* !G_PLATFORM_WIN32 */
+# define GOBJECT_VAR _GLIB_EXTERN
+# endif /* !G_PLATFORM_WIN32 */
+#endif /* GOBJECT_VAR */
+
+GOBJECT_VAR GType *g_param_spec_types;
+
+G_END_DECLS
+
+#endif /* __G_PARAMSPECS_H__ */
diff --git a/include/glib/gobject/gsignal.h b/include/glib/gobject/gsignal.h
new file mode 100644
index 0000000000..a79b9f662a
--- /dev/null
+++ b/include/glib/gobject/gsignal.h
@@ -0,0 +1,623 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2000-2001 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_SIGNAL_H__
+#define __G_SIGNAL_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gclosure.h>
+#include <gobject/gvalue.h>
+#include <gobject/gparam.h>
+#include <gobject/gmarshal.h>
+
+G_BEGIN_DECLS
+
+/* --- typedefs --- */
+typedef struct _GSignalQuery GSignalQuery;
+typedef struct _GSignalInvocationHint GSignalInvocationHint;
+/**
+ * GSignalCMarshaller:
+ *
+ * This is the signature of marshaller functions, required to marshall
+ * arrays of parameter values to signal emissions into C language callback
+ * invocations. It is merely an alias to #GClosureMarshal since the #GClosure
+ * mechanism takes over responsibility of actual function invocation for the
+ * signal system.
+ */
+typedef GClosureMarshal GSignalCMarshaller;
+/**
+ * GSignalCVaMarshaller:
+ *
+ * This is the signature of va_list marshaller functions, an optional
+ * marshaller that can be used in some situations to avoid
+ * marshalling the signal argument into GValues.
+ */
+typedef GVaClosureMarshal GSignalCVaMarshaller;
+/**
+ * GSignalEmissionHook:
+ * @ihint: Signal invocation hint, see #GSignalInvocationHint.
+ * @n_param_values: the number of parameters to the function, including
+ * the instance on which the signal was emitted.
+ * @param_values: (array length=n_param_values): the instance on which
+ * the signal was emitted, followed by the parameters of the emission.
+ * @data: user data associated with the hook.
+ *
+ * A simple function pointer to get invoked when the signal is emitted. This
+ * allows you to tie a hook to the signal type, so that it will trap all
+ * emissions of that signal, from any object.
+ *
+ * You may not attach these to signals created with the #G_SIGNAL_NO_HOOKS flag.
+ *
+ * Returns: whether it wants to stay connected. If it returns %FALSE, the signal
+ * hook is disconnected (and destroyed).
+ */
+typedef gboolean (*GSignalEmissionHook) (GSignalInvocationHint *ihint,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer data);
+/**
+ * GSignalAccumulator:
+ * @ihint: Signal invocation hint, see #GSignalInvocationHint.
+ * @return_accu: Accumulator to collect callback return values in, this
+ * is the return value of the current signal emission.
+ * @handler_return: A #GValue holding the return value of the signal handler.
+ * @data: Callback data that was specified when creating the signal.
+ *
+ * The signal accumulator is a special callback function that can be used
+ * to collect return values of the various callbacks that are called
+ * during a signal emission. The signal accumulator is specified at signal
+ * creation time, if it is left %NULL, no accumulation of callback return
+ * values is performed. The return value of signal emissions is then the
+ * value returned by the last callback.
+ *
+ * Returns: The accumulator function returns whether the signal emission
+ * should be aborted. Returning %FALSE means to abort the
+ * current emission and %TRUE is returned for continuation.
+ */
+typedef gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint,
+ GValue *return_accu,
+ const GValue *handler_return,
+ gpointer data);
+
+
+/* --- run, match and connect types --- */
+/**
+ * GSignalFlags:
+ * @G_SIGNAL_RUN_FIRST: Invoke the object method handler in the first emission stage.
+ * @G_SIGNAL_RUN_LAST: Invoke the object method handler in the third emission stage.
+ * @G_SIGNAL_RUN_CLEANUP: Invoke the object method handler in the last emission stage.
+ * @G_SIGNAL_NO_RECURSE: Signals being emitted for an object while currently being in
+ * emission for this very object will not be emitted recursively,
+ * but instead cause the first emission to be restarted.
+ * @G_SIGNAL_DETAILED: This signal supports "::detail" appendices to the signal name
+ * upon handler connections and emissions.
+ * @G_SIGNAL_ACTION: Action signals are signals that may freely be emitted on alive
+ * objects from user code via g_signal_emit() and friends, without
+ * the need of being embedded into extra code that performs pre or
+ * post emission adjustments on the object. They can also be thought
+ * of as object methods which can be called generically by
+ * third-party code.
+ * @G_SIGNAL_NO_HOOKS: No emissions hooks are supported for this signal.
+ * @G_SIGNAL_MUST_COLLECT: Varargs signal emission will always collect the
+ * arguments, even if there are no signal handlers connected. Since 2.30.
+ * @G_SIGNAL_DEPRECATED: The signal is deprecated and will be removed
+ * in a future version. A warning will be generated if it is connected while
+ * running with G_ENABLE_DIAGNOSTIC=1. Since 2.32.
+ *
+ * The signal flags are used to specify a signal's behaviour, the overall
+ * signal description outlines how especially the RUN flags control the
+ * stages of a signal emission.
+ */
+typedef enum
+{
+ G_SIGNAL_RUN_FIRST = 1 << 0,
+ G_SIGNAL_RUN_LAST = 1 << 1,
+ G_SIGNAL_RUN_CLEANUP = 1 << 2,
+ G_SIGNAL_NO_RECURSE = 1 << 3,
+ G_SIGNAL_DETAILED = 1 << 4,
+ G_SIGNAL_ACTION = 1 << 5,
+ G_SIGNAL_NO_HOOKS = 1 << 6,
+ G_SIGNAL_MUST_COLLECT = 1 << 7,
+ G_SIGNAL_DEPRECATED = 1 << 8
+} GSignalFlags;
+/**
+ * G_SIGNAL_FLAGS_MASK:
+ *
+ * A mask for all #GSignalFlags bits.
+ */
+#define G_SIGNAL_FLAGS_MASK 0x1ff
+/**
+ * GConnectFlags:
+ * @G_CONNECT_AFTER: whether the handler should be called before or after the
+ * default handler of the signal.
+ * @G_CONNECT_SWAPPED: whether the instance and data should be swapped when
+ * calling the handler; see g_signal_connect_swapped() for an example.
+ *
+ * The connection flags are used to specify the behaviour of a signal's
+ * connection.
+ */
+typedef enum
+{
+ G_CONNECT_AFTER = 1 << 0,
+ G_CONNECT_SWAPPED = 1 << 1
+} GConnectFlags;
+/**
+ * GSignalMatchType:
+ * @G_SIGNAL_MATCH_ID: The signal id must be equal.
+ * @G_SIGNAL_MATCH_DETAIL: The signal detail be equal.
+ * @G_SIGNAL_MATCH_CLOSURE: The closure must be the same.
+ * @G_SIGNAL_MATCH_FUNC: The C closure callback must be the same.
+ * @G_SIGNAL_MATCH_DATA: The closure data must be the same.
+ * @G_SIGNAL_MATCH_UNBLOCKED: Only unblocked signals may matched.
+ *
+ * The match types specify what g_signal_handlers_block_matched(),
+ * g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
+ * match signals by.
+ */
+typedef enum
+{
+ G_SIGNAL_MATCH_ID = 1 << 0,
+ G_SIGNAL_MATCH_DETAIL = 1 << 1,
+ G_SIGNAL_MATCH_CLOSURE = 1 << 2,
+ G_SIGNAL_MATCH_FUNC = 1 << 3,
+ G_SIGNAL_MATCH_DATA = 1 << 4,
+ G_SIGNAL_MATCH_UNBLOCKED = 1 << 5
+} GSignalMatchType;
+/**
+ * G_SIGNAL_MATCH_MASK:
+ *
+ * A mask for all #GSignalMatchType bits.
+ */
+#define G_SIGNAL_MATCH_MASK 0x3f
+/**
+ * G_SIGNAL_TYPE_STATIC_SCOPE:
+ *
+ * This macro flags signal argument types for which the signal system may
+ * assume that instances thereof remain persistent across all signal emissions
+ * they are used in. This is only useful for non ref-counted, value-copy types.
+ *
+ * To flag a signal argument in this way, add `| G_SIGNAL_TYPE_STATIC_SCOPE`
+ * to the corresponding argument of g_signal_new().
+ * |[
+ * g_signal_new ("size_request",
+ * G_TYPE_FROM_CLASS (gobject_class),
+ * G_SIGNAL_RUN_FIRST,
+ * G_STRUCT_OFFSET (GtkWidgetClass, size_request),
+ * NULL, NULL,
+ * _gtk_marshal_VOID__BOXED,
+ * G_TYPE_NONE, 1,
+ * GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
+ * ]|
+ */
+#define G_SIGNAL_TYPE_STATIC_SCOPE (G_TYPE_FLAG_RESERVED_ID_BIT)
+
+
+/* --- signal information --- */
+/**
+ * GSignalInvocationHint:
+ * @signal_id: The signal id of the signal invoking the callback
+ * @detail: The detail passed on for this emission
+ * @run_type: The stage the signal emission is currently in, this
+ * field will contain one of %G_SIGNAL_RUN_FIRST,
+ * %G_SIGNAL_RUN_LAST or %G_SIGNAL_RUN_CLEANUP.
+ *
+ * The #GSignalInvocationHint structure is used to pass on additional information
+ * to callbacks during a signal emission.
+ */
+struct _GSignalInvocationHint
+{
+ guint signal_id;
+ GQuark detail;
+ GSignalFlags run_type;
+};
+/**
+ * GSignalQuery:
+ * @signal_id: The signal id of the signal being queried, or 0 if the
+ * signal to be queried was unknown.
+ * @signal_name: The signal name.
+ * @itype: The interface/instance type that this signal can be emitted for.
+ * @signal_flags: The signal flags as passed in to g_signal_new().
+ * @return_type: The return type for user callbacks.
+ * @n_params: The number of parameters that user callbacks take.
+ * @param_types: (array length=n_params): The individual parameter types for
+ * user callbacks, note that the effective callback signature is:
+ * |[<!-- language="C" -->
+ * @return_type callback (#gpointer data1,
+ * [param_types param_names,]
+ * gpointer data2);
+ * ]|
+ *
+ * A structure holding in-depth information for a specific signal. It is
+ * filled in by the g_signal_query() function.
+ */
+struct _GSignalQuery
+{
+ guint signal_id;
+ const gchar *signal_name;
+ GType itype;
+ GSignalFlags signal_flags;
+ GType return_type; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
+ guint n_params;
+ const GType *param_types; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
+};
+
+
+/* --- signals --- */
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_newv (const gchar *signal_name,
+ GType itype,
+ GSignalFlags signal_flags,
+ GClosure *class_closure,
+ GSignalAccumulator accumulator,
+ gpointer accu_data,
+ GSignalCMarshaller c_marshaller,
+ GType return_type,
+ guint n_params,
+ GType *param_types);
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_new_valist (const gchar *signal_name,
+ GType itype,
+ GSignalFlags signal_flags,
+ GClosure *class_closure,
+ GSignalAccumulator accumulator,
+ gpointer accu_data,
+ GSignalCMarshaller c_marshaller,
+ GType return_type,
+ guint n_params,
+ va_list args);
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_new (const gchar *signal_name,
+ GType itype,
+ GSignalFlags signal_flags,
+ guint class_offset,
+ GSignalAccumulator accumulator,
+ gpointer accu_data,
+ GSignalCMarshaller c_marshaller,
+ GType return_type,
+ guint n_params,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_new_class_handler (const gchar *signal_name,
+ GType itype,
+ GSignalFlags signal_flags,
+ GCallback class_handler,
+ GSignalAccumulator accumulator,
+ gpointer accu_data,
+ GSignalCMarshaller c_marshaller,
+ GType return_type,
+ guint n_params,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_set_va_marshaller (guint signal_id,
+ GType instance_type,
+ GSignalCVaMarshaller va_marshaller);
+
+GLIB_AVAILABLE_IN_ALL
+void g_signal_emitv (const GValue *instance_and_params,
+ guint signal_id,
+ GQuark detail,
+ GValue *return_value);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_emit_valist (gpointer instance,
+ guint signal_id,
+ GQuark detail,
+ va_list var_args);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_emit (gpointer instance,
+ guint signal_id,
+ GQuark detail,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_emit_by_name (gpointer instance,
+ const gchar *detailed_signal,
+ ...);
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_lookup (const gchar *name,
+ GType itype);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_signal_name (guint signal_id);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_query (guint signal_id,
+ GSignalQuery *query);
+GLIB_AVAILABLE_IN_ALL
+guint* g_signal_list_ids (GType itype,
+ guint *n_ids);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_signal_parse_name (const gchar *detailed_signal,
+ GType itype,
+ guint *signal_id_p,
+ GQuark *detail_p,
+ gboolean force_detail_quark);
+GLIB_AVAILABLE_IN_ALL
+GSignalInvocationHint* g_signal_get_invocation_hint (gpointer instance);
+
+
+/* --- signal emissions --- */
+GLIB_AVAILABLE_IN_ALL
+void g_signal_stop_emission (gpointer instance,
+ guint signal_id,
+ GQuark detail);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_stop_emission_by_name (gpointer instance,
+ const gchar *detailed_signal);
+GLIB_AVAILABLE_IN_ALL
+gulong g_signal_add_emission_hook (guint signal_id,
+ GQuark detail,
+ GSignalEmissionHook hook_func,
+ gpointer hook_data,
+ GDestroyNotify data_destroy);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_remove_emission_hook (guint signal_id,
+ gulong hook_id);
+
+
+/* --- signal handlers --- */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_signal_has_handler_pending (gpointer instance,
+ guint signal_id,
+ GQuark detail,
+ gboolean may_be_blocked);
+GLIB_AVAILABLE_IN_ALL
+gulong g_signal_connect_closure_by_id (gpointer instance,
+ guint signal_id,
+ GQuark detail,
+ GClosure *closure,
+ gboolean after);
+GLIB_AVAILABLE_IN_ALL
+gulong g_signal_connect_closure (gpointer instance,
+ const gchar *detailed_signal,
+ GClosure *closure,
+ gboolean after);
+GLIB_AVAILABLE_IN_ALL
+gulong g_signal_connect_data (gpointer instance,
+ const gchar *detailed_signal,
+ GCallback c_handler,
+ gpointer data,
+ GClosureNotify destroy_data,
+ GConnectFlags connect_flags);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_handler_block (gpointer instance,
+ gulong handler_id);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_handler_unblock (gpointer instance,
+ gulong handler_id);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_handler_disconnect (gpointer instance,
+ gulong handler_id);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_signal_handler_is_connected (gpointer instance,
+ gulong handler_id);
+GLIB_AVAILABLE_IN_ALL
+gulong g_signal_handler_find (gpointer instance,
+ GSignalMatchType mask,
+ guint signal_id,
+ GQuark detail,
+ GClosure *closure,
+ gpointer func,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_handlers_block_matched (gpointer instance,
+ GSignalMatchType mask,
+ guint signal_id,
+ GQuark detail,
+ GClosure *closure,
+ gpointer func,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_handlers_unblock_matched (gpointer instance,
+ GSignalMatchType mask,
+ guint signal_id,
+ GQuark detail,
+ GClosure *closure,
+ gpointer func,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+guint g_signal_handlers_disconnect_matched (gpointer instance,
+ GSignalMatchType mask,
+ guint signal_id,
+ GQuark detail,
+ GClosure *closure,
+ gpointer func,
+ gpointer data);
+
+GLIB_AVAILABLE_IN_2_62
+void g_clear_signal_handler (gulong *handler_id_ptr,
+ gpointer instance);
+
+#define g_clear_signal_handler(handler_id_ptr, instance) \
+ G_STMT_START { \
+ G_STATIC_ASSERT (sizeof *(handler_id_ptr) == sizeof (gulong)); \
+ gulong _handler_id = *(handler_id_ptr); \
+ \
+ if (_handler_id > 0) \
+ { \
+ g_signal_handler_disconnect ((instance), _handler_id); \
+ *(handler_id_ptr) = 0; \
+ } \
+ } G_STMT_END \
+ GLIB_AVAILABLE_MACRO_IN_2_62
+
+/* --- overriding and chaining --- */
+GLIB_AVAILABLE_IN_ALL
+void g_signal_override_class_closure (guint signal_id,
+ GType instance_type,
+ GClosure *class_closure);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_override_class_handler (const gchar *signal_name,
+ GType instance_type,
+ GCallback class_handler);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_chain_from_overridden (const GValue *instance_and_params,
+ GValue *return_value);
+GLIB_AVAILABLE_IN_ALL
+void g_signal_chain_from_overridden_handler (gpointer instance,
+ ...);
+
+
+/* --- convenience --- */
+/**
+ * g_signal_connect:
+ * @instance: the instance to connect to.
+ * @detailed_signal: a string of the form "signal-name::detail".
+ * @c_handler: the #GCallback to connect.
+ * @data: data to pass to @c_handler calls.
+ *
+ * Connects a #GCallback function to a signal for a particular object.
+ *
+ * The handler will be called before the default handler of the signal.
+ *
+ * See [memory management of signal handlers][signal-memory-management] for
+ * details on how to handle the return value and memory management of @data.
+ *
+ * Returns: the handler ID, of type #gulong (always greater than 0 for successful connections)
+ */
+#define g_signal_connect(instance, detailed_signal, c_handler, data) \
+ g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)
+/**
+ * g_signal_connect_after:
+ * @instance: the instance to connect to.
+ * @detailed_signal: a string of the form "signal-name::detail".
+ * @c_handler: the #GCallback to connect.
+ * @data: data to pass to @c_handler calls.
+ *
+ * Connects a #GCallback function to a signal for a particular object.
+ *
+ * The handler will be called after the default handler of the signal.
+ *
+ * Returns: the handler ID, of type #gulong (always greater than 0 for successful connections)
+ */
+#define g_signal_connect_after(instance, detailed_signal, c_handler, data) \
+ g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)
+/**
+ * g_signal_connect_swapped:
+ * @instance: the instance to connect to.
+ * @detailed_signal: a string of the form "signal-name::detail".
+ * @c_handler: the #GCallback to connect.
+ * @data: data to pass to @c_handler calls.
+ *
+ * Connects a #GCallback function to a signal for a particular object.
+ *
+ * The instance on which the signal is emitted and @data will be swapped when
+ * calling the handler. This is useful when calling pre-existing functions to
+ * operate purely on the @data, rather than the @instance: swapping the
+ * parameters avoids the need to write a wrapper function.
+ *
+ * For example, this allows the shorter code:
+ * |[<!-- language="C" -->
+ * g_signal_connect_swapped (button, "clicked",
+ * (GCallback) gtk_widget_hide, other_widget);
+ * ]|
+ *
+ * Rather than the cumbersome:
+ * |[<!-- language="C" -->
+ * static void
+ * button_clicked_cb (GtkButton *button, GtkWidget *other_widget)
+ * {
+ * gtk_widget_hide (other_widget);
+ * }
+ *
+ * ...
+ *
+ * g_signal_connect (button, "clicked",
+ * (GCallback) button_clicked_cb, other_widget);
+ * ]|
+ *
+ * Returns: the handler ID, of type #gulong (always greater than 0 for successful connections)
+ */
+#define g_signal_connect_swapped(instance, detailed_signal, c_handler, data) \
+ g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)
+/**
+ * g_signal_handlers_disconnect_by_func:
+ * @instance: The instance to remove handlers from.
+ * @func: The C closure callback of the handlers (useless for non-C closures).
+ * @data: The closure data of the handlers' closures.
+ *
+ * Disconnects all handlers on an instance that match @func and @data.
+ *
+ * Returns: The number of handlers that matched.
+ */
+#define g_signal_handlers_disconnect_by_func(instance, func, data) \
+ g_signal_handlers_disconnect_matched ((instance), \
+ (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
+ 0, 0, NULL, (func), (data))
+
+/**
+ * g_signal_handlers_disconnect_by_data:
+ * @instance: The instance to remove handlers from
+ * @data: the closure data of the handlers' closures
+ *
+ * Disconnects all handlers on an instance that match @data.
+ *
+ * Returns: The number of handlers that matched.
+ *
+ * Since: 2.32
+ */
+#define g_signal_handlers_disconnect_by_data(instance, data) \
+ g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (data))
+
+/**
+ * g_signal_handlers_block_by_func:
+ * @instance: The instance to block handlers from.
+ * @func: The C closure callback of the handlers (useless for non-C closures).
+ * @data: The closure data of the handlers' closures.
+ *
+ * Blocks all handlers on an instance that match @func and @data.
+ *
+ * Returns: The number of handlers that matched.
+ */
+#define g_signal_handlers_block_by_func(instance, func, data) \
+ g_signal_handlers_block_matched ((instance), \
+ (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
+ 0, 0, NULL, (func), (data))
+/**
+ * g_signal_handlers_unblock_by_func:
+ * @instance: The instance to unblock handlers from.
+ * @func: The C closure callback of the handlers (useless for non-C closures).
+ * @data: The closure data of the handlers' closures.
+ *
+ * Unblocks all handlers on an instance that match @func and @data.
+ *
+ * Returns: The number of handlers that matched.
+ */
+#define g_signal_handlers_unblock_by_func(instance, func, data) \
+ g_signal_handlers_unblock_matched ((instance), \
+ (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
+ 0, 0, NULL, (func), (data))
+
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_signal_accumulator_true_handled (GSignalInvocationHint *ihint,
+ GValue *return_accu,
+ const GValue *handler_return,
+ gpointer dummy);
+
+GLIB_AVAILABLE_IN_ALL
+gboolean g_signal_accumulator_first_wins (GSignalInvocationHint *ihint,
+ GValue *return_accu,
+ const GValue *handler_return,
+ gpointer dummy);
+
+/*< private >*/
+GLIB_AVAILABLE_IN_ALL
+void g_signal_handlers_destroy (gpointer instance);
+void _g_signals_destroy (GType itype);
+
+G_END_DECLS
+
+#endif /* __G_SIGNAL_H__ */
diff --git a/include/glib/gobject/gsourceclosure.h b/include/glib/gobject/gsourceclosure.h
new file mode 100644
index 0000000000..4847677033
--- /dev/null
+++ b/include/glib/gobject/gsourceclosure.h
@@ -0,0 +1,38 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2001 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_SOURCECLOSURE_H__
+#define __G_SOURCECLOSURE_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gclosure.h>
+#include <gobject/glib-types.h>
+
+G_BEGIN_DECLS
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_closure (GSource *source,
+ GClosure *closure);
+
+GLIB_AVAILABLE_IN_ALL
+void g_source_set_dummy_callback (GSource *source);
+
+G_END_DECLS
+
+#endif /* __G_SOURCECLOSURE_H__ */
diff --git a/include/glib/gobject/gtype.h b/include/glib/gobject/gtype.h
new file mode 100644
index 0000000000..d9e5d110ce
--- /dev/null
+++ b/include/glib/gobject/gtype.h
@@ -0,0 +1,2356 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_TYPE_H__
+#define __G_TYPE_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/* Basic Type Macros
+ */
+/**
+ * G_TYPE_FUNDAMENTAL:
+ * @type: A #GType value.
+ *
+ * The fundamental type which is the ancestor of @type.
+ * Fundamental types are types that serve as ultimate bases for the derived types,
+ * thus they are the roots of distinct inheritance hierarchies.
+ */
+#define G_TYPE_FUNDAMENTAL(type) (g_type_fundamental (type))
+/**
+ * G_TYPE_FUNDAMENTAL_MAX:
+ *
+ * An integer constant that represents the number of identifiers reserved
+ * for types that are assigned at compile-time.
+ */
+#define G_TYPE_FUNDAMENTAL_MAX (255 << G_TYPE_FUNDAMENTAL_SHIFT)
+
+/* Constant fundamental types,
+ */
+/**
+ * G_TYPE_INVALID:
+ *
+ * An invalid #GType used as error return value in some functions which return
+ * a #GType.
+ */
+#define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0)
+/**
+ * G_TYPE_NONE:
+ *
+ * A fundamental type which is used as a replacement for the C
+ * void return type.
+ */
+#define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1)
+/**
+ * G_TYPE_INTERFACE:
+ *
+ * The fundamental type from which all interfaces are derived.
+ */
+#define G_TYPE_INTERFACE G_TYPE_MAKE_FUNDAMENTAL (2)
+/**
+ * G_TYPE_CHAR:
+ *
+ * The fundamental type corresponding to #gchar.
+ * The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed integer.
+ * This may or may not be the same type a the C type "gchar".
+ */
+#define G_TYPE_CHAR G_TYPE_MAKE_FUNDAMENTAL (3)
+/**
+ * G_TYPE_UCHAR:
+ *
+ * The fundamental type corresponding to #guchar.
+ */
+#define G_TYPE_UCHAR G_TYPE_MAKE_FUNDAMENTAL (4)
+/**
+ * G_TYPE_BOOLEAN:
+ *
+ * The fundamental type corresponding to #gboolean.
+ */
+#define G_TYPE_BOOLEAN G_TYPE_MAKE_FUNDAMENTAL (5)
+/**
+ * G_TYPE_INT:
+ *
+ * The fundamental type corresponding to #gint.
+ */
+#define G_TYPE_INT G_TYPE_MAKE_FUNDAMENTAL (6)
+/**
+ * G_TYPE_UINT:
+ *
+ * The fundamental type corresponding to #guint.
+ */
+#define G_TYPE_UINT G_TYPE_MAKE_FUNDAMENTAL (7)
+/**
+ * G_TYPE_LONG:
+ *
+ * The fundamental type corresponding to #glong.
+ */
+#define G_TYPE_LONG G_TYPE_MAKE_FUNDAMENTAL (8)
+/**
+ * G_TYPE_ULONG:
+ *
+ * The fundamental type corresponding to #gulong.
+ */
+#define G_TYPE_ULONG G_TYPE_MAKE_FUNDAMENTAL (9)
+/**
+ * G_TYPE_INT64:
+ *
+ * The fundamental type corresponding to #gint64.
+ */
+#define G_TYPE_INT64 G_TYPE_MAKE_FUNDAMENTAL (10)
+/**
+ * G_TYPE_UINT64:
+ *
+ * The fundamental type corresponding to #guint64.
+ */
+#define G_TYPE_UINT64 G_TYPE_MAKE_FUNDAMENTAL (11)
+/**
+ * G_TYPE_ENUM:
+ *
+ * The fundamental type from which all enumeration types are derived.
+ */
+#define G_TYPE_ENUM G_TYPE_MAKE_FUNDAMENTAL (12)
+/**
+ * G_TYPE_FLAGS:
+ *
+ * The fundamental type from which all flags types are derived.
+ */
+#define G_TYPE_FLAGS G_TYPE_MAKE_FUNDAMENTAL (13)
+/**
+ * G_TYPE_FLOAT:
+ *
+ * The fundamental type corresponding to #gfloat.
+ */
+#define G_TYPE_FLOAT G_TYPE_MAKE_FUNDAMENTAL (14)
+/**
+ * G_TYPE_DOUBLE:
+ *
+ * The fundamental type corresponding to #gdouble.
+ */
+#define G_TYPE_DOUBLE G_TYPE_MAKE_FUNDAMENTAL (15)
+/**
+ * G_TYPE_STRING:
+ *
+ * The fundamental type corresponding to nul-terminated C strings.
+ */
+#define G_TYPE_STRING G_TYPE_MAKE_FUNDAMENTAL (16)
+/**
+ * G_TYPE_POINTER:
+ *
+ * The fundamental type corresponding to #gpointer.
+ */
+#define G_TYPE_POINTER G_TYPE_MAKE_FUNDAMENTAL (17)
+/**
+ * G_TYPE_BOXED:
+ *
+ * The fundamental type from which all boxed types are derived.
+ */
+#define G_TYPE_BOXED G_TYPE_MAKE_FUNDAMENTAL (18)
+/**
+ * G_TYPE_PARAM:
+ *
+ * The fundamental type from which all #GParamSpec types are derived.
+ */
+#define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19)
+/**
+ * G_TYPE_OBJECT:
+ *
+ * The fundamental type for #GObject.
+ */
+#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20)
+/**
+ * G_TYPE_VARIANT:
+ *
+ * The fundamental type corresponding to #GVariant.
+ *
+ * All floating #GVariant instances passed through the #GType system are
+ * consumed.
+ *
+ * Note that callbacks in closures, and signal handlers
+ * for signals of return type %G_TYPE_VARIANT, must never return floating
+ * variants.
+ *
+ * Note: GLib 2.24 did include a boxed type with this name. It was replaced
+ * with this fundamental type in 2.26.
+ *
+ * Since: 2.26
+ */
+#define G_TYPE_VARIANT G_TYPE_MAKE_FUNDAMENTAL (21)
+
+
+/* Reserved fundamental type numbers to create new fundamental
+ * type IDs with G_TYPE_MAKE_FUNDAMENTAL().
+ *
+ * Open an issue on https://gitlab.gnome.org/GNOME/glib/issues/new for
+ * reservations.
+ */
+/**
+ * G_TYPE_FUNDAMENTAL_SHIFT:
+ *
+ * Shift value used in converting numbers to type IDs.
+ */
+#define G_TYPE_FUNDAMENTAL_SHIFT (2)
+/**
+ * G_TYPE_MAKE_FUNDAMENTAL:
+ * @x: the fundamental type number.
+ *
+ * Get the type ID for the fundamental type number @x.
+ * Use g_type_fundamental_next() instead of this macro to create new fundamental
+ * types.
+ *
+ * Returns: the GType
+ */
+#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT))
+/**
+ * G_TYPE_RESERVED_GLIB_FIRST:
+ *
+ * First fundamental type number to create a new fundamental type id with
+ * G_TYPE_MAKE_FUNDAMENTAL() reserved for GLib.
+ */
+#define G_TYPE_RESERVED_GLIB_FIRST (22)
+/**
+ * G_TYPE_RESERVED_GLIB_LAST:
+ *
+ * Last fundamental type number reserved for GLib.
+ */
+#define G_TYPE_RESERVED_GLIB_LAST (31)
+/**
+ * G_TYPE_RESERVED_BSE_FIRST:
+ *
+ * First fundamental type number to create a new fundamental type id with
+ * G_TYPE_MAKE_FUNDAMENTAL() reserved for BSE.
+ */
+#define G_TYPE_RESERVED_BSE_FIRST (32)
+/**
+ * G_TYPE_RESERVED_BSE_LAST:
+ *
+ * Last fundamental type number reserved for BSE.
+ */
+#define G_TYPE_RESERVED_BSE_LAST (48)
+/**
+ * G_TYPE_RESERVED_USER_FIRST:
+ *
+ * First available fundamental type number to create new fundamental
+ * type id with G_TYPE_MAKE_FUNDAMENTAL().
+ */
+#define G_TYPE_RESERVED_USER_FIRST (49)
+
+
+/* Type Checking Macros
+ */
+/**
+ * G_TYPE_IS_FUNDAMENTAL:
+ * @type: A #GType value
+ *
+ * Checks if @type is a fundamental type.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_FUNDAMENTAL(type) ((type) <= G_TYPE_FUNDAMENTAL_MAX)
+/**
+ * G_TYPE_IS_DERIVED:
+ * @type: A #GType value
+ *
+ * Checks if @type is derived (or in object-oriented terminology:
+ * inherited) from another type (this holds true for all non-fundamental
+ * types).
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_DERIVED(type) ((type) > G_TYPE_FUNDAMENTAL_MAX)
+/**
+ * G_TYPE_IS_INTERFACE:
+ * @type: A #GType value
+ *
+ * Checks if @type is an interface type.
+ * An interface type provides a pure API, the implementation
+ * of which is provided by another type (which is then said to conform
+ * to the interface). GLib interfaces are somewhat analogous to Java
+ * interfaces and C++ classes containing only pure virtual functions,
+ * with the difference that GType interfaces are not derivable (but see
+ * g_type_interface_add_prerequisite() for an alternative).
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_INTERFACE(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE)
+/**
+ * G_TYPE_IS_CLASSED:
+ * @type: A #GType value
+ *
+ * Checks if @type is a classed type.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_CLASSED(type) (g_type_test_flags ((type), G_TYPE_FLAG_CLASSED))
+/**
+ * G_TYPE_IS_INSTANTIATABLE:
+ * @type: A #GType value
+ *
+ * Checks if @type can be instantiated. Instantiation is the
+ * process of creating an instance (object) of this type.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_INSTANTIATABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_INSTANTIATABLE))
+/**
+ * G_TYPE_IS_DERIVABLE:
+ * @type: A #GType value
+ *
+ * Checks if @type is a derivable type. A derivable type can
+ * be used as the base class of a flat (single-level) class hierarchy.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DERIVABLE))
+/**
+ * G_TYPE_IS_DEEP_DERIVABLE:
+ * @type: A #GType value
+ *
+ * Checks if @type is a deep derivable type. A deep derivable type
+ * can be used as the base class of a deep (multi-level) class hierarchy.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_DEEP_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE))
+/**
+ * G_TYPE_IS_ABSTRACT:
+ * @type: A #GType value
+ *
+ * Checks if @type is an abstract type. An abstract type cannot be
+ * instantiated and is normally used as an abstract base class for
+ * derived classes.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_ABSTRACT(type) (g_type_test_flags ((type), G_TYPE_FLAG_ABSTRACT))
+/**
+ * G_TYPE_IS_VALUE_ABSTRACT:
+ * @type: A #GType value
+ *
+ * Checks if @type is an abstract value type. An abstract value type introduces
+ * a value table, but can't be used for g_value_init() and is normally used as
+ * an abstract base type for derived value types.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_VALUE_ABSTRACT(type) (g_type_test_flags ((type), G_TYPE_FLAG_VALUE_ABSTRACT))
+/**
+ * G_TYPE_IS_VALUE_TYPE:
+ * @type: A #GType value
+ *
+ * Checks if @type is a value type and can be used with g_value_init().
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_IS_VALUE_TYPE(type) (g_type_check_is_value_type (type))
+/**
+ * G_TYPE_HAS_VALUE_TABLE:
+ * @type: A #GType value
+ *
+ * Checks if @type has a #GTypeValueTable.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_HAS_VALUE_TABLE(type) (g_type_value_table_peek (type) != NULL)
+
+
+/* Typedefs
+ */
+/**
+ * GType:
+ *
+ * A numerical value which represents the unique identifier of a registered
+ * type.
+ */
+#if GLIB_SIZEOF_SIZE_T != GLIB_SIZEOF_LONG || !defined __cplusplus
+typedef gsize GType;
+#else /* for historic reasons, C++ links against gulong GTypes */
+typedef gulong GType;
+#endif
+typedef struct _GValue GValue;
+typedef union _GTypeCValue GTypeCValue;
+typedef struct _GTypePlugin GTypePlugin;
+typedef struct _GTypeClass GTypeClass;
+typedef struct _GTypeInterface GTypeInterface;
+typedef struct _GTypeInstance GTypeInstance;
+typedef struct _GTypeInfo GTypeInfo;
+typedef struct _GTypeFundamentalInfo GTypeFundamentalInfo;
+typedef struct _GInterfaceInfo GInterfaceInfo;
+typedef struct _GTypeValueTable GTypeValueTable;
+typedef struct _GTypeQuery GTypeQuery;
+
+
+/* Basic Type Structures
+ */
+/**
+ * GTypeClass:
+ *
+ * An opaque structure used as the base of all classes.
+ */
+struct _GTypeClass
+{
+ /*< private >*/
+ GType g_type;
+};
+/**
+ * GTypeInstance:
+ *
+ * An opaque structure used as the base of all type instances.
+ */
+struct _GTypeInstance
+{
+ /*< private >*/
+ GTypeClass *g_class;
+};
+/**
+ * GTypeInterface:
+ *
+ * An opaque structure used as the base of all interface types.
+ */
+struct _GTypeInterface
+{
+ /*< private >*/
+ GType g_type; /* iface type */
+ GType g_instance_type;
+};
+/**
+ * GTypeQuery:
+ * @type: the #GType value of the type
+ * @type_name: the name of the type
+ * @class_size: the size of the class structure
+ * @instance_size: the size of the instance structure
+ *
+ * A structure holding information for a specific type.
+ * It is filled in by the g_type_query() function.
+ */
+struct _GTypeQuery
+{
+ GType type;
+ const gchar *type_name;
+ guint class_size;
+ guint instance_size;
+};
+
+
+/* Casts, checks and accessors for structured types
+ * usage of these macros is reserved to type implementations only
+ */
+/*< protected >*/
+/**
+ * G_TYPE_CHECK_INSTANCE:
+ * @instance: Location of a #GTypeInstance structure
+ *
+ * Checks if @instance is a valid #GTypeInstance structure,
+ * otherwise issues a warning and returns %FALSE. %NULL is not a valid
+ * #GTypeInstance.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_CHECK_INSTANCE(instance) (_G_TYPE_CHI ((GTypeInstance*) (instance)))
+/**
+ * G_TYPE_CHECK_INSTANCE_CAST:
+ * @instance: (nullable): Location of a #GTypeInstance structure
+ * @g_type: The type to be returned
+ * @c_type: The corresponding C type of @g_type
+ *
+ * Checks that @instance is an instance of the type identified by @g_type
+ * and issues a warning if this is not the case. Returns @instance casted
+ * to a pointer to @c_type.
+ *
+ * No warning will be issued if @instance is %NULL, and %NULL will be returned.
+ *
+ * This macro should only be used in type implementations.
+ */
+#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type))
+/**
+ * G_TYPE_CHECK_INSTANCE_TYPE:
+ * @instance: (nullable): Location of a #GTypeInstance structure.
+ * @g_type: The type to be checked
+ *
+ * Checks if @instance is an instance of the type identified by @g_type. If
+ * @instance is %NULL, %FALSE will be returned.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type) (_G_TYPE_CIT ((instance), (g_type)))
+/**
+ * G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE:
+ * @instance: (nullable): Location of a #GTypeInstance structure.
+ * @g_type: The fundamental type to be checked
+ *
+ * Checks if @instance is an instance of the fundamental type identified by @g_type.
+ * If @instance is %NULL, %FALSE will be returned.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE(instance, g_type) (_G_TYPE_CIFT ((instance), (g_type)))
+/**
+ * G_TYPE_INSTANCE_GET_CLASS:
+ * @instance: Location of the #GTypeInstance structure
+ * @g_type: The #GType of the class to be returned
+ * @c_type: The C type of the class structure
+ *
+ * Get the class structure of a given @instance, casted
+ * to a specified ancestor type @g_type of the instance.
+ *
+ * Note that while calling a GInstanceInitFunc(), the class pointer
+ * gets modified, so it might not always return the expected pointer.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: a pointer to the class structure
+ */
+#define G_TYPE_INSTANCE_GET_CLASS(instance, g_type, c_type) (_G_TYPE_IGC ((instance), (g_type), c_type))
+/**
+ * G_TYPE_INSTANCE_GET_INTERFACE:
+ * @instance: Location of the #GTypeInstance structure
+ * @g_type: The #GType of the interface to be returned
+ * @c_type: The C type of the interface structure
+ *
+ * Get the interface structure for interface @g_type of a given @instance.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: a pointer to the interface structure
+ */
+#define G_TYPE_INSTANCE_GET_INTERFACE(instance, g_type, c_type) (_G_TYPE_IGI ((instance), (g_type), c_type))
+/**
+ * G_TYPE_CHECK_CLASS_CAST:
+ * @g_class: Location of a #GTypeClass structure
+ * @g_type: The type to be returned
+ * @c_type: The corresponding C type of class structure of @g_type
+ *
+ * Checks that @g_class is a class structure of the type identified by @g_type
+ * and issues a warning if this is not the case. Returns @g_class casted
+ * to a pointer to @c_type. %NULL is not a valid class structure.
+ *
+ * This macro should only be used in type implementations.
+ */
+#define G_TYPE_CHECK_CLASS_CAST(g_class, g_type, c_type) (_G_TYPE_CCC ((g_class), (g_type), c_type))
+/**
+ * G_TYPE_CHECK_CLASS_TYPE:
+ * @g_class: (nullable): Location of a #GTypeClass structure
+ * @g_type: The type to be checked
+ *
+ * Checks if @g_class is a class structure of the type identified by
+ * @g_type. If @g_class is %NULL, %FALSE will be returned.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_CHECK_CLASS_TYPE(g_class, g_type) (_G_TYPE_CCT ((g_class), (g_type)))
+/**
+ * G_TYPE_CHECK_VALUE:
+ * @value: a #GValue
+ *
+ * Checks if @value has been initialized to hold values
+ * of a value type.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_CHECK_VALUE(value) (_G_TYPE_CHV ((value)))
+/**
+ * G_TYPE_CHECK_VALUE_TYPE:
+ * @value: a #GValue
+ * @g_type: The type to be checked
+ *
+ * Checks if @value has been initialized to hold values
+ * of type @g_type.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: %TRUE on success
+ */
+#define G_TYPE_CHECK_VALUE_TYPE(value, g_type) (_G_TYPE_CVH ((value), (g_type)))
+/**
+ * G_TYPE_FROM_INSTANCE:
+ * @instance: Location of a valid #GTypeInstance structure
+ *
+ * Get the type identifier from a given @instance structure.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: the #GType
+ */
+#define G_TYPE_FROM_INSTANCE(instance) (G_TYPE_FROM_CLASS (((GTypeInstance*) (instance))->g_class))
+/**
+ * G_TYPE_FROM_CLASS:
+ * @g_class: Location of a valid #GTypeClass structure
+ *
+ * Get the type identifier from a given @class structure.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: the #GType
+ */
+#define G_TYPE_FROM_CLASS(g_class) (((GTypeClass*) (g_class))->g_type)
+/**
+ * G_TYPE_FROM_INTERFACE:
+ * @g_iface: Location of a valid #GTypeInterface structure
+ *
+ * Get the type identifier from a given @interface structure.
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Returns: the #GType
+ */
+#define G_TYPE_FROM_INTERFACE(g_iface) (((GTypeInterface*) (g_iface))->g_type)
+
+/**
+ * G_TYPE_INSTANCE_GET_PRIVATE:
+ * @instance: the instance of a type deriving from @private_type
+ * @g_type: the type identifying which private data to retrieve
+ * @c_type: The C type for the private structure
+ *
+ * Gets the private structure for a particular type.
+ * The private structure must have been registered in the
+ * class_init function with g_type_class_add_private().
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Since: 2.4
+ * Deprecated: 2.58: Use %G_ADD_PRIVATE and the generated
+ * `your_type_get_instance_private()` function instead
+ * Returns: (not nullable): a pointer to the private data structure
+ */
+#define G_TYPE_INSTANCE_GET_PRIVATE(instance, g_type, c_type) ((c_type*) g_type_instance_get_private ((GTypeInstance*) (instance), (g_type))) GLIB_DEPRECATED_MACRO_IN_2_58_FOR(G_ADD_PRIVATE)
+
+/**
+ * G_TYPE_CLASS_GET_PRIVATE:
+ * @klass: the class of a type deriving from @private_type
+ * @g_type: the type identifying which private data to retrieve
+ * @c_type: The C type for the private structure
+ *
+ * Gets the private class structure for a particular type.
+ * The private structure must have been registered in the
+ * get_type() function with g_type_add_class_private().
+ *
+ * This macro should only be used in type implementations.
+ *
+ * Since: 2.24
+ * Returns: (not nullable): a pointer to the private data structure
+ */
+#define G_TYPE_CLASS_GET_PRIVATE(klass, g_type, c_type) ((c_type*) g_type_class_get_private ((GTypeClass*) (klass), (g_type)))
+
+/**
+ * GTypeDebugFlags:
+ * @G_TYPE_DEBUG_NONE: Print no messages
+ * @G_TYPE_DEBUG_OBJECTS: Print messages about object bookkeeping
+ * @G_TYPE_DEBUG_SIGNALS: Print messages about signal emissions
+ * @G_TYPE_DEBUG_MASK: Mask covering all debug flags
+ * @G_TYPE_DEBUG_INSTANCE_COUNT: Keep a count of instances of each type
+ *
+ * These flags used to be passed to g_type_init_with_debug_flags() which
+ * is now deprecated.
+ *
+ * If you need to enable debugging features, use the GOBJECT_DEBUG
+ * environment variable.
+ *
+ * Deprecated: 2.36: g_type_init() is now done automatically
+ */
+typedef enum /*< skip >*/
+{
+ G_TYPE_DEBUG_NONE = 0,
+ G_TYPE_DEBUG_OBJECTS = 1 << 0,
+ G_TYPE_DEBUG_SIGNALS = 1 << 1,
+ G_TYPE_DEBUG_INSTANCE_COUNT = 1 << 2,
+ G_TYPE_DEBUG_MASK = 0x07
+} GTypeDebugFlags GLIB_DEPRECATED_TYPE_IN_2_36;
+
+
+/* --- prototypes --- */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_36
+void g_type_init (void);
+GLIB_DEPRECATED_IN_2_36
+void g_type_init_with_debug_flags (GTypeDebugFlags debug_flags);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_type_name (GType type);
+GLIB_AVAILABLE_IN_ALL
+GQuark g_type_qname (GType type);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_from_name (const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_parent (GType type);
+GLIB_AVAILABLE_IN_ALL
+guint g_type_depth (GType type);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_next_base (GType leaf_type,
+ GType root_type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_is_a (GType type,
+ GType is_a_type);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_class_ref (GType type);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_class_peek (GType type);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_class_peek_static (GType type);
+GLIB_AVAILABLE_IN_ALL
+void g_type_class_unref (gpointer g_class);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_class_peek_parent (gpointer g_class);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_interface_peek (gpointer instance_class,
+ GType iface_type);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_interface_peek_parent (gpointer g_iface);
+
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_default_interface_ref (GType g_type);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_default_interface_peek (GType g_type);
+GLIB_AVAILABLE_IN_ALL
+void g_type_default_interface_unref (gpointer g_iface);
+
+/* g_free() the returned arrays */
+GLIB_AVAILABLE_IN_ALL
+GType* g_type_children (GType type,
+ guint *n_children);
+GLIB_AVAILABLE_IN_ALL
+GType* g_type_interfaces (GType type,
+ guint *n_interfaces);
+
+/* per-type _static_ data */
+GLIB_AVAILABLE_IN_ALL
+void g_type_set_qdata (GType type,
+ GQuark quark,
+ gpointer data);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_get_qdata (GType type,
+ GQuark quark);
+GLIB_AVAILABLE_IN_ALL
+void g_type_query (GType type,
+ GTypeQuery *query);
+
+GLIB_AVAILABLE_IN_2_44
+int g_type_get_instance_count (GType type);
+
+/* --- type registration --- */
+/**
+ * GBaseInitFunc:
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to initialize
+ *
+ * A callback function used by the type system to do base initialization
+ * of the class structures of derived types. It is called as part of the
+ * initialization process of all derived classes and should reallocate
+ * or reset all dynamic class members copied over from the parent class.
+ * For example, class members (such as strings) that are not sufficiently
+ * handled by a plain memory copy of the parent class into the derived class
+ * have to be altered. See GClassInitFunc() for a discussion of the class
+ * initialization process.
+ */
+typedef void (*GBaseInitFunc) (gpointer g_class);
+/**
+ * GBaseFinalizeFunc:
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to finalize
+ *
+ * A callback function used by the type system to finalize those portions
+ * of a derived types class structure that were setup from the corresponding
+ * GBaseInitFunc() function. Class finalization basically works the inverse
+ * way in which class initialization is performed.
+ * See GClassInitFunc() for a discussion of the class initialization process.
+ */
+typedef void (*GBaseFinalizeFunc) (gpointer g_class);
+/**
+ * GClassInitFunc:
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to initialize.
+ * @class_data: The @class_data member supplied via the #GTypeInfo structure.
+ *
+ * A callback function used by the type system to initialize the class
+ * of a specific type. This function should initialize all static class
+ * members.
+ *
+ * The initialization process of a class involves:
+ *
+ * - Copying common members from the parent class over to the
+ * derived class structure.
+ * - Zero initialization of the remaining members not copied
+ * over from the parent class.
+ * - Invocation of the GBaseInitFunc() initializers of all parent
+ * types and the class' type.
+ * - Invocation of the class' GClassInitFunc() initializer.
+ *
+ * Since derived classes are partially initialized through a memory copy
+ * of the parent class, the general rule is that GBaseInitFunc() and
+ * GBaseFinalizeFunc() should take care of necessary reinitialization
+ * and release of those class members that were introduced by the type
+ * that specified these GBaseInitFunc()/GBaseFinalizeFunc().
+ * GClassInitFunc() should only care about initializing static
+ * class members, while dynamic class members (such as allocated strings
+ * or reference counted resources) are better handled by a GBaseInitFunc()
+ * for this type, so proper initialization of the dynamic class members
+ * is performed for class initialization of derived types as well.
+ *
+ * An example may help to correspond the intend of the different class
+ * initializers:
+ *
+ * |[<!-- language="C" -->
+ * typedef struct {
+ * GObjectClass parent_class;
+ * gint static_integer;
+ * gchar *dynamic_string;
+ * } TypeAClass;
+ * static void
+ * type_a_base_class_init (TypeAClass *class)
+ * {
+ * class->dynamic_string = g_strdup ("some string");
+ * }
+ * static void
+ * type_a_base_class_finalize (TypeAClass *class)
+ * {
+ * g_free (class->dynamic_string);
+ * }
+ * static void
+ * type_a_class_init (TypeAClass *class)
+ * {
+ * class->static_integer = 42;
+ * }
+ *
+ * typedef struct {
+ * TypeAClass parent_class;
+ * gfloat static_float;
+ * GString *dynamic_gstring;
+ * } TypeBClass;
+ * static void
+ * type_b_base_class_init (TypeBClass *class)
+ * {
+ * class->dynamic_gstring = g_string_new ("some other string");
+ * }
+ * static void
+ * type_b_base_class_finalize (TypeBClass *class)
+ * {
+ * g_string_free (class->dynamic_gstring);
+ * }
+ * static void
+ * type_b_class_init (TypeBClass *class)
+ * {
+ * class->static_float = 3.14159265358979323846;
+ * }
+ * ]|
+ * Initialization of TypeBClass will first cause initialization of
+ * TypeAClass (derived classes reference their parent classes, see
+ * g_type_class_ref() on this).
+ *
+ * Initialization of TypeAClass roughly involves zero-initializing its fields,
+ * then calling its GBaseInitFunc() type_a_base_class_init() to allocate
+ * its dynamic members (dynamic_string), and finally calling its GClassInitFunc()
+ * type_a_class_init() to initialize its static members (static_integer).
+ * The first step in the initialization process of TypeBClass is then
+ * a plain memory copy of the contents of TypeAClass into TypeBClass and
+ * zero-initialization of the remaining fields in TypeBClass.
+ * The dynamic members of TypeAClass within TypeBClass now need
+ * reinitialization which is performed by calling type_a_base_class_init()
+ * with an argument of TypeBClass.
+ *
+ * After that, the GBaseInitFunc() of TypeBClass, type_b_base_class_init()
+ * is called to allocate the dynamic members of TypeBClass (dynamic_gstring),
+ * and finally the GClassInitFunc() of TypeBClass, type_b_class_init(),
+ * is called to complete the initialization process with the static members
+ * (static_float).
+ *
+ * Corresponding finalization counter parts to the GBaseInitFunc() functions
+ * have to be provided to release allocated resources at class finalization
+ * time.
+ */
+typedef void (*GClassInitFunc) (gpointer g_class,
+ gpointer class_data);
+/**
+ * GClassFinalizeFunc:
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure to finalize
+ * @class_data: The @class_data member supplied via the #GTypeInfo structure
+ *
+ * A callback function used by the type system to finalize a class.
+ * This function is rarely needed, as dynamically allocated class resources
+ * should be handled by GBaseInitFunc() and GBaseFinalizeFunc().
+ * Also, specification of a GClassFinalizeFunc() in the #GTypeInfo
+ * structure of a static type is invalid, because classes of static types
+ * will never be finalized (they are artificially kept alive when their
+ * reference count drops to zero).
+ */
+typedef void (*GClassFinalizeFunc) (gpointer g_class,
+ gpointer class_data);
+/**
+ * GInstanceInitFunc:
+ * @instance: The instance to initialize
+ * @g_class: (type GObject.TypeClass): The class of the type the instance is
+ * created for
+ *
+ * A callback function used by the type system to initialize a new
+ * instance of a type. This function initializes all instance members and
+ * allocates any resources required by it.
+ *
+ * Initialization of a derived instance involves calling all its parent
+ * types instance initializers, so the class member of the instance
+ * is altered during its initialization to always point to the class that
+ * belongs to the type the current initializer was introduced for.
+ *
+ * The extended members of @instance are guaranteed to have been filled with
+ * zeros before this function is called.
+ */
+typedef void (*GInstanceInitFunc) (GTypeInstance *instance,
+ gpointer g_class);
+/**
+ * GInterfaceInitFunc:
+ * @g_iface: (type GObject.TypeInterface): The interface structure to initialize
+ * @iface_data: The @interface_data supplied via the #GInterfaceInfo structure
+ *
+ * A callback function used by the type system to initialize a new
+ * interface. This function should initialize all internal data and
+ * allocate any resources required by the interface.
+ *
+ * The members of @iface_data are guaranteed to have been filled with
+ * zeros before this function is called.
+ */
+typedef void (*GInterfaceInitFunc) (gpointer g_iface,
+ gpointer iface_data);
+/**
+ * GInterfaceFinalizeFunc:
+ * @g_iface: (type GObject.TypeInterface): The interface structure to finalize
+ * @iface_data: The @interface_data supplied via the #GInterfaceInfo structure
+ *
+ * A callback function used by the type system to finalize an interface.
+ * This function should destroy any internal data and release any resources
+ * allocated by the corresponding GInterfaceInitFunc() function.
+ */
+typedef void (*GInterfaceFinalizeFunc) (gpointer g_iface,
+ gpointer iface_data);
+/**
+ * GTypeClassCacheFunc:
+ * @cache_data: data that was given to the g_type_add_class_cache_func() call
+ * @g_class: (type GObject.TypeClass): The #GTypeClass structure which is
+ * unreferenced
+ *
+ * A callback function which is called when the reference count of a class
+ * drops to zero. It may use g_type_class_ref() to prevent the class from
+ * being freed. You should not call g_type_class_unref() from a
+ * #GTypeClassCacheFunc function to prevent infinite recursion, use
+ * g_type_class_unref_uncached() instead.
+ *
+ * The functions have to check the class id passed in to figure
+ * whether they actually want to cache the class of this type, since all
+ * classes are routed through the same #GTypeClassCacheFunc chain.
+ *
+ * Returns: %TRUE to stop further #GTypeClassCacheFuncs from being
+ * called, %FALSE to continue
+ */
+typedef gboolean (*GTypeClassCacheFunc) (gpointer cache_data,
+ GTypeClass *g_class);
+/**
+ * GTypeInterfaceCheckFunc:
+ * @check_data: data passed to g_type_add_interface_check()
+ * @g_iface: (type GObject.TypeInterface): the interface that has been
+ * initialized
+ *
+ * A callback called after an interface vtable is initialized.
+ * See g_type_add_interface_check().
+ *
+ * Since: 2.4
+ */
+typedef void (*GTypeInterfaceCheckFunc) (gpointer check_data,
+ gpointer g_iface);
+/**
+ * GTypeFundamentalFlags:
+ * @G_TYPE_FLAG_CLASSED: Indicates a classed type
+ * @G_TYPE_FLAG_INSTANTIATABLE: Indicates an instantiable type (implies classed)
+ * @G_TYPE_FLAG_DERIVABLE: Indicates a flat derivable type
+ * @G_TYPE_FLAG_DEEP_DERIVABLE: Indicates a deep derivable type (implies derivable)
+ *
+ * Bit masks used to check or determine specific characteristics of a
+ * fundamental type.
+ */
+typedef enum /*< skip >*/
+{
+ G_TYPE_FLAG_CLASSED = (1 << 0),
+ G_TYPE_FLAG_INSTANTIATABLE = (1 << 1),
+ G_TYPE_FLAG_DERIVABLE = (1 << 2),
+ G_TYPE_FLAG_DEEP_DERIVABLE = (1 << 3)
+} GTypeFundamentalFlags;
+/**
+ * GTypeFlags:
+ * @G_TYPE_FLAG_ABSTRACT: Indicates an abstract type. No instances can be
+ * created for an abstract type
+ * @G_TYPE_FLAG_VALUE_ABSTRACT: Indicates an abstract value type, i.e. a type
+ * that introduces a value table, but can't be used for
+ * g_value_init()
+ *
+ * Bit masks used to check or determine characteristics of a type.
+ */
+typedef enum /*< skip >*/
+{
+ G_TYPE_FLAG_ABSTRACT = (1 << 4),
+ G_TYPE_FLAG_VALUE_ABSTRACT = (1 << 5)
+} GTypeFlags;
+/**
+ * GTypeInfo:
+ * @class_size: Size of the class structure (required for interface, classed and instantiatable types)
+ * @base_init: Location of the base initialization function (optional)
+ * @base_finalize: Location of the base finalization function (optional)
+ * @class_init: Location of the class initialization function for
+ * classed and instantiatable types. Location of the default vtable
+ * inititalization function for interface types. (optional) This function
+ * is used both to fill in virtual functions in the class or default vtable,
+ * and to do type-specific setup such as registering signals and object
+ * properties.
+ * @class_finalize: Location of the class finalization function for
+ * classed and instantiatable types. Location of the default vtable
+ * finalization function for interface types. (optional)
+ * @class_data: User-supplied data passed to the class init/finalize functions
+ * @instance_size: Size of the instance (object) structure (required for instantiatable types only)
+ * @n_preallocs: Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10, it is ignored, since instances are allocated with the [slice allocator][glib-Memory-Slices] now.
+ * @instance_init: Location of the instance initialization function (optional, for instantiatable types only)
+ * @value_table: A #GTypeValueTable function table for generic handling of GValues
+ * of this type (usually only useful for fundamental types)
+ *
+ * This structure is used to provide the type system with the information
+ * required to initialize and destruct (finalize) a type's class and
+ * its instances.
+ *
+ * The initialized structure is passed to the g_type_register_static() function
+ * (or is copied into the provided #GTypeInfo structure in the
+ * g_type_plugin_complete_type_info()). The type system will perform a deep
+ * copy of this structure, so its memory does not need to be persistent
+ * across invocation of g_type_register_static().
+ */
+struct _GTypeInfo
+{
+ /* interface types, classed types, instantiated types */
+ guint16 class_size;
+
+ GBaseInitFunc base_init;
+ GBaseFinalizeFunc base_finalize;
+
+ /* interface types, classed types, instantiated types */
+ GClassInitFunc class_init;
+ GClassFinalizeFunc class_finalize;
+ gconstpointer class_data;
+
+ /* instantiated types */
+ guint16 instance_size;
+ guint16 n_preallocs;
+ GInstanceInitFunc instance_init;
+
+ /* value handling */
+ const GTypeValueTable *value_table;
+};
+/**
+ * GTypeFundamentalInfo:
+ * @type_flags: #GTypeFundamentalFlags describing the characteristics of the fundamental type
+ *
+ * A structure that provides information to the type system which is
+ * used specifically for managing fundamental types.
+ */
+struct _GTypeFundamentalInfo
+{
+ GTypeFundamentalFlags type_flags;
+};
+/**
+ * GInterfaceInfo:
+ * @interface_init: location of the interface initialization function
+ * @interface_finalize: location of the interface finalization function
+ * @interface_data: user-supplied data passed to the interface init/finalize functions
+ *
+ * A structure that provides information to the type system which is
+ * used specifically for managing interface types.
+ */
+struct _GInterfaceInfo
+{
+ GInterfaceInitFunc interface_init;
+ GInterfaceFinalizeFunc interface_finalize;
+ gpointer interface_data;
+};
+/**
+ * GTypeValueTable:
+ * @value_init: Default initialize @values contents by poking values
+ * directly into the value->data array. The data array of
+ * the #GValue passed into this function was zero-filled
+ * with `memset()`, so no care has to be taken to free any
+ * old contents. E.g. for the implementation of a string
+ * value that may never be %NULL, the implementation might
+ * look like:
+ * |[<!-- language="C" -->
+ * value->data[0].v_pointer = g_strdup ("");
+ * ]|
+ * @value_free: Free any old contents that might be left in the
+ * data array of the passed in @value. No resources may
+ * remain allocated through the #GValue contents after
+ * this function returns. E.g. for our above string type:
+ * |[<!-- language="C" -->
+ * // only free strings without a specific flag for static storage
+ * if (!(value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS))
+ * g_free (value->data[0].v_pointer);
+ * ]|
+ * @value_copy: @dest_value is a #GValue with zero-filled data section
+ * and @src_value is a properly setup #GValue of same or
+ * derived type.
+ * The purpose of this function is to copy the contents of
+ * @src_value into @dest_value in a way, that even after
+ * @src_value has been freed, the contents of @dest_value
+ * remain valid. String type example:
+ * |[<!-- language="C" -->
+ * dest_value->data[0].v_pointer = g_strdup (src_value->data[0].v_pointer);
+ * ]|
+ * @value_peek_pointer: If the value contents fit into a pointer, such as objects
+ * or strings, return this pointer, so the caller can peek at
+ * the current contents. To extend on our above string example:
+ * |[<!-- language="C" -->
+ * return value->data[0].v_pointer;
+ * ]|
+ * @collect_format: A string format describing how to collect the contents of
+ * this value bit-by-bit. Each character in the format represents
+ * an argument to be collected, and the characters themselves indicate
+ * the type of the argument. Currently supported arguments are:
+ * - 'i' - Integers. passed as collect_values[].v_int.
+ * - 'l' - Longs. passed as collect_values[].v_long.
+ * - 'd' - Doubles. passed as collect_values[].v_double.
+ * - 'p' - Pointers. passed as collect_values[].v_pointer.
+ * It should be noted that for variable argument list construction,
+ * ANSI C promotes every type smaller than an integer to an int, and
+ * floats to doubles. So for collection of short int or char, 'i'
+ * needs to be used, and for collection of floats 'd'.
+ * @collect_value: The collect_value() function is responsible for converting the
+ * values collected from a variable argument list into contents
+ * suitable for storage in a GValue. This function should setup
+ * @value similar to value_init(); e.g. for a string value that
+ * does not allow %NULL pointers, it needs to either spew an error,
+ * or do an implicit conversion by storing an empty string.
+ * The @value passed in to this function has a zero-filled data
+ * array, so just like for value_init() it is guaranteed to not
+ * contain any old contents that might need freeing.
+ * @n_collect_values is exactly the string length of @collect_format,
+ * and @collect_values is an array of unions #GTypeCValue with
+ * length @n_collect_values, containing the collected values
+ * according to @collect_format.
+ * @collect_flags is an argument provided as a hint by the caller.
+ * It may contain the flag %G_VALUE_NOCOPY_CONTENTS indicating,
+ * that the collected value contents may be considered "static"
+ * for the duration of the @value lifetime.
+ * Thus an extra copy of the contents stored in @collect_values is
+ * not required for assignment to @value.
+ * For our above string example, we continue with:
+ * |[<!-- language="C" -->
+ * if (!collect_values[0].v_pointer)
+ * value->data[0].v_pointer = g_strdup ("");
+ * else if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
+ * {
+ * value->data[0].v_pointer = collect_values[0].v_pointer;
+ * // keep a flag for the value_free() implementation to not free this string
+ * value->data[1].v_uint = G_VALUE_NOCOPY_CONTENTS;
+ * }
+ * else
+ * value->data[0].v_pointer = g_strdup (collect_values[0].v_pointer);
+ * return NULL;
+ * ]|
+ * It should be noted, that it is generally a bad idea to follow the
+ * #G_VALUE_NOCOPY_CONTENTS hint for reference counted types. Due to
+ * reentrancy requirements and reference count assertions performed
+ * by the signal emission code, reference counts should always be
+ * incremented for reference counted contents stored in the value->data
+ * array. To deviate from our string example for a moment, and taking
+ * a look at an exemplary implementation for collect_value() of
+ * #GObject:
+ * |[<!-- language="C" -->
+ * if (collect_values[0].v_pointer)
+ * {
+ * GObject *object = G_OBJECT (collect_values[0].v_pointer);
+ * // never honour G_VALUE_NOCOPY_CONTENTS for ref-counted types
+ * value->data[0].v_pointer = g_object_ref (object);
+ * return NULL;
+ * }
+ * else
+ * return g_strdup_printf ("Object passed as invalid NULL pointer");
+ * }
+ * ]|
+ * The reference count for valid objects is always incremented,
+ * regardless of @collect_flags. For invalid objects, the example
+ * returns a newly allocated string without altering @value.
+ * Upon success, collect_value() needs to return %NULL. If, however,
+ * an error condition occurred, collect_value() may spew an
+ * error by returning a newly allocated non-%NULL string, giving
+ * a suitable description of the error condition.
+ * The calling code makes no assumptions about the @value
+ * contents being valid upon error returns, @value
+ * is simply thrown away without further freeing. As such, it is
+ * a good idea to not allocate #GValue contents, prior to returning
+ * an error, however, collect_values() is not obliged to return
+ * a correctly setup @value for error returns, simply because
+ * any non-%NULL return is considered a fatal condition so further
+ * program behaviour is undefined.
+ * @lcopy_format: Format description of the arguments to collect for @lcopy_value,
+ * analogous to @collect_format. Usually, @lcopy_format string consists
+ * only of 'p's to provide lcopy_value() with pointers to storage locations.
+ * @lcopy_value: This function is responsible for storing the @value contents into
+ * arguments passed through a variable argument list which got
+ * collected into @collect_values according to @lcopy_format.
+ * @n_collect_values equals the string length of @lcopy_format,
+ * and @collect_flags may contain %G_VALUE_NOCOPY_CONTENTS.
+ * In contrast to collect_value(), lcopy_value() is obliged to
+ * always properly support %G_VALUE_NOCOPY_CONTENTS.
+ * Similar to collect_value() the function may prematurely abort
+ * by returning a newly allocated string describing an error condition.
+ * To complete the string example:
+ * |[<!-- language="C" -->
+ * gchar **string_p = collect_values[0].v_pointer;
+ * if (!string_p)
+ * return g_strdup_printf ("string location passed as NULL");
+ * if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
+ * *string_p = value->data[0].v_pointer;
+ * else
+ * *string_p = g_strdup (value->data[0].v_pointer);
+ * ]|
+ * And an illustrative version of lcopy_value() for
+ * reference-counted types:
+ * |[<!-- language="C" -->
+ * GObject **object_p = collect_values[0].v_pointer;
+ * if (!object_p)
+ * return g_strdup_printf ("object location passed as NULL");
+ * if (!value->data[0].v_pointer)
+ * *object_p = NULL;
+ * else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) // always honour
+ * *object_p = value->data[0].v_pointer;
+ * else
+ * *object_p = g_object_ref (value->data[0].v_pointer);
+ * return NULL;
+ * ]|
+ *
+ * The #GTypeValueTable provides the functions required by the #GValue
+ * implementation, to serve as a container for values of a type.
+ */
+
+struct _GTypeValueTable
+{
+ void (*value_init) (GValue *value);
+ void (*value_free) (GValue *value);
+ void (*value_copy) (const GValue *src_value,
+ GValue *dest_value);
+ /* varargs functionality (optional) */
+ gpointer (*value_peek_pointer) (const GValue *value);
+ const gchar *collect_format;
+ gchar* (*collect_value) (GValue *value,
+ guint n_collect_values,
+ GTypeCValue *collect_values,
+ guint collect_flags);
+ const gchar *lcopy_format;
+ gchar* (*lcopy_value) (const GValue *value,
+ guint n_collect_values,
+ GTypeCValue *collect_values,
+ guint collect_flags);
+};
+GLIB_AVAILABLE_IN_ALL
+GType g_type_register_static (GType parent_type,
+ const gchar *type_name,
+ const GTypeInfo *info,
+ GTypeFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_register_static_simple (GType parent_type,
+ const gchar *type_name,
+ guint class_size,
+ GClassInitFunc class_init,
+ guint instance_size,
+ GInstanceInitFunc instance_init,
+ GTypeFlags flags);
+
+GLIB_AVAILABLE_IN_ALL
+GType g_type_register_dynamic (GType parent_type,
+ const gchar *type_name,
+ GTypePlugin *plugin,
+ GTypeFlags flags);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_register_fundamental (GType type_id,
+ const gchar *type_name,
+ const GTypeInfo *info,
+ const GTypeFundamentalInfo *finfo,
+ GTypeFlags flags);
+GLIB_AVAILABLE_IN_ALL
+void g_type_add_interface_static (GType instance_type,
+ GType interface_type,
+ const GInterfaceInfo *info);
+GLIB_AVAILABLE_IN_ALL
+void g_type_add_interface_dynamic (GType instance_type,
+ GType interface_type,
+ GTypePlugin *plugin);
+GLIB_AVAILABLE_IN_ALL
+void g_type_interface_add_prerequisite (GType interface_type,
+ GType prerequisite_type);
+GLIB_AVAILABLE_IN_ALL
+GType*g_type_interface_prerequisites (GType interface_type,
+ guint *n_prerequisites);
+GLIB_DEPRECATED_IN_2_58
+void g_type_class_add_private (gpointer g_class,
+ gsize private_size);
+GLIB_AVAILABLE_IN_2_38
+gint g_type_add_instance_private (GType class_type,
+ gsize private_size);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_instance_get_private (GTypeInstance *instance,
+ GType private_type);
+GLIB_AVAILABLE_IN_2_38
+void g_type_class_adjust_private_offset (gpointer g_class,
+ gint *private_size_or_offset);
+
+GLIB_AVAILABLE_IN_ALL
+void g_type_add_class_private (GType class_type,
+ gsize private_size);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_type_class_get_private (GTypeClass *klass,
+ GType private_type);
+GLIB_AVAILABLE_IN_2_38
+gint g_type_class_get_instance_private_offset (gpointer g_class);
+
+GLIB_AVAILABLE_IN_2_34
+void g_type_ensure (GType type);
+GLIB_AVAILABLE_IN_2_36
+guint g_type_get_type_registration_serial (void);
+
+
+/* --- GType boilerplate --- */
+/**
+ * G_DECLARE_FINAL_TYPE:
+ * @ModuleObjName: The name of the new type, in camel case (like GtkWidget)
+ * @module_obj_name: The name of the new type in lowercase, with words
+ * separated by '_' (like 'gtk_widget')
+ * @MODULE: The name of the module, in all caps (like 'GTK')
+ * @OBJ_NAME: The bare name of the type, in all caps (like 'WIDGET')
+ * @ParentName: the name of the parent type, in camel case (like GtkWidget)
+ *
+ * A convenience macro for emitting the usual declarations in the header file for a type which is not (at the
+ * present time) intended to be subclassed.
+ *
+ * You might use it in a header as follows:
+ *
+ * |[
+ * #ifndef _myapp_window_h_
+ * #define _myapp_window_h_
+ *
+ * #include <gtk/gtk.h>
+ *
+ * #define MY_APP_TYPE_WINDOW my_app_window_get_type ()
+ * G_DECLARE_FINAL_TYPE (MyAppWindow, my_app_window, MY_APP, WINDOW, GtkWindow)
+ *
+ * MyAppWindow * my_app_window_new (void);
+ *
+ * ...
+ *
+ * #endif
+ * ]|
+ *
+ * This results in the following things happening:
+ *
+ * - the usual my_app_window_get_type() function is declared with a return type of #GType
+ *
+ * - the MyAppWindow types is defined as a typedef of struct _MyAppWindow. The struct itself is not
+ * defined and should be defined from the .c file before G_DEFINE_TYPE() is used.
+ *
+ * - the MY_APP_WINDOW() cast is emitted as static inline function along with the MY_APP_IS_WINDOW() type
+ * checking function
+ *
+ * - the MyAppWindowClass type is defined as a struct containing GtkWindowClass. This is done for the
+ * convenience of the person defining the type and should not be considered to be part of the ABI. In
+ * particular, without a firm declaration of the instance structure, it is not possible to subclass the type
+ * and therefore the fact that the size of the class structure is exposed is not a concern and it can be
+ * freely changed at any point in the future.
+ *
+ * - g_autoptr() support being added for your type, based on the type of your parent class
+ *
+ * You can only use this function if your parent type also supports g_autoptr().
+ *
+ * Because the type macro (MY_APP_TYPE_WINDOW in the above example) is not a callable, you must continue to
+ * manually define this as a macro for yourself.
+ *
+ * The declaration of the _get_type() function is the first thing emitted by the macro. This allows this macro
+ * to be used in the usual way with export control and API versioning macros.
+ *
+ * If you want to declare your own class structure, use G_DECLARE_DERIVABLE_TYPE().
+ *
+ * If you are writing a library, it is important to note that it is possible to convert a type from using
+ * G_DECLARE_FINAL_TYPE() to G_DECLARE_DERIVABLE_TYPE() without breaking API or ABI. As a precaution, you
+ * should therefore use G_DECLARE_FINAL_TYPE() until you are sure that it makes sense for your class to be
+ * subclassed. Once a class structure has been exposed it is not possible to change its size or remove or
+ * reorder items without breaking the API and/or ABI.
+ *
+ * Since: 2.44
+ **/
+#define G_DECLARE_FINAL_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \
+ GType module_obj_name##_get_type (void); \
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ typedef struct _##ModuleObjName ModuleObjName; \
+ typedef struct { ParentName##Class parent_class; } ModuleObjName##Class; \
+ \
+ _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
+ \
+ static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
+ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
+ static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
+ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
+ G_GNUC_END_IGNORE_DEPRECATIONS
+
+/**
+ * G_DECLARE_DERIVABLE_TYPE:
+ * @ModuleObjName: The name of the new type, in camel case (like GtkWidget)
+ * @module_obj_name: The name of the new type in lowercase, with words
+ * separated by '_' (like 'gtk_widget')
+ * @MODULE: The name of the module, in all caps (like 'GTK')
+ * @OBJ_NAME: The bare name of the type, in all caps (like 'WIDGET')
+ * @ParentName: the name of the parent type, in camel case (like GtkWidget)
+ *
+ * A convenience macro for emitting the usual declarations in the
+ * header file for a type which is intended to be subclassed.
+ *
+ * You might use it in a header as follows:
+ *
+ * |[
+ * #ifndef _gtk_frobber_h_
+ * #define _gtk_frobber_h_
+ *
+ * #define GTK_TYPE_FROBBER gtk_frobber_get_type ()
+ * GDK_AVAILABLE_IN_3_12
+ * G_DECLARE_DERIVABLE_TYPE (GtkFrobber, gtk_frobber, GTK, FROBBER, GtkWidget)
+ *
+ * struct _GtkFrobberClass
+ * {
+ * GtkWidgetClass parent_class;
+ *
+ * void (* handle_frob) (GtkFrobber *frobber,
+ * guint n_frobs);
+ *
+ * gpointer padding[12];
+ * };
+ *
+ * GtkWidget * gtk_frobber_new (void);
+ *
+ * ...
+ *
+ * #endif
+ * ]|
+ *
+ * This results in the following things happening:
+ *
+ * - the usual gtk_frobber_get_type() function is declared with a return type of #GType
+ *
+ * - the GtkFrobber struct is created with GtkWidget as the first and only item. You are expected to use
+ * a private structure from your .c file to store your instance variables.
+ *
+ * - the GtkFrobberClass type is defined as a typedef to struct _GtkFrobberClass, which is left undefined.
+ * You should do this from the header file directly after you use the macro.
+ *
+ * - the GTK_FROBBER() and GTK_FROBBER_CLASS() casts are emitted as static inline functions along with
+ * the GTK_IS_FROBBER() and GTK_IS_FROBBER_CLASS() type checking functions and GTK_FROBBER_GET_CLASS()
+ * function.
+ *
+ * - g_autoptr() support being added for your type, based on the type of your parent class
+ *
+ * You can only use this function if your parent type also supports g_autoptr().
+ *
+ * Because the type macro (GTK_TYPE_FROBBER in the above example) is not a callable, you must continue to
+ * manually define this as a macro for yourself.
+ *
+ * The declaration of the _get_type() function is the first thing emitted by the macro. This allows this macro
+ * to be used in the usual way with export control and API versioning macros.
+ *
+ * If you are writing a library, it is important to note that it is possible to convert a type from using
+ * G_DECLARE_FINAL_TYPE() to G_DECLARE_DERIVABLE_TYPE() without breaking API or ABI. As a precaution, you
+ * should therefore use G_DECLARE_FINAL_TYPE() until you are sure that it makes sense for your class to be
+ * subclassed. Once a class structure has been exposed it is not possible to change its size or remove or
+ * reorder items without breaking the API and/or ABI. If you want to declare your own class structure, use
+ * G_DECLARE_DERIVABLE_TYPE(). If you want to declare a class without exposing the class or instance
+ * structures, use G_DECLARE_FINAL_TYPE().
+ *
+ * If you must use G_DECLARE_DERIVABLE_TYPE() you should be sure to include some padding at the bottom of your
+ * class structure to leave space for the addition of future virtual functions.
+ *
+ * Since: 2.44
+ **/
+#define G_DECLARE_DERIVABLE_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \
+ GType module_obj_name##_get_type (void); \
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ typedef struct _##ModuleObjName ModuleObjName; \
+ typedef struct _##ModuleObjName##Class ModuleObjName##Class; \
+ struct _##ModuleObjName { ParentName parent_instance; }; \
+ \
+ _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName) \
+ \
+ static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
+ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
+ static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_CLASS (gpointer ptr) { \
+ return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
+ static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
+ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
+ static inline gboolean MODULE##_IS_##OBJ_NAME##_CLASS (gpointer ptr) { \
+ return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \
+ static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gpointer ptr) { \
+ return G_TYPE_INSTANCE_GET_CLASS (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \
+ G_GNUC_END_IGNORE_DEPRECATIONS
+
+/**
+ * G_DECLARE_INTERFACE:
+ * @ModuleObjName: The name of the new type, in camel case (like GtkWidget)
+ * @module_obj_name: The name of the new type in lowercase, with words
+ * separated by '_' (like 'gtk_widget')
+ * @MODULE: The name of the module, in all caps (like 'GTK')
+ * @OBJ_NAME: The bare name of the type, in all caps (like 'WIDGET')
+ * @PrerequisiteName: the name of the prerequisite type, in camel case (like GtkWidget)
+ *
+ * A convenience macro for emitting the usual declarations in the header file for a GInterface type.
+ *
+ * You might use it in a header as follows:
+ *
+ * |[
+ * #ifndef _my_model_h_
+ * #define _my_model_h_
+ *
+ * #define MY_TYPE_MODEL my_model_get_type ()
+ * GDK_AVAILABLE_IN_3_12
+ * G_DECLARE_INTERFACE (MyModel, my_model, MY, MODEL, GObject)
+ *
+ * struct _MyModelInterface
+ * {
+ * GTypeInterface g_iface;
+ *
+ * gpointer (* get_item) (MyModel *model);
+ * };
+ *
+ * gpointer my_model_get_item (MyModel *model);
+ *
+ * ...
+ *
+ * #endif
+ * ]|
+ *
+ * This results in the following things happening:
+ *
+ * - the usual my_model_get_type() function is declared with a return type of #GType
+ *
+ * - the MyModelInterface type is defined as a typedef to struct _MyModelInterface,
+ * which is left undefined. You should do this from the header file directly after
+ * you use the macro.
+ *
+ * - the MY_MODEL() cast is emitted as static inline functions along with
+ * the MY_IS_MODEL() type checking function and MY_MODEL_GET_IFACE() function.
+ *
+ * - g_autoptr() support being added for your type, based on your prerequisite type.
+ *
+ * You can only use this function if your prerequisite type also supports g_autoptr().
+ *
+ * Because the type macro (MY_TYPE_MODEL in the above example) is not a callable, you must continue to
+ * manually define this as a macro for yourself.
+ *
+ * The declaration of the _get_type() function is the first thing emitted by the macro. This allows this macro
+ * to be used in the usual way with export control and API versioning macros.
+ *
+ * Since: 2.44
+ **/
+#define G_DECLARE_INTERFACE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, PrerequisiteName) \
+ GType module_obj_name##_get_type (void); \
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ typedef struct _##ModuleObjName ModuleObjName; \
+ typedef struct _##ModuleObjName##Interface ModuleObjName##Interface; \
+ \
+ _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, PrerequisiteName) \
+ \
+ static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
+ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
+ static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
+ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \
+ static inline ModuleObjName##Interface * MODULE##_##OBJ_NAME##_GET_IFACE (gpointer ptr) { \
+ return G_TYPE_INSTANCE_GET_INTERFACE (ptr, module_obj_name##_get_type (), ModuleObjName##Interface); } \
+ G_GNUC_END_IGNORE_DEPRECATIONS
+
+/**
+ * G_DEFINE_TYPE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @T_P: The #GType of the parent type.
+ *
+ * A convenience macro for type implementations, which declares a class
+ * initialization function, an instance initialization function (see #GTypeInfo
+ * for information about these) and a static variable named `t_n_parent_class`
+ * pointing to the parent class. Furthermore, it defines a *_get_type() function.
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
+ *
+ * Since: 2.4
+ */
+#define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
+/**
+ * G_DEFINE_TYPE_WITH_CODE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type in lowercase, with words separated by '_'.
+ * @T_P: The #GType of the parent type.
+ * @_C_: Custom code that gets inserted in the *_get_type() function.
+ *
+ * A convenience macro for type implementations.
+ * Similar to G_DEFINE_TYPE(), but allows you to insert custom code into the
+ * *_get_type() function, e.g. interface implementations via G_IMPLEMENT_INTERFACE().
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
+ *
+ * Since: 2.4
+ */
+#define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+/**
+ * G_DEFINE_TYPE_WITH_PRIVATE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @T_P: The #GType of the parent type.
+ *
+ * A convenience macro for type implementations, which declares a class
+ * initialization function, an instance initialization function (see #GTypeInfo
+ * for information about these), a static variable named `t_n_parent_class`
+ * pointing to the parent class, and adds private instance data to the type.
+ * Furthermore, it defines a *_get_type() function. See G_DEFINE_TYPE_EXTENDED()
+ * for an example.
+ *
+ * Note that private structs added with this macros must have a struct
+ * name of the form @TN Private.
+ *
+ * The private instance data can be retrieved using the automatically generated
+ * getter function `t_n_get_instance_private()`.
+ *
+ * See also: G_ADD_PRIVATE()
+ *
+ * Since: 2.38
+ */
+#define G_DEFINE_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, G_ADD_PRIVATE (TN))
+/**
+ * G_DEFINE_ABSTRACT_TYPE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @T_P: The #GType of the parent type.
+ *
+ * A convenience macro for type implementations.
+ * Similar to G_DEFINE_TYPE(), but defines an abstract type.
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
+ *
+ * Since: 2.4
+ */
+#define G_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, {})
+/**
+ * G_DEFINE_ABSTRACT_TYPE_WITH_CODE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @T_P: The #GType of the parent type.
+ * @_C_: Custom code that gets inserted in the @type_name_get_type() function.
+ *
+ * A convenience macro for type implementations.
+ * Similar to G_DEFINE_TYPE_WITH_CODE(), but defines an abstract type and
+ * allows you to insert custom code into the *_get_type() function, e.g.
+ * interface implementations via G_IMPLEMENT_INTERFACE().
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
+ *
+ * Since: 2.4
+ */
+#define G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+/**
+ * G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @T_P: The #GType of the parent type.
+ *
+ * Similar to G_DEFINE_TYPE_WITH_PRIVATE(), but defines an abstract type.
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
+ *
+ * Since: 2.38
+ */
+#define G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, G_ADD_PRIVATE (TN))
+/**
+ * G_DEFINE_TYPE_EXTENDED:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @T_P: The #GType of the parent type.
+ * @_f_: #GTypeFlags to pass to g_type_register_static()
+ * @_C_: Custom code that gets inserted in the *_get_type() function.
+ *
+ * The most general convenience macro for type implementations, on which
+ * G_DEFINE_TYPE(), etc are based.
+ *
+ * |[<!-- language="C" -->
+ * G_DEFINE_TYPE_EXTENDED (GtkGadget,
+ * gtk_gadget,
+ * GTK_TYPE_WIDGET,
+ * 0,
+ * G_ADD_PRIVATE (GtkGadget)
+ * G_IMPLEMENT_INTERFACE (TYPE_GIZMO,
+ * gtk_gadget_gizmo_init));
+ * ]|
+ * expands to
+ * |[<!-- language="C" -->
+ * static void gtk_gadget_init (GtkGadget *self);
+ * static void gtk_gadget_class_init (GtkGadgetClass *klass);
+ * static gpointer gtk_gadget_parent_class = NULL;
+ * static gint GtkGadget_private_offset;
+ * static void gtk_gadget_class_intern_init (gpointer klass)
+ * {
+ * gtk_gadget_parent_class = g_type_class_peek_parent (klass);
+ * if (GtkGadget_private_offset != 0)
+ * g_type_class_adjust_private_offset (klass, &GtkGadget_private_offset);
+ * gtk_gadget_class_init ((GtkGadgetClass*) klass);
+ * }
+ * static inline gpointer gtk_gadget_get_instance_private (GtkGadget *self)
+ * {
+ * return (G_STRUCT_MEMBER_P (self, GtkGadget_private_offset));
+ * }
+ *
+ * GType
+ * gtk_gadget_get_type (void)
+ * {
+ * static volatile gsize g_define_type_id__volatile = 0;
+ * if (g_once_init_enter (&g_define_type_id__volatile))
+ * {
+ * GType g_define_type_id =
+ * g_type_register_static_simple (GTK_TYPE_WIDGET,
+ * g_intern_static_string ("GtkGadget"),
+ * sizeof (GtkGadgetClass),
+ * (GClassInitFunc) gtk_gadget_class_intern_init,
+ * sizeof (GtkGadget),
+ * (GInstanceInitFunc) gtk_gadget_init,
+ * 0);
+ * {
+ * GtkGadget_private_offset =
+ * g_type_add_instance_private (g_define_type_id, sizeof (GtkGadgetPrivate));
+ * }
+ * {
+ * const GInterfaceInfo g_implement_interface_info = {
+ * (GInterfaceInitFunc) gtk_gadget_gizmo_init
+ * };
+ * g_type_add_interface_static (g_define_type_id, TYPE_GIZMO, &g_implement_interface_info);
+ * }
+ * g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ * }
+ * return g_define_type_id__volatile;
+ * }
+ * ]|
+ * The only pieces which have to be manually provided are the definitions of
+ * the instance and class structure and the definitions of the instance and
+ * class init functions.
+ *
+ * Since: 2.4
+ */
+#define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+
+/**
+ * G_DEFINE_INTERFACE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words separated by '_'.
+ * @T_P: The #GType of the prerequisite type for the interface, or 0
+ * (%G_TYPE_INVALID) for no prerequisite type.
+ *
+ * A convenience macro for #GTypeInterface definitions, which declares
+ * a default vtable initialization function and defines a *_get_type()
+ * function.
+ *
+ * The macro expects the interface initialization function to have the
+ * name `t_n ## _default_init`, and the interface structure to have the
+ * name `TN ## Interface`.
+ *
+ * The initialization function has signature
+ * `static void t_n ## _default_init (TypeName##Interface *klass);`, rather than
+ * the full #GInterfaceInitFunc signature, for brevity and convenience. If you
+ * need to use an initialization function with an `iface_data` argument, you
+ * must write the #GTypeInterface definitions manually.
+ *
+ * Since: 2.24
+ */
+#define G_DEFINE_INTERFACE(TN, t_n, T_P) G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;)
+
+/**
+ * G_DEFINE_INTERFACE_WITH_CODE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words separated by '_'.
+ * @T_P: The #GType of the prerequisite type for the interface, or 0
+ * (%G_TYPE_INVALID) for no prerequisite type.
+ * @_C_: Custom code that gets inserted in the *_get_type() function.
+ *
+ * A convenience macro for #GTypeInterface definitions. Similar to
+ * G_DEFINE_INTERFACE(), but allows you to insert custom code into the
+ * *_get_type() function, e.g. additional interface implementations
+ * via G_IMPLEMENT_INTERFACE(), or additional prerequisite types. See
+ * G_DEFINE_TYPE_EXTENDED() for a similar example using
+ * G_DEFINE_TYPE_WITH_CODE().
+ *
+ * Since: 2.24
+ */
+#define G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TN, t_n, T_P) {_C_;} _G_DEFINE_INTERFACE_EXTENDED_END()
+
+/**
+ * G_IMPLEMENT_INTERFACE:
+ * @TYPE_IFACE: The #GType of the interface to add
+ * @iface_init: (type GInterfaceInitFunc): The interface init function, of type #GInterfaceInitFunc
+ *
+ * A convenience macro to ease interface addition in the `_C_` section
+ * of G_DEFINE_TYPE_WITH_CODE() or G_DEFINE_ABSTRACT_TYPE_WITH_CODE().
+ * See G_DEFINE_TYPE_EXTENDED() for an example.
+ *
+ * Note that this macro can only be used together with the G_DEFINE_TYPE_*
+ * macros, since it depends on variable names from those macros.
+ *
+ * Since: 2.4
+ */
+#define G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) { \
+ const GInterfaceInfo g_implement_interface_info = { \
+ (GInterfaceInitFunc)(void (*)(void)) iface_init, NULL, NULL \
+ }; \
+ g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
+}
+
+/**
+ * G_ADD_PRIVATE:
+ * @TypeName: the name of the type in CamelCase
+ *
+ * A convenience macro to ease adding private data to instances of a new type
+ * in the @_C_ section of G_DEFINE_TYPE_WITH_CODE() or
+ * G_DEFINE_ABSTRACT_TYPE_WITH_CODE().
+ *
+ * For instance:
+ *
+ * |[<!-- language="C" -->
+ * typedef struct _MyObject MyObject;
+ * typedef struct _MyObjectClass MyObjectClass;
+ *
+ * typedef struct {
+ * gint foo;
+ * gint bar;
+ * } MyObjectPrivate;
+ *
+ * G_DEFINE_TYPE_WITH_CODE (MyObject, my_object, G_TYPE_OBJECT,
+ * G_ADD_PRIVATE (MyObject))
+ * ]|
+ *
+ * Will add MyObjectPrivate as the private data to any instance of the MyObject
+ * type.
+ *
+ * G_DEFINE_TYPE_* macros will automatically create a private function
+ * based on the arguments to this macro, which can be used to safely
+ * retrieve the private data from an instance of the type; for instance:
+ *
+ * |[<!-- language="C" -->
+ * gint
+ * my_object_get_foo (MyObject *obj)
+ * {
+ * MyObjectPrivate *priv = my_object_get_instance_private (obj);
+ *
+ * g_return_val_if_fail (MY_IS_OBJECT (obj), 0);
+ *
+ * return priv->foo;
+ * }
+ *
+ * void
+ * my_object_set_bar (MyObject *obj,
+ * gint bar)
+ * {
+ * MyObjectPrivate *priv = my_object_get_instance_private (obj);
+ *
+ * g_return_if_fail (MY_IS_OBJECT (obj));
+ *
+ * if (priv->bar != bar)
+ * priv->bar = bar;
+ * }
+ * ]|
+ *
+ * Note that this macro can only be used together with the G_DEFINE_TYPE_*
+ * macros, since it depends on variable names from those macros.
+ *
+ * Also note that private structs added with these macros must have a struct
+ * name of the form `TypeNamePrivate`.
+ *
+ * It is safe to call the `_get_instance_private` function on %NULL or invalid
+ * objects since it's only adding an offset to the instance pointer. In that
+ * case the returned pointer must not be dereferenced.
+ *
+ * Since: 2.38
+ */
+#define G_ADD_PRIVATE(TypeName) { \
+ TypeName##_private_offset = \
+ g_type_add_instance_private (g_define_type_id, sizeof (TypeName##Private)); \
+}
+
+/**
+ * G_PRIVATE_OFFSET:
+ * @TypeName: the name of the type in CamelCase
+ * @field: the name of the field in the private data structure
+ *
+ * Evaluates to the offset of the @field inside the instance private data
+ * structure for @TypeName.
+ *
+ * Note that this macro can only be used together with the G_DEFINE_TYPE_*
+ * and G_ADD_PRIVATE() macros, since it depends on variable names from
+ * those macros.
+ *
+ * Since: 2.38
+ */
+#define G_PRIVATE_OFFSET(TypeName, field) \
+ (TypeName##_private_offset + (G_STRUCT_OFFSET (TypeName##Private, field)))
+
+/**
+ * G_PRIVATE_FIELD_P:
+ * @TypeName: the name of the type in CamelCase
+ * @inst: the instance of @TypeName you wish to access
+ * @field_name: the name of the field in the private data structure
+ *
+ * Evaluates to a pointer to the @field_name inside the @inst private data
+ * structure for @TypeName.
+ *
+ * Note that this macro can only be used together with the G_DEFINE_TYPE_*
+ * and G_ADD_PRIVATE() macros, since it depends on variable names from
+ * those macros.
+ *
+ * Since: 2.38
+ */
+#define G_PRIVATE_FIELD_P(TypeName, inst, field_name) \
+ G_STRUCT_MEMBER_P (inst, G_PRIVATE_OFFSET (TypeName, field_name))
+
+/**
+ * G_PRIVATE_FIELD:
+ * @TypeName: the name of the type in CamelCase
+ * @inst: the instance of @TypeName you wish to access
+ * @field_type: the type of the field in the private data structure
+ * @field_name: the name of the field in the private data structure
+ *
+ * Evaluates to the @field_name inside the @inst private data
+ * structure for @TypeName.
+ *
+ * Note that this macro can only be used together with the G_DEFINE_TYPE_*
+ * and G_ADD_PRIVATE() macros, since it depends on variable names from
+ * those macros.
+ *
+ * Since: 2.38
+ */
+#define G_PRIVATE_FIELD(TypeName, inst, field_type, field_name) \
+ G_STRUCT_MEMBER (field_type, inst, G_PRIVATE_OFFSET (TypeName, field_name))
+
+/* we need to have this macro under conditional expansion, as it references
+ * a function that has been added in 2.38. see bug:
+ * https://bugzilla.gnome.org/show_bug.cgi?id=703191
+ */
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+#define _G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
+static void type_name##_class_intern_init (gpointer klass) \
+{ \
+ type_name##_parent_class = g_type_class_peek_parent (klass); \
+ if (TypeName##_private_offset != 0) \
+ g_type_class_adjust_private_offset (klass, &TypeName##_private_offset); \
+ type_name##_class_init ((TypeName##Class*) klass); \
+}
+
+#else
+#define _G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
+static void type_name##_class_intern_init (gpointer klass) \
+{ \
+ type_name##_parent_class = g_type_class_peek_parent (klass); \
+ type_name##_class_init ((TypeName##Class*) klass); \
+}
+#endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 */
+
+/* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
+#define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
+\
+static void type_name##_init (TypeName *self); \
+static void type_name##_class_init (TypeName##Class *klass); \
+static GType type_name##_get_type_once (void); \
+static gpointer type_name##_parent_class = NULL; \
+static gint TypeName##_private_offset; \
+\
+_G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
+\
+G_GNUC_UNUSED \
+static inline gpointer \
+type_name##_get_instance_private (TypeName *self) \
+{ \
+ return (G_STRUCT_MEMBER_P (self, TypeName##_private_offset)); \
+} \
+\
+GType \
+type_name##_get_type (void) \
+{ \
+ static volatile gsize g_define_type_id__volatile = 0;
+ /* Prelude goes here */
+
+/* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
+#define _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
+ if (g_once_init_enter (&g_define_type_id__volatile)) \
+ { \
+ GType g_define_type_id = type_name##_get_type_once (); \
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
+ } \
+ return g_define_type_id__volatile; \
+} /* closes type_name##_get_type() */ \
+\
+G_GNUC_NO_INLINE \
+static GType \
+type_name##_get_type_once (void) \
+{ \
+ GType g_define_type_id = \
+ g_type_register_static_simple (TYPE_PARENT, \
+ g_intern_static_string (#TypeName), \
+ sizeof (TypeName##Class), \
+ (GClassInitFunc)(void (*)(void)) type_name##_class_intern_init, \
+ sizeof (TypeName), \
+ (GInstanceInitFunc)(void (*)(void)) type_name##_init, \
+ (GTypeFlags) flags); \
+ { /* custom code follows */
+#define _G_DEFINE_TYPE_EXTENDED_END() \
+ /* following custom code */ \
+ } \
+ return g_define_type_id; \
+} /* closes type_name##_get_type_once() */
+
+/* This was defined before we had G_DEFINE_TYPE_WITH_CODE_AND_PRELUDE, it's simplest
+ * to keep it.
+ */
+#define _G_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \
+ _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
+ _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
+
+#define _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PREREQ) \
+\
+static void type_name##_default_init (TypeName##Interface *klass); \
+\
+GType \
+type_name##_get_type (void) \
+{ \
+ static volatile gsize g_define_type_id__volatile = 0; \
+ if (g_once_init_enter (&g_define_type_id__volatile)) \
+ { \
+ GType g_define_type_id = \
+ g_type_register_static_simple (G_TYPE_INTERFACE, \
+ g_intern_static_string (#TypeName), \
+ sizeof (TypeName##Interface), \
+ (GClassInitFunc)(void (*)(void)) type_name##_default_init, \
+ 0, \
+ (GInstanceInitFunc)NULL, \
+ (GTypeFlags) 0); \
+ if (TYPE_PREREQ != G_TYPE_INVALID) \
+ g_type_interface_add_prerequisite (g_define_type_id, TYPE_PREREQ); \
+ { /* custom code follows */
+#define _G_DEFINE_INTERFACE_EXTENDED_END() \
+ /* following custom code */ \
+ } \
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
+ } \
+ return g_define_type_id__volatile; \
+} /* closes type_name##_get_type() */
+
+/**
+ * G_DEFINE_BOXED_TYPE:
+ * @TypeName: The name of the new type, in Camel case
+ * @type_name: The name of the new type, in lowercase, with words
+ * separated by '_'
+ * @copy_func: the #GBoxedCopyFunc for the new type
+ * @free_func: the #GBoxedFreeFunc for the new type
+ *
+ * A convenience macro for boxed type implementations, which defines a
+ * type_name_get_type() function registering the boxed type.
+ *
+ * Since: 2.26
+ */
+#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
+/**
+ * G_DEFINE_BOXED_TYPE_WITH_CODE:
+ * @TypeName: The name of the new type, in Camel case
+ * @type_name: The name of the new type, in lowercase, with words
+ * separated by '_'
+ * @copy_func: the #GBoxedCopyFunc for the new type
+ * @free_func: the #GBoxedFreeFunc for the new type
+ * @_C_: Custom code that gets inserted in the *_get_type() function
+ *
+ * A convenience macro for boxed type implementations.
+ * Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into the
+ * type_name_get_type() function, e.g. to register value transformations with
+ * g_value_register_transform_func(), for instance:
+ *
+ * |[<!-- language="C" -->
+ * G_DEFINE_BOXED_TYPE_WITH_CODE (GdkRectangle, gdk_rectangle,
+ * gdk_rectangle_copy,
+ * gdk_rectangle_free,
+ * register_rectangle_transform_funcs (g_define_type_id))
+ * ]|
+ *
+ * Similarly to the %G_DEFINE_TYPE family of macros, the #GType of the newly
+ * defined boxed type is exposed in the `g_define_type_id` variable.
+ *
+ * Since: 2.26
+ */
+#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+
+/* Only use this in non-C++ on GCC >= 2.7, except for Darwin/ppc64.
+ * See https://bugzilla.gnome.org/show_bug.cgi?id=647145
+ */
+#if !defined (__cplusplus) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined (__APPLE__) && defined (__ppc64__))
+#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
+static GType type_name##_get_type_once (void); \
+\
+GType \
+type_name##_get_type (void) \
+{ \
+ static volatile gsize g_define_type_id__volatile = 0; \
+ if (g_once_init_enter (&g_define_type_id__volatile)) \
+ { \
+ GType g_define_type_id = type_name##_get_type_once (); \
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
+ } \
+ return g_define_type_id__volatile; \
+} \
+\
+G_GNUC_NO_INLINE \
+static GType \
+type_name##_get_type_once (void) \
+{ \
+ GType (* _g_register_boxed) \
+ (const gchar *, \
+ union \
+ { \
+ TypeName * (*do_copy_type) (TypeName *); \
+ TypeName * (*do_const_copy_type) (const TypeName *); \
+ GBoxedCopyFunc do_copy_boxed; \
+ } __attribute__((__transparent_union__)), \
+ union \
+ { \
+ void (* do_free_type) (TypeName *); \
+ GBoxedFreeFunc do_free_boxed; \
+ } __attribute__((__transparent_union__)) \
+ ) = g_boxed_type_register_static; \
+ GType g_define_type_id = \
+ _g_register_boxed (g_intern_static_string (#TypeName), copy_func, free_func); \
+ { /* custom code follows */
+#else
+#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
+static GType type_name##_get_type_once (void); \
+\
+GType \
+type_name##_get_type (void) \
+{ \
+ static volatile gsize g_define_type_id__volatile = 0; \
+ if (g_once_init_enter (&g_define_type_id__volatile)) \
+ { \
+ GType g_define_type_id = type_name##_get_type_once (); \
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
+ } \
+ return g_define_type_id__volatile; \
+} \
+\
+G_GNUC_NO_INLINE \
+static GType \
+type_name##_get_type_once (void) \
+{ \
+ GType g_define_type_id = \
+ g_boxed_type_register_static (g_intern_static_string (#TypeName), \
+ (GBoxedCopyFunc) copy_func, \
+ (GBoxedFreeFunc) free_func); \
+ { /* custom code follows */
+#endif /* __GNUC__ */
+
+/**
+ * G_DEFINE_POINTER_TYPE:
+ * @TypeName: The name of the new type, in Camel case
+ * @type_name: The name of the new type, in lowercase, with words
+ * separated by '_'
+ *
+ * A convenience macro for pointer type implementations, which defines a
+ * type_name_get_type() function registering the pointer type.
+ *
+ * Since: 2.26
+ */
+#define G_DEFINE_POINTER_TYPE(TypeName, type_name) G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, type_name, {})
+/**
+ * G_DEFINE_POINTER_TYPE_WITH_CODE:
+ * @TypeName: The name of the new type, in Camel case
+ * @type_name: The name of the new type, in lowercase, with words
+ * separated by '_'
+ * @_C_: Custom code that gets inserted in the *_get_type() function
+ *
+ * A convenience macro for pointer type implementations.
+ * Similar to G_DEFINE_POINTER_TYPE(), but allows to insert
+ * custom code into the type_name_get_type() function.
+ *
+ * Since: 2.26
+ */
+#define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_) _G_DEFINE_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+
+#define _G_DEFINE_POINTER_TYPE_BEGIN(TypeName, type_name) \
+static GType type_name##_get_type_once (void); \
+\
+GType \
+type_name##_get_type (void) \
+{ \
+ static volatile gsize g_define_type_id__volatile = 0; \
+ if (g_once_init_enter (&g_define_type_id__volatile)) \
+ { \
+ GType g_define_type_id = type_name##_get_type_once (); \
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
+ } \
+ return g_define_type_id__volatile; \
+} \
+\
+G_GNUC_NO_INLINE \
+static GType \
+type_name##_get_type_once (void) \
+{ \
+ GType g_define_type_id = \
+ g_pointer_type_register_static (g_intern_static_string (#TypeName)); \
+ { /* custom code follows */
+
+/* --- protected (for fundamental type implementations) --- */
+GLIB_AVAILABLE_IN_ALL
+GTypePlugin* g_type_get_plugin (GType type);
+GLIB_AVAILABLE_IN_ALL
+GTypePlugin* g_type_interface_get_plugin (GType instance_type,
+ GType interface_type);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_fundamental_next (void);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_fundamental (GType type_id);
+GLIB_AVAILABLE_IN_ALL
+GTypeInstance* g_type_create_instance (GType type);
+GLIB_AVAILABLE_IN_ALL
+void g_type_free_instance (GTypeInstance *instance);
+
+GLIB_AVAILABLE_IN_ALL
+void g_type_add_class_cache_func (gpointer cache_data,
+ GTypeClassCacheFunc cache_func);
+GLIB_AVAILABLE_IN_ALL
+void g_type_remove_class_cache_func (gpointer cache_data,
+ GTypeClassCacheFunc cache_func);
+GLIB_AVAILABLE_IN_ALL
+void g_type_class_unref_uncached (gpointer g_class);
+
+GLIB_AVAILABLE_IN_ALL
+void g_type_add_interface_check (gpointer check_data,
+ GTypeInterfaceCheckFunc check_func);
+GLIB_AVAILABLE_IN_ALL
+void g_type_remove_interface_check (gpointer check_data,
+ GTypeInterfaceCheckFunc check_func);
+
+GLIB_AVAILABLE_IN_ALL
+GTypeValueTable* g_type_value_table_peek (GType type);
+
+
+/*< private >*/
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_check_instance (GTypeInstance *instance) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+GTypeInstance* g_type_check_instance_cast (GTypeInstance *instance,
+ GType iface_type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_check_instance_is_a (GTypeInstance *instance,
+ GType iface_type) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_2_42
+gboolean g_type_check_instance_is_fundamentally_a (GTypeInstance *instance,
+ GType fundamental_type) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+GTypeClass* g_type_check_class_cast (GTypeClass *g_class,
+ GType is_a_type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_check_class_is_a (GTypeClass *g_class,
+ GType is_a_type) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_check_is_value_type (GType type) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_check_value (const GValue *value) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_check_value_holds (const GValue *value,
+ GType type) G_GNUC_PURE;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_test_flags (GType type,
+ guint flags) G_GNUC_CONST;
+
+
+/* --- debugging functions --- */
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_type_name_from_instance (GTypeInstance *instance);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_type_name_from_class (GTypeClass *g_class);
+
+
+/* --- implementation bits --- */
+#ifndef G_DISABLE_CAST_CHECKS
+# define _G_TYPE_CIC(ip, gt, ct) \
+ ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt))
+# define _G_TYPE_CCC(cp, gt, ct) \
+ ((ct*) g_type_check_class_cast ((GTypeClass*) cp, gt))
+#else /* G_DISABLE_CAST_CHECKS */
+# define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip)
+# define _G_TYPE_CCC(cp, gt, ct) ((ct*) cp)
+#endif /* G_DISABLE_CAST_CHECKS */
+#define _G_TYPE_CHI(ip) (g_type_check_instance ((GTypeInstance*) ip))
+#define _G_TYPE_CHV(vl) (g_type_check_value ((GValue*) vl))
+#define _G_TYPE_IGC(ip, gt, ct) ((ct*) (((GTypeInstance*) ip)->g_class))
+#define _G_TYPE_IGI(ip, gt, ct) ((ct*) g_type_interface_peek (((GTypeInstance*) ip)->g_class, gt))
+#define _G_TYPE_CIFT(ip, ft) (g_type_check_instance_is_fundamentally_a ((GTypeInstance*) ip, ft))
+#ifdef __GNUC__
+# define _G_TYPE_CIT(ip, gt) (G_GNUC_EXTENSION ({ \
+ GTypeInstance *__inst = (GTypeInstance*) ip; GType __t = gt; gboolean __r; \
+ if (!__inst) \
+ __r = FALSE; \
+ else if (__inst->g_class && __inst->g_class->g_type == __t) \
+ __r = TRUE; \
+ else \
+ __r = g_type_check_instance_is_a (__inst, __t); \
+ __r; \
+}))
+# define _G_TYPE_CCT(cp, gt) (G_GNUC_EXTENSION ({ \
+ GTypeClass *__class = (GTypeClass*) cp; GType __t = gt; gboolean __r; \
+ if (!__class) \
+ __r = FALSE; \
+ else if (__class->g_type == __t) \
+ __r = TRUE; \
+ else \
+ __r = g_type_check_class_is_a (__class, __t); \
+ __r; \
+}))
+# define _G_TYPE_CVH(vl, gt) (G_GNUC_EXTENSION ({ \
+ const GValue *__val = (const GValue*) vl; GType __t = gt; gboolean __r; \
+ if (!__val) \
+ __r = FALSE; \
+ else if (__val->g_type == __t) \
+ __r = TRUE; \
+ else \
+ __r = g_type_check_value_holds (__val, __t); \
+ __r; \
+}))
+#else /* !__GNUC__ */
+# define _G_TYPE_CIT(ip, gt) (g_type_check_instance_is_a ((GTypeInstance*) ip, gt))
+# define _G_TYPE_CCT(cp, gt) (g_type_check_class_is_a ((GTypeClass*) cp, gt))
+# define _G_TYPE_CVH(vl, gt) (g_type_check_value_holds ((const GValue*) vl, gt))
+#endif /* !__GNUC__ */
+/**
+ * G_TYPE_FLAG_RESERVED_ID_BIT:
+ *
+ * A bit in the type number that's supposed to be left untouched.
+ */
+#define G_TYPE_FLAG_RESERVED_ID_BIT ((GType) (1 << 0))
+
+G_END_DECLS
+
+#endif /* __G_TYPE_H__ */
diff --git a/include/glib/gobject/gtypemodule.h b/include/glib/gobject/gtypemodule.h
new file mode 100644
index 0000000000..5c40250631
--- /dev/null
+++ b/include/glib/gobject/gtypemodule.h
@@ -0,0 +1,295 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_TYPE_MODULE_H__
+#define __G_TYPE_MODULE_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gobject.h>
+#include <gobject/genums.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GTypeModule GTypeModule;
+typedef struct _GTypeModuleClass GTypeModuleClass;
+
+#define G_TYPE_TYPE_MODULE (g_type_module_get_type ())
+#define G_TYPE_MODULE(module) (G_TYPE_CHECK_INSTANCE_CAST ((module), G_TYPE_TYPE_MODULE, GTypeModule))
+#define G_TYPE_MODULE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TYPE_MODULE, GTypeModuleClass))
+#define G_IS_TYPE_MODULE(module) (G_TYPE_CHECK_INSTANCE_TYPE ((module), G_TYPE_TYPE_MODULE))
+#define G_IS_TYPE_MODULE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TYPE_MODULE))
+#define G_TYPE_MODULE_GET_CLASS(module) (G_TYPE_INSTANCE_GET_CLASS ((module), G_TYPE_TYPE_MODULE, GTypeModuleClass))
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTypeModule, g_object_unref)
+
+/**
+ * GTypeModule:
+ * @name: the name of the module
+ *
+ * The members of the GTypeModule structure should not
+ * be accessed directly, except for the @name field.
+ */
+struct _GTypeModule
+{
+ GObject parent_instance;
+
+ guint use_count;
+ GSList *type_infos;
+ GSList *interface_infos;
+
+ /*< public >*/
+ gchar *name;
+};
+
+/**
+ * GTypeModuleClass:
+ * @parent_class: the parent class
+ * @load: loads the module and registers one or more types using
+ * g_type_module_register_type().
+ * @unload: unloads the module
+ *
+ * In order to implement dynamic loading of types based on #GTypeModule,
+ * the @load and @unload functions in #GTypeModuleClass must be implemented.
+ */
+struct _GTypeModuleClass
+{
+ GObjectClass parent_class;
+
+ /*< public >*/
+ gboolean (* load) (GTypeModule *module);
+ void (* unload) (GTypeModule *module);
+
+ /*< private >*/
+ /* Padding for future expansion */
+ void (*reserved1) (void);
+ void (*reserved2) (void);
+ void (*reserved3) (void);
+ void (*reserved4) (void);
+};
+
+/**
+ * G_DEFINE_DYNAMIC_TYPE:
+ * @TN: The name of the new type, in Camel case.
+ * @t_n: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @T_P: The #GType of the parent type.
+ *
+ * A convenience macro for dynamic type implementations, which declares a
+ * class initialization function, an instance initialization function (see
+ * #GTypeInfo for information about these) and a static variable named
+ * `t_n`_parent_class pointing to the parent class. Furthermore,
+ * it defines a `*_get_type()` and a static `*_register_type()` functions
+ * for use in your `module_init()`.
+ *
+ * See G_DEFINE_DYNAMIC_TYPE_EXTENDED() for an example.
+ *
+ * Since: 2.14
+ */
+#define G_DEFINE_DYNAMIC_TYPE(TN, t_n, T_P) G_DEFINE_DYNAMIC_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
+/**
+ * G_DEFINE_DYNAMIC_TYPE_EXTENDED:
+ * @TypeName: The name of the new type, in Camel case.
+ * @type_name: The name of the new type, in lowercase, with words
+ * separated by '_'.
+ * @TYPE_PARENT: The #GType of the parent type.
+ * @flags: #GTypeFlags to pass to g_type_module_register_type()
+ * @CODE: Custom code that gets inserted in the *_get_type() function.
+ *
+ * A more general version of G_DEFINE_DYNAMIC_TYPE() which
+ * allows to specify #GTypeFlags and custom code.
+ *
+ * |[
+ * G_DEFINE_DYNAMIC_TYPE_EXTENDED (GtkGadget,
+ * gtk_gadget,
+ * GTK_TYPE_THING,
+ * 0,
+ * G_IMPLEMENT_INTERFACE_DYNAMIC (TYPE_GIZMO,
+ * gtk_gadget_gizmo_init));
+ * ]|
+ * expands to
+ * |[
+ * static void gtk_gadget_init (GtkGadget *self);
+ * static void gtk_gadget_class_init (GtkGadgetClass *klass);
+ * static void gtk_gadget_class_finalize (GtkGadgetClass *klass);
+ *
+ * static gpointer gtk_gadget_parent_class = NULL;
+ * static GType gtk_gadget_type_id = 0;
+ *
+ * static void gtk_gadget_class_intern_init (gpointer klass)
+ * {
+ * gtk_gadget_parent_class = g_type_class_peek_parent (klass);
+ * gtk_gadget_class_init ((GtkGadgetClass*) klass);
+ * }
+ *
+ * GType
+ * gtk_gadget_get_type (void)
+ * {
+ * return gtk_gadget_type_id;
+ * }
+ *
+ * static void
+ * gtk_gadget_register_type (GTypeModule *type_module)
+ * {
+ * const GTypeInfo g_define_type_info = {
+ * sizeof (GtkGadgetClass),
+ * (GBaseInitFunc) NULL,
+ * (GBaseFinalizeFunc) NULL,
+ * (GClassInitFunc) gtk_gadget_class_intern_init,
+ * (GClassFinalizeFunc) gtk_gadget_class_finalize,
+ * NULL, // class_data
+ * sizeof (GtkGadget),
+ * 0, // n_preallocs
+ * (GInstanceInitFunc) gtk_gadget_init,
+ * NULL // value_table
+ * };
+ * gtk_gadget_type_id = g_type_module_register_type (type_module,
+ * GTK_TYPE_THING,
+ * "GtkGadget",
+ * &g_define_type_info,
+ * (GTypeFlags) flags);
+ * {
+ * const GInterfaceInfo g_implement_interface_info = {
+ * (GInterfaceInitFunc) gtk_gadget_gizmo_init
+ * };
+ * g_type_module_add_interface (type_module, g_define_type_id, TYPE_GIZMO, &g_implement_interface_info);
+ * }
+ * }
+ * ]|
+ *
+ * Since: 2.14
+ */
+#define G_DEFINE_DYNAMIC_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE) \
+static void type_name##_init (TypeName *self); \
+static void type_name##_class_init (TypeName##Class *klass); \
+static void type_name##_class_finalize (TypeName##Class *klass); \
+static gpointer type_name##_parent_class = NULL; \
+static GType type_name##_type_id = 0; \
+static gint TypeName##_private_offset; \
+\
+_G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \
+\
+G_GNUC_UNUSED \
+static inline gpointer \
+type_name##_get_instance_private (TypeName *self) \
+{ \
+ return (G_STRUCT_MEMBER_P (self, TypeName##_private_offset)); \
+} \
+\
+GType \
+type_name##_get_type (void) \
+{ \
+ return type_name##_type_id; \
+} \
+static void \
+type_name##_register_type (GTypeModule *type_module) \
+{ \
+ GType g_define_type_id G_GNUC_UNUSED; \
+ const GTypeInfo g_define_type_info = { \
+ sizeof (TypeName##Class), \
+ (GBaseInitFunc) NULL, \
+ (GBaseFinalizeFunc) NULL, \
+ (GClassInitFunc)(void (*)(void)) type_name##_class_intern_init, \
+ (GClassFinalizeFunc)(void (*)(void)) type_name##_class_finalize, \
+ NULL, /* class_data */ \
+ sizeof (TypeName), \
+ 0, /* n_preallocs */ \
+ (GInstanceInitFunc)(void (*)(void)) type_name##_init, \
+ NULL /* value_table */ \
+ }; \
+ type_name##_type_id = g_type_module_register_type (type_module, \
+ TYPE_PARENT, \
+ #TypeName, \
+ &g_define_type_info, \
+ (GTypeFlags) flags); \
+ g_define_type_id = type_name##_type_id; \
+ { CODE ; } \
+}
+
+/**
+ * G_IMPLEMENT_INTERFACE_DYNAMIC:
+ * @TYPE_IFACE: The #GType of the interface to add
+ * @iface_init: The interface init function
+ *
+ * A convenience macro to ease interface addition in the @_C_ section
+ * of G_DEFINE_DYNAMIC_TYPE_EXTENDED(). See G_DEFINE_DYNAMIC_TYPE_EXTENDED()
+ * for an example.
+ *
+ * Note that this macro can only be used together with the
+ * G_DEFINE_DYNAMIC_TYPE_EXTENDED macros, since it depends on variable
+ * names from that macro.
+ *
+ * Since: 2.24
+ */
+#define G_IMPLEMENT_INTERFACE_DYNAMIC(TYPE_IFACE, iface_init) { \
+ const GInterfaceInfo g_implement_interface_info = { \
+ (GInterfaceInitFunc)(void (*)(void)) iface_init, NULL, NULL \
+ }; \
+ g_type_module_add_interface (type_module, g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
+}
+
+/**
+ * G_ADD_PRIVATE_DYNAMIC:
+ * @TypeName: the name of the type in CamelCase
+ *
+ * A convenience macro to ease adding private data to instances of a new dynamic
+ * type in the @_C_ section of G_DEFINE_DYNAMIC_TYPE_EXTENDED(). See
+ * G_ADD_PRIVATE() for details, it is similar but for static types.
+ *
+ * Note that this macro can only be used together with the
+ * G_DEFINE_DYNAMIC_TYPE_EXTENDED macros, since it depends on variable
+ * names from that macro.
+ *
+ * Since: 2.38
+ */
+#define G_ADD_PRIVATE_DYNAMIC(TypeName) { \
+ TypeName##_private_offset = sizeof (TypeName##Private); \
+}
+
+GLIB_AVAILABLE_IN_ALL
+GType g_type_module_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+gboolean g_type_module_use (GTypeModule *module);
+GLIB_AVAILABLE_IN_ALL
+void g_type_module_unuse (GTypeModule *module);
+GLIB_AVAILABLE_IN_ALL
+void g_type_module_set_name (GTypeModule *module,
+ const gchar *name);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_module_register_type (GTypeModule *module,
+ GType parent_type,
+ const gchar *type_name,
+ const GTypeInfo *type_info,
+ GTypeFlags flags);
+GLIB_AVAILABLE_IN_ALL
+void g_type_module_add_interface (GTypeModule *module,
+ GType instance_type,
+ GType interface_type,
+ const GInterfaceInfo *interface_info);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_module_register_enum (GTypeModule *module,
+ const gchar *name,
+ const GEnumValue *const_static_values);
+GLIB_AVAILABLE_IN_ALL
+GType g_type_module_register_flags (GTypeModule *module,
+ const gchar *name,
+ const GFlagsValue *const_static_values);
+
+G_END_DECLS
+
+#endif /* __G_TYPE_MODULE_H__ */
diff --git a/include/glib/gobject/gtypeplugin.h b/include/glib/gobject/gtypeplugin.h
new file mode 100644
index 0000000000..482f55cae1
--- /dev/null
+++ b/include/glib/gobject/gtypeplugin.h
@@ -0,0 +1,134 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2000 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __G_TYPE_PLUGIN_H__
+#define __G_TYPE_PLUGIN_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gtype.h>
+
+G_BEGIN_DECLS
+
+/* --- type macros --- */
+#define G_TYPE_TYPE_PLUGIN (g_type_plugin_get_type ())
+#define G_TYPE_PLUGIN(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TYPE_PLUGIN, GTypePlugin))
+#define G_TYPE_PLUGIN_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
+#define G_IS_TYPE_PLUGIN(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TYPE_PLUGIN))
+#define G_IS_TYPE_PLUGIN_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), G_TYPE_TYPE_PLUGIN))
+#define G_TYPE_PLUGIN_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
+
+
+/* --- typedefs & structures --- */
+typedef struct _GTypePluginClass GTypePluginClass;
+/**
+ * GTypePluginUse:
+ * @plugin: the #GTypePlugin whose use count should be increased
+ *
+ * The type of the @use_plugin function of #GTypePluginClass, which gets called
+ * to increase the use count of @plugin.
+ */
+typedef void (*GTypePluginUse) (GTypePlugin *plugin);
+/**
+ * GTypePluginUnuse:
+ * @plugin: the #GTypePlugin whose use count should be decreased
+ *
+ * The type of the @unuse_plugin function of #GTypePluginClass.
+ */
+typedef void (*GTypePluginUnuse) (GTypePlugin *plugin);
+/**
+ * GTypePluginCompleteTypeInfo:
+ * @plugin: the #GTypePlugin
+ * @g_type: the #GType whose info is completed
+ * @info: the #GTypeInfo struct to fill in
+ * @value_table: the #GTypeValueTable to fill in
+ *
+ * The type of the @complete_type_info function of #GTypePluginClass.
+ */
+typedef void (*GTypePluginCompleteTypeInfo) (GTypePlugin *plugin,
+ GType g_type,
+ GTypeInfo *info,
+ GTypeValueTable *value_table);
+/**
+ * GTypePluginCompleteInterfaceInfo:
+ * @plugin: the #GTypePlugin
+ * @instance_type: the #GType of an instantiable type to which the interface
+ * is added
+ * @interface_type: the #GType of the interface whose info is completed
+ * @info: the #GInterfaceInfo to fill in
+ *
+ * The type of the @complete_interface_info function of #GTypePluginClass.
+ */
+typedef void (*GTypePluginCompleteInterfaceInfo) (GTypePlugin *plugin,
+ GType instance_type,
+ GType interface_type,
+ GInterfaceInfo *info);
+/**
+ * GTypePlugin:
+ *
+ * The GTypePlugin typedef is used as a placeholder
+ * for objects that implement the GTypePlugin interface.
+ */
+/**
+ * GTypePluginClass:
+ * @use_plugin: Increases the use count of the plugin.
+ * @unuse_plugin: Decreases the use count of the plugin.
+ * @complete_type_info: Fills in the #GTypeInfo and
+ * #GTypeValueTable structs for the type. The structs are initialized
+ * with `memset(s, 0, sizeof (s))` before calling this function.
+ * @complete_interface_info: Fills in missing parts of the #GInterfaceInfo
+ * for the interface. The structs is initialized with
+ * `memset(s, 0, sizeof (s))` before calling this function.
+ *
+ * The #GTypePlugin interface is used by the type system in order to handle
+ * the lifecycle of dynamically loaded types.
+ */
+struct _GTypePluginClass
+{
+ /*< private >*/
+ GTypeInterface base_iface;
+
+ /*< public >*/
+ GTypePluginUse use_plugin;
+ GTypePluginUnuse unuse_plugin;
+ GTypePluginCompleteTypeInfo complete_type_info;
+ GTypePluginCompleteInterfaceInfo complete_interface_info;
+};
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GType g_type_plugin_get_type (void) G_GNUC_CONST;
+GLIB_AVAILABLE_IN_ALL
+void g_type_plugin_use (GTypePlugin *plugin);
+GLIB_AVAILABLE_IN_ALL
+void g_type_plugin_unuse (GTypePlugin *plugin);
+GLIB_AVAILABLE_IN_ALL
+void g_type_plugin_complete_type_info (GTypePlugin *plugin,
+ GType g_type,
+ GTypeInfo *info,
+ GTypeValueTable *value_table);
+GLIB_AVAILABLE_IN_ALL
+void g_type_plugin_complete_interface_info (GTypePlugin *plugin,
+ GType instance_type,
+ GType interface_type,
+ GInterfaceInfo *info);
+
+G_END_DECLS
+
+#endif /* __G_TYPE_PLUGIN_H__ */
diff --git a/include/glib/gobject/gvalue.h b/include/glib/gobject/gvalue.h
new file mode 100644
index 0000000000..9d8f03482a
--- /dev/null
+++ b/include/glib/gobject/gvalue.h
@@ -0,0 +1,196 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * gvalue.h: generic GValue functions
+ */
+#ifndef __G_VALUE_H__
+#define __G_VALUE_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gtype.h>
+
+G_BEGIN_DECLS
+
+/* --- type macros --- */
+/**
+ * G_TYPE_IS_VALUE:
+ * @type: A #GType value.
+ *
+ * Checks whether the passed in type ID can be used for g_value_init().
+ * That is, this macro checks whether this type provides an implementation
+ * of the #GTypeValueTable functions required for a type to create a #GValue of.
+ *
+ * Returns: Whether @type is suitable as a #GValue type.
+ */
+#define G_TYPE_IS_VALUE(type) (g_type_check_is_value_type (type))
+/**
+ * G_IS_VALUE:
+ * @value: A #GValue structure.
+ *
+ * Checks if @value is a valid and initialized #GValue structure.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_IS_VALUE(value) (G_TYPE_CHECK_VALUE (value))
+/**
+ * G_VALUE_TYPE:
+ * @value: A #GValue structure.
+ *
+ * Get the type identifier of @value.
+ *
+ * Returns: the #GType.
+ */
+#define G_VALUE_TYPE(value) (((GValue*) (value))->g_type)
+/**
+ * G_VALUE_TYPE_NAME:
+ * @value: A #GValue structure.
+ *
+ * Gets the type name of @value.
+ *
+ * Returns: the type name.
+ */
+#define G_VALUE_TYPE_NAME(value) (g_type_name (G_VALUE_TYPE (value)))
+/**
+ * G_VALUE_HOLDS:
+ * @value: A #GValue structure.
+ * @type: A #GType value.
+ *
+ * Checks if @value holds (or contains) a value of @type.
+ * This macro will also check for @value != %NULL and issue a
+ * warning if the check fails.
+ *
+ * Returns: %TRUE if @value holds the @type.
+ */
+#define G_VALUE_HOLDS(value,type) (G_TYPE_CHECK_VALUE_TYPE ((value), (type)))
+
+
+/* --- typedefs & structures --- */
+/**
+ * GValueTransform:
+ * @src_value: Source value.
+ * @dest_value: Target value.
+ *
+ * The type of value transformation functions which can be registered with
+ * g_value_register_transform_func().
+ *
+ * @dest_value will be initialized to the correct destination type.
+ */
+typedef void (*GValueTransform) (const GValue *src_value,
+ GValue *dest_value);
+/**
+ * GValue:
+ *
+ * An opaque structure used to hold different types of values.
+ * The data within the structure has protected scope: it is accessible only
+ * to functions within a #GTypeValueTable structure, or implementations of
+ * the g_value_*() API. That is, code portions which implement new fundamental
+ * types.
+ * #GValue users cannot make any assumptions about how data is stored
+ * within the 2 element @data union, and the @g_type member should
+ * only be accessed through the G_VALUE_TYPE() macro.
+ */
+struct _GValue
+{
+ /*< private >*/
+ GType g_type;
+
+ /* public for GTypeValueTable methods */
+ union {
+ gint v_int;
+ guint v_uint;
+ glong v_long;
+ gulong v_ulong;
+ gint64 v_int64;
+ guint64 v_uint64;
+ gfloat v_float;
+ gdouble v_double;
+ gpointer v_pointer;
+ } data[2];
+};
+
+
+/* --- prototypes --- */
+GLIB_AVAILABLE_IN_ALL
+GValue* g_value_init (GValue *value,
+ GType g_type);
+GLIB_AVAILABLE_IN_ALL
+void g_value_copy (const GValue *src_value,
+ GValue *dest_value);
+GLIB_AVAILABLE_IN_ALL
+GValue* g_value_reset (GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_unset (GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_instance (GValue *value,
+ gpointer instance);
+GLIB_AVAILABLE_IN_2_42
+void g_value_init_from_instance (GValue *value,
+ gpointer instance);
+
+
+/* --- private --- */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_value_fits_pointer (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_value_peek_pointer (const GValue *value);
+
+
+/* --- implementation details --- */
+GLIB_AVAILABLE_IN_ALL
+gboolean g_value_type_compatible (GType src_type,
+ GType dest_type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_value_type_transformable (GType src_type,
+ GType dest_type);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_value_transform (const GValue *src_value,
+ GValue *dest_value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_register_transform_func (GType src_type,
+ GType dest_type,
+ GValueTransform transform_func);
+
+/**
+ * G_VALUE_NOCOPY_CONTENTS:
+ *
+ * If passed to G_VALUE_COLLECT(), allocated data won't be copied
+ * but used verbatim. This does not affect ref-counted types like
+ * objects.
+ */
+#define G_VALUE_NOCOPY_CONTENTS (1 << 27)
+
+/**
+ * G_VALUE_INIT:
+ *
+ * A #GValue must be initialized before it can be used. This macro can
+ * be used as initializer instead of an explicit `{ 0 }` when declaring
+ * a variable, but it cannot be assigned to a variable.
+ *
+ * |[
+ * GValue value = G_VALUE_INIT;
+ * ]|
+ *
+ * Since: 2.30
+ */
+#define G_VALUE_INIT { 0, { { 0 } } }
+
+
+G_END_DECLS
+
+#endif /* __G_VALUE_H__ */
diff --git a/include/glib/gobject/gvaluearray.h b/include/glib/gobject/gvaluearray.h
new file mode 100644
index 0000000000..dbc6be765d
--- /dev/null
+++ b/include/glib/gobject/gvaluearray.h
@@ -0,0 +1,104 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 2001 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * gvaluearray.h: GLib array type holding GValues
+ */
+#ifndef __G_VALUE_ARRAY_H__
+#define __G_VALUE_ARRAY_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gvalue.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_TYPE_VALUE_ARRAY:
+ *
+ * The type ID of the "GValueArray" type which is a boxed type,
+ * used to pass around pointers to GValueArrays.
+ *
+ * Deprecated: 2.32: Use #GArray instead of #GValueArray
+ */
+#define G_TYPE_VALUE_ARRAY (g_value_array_get_type ()) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(G_TYPE_ARRAY)
+
+/* --- typedefs & structs --- */
+typedef struct _GValueArray GValueArray;
+/**
+ * GValueArray:
+ * @n_values: number of values contained in the array
+ * @values: array of values
+ *
+ * A #GValueArray contains an array of #GValue elements.
+ */
+struct _GValueArray
+{
+ guint n_values;
+ GValue *values;
+
+ /*< private >*/
+ guint n_prealloced;
+};
+
+/* --- prototypes --- */
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GType g_value_array_get_type (void) G_GNUC_CONST;
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValue* g_value_array_get_nth (GValueArray *value_array,
+ guint index_);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_new (guint n_prealloced);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+void g_value_array_free (GValueArray *value_array);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_copy (const GValueArray *value_array);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_prepend (GValueArray *value_array,
+ const GValue *value);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_append (GValueArray *value_array,
+ const GValue *value);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_insert (GValueArray *value_array,
+ guint index_,
+ const GValue *value);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_remove (GValueArray *value_array,
+ guint index_);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_sort (GValueArray *value_array,
+ GCompareFunc compare_func);
+
+GLIB_DEPRECATED_IN_2_32_FOR(GArray)
+GValueArray* g_value_array_sort_with_data (GValueArray *value_array,
+ GCompareDataFunc compare_func,
+ gpointer user_data);
+
+
+G_END_DECLS
+
+#endif /* __G_VALUE_ARRAY_H__ */
diff --git a/include/glib/gobject/gvaluecollector.h b/include/glib/gobject/gvaluecollector.h
new file mode 100644
index 0000000000..177aa3dfae
--- /dev/null
+++ b/include/glib/gobject/gvaluecollector.h
@@ -0,0 +1,261 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * gvaluecollector.h: GValue varargs stubs
+ */
+/**
+ * SECTION:value_collection
+ * @Short_description: Converting varargs to generic values
+ * @Title: Varargs Value Collection
+ *
+ * The macros in this section provide the varargs parsing support needed
+ * in variadic GObject functions such as g_object_new() or g_object_set().
+ * They currently support the collection of integral types, floating point
+ * types and pointers.
+ */
+#ifndef __G_VALUE_COLLECTOR_H__
+#define __G_VALUE_COLLECTOR_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* we may want to add aggregate types here some day, if requested
+ * by users. the basic C types are covered already, everything
+ * smaller than an int is promoted to an integer and floats are
+ * always promoted to doubles for varargs call constructions.
+ */
+enum /*< skip >*/
+{
+ G_VALUE_COLLECT_INT = 'i',
+ G_VALUE_COLLECT_LONG = 'l',
+ G_VALUE_COLLECT_INT64 = 'q',
+ G_VALUE_COLLECT_DOUBLE = 'd',
+ G_VALUE_COLLECT_POINTER = 'p'
+};
+
+
+/* vararg union holding actual values collected
+ */
+/**
+ * GTypeCValue:
+ * @v_int: the field for holding integer values
+ * @v_long: the field for holding long integer values
+ * @v_int64: the field for holding 64 bit integer values
+ * @v_double: the field for holding floating point values
+ * @v_pointer: the field for holding pointers
+ *
+ * A union holding one collected value.
+ */
+union _GTypeCValue
+{
+ gint v_int;
+ glong v_long;
+ gint64 v_int64;
+ gdouble v_double;
+ gpointer v_pointer;
+};
+
+/**
+ * G_VALUE_COLLECT_INIT:
+ * @value: a #GValue return location. @value must contain only 0 bytes.
+ * @_value_type: the #GType to use for @value.
+ * @var_args: the va_list variable; it may be evaluated multiple times
+ * @flags: flags which are passed on to the collect_value() function of
+ * the #GTypeValueTable of @value.
+ * @__error: a #gchar** variable that will be modified to hold a g_new()
+ * allocated error messages if something fails
+ *
+ * Collects a variable argument value from a va_list. We have to
+ * implement the varargs collection as a macro, because on some systems
+ * va_list variables cannot be passed by reference.
+ *
+ * Since: 2.24
+ */
+#define G_VALUE_COLLECT_INIT(value, _value_type, var_args, flags, __error) \
+G_STMT_START { \
+ GValue *g_vci_val = (value); \
+ guint g_vci_flags = (flags); \
+ GTypeValueTable *g_vci_vtab = g_type_value_table_peek (_value_type); \
+ const gchar *g_vci_collect_format = g_vci_vtab->collect_format; \
+ GTypeCValue g_vci_cvalues[G_VALUE_COLLECT_FORMAT_MAX_LENGTH] = { { 0, }, }; \
+ guint g_vci_n_values = 0; \
+ \
+ g_vci_val->g_type = _value_type; /* value_meminit() from gvalue.c */ \
+ while (*g_vci_collect_format) \
+ { \
+ GTypeCValue *g_vci_cvalue = g_vci_cvalues + g_vci_n_values++; \
+ \
+ switch (*g_vci_collect_format++) \
+ { \
+ case G_VALUE_COLLECT_INT: \
+ g_vci_cvalue->v_int = va_arg ((var_args), gint); \
+ break; \
+ case G_VALUE_COLLECT_LONG: \
+ g_vci_cvalue->v_long = va_arg ((var_args), glong); \
+ break; \
+ case G_VALUE_COLLECT_INT64: \
+ g_vci_cvalue->v_int64 = va_arg ((var_args), gint64); \
+ break; \
+ case G_VALUE_COLLECT_DOUBLE: \
+ g_vci_cvalue->v_double = va_arg ((var_args), gdouble); \
+ break; \
+ case G_VALUE_COLLECT_POINTER: \
+ g_vci_cvalue->v_pointer = va_arg ((var_args), gpointer); \
+ break; \
+ default: \
+ g_assert_not_reached (); \
+ } \
+ } \
+ *(__error) = g_vci_vtab->collect_value (g_vci_val, \
+ g_vci_n_values, \
+ g_vci_cvalues, \
+ g_vci_flags); \
+} G_STMT_END
+
+/**
+ * G_VALUE_COLLECT:
+ * @value: a #GValue return location. @value is supposed to be initialized
+ * according to the value type to be collected
+ * @var_args: the va_list variable; it may be evaluated multiple times
+ * @flags: flags which are passed on to the collect_value() function of
+ * the #GTypeValueTable of @value.
+ * @__error: a #gchar** variable that will be modified to hold a g_new()
+ * allocated error messages if something fails
+ *
+ * Collects a variable argument value from a va_list. We have to
+ * implement the varargs collection as a macro, because on some systems
+ * va_list variables cannot be passed by reference.
+ *
+ * Note: If you are creating the @value argument just before calling this macro,
+ * you should use the #G_VALUE_COLLECT_INIT variant and pass the unitialized
+ * #GValue. That variant is faster than #G_VALUE_COLLECT.
+ */
+#define G_VALUE_COLLECT(value, var_args, flags, __error) G_STMT_START { \
+ GValue *g_vc_value = (value); \
+ GType g_vc_value_type = G_VALUE_TYPE (g_vc_value); \
+ GTypeValueTable *g_vc_vtable = g_type_value_table_peek (g_vc_value_type); \
+ \
+ if (g_vc_vtable->value_free) \
+ g_vc_vtable->value_free (g_vc_value); \
+ memset (g_vc_value->data, 0, sizeof (g_vc_value->data)); \
+ \
+ G_VALUE_COLLECT_INIT(value, g_vc_value_type, var_args, flags, __error); \
+} G_STMT_END
+
+/**
+ * G_VALUE_COLLECT_SKIP:
+ * @_value_type: the #GType of the value to skip
+ * @var_args: the va_list variable; it may be evaluated multiple times
+ *
+ * Skip an argument of type @_value_type from @var_args.
+ */
+#define G_VALUE_COLLECT_SKIP(_value_type, var_args) \
+G_STMT_START { \
+ GTypeValueTable *g_vcs_vtable = g_type_value_table_peek (_value_type); \
+ const gchar *g_vcs_collect_format = g_vcs_vtable->collect_format; \
+ \
+ while (*g_vcs_collect_format) \
+ { \
+ switch (*g_vcs_collect_format++) \
+ { \
+ case G_VALUE_COLLECT_INT: \
+ va_arg ((var_args), gint); \
+ break; \
+ case G_VALUE_COLLECT_LONG: \
+ va_arg ((var_args), glong); \
+ break; \
+ case G_VALUE_COLLECT_INT64: \
+ va_arg ((var_args), gint64); \
+ break; \
+ case G_VALUE_COLLECT_DOUBLE: \
+ va_arg ((var_args), gdouble); \
+ break; \
+ case G_VALUE_COLLECT_POINTER: \
+ va_arg ((var_args), gpointer); \
+ break; \
+ default: \
+ g_assert_not_reached (); \
+ } \
+ } \
+} G_STMT_END
+
+/**
+ * G_VALUE_LCOPY:
+ * @value: a #GValue to store into the @var_args; this must be initialized
+ * and set
+ * @var_args: the va_list variable; it may be evaluated multiple times
+ * @flags: flags which are passed on to the lcopy_value() function of
+ * the #GTypeValueTable of @value.
+ * @__error: a #gchar** variable that will be modified to hold a g_new()
+ * allocated error message if something fails
+ *
+ * Stores a value’s value into one or more argument locations from a va_list.
+ * This is the inverse of G_VALUE_COLLECT().
+ */
+#define G_VALUE_LCOPY(value, var_args, flags, __error) \
+G_STMT_START { \
+ const GValue *g_vl_value = (value); \
+ guint g_vl_flags = (flags); \
+ GType g_vl_value_type = G_VALUE_TYPE (g_vl_value); \
+ GTypeValueTable *g_vl_vtable = g_type_value_table_peek (g_vl_value_type); \
+ const gchar *g_vl_lcopy_format = g_vl_vtable->lcopy_format; \
+ GTypeCValue g_vl_cvalues[G_VALUE_COLLECT_FORMAT_MAX_LENGTH] = { { 0, }, }; \
+ guint g_vl_n_values = 0; \
+ \
+ while (*g_vl_lcopy_format) \
+ { \
+ GTypeCValue *g_vl_cvalue = g_vl_cvalues + g_vl_n_values++; \
+ \
+ switch (*g_vl_lcopy_format++) \
+ { \
+ case G_VALUE_COLLECT_INT: \
+ g_vl_cvalue->v_int = va_arg ((var_args), gint); \
+ break; \
+ case G_VALUE_COLLECT_LONG: \
+ g_vl_cvalue->v_long = va_arg ((var_args), glong); \
+ break; \
+ case G_VALUE_COLLECT_INT64: \
+ g_vl_cvalue->v_int64 = va_arg ((var_args), gint64); \
+ break; \
+ case G_VALUE_COLLECT_DOUBLE: \
+ g_vl_cvalue->v_double = va_arg ((var_args), gdouble); \
+ break; \
+ case G_VALUE_COLLECT_POINTER: \
+ g_vl_cvalue->v_pointer = va_arg ((var_args), gpointer); \
+ break; \
+ default: \
+ g_assert_not_reached (); \
+ } \
+ } \
+ *(__error) = g_vl_vtable->lcopy_value (g_vl_value, \
+ g_vl_n_values, \
+ g_vl_cvalues, \
+ g_vl_flags); \
+} G_STMT_END
+
+
+/**
+ * G_VALUE_COLLECT_FORMAT_MAX_LENGTH:
+ *
+ * The maximal number of #GTypeCValues which can be collected for a
+ * single #GValue.
+ */
+#define G_VALUE_COLLECT_FORMAT_MAX_LENGTH (8)
+
+G_END_DECLS
+
+#endif /* __G_VALUE_COLLECTOR_H__ */
diff --git a/include/glib/gobject/gvaluetypes.h b/include/glib/gobject/gvaluetypes.h
new file mode 100644
index 0000000000..9274435329
--- /dev/null
+++ b/include/glib/gobject/gvaluetypes.h
@@ -0,0 +1,300 @@
+/* GObject - GLib Type, Object, Parameter and Signal Library
+ * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * gvaluetypes.h: GLib default values
+ */
+#ifndef __G_VALUETYPES_H__
+#define __G_VALUETYPES_H__
+
+#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
+#error "Only <glib-object.h> can be included directly."
+#endif
+
+#include <gobject/gvalue.h>
+
+G_BEGIN_DECLS
+
+/* --- type macros --- */
+/**
+ * G_VALUE_HOLDS_CHAR:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_CHAR.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_CHAR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR))
+/**
+ * G_VALUE_HOLDS_UCHAR:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_UCHAR.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_UCHAR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UCHAR))
+/**
+ * G_VALUE_HOLDS_BOOLEAN:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_BOOLEAN.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_BOOLEAN(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOOLEAN))
+/**
+ * G_VALUE_HOLDS_INT:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_INT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_INT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT))
+/**
+ * G_VALUE_HOLDS_UINT:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_UINT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_UINT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT))
+/**
+ * G_VALUE_HOLDS_LONG:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_LONG.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_LONG(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_LONG))
+/**
+ * G_VALUE_HOLDS_ULONG:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_ULONG.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_ULONG(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_ULONG))
+/**
+ * G_VALUE_HOLDS_INT64:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_INT64.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_INT64(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT64))
+/**
+ * G_VALUE_HOLDS_UINT64:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_UINT64.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_UINT64(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT64))
+/**
+ * G_VALUE_HOLDS_FLOAT:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_FLOAT.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_FLOAT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLOAT))
+/**
+ * G_VALUE_HOLDS_DOUBLE:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_DOUBLE.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_DOUBLE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_DOUBLE))
+/**
+ * G_VALUE_HOLDS_STRING:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_STRING.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_STRING(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_STRING))
+/**
+ * G_VALUE_HOLDS_POINTER:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_POINTER.
+ *
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_POINTER(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_POINTER))
+/**
+ * G_TYPE_GTYPE:
+ *
+ * The type for #GType.
+ */
+#define G_TYPE_GTYPE (g_gtype_get_type())
+/**
+ * G_VALUE_HOLDS_GTYPE:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_GTYPE.
+ *
+ * Since: 2.12
+ * Returns: %TRUE on success.
+ */
+#define G_VALUE_HOLDS_GTYPE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_GTYPE))
+/**
+ * G_VALUE_HOLDS_VARIANT:
+ * @value: a valid #GValue structure
+ *
+ * Checks whether the given #GValue can hold values of type %G_TYPE_VARIANT.
+ *
+ * Returns: %TRUE on success.
+ *
+ * Since: 2.26
+ */
+#define G_VALUE_HOLDS_VARIANT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_VARIANT))
+
+
+/* --- prototypes --- */
+GLIB_DEPRECATED_IN_2_32_FOR(g_value_set_schar)
+void g_value_set_char (GValue *value,
+ gchar v_char);
+GLIB_DEPRECATED_IN_2_32_FOR(g_value_get_schar)
+gchar g_value_get_char (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_schar (GValue *value,
+ gint8 v_char);
+GLIB_AVAILABLE_IN_ALL
+gint8 g_value_get_schar (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_uchar (GValue *value,
+ guchar v_uchar);
+GLIB_AVAILABLE_IN_ALL
+guchar g_value_get_uchar (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_boolean (GValue *value,
+ gboolean v_boolean);
+GLIB_AVAILABLE_IN_ALL
+gboolean g_value_get_boolean (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_int (GValue *value,
+ gint v_int);
+GLIB_AVAILABLE_IN_ALL
+gint g_value_get_int (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_uint (GValue *value,
+ guint v_uint);
+GLIB_AVAILABLE_IN_ALL
+guint g_value_get_uint (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_long (GValue *value,
+ glong v_long);
+GLIB_AVAILABLE_IN_ALL
+glong g_value_get_long (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_ulong (GValue *value,
+ gulong v_ulong);
+GLIB_AVAILABLE_IN_ALL
+gulong g_value_get_ulong (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_int64 (GValue *value,
+ gint64 v_int64);
+GLIB_AVAILABLE_IN_ALL
+gint64 g_value_get_int64 (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_uint64 (GValue *value,
+ guint64 v_uint64);
+GLIB_AVAILABLE_IN_ALL
+guint64 g_value_get_uint64 (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_float (GValue *value,
+ gfloat v_float);
+GLIB_AVAILABLE_IN_ALL
+gfloat g_value_get_float (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_double (GValue *value,
+ gdouble v_double);
+GLIB_AVAILABLE_IN_ALL
+gdouble g_value_get_double (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_string (GValue *value,
+ const gchar *v_string);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_static_string (GValue *value,
+ const gchar *v_string);
+GLIB_AVAILABLE_IN_ALL
+const gchar * g_value_get_string (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+gchar* g_value_dup_string (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_pointer (GValue *value,
+ gpointer v_pointer);
+GLIB_AVAILABLE_IN_ALL
+gpointer g_value_get_pointer (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+GType g_gtype_get_type (void);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_gtype (GValue *value,
+ GType v_gtype);
+GLIB_AVAILABLE_IN_ALL
+GType g_value_get_gtype (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+void g_value_set_variant (GValue *value,
+ GVariant *variant);
+GLIB_AVAILABLE_IN_ALL
+void g_value_take_variant (GValue *value,
+ GVariant *variant);
+GLIB_AVAILABLE_IN_ALL
+GVariant* g_value_get_variant (const GValue *value);
+GLIB_AVAILABLE_IN_ALL
+GVariant* g_value_dup_variant (const GValue *value);
+
+
+/* Convenience for registering new pointer types */
+GLIB_AVAILABLE_IN_ALL
+GType g_pointer_type_register_static (const gchar *name);
+
+/* debugging aid, describe value contents as string */
+GLIB_AVAILABLE_IN_ALL
+gchar* g_strdup_value_contents (const GValue *value);
+
+
+GLIB_AVAILABLE_IN_ALL
+void g_value_take_string (GValue *value,
+ gchar *v_string);
+GLIB_DEPRECATED_FOR(g_value_take_string)
+void g_value_set_string_take_ownership (GValue *value,
+ gchar *v_string);
+
+
+/* humpf, need a C representable type name for G_TYPE_STRING */
+/**
+ * gchararray:
+ *
+ * A C representable type name for #G_TYPE_STRING.
+ */
+typedef gchar* gchararray;
+
+
+G_END_DECLS
+
+#endif /* __G_VALUETYPES_H__ */
diff --git a/include/glib/msvc_recommended_pragmas.h b/include/glib/msvc_recommended_pragmas.h
new file mode 100644
index 0000000000..c0eb1d5edf
--- /dev/null
+++ b/include/glib/msvc_recommended_pragmas.h
@@ -0,0 +1,34 @@
+#ifndef _MSC_VER
+#pragma error "This header is for Microsoft VC only."
+#endif /* _MSC_VER */
+
+/* Make MSVC more pedantic, this is a recommended pragma list
+ * from _Win32_Programming_ by Rector and Newcomer.
+ */
+#pragma warning(error:4002) /* too many actual parameters for macro */
+#pragma warning(error:4003) /* not enough actual parameters for macro */
+#pragma warning(1:4010) /* single-line comment contains line-continuation character */
+#pragma warning(error:4013) /* 'function' undefined; assuming extern returning int */
+#pragma warning(1:4016) /* no function return type; using int as default */
+#pragma warning(error:4020) /* too many actual parameters */
+#pragma warning(error:4021) /* too few actual parameters */
+#pragma warning(error:4027) /* function declared without formal parameter list */
+#pragma warning(error:4029) /* declared formal parameter list different from definition */
+#pragma warning(error:4033) /* 'function' must return a value */
+#pragma warning(error:4035) /* 'function' : no return value */
+#pragma warning(error:4045) /* array bounds overflow */
+#pragma warning(error:4047) /* different levels of indirection */
+#pragma warning(error:4049) /* terminating line number emission */
+#pragma warning(error:4053) /* An expression of type void was used as an operand */
+#pragma warning(error:4071) /* no function prototype given */
+#pragma warning(disable:4101) /* unreferenced local variable */
+#pragma warning(error:4150)
+
+#pragma warning(disable:4244) /* No possible loss of data warnings */
+#pragma warning(disable:4305) /* No truncation from int to char warnings */
+
+#pragma warning(error:4819) /* The file contains a character that cannot be represented in the current code page */
+
+/* work around Microsoft's premature attempt to deprecate the C-Library */
+#define _CRT_SECURE_NO_WARNINGS
+#define _CRT_NONSTDC_NO_WARNINGS