Imported Upstream version 1.38.0
[platform/upstream/gobject-introspection.git] / gir / gio-2.0.c
1 /************************************************************/
2 /* THIS FILE IS GENERATED DO NOT EDIT */
3 /************************************************************/
4
5 /**
6  * GAction:enabled:
7  *
8  * If @action is currently enabled.
9  *
10  * If the action is disabled then calls to g_action_activate() and
11  * g_action_change_state() have no effect.
12  *
13  * Since: 2.28
14  */
15
16
17 /**
18  * GAction:name:
19  *
20  * The name of the action.  This is mostly meaningful for identifying
21  * the action once it has been added to a #GActionGroup.
22  *
23  * Since: 2.28
24  */
25
26
27 /**
28  * GAction:parameter-type:
29  *
30  * The type of the parameter that must be given when activating the
31  * action.
32  *
33  * Since: 2.28
34  */
35
36
37 /**
38  * GAction:state:
39  *
40  * The state of the action, or %NULL if the action is stateless.
41  *
42  * Since: 2.28
43  */
44
45
46 /**
47  * GAction:state-type:
48  *
49  * The #GVariantType of the state that the action has, or %NULL if the
50  * action is stateless.
51  *
52  * Since: 2.28
53  */
54
55
56 /**
57  * GActionEntry:
58  * @name: the name of the action
59  * @activate: the callback to connect to the "activate" signal of the action
60  * @parameter_type: the type of the parameter that must be passed to the activate function for this action, given as a single GVariant type string (or %NULL for no parameter)
61  * @state: the initial state for this action, given in GVariant text format.  The state is parsed with no extra type information, so type tags must be added to the string if they are necessary.
62  * @change_state: the callback to connect to the "change-state" signal of the action
63  *
64  * This struct defines a single action.  It is for use with
65  * g_action_map_add_action_entries().
66  *
67  * The order of the items in the structure are intended to reflect
68  * frequency of use.  It is permissible to use an incomplete initialiser
69  * in order to leave some of the later values as %NULL.  All values
70  * after @name are optional.  Additional optional fields may be added in
71  * the future.
72  *
73  * See g_action_map_add_action_entries() for an example.
74  */
75
76
77 /**
78  * GActionGroup::action-added:
79  * @action_group: the #GActionGroup that changed
80  * @action_name: the name of the action in @action_group
81  *
82  * Signals that a new action was just added to the group.
83  * This signal is emitted after the action has been added
84  * and is now visible.
85  *
86  * Since: 2.28
87  */
88
89
90 /**
91  * GActionGroup::action-enabled-changed:
92  * @action_group: the #GActionGroup that changed
93  * @action_name: the name of the action in @action_group
94  * @enabled: whether the action is enabled or not
95  *
96  * Signals that the enabled status of the named action has changed.
97  *
98  * Since: 2.28
99  */
100
101
102 /**
103  * GActionGroup::action-removed:
104  * @action_group: the #GActionGroup that changed
105  * @action_name: the name of the action in @action_group
106  *
107  * Signals that an action is just about to be removed from the group.
108  * This signal is emitted before the action is removed, so the action
109  * is still visible and can be queried from the signal handler.
110  *
111  * Since: 2.28
112  */
113
114
115 /**
116  * GActionGroup::action-state-changed:
117  * @action_group: the #GActionGroup that changed
118  * @action_name: the name of the action in @action_group
119  * @value: the new value of the state
120  *
121  * Signals that the state of the named action has changed.
122  *
123  * Since: 2.28
124  */
125
126
127 /**
128  * GActionGroupInterface:
129  * @has_action: the virtual function pointer for g_action_group_has_action()
130  * @list_actions: the virtual function pointer for g_action_group_list_actions()
131  * @get_action_parameter_type: the virtual function pointer for g_action_group_get_action_parameter_type()
132  * @get_action_state_type: the virtual function pointer for g_action_group_get_action_state_type()
133  * @get_action_state_hint: the virtual function pointer for g_action_group_get_action_state_hint()
134  * @get_action_enabled: the virtual function pointer for g_action_group_get_action_enabled()
135  * @get_action_state: the virtual function pointer for g_action_group_get_action_state()
136  * @change_action_state: the virtual function pointer for g_action_group_change_action_state()
137  * @query_action: the virtual function pointer for g_action_group_query_action()
138  * @activate_action: the virtual function pointer for g_action_group_activate_action()
139  * @action_added: the class closure for the #GActionGroup::action-added signal
140  * @action_removed: the class closure for the #GActionGroup::action-removed signal
141  * @action_enabled_changed: the class closure for the #GActionGroup::action-enabled-changed signal
142  * @action_state_changed: the class closure for the #GActionGroup::action-enabled-changed signal
143  *
144  * The virtual function table for #GActionGroup.
145  *
146  * Since: 2.28
147  */
148
149
150 /**
151  * GActionInterface:
152  * @get_name: the virtual function pointer for g_action_get_name()
153  * @get_parameter_type: the virtual function pointer for g_action_get_parameter_type()
154  * @get_state_type: the virtual function pointer for g_action_get_state_type()
155  * @get_state_hint: the virtual function pointer for g_action_get_state_hint()
156  * @get_enabled: the virtual function pointer for g_action_get_enabled()
157  * @get_state: the virtual function pointer for g_action_get_state()
158  * @change_state: the virtual function pointer for g_action_change_state()
159  * @activate: the virtual function pointer for g_action_activate().  Note that #GAction does not have an 'activate' signal but that implementations of it may have one.
160  *
161  * The virtual function table for #GAction.
162  *
163  * Since: 2.28
164  */
165
166
167 /**
168  * GActionMapInterface:
169  * @lookup_action: the virtual function pointer for g_action_map_lookup_action()
170  * @add_action: the virtual function pointer for g_action_map_add_action()
171  * @remove_action: the virtual function pointer for g_action_map_remove_action()
172  *
173  * The virtual function table for #GActionMap.
174  *
175  * Since: 2.32
176  */
177
178
179 /**
180  * GApplication::activate:
181  * @application: the application
182  *
183  * The ::activate signal is emitted on the primary instance when an
184  * activation occurs. See g_application_activate().
185  */
186
187
188 /**
189  * GApplication::command-line:
190  * @application: the application
191  * @command_line: a #GApplicationCommandLine representing the passed commandline
192  *
193  * The ::command-line signal is emitted on the primary instance when
194  * a commandline is not handled locally. See g_application_run() and
195  * the #GApplicationCommandLine documentation for more information.
196  *
197  * Returns: An integer that is set as the exit status for the calling process. See g_application_command_line_set_exit_status().
198  */
199
200
201 /**
202  * GApplication::open:
203  * @application: the application
204  * @files: (array length=n_files) (element-type GFile): an array of #GFiles
205  * @n_files: the length of @files
206  * @hint: a hint provided by the calling instance
207  *
208  * The ::open signal is emitted on the primary instance when there are
209  * files to open. See g_application_open() for more information.
210  */
211
212
213 /**
214  * GApplication::shutdown:
215  * @application: the application
216  *
217  * The ::shutdown signal is emitted only on the registered primary instance
218  * immediately after the main loop terminates.
219  */
220
221
222 /**
223  * GApplication::startup:
224  * @application: the application
225  *
226  * The ::startup signal is emitted on the primary instance immediately
227  * after registration. See g_application_register().
228  */
229
230
231 /**
232  * GApplicationClass:
233  * @startup: invoked on the primary instance immediately after registration
234  * @shutdown: invoked only on the registered primary instance immediately after the main loop terminates
235  * @activate: invoked on the primary instance when an activation occurs
236  * @open: invoked on the primary instance when there are files to open
237  * @command_line: invoked on the primary instance when a command-line is not handled locally
238  * @local_command_line: invoked (locally) when the process has been invoked via commandline execution (as opposed to, say, D-Bus activation - which is not currently supported by GApplication). The virtual function has the chance to inspect (and possibly replace) the list of command line arguments. See g_application_run() for more information.
239  * @before_emit: invoked on the primary instance before 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
240  * @after_emit: invoked on the primary instance after 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
241  * @add_platform_data: invoked (locally) to add 'platform data' to be sent to the primary instance when activating, opening or invoking actions
242  * @quit_mainloop: Used to be invoked on the primary instance when the use count of the application drops to zero (and after any inactivity timeout, if requested). Not used anymore since 2.32
243  * @run_mainloop: Used to be invoked on the primary instance from g_application_run() if the use-count is non-zero. Since 2.32, GApplication is iterating the main context directly and is not using @run_mainloop anymore
244  * @dbus_register: invoked locally during registration, if the application is using its D-Bus backend. You can use this to export extra objects on the bus, that need to exist before the application tries to own the bus name. The function is passed the #GDBusConnection to to session bus, and the object path that #GApplication will use to export is D-Bus API. If this function returns %TRUE, registration will proceed; otherwise registration will abort. Since: 2.34
245  * @dbus_unregister: invoked locally during unregistration, if the application is using its D-Bus backend. Use this to undo anything done by the @dbus_register vfunc. Since: 2.34
246  *
247  * Virtual function table for #GApplication.
248  *
249  * Since: 2.28
250  */
251
252
253 /**
254  * GApplicationCommandLineClass:
255  *
256  * The <structname>GApplicationCommandLineClass</structname> structure
257  * contains private data only
258  *
259  * Since: 2.28
260  */
261
262
263 /**
264  * GBytesIcon:bytes:
265  *
266  * The bytes containing the icon.
267  */
268
269
270 /**
271  * GCancellable::cancelled:
272  * @cancellable: a #GCancellable.
273  *
274  * Emitted when the operation has been cancelled.
275  *
276  * Can be used by implementations of cancellable operations. If the
277  * operation is cancelled from another thread, the signal will be
278  * emitted in the thread that cancelled the operation, not the
279  * thread that is running the operation.
280  *
281  * Note that disconnecting from this signal (or any signal) in a
282  * multi-threaded program is prone to race conditions. For instance
283  * it is possible that a signal handler may be invoked even
284  * <emphasis>after</emphasis> a call to
285  * g_signal_handler_disconnect() for that handler has already
286  * returned.
287  *
288  * There is also a problem when cancellation happen
289  * right before connecting to the signal. If this happens the
290  * signal will unexpectedly not be emitted, and checking before
291  * connecting to the signal leaves a race condition where this is
292  * still happening.
293  *
294  * In order to make it safe and easy to connect handlers there
295  * are two helper functions: g_cancellable_connect() and
296  * g_cancellable_disconnect() which protect against problems
297  * like this.
298  *
299  * An example of how to us this:
300  * |[
301  *     /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
302  *     if (g_cancellable_set_error_if_cancelled (cancellable))
303  *       return;
304  *
305  *     /<!-- -->* Set up all the data needed to be able to
306  *      * handle cancellation of the operation *<!-- -->/
307  *     my_data = my_data_new (...);
308  *
309  *     id = 0;
310  *     if (cancellable)
311  *       id = g_cancellable_connect (cancellable,
312  *                            G_CALLBACK (cancelled_handler)
313  *                            data, NULL);
314  *
315  *     /<!-- -->* cancellable operation here... *<!-- -->/
316  *
317  *     g_cancellable_disconnect (cancellable, id);
318  *
319  *     /<!-- -->* cancelled_handler is never called after this, it
320  *      * is now safe to free the data *<!-- -->/
321  *     my_data_free (my_data);
322  * ]|
323  *
324  * Note that the cancelled signal is emitted in the thread that
325  * the user cancelled from, which may be the main thread. So, the
326  * cancellable signal should not do something that can block.
327  */
328
329
330 /**
331  * GCharsetConverter:
332  *
333  * Conversions between character sets.
334  */
335
336
337 /**
338  * GCredentials:
339  *
340  * The #GCredentials structure contains only private data and
341  * should only be accessed using the provided API.
342  *
343  * Since: 2.26
344  */
345
346
347 /**
348  * GCredentialsClass:
349  *
350  * Class structure for #GCredentials.
351  *
352  * Since: 2.26
353  */
354
355
356 /**
357  * GDBusAuthMechanism:credentials:
358  *
359  * If authenticating as a server, this property contains the
360  * received credentials, if any.
361  *
362  * If authenticating as a client, the property contains the
363  * credentials that were sent, if any.
364  */
365
366
367 /**
368  * GDBusAuthObserver:
369  *
370  * The #GDBusAuthObserver structure contains only private data and
371  * should only be accessed using the provided API.
372  *
373  * Since: 2.26
374  */
375
376
377 /**
378  * GDBusAuthObserver::allow-mechanism:
379  * @observer: The #GDBusAuthObserver emitting the signal.
380  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
381  *
382  * Emitted to check if @mechanism is allowed to be used.
383  *
384  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
385  * Since: 2.34
386  */
387
388
389 /**
390  * GDBusAuthObserver::authorize-authenticated-peer:
391  * @observer: The #GDBusAuthObserver emitting the signal.
392  * @stream: A #GIOStream for the #GDBusConnection.
393  * @credentials: (allow-none): Credentials received from the peer or %NULL.
394  *
395  * Emitted to check if a peer that is successfully authenticated
396  * is authorized.
397  *
398  * Returns: %TRUE if the peer is authorized, %FALSE if not.
399  * Since: 2.26
400  */
401
402
403 /**
404  * GDBusAuthObserverClass:
405  * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
406  *
407  * Class structure for #GDBusAuthObserverClass.
408  *
409  * Since: 2.26
410  */
411
412
413 /**
414  * GDBusConnection:
415  *
416  * The #GDBusConnection structure contains only private data and
417  * should only be accessed using the provided API.
418  *
419  * Since: 2.26
420  */
421
422
423 /**
424  * GDBusConnection::closed:
425  * @connection: The #GDBusConnection emitting the signal.
426  * @remote_peer_vanished: %TRUE if @connection is closed because the remote peer closed its end of the connection.
427  * @error: (allow-none): A #GError with more details about the event or %NULL.
428  *
429  * Emitted when the connection is closed.
430  *
431  * The cause of this event can be
432  * <itemizedlist>
433  * <listitem><para>
434  *    If g_dbus_connection_close() is called. In this case
435  *    @remote_peer_vanished is set to %FALSE and @error is %NULL.
436  * </para></listitem>
437  * <listitem><para>
438  *    If the remote peer closes the connection. In this case
439  *    @remote_peer_vanished is set to %TRUE and @error is set.
440  * </para></listitem>
441  * <listitem><para>
442  *    If the remote peer sends invalid or malformed data. In this
443  *    case @remote_peer_vanished is set to %FALSE and @error
444  *    is set.
445  * </para></listitem>
446  * </itemizedlist>
447  *
448  * Upon receiving this signal, you should give up your reference to
449  * @connection. You are guaranteed that this signal is emitted only
450  * once.
451  *
452  * Since: 2.26
453  */
454
455
456 /**
457  * GDBusConnection:address:
458  *
459  * A D-Bus address specifying potential endpoints that can be used
460  * when establishing the connection.
461  *
462  * Since: 2.26
463  */
464
465
466 /**
467  * GDBusConnection:authentication-observer:
468  *
469  * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
470  *
471  * Since: 2.26
472  */
473
474
475 /**
476  * GDBusConnection:capabilities:
477  *
478  * Flags from the #GDBusCapabilityFlags enumeration
479  * representing connection features negotiated with the other peer.
480  *
481  * Since: 2.26
482  */
483
484
485 /**
486  * GDBusConnection:closed:
487  *
488  * A boolean specifying whether the connection has been closed.
489  *
490  * Since: 2.26
491  */
492
493
494 /**
495  * GDBusConnection:exit-on-close:
496  *
497  * A boolean specifying whether the process will be terminated (by
498  * calling <literal>raise(SIGTERM)</literal>) if the connection
499  * is closed by the remote peer.
500  *
501  * Note that #GDBusConnection objects returned by g_bus_get_finish() and
502  * g_bus_get_sync() will (usually) have this property set to %TRUE.
503  *
504  * Since: 2.26
505  */
506
507
508 /**
509  * GDBusConnection:flags:
510  *
511  * Flags from the #GDBusConnectionFlags enumeration.
512  *
513  * Since: 2.26
514  */
515
516
517 /**
518  * GDBusConnection:guid:
519  *
520  * The GUID of the peer performing the role of server when
521  * authenticating.
522  *
523  * If you are constructing a #GDBusConnection and pass
524  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the
525  * #GDBusConnection:flags property then you MUST also set this
526  * property to a valid guid.
527  *
528  * If you are constructing a #GDBusConnection and pass
529  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the
530  * #GDBusConnection:flags property you will be able to read the GUID
531  * of the other peer here after the connection has been successfully
532  * initialized.
533  *
534  * Since: 2.26
535  */
536
537
538 /**
539  * GDBusConnection:locked:
540  *
541  * A boolean specifying whether the message is locked.
542  *
543  * Since: 2.26
544  */
545
546
547 /**
548  * GDBusConnection:stream:
549  *
550  * The underlying #GIOStream used for I/O.
551  *
552  * If this is passed on construction and is a #GSocketConnection,
553  * then the corresponding #GSocket will be put into non-blocking mode.
554  *
555  * While the #GDBusConnection is active, it will interact with this
556  * stream from a worker thread, so it is not safe to interact with
557  * the stream directly.
558  *
559  * Since: 2.26
560  */
561
562
563 /**
564  * GDBusConnection:unique-name:
565  *
566  * The unique name as assigned by the message bus or %NULL if the
567  * connection is not open or not a message bus connection.
568  *
569  * Since: 2.26
570  */
571
572
573 /**
574  * GDBusConnectionClass:
575  * @closed: Signal class handler for the #GDBusConnection::closed signal.
576  *
577  * Class structure for #GDBusConnection.
578  *
579  * Since: 2.26
580  */
581
582
583 /**
584  * GDBusInterfaceSkeleton::g-authorize-method:
585  * @interface: The #GDBusInterfaceSkeleton emitting the signal.
586  * @invocation: A #GDBusMethodInvocation.
587  *
588  * Emitted when a method is invoked by a remote caller and used to
589  * determine if the method call is authorized.
590  *
591  * Note that this signal is emitted in a thread dedicated to
592  * handling the method call so handlers are allowed to perform
593  * blocking IO. This means that it is appropriate to call
594  * e.g. <ulink
595  * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
596  * with the <ulink
597  * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#POLKIT-CHECK-AUTHORIZATION-FLAGS-ALLOW-USER-INTERACTION:CAPS">POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION</ulink> flag set.
598  *
599  * If %FALSE is returned then no further handlers are run and the
600  * signal handler must take a reference to @invocation and finish
601  * handling the call (e.g. return an error via
602  * g_dbus_method_invocation_return_error()).
603  *
604  * Otherwise, if %TRUE is returned, signal emission continues. If no
605  * handlers return %FALSE, then the method is dispatched. If
606  * @interface has an enclosing #GDBusObjectSkeleton, then the
607  * #GDBusObjectSkeleton::authorize-method signal handlers run before
608  * the handlers for this signal.
609  *
610  * The default class handler just returns %TRUE.
611  *
612  * Please note that the common case is optimized: if no signals
613  * handlers are connected and the default class handler isn't
614  * overridden (for both @interface and the enclosing
615  * #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
616  * not have the
617  * %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
618  * flags set, no dedicated thread is ever used and the call will be
619  * handled in the same thread as the object that @interface belongs
620  * to was exported in.
621  *
622  * Returns: %TRUE if the call is authorized, %FALSE otherwise.
623  * Since: 2.30
624  */
625
626
627 /**
628  * GDBusInterfaceSkeleton:g-flags:
629  *
630  * Flags from the #GDBusInterfaceSkeletonFlags enumeration.
631  *
632  * Since: 2.30
633  */
634
635
636 /**
637  * GDBusMessage:
638  *
639  * The #GDBusMessage structure contains only private data and should
640  * only be accessed using the provided API.
641  *
642  * Since: 2.26
643  */
644
645
646 /**
647  * GDBusMessageClass:
648  *
649  * Class structure for #GDBusMessage.
650  *
651  * Since: 2.26
652  */
653
654
655 /**
656  * GDBusMethodInvocation:
657  *
658  * The #GDBusMethodInvocation structure contains only private data and
659  * should only be accessed using the provided API.
660  *
661  * Since: 2.26
662  */
663
664
665 /**
666  * GDBusMethodInvocationClass:
667  *
668  * Class structure for #GDBusMethodInvocation.
669  *
670  * Since: 2.26
671  */
672
673
674 /**
675  * GDBusObject::interface-added:
676  * @object: The #GDBusObject emitting the signal.
677  * @interface: The #GDBusInterface that was added.
678  *
679  * Emitted when @interface is added to @object.
680  *
681  * Since: 2.30
682  */
683
684
685 /**
686  * GDBusObject::interface-removed:
687  * @object: The #GDBusObject emitting the signal.
688  * @interface: The #GDBusInterface that was removed.
689  *
690  * Emitted when @interface is removed from @object.
691  *
692  * Since: 2.30
693  */
694
695
696 /**
697  * GDBusObjectManager::interface-added:
698  * @manager: The #GDBusObjectManager emitting the signal.
699  * @object: The #GDBusObject on which an interface was added.
700  * @interface: The #GDBusInterface that was added.
701  *
702  * Emitted when @interface is added to @object.
703  *
704  * This signal exists purely as a convenience to avoid having to
705  * connect signals to all objects managed by @manager.
706  *
707  * Since: 2.30
708  */
709
710
711 /**
712  * GDBusObjectManager::interface-removed:
713  * @manager: The #GDBusObjectManager emitting the signal.
714  * @object: The #GDBusObject on which an interface was removed.
715  * @interface: The #GDBusInterface that was removed.
716  *
717  * Emitted when @interface has been removed from @object.
718  *
719  * This signal exists purely as a convenience to avoid having to
720  * connect signals to all objects managed by @manager.
721  *
722  * Since: 2.30
723  */
724
725
726 /**
727  * GDBusObjectManager::object-added:
728  * @manager: The #GDBusObjectManager emitting the signal.
729  * @object: The #GDBusObject that was added.
730  *
731  * Emitted when @object is added to @manager.
732  *
733  * Since: 2.30
734  */
735
736
737 /**
738  * GDBusObjectManager::object-removed:
739  * @manager: The #GDBusObjectManager emitting the signal.
740  * @object: The #GDBusObject that was removed.
741  *
742  * Emitted when @object is removed from @manager.
743  *
744  * Since: 2.30
745  */
746
747
748 /**
749  * GDBusObjectManagerClient::interface-proxy-properties-changed:
750  * @manager: The #GDBusObjectManagerClient emitting the signal.
751  * @object_proxy: The #GDBusObjectProxy on which an interface has properties that are changing.
752  * @interface_proxy: The #GDBusProxy that has properties that are changing.
753  * @changed_properties: A #GVariant containing the properties that changed.
754  * @invalidated_properties: A %NULL terminated array of properties that was invalidated.
755  *
756  * Emitted when one or more D-Bus properties on proxy changes. The
757  * local cache has already been updated when this signal fires. Note
758  * that both @changed_properties and @invalidated_properties are
759  * guaranteed to never be %NULL (either may be empty though).
760  *
761  * This signal exists purely as a convenience to avoid having to
762  * connect signals to all interface proxies managed by @manager.
763  *
764  * This signal is emitted in the
765  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
766  * that @manager was constructed in.
767  *
768  * Since: 2.30
769  */
770
771
772 /**
773  * GDBusObjectManagerClient::interface-proxy-signal:
774  * @manager: The #GDBusObjectManagerClient emitting the signal.
775  * @object_proxy: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
776  * @interface_proxy: The #GDBusProxy that is emitting a D-Bus signal.
777  * @sender_name: The sender of the signal or NULL if the connection is not a bus connection.
778  * @signal_name: The signal name.
779  * @parameters: A #GVariant tuple with parameters for the signal.
780  *
781  * Emitted when a D-Bus signal is received on @interface_proxy.
782  *
783  * This signal exists purely as a convenience to avoid having to
784  * connect signals to all interface proxies managed by @manager.
785  *
786  * This signal is emitted in the
787  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
788  * that @manager was constructed in.
789  *
790  * Since: 2.30
791  */
792
793
794 /**
795  * GDBusObjectManagerClient:bus-type:
796  *
797  * If this property is not %G_BUS_TYPE_NONE, then
798  * #GDBusObjectManagerClient:connection must be %NULL and will be set to the
799  * #GDBusConnection obtained by calling g_bus_get() with the value
800  * of this property.
801  *
802  * Since: 2.30
803  */
804
805
806 /**
807  * GDBusObjectManagerClient:connection:
808  *
809  * The #GDBusConnection to use.
810  *
811  * Since: 2.30
812  */
813
814
815 /**
816  * GDBusObjectManagerClient:flags:
817  *
818  * Flags from the #GDBusObjectManagerClientFlags enumeration.
819  *
820  * Since: 2.30
821  */
822
823
824 /**
825  * GDBusObjectManagerClient:get-proxy-type-destroy-notify:
826  *
827  * A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data.
828  *
829  * Since: 2.30
830  */
831
832
833 /**
834  * GDBusObjectManagerClient:get-proxy-type-func:
835  *
836  * The #GDBusProxyTypeFunc to use when determining what #GType to
837  * use for interface proxies or %NULL.
838  *
839  * Since: 2.30
840  */
841
842
843 /**
844  * GDBusObjectManagerClient:get-proxy-type-user-data:
845  *
846  * The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func.
847  *
848  * Since: 2.30
849  */
850
851
852 /**
853  * GDBusObjectManagerClient:name:
854  *
855  * The well-known name or unique name that the manager is for.
856  *
857  * Since: 2.30
858  */
859
860
861 /**
862  * GDBusObjectManagerClient:name-owner:
863  *
864  * The unique name that owns #GDBusObjectManagerClient:name or %NULL if
865  * no-one is currently owning the name. Connect to the
866  * #GObject::notify signal to track changes to this property.
867  *
868  * Since: 2.30
869  */
870
871
872 /**
873  * GDBusObjectManagerClient:object-path:
874  *
875  * The object path the manager is for.
876  *
877  * Since: 2.30
878  */
879
880
881 /**
882  * GDBusObjectManagerServer:connection:
883  *
884  * The #GDBusConnection to export objects on.
885  *
886  * Since: 2.30
887  */
888
889
890 /**
891  * GDBusObjectManagerServer:object-path:
892  *
893  * The object path to register the manager object at.
894  *
895  * Since: 2.30
896  */
897
898
899 /**
900  * GDBusObjectProxy:g-connection:
901  *
902  * The connection of the proxy.
903  *
904  * Since: 2.30
905  */
906
907
908 /**
909  * GDBusObjectProxy:g-object-path:
910  *
911  * The object path of the proxy.
912  *
913  * Since: 2.30
914  */
915
916
917 /**
918  * GDBusObjectSkeleton::authorize-method:
919  * @object: The #GDBusObjectSkeleton emitting the signal.
920  * @interface: The #GDBusInterfaceSkeleton that @invocation is for.
921  * @invocation: A #GDBusMethodInvocation.
922  *
923  * Emitted when a method is invoked by a remote caller and used to
924  * determine if the method call is authorized.
925  *
926  * This signal is like #GDBusInterfaceSkeleton<!-- -->'s
927  * #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
928  * for the enclosing object.
929  *
930  * The default class handler just returns %TRUE.
931  *
932  * Returns: %TRUE if the call is authorized, %FALSE otherwise.
933  * Since: 2.30
934  */
935
936
937 /**
938  * GDBusObjectSkeleton:g-object-path:
939  *
940  * The object path where the object is exported.
941  *
942  * Since: 2.30
943  */
944
945
946 /**
947  * GDBusProxy::g-properties-changed:
948  * @proxy: The #GDBusProxy emitting the signal.
949  * @changed_properties: A #GVariant containing the properties that changed
950  * @invalidated_properties: A %NULL terminated array of properties that was invalidated
951  *
952  * Emitted when one or more D-Bus properties on @proxy changes. The
953  * local cache has already been updated when this signal fires. Note
954  * that both @changed_properties and @invalidated_properties are
955  * guaranteed to never be %NULL (either may be empty though).
956  *
957  * If the proxy has the flag
958  * %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
959  * @invalidated_properties will always be empty.
960  *
961  * This signal corresponds to the
962  * <literal>PropertiesChanged</literal> D-Bus signal on the
963  * <literal>org.freedesktop.DBus.Properties</literal> interface.
964  *
965  * Since: 2.26
966  */
967
968
969 /**
970  * GDBusProxy::g-signal:
971  * @proxy: The #GDBusProxy emitting the signal.
972  * @sender_name: (allow-none): The sender of the signal or %NULL if the connection is not a bus connection.
973  * @signal_name: The name of the signal.
974  * @parameters: A #GVariant tuple with parameters for the signal.
975  *
976  * Emitted when a signal from the remote object and interface that @proxy is for, has been received.
977  *
978  * Since: 2.26
979  */
980
981
982 /**
983  * GDBusProxy:g-bus-type:
984  *
985  * If this property is not %G_BUS_TYPE_NONE, then
986  * #GDBusProxy:g-connection must be %NULL and will be set to the
987  * #GDBusConnection obtained by calling g_bus_get() with the value
988  * of this property.
989  *
990  * Since: 2.26
991  */
992
993
994 /**
995  * GDBusProxy:g-connection:
996  *
997  * The #GDBusConnection the proxy is for.
998  *
999  * Since: 2.26
1000  */
1001
1002
1003 /**
1004  * GDBusProxy:g-default-timeout:
1005  *
1006  * The timeout to use if -1 (specifying default timeout) is passed
1007  * as @timeout_msec in the g_dbus_proxy_call() and
1008  * g_dbus_proxy_call_sync() functions.
1009  *
1010  * This allows applications to set a proxy-wide timeout for all
1011  * remote method invocations on the proxy. If this property is -1,
1012  * the default timeout (typically 25 seconds) is used. If set to
1013  * %G_MAXINT, then no timeout is used.
1014  *
1015  * Since: 2.26
1016  */
1017
1018
1019 /**
1020  * GDBusProxy:g-flags:
1021  *
1022  * Flags from the #GDBusProxyFlags enumeration.
1023  *
1024  * Since: 2.26
1025  */
1026
1027
1028 /**
1029  * GDBusProxy:g-interface-info:
1030  *
1031  * Ensure that interactions with this proxy conform to the given
1032  * interface. This is mainly to ensure that malformed data received
1033  * from the other peer is ignored. The given #GDBusInterfaceInfo is
1034  * said to be the <emphasis>expected interface</emphasis>.
1035  *
1036  * The checks performed are:
1037  * <itemizedlist>
1038  *   <listitem><para>
1039  *     When completing a method call, if the type signature of
1040  *     the reply message isn't what's expected, the reply is
1041  *     discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
1042  *   </para></listitem>
1043  *   <listitem><para>
1044  *     Received signals that have a type signature mismatch are dropped and
1045  *     a warning is logged via g_warning().
1046  *   </para></listitem>
1047  *   <listitem><para>
1048  *     Properties received via the initial <literal>GetAll()</literal> call
1049  *     or via the <literal>::PropertiesChanged</literal> signal (on the
1050  *     <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.DBus.Properties</ulink> interface) or
1051  *     set using g_dbus_proxy_set_cached_property() with a type signature
1052  *     mismatch are ignored and a warning is logged via g_warning().
1053  *   </para></listitem>
1054  * </itemizedlist>
1055  * Note that these checks are never done on methods, signals and
1056  * properties that are not referenced in the given
1057  * #GDBusInterfaceInfo, since extending a D-Bus interface on the
1058  * service-side is not considered an ABI break.
1059  *
1060  * Since: 2.26
1061  */
1062
1063
1064 /**
1065  * GDBusProxy:g-interface-name:
1066  *
1067  * The D-Bus interface name the proxy is for.
1068  *
1069  * Since: 2.26
1070  */
1071
1072
1073 /**
1074  * GDBusProxy:g-name:
1075  *
1076  * The well-known or unique name that the proxy is for.
1077  *
1078  * Since: 2.26
1079  */
1080
1081
1082 /**
1083  * GDBusProxy:g-name-owner:
1084  *
1085  * The unique name that owns #GDBusProxy:g-name or %NULL if no-one
1086  * currently owns that name. You may connect to #GObject::notify signal to
1087  * track changes to this property.
1088  *
1089  * Since: 2.26
1090  */
1091
1092
1093 /**
1094  * GDBusProxy:g-object-path:
1095  *
1096  * The object path the proxy is for.
1097  *
1098  * Since: 2.26
1099  */
1100
1101
1102 /**
1103  * GDBusServer:
1104  *
1105  * The #GDBusServer structure contains only private data and
1106  * should only be accessed using the provided API.
1107  *
1108  * Since: 2.26
1109  */
1110
1111
1112 /**
1113  * GDBusServer::new-connection:
1114  * @server: The #GDBusServer emitting the signal.
1115  * @connection: A #GDBusConnection for the new connection.
1116  *
1117  * Emitted when a new authenticated connection has been made. Use
1118  * g_dbus_connection_get_peer_credentials() to figure out what
1119  * identity (if any), was authenticated.
1120  *
1121  * If you want to accept the connection, take a reference to the
1122  * @connection object and return %TRUE. When you are done with the
1123  * connection call g_dbus_connection_close() and give up your
1124  * reference. Note that the other peer may disconnect at any time -
1125  * a typical thing to do when accepting a connection is to listen to
1126  * the #GDBusConnection::closed signal.
1127  *
1128  * If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
1129  * then the signal is emitted in a new thread dedicated to the
1130  * connection. Otherwise the signal is emitted in the <link
1131  * linkend="g-main-context-push-thread-default">thread-default main
1132  * loop</link> of the thread that @server was constructed in.
1133  *
1134  * You are guaranteed that signal handlers for this signal runs
1135  * before incoming messages on @connection are processed. This means
1136  * that it's suitable to call g_dbus_connection_register_object() or
1137  * similar from the signal handler.
1138  *
1139  * Returns: %TRUE to claim @connection, %FALSE to let other handlers run.
1140  * Since: 2.26
1141  */
1142
1143
1144 /**
1145  * GDBusServer:active:
1146  *
1147  * Whether the server is currently active.
1148  *
1149  * Since: 2.26
1150  */
1151
1152
1153 /**
1154  * GDBusServer:address:
1155  *
1156  * The D-Bus address to listen on.
1157  *
1158  * Since: 2.26
1159  */
1160
1161
1162 /**
1163  * GDBusServer:authentication-observer:
1164  *
1165  * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
1166  *
1167  * Since: 2.26
1168  */
1169
1170
1171 /**
1172  * GDBusServer:client-address:
1173  *
1174  * The D-Bus address that clients can use.
1175  *
1176  * Since: 2.26
1177  */
1178
1179
1180 /**
1181  * GDBusServer:flags:
1182  *
1183  * Flags from the #GDBusServerFlags enumeration.
1184  *
1185  * Since: 2.26
1186  */
1187
1188
1189 /**
1190  * GDBusServer:guid:
1191  *
1192  * The guid of the server.
1193  *
1194  * Since: 2.26
1195  */
1196
1197
1198 /**
1199  * GDBusServerClass:
1200  * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
1201  *
1202  * Class structure for #GDBusServer.
1203  *
1204  * Since: 2.26
1205  */
1206
1207
1208 /**
1209  * GDataOutputStream:byte-order:
1210  *
1211  * Determines the byte ordering that is used when writing
1212  * multi-byte entities (such as integers) to the stream.
1213  */
1214
1215
1216 /**
1217  * GDataStream:byte-order:
1218  *
1219  * The ::byte-order property determines the byte ordering that
1220  * is used when reading multi-byte entities (such as integers)
1221  * from the stream.
1222  */
1223
1224
1225 /**
1226  * GDataStream:newline-type:
1227  *
1228  * The :newline-type property determines what is considered
1229  * as a line ending when reading complete lines from the stream.
1230  */
1231
1232
1233 /**
1234  * GDesktopAppInfo:
1235  *
1236  * Information about an installed application from a desktop file.
1237  */
1238
1239
1240 /**
1241  * GDesktopAppInfo:filename:
1242  *
1243  * The origin filename of this #GDesktopAppInfo
1244  */
1245
1246
1247 /**
1248  * GDrive::changed:
1249  * @drive: a #GDrive.
1250  *
1251  * Emitted when the drive's state has changed.
1252  */
1253
1254
1255 /**
1256  * GDrive::disconnected:
1257  * @drive: a #GDrive.
1258  *
1259  * This signal is emitted when the #GDrive have been
1260  * disconnected. If the recipient is holding references to the
1261  * object they should release them so the object can be
1262  * finalized.
1263  */
1264
1265
1266 /**
1267  * GDrive::eject-button:
1268  * @drive: a #GDrive.
1269  *
1270  * Emitted when the physical eject button (if any) of a drive has
1271  * been pressed.
1272  */
1273
1274
1275 /**
1276  * GDrive::stop-button:
1277  * @drive: a #GDrive.
1278  *
1279  * Emitted when the physical stop button (if any) of a drive has
1280  * been pressed.
1281  *
1282  * Since: 2.22
1283  */
1284
1285
1286 /**
1287  * GFileIcon:file:
1288  *
1289  * The file containing the icon.
1290  */
1291
1292
1293 /**
1294  * GFileMonitor::changed:
1295  * @monitor: a #GFileMonitor.
1296  * @file: a #GFile.
1297  * @other_file: (allow-none): a #GFile or #NULL.
1298  * @event_type: a #GFileMonitorEvent.
1299  *
1300  * Emitted when @file has been changed.
1301  *
1302  * If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
1303  * #G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the
1304  * old path, and @other_file will be set to a #GFile containing the new path.
1305  *
1306  * In all the other cases, @other_file will be set to #NULL.
1307  */
1308
1309
1310 /**
1311  * GFilenameCompleter::got-completion-data:
1312  *
1313  * Emitted when the file name completion information comes available.
1314  */
1315
1316
1317 /**
1318  * GIOModuleScope:
1319  *
1320  * Represents a scope for loading IO modules. A scope can be used for blocking
1321  * duplicate modules, or blocking a module you don't want to load.
1322  *
1323  * The scope can be used with g_io_modules_load_all_in_directory_with_scope()
1324  * or g_io_modules_scan_all_in_directory_with_scope().
1325  *
1326  * Since: 2.30
1327  */
1328
1329
1330 /**
1331  * GInetAddress:
1332  *
1333  * An IPv4 or IPv6 internet address.
1334  */
1335
1336
1337 /**
1338  * GInetAddress:is-any:
1339  *
1340  * Whether this is the "any" address for its family.
1341  * See g_inet_address_get_is_any().
1342  *
1343  * Since: 2.22
1344  */
1345
1346
1347 /**
1348  * GInetAddress:is-link-local:
1349  *
1350  * Whether this is a link-local address.
1351  * See g_inet_address_get_is_link_local().
1352  *
1353  * Since: 2.22
1354  */
1355
1356
1357 /**
1358  * GInetAddress:is-loopback:
1359  *
1360  * Whether this is the loopback address for its family.
1361  * See g_inet_address_get_is_loopback().
1362  *
1363  * Since: 2.22
1364  */
1365
1366
1367 /**
1368  * GInetAddress:is-mc-global:
1369  *
1370  * Whether this is a global multicast address.
1371  * See g_inet_address_get_is_mc_global().
1372  *
1373  * Since: 2.22
1374  */
1375
1376
1377 /**
1378  * GInetAddress:is-mc-link-local:
1379  *
1380  * Whether this is a link-local multicast address.
1381  * See g_inet_address_get_is_mc_link_local().
1382  *
1383  * Since: 2.22
1384  */
1385
1386
1387 /**
1388  * GInetAddress:is-mc-node-local:
1389  *
1390  * Whether this is a node-local multicast address.
1391  * See g_inet_address_get_is_mc_node_local().
1392  *
1393  * Since: 2.22
1394  */
1395
1396
1397 /**
1398  * GInetAddress:is-mc-org-local:
1399  *
1400  * Whether this is an organization-local multicast address.
1401  * See g_inet_address_get_is_mc_org_local().
1402  *
1403  * Since: 2.22
1404  */
1405
1406
1407 /**
1408  * GInetAddress:is-mc-site-local:
1409  *
1410  * Whether this is a site-local multicast address.
1411  * See g_inet_address_get_is_mc_site_local().
1412  *
1413  * Since: 2.22
1414  */
1415
1416
1417 /**
1418  * GInetAddress:is-multicast:
1419  *
1420  * Whether this is a multicast address.
1421  * See g_inet_address_get_is_multicast().
1422  *
1423  * Since: 2.22
1424  */
1425
1426
1427 /**
1428  * GInetAddress:is-site-local:
1429  *
1430  * Whether this is a site-local address.
1431  * See g_inet_address_get_is_loopback().
1432  *
1433  * Since: 2.22
1434  */
1435
1436
1437 /**
1438  * GInetAddressMask:
1439  *
1440  * A combination of an IPv4 or IPv6 base address and a length,
1441  * representing a range of IP addresses.
1442  *
1443  * Since: 2.32
1444  */
1445
1446
1447 /**
1448  * GInetSocketAddress:
1449  *
1450  * An IPv4 or IPv6 socket address, corresponding to a <type>struct
1451  * sockaddr_in</type> or <type>struct sockaddr_in6</type>.
1452  */
1453
1454
1455 /**
1456  * GInetSocketAddress:flowinfo:
1457  *
1458  * The <literal>sin6_flowinfo</literal> field, for IPv6 addresses.
1459  *
1460  * Since: 2.32
1461  */
1462
1463
1464 /**
1465  * GInetSocketAddress:scope_id:
1466  *
1467  * The <literal>sin6_scope_id</literal> field, for IPv6 addresses.
1468  *
1469  * Since: 2.32
1470  */
1471
1472
1473 /**
1474  * GMemoryOutputStream:data:
1475  *
1476  * Pointer to buffer where data will be written.
1477  *
1478  * Since: 2.24
1479  */
1480
1481
1482 /**
1483  * GMemoryOutputStream:data-size:
1484  *
1485  * Size of data written to the buffer.
1486  *
1487  * Since: 2.24
1488  */
1489
1490
1491 /**
1492  * GMemoryOutputStream:destroy-function: (skip)
1493  *
1494  * Function called with the buffer as argument when the stream is destroyed.
1495  *
1496  * Since: 2.24
1497  */
1498
1499
1500 /**
1501  * GMemoryOutputStream:realloc-function: (skip)
1502  *
1503  * Function with realloc semantics called to enlarge the buffer.
1504  *
1505  * Since: 2.24
1506  */
1507
1508
1509 /**
1510  * GMemoryOutputStream:size:
1511  *
1512  * Current size of the data buffer.
1513  *
1514  * Since: 2.24
1515  */
1516
1517
1518 /**
1519  * GMenu:
1520  *
1521  * #GMenu is an opaque structure type.  You must access it using the
1522  * functions below.
1523  *
1524  * Since: 2.32
1525  */
1526
1527
1528 /**
1529  * GMenuAttributeIter:
1530  *
1531  * #GMenuAttributeIter is an opaque structure type.  You must access it
1532  * using the functions below.
1533  *
1534  * Since: 2.32
1535  */
1536
1537
1538 /**
1539  * GMenuItem:
1540  *
1541  * #GMenuItem is an opaque structure type.  You must access it using the
1542  * functions below.
1543  *
1544  * Since: 2.32
1545  */
1546
1547
1548 /**
1549  * GMenuLinkIter:
1550  *
1551  * #GMenuLinkIter is an opaque structure type.  You must access it using
1552  * the functions below.
1553  *
1554  * Since: 2.32
1555  */
1556
1557
1558 /**
1559  * GMenuModel:
1560  *
1561  * #GMenuModel is an opaque structure type.  You must access it using the
1562  * functions below.
1563  *
1564  * Since: 2.32
1565  */
1566
1567
1568 /**
1569  * GMenuModel::items-changed:
1570  * @model: the #GMenuModel that is changing
1571  * @position: the position of the change
1572  * @removed: the number of items removed
1573  * @added: the number of items added
1574  *
1575  * Emitted when a change has occured to the menu.
1576  *
1577  * The only changes that can occur to a menu is that items are removed
1578  * or added.  Items may not change (except by being removed and added
1579  * back in the same location).  This signal is capable of describing
1580  * both of those changes (at the same time).
1581  *
1582  * The signal means that starting at the index @position, @removed
1583  * items were removed and @added items were added in their place.  If
1584  * @removed is zero then only items were added.  If @added is zero
1585  * then only items were removed.
1586  *
1587  * As an example, if the menu contains items a, b, c, d (in that
1588  * order) and the signal (2, 1, 3) occurs then the new composition of
1589  * the menu will be a, b, _, _, _, d (with each _ representing some
1590  * new item).
1591  *
1592  * Signal handlers may query the model (particularly the added items)
1593  * and expect to see the results of the modification that is being
1594  * reported.  The signal is emitted after the modification.
1595  */
1596
1597
1598 /**
1599  * GMount::changed:
1600  * @mount: the object on which the signal is emitted
1601  *
1602  * Emitted when the mount has been changed.
1603  */
1604
1605
1606 /**
1607  * GMount::pre-unmount:
1608  * @mount: the object on which the signal is emitted
1609  *
1610  * This signal is emitted when the #GMount is about to be
1611  * unmounted.
1612  *
1613  * Since: 2.22
1614  */
1615
1616
1617 /**
1618  * GMount::unmounted:
1619  * @mount: the object on which the signal is emitted
1620  *
1621  * This signal is emitted when the #GMount have been
1622  * unmounted. If the recipient is holding references to the
1623  * object they should release them so the object can be
1624  * finalized.
1625  */
1626
1627
1628 /**
1629  * GMountOperation::aborted:
1630  *
1631  * Emitted by the backend when e.g. a device becomes unavailable
1632  * while a mount operation is in progress.
1633  *
1634  * Implementations of GMountOperation should handle this signal
1635  * by dismissing open password dialogs.
1636  *
1637  * Since: 2.20
1638  */
1639
1640
1641 /**
1642  * GMountOperation::ask-password:
1643  * @op: a #GMountOperation requesting a password.
1644  * @message: string containing a message to display to the user.
1645  * @default_user: string containing the default user name.
1646  * @default_domain: string containing the default domain.
1647  * @flags: a set of #GAskPasswordFlags.
1648  *
1649  * Emitted when a mount operation asks the user for a password.
1650  *
1651  * If the message contains a line break, the first line should be
1652  * presented as a heading. For example, it may be used as the
1653  * primary text in a #GtkMessageDialog.
1654  */
1655
1656
1657 /**
1658  * GMountOperation::ask-question:
1659  * @op: a #GMountOperation asking a question.
1660  * @message: string containing a message to display to the user.
1661  * @choices: an array of strings for each possible choice.
1662  *
1663  * Emitted when asking the user a question and gives a list of
1664  * choices for the user to choose from.
1665  *
1666  * If the message contains a line break, the first line should be
1667  * presented as a heading. For example, it may be used as the
1668  * primary text in a #GtkMessageDialog.
1669  */
1670
1671
1672 /**
1673  * GMountOperation::reply:
1674  * @op: a #GMountOperation.
1675  * @result: a #GMountOperationResult indicating how the request was handled
1676  *
1677  * Emitted when the user has replied to the mount operation.
1678  */
1679
1680
1681 /**
1682  * GMountOperation::show-processes:
1683  * @op: a #GMountOperation.
1684  * @message: string containing a message to display to the user.
1685  * @processes: (element-type GPid): an array of #GPid for processes blocking the operation.
1686  * @choices: an array of strings for each possible choice.
1687  *
1688  * Emitted when one or more processes are blocking an operation
1689  * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
1690  *
1691  * Note that this signal may be emitted several times to update the
1692  * list of blocking processes as processes close files. The
1693  * application should only respond with g_mount_operation_reply() to
1694  * the latest signal (setting #GMountOperation:choice to the choice
1695  * the user made).
1696  *
1697  * If the message contains a line break, the first line should be
1698  * presented as a heading. For example, it may be used as the
1699  * primary text in a #GtkMessageDialog.
1700  *
1701  * Since: 2.22
1702  */
1703
1704
1705 /**
1706  * GMountOperation::show-unmount-progress:
1707  * @op: a #GMountOperation:
1708  * @message: string containing a mesage to display to the user
1709  * @time_left: the estimated time left before the operation completes, in microseconds, or -1
1710  * @bytes_left: the amount of bytes to be written before the operation completes (or -1 if such amount is not known), or zero if the operation is completed
1711  *
1712  * Emitted when an unmount operation has been busy for more than some time
1713  * (typically 1.5 seconds).
1714  *
1715  * When unmounting or ejecting a volume, the kernel might need to flush
1716  * pending data in its buffers to the volume stable storage, and this operation
1717  * can take a considerable amount of time. This signal may be emitted several
1718  * times as long as the unmount operation is outstanding, and then one
1719  * last time when the operation is completed, with @bytes_left set to zero.
1720  *
1721  * Implementations of GMountOperation should handle this signal by
1722  * showing an UI notification, and then dismiss it, or show another notification
1723  * of completion, when @bytes_left reaches zero.
1724  *
1725  * If the message contains a line break, the first line should be
1726  * presented as a heading. For example, it may be used as the
1727  * primary text in a #GtkMessageDialog.
1728  *
1729  * Since: 2.34
1730  */
1731
1732
1733 /**
1734  * GMountOperation:anonymous:
1735  *
1736  * Whether to use an anonymous user when authenticating.
1737  */
1738
1739
1740 /**
1741  * GMountOperation:choice:
1742  *
1743  * The index of the user's choice when a question is asked during the
1744  * mount operation. See the #GMountOperation::ask-question signal.
1745  */
1746
1747
1748 /**
1749  * GMountOperation:domain:
1750  *
1751  * The domain to use for the mount operation.
1752  */
1753
1754
1755 /**
1756  * GMountOperation:password:
1757  *
1758  * The password that is used for authentication when carrying out
1759  * the mount operation.
1760  */
1761
1762
1763 /**
1764  * GMountOperation:password-save:
1765  *
1766  * Determines if and how the password information should be saved.
1767  */
1768
1769
1770 /**
1771  * GMountOperation:username:
1772  *
1773  * The user name that is used for authentication when carrying out
1774  * the mount operation.
1775  */
1776
1777
1778 /**
1779  * GNetworkAddress:
1780  *
1781  * A #GSocketConnectable for resolving a hostname and connecting to
1782  * that host.
1783  */
1784
1785
1786 /**
1787  * GNetworkMonitor:
1788  *
1789  * #GNetworkMonitor monitors the status of network connections and
1790  * indicates when a possibly-user-visible change has occurred.
1791  *
1792  * Since: 2.32
1793  */
1794
1795
1796 /**
1797  * GNetworkMonitor::network-changed:
1798  * @monitor: a #GNetworkMonitor
1799  * @available: the current value of #GNetworkMonitor:network-available
1800  *
1801  * Emitted when the network configuration changes. If @available is
1802  * %TRUE, then some hosts may be reachable that were not reachable
1803  * before, while others that were reachable before may no longer be
1804  * reachable. If @available is %FALSE, then no remote hosts are
1805  * reachable.
1806  *
1807  * Since: 2.32
1808  */
1809
1810
1811 /**
1812  * GNetworkMonitor:network-available:
1813  *
1814  * Whether the network is considered available. That is, whether the
1815  * system has a default route for at least one of IPv4 or IPv6.
1816  *
1817  * Real-world networks are of course much more complicated than
1818  * this; the machine may be connected to a wifi hotspot that
1819  * requires payment before allowing traffic through, or may be
1820  * connected to a functioning router that has lost its own upstream
1821  * connectivity. Some hosts might only be accessible when a VPN is
1822  * active. Other hosts might only be accessible when the VPN is
1823  * <emphasis>not</emphasis> active. Thus, it is best to use
1824  * g_network_monitor_can_reach() or
1825  * g_network_monitor_can_reach_async() to test for reachability on a
1826  * host-by-host basis. (On the other hand, when the property is
1827  * %FALSE, the application can reasonably expect that no remote
1828  * hosts at all are reachable, and should indicate this to the user
1829  * in its UI.)
1830  *
1831  * See also #GNetworkMonitor::network-changed.
1832  *
1833  * Since: 2.32
1834  */
1835
1836
1837 /**
1838  * GNetworkService:
1839  *
1840  * A #GSocketConnectable for resolving a SRV record and connecting to
1841  * that service.
1842  */
1843
1844
1845 /**
1846  * GPermission:
1847  *
1848  * #GPermission is an opaque data structure and can only be accessed
1849  * using the following functions.
1850  */
1851
1852
1853 /**
1854  * GPermission:allowed:
1855  *
1856  * %TRUE if the caller currently has permission to perform the action that
1857  * @permission represents the permission to perform.
1858  */
1859
1860
1861 /**
1862  * GPermission:can-acquire:
1863  *
1864  * %TRUE if it is generally possible to acquire the permission by calling
1865  * g_permission_acquire().
1866  */
1867
1868
1869 /**
1870  * GPermission:can-release:
1871  *
1872  * %TRUE if it is generally possible to release the permission by calling
1873  * g_permission_release().
1874  */
1875
1876
1877 /**
1878  * GPropertyAction:
1879  *
1880  * This type is opaque.
1881  *
1882  * Since: 2.38
1883  */
1884
1885
1886 /**
1887  * GPropertyAction:enabled:
1888  *
1889  * If @action is currently enabled.
1890  *
1891  * If the action is disabled then calls to g_action_activate() and
1892  * g_action_change_state() have no effect.
1893  *
1894  * Since: 2.38
1895  */
1896
1897
1898 /**
1899  * GPropertyAction:name:
1900  *
1901  * The name of the action.  This is mostly meaningful for identifying
1902  * the action once it has been added to a #GActionMap.
1903  *
1904  * Since: 2.38
1905  */
1906
1907
1908 /**
1909  * GPropertyAction:object:
1910  *
1911  * The object to wrap a property on.
1912  *
1913  * The object must be a non-%NULL #GObject with properties.
1914  *
1915  * Since: 2.38
1916  */
1917
1918
1919 /**
1920  * GPropertyAction:parameter-type:
1921  *
1922  * The type of the parameter that must be given when activating the
1923  * action.
1924  *
1925  * Since: 2.38
1926  */
1927
1928
1929 /**
1930  * GPropertyAction:property-name:
1931  *
1932  * The name of the property to wrap on the object.
1933  *
1934  * The property must exist on the passed-in object and it must be
1935  * readable and writable (and not construct-only).
1936  *
1937  * Since: 2.38
1938  */
1939
1940
1941 /**
1942  * GPropertyAction:state:
1943  *
1944  * The state of the action, or %NULL if the action is stateless.
1945  *
1946  * Since: 2.38
1947  */
1948
1949
1950 /**
1951  * GPropertyAction:state-type:
1952  *
1953  * The #GVariantType of the state that the action has, or %NULL if the
1954  * action is stateless.
1955  *
1956  * Since: 2.38
1957  */
1958
1959
1960 /**
1961  * GProxyAddress:
1962  *
1963  * A #GInetSocketAddress representing a connection via a proxy server
1964  *
1965  * Since: 2.26
1966  */
1967
1968
1969 /**
1970  * GProxyAddress:destination-protocol:
1971  *
1972  * The protocol being spoke to the destination host, or %NULL if
1973  * the #GProxyAddress doesn't know.
1974  *
1975  * Since: 2.34
1976  */
1977
1978
1979 /**
1980  * GProxyAddress:uri:
1981  *
1982  * The URI string that the proxy was constructed from (or %NULL
1983  * if the creator didn't specify this).
1984  *
1985  * Since: 2.34
1986  */
1987
1988
1989 /**
1990  * GProxyAddressEnumerator:default-port:
1991  *
1992  * The default port to use if #GProxyAddressEnumerator:uri does not
1993  * specify one.
1994  *
1995  * Since: 2.38
1996  */
1997
1998
1999 /**
2000  * GProxyAddressEnumerator:proxy-resolver:
2001  *
2002  * The proxy resolver to use.
2003  *
2004  * Since: 2.36
2005  */
2006
2007
2008 /**
2009  * GRemoteActionGroupInterface:
2010  * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
2011  * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
2012  *
2013  * The virtual function table for #GRemoteActionGroup.
2014  *
2015  * Since: 2.32
2016  */
2017
2018
2019 /**
2020  * GResolver:
2021  *
2022  * The object that handles DNS resolution. Use g_resolver_get_default()
2023  * to get the default resolver.
2024  */
2025
2026
2027 /**
2028  * GResolver::reload:
2029  * @resolver: a #GResolver
2030  *
2031  * Emitted when the resolver notices that the system resolver
2032  * configuration has changed.
2033  */
2034
2035
2036 /**
2037  * GSettings::change-event:
2038  * @settings: the object on which the signal was emitted
2039  * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
2040  * @n_keys: the length of the @keys array, or 0
2041  *
2042  * The "change-event" signal is emitted once per change event that
2043  * affects this settings object.  You should connect to this signal
2044  * only if you are interested in viewing groups of changes before they
2045  * are split out into multiple emissions of the "changed" signal.
2046  * For most use cases it is more appropriate to use the "changed" signal.
2047  *
2048  * In the event that the change event applies to one or more specified
2049  * keys, @keys will be an array of #GQuark of length @n_keys.  In the
2050  * event that the change event applies to the #GSettings object as a
2051  * whole (ie: potentially every key has been changed) then @keys will
2052  * be %NULL and @n_keys will be 0.
2053  *
2054  * The default handler for this signal invokes the "changed" signal
2055  * for each affected key.  If any other connected handler returns
2056  * %TRUE then this default functionality will be suppressed.
2057  *
2058  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
2059  */
2060
2061
2062 /**
2063  * GSettings::changed:
2064  * @settings: the object on which the signal was emitted
2065  * @key: the name of the key that changed
2066  *
2067  * The "changed" signal is emitted when a key has potentially changed.
2068  * You should call one of the g_settings_get() calls to check the new
2069  * value.
2070  *
2071  * This signal supports detailed connections.  You can connect to the
2072  * detailed signal "changed::x" in order to only receive callbacks
2073  * when key "x" changes.
2074  */
2075
2076
2077 /**
2078  * GSettings::writable-change-event:
2079  * @settings: the object on which the signal was emitted
2080  * @key: the quark of the key, or 0
2081  *
2082  * The "writable-change-event" signal is emitted once per writability
2083  * change event that affects this settings object.  You should connect
2084  * to this signal if you are interested in viewing groups of changes
2085  * before they are split out into multiple emissions of the
2086  * "writable-changed" signal.  For most use cases it is more
2087  * appropriate to use the "writable-changed" signal.
2088  *
2089  * In the event that the writability change applies only to a single
2090  * key, @key will be set to the #GQuark for that key.  In the event
2091  * that the writability change affects the entire settings object,
2092  * @key will be 0.
2093  *
2094  * The default handler for this signal invokes the "writable-changed"
2095  * and "changed" signals for each affected key.  This is done because
2096  * changes in writability might also imply changes in value (if for
2097  * example, a new mandatory setting is introduced).  If any other
2098  * connected handler returns %TRUE then this default functionality
2099  * will be suppressed.
2100  *
2101  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
2102  */
2103
2104
2105 /**
2106  * GSettings::writable-changed:
2107  * @settings: the object on which the signal was emitted
2108  * @key: the key
2109  *
2110  * The "writable-changed" signal is emitted when the writability of a
2111  * key has potentially changed.  You should call
2112  * g_settings_is_writable() in order to determine the new status.
2113  *
2114  * This signal supports detailed connections.  You can connect to the
2115  * detailed signal "writable-changed::x" in order to only receive
2116  * callbacks when the writability of "x" changes.
2117  */
2118
2119
2120 /**
2121  * GSettings:context:
2122  *
2123  * The name of the context that the settings are stored in.
2124  */
2125
2126
2127 /**
2128  * GSettings:delay-apply:
2129  *
2130  * Whether the #GSettings object is in 'delay-apply' mode. See
2131  * g_settings_delay() for details.
2132  *
2133  * Since: 2.28
2134  */
2135
2136
2137 /**
2138  * GSettings:has-unapplied:
2139  *
2140  * If this property is %TRUE, the #GSettings object has outstanding
2141  * changes that will be applied when g_settings_apply() is called.
2142  */
2143
2144
2145 /**
2146  * GSettings:path:
2147  *
2148  * The path within the backend where the settings are stored.
2149  */
2150
2151
2152 /**
2153  * GSettings:schema:
2154  *
2155  * The name of the schema that describes the types of keys
2156  * for this #GSettings object.
2157  *
2158  * The type of this property is *not* #GSettingsSchema.
2159  * #GSettingsSchema has only existed since version 2.32 and
2160  * unfortunately this name was used in previous versions to refer to
2161  * the schema ID rather than the schema itself.  Take care to use the
2162  * 'settings-schema' property if you wish to pass in a
2163  * #GSettingsSchema.
2164  *
2165  * Deprecated: 2.32:Use the 'schema-id' property instead.  In a future version, this property may instead refer to a #GSettingsSchema.
2166  */
2167
2168
2169 /**
2170  * GSettings:schema-id:
2171  *
2172  * The name of the schema that describes the types of keys
2173  * for this #GSettings object.
2174  */
2175
2176
2177 /**
2178  * GSettings:settings-schema:
2179  *
2180  * The #GSettingsSchema describing the types of keys for this
2181  * #GSettings object.
2182  *
2183  * Ideally, this property would be called 'schema'.  #GSettingsSchema
2184  * has only existed since version 2.32, however, and before then the
2185  * 'schema' property was used to refer to the ID of the schema rather
2186  * than the schema itself.  Take care.
2187  */
2188
2189
2190 /**
2191  * GSettingsSchema:
2192  *
2193  * This is an opaque structure type.  You may not access it directly.
2194  *
2195  * Since: 2.32
2196  */
2197
2198
2199 /**
2200  * GSettingsSchemaSource:
2201  *
2202  * This is an opaque structure type.  You may not access it directly.
2203  *
2204  * Since: 2.32
2205  */
2206
2207
2208 /**
2209  * GSimpleAction::activate:
2210  * @simple: the #GSimpleAction
2211  * @parameter: (allow-none): the parameter to the activation
2212  *
2213  * Indicates that the action was just activated.
2214  *
2215  * @parameter will always be of the expected type.  In the event that
2216  * an incorrect type was given, no signal will be emitted.
2217  *
2218  * Since: 2.28
2219  */
2220
2221
2222 /**
2223  * GSimpleAction::change-state:
2224  * @simple: the #GSimpleAction
2225  * @value: (allow-none): the requested value for the state
2226  *
2227  * Indicates that the action just received a request to change its
2228  * state.
2229  *
2230  * @value will always be of the correct state type.  In the event that
2231  * an incorrect type was given, no signal will be emitted.
2232  *
2233  * If no handler is connected to this signal then the default
2234  * behaviour is to call g_simple_action_set_state() to set the state
2235  * to the requested value.  If you connect a signal handler then no
2236  * default action is taken.  If the state should change then you must
2237  * call g_simple_action_set_state() from the handler.
2238  *
2239  * <example>
2240  * <title>Example 'change-state' handler</title>
2241  * <programlisting>
2242  * static void
2243  * change_volume_state (GSimpleAction *action,
2244  *                      GVariant      *value,
2245  *                      gpointer       user_data)
2246  * {
2247  *   gint requested;
2248  *
2249  *   requested = g_variant_get_int32 (value);
2250  *
2251  *   // Volume only goes from 0 to 10
2252  *   if (0 <= requested && requested <= 10)
2253  *     g_simple_action_set_state (action, value);
2254  * }
2255  * </programlisting>
2256  * </example>
2257  *
2258  * The handler need not set the state to the requested value.  It
2259  * could set it to any value at all, or take some other action.
2260  *
2261  * Since: 2.30
2262  */
2263
2264
2265 /**
2266  * GSimpleAction:enabled:
2267  *
2268  * If @action is currently enabled.
2269  *
2270  * If the action is disabled then calls to g_action_activate() and
2271  * g_action_change_state() have no effect.
2272  *
2273  * Since: 2.28
2274  */
2275
2276
2277 /**
2278  * GSimpleAction:name:
2279  *
2280  * The name of the action.  This is mostly meaningful for identifying
2281  * the action once it has been added to a #GSimpleActionGroup.
2282  *
2283  * Since: 2.28
2284  */
2285
2286
2287 /**
2288  * GSimpleAction:parameter-type:
2289  *
2290  * The type of the parameter that must be given when activating the
2291  * action.
2292  *
2293  * Since: 2.28
2294  */
2295
2296
2297 /**
2298  * GSimpleAction:state:
2299  *
2300  * The state of the action, or %NULL if the action is stateless.
2301  *
2302  * Since: 2.28
2303  */
2304
2305
2306 /**
2307  * GSimpleAction:state-type:
2308  *
2309  * The #GVariantType of the state that the action has, or %NULL if the
2310  * action is stateless.
2311  *
2312  * Since: 2.28
2313  */
2314
2315
2316 /**
2317  * GSimplePermission:
2318  *
2319  * #GSimplePermission is an opaque data structure.  There are no methods
2320  * except for those defined by #GPermission.
2321  */
2322
2323
2324 /**
2325  * GSimpleProxyResolver:default-proxy:
2326  *
2327  * The default proxy URI that will be used for any URI that doesn't
2328  * match #GSimpleProxyResolver:ignore-hosts, and doesn't match any
2329  * of the schemes set with g_simple_proxy_resolver_set_uri_proxy().
2330  *
2331  * Note that as a special case, if this URI starts with
2332  * "<literal>socks://</literal>", #GSimpleProxyResolver will treat
2333  * it as referring to all three of the <literal>socks5</literal>,
2334  * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
2335  * types.
2336  */
2337
2338
2339 /**
2340  * GSimpleProxyResolver:ignore-hosts:
2341  *
2342  * A list of hostnames and IP addresses that the resolver should
2343  * allow direct connections to.
2344  *
2345  * Entries can be in one of 4 formats:
2346  *
2347  * <itemizedlist>
2348  *   <listitem>
2349  *     A hostname, such as "<literal>example.com</literal>",
2350  *     "<literal>.example.com</literal>", or
2351  *     "<literal>*.example.com</literal>", any of which match
2352  *     "<literal>example.com</literal>" or any subdomain of it.
2353  *   </listitem>
2354  *   <listitem>
2355  *     An IPv4 or IPv6 address, such as
2356  *     "<literal>192.168.1.1</literal>", which matches only
2357  *     that address.
2358  *   </listitem>
2359  *   <listitem>
2360  *     A hostname or IP address followed by a port, such as
2361  *     "<literal>example.com:80</literal>", which matches whatever
2362  *     the hostname or IP address would match, but only for URLs
2363  *     with the (explicitly) indicated port. In the case of an IPv6
2364  *     address, the address part must appear in brackets:
2365  *     "<literal>[::1]:443</literal>"
2366  *   </listitem>
2367  *   <listitem>
2368  *     An IP address range, given by a base address and prefix length,
2369  *     such as "<literal>fe80::/10</literal>", which matches any
2370  *     address in that range.
2371  *   </listitem>
2372  * </itemizedlist>
2373  *
2374  * Note that when dealing with Unicode hostnames, the matching is
2375  * done against the ASCII form of the name.
2376  *
2377  * Also note that hostname exclusions apply only to connections made
2378  * to hosts identified by name, and IP address exclusions apply only
2379  * to connections made to hosts identified by address. That is, if
2380  * <literal>example.com</literal> has an address of
2381  * <literal>192.168.1.1</literal>, and the :ignore-hosts list
2382  * contains only "<literal>192.168.1.1</literal>", then a connection
2383  * to "<literal>example.com</literal>" (eg, via a #GNetworkAddress)
2384  * will use the proxy, and a connection to
2385  * "<literal>192.168.1.1</literal>" (eg, via a #GInetSocketAddress)
2386  * will not.
2387  *
2388  * These rules match the "ignore-hosts"/"noproxy" rules most
2389  * commonly used by other applications.
2390  */
2391
2392
2393 /**
2394  * GSocket:broadcast:
2395  *
2396  * Whether the socket should allow sending to broadcast addresses.
2397  *
2398  * Since: 2.32
2399  */
2400
2401
2402 /**
2403  * GSocket:multicast-loopback:
2404  *
2405  * Whether outgoing multicast packets loop back to the local host.
2406  *
2407  * Since: 2.32
2408  */
2409
2410
2411 /**
2412  * GSocket:multicast-ttl:
2413  *
2414  * Time-to-live out outgoing multicast packets
2415  *
2416  * Since: 2.32
2417  */
2418
2419
2420 /**
2421  * GSocket:timeout:
2422  *
2423  * The timeout in seconds on socket I/O
2424  *
2425  * Since: 2.26
2426  */
2427
2428
2429 /**
2430  * GSocket:ttl:
2431  *
2432  * Time-to-live for outgoing unicast packets
2433  *
2434  * Since: 2.32
2435  */
2436
2437
2438 /**
2439  * GSocketAddress:
2440  *
2441  * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2442  * or one of its subtypes.
2443  */
2444
2445
2446 /**
2447  * GSocketClient::event:
2448  * @client: the #GSocketClient
2449  * @event: the event that is occurring
2450  * @connectable: the #GSocketConnectable that @event is occurring on
2451  * @connection: the current representation of the connection
2452  *
2453  * Emitted when @client's activity on @connectable changes state.
2454  * Among other things, this can be used to provide progress
2455  * information about a network connection in the UI. The meanings of
2456  * the different @event values are as follows:
2457  *
2458  * <variablelist>
2459  *   <varlistentry>
2460  *     <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2461  *     <listitem><para>
2462  *       @client is about to look up @connectable in DNS.
2463  *       @connection will be %NULL.
2464  *     </para></listitem>
2465  *   </varlistentry>
2466  *   <varlistentry>
2467  *     <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2468  *     <listitem><para>
2469  *       @client has successfully resolved @connectable in DNS.
2470  *       @connection will be %NULL.
2471  *     </para></listitem>
2472  *   </varlistentry>
2473  *   <varlistentry>
2474  *     <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2475  *     <listitem><para>
2476  *       @client is about to make a connection to a remote host;
2477  *       either a proxy server or the destination server itself.
2478  *       @connection is the #GSocketConnection, which is not yet
2479  *       connected.
2480  *     </para></listitem>
2481  *   </varlistentry>
2482  *   <varlistentry>
2483  *     <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2484  *     <listitem><para>
2485  *       @client has successfully connected to a remote host.
2486  *       @connection is the connected #GSocketConnection.
2487  *     </para></listitem>
2488  *   </varlistentry>
2489  *   <varlistentry>
2490  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2491  *     <listitem><para>
2492  *       @client is about to negotiate with a proxy to get it to
2493  *       connect to @connectable. @connection is the
2494  *       #GSocketConnection to the proxy server.
2495  *     </para></listitem>
2496  *   </varlistentry>
2497  *   <varlistentry>
2498  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2499  *     <listitem><para>
2500  *       @client has negotiated a connection to @connectable through
2501  *       a proxy server. @connection is the stream returned from
2502  *       g_proxy_connect(), which may or may not be a
2503  *       #GSocketConnection.
2504  *     </para></listitem>
2505  *   </varlistentry>
2506  *   <varlistentry>
2507  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2508  *     <listitem><para>
2509  *       @client is about to begin a TLS handshake. @connection is a
2510  *       #GTlsClientConnection.
2511  *     </para></listitem>
2512  *   </varlistentry>
2513  *   <varlistentry>
2514  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2515  *     <listitem><para>
2516  *       @client has successfully completed the TLS handshake.
2517  *       @connection is a #GTlsClientConnection.
2518  *     </para></listitem>
2519  *   </varlistentry>
2520  *   <varlistentry>
2521  *     <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2522  *     <listitem><para>
2523  *       @client has either successfully connected to @connectable
2524  *       (in which case @connection is the #GSocketConnection that
2525  *       it will be returning to the caller) or has failed (in which
2526  *       case @connection is %NULL and the client is about to return
2527  *       an error).
2528  *     </para></listitem>
2529  *   </varlistentry>
2530  * </variablelist>
2531  *
2532  * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2533  * multiple times (or not at all) for a given connectable (in
2534  * particular, if @client ends up attempting to connect to more than
2535  * one address). However, if @client emits the #GSocketClient::event
2536  * signal at all for a given connectable, that it will always emit
2537  * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2538  *
2539  * Note that there may be additional #GSocketClientEvent values in
2540  * the future; unrecognized @event values should be ignored.
2541  *
2542  * Since: 2.32
2543  */
2544
2545
2546 /**
2547  * GSocketClient:proxy-resolver:
2548  *
2549  * The proxy resolver to use
2550  *
2551  * Since: 2.36
2552  */
2553
2554
2555 /**
2556  * GSocketService::incoming:
2557  * @service: the #GSocketService
2558  * @connection: a new #GSocketConnection object
2559  * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2560  *
2561  * The ::incoming signal is emitted when a new incoming connection
2562  * to @service needs to be handled. The handler must initiate the
2563  * handling of @connection, but may not block; in essence,
2564  * asynchronous operations must be used.
2565  *
2566  * @connection will be unreffed once the signal handler returns,
2567  * so you need to ref it yourself if you are planning to use it.
2568  *
2569  * Returns: %TRUE to stop other handlers from being called
2570  * Since: 2.22
2571  */
2572
2573
2574 /**
2575  * GSrvTarget:
2576  *
2577  * A single target host/port that a network service is running on.
2578  */
2579
2580
2581 /**
2582  * GTask:
2583  *
2584  * The opaque object representing a synchronous or asynchronous task
2585  * and its result.
2586  */
2587
2588
2589 /**
2590  * GTaskThreadFunc:
2591  * @task: the #GTask
2592  * @source_object: (type GObject): @task's source object
2593  * @task_data: @task's task data
2594  * @cancellable: @task's #GCancellable, or %NULL
2595  *
2596  * The prototype for a task function to be run in a thread via
2597  * g_task_run_in_thread() or g_task_run_in_thread_sync().
2598  *
2599  * If the return-on-cancel flag is set on @task, and @cancellable gets
2600  * cancelled, then the #GTask will be completed immediately (as though
2601  * g_task_return_error_if_cancelled() had been called), without
2602  * waiting for the task function to complete. However, the task
2603  * function will continue running in its thread in the background. The
2604  * function therefore needs to be careful about how it uses
2605  * externally-visible state in this case. See
2606  * g_task_set_return_on_cancel() for more details.
2607  *
2608  * Other than in that case, @task will be completed when the
2609  * #GTaskThreadFunc returns, <emphasis>not</emphasis> when it calls
2610  * a <literal>g_task_return_</literal> function.
2611  *
2612  * Since: 2.36
2613  */
2614
2615
2616 /**
2617  * GTestDBus:
2618  *
2619  * The #GTestDBus structure contains only private data and
2620  * should only be accessed using the provided API.
2621  *
2622  * Since: 2.34
2623  */
2624
2625
2626 /**
2627  * GTestDBus:flags:
2628  *
2629  * #GTestDBusFlags specifying the behaviour of the dbus session
2630  *
2631  * Since: 2.34
2632  */
2633
2634
2635 /**
2636  * GThemedIcon:name:
2637  *
2638  * The icon name.
2639  */
2640
2641
2642 /**
2643  * GThemedIcon:names:
2644  *
2645  * A %NULL-terminated array of icon names.
2646  */
2647
2648
2649 /**
2650  * GThemedIcon:use-default-fallbacks:
2651  *
2652  * Whether to use the default fallbacks found by shortening the icon name
2653  * at '-' characters. If the "names" array has more than one element,
2654  * ignores any past the first.
2655  *
2656  * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2657  * would become
2658  * |[
2659  * {
2660  *   "gnome-dev-cdrom-audio",
2661  *   "gnome-dev-cdrom",
2662  *   "gnome-dev",
2663  *   "gnome",
2664  *   NULL
2665  * };
2666  * ]|
2667  */
2668
2669
2670 /**
2671  * GThreadedSocketService::run:
2672  * @service: the #GThreadedSocketService.
2673  * @connection: a new #GSocketConnection object.
2674  * @source_object: the source_object passed to g_socket_listener_add_address().
2675  *
2676  * The ::run signal is emitted in a worker thread in response to an
2677  * incoming connection. This thread is dedicated to handling
2678  * @connection and may perform blocking IO. The signal handler need
2679  * not return until the connection is closed.
2680  *
2681  * Returns: %TRUE to stop further signal handlers from being called
2682  */
2683
2684
2685 /**
2686  * GTlsBackend:
2687  *
2688  * TLS (Transport Layer Security, aka SSL) backend. This is an
2689  * internal type used to coordinate the different classes implemented
2690  * by a TLS backend.
2691  *
2692  * Since: 2.28
2693  */
2694
2695
2696 /**
2697  * GTlsCertificate:
2698  *
2699  * Abstract base class for TLS certificate types.
2700  *
2701  * Since: 2.28
2702  */
2703
2704
2705 /**
2706  * GTlsCertificate:certificate:
2707  *
2708  * The DER (binary) encoded representation of the certificate.
2709  * This property and the #GTlsCertificate:certificate-pem property
2710  * represent the same data, just in different forms.
2711  *
2712  * Since: 2.28
2713  */
2714
2715
2716 /**
2717  * GTlsCertificate:certificate-pem:
2718  *
2719  * The PEM (ASCII) encoded representation of the certificate.
2720  * This property and the #GTlsCertificate:certificate
2721  * property represent the same data, just in different forms.
2722  *
2723  * Since: 2.28
2724  */
2725
2726
2727 /**
2728  * GTlsCertificate:issuer:
2729  *
2730  * A #GTlsCertificate representing the entity that issued this
2731  * certificate. If %NULL, this means that the certificate is either
2732  * self-signed, or else the certificate of the issuer is not
2733  * available.
2734  *
2735  * Since: 2.28
2736  */
2737
2738
2739 /**
2740  * GTlsCertificate:private-key:
2741  *
2742  * The DER (binary) encoded representation of the certificate's
2743  * private key, in either PKCS#1 format or unencrypted PKCS#8
2744  * format. This property (or the #GTlsCertificate:private-key-pem
2745  * property) can be set when constructing a key (eg, from a file),
2746  * but cannot be read.
2747  *
2748  * PKCS#8 format is supported since 2.32; earlier releases only
2749  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2750  * tool to convert PKCS#8 keys to PKCS#1.
2751  *
2752  * Since: 2.28
2753  */
2754
2755
2756 /**
2757  * GTlsCertificate:private-key-pem:
2758  *
2759  * The PEM (ASCII) encoded representation of the certificate's
2760  * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2761  * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2762  * PRIVATE KEY</literal>"). This property (or the
2763  * #GTlsCertificate:private-key property) can be set when
2764  * constructing a key (eg, from a file), but cannot be read.
2765  *
2766  * PKCS#8 format is supported since 2.32; earlier releases only
2767  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2768  * tool to convert PKCS#8 keys to PKCS#1.
2769  *
2770  * Since: 2.28
2771  */
2772
2773
2774 /**
2775  * GTlsClientConnection:
2776  *
2777  * Abstract base class for the backend-specific client connection
2778  * type.
2779  *
2780  * Since: 2.28
2781  */
2782
2783
2784 /**
2785  * GTlsClientConnection:accepted-cas:
2786  *
2787  * A list of the distinguished names of the Certificate Authorities
2788  * that the server will accept client certificates signed by. If the
2789  * server requests a client certificate during the handshake, then
2790  * this property will be set after the handshake completes.
2791  *
2792  * Each item in the list is a #GByteArray which contains the complete
2793  * subject DN of the certificate authority.
2794  *
2795  * Since: 2.28
2796  */
2797
2798
2799 /**
2800  * GTlsClientConnection:server-identity:
2801  *
2802  * A #GSocketConnectable describing the identity of the server that
2803  * is expected on the other end of the connection.
2804  *
2805  * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2806  * #GTlsClientConnection:validation-flags, this object will be used
2807  * to determine the expected identify of the remote end of the
2808  * connection; if #GTlsClientConnection:server-identity is not set,
2809  * or does not match the identity presented by the server, then the
2810  * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2811  *
2812  * In addition to its use in verifying the server certificate,
2813  * this is also used to give a hint to the server about what
2814  * certificate we expect, which is useful for servers that serve
2815  * virtual hosts.
2816  *
2817  * Since: 2.28
2818  */
2819
2820
2821 /**
2822  * GTlsClientConnection:use-ssl3:
2823  *
2824  * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2825  * to negotiate the best version of TLS or SSL to use. This can be
2826  * used when talking to servers that don't implement version
2827  * negotiation correctly and therefore refuse to handshake at all with
2828  * a "modern" TLS handshake.
2829  *
2830  * Since: 2.28
2831  */
2832
2833
2834 /**
2835  * GTlsClientConnection:validation-flags:
2836  *
2837  * What steps to perform when validating a certificate received from
2838  * a server. Server certificates that fail to validate in all of the
2839  * ways indicated here will be rejected unless the application
2840  * overrides the default via #GTlsConnection::accept-certificate.
2841  *
2842  * Since: 2.28
2843  */
2844
2845
2846 /**
2847  * GTlsConnection:
2848  *
2849  * Abstract base class for the backend-specific #GTlsClientConnection
2850  * and #GTlsServerConnection types.
2851  *
2852  * Since: 2.28
2853  */
2854
2855
2856 /**
2857  * GTlsConnection::accept-certificate:
2858  * @conn: a #GTlsConnection
2859  * @peer_cert: the peer's #GTlsCertificate
2860  * @errors: the problems with @peer_cert.
2861  *
2862  * Emitted during the TLS handshake after the peer certificate has
2863  * been received. You can examine @peer_cert's certification path by
2864  * calling g_tls_certificate_get_issuer() on it.
2865  *
2866  * For a client-side connection, @peer_cert is the server's
2867  * certificate, and the signal will only be emitted if the
2868  * certificate was not acceptable according to @conn's
2869  * #GTlsClientConnection:validation_flags. If you would like the
2870  * certificate to be accepted despite @errors, return %TRUE from the
2871  * signal handler. Otherwise, if no handler accepts the certificate,
2872  * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2873  *
2874  * For a server-side connection, @peer_cert is the certificate
2875  * presented by the client, if this was requested via the server's
2876  * #GTlsServerConnection:authentication_mode. On the server side,
2877  * the signal is always emitted when the client presents a
2878  * certificate, and the certificate will only be accepted if a
2879  * handler returns %TRUE.
2880  *
2881  * Note that if this signal is emitted as part of asynchronous I/O
2882  * in the main thread, then you should not attempt to interact with
2883  * the user before returning from the signal handler. If you want to
2884  * let the user decide whether or not to accept the certificate, you
2885  * would have to return %FALSE from the signal handler on the first
2886  * attempt, and then after the connection attempt returns a
2887  * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2888  * the user decides to accept the certificate, remember that fact,
2889  * create a new connection, and return %TRUE from the signal handler
2890  * the next time.
2891  *
2892  * If you are doing I/O in another thread, you do not
2893  * need to worry about this, and can simply block in the signal
2894  * handler until the UI thread returns an answer.
2895  *
2896  * Returns: %TRUE to accept @peer_cert (which will also immediately end the signal emission). %FALSE to allow the signal emission to continue, which will cause the handshake to fail if no one else overrides it.
2897  * Since: 2.28
2898  */
2899
2900
2901 /**
2902  * GTlsConnection:base-io-stream:
2903  *
2904  * The #GIOStream that the connection wraps
2905  *
2906  * Since: 2.28
2907  */
2908
2909
2910 /**
2911  * GTlsConnection:certificate:
2912  *
2913  * The connection's certificate; see
2914  * g_tls_connection_set_certificate().
2915  *
2916  * Since: 2.28
2917  */
2918
2919
2920 /**
2921  * GTlsConnection:database:
2922  *
2923  * The certificate database to use when verifying this TLS connection.
2924  * If no cerificate database is set, then the default database will be
2925  * used. See g_tls_backend_get_default_database().
2926  *
2927  * Since: 2.30
2928  */
2929
2930
2931 /**
2932  * GTlsConnection:interaction:
2933  *
2934  * A #GTlsInteraction object to be used when the connection or certificate
2935  * database need to interact with the user. This will be used to prompt the
2936  * user for passwords where necessary.
2937  *
2938  * Since: 2.30
2939  */
2940
2941
2942 /**
2943  * GTlsConnection:peer-certificate:
2944  *
2945  * The connection's peer's certificate, after the TLS handshake has
2946  * completed and the certificate has been accepted. Note in
2947  * particular that this is not yet set during the emission of
2948  * #GTlsConnection::accept-certificate.
2949  *
2950  * (You can watch for a #GObject::notify signal on this property to
2951  * detect when a handshake has occurred.)
2952  *
2953  * Since: 2.28
2954  */
2955
2956
2957 /**
2958  * GTlsConnection:peer-certificate-errors:
2959  *
2960  * The errors noticed-and-ignored while verifying
2961  * #GTlsConnection:peer-certificate. Normally this should be 0, but
2962  * it may not be if #GTlsClientConnection:validation-flags is not
2963  * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2964  * #GTlsConnection::accept-certificate overrode the default
2965  * behavior.
2966  *
2967  * Since: 2.28
2968  */
2969
2970
2971 /**
2972  * GTlsConnection:rehandshake-mode:
2973  *
2974  * The rehandshaking mode. See
2975  * g_tls_connection_set_rehandshake_mode().
2976  *
2977  * Since: 2.28
2978  */
2979
2980
2981 /**
2982  * GTlsConnection:require-close-notify:
2983  *
2984  * Whether or not proper TLS close notification is required.
2985  * See g_tls_connection_set_require_close_notify().
2986  *
2987  * Since: 2.28
2988  */
2989
2990
2991 /**
2992  * GTlsConnection:use-system-certdb:
2993  *
2994  * Whether or not the system certificate database will be used to
2995  * verify peer certificates. See
2996  * g_tls_connection_set_use_system_certdb().
2997  *
2998  * Deprecated: 2.30: Use GTlsConnection:database instead
2999  */
3000
3001
3002 /**
3003  * GTlsDatabase:
3004  *
3005  * Abstract base class for the backend-specific database types.
3006  *
3007  * Since: 2.30
3008  */
3009
3010
3011 /**
3012  * GTlsFileDatabase:
3013  *
3014  * Implemented by a #GTlsDatabase which allows you to load certificates
3015  * from a file.
3016  *
3017  * Since: 2.30
3018  */
3019
3020
3021 /**
3022  * GTlsFileDatabase:anchors:
3023  *
3024  * The path to a file containing PEM encoded certificate authority
3025  * root anchors. The certificates in this file will be treated as
3026  * root authorities for the purpose of verifying other certificates
3027  * via the g_tls_database_verify_chain() operation.
3028  *
3029  * Since: 2.30
3030  */
3031
3032
3033 /**
3034  * GTlsInteraction:
3035  *
3036  * An object representing interaction that the TLS connection and database
3037  * might have with the user.
3038  *
3039  * Since: 2.30
3040  */
3041
3042
3043 /**
3044  * GTlsInteractionClass:
3045  * @ask_password: ask for a password synchronously. If the implementation returns %G_TLS_INTERACTION_HANDLED, then the password argument should have been filled in by using g_tls_password_set_value() or a similar function.
3046  * @ask_password_async: ask for a password asynchronously.
3047  * @ask_password_finish: complete operation to ask for a password asynchronously. If the implementation returns %G_TLS_INTERACTION_HANDLED, then the password argument of the async method should have been filled in by using g_tls_password_set_value() or a similar function.
3048  *
3049  * The class for #GTlsInteraction. Derived classes implement the various
3050  * virtual interaction methods to handle TLS interactions.
3051  *
3052  * Derived classes can choose to implement whichever interactions methods they'd
3053  * like to support by overriding those virtual methods in their class
3054  * initialization function. If a derived class implements an async method,
3055  * it must also implement the corresponding finish method.
3056  *
3057  * The synchronous interaction methods should implement to display modal dialogs,
3058  * and the asynchronous methods to display modeless dialogs.
3059  *
3060  * If the user cancels an interaction, then the result should be
3061  * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
3062  * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
3063  *
3064  * Since: 2.30
3065  */
3066
3067
3068 /**
3069  * GTlsPassword:
3070  *
3071  * An abstract interface representing a password used in TLS. Often used in
3072  * user interaction such as unlocking a key storage token.
3073  *
3074  * Since: 2.30
3075  */
3076
3077
3078 /**
3079  * GTlsServerConnection:authentication-mode:
3080  *
3081  * The #GTlsAuthenticationMode for the server. This can be changed
3082  * before calling g_tls_connection_handshake() if you want to
3083  * rehandshake with a different mode from the initial handshake.
3084  *
3085  * Since: 2.28
3086  */
3087
3088
3089 /**
3090  * GUnixCredentialsMessage:credentials:
3091  *
3092  * The credentials stored in the message.
3093  *
3094  * Since: 2.26
3095  */
3096
3097
3098 /**
3099  * GUnixInputStream:close-fd:
3100  *
3101  * Whether to close the file descriptor when the stream is closed.
3102  *
3103  * Since: 2.20
3104  */
3105
3106
3107 /**
3108  * GUnixInputStream:fd:
3109  *
3110  * The file descriptor that the stream reads from.
3111  *
3112  * Since: 2.20
3113  */
3114
3115
3116 /**
3117  * GUnixMountMonitor::mountpoints-changed:
3118  * @monitor: the object on which the signal is emitted
3119  *
3120  * Emitted when the unix mount points have changed.
3121  */
3122
3123
3124 /**
3125  * GUnixMountMonitor::mounts-changed:
3126  * @monitor: the object on which the signal is emitted
3127  *
3128  * Emitted when the unix mounts have changed.
3129  */
3130
3131
3132 /**
3133  * GUnixOutputStream:close-fd:
3134  *
3135  * Whether to close the file descriptor when the stream is closed.
3136  *
3137  * Since: 2.20
3138  */
3139
3140
3141 /**
3142  * GUnixOutputStream:fd:
3143  *
3144  * The file descriptor that the stream writes to.
3145  *
3146  * Since: 2.20
3147  */
3148
3149
3150 /**
3151  * GUnixSocketAddress:
3152  *
3153  * A UNIX-domain (local) socket address, corresponding to a
3154  * <type>struct sockaddr_un</type>.
3155  */
3156
3157
3158 /**
3159  * GUnixSocketAddress:abstract:
3160  *
3161  * Whether or not this is an abstract address
3162  *
3163  * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
3164  */
3165
3166
3167 /**
3168  * GVolume::changed:
3169  *
3170  * Emitted when the volume has been changed.
3171  */
3172
3173
3174 /**
3175  * GVolume::removed:
3176  *
3177  * This signal is emitted when the #GVolume have been removed. If
3178  * the recipient is holding references to the object they should
3179  * release them so the object can be finalized.
3180  */
3181
3182
3183 /**
3184  * GVolumeMonitor::drive-changed:
3185  * @volume_monitor: The volume monitor emitting the signal.
3186  * @drive: the drive that changed
3187  *
3188  * Emitted when a drive changes.
3189  */
3190
3191
3192 /**
3193  * GVolumeMonitor::drive-connected:
3194  * @volume_monitor: The volume monitor emitting the signal.
3195  * @drive: a #GDrive that was connected.
3196  *
3197  * Emitted when a drive is connected to the system.
3198  */
3199
3200
3201 /**
3202  * GVolumeMonitor::drive-disconnected:
3203  * @volume_monitor: The volume monitor emitting the signal.
3204  * @drive: a #GDrive that was disconnected.
3205  *
3206  * Emitted when a drive is disconnected from the system.
3207  */
3208
3209
3210 /**
3211  * GVolumeMonitor::drive-eject-button:
3212  * @volume_monitor: The volume monitor emitting the signal.
3213  * @drive: the drive where the eject button was pressed
3214  *
3215  * Emitted when the eject button is pressed on @drive.
3216  *
3217  * Since: 2.18
3218  */
3219
3220
3221 /**
3222  * GVolumeMonitor::drive-stop-button:
3223  * @volume_monitor: The volume monitor emitting the signal.
3224  * @drive: the drive where the stop button was pressed
3225  *
3226  * Emitted when the stop button is pressed on @drive.
3227  *
3228  * Since: 2.22
3229  */
3230
3231
3232 /**
3233  * GVolumeMonitor::mount-added:
3234  * @volume_monitor: The volume monitor emitting the signal.
3235  * @mount: a #GMount that was added.
3236  *
3237  * Emitted when a mount is added.
3238  */
3239
3240
3241 /**
3242  * GVolumeMonitor::mount-changed:
3243  * @volume_monitor: The volume monitor emitting the signal.
3244  * @mount: a #GMount that changed.
3245  *
3246  * Emitted when a mount changes.
3247  */
3248
3249
3250 /**
3251  * GVolumeMonitor::mount-pre-unmount:
3252  * @volume_monitor: The volume monitor emitting the signal.
3253  * @mount: a #GMount that is being unmounted.
3254  *
3255  * Emitted when a mount is about to be removed.
3256  */
3257
3258
3259 /**
3260  * GVolumeMonitor::mount-removed:
3261  * @volume_monitor: The volume monitor emitting the signal.
3262  * @mount: a #GMount that was removed.
3263  *
3264  * Emitted when a mount is removed.
3265  */
3266
3267
3268 /**
3269  * GVolumeMonitor::volume-added:
3270  * @volume_monitor: The volume monitor emitting the signal.
3271  * @volume: a #GVolume that was added.
3272  *
3273  * Emitted when a mountable volume is added to the system.
3274  */
3275
3276
3277 /**
3278  * GVolumeMonitor::volume-changed:
3279  * @volume_monitor: The volume monitor emitting the signal.
3280  * @volume: a #GVolume that changed.
3281  *
3282  * Emitted when mountable volume is changed.
3283  */
3284
3285
3286 /**
3287  * GVolumeMonitor::volume-removed:
3288  * @volume_monitor: The volume monitor emitting the signal.
3289  * @volume: a #GVolume that was removed.
3290  *
3291  * Emitted when a mountable volume is removed from the system.
3292  */
3293
3294
3295 /**
3296  * GWin32InputStream:close-handle:
3297  *
3298  * Whether to close the file handle when the stream is closed.
3299  *
3300  * Since: 2.26
3301  */
3302
3303
3304 /**
3305  * GWin32InputStream:handle:
3306  *
3307  * The handle that the stream reads from.
3308  *
3309  * Since: 2.26
3310  */
3311
3312
3313 /**
3314  * GWin32OutputStream:close-handle:
3315  *
3316  * Whether to close the file handle when the stream is closed.
3317  *
3318  * Since: 2.26
3319  */
3320
3321
3322 /**
3323  * GWin32OutputStream:handle:
3324  *
3325  * The file handle that the stream writes to.
3326  *
3327  * Since: 2.26
3328  */
3329
3330
3331 /**
3332  * GZlibCompressor:
3333  *
3334  * Zlib decompression
3335  */
3336
3337
3338 /**
3339  * GZlibCompressor:file-info:
3340  *
3341  * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3342  * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3343  * and modification time from the file info to the GZIP header.
3344  *
3345  * Since: 2.26
3346  */
3347
3348
3349 /**
3350  * GZlibDecompressor:
3351  *
3352  * Zlib decompression
3353  */
3354
3355
3356 /**
3357  * GZlibDecompressor:file-info:
3358  *
3359  * A #GFileInfo containing the information found in the GZIP header
3360  * of the data stream processed, or %NULL if the header was not yet
3361  * fully processed, is not present at all, or the compressor's
3362  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3363  *
3364  * Since: 2.26
3365  */
3366
3367
3368 /**
3369  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3370  *
3371  * The purpose used to verify the client certificate in a TLS connection.
3372  * Used by TLS servers.
3373  */
3374
3375
3376 /**
3377  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3378  *
3379  * The purpose used to verify the server certificate in a TLS connection. This
3380  * is the most common purpose in use. Used by TLS clients.
3381  */
3382
3383
3384 /**
3385  * G_TYPE_SETTINGS_SCHEMA:
3386  *
3387  * A boxed #GType corresponding to #GSettingsSchema.
3388  *
3389  * Since: 2.32
3390  */
3391
3392
3393 /**
3394  * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3395  *
3396  * A boxed #GType corresponding to #GSettingsSchemaSource.
3397  *
3398  * Since: 2.32
3399  */
3400
3401
3402 /**
3403  * SECTION:extensionpoints
3404  * @short_description: Extension Points
3405  * @include: gio.h
3406  * @see_also: <link linkend="extending-gio">Extending GIO</link>
3407  *
3408  * #GIOExtensionPoint provides a mechanism for modules to extend the
3409  * functionality of the library or application that loaded it in an
3410  * organized fashion.
3411  *
3412  * An extension point is identified by a name, and it may optionally
3413  * require that any implementation must by of a certain type (or derived
3414  * thereof). Use g_io_extension_point_register() to register an
3415  * extension point, and g_io_extension_point_set_required_type() to
3416  * set a required type.
3417  *
3418  * A module can implement an extension point by specifying the #GType
3419  * that implements the functionality. Additionally, each implementation
3420  * of an extension point has a name, and a priority. Use
3421  * g_io_extension_point_implement() to implement an extension point.
3422  *
3423  *  |[
3424  *  GIOExtensionPoint *ep;
3425  *
3426  *  /&ast; Register an extension point &ast;/
3427  *  ep = g_io_extension_point_register ("my-extension-point");
3428  *  g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3429  *  ]|
3430  *
3431  *  |[
3432  *  /&ast; Implement an extension point &ast;/
3433  *  G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3434  *  g_io_extension_point_implement ("my-extension-point",
3435  *                                  my_example_impl_get_type (),
3436  *                                  "my-example",
3437  *                                  10);
3438  *  ]|
3439  *
3440  *  It is up to the code that registered the extension point how
3441  *  it uses the implementations that have been associated with it.
3442  *  Depending on the use case, it may use all implementations, or
3443  *  only the one with the highest priority, or pick a specific
3444  *  one by name.
3445  *
3446  *  To avoid opening all modules just to find out what extension
3447  *  points they implement, GIO makes use of a caching mechanism,
3448  *  see <link linkend="gio-querymodules">gio-querymodules</link>.
3449  *  You are expected to run this command after installing a
3450  *  GIO module.
3451  *
3452  *  The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3453  *  used to specify additional directories to automatically load modules
3454  *  from. This environment variable has the same syntax as the
3455  *  <envar>PATH</envar>. If two modules have the same base name in different
3456  *  directories, then the latter one will be ignored. If additional
3457  *  directories are specified GIO will load modules from the built-in
3458  *  directory last.
3459  */
3460
3461
3462 /**
3463  * SECTION:gaction
3464  * @title: GAction
3465  * @short_description: An action interface
3466  *
3467  * #GAction represents a single named action.
3468  *
3469  * The main interface to an action is that it can be activated with
3470  * g_action_activate().  This results in the 'activate' signal being
3471  * emitted.  An activation has a #GVariant parameter (which may be
3472  * %NULL).  The correct type for the parameter is determined by a static
3473  * parameter type (which is given at construction time).
3474  *
3475  * An action may optionally have a state, in which case the state may be
3476  * set with g_action_change_state().  This call takes a #GVariant.  The
3477  * correct type for the state is determined by a static state type
3478  * (which is given at construction time).
3479  *
3480  * The state may have a hint associated with it, specifying its valid
3481  * range.
3482  *
3483  * #GAction is merely the interface to the concept of an action, as
3484  * described above.  Various implementations of actions exist, including
3485  * #GSimpleAction and #GtkAction.
3486  *
3487  * In all cases, the implementing class is responsible for storing the
3488  * name of the action, the parameter type, the enabled state, the
3489  * optional state type and the state and emitting the appropriate
3490  * signals when these change.  The implementor responsible for filtering
3491  * calls to g_action_activate() and g_action_change_state() for type
3492  * safety and for the state being enabled.
3493  *
3494  * Probably the only useful thing to do with a #GAction is to put it
3495  * inside of a #GSimpleActionGroup.
3496  */
3497
3498
3499 /**
3500  * SECTION:gactiongroup
3501  * @title: GActionGroup
3502  * @short_description: A group of actions
3503  * @see_also: #GAction
3504  *
3505  * #GActionGroup represents a group of actions. Actions can be used to
3506  * expose functionality in a structured way, either from one part of a
3507  * program to another, or to the outside world. Action groups are often
3508  * used together with a #GMenuModel that provides additional
3509  * representation data for displaying the actions to the user, e.g. in
3510  * a menu.
3511  *
3512  * The main way to interact with the actions in a GActionGroup is to
3513  * activate them with g_action_group_activate_action(). Activating an
3514  * action may require a #GVariant parameter. The required type of the
3515  * parameter can be inquired with g_action_group_get_action_parameter_type().
3516  * Actions may be disabled, see g_action_group_get_action_enabled().
3517  * Activating a disabled action has no effect.
3518  *
3519  * Actions may optionally have a state in the form of a #GVariant. The
3520  * current state of an action can be inquired with
3521  * g_action_group_get_action_state(). Activating a stateful action may
3522  * change its state, but it is also possible to set the state by calling
3523  * g_action_group_change_action_state().
3524  *
3525  * As typical example, consider a text editing application which has an
3526  * option to change the current font to 'bold'. A good way to represent
3527  * this would be a stateful action, with a boolean state. Activating the
3528  * action would toggle the state.
3529  *
3530  * Each action in the group has a unique name (which is a string).  All
3531  * method calls, except g_action_group_list_actions() take the name of
3532  * an action as an argument.
3533  *
3534  * The #GActionGroup API is meant to be the 'public' API to the action
3535  * group.  The calls here are exactly the interaction that 'external
3536  * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3537  * with actions.  'Internal' APIs (ie: ones meant only to be accessed by
3538  * the action group implementation) are found on subclasses.  This is
3539  * why you will find - for example - g_action_group_get_action_enabled()
3540  * but not an equivalent <function>set()</function> call.
3541  *
3542  * Signals are emitted on the action group in response to state changes
3543  * on individual actions.
3544  *
3545  * Implementations of #GActionGroup should provide implementations for
3546  * the virtual functions g_action_group_list_actions() and
3547  * g_action_group_query_action().  The other virtual functions should
3548  * not be implemented - their "wrappers" are actually implemented with
3549  * calls to g_action_group_query_action().
3550  */
3551
3552
3553 /**
3554  * SECTION:gactiongroupexporter
3555  * @title: GActionGroup exporter
3556  * @short_description: Export GActionGroups on D-Bus
3557  * @see_also: #GActionGroup, #GDBusActionGroup
3558  *
3559  * These functions support exporting a #GActionGroup on D-Bus.
3560  * The D-Bus interface that is used is a private implementation
3561  * detail.
3562  *
3563  * To access an exported #GActionGroup remotely, use
3564  * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3565  */
3566
3567
3568 /**
3569  * SECTION:gactionmap
3570  * @title: GActionMap
3571  * @short_description: Interface for action containers
3572  *
3573  * The GActionMap interface is implemented by #GActionGroup
3574  * implementations that operate by containing a number of
3575  * named #GAction instances, such as #GSimpleActionGroup.
3576  *
3577  * One useful application of this interface is to map the
3578  * names of actions from various action groups to unique,
3579  * prefixed names (e.g. by prepending "app." or "win.").
3580  * This is the motivation for the 'Map' part of the interface
3581  * name.
3582  *
3583  * Since: 2.32
3584  */
3585
3586
3587 /**
3588  * SECTION:gappinfo
3589  * @short_description: Application information and launch contexts
3590  * @include: gio/gio.h
3591  *
3592  * #GAppInfo and #GAppLaunchContext are used for describing and launching
3593  * applications installed on the system.
3594  *
3595  * As of GLib 2.20, URIs will always be converted to POSIX paths
3596  * (using g_file_get_path()) when using g_app_info_launch() even if
3597  * the application requested an URI and not a POSIX path. For example
3598  * for an desktop-file based application with Exec key <literal>totem
3599  * &percnt;U</literal> and a single URI,
3600  * <literal>sftp://foo/file.avi</literal>, then
3601  * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3602  * passed. This will only work if a set of suitable GIO extensions
3603  * (such as gvfs 2.26 compiled with FUSE support), is available and
3604  * operational; if this is not the case, the URI will be passed
3605  * unmodified to the application. Some URIs, such as
3606  * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3607  * path (in gvfs there's no FUSE mount for it); such URIs will be
3608  * passed unmodified to the application.
3609  *
3610  * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3611  * back to the GIO URI in the #GFile constructors (since gvfs
3612  * implements the #GVfs extension point). As such, if the application
3613  * needs to examine the URI, it needs to use g_file_get_uri() or
3614  * similar on #GFile. In other words, an application cannot assume
3615  * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3616  * equal to the result of g_file_get_uri(). The following snippet
3617  * illustrates this:
3618  *
3619  * <programlisting>
3620  * GFile *f;
3621  * char *uri;
3622  *
3623  * file = g_file_new_for_commandline_arg (uri_from_commandline);
3624  *
3625  * uri = g_file_get_uri (file);
3626  * strcmp (uri, uri_from_commandline) == 0; // FALSE
3627  * g_free (uri);
3628  *
3629  * if (g_file_has_uri_scheme (file, "cdda"))
3630  *   {
3631  *     // do something special with uri
3632  *   }
3633  * g_object_unref (file);
3634  * </programlisting>
3635  *
3636  * This code will work when both <literal>cdda://sr0/Track
3637  * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3638  * 1.wav</literal> is passed to the application. It should be noted
3639  * that it's generally not safe for applications to rely on the format
3640  * of a particular URIs. Different launcher applications (e.g. file
3641  * managers) may have different ideas of what a given URI means.
3642  */
3643
3644
3645 /**
3646  * SECTION:gapplication
3647  * @title: GApplication
3648  * @short_description: Core application class
3649  *
3650  * A #GApplication is the foundation of an application.  It wraps some
3651  * low-level platform-specific services and is intended to act as the
3652  * foundation for higher-level application classes such as
3653  * #GtkApplication or #MxApplication.  In general, you should not use
3654  * this class outside of a higher level framework.
3655  *
3656  * GApplication provides convenient life cycle management by maintaining
3657  * a <firstterm>use count</firstterm> for the primary application instance.
3658  * The use count can be changed using g_application_hold() and
3659  * g_application_release(). If it drops to zero, the application exits.
3660  * Higher-level classes such as #GtkApplication employ the use count to
3661  * ensure that the application stays alive as long as it has any opened
3662  * windows.
3663  *
3664  * Another feature that GApplication (optionally) provides is process
3665  * uniqueness.  Applications can make use of this functionality by
3666  * providing a unique application ID.  If given, only one application
3667  * with this ID can be running at a time per session.  The session
3668  * concept is platform-dependent, but corresponds roughly to a graphical
3669  * desktop login.  When your application is launched again, its
3670  * arguments are passed through platform communication to the already
3671  * running program.  The already running instance of the program is
3672  * called the <firstterm>primary instance</firstterm>; for non-unique
3673  * applications this is the always the current instance.
3674  * On Linux, the D-Bus session bus is used for communication.
3675  *
3676  * The use of #GApplication differs from some other commonly-used
3677  * uniqueness libraries (such as libunique) in important ways.  The
3678  * application is not expected to manually register itself and check if
3679  * it is the primary instance.  Instead, the <code>main()</code>
3680  * function of a #GApplication should do very little more than
3681  * instantiating the application instance, possibly connecting signal
3682  * handlers, then calling g_application_run().  All checks for
3683  * uniqueness are done internally.  If the application is the primary
3684  * instance then the startup signal is emitted and the mainloop runs.
3685  * If the application is not the primary instance then a signal is sent
3686  * to the primary instance and g_application_run() promptly returns.
3687  * See the code examples below.
3688  *
3689  * If used, the expected form of an application identifier is very close
3690  * to that of of a
3691  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3692  * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3693  * For details on valid application identifiers, see g_application_id_is_valid().
3694  *
3695  * On Linux, the application identifier is claimed as a well-known bus name
3696  * on the user's session bus.  This means that the uniqueness of your
3697  * application is scoped to the current session.  It also means that your
3698  * application may provide additional services (through registration of other
3699  * object paths) at that bus name.  The registration of these object paths
3700  * should be done with the shared GDBus session bus.  Note that due to the
3701  * internal architecture of GDBus, method calls can be dispatched at any time
3702  * (even if a main loop is not running).  For this reason, you must ensure that
3703  * any object paths that you wish to register are registered before #GApplication
3704  * attempts to acquire the bus name of your application (which happens in
3705  * g_application_register()).  Unfortunately, this means that you cannot use
3706  * g_application_get_is_remote() to decide if you want to register object paths.
3707  *
3708  * GApplication also implements the #GActionGroup and #GActionMap
3709  * interfaces and lets you easily export actions by adding them with
3710  * g_action_map_add_action(). When invoking an action by calling
3711  * g_action_group_activate_action() on the application, it is always
3712  * invoked in the primary instance. The actions are also exported on
3713  * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3714  * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3715  * for remote access to exported #GMenuModels.
3716  *
3717  * There is a number of different entry points into a GApplication:
3718  * <itemizedlist>
3719  * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3720  * <listitem>via 'Open' (i.e. opening some files)</listitem>
3721  * <listitem>by handling a command-line</listitem>
3722  * <listitem>via activating an action</listitem>
3723  * </itemizedlist>
3724  * The #GApplication::startup signal lets you handle the application
3725  * initialization for all of these in a single place.
3726  *
3727  * Regardless of which of these entry points is used to start the application,
3728  * GApplication passes some <firstterm id="platform-data">platform
3729  * data</firstterm> from the launching instance to the primary instance,
3730  * in the form of a #GVariant dictionary mapping strings to variants.
3731  * To use platform data, override the @before_emit or @after_emit virtual
3732  * functions in your #GApplication subclass. When dealing with
3733  * #GApplicationCommandLine objects, the platform data is directly
3734  * available via g_application_command_line_get_cwd(),
3735  * g_application_command_line_get_environ() and
3736  * g_application_command_line_get_platform_data().
3737  *
3738  * As the name indicates, the platform data may vary depending on the
3739  * operating system, but it always includes the current directory (key
3740  * "cwd"), and optionally the environment (ie the set of environment
3741  * variables and their values) of the calling process (key "environ").
3742  * The environment is only added to the platform data if the
3743  * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3744  * can add their own platform data by overriding the @add_platform_data
3745  * virtual function. For instance, #GtkApplication adds startup notification
3746  * data in this way.
3747  *
3748  * To parse commandline arguments you may handle the
3749  * #GApplication::command-line signal or override the local_command_line()
3750  * vfunc, to parse them in either the primary instance or the local instance,
3751  * respectively.
3752  *
3753  * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3754  * <programlisting>
3755  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3756  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3757  * </xi:include>
3758  * </programlisting>
3759  * </example>
3760  *
3761  * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3762  * <programlisting>
3763  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3764  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3765  * </xi:include>
3766  * </programlisting>
3767  * </example>
3768  *
3769  * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3770  * <programlisting>
3771  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3772  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3773  * </xi:include>
3774  * </programlisting>
3775  * </example>
3776  *
3777  * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3778  * <programlisting>
3779  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3780  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3781  * </xi:include>
3782  * </programlisting>
3783  * </example>
3784  */
3785
3786
3787 /**
3788  * SECTION:gapplicationcommandline
3789  * @title: GApplicationCommandLine
3790  * @short_description: A command-line invocation of an application
3791  * @see_also: #GApplication
3792  *
3793  * #GApplicationCommandLine represents a command-line invocation of
3794  * an application.  It is created by #GApplication and emitted
3795  * in the #GApplication::command-line signal and virtual function.
3796  *
3797  * The class contains the list of arguments that the program was invoked
3798  * with.  It is also possible to query if the commandline invocation was
3799  * local (ie: the current process is running in direct response to the
3800  * invocation) or remote (ie: some other process forwarded the
3801  * commandline to this process).
3802  *
3803  * The GApplicationCommandLine object can provide the @argc and @argv
3804  * parameters for use with the #GOptionContext command-line parsing API,
3805  * with the g_application_command_line_get_arguments() function. See
3806  * <xref linkend="gapplication-example-cmdline3"/> for an example.
3807  *
3808  * The exit status of the originally-invoked process may be set and
3809  * messages can be printed to stdout or stderr of that process.  The
3810  * lifecycle of the originally-invoked process is tied to the lifecycle
3811  * of this object (ie: the process exits when the last reference is
3812  * dropped).
3813  *
3814  * The main use for #GApplicationCommandLine (and the
3815  * #GApplication::command-line signal) is 'Emacs server' like use cases:
3816  * You can set the <envar>EDITOR</envar> environment variable to have
3817  * e.g. git use your favourite editor to edit commit messages, and if you
3818  * already have an instance of the editor running, the editing will happen
3819  * in the running instance, instead of opening a new one. An important
3820  * aspect of this use case is that the process that gets started by git
3821  * does not return until the editing is done.
3822  *
3823  * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3824  * <para>
3825  * A simple example where the commandline is completely handled
3826  * in the #GApplication::command-line handler. The launching instance exits
3827  * once the signal handler in the primary instance has returned, and the
3828  * return value of the signal handler becomes the exit status of the launching
3829  * instance.
3830  * </para>
3831  * <programlisting>
3832  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3833  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3834  * </xi:include>
3835  * </programlisting>
3836  * </example>
3837  *
3838  * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3839  * <para>
3840  * An example of split commandline handling. Options that start with
3841  * <literal>--local-</literal> are handled locally, all other options are
3842  * passed to the #GApplication::command-line handler which runs in the primary
3843  * instance.
3844  * </para>
3845  * <programlisting>
3846  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3847  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3848  * </xi:include>
3849  * </programlisting>
3850  * </example>
3851  *
3852  * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3853  * <para>
3854  * An example of deferred commandline handling. Here, the commandline is
3855  * not completely handled before the #GApplication::command-line handler
3856  * returns. Instead, we keep a reference to the GApplicationCommandLine
3857  * object and handle it later(in this example, in an idle). Note that it
3858  * is necessary to hold the application until you are done with the
3859  * commandline.
3860  * </para>
3861  * <para>
3862  * This example also shows how to use #GOptionContext for parsing the
3863  * commandline arguments. Note that it is necessary to disable the
3864  * built-in help-handling of #GOptionContext, since it calls exit()
3865  * after printing help, which is not what you want to happen in
3866  * the primary instance.
3867  * </para>
3868  * <programlisting>
3869  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3870  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3871  * </xi:include>
3872  * </programlisting>
3873  * </example>
3874  */
3875
3876
3877 /**
3878  * SECTION:gasyncinitable
3879  * @short_description: Asynchronously failable object initialization interface
3880  * @include: gio/gio.h
3881  * @see_also: #GInitable
3882  *
3883  * This is the asynchronous version of #GInitable; it behaves the same
3884  * in all ways except that initialization is asynchronous. For more details
3885  * see the descriptions on #GInitable.
3886  *
3887  * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3888  *
3889  * Users of objects implementing this are not intended to use the interface
3890  * method directly; instead it will be used automatically in various ways.
3891  * For C applications you generally just call g_async_initable_new_async()
3892  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3893  * g_async_initable_init_async() under the cover, calling back with %NULL and
3894  * a set %GError on failure.
3895  *
3896  * A typical implementation might look something like this:
3897  *
3898  * |[
3899  * enum {
3900  *    NOT_INITIALIZED,
3901  *    INITIALIZING,
3902  *    INITIALIZED
3903  * };
3904  *
3905  * static void
3906  * _foo_ready_cb (Foo *self)
3907  * {
3908  *   GList *l;
3909  *
3910  *   self->priv->state = INITIALIZED;
3911  *
3912  *   for (l = self->priv->init_results; l != NULL; l = l->next)
3913  *     {
3914  *       GTask *task = l->data;
3915  *
3916  *       if (self->priv->success)
3917  *         g_task_return_boolean (task, TRUE);
3918  *       else
3919  *         g_task_return_new_error (task, ...);
3920  *       g_object_unref (task);
3921  *     }
3922  *
3923  *   g_list_free (self->priv->init_results);
3924  *   self->priv->init_results = NULL;
3925  * }
3926  *
3927  * static void
3928  * foo_init_async (GAsyncInitable       *initable,
3929  *                 int                   io_priority,
3930  *                 GCancellable         *cancellable,
3931  *                 GAsyncReadyCallback   callback,
3932  *                 gpointer              user_data)
3933  * {
3934  *   Foo *self = FOO (initable);
3935  *   GTask *task;
3936  *
3937  *   task = g_task_new (initable, cancellable, callback, user_data);
3938  *
3939  *   switch (self->priv->state)
3940  *     {
3941  *       case NOT_INITIALIZED:
3942  *         _foo_get_ready (self);
3943  *         self->priv->init_results = g_list_append (self->priv->init_results,
3944  *                                                   task);
3945  *         self->priv->state = INITIALIZING;
3946  *         break;
3947  *       case INITIALIZING:
3948  *         self->priv->init_results = g_list_append (self->priv->init_results,
3949  *                                                   task);
3950  *         break;
3951  *       case INITIALIZED:
3952  *         if (!self->priv->success)
3953  *           g_task_return_new_error (task, ...);
3954  *         else
3955  *           g_task_return_boolean (task, TRUE);
3956  *         g_object_unref (task);
3957  *         break;
3958  *     }
3959  * }
3960  *
3961  * static gboolean
3962  * foo_init_finish (GAsyncInitable       *initable,
3963  *                  GAsyncResult         *result,
3964  *                  GError              **error)
3965  * {
3966  *   g_return_val_if_fail (g_task_is_valid (result, initable), FALSE);
3967  *
3968  *   return g_task_propagate_boolean (G_TASK (result), error);
3969  * }
3970  *
3971  * static void
3972  * foo_async_initable_iface_init (gpointer g_iface,
3973  *                                gpointer data)
3974  * {
3975  *   GAsyncInitableIface *iface = g_iface;
3976  *
3977  *   iface->init_async = foo_init_async;
3978  *   iface->init_finish = foo_init_finish;
3979  * }
3980  * ]|
3981  */
3982
3983
3984 /**
3985  * SECTION:gasyncresult
3986  * @short_description: Asynchronous Function Results
3987  * @include: gio/gio.h
3988  * @see_also: #GTask
3989  *
3990  * Provides a base class for implementing asynchronous function results.
3991  *
3992  * Asynchronous operations are broken up into two separate operations
3993  * which are chained together by a #GAsyncReadyCallback. To begin
3994  * an asynchronous operation, provide a #GAsyncReadyCallback to the
3995  * asynchronous function. This callback will be triggered when the
3996  * operation has completed, and will be passed a #GAsyncResult instance
3997  * filled with the details of the operation's success or failure, the
3998  * object the asynchronous function was started for and any error codes
3999  * returned. The asynchronous callback function is then expected to call
4000  * the corresponding "_finish()" function, passing the object the
4001  * function was called for, the #GAsyncResult instance, and (optionally)
4002  * an @error to grab any error conditions that may have occurred.
4003  *
4004  * The "_finish()" function for an operation takes the generic result
4005  * (of type #GAsyncResult) and returns the specific result that the
4006  * operation in question yields (e.g. a #GFileEnumerator for a
4007  * "enumerate children" operation). If the result or error status of the
4008  * operation is not needed, there is no need to call the "_finish()"
4009  * function; GIO will take care of cleaning up the result and error
4010  * information after the #GAsyncReadyCallback returns. You can pass
4011  * %NULL for the #GAsyncReadyCallback if you don't need to take any
4012  * action at all after the operation completes. Applications may also
4013  * take a reference to the #GAsyncResult and call "_finish()" later;
4014  * however, the "_finish()" function may be called at most once.
4015  *
4016  * Example of a typical asynchronous operation flow:
4017  * |[
4018  * void _theoretical_frobnitz_async (Theoretical         *t,
4019  *                                   GCancellable        *c,
4020  *                                   GAsyncReadyCallback  cb,
4021  *                                   gpointer             u);
4022  *
4023  * gboolean _theoretical_frobnitz_finish (Theoretical   *t,
4024  *                                        GAsyncResult  *res,
4025  *                                        GError       **e);
4026  *
4027  * static void
4028  * frobnitz_result_func (GObject      *source_object,
4029  *               GAsyncResult *res,
4030  *               gpointer      user_data)
4031  * {
4032  *   gboolean success = FALSE;
4033  *
4034  *   success = _theoretical_frobnitz_finish (source_object, res, NULL);
4035  *
4036  *   if (success)
4037  *     g_printf ("Hurray!\n");
4038  *   else
4039  *     g_printf ("Uh oh!\n");
4040  *
4041  *   /<!-- -->* ... *<!-- -->/
4042  *
4043  * }
4044  *
4045  * int main (int argc, void *argv[])
4046  * {
4047  *    /<!-- -->* ... *<!-- -->/
4048  *
4049  *    _theoretical_frobnitz_async (theoretical_data,
4050  *                                 NULL,
4051  *                                 frobnitz_result_func,
4052  *                                 NULL);
4053  *
4054  *    /<!-- -->* ... *<!-- -->/
4055  * }
4056  * ]|
4057  *
4058  * The callback for an asynchronous operation is called only once, and is
4059  * always called, even in the case of a cancelled operation. On cancellation
4060  * the result is a %G_IO_ERROR_CANCELLED error.
4061  *
4062  * <para id="io-priority"><indexterm><primary>I/O
4063  * priority</primary></indexterm> Many I/O-related asynchronous
4064  * operations have a priority parameter, which is used in certain
4065  * cases to determine the order in which operations are executed. They
4066  * are <emphasis>not</emphasis> used to determine system-wide I/O
4067  * scheduling. Priorities are integers, with lower numbers indicating
4068  * higher priority. It is recommended to choose priorities between
4069  * %G_PRIORITY_LOW and %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a
4070  * default. </para>
4071  */
4072
4073
4074 /**
4075  * SECTION:gbufferedinputstream
4076  * @short_description: Buffered Input Stream
4077  * @include: gio/gio.h
4078  * @see_also: #GFilterInputStream, #GInputStream
4079  *
4080  * Buffered input stream implements #GFilterInputStream and provides
4081  * for buffered reads.
4082  *
4083  * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
4084  *
4085  * To create a buffered input stream, use g_buffered_input_stream_new(),
4086  * or g_buffered_input_stream_new_sized() to specify the buffer's size at
4087  * construction.
4088  *
4089  * To get the size of a buffer within a buffered input stream, use
4090  * g_buffered_input_stream_get_buffer_size(). To change the size of a
4091  * buffered input stream's buffer, use
4092  * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
4093  * cannot be reduced below the size of the data within the buffer.
4094  */
4095
4096
4097 /**
4098  * SECTION:gbufferedoutputstream
4099  * @short_description: Buffered Output Stream
4100  * @include: gio/gio.h
4101  * @see_also: #GFilterOutputStream, #GOutputStream
4102  *
4103  * Buffered output stream implements #GFilterOutputStream and provides
4104  * for buffered writes.
4105  *
4106  * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
4107  *
4108  * To create a buffered output stream, use g_buffered_output_stream_new(),
4109  * or g_buffered_output_stream_new_sized() to specify the buffer's size
4110  * at construction.
4111  *
4112  * To get the size of a buffer within a buffered input stream, use
4113  * g_buffered_output_stream_get_buffer_size(). To change the size of a
4114  * buffered output stream's buffer, use
4115  * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
4116  * size cannot be reduced below the size of the data within the buffer.
4117  */
4118
4119
4120 /**
4121  * SECTION:gbytesicon
4122  * @short_description: An icon stored in memory as a GBytes
4123  * @include: gio/gio.h
4124  * @see_also: #GIcon, #GLoadableIcon, #GBytes
4125  *
4126  * #GBytesIcon specifies an image held in memory in a common format (usually
4127  * png) to be used as icon.
4128  *
4129  * Since: 2.38
4130  */
4131
4132
4133 /**
4134  * SECTION:gcancellable
4135  * @short_description: Thread-safe Operation Cancellation Stack
4136  * @include: gio/gio.h
4137  *
4138  * GCancellable is a thread-safe operation cancellation stack used
4139  * throughout GIO to allow for cancellation of synchronous and
4140  * asynchronous operations.
4141  */
4142
4143
4144 /**
4145  * SECTION:gcharsetconverter
4146  * @short_description: Convert between charsets
4147  * @include: gio/gio.h
4148  *
4149  * #GCharsetConverter is an implementation of #GConverter based on
4150  * GIConv.
4151  */
4152
4153
4154 /**
4155  * SECTION:gcontenttype
4156  * @short_description: Platform-specific content typing
4157  * @include: gio/gio.h
4158  *
4159  * A content type is a platform specific string that defines the type
4160  * of a file. On UNIX it is a <ulink url="http://www.wikipedia.org/wiki/Internet_media_type">mime type</ulink> like "text/plain" or "image/png".
4161  * On Win32 it is an extension string like ".doc", ".txt" or a perceived
4162  * string like "audio". Such strings can be looked up in the registry at
4163  * HKEY_CLASSES_ROOT.
4164  */
4165
4166
4167 /**
4168  * SECTION:gconverter
4169  * @short_description: Data conversion interface
4170  * @include: gio/gio.h
4171  * @see_also: #GInputStream, #GOutputStream
4172  *
4173  * #GConverter is implemented by objects that convert
4174  * binary data in various ways. The conversion can be
4175  * stateful and may fail at any place.
4176  *
4177  * Some example conversions are: character set conversion,
4178  * compression, decompression and regular expression
4179  * replace.
4180  *
4181  * Since: 2.24
4182  */
4183
4184
4185 /**
4186  * SECTION:gconverterinputstream
4187  * @short_description: Converter Input Stream
4188  * @include: gio/gio.h
4189  * @see_also: #GInputStream, #GConverter
4190  *
4191  * Converter input stream implements #GInputStream and allows
4192  * conversion of data of various types during reading.
4193  *
4194  * As of GLib 2.34, #GConverterInputStream implements
4195  * #GPollableInputStream.
4196  */
4197
4198
4199 /**
4200  * SECTION:gconverteroutputstream
4201  * @short_description: Converter Output Stream
4202  * @include: gio/gio.h
4203  * @see_also: #GOutputStream, #GConverter
4204  *
4205  * Converter output stream implements #GOutputStream and allows
4206  * conversion of data of various types during reading.
4207  *
4208  * As of GLib 2.34, #GConverterOutputStream implements
4209  * #GPollableOutputStream.
4210  */
4211
4212
4213 /**
4214  * SECTION:gcredentials
4215  * @short_description: An object containing credentials
4216  * @include: gio/gio.h
4217  *
4218  * The #GCredentials type is a reference-counted wrapper for native
4219  * credentials. This information is typically used for identifying,
4220  * authenticating and authorizing other processes.
4221  *
4222  * Some operating systems supports looking up the credentials of the
4223  * remote peer of a communication endpoint - see e.g.
4224  * g_socket_get_credentials().
4225  *
4226  * Some operating systems supports securely sending and receiving
4227  * credentials over a Unix Domain Socket, see
4228  * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
4229  * g_unix_connection_receive_credentials() for details.
4230  *
4231  * On Linux, the native credential type is a <type>struct ucred</type>
4232  * - see the
4233  * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
4234  * man page for details. This corresponds to
4235  * %G_CREDENTIALS_TYPE_LINUX_UCRED.
4236  *
4237  * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
4238  * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
4239  *
4240  * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4241  * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4242  */
4243
4244
4245 /**
4246  * SECTION:gdatainputstream
4247  * @short_description: Data Input Stream
4248  * @include: gio/gio.h
4249  * @see_also: #GInputStream
4250  *
4251  * Data input stream implements #GInputStream and includes functions for
4252  * reading structured data directly from a binary input stream.
4253  */
4254
4255
4256 /**
4257  * SECTION:gdataoutputstream
4258  * @short_description: Data Output Stream
4259  * @include: gio/gio.h
4260  * @see_also: #GOutputStream
4261  *
4262  * Data output stream implements #GOutputStream and includes functions for
4263  * writing data directly to an output stream.
4264  */
4265
4266
4267 /**
4268  * SECTION:gdbusactiongroup
4269  * @title: GDBusActionGroup
4270  * @short_description: A D-Bus GActionGroup implementation
4271  * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4272  *
4273  * #GDBusActionGroup is an implementation of the #GActionGroup
4274  * interface that can be used as a proxy for an action group
4275  * that is exported over D-Bus with g_dbus_connection_export_action_group().
4276  */
4277
4278
4279 /**
4280  * SECTION:gdbusaddress
4281  * @title: D-Bus Addresses
4282  * @short_description: D-Bus connection endpoints
4283  * @include: gio/gio.h
4284  *
4285  * Routines for working with D-Bus addresses. A D-Bus address is a string
4286  * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4287  * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html&num;addresses">D-Bus specification</link>.
4288  */
4289
4290
4291 /**
4292  * SECTION:gdbusauthobserver
4293  * @short_description: Object used for authenticating connections
4294  * @include: gio/gio.h
4295  *
4296  * The #GDBusAuthObserver type provides a mechanism for participating
4297  * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4298  * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4299  * signals you are interested in. Note that new signals may be added
4300  * in the future
4301  *
4302  * For example, if you only want to allow D-Bus connections from
4303  * processes owned by the same uid as the server, you would use a
4304  * signal handler like the following:
4305  * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4306  * static gboolean
4307  * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4308  *                                  GIOStream         *stream,
4309  *                                  GCredentials      *credentials,
4310  *                                  gpointer           user_data)
4311  * {
4312  *   gboolean authorized;
4313  *
4314  *   authorized = FALSE;
4315  *   if (credentials != NULL)
4316  *     {
4317  *       GCredentials *own_credentials;
4318  *       own_credentials = g_credentials_new ();
4319  *       if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4320  *         authorized = TRUE;
4321  *       g_object_unref (own_credentials);
4322  *     }
4323  *
4324  *   return authorized;
4325  * }
4326  * </programlisting></example>
4327  */
4328
4329
4330 /**
4331  * SECTION:gdbusconnection
4332  * @short_description: D-Bus Connections
4333  * @include: gio/gio.h
4334  *
4335  * The #GDBusConnection type is used for D-Bus connections to remote
4336  * peers such as a message buses. It is a low-level API that offers a
4337  * lot of flexibility. For instance, it lets you establish a connection
4338  * over any transport that can by represented as an #GIOStream.
4339  *
4340  * This class is rarely used directly in D-Bus clients. If you are writing
4341  * an D-Bus client, it is often easier to use the g_bus_own_name(),
4342  * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4343  *
4344  * As an exception to the usual GLib rule that a particular object must not be
4345  * used by two threads at the same time, #GDBusConnection's methods may be
4346  * called from any thread<footnote>
4347  * <para>
4348  *   This is so that g_bus_get() and g_bus_get_sync() can safely return the
4349  *   same #GDBusConnection when called from any thread.
4350  * </para>
4351  * </footnote>.
4352  *
4353  * Most of the ways to obtain a #GDBusConnection automatically initialize it
4354  * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4355  * g_bus_get(), and the synchronous versions of those methods, give you an
4356  * initialized connection. Language bindings for GIO should use
4357  * g_initable_new() or g_async_initable_new_async(), which also initialize the
4358  * connection.
4359  *
4360  * If you construct an uninitialized #GDBusConnection, such as via
4361  * g_object_new(), you must initialize it via g_initable_init() or
4362  * g_async_initable_init_async() before using its methods or properties.
4363  * Calling methods or accessing properties on a #GDBusConnection that has not
4364  * completed initialization successfully is considered to be invalid, and leads
4365  * to undefined behaviour. In particular, if initialization fails with a
4366  * #GError, the only valid thing you can do with that #GDBusConnection is to
4367  * free it with g_object_unref().
4368  *
4369  * <example id="gdbus-server"><title>D-Bus server example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-server.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4370  *
4371  * <example id="gdbus-subtree-server"><title>D-Bus subtree example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-subtree.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4372  *
4373  * <example id="gdbus-unix-fd-client"><title>D-Bus UNIX File Descriptor example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-unix-fd-client.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4374  *
4375  * <example id="gdbus-export"><title>Exporting a GObject</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-export.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4376  */
4377
4378
4379 /**
4380  * SECTION:gdbuserror
4381  * @title: GDBusError
4382  * @short_description: Mapping D-Bus errors to and from GError
4383  * @include: gio/gio.h
4384  *
4385  * All facilities that return errors from remote methods (such as
4386  * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4387  * errors (e.g. errors returned from the other peer) and locally
4388  * in-process generated errors.
4389  *
4390  * To check if a returned #GError is an error from a remote peer, use
4391  * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4392  * use g_dbus_error_get_remote_error(). Before presenting an error,
4393  * always use g_dbus_error_strip_remote_error().
4394  *
4395  * In addition, facilities used to return errors to a remote peer also
4396  * use #GError. See g_dbus_method_invocation_return_error() for
4397  * discussion about how the D-Bus error name is set.
4398  *
4399  * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4400  * automatically map from D-Bus errors to #GError and back. This
4401  * is typically done in the function returning the #GQuark for the
4402  * error domain:
4403  * <example id="error-registration"><title>Error Registration</title><programlisting>
4404  * /<!-- -->* foo-bar-error.h: *<!-- -->/
4405  *
4406  * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4407  * GQuark foo_bar_error_quark (void);
4408  *
4409  * typedef enum
4410  * {
4411  *   FOO_BAR_ERROR_FAILED,
4412  *   FOO_BAR_ERROR_ANOTHER_ERROR,
4413  *   FOO_BAR_ERROR_SOME_THIRD_ERROR,
4414  *   FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4415  * } FooBarError;
4416  *
4417  * /<!-- -->* foo-bar-error.c: *<!-- -->/
4418  *
4419  * static const GDBusErrorEntry foo_bar_error_entries[] =
4420  * {
4421  *   {FOO_BAR_ERROR_FAILED,           "org.project.Foo.Bar.Error.Failed"},
4422  *   {FOO_BAR_ERROR_ANOTHER_ERROR,    "org.project.Foo.Bar.Error.AnotherError"},
4423  *   {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4424  * };
4425  *
4426  * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4427  * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4428  *
4429  * GQuark
4430  * foo_bar_error_quark (void)
4431  * {
4432  *   static volatile gsize quark_volatile = 0;
4433  *   g_dbus_error_register_error_domain ("foo-bar-error-quark",
4434  *                                       &quark_volatile,
4435  *                                       foo_bar_error_entries,
4436  *                                       G_N_ELEMENTS (foo_bar_error_entries));
4437  *   return (GQuark) quark_volatile;
4438  * }
4439  * </programlisting></example>
4440  * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4441  * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4442  *
4443  * If the other peer is using GDBus, and has registered the association with
4444  * g_dbus_error_register_error_domain() in advance (e.g. by invoking the %FOO_BAR_ERROR quark
4445  * generation itself in the previous example) the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4446  * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4447  * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4448  *
4449  * Note that errors in the %G_DBUS_ERROR error domain is intended only
4450  * for returning errors from a remote message bus process. Errors
4451  * generated locally in-process by e.g. #GDBusConnection is from the
4452  * %G_IO_ERROR domain.
4453  */
4454
4455
4456 /**
4457  * SECTION:gdbusinterface
4458  * @short_description: Base type for D-Bus interfaces
4459  * @include: gio/gio.h
4460  *
4461  * The #GDBusInterface type is the base type for D-Bus interfaces both
4462  * on the service side (see #GDBusInterfaceSkeleton) and client side
4463  * (see #GDBusProxy).
4464  */
4465
4466
4467 /**
4468  * SECTION:gdbusinterfaceskeleton
4469  * @short_description: Service-side D-Bus interface
4470  * @include: gio/gio.h
4471  *
4472  * Abstract base class for D-Bus interfaces on the service side.
4473  */
4474
4475
4476 /**
4477  * SECTION:gdbusintrospection
4478  * @title: D-Bus Introspection Data
4479  * @short_description: Node and interface description data structures
4480  * @include: gio/gio.h
4481  *
4482  * Various data structures and convenience routines to parse and
4483  * generate D-Bus introspection XML. Introspection information is
4484  * used when registering objects with g_dbus_connection_register_object().
4485  *
4486  * The format of D-Bus introspection XML is specified in the
4487  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4488  */
4489
4490
4491 /**
4492  * SECTION:gdbusmenumodel
4493  * @title: GDBusMenuModel
4494  * @short_description: A D-Bus GMenuModel implementation
4495  * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4496  *
4497  * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4498  * as a proxy for a menu model that is exported over D-Bus with
4499  * g_dbus_connection_export_menu_model().
4500  */
4501
4502
4503 /**
4504  * SECTION:gdbusmessage
4505  * @short_description: D-Bus Message
4506  * @include: gio/gio.h
4507  *
4508  * A type for representing D-Bus messages that can be sent or received
4509  * on a #GDBusConnection.
4510  */
4511
4512
4513 /**
4514  * SECTION:gdbusmethodinvocation
4515  * @short_description: Object for handling remote calls
4516  * @include: gio/gio.h
4517  *
4518  * Instances of the #GDBusMethodInvocation class are used when
4519  * handling D-Bus method calls. It provides a way to asynchronously
4520  * return results and errors.
4521  *
4522  * The normal way to obtain a #GDBusMethodInvocation object is to receive
4523  * it as an argument to the handle_method_call() function in a
4524  * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4525  */
4526
4527
4528 /**
4529  * SECTION:gdbusnameowning
4530  * @title: Owning Bus Names
4531  * @short_description: Simple API for owning bus names
4532  * @include: gio/gio.h
4533  *
4534  * Convenience API for owning bus names.
4535  *
4536  * <example id="gdbus-owning-names"><title>Simple application owning a name</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-own-name.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4537  */
4538
4539
4540 /**
4541  * SECTION:gdbusnamewatching
4542  * @title: Watching Bus Names
4543  * @short_description: Simple API for watching bus names
4544  * @include: gio/gio.h
4545  *
4546  * Convenience API for watching bus names.
4547  *
4548  * <example id="gdbus-watching-names"><title>Simple application watching a name</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-watch-name.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4549  */
4550
4551
4552 /**
4553  * SECTION:gdbusobject
4554  * @short_description: Base type for D-Bus objects
4555  * @include: gio/gio.h
4556  *
4557  * The #GDBusObject type is the base type for D-Bus objects on both
4558  * the service side (see #GDBusObjectSkeleton) and the client side
4559  * (see #GDBusObjectProxy). It is essentially just a container of
4560  * interfaces.
4561  */
4562
4563
4564 /**
4565  * SECTION:gdbusobjectmanager
4566  * @short_description: Base type for D-Bus object managers
4567  * @include: gio/gio.h
4568  *
4569  * The #GDBusObjectManager type is the base type for service- and
4570  * client-side implementations of the standardized <ulink
4571  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4572  * interface.
4573  *
4574  * See #GDBusObjectManagerClient for the client-side implementation
4575  * and #GDBusObjectManagerServer for the service-side implementation.
4576  */
4577
4578
4579 /**
4580  * SECTION:gdbusobjectmanagerclient
4581  * @short_description: Client-side object manager
4582  * @include: gio/gio.h
4583  *
4584  * #GDBusObjectManagerClient is used to create, monitor and delete object
4585  * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4586  * code implementing the <ulink
4587  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4588  * interface).
4589  *
4590  * Once an instance of this type has been created, you can connect to
4591  * the #GDBusObjectManager::object-added and
4592  * #GDBusObjectManager::object-removed signals and inspect the
4593  * #GDBusObjectProxy objects returned by
4594  * g_dbus_object_manager_get_objects().
4595  *
4596  * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4597  * object construction time, the default behavior is to request the
4598  * message bus to launch an owner for the name. This behavior can be
4599  * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4600  * flag. It's also worth noting that this only works if the name of
4601  * interest is activatable in the first place. E.g. in some cases it
4602  * is not possible to launch an owner for the requested name. In this
4603  * case, #GDBusObjectManagerClient object construction still succeeds but
4604  * there will be no object proxies
4605  * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4606  * the #GDBusObjectManagerClient:name-owner property is %NULL.
4607  *
4608  * The owner of the requested name can come and go (for example
4609  * consider a system service being restarted) â€“ #GDBusObjectManagerClient
4610  * handles this case too; simply connect to the #GObject::notify
4611  * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4612  * property. When the name owner vanishes, the behavior is that
4613  * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4614  * emission of the #GObject::notify signal) and then
4615  * #GDBusObjectManager::object-removed signals are synthesized
4616  * for all currently existing object proxies. Since
4617  * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4618  * use this information to disambiguate a synthesized signal from a
4619  * genuine signal caused by object removal on the remote
4620  * #GDBusObjectManager. Similarly, when a new name owner appears,
4621  * #GDBusObjectManager::object-added signals are synthesized
4622  * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4623  * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4624  * is set to the new name owner (this includes emission of the
4625  * #GObject::notify signal).  Furthermore, you are guaranteed that
4626  * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4627  * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4628  * the name of interest is atomically replaced
4629  *
4630  * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4631  * instances. All signals (including the
4632  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4633  * signal) delivered to #GDBusProxy instances are guaranteed to
4634  * originate from the name owner. This guarantee along with the
4635  * behavior described above, means that certain race conditions
4636  * including the <emphasis><quote>half the proxy is from the old owner
4637  * and the other half is from the new owner</quote></emphasis> problem
4638  * cannot happen.
4639  *
4640  * To avoid having the application connect to signals on the returned
4641  * #GDBusObjectProxy and #GDBusProxy objects, the
4642  * #GDBusObject::interface-added,
4643  * #GDBusObject::interface-removed,
4644  * #GDBusProxy::g-properties-changed and
4645  * #GDBusProxy::g-signal signals
4646  * are also emitted on the #GDBusObjectManagerClient instance managing these
4647  * objects. The signals emitted are
4648  * #GDBusObjectManager::interface-added,
4649  * #GDBusObjectManager::interface-removed,
4650  * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4651  * #GDBusObjectManagerClient::interface-proxy-signal.
4652  *
4653  * Note that all callbacks and signals are emitted in the
4654  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4655  * that the #GDBusObjectManagerClient object was constructed
4656  * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4657  * originating from the #GDBusObjectManagerClient object will be created in
4658  * the same context and, consequently, will deliver signals in the
4659  * same main loop.
4660  */
4661
4662
4663 /**
4664  * SECTION:gdbusobjectmanagerserver
4665  * @short_description: Service-side object manager
4666  * @include: gio/gio.h
4667  *
4668  * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4669  * the standardized <ulink
4670  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4671  * interface. For example, remote D-Bus clients can get all objects
4672  * and properties in a single call. Additionally, any change in the
4673  * object hierarchy is broadcast using signals. This means that D-Bus
4674  * clients can keep caches up to date by only listening to D-Bus
4675  * signals.
4676  *
4677  * See #GDBusObjectManagerClient for the client-side code that is
4678  * intended to be used with #GDBusObjectManagerServer or any D-Bus
4679  * object implementing the org.freedesktop.DBus.ObjectManager
4680  * interface.
4681  */
4682
4683
4684 /**
4685  * SECTION:gdbusobjectproxy
4686  * @short_description: Client-side D-Bus object
4687  * @include: gio/gio.h
4688  *
4689  * A #GDBusObjectProxy is an object used to represent a remote object
4690  * with one or more D-Bus interfaces. Normally, you don't instantiate
4691  * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4692  * is used to obtain it.
4693  *
4694  * Since: 2.30
4695  */
4696
4697
4698 /**
4699  * SECTION:gdbusobjectskeleton
4700  * @short_description: Service-side D-Bus object
4701  * @include: gio/gio.h
4702  *
4703  * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4704  * interfaces. The set of exported interfaces on the object may be
4705  * dynamic and change at runtime.
4706  *
4707  * This type is intended to be used with #GDBusObjectManager.
4708  */
4709
4710
4711 /**
4712  * SECTION:gdbusproxy
4713  * @short_description: Client-side D-Bus interface proxy
4714  * @include: gio/gio.h
4715  *
4716  * #GDBusProxy is a base class used for proxies to access a D-Bus
4717  * interface on a remote object. A #GDBusProxy can be constructed for
4718  * both well-known and unique names.
4719  *
4720  * By default, #GDBusProxy will cache all properties (and listen to
4721  * changes) of the remote object, and proxy all signals that gets
4722  * emitted. This behaviour can be changed by passing suitable
4723  * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4724  * well-known name, the property cache is flushed when the name owner
4725  * vanishes and reloaded when a name owner appears.
4726  *
4727  * If a #GDBusProxy is used for a well-known name, the owner of the
4728  * name is tracked and can be read from
4729  * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4730  * get notified of changes. Additionally, only signals and property
4731  * changes emitted from the current name owner are considered and
4732  * calls are always sent to the current name owner. This avoids a
4733  * number of race conditions when the name is lost by one owner and
4734  * claimed by another. However, if no name owner currently exists,
4735  * then calls will be sent to the well-known name which may result in
4736  * the message bus launching an owner (unless
4737  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4738  *
4739  * The generic #GDBusProxy::g-properties-changed and
4740  * #GDBusProxy::g-signal signals are not very convenient to work
4741  * with. Therefore, the recommended way of working with proxies is to
4742  * subclass #GDBusProxy, and have more natural properties and signals
4743  * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4744  * for how this can easily be done using the
4745  * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4746  * tool.
4747  *
4748  * A #GDBusProxy instance can be used from multiple threads but note
4749  * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4750  * and #GObject::notify) are emitted in the
4751  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4752  * of the thread where the instance was constructed.
4753  *
4754  * <example id="gdbus-wellknown-proxy"><title>GDBusProxy for a well-known-name</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-watch-proxy.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4755  */
4756
4757
4758 /**
4759  * SECTION:gdbusserver
4760  * @short_description: Helper for accepting connections
4761  * @include: gio/gio.h
4762  *
4763  * #GDBusServer is a helper for listening to and accepting D-Bus
4764  * connections. This can be used to create a new D-Bus server, allowing two
4765  * peers to use the D-Bus protocol for their own specialized communication.
4766  * A server instance provided in this way will not perform message routing or
4767  * implement the org.freedesktop.DBus interface.
4768  *
4769  * To just export an object on a well-known name on a message bus, such as the
4770  * session or system bus, you should instead use g_bus_own_name().
4771  *
4772  * <example id="gdbus-peer-to-peer"><title>D-Bus peer-to-peer example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-peer.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4773  */
4774
4775
4776 /**
4777  * SECTION:gdbusutils
4778  * @title: D-Bus Utilities
4779  * @short_description: Various utilities related to D-Bus
4780  * @include: gio/gio.h
4781  *
4782  * Various utility routines related to D-Bus.
4783  */
4784
4785
4786 /**
4787  * SECTION:gdesktopappinfo
4788  * @title: GDesktopAppInfo
4789  * @short_description: Application information from desktop files
4790  * @include: gio/gdesktopappinfo.h
4791  *
4792  * #GDesktopAppInfo is an implementation of #GAppInfo based on
4793  * desktop files.
4794  *
4795  * Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
4796  * the UNIX-specific GIO interfaces, thus you have to use the
4797  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4798  */
4799
4800
4801 /**
4802  * SECTION:gdrive
4803  * @short_description: Drive management
4804  * @include: gio/gio.h
4805  *
4806  * #GDrive - this represent a piece of hardware connected to the machine.
4807  * It's generally only created for removable hardware or hardware with
4808  * removable media.
4809  *
4810  * #GDrive is a container class for #GVolume objects that stem from
4811  * the same piece of media. As such, #GDrive abstracts a drive with
4812  * (or without) removable media and provides operations for querying
4813  * whether media is available, determining whether media change is
4814  * automatically detected and ejecting the media.
4815  *
4816  * If the #GDrive reports that media isn't automatically detected, one
4817  * can poll for media; typically one should not do this periodically
4818  * as a poll for media operation is potententially expensive and may
4819  * spin up the drive creating noise.
4820  *
4821  * #GDrive supports starting and stopping drives with authentication
4822  * support for the former. This can be used to support a diverse set
4823  * of use cases including connecting/disconnecting iSCSI devices,
4824  * powering down external disk enclosures and starting/stopping
4825  * multi-disk devices such as RAID devices. Note that the actual
4826  * semantics and side-effects of starting/stopping a #GDrive may vary
4827  * according to implementation. To choose the correct verbs in e.g. a
4828  * file manager, use g_drive_get_start_stop_type().
4829  *
4830  * For porting from GnomeVFS note that there is no equivalent of
4831  * #GDrive in that API.
4832  */
4833
4834
4835 /**
4836  * SECTION:gemblem
4837  * @short_description: An object for emblems
4838  * @include: gio/gio.h
4839  * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4840  *
4841  * #GEmblem is an implementation of #GIcon that supports
4842  * having an emblem, which is an icon with additional properties.
4843  * It can than be added to a #GEmblemedIcon.
4844  *
4845  * Currently, only metainformation about the emblem's origin is
4846  * supported. More may be added in the future.
4847  */
4848
4849
4850 /**
4851  * SECTION:gemblemedicon
4852  * @short_description: Icon with emblems
4853  * @include: gio/gio.h
4854  * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4855  *
4856  * #GEmblemedIcon is an implementation of #GIcon that supports
4857  * adding an emblem to an icon. Adding multiple emblems to an
4858  * icon is ensured via g_emblemed_icon_add_emblem().
4859  *
4860  * Note that #GEmblemedIcon allows no control over the position
4861  * of the emblems. See also #GEmblem for more information.
4862  */
4863
4864
4865 /**
4866  * SECTION:gfile
4867  * @short_description: File and Directory Handling
4868  * @include: gio/gio.h
4869  * @see_also: #GFileInfo, #GFileEnumerator
4870  *
4871  * #GFile is a high level abstraction for manipulating files on a
4872  * virtual file system. #GFiles are lightweight, immutable objects
4873  * that do no I/O upon creation. It is necessary to understand that
4874  * #GFile objects do not represent files, merely an identifier for a
4875  * file. All file content I/O is implemented as streaming operations
4876  * (see #GInputStream and #GOutputStream).
4877  *
4878  * To construct a #GFile, you can use:
4879  * <simplelist>
4880  * <member>g_file_new_for_path() if you have a path.</member>
4881  * <member>g_file_new_for_uri() if you have a URI.</member>
4882  * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4883  * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4884  * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4885  * </simplelist>
4886  *
4887  * One way to think of a #GFile is as an abstraction of a pathname. For
4888  * normal files the system pathname is what is stored internally, but as
4889  * #GFiles are extensible it could also be something else that corresponds
4890  * to a pathname in a userspace implementation of a filesystem.
4891  *
4892  * #GFiles make up hierarchies of directories and files that correspond to
4893  * the files on a filesystem. You can move through the file system with
4894  * #GFile using g_file_get_parent() to get an identifier for the parent
4895  * directory, g_file_get_child() to get a child within a directory,
4896  * g_file_resolve_relative_path() to resolve a relative path between two
4897  * #GFiles. There can be multiple hierarchies, so you may not end up at
4898  * the same root if you repeatedly call g_file_get_parent() on two different
4899  * files.
4900  *
4901  * All #GFiles have a basename (get with g_file_get_basename()). These names
4902  * are byte strings that are used to identify the file on the filesystem
4903  * (relative to its parent directory) and there is no guarantees that they
4904  * have any particular charset encoding or even make any sense at all. If
4905  * you want to use filenames in a user interface you should use the display
4906  * name that you can get by requesting the
4907  * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4908  * This is guaranteed to be in UTF-8 and can be used in a user interface.
4909  * But always store the real basename or the #GFile to use to actually
4910  * access the file, because there is no way to go from a display name to
4911  * the actual name.
4912  *
4913  * Using #GFile as an identifier has the same weaknesses as using a path
4914  * in that there may be multiple aliases for the same file. For instance,
4915  * hard or soft links may cause two different #GFiles to refer to the same
4916  * file. Other possible causes for aliases are: case insensitive filesystems,
4917  * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4918  * check if two #GFiles point to the same file you can query for the
4919  * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4920  * canonicalization of pathnames passed in, so that trivial differences in
4921  * the path string used at creation (duplicated slashes, slash at end of
4922  * path, "." or ".." path segments, etc) does not create different #GFiles.
4923  *
4924  * Many #GFile operations have both synchronous and asynchronous versions
4925  * to suit your application. Asynchronous versions of synchronous functions
4926  * simply have _async() appended to their function names. The asynchronous
4927  * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4928  * the operation, producing a GAsyncResult which is then passed to the
4929  * function's matching _finish() operation.
4930  *
4931  * Some #GFile operations do not have synchronous analogs, as they may
4932  * take a very long time to finish, and blocking may leave an application
4933  * unusable. Notable cases include:
4934  * <simplelist>
4935  * <member>g_file_mount_mountable() to mount a mountable file.</member>
4936  * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4937  * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4938  * </simplelist>
4939  *
4940  * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4941  * One notable feature of #GFiles are entity tags, or "etags" for
4942  * short. Entity tags are somewhat like a more abstract version of the
4943  * traditional mtime, and can be used to quickly determine if the file has
4944  * been modified from the version on the file system. See the HTTP 1.1
4945  * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4946  * for HTTP Etag headers, which are a very similar concept.
4947  * </para>
4948  */
4949
4950
4951 /**
4952  * SECTION:gfileattribute
4953  * @short_description: Key-Value Paired File Attributes
4954  * @include: gio/gio.h
4955  * @see_also: #GFile, #GFileInfo
4956  *
4957  * File attributes in GIO consist of a list of key-value pairs.
4958  *
4959  * Keys are strings that contain a key namespace and a key name, separated
4960  * by a colon, e.g. "namespace::keyname". Namespaces are included to sort
4961  * key-value pairs by namespaces for relevance. Keys can be retrived
4962  * using wildcards, e.g. "standard::*" will return all of the keys in the
4963  * "standard" namespace.
4964  *
4965  * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4966  * available as a #GFileAttributeInfoList. This list is queryable by key names
4967  * as indicated earlier.
4968  *
4969  * Information is stored within the list in #GFileAttributeInfo structures.
4970  * The info structure can store different types, listed in the enum
4971  * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4972  * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4973  *
4974  * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4975  * install default keys and values for their given file system, architecture,
4976  * and other possible implementation details (e.g., on a UNIX system, a file
4977  * attribute key will be registered for the user id for a given file).
4978  *
4979  * <para>
4980  * <table>
4981  * <title>GFileAttributes Default Namespaces</title>
4982  * <tgroup cols='2' align='left'><thead>
4983  * <row><entry>Namspace</entry><entry>Description</entry></row>
4984  * </thead>
4985  * <tbody>
4986  * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4987  * information that any application may need should be put in this namespace.
4988  * Examples include the file's name, type, and size.</entry></row>
4989  * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4990  * namespace. Currently, the only key in this namespace is "value", which contains
4991  * the value of the current entity tag.</entry></row>
4992  * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4993  * namespace is used by file managers and applications that list directories
4994  * to check for loops and to uniquely identify files.</entry></row>
4995  * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4996  * if a user has the proper privilidges to access files and perform
4997  * file operations. Keys in this namespace are made to be generic
4998  * and easily understood, e.g. the "can_read" key is %TRUE if
4999  * the current user has permission to read the file. UNIX permissions and
5000  * NTFS ACLs in Windows should be mapped to these values.</entry></row>
5001  * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
5002  * simple boolean keys for checking if a file or path supports mount operations, e.g.
5003  * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
5004  * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
5005  * access, changed, created times. </entry></row>
5006  * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
5007  * information and may not be available for all files. Examples include
5008  * the UNIX "UID", "GID", etc.</entry></row>
5009  * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
5010  * information and may not be available for all files. Examples include
5011  * "is_system" for checking if a file is marked as a system file, and "is_archive"
5012  * for checking if a file is marked as an archive file.</entry></row>
5013  * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
5014  * about who owns a file. May not be available for all file systems. Examples include
5015  * "user" for getting the user name of the file owner. This information is often mapped from
5016  * some backend specific data such as a unix UID.</entry></row>
5017  * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
5018  * information about file thumbnails and their location within the file system. Examples of
5019  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
5020  * to check if thumbnailing of the file failed.</entry></row>
5021  * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
5022  * about the file system where a file is located, such as its type, how much
5023  * space is left available, and the overall size of the file system.</entry></row>
5024  * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
5025  * contain information about the current GVFS backend in use. </entry></row>
5026  * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
5027  * about extended user attributes. See attr(5). The "user." prefix of the
5028  * extended user attribute name is stripped away when constructing keys in
5029  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
5030  * the name "user.mime_type". Note that this information is only available
5031  * if GLib has been built with extended attribute support.</entry></row>
5032  * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
5033  * Gets information about extended attributes which are not user-specific.
5034  * See attr(5). Note that this information is only available if GLib
5035  * has been built with extended attribute support.</entry></row>
5036  * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
5037  * information about the SELinux context of files. Note that this information
5038  * is only available if GLib has been built with SELinux support.</entry></row>
5039  * </tbody>
5040  * </tgroup>
5041  * </table>
5042  * </para>
5043  *
5044  * Please note that these are not all of the possible namespaces.
5045  * More namespaces can be added from GIO modules or by individual applications.
5046  * For more information about writing GIO modules, see #GIOModule.
5047  *
5048  * <!-- TODO: Implementation note about using extended attributes on supported
5049  * file systems -->
5050  *
5051  * <para><table>
5052  * <title>GFileAttributes Built-in Keys and Value Types</title>
5053  * <tgroup cols='3' align='left'><thead>
5054  * <row><entry>Enum Value</entry><entry>Namespace::Key</entry><entry>Value Type</entry></row>
5055  * </thead><tbody>
5056  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
5057  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
5058  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
5059  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
5060  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
5061  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
5062  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
5063  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
5064  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
5065  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
5066  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
5067  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
5068  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
5069  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
5070  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
5071  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
5072  * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
5073  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
5074  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
5075  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
5076  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
5077  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
5078  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
5079  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
5080  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
5081  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
5082  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
5083  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
5084  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
5085  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
5086  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
5087  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
5088  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
5089  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
5090  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
5091  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
5092  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
5093  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
5094  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
5095  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
5096  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
5097  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
5098  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
5099  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
5100  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
5101  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
5102  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
5103  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
5104  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
5105  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
5106  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
5107  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
5108  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
5109  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
5110  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
5111  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
5112  * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
5113  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
5114  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
5115  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
5116  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
5117  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
5118  * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
5119  * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
5120  * </tbody></tgroup></table></para>
5121  *
5122  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
5123  * namespaces. Keys for the "xattr" namespace are constructed by stripping
5124  * away the "user." prefix from the extended user attribute, and prepending
5125  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
5126  * concatenating "xattr-sys::" with the extended attribute name. All extended
5127  * attribute values are returned as hex-encoded strings in which bytes outside
5128  * the ASCII range are encoded as hexadecimal escape sequences of the form
5129  * \x<replaceable>nn</replaceable>.
5130  */
5131
5132
5133 /**
5134  * SECTION:gfiledescriptorbased
5135  * @short_description: Interface for file descriptor based IO
5136  * @include: gio/gfiledescriptorbased.h
5137  * @see_also: #GInputStream, #GOutputStream
5138  *
5139  * #GFileDescriptorBased is implemented by streams (implementations of
5140  * #GInputStream or #GOutputStream) that are based on file descriptors.
5141  *
5142  * Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
5143  * the UNIX-specific GIO interfaces, thus you have to use the
5144  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
5145  *
5146  * Since: 2.24
5147  */
5148
5149
5150 /**
5151  * SECTION:gfileenumerator
5152  * @short_description: Enumerated Files Routines
5153  * @include: gio/gio.h
5154  *
5155  * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
5156  * returning a #GFileInfo structure for each file enumerated (e.g.
5157  * g_file_enumerate_children() will return a #GFileEnumerator for each
5158  * of the children within a directory).
5159  *
5160  * To get the next file's information from a #GFileEnumerator, use
5161  * g_file_enumerator_next_file() or its asynchronous version,
5162  * g_file_enumerator_next_files_async(). Note that the asynchronous
5163  * version will return a list of #GFileInfo<!---->s, whereas the
5164  * synchronous will only return the next file in the enumerator.
5165  *
5166  * The ordering of returned files is unspecified for non-Unix
5167  * platforms; for more information, see g_dir_read_name().  On Unix,
5168  * when operating on local files, returned files will be sorted by
5169  * inode number.  Effectively you can assume that the ordering of
5170  * returned files will be stable between successive calls (and
5171  * applications) assuming the directory is unchanged.
5172  *
5173  * If your application needs a specific ordering, such as by name or
5174  * modification time, you will have to implement that in your
5175  * application code.
5176  *
5177  * To close a #GFileEnumerator, use g_file_enumerator_close(), or
5178  * its asynchronous version, g_file_enumerator_close_async(). Once
5179  * a #GFileEnumerator is closed, no further actions may be performed
5180  * on it, and it should be freed with g_object_unref().
5181  */
5182
5183
5184 /**
5185  * SECTION:gfileicon
5186  * @short_description: Icons pointing to an image file
5187  * @include: gio/gio.h
5188  * @see_also: #GIcon, #GLoadableIcon
5189  *
5190  * #GFileIcon specifies an icon by pointing to an image file
5191  * to be used as icon.
5192  */
5193
5194
5195 /**
5196  * SECTION:gfileinfo
5197  * @short_description: File Information and Attributes
5198  * @include: gio/gio.h
5199  * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
5200  *
5201  * Functionality for manipulating basic metadata for files. #GFileInfo
5202  * implements methods for getting information that all files should
5203  * contain, and allows for manipulation of extended attributes.
5204  *
5205  * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
5206  * information on how GIO handles file attributes.
5207  *
5208  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
5209  * async variant). To obtain a #GFileInfo for a file input or output
5210  * stream, use g_file_input_stream_query_info() or
5211  * g_file_output_stream_query_info() (or their async variants).
5212  *
5213  * To change the actual attributes of a file, you should then set the
5214  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
5215  * or g_file_set_attributes_async() on a GFile.
5216  *
5217  * However, not all attributes can be changed in the file. For instance,
5218  * the actual size of a file cannot be changed via g_file_info_set_size().
5219  * You may call g_file_query_settable_attributes() and
5220  * g_file_query_writable_namespaces() to discover the settable attributes
5221  * of a particular file at runtime.
5222  *
5223  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
5224  * attributes.
5225  */
5226
5227
5228 /**
5229  * SECTION:gfileinputstream
5230  * @short_description: File input streaming operations
5231  * @include: gio/gio.h
5232  * @see_also: #GInputStream, #GDataInputStream, #GSeekable
5233  *
5234  * GFileInputStream provides input streams that take their
5235  * content from a file.
5236  *
5237  * GFileInputStream implements #GSeekable, which allows the input
5238  * stream to jump to arbitrary positions in the file, provided the
5239  * filesystem of the file allows it. To find the position of a file
5240  * input stream, use g_seekable_tell(). To find out if a file input
5241  * stream supports seeking, use g_seekable_can_seek().
5242  * To position a file input stream, use g_seekable_seek().
5243  */
5244
5245
5246 /**
5247  * SECTION:gfileiostream
5248  * @short_description: File read and write streaming operations
5249  * @include: gio/gio.h
5250  * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
5251  *
5252  * GFileIOStream provides io streams that both read and write to the same
5253  * file handle.
5254  *
5255  * GFileIOStream implements #GSeekable, which allows the io
5256  * stream to jump to arbitrary positions in the file and to truncate
5257  * the file, provided the filesystem of the file supports these
5258  * operations.
5259  *
5260  * To find the position of a file io stream, use
5261  * g_seekable_tell().
5262  *
5263  * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5264  * To position a file io stream, use g_seekable_seek().
5265  * To find out if a file io stream supports truncating, use
5266  * g_seekable_can_truncate(). To truncate a file io
5267  * stream, use g_seekable_truncate().
5268  *
5269  * The default implementation of all the #GFileIOStream operations
5270  * and the implementation of #GSeekable just call into the same operations
5271  * on the output stream.
5272  *
5273  * Since: 2.22
5274  */
5275
5276
5277 /**
5278  * SECTION:gfilemonitor
5279  * @short_description: File Monitor
5280  * @include: gio/gio.h
5281  *
5282  * Monitors a file or directory for changes.
5283  *
5284  * To obtain a #GFileMonitor for a file or directory, use
5285  * g_file_monitor(), g_file_monitor_file(), or
5286  * g_file_monitor_directory().
5287  *
5288  * To get informed about changes to the file or directory you are
5289  * monitoring, connect to the #GFileMonitor::changed signal. The
5290  * signal will be emitted in the <link
5291  * linkend="g-main-context-push-thread-default">thread-default main
5292  * context</link> of the thread that the monitor was created in
5293  * (though if the global default main context is blocked, this may
5294  * cause notifications to be blocked even if the thread-default
5295  * context is still running).
5296  */
5297
5298
5299 /**
5300  * SECTION:gfilenamecompleter
5301  * @short_description: Filename Completer
5302  * @include: gio/gio.h
5303  *
5304  * Completes partial file and directory names given a partial string by
5305  * looking in the file system for clues. Can return a list of possible
5306  * completion strings for widget implementations.
5307  */
5308
5309
5310 /**
5311  * SECTION:gfileoutputstream
5312  * @short_description: File output streaming operations
5313  * @include: gio/gio.h
5314  * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5315  *
5316  * GFileOutputStream provides output streams that write their
5317  * content to a file.
5318  *
5319  * GFileOutputStream implements #GSeekable, which allows the output
5320  * stream to jump to arbitrary positions in the file and to truncate
5321  * the file, provided the filesystem of the file supports these
5322  * operations.
5323  *
5324  * To find the position of a file output stream, use g_seekable_tell().
5325  * To find out if a file output stream supports seeking, use
5326  * g_seekable_can_seek().To position a file output stream, use
5327  * g_seekable_seek(). To find out if a file output stream supports
5328  * truncating, use g_seekable_can_truncate(). To truncate a file output
5329  * stream, use g_seekable_truncate().
5330  */
5331
5332
5333 /**
5334  * SECTION:gfilterinputstream
5335  * @short_description: Filter Input Stream
5336  * @include: gio/gio.h
5337  *
5338  * Base class for input stream implementations that perform some
5339  * kind of filtering operation on a base stream. Typical examples
5340  * of filtering operations are character set conversion, compression
5341  * and byte order flipping.
5342  */
5343
5344
5345 /**
5346  * SECTION:gfilteroutputstream
5347  * @short_description: Filter Output Stream
5348  * @include: gio/gio.h
5349  *
5350  * Base class for output stream implementations that perform some
5351  * kind of filtering operation on a base stream. Typical examples
5352  * of filtering operations are character set conversion, compression
5353  * and byte order flipping.
5354  */
5355
5356
5357 /**
5358  * SECTION:gicon
5359  * @short_description: Interface for icons
5360  * @include: gio/gio.h
5361  *
5362  * #GIcon is a very minimal interface for icons. It provides functions
5363  * for checking the equality of two icons, hashing of icons and
5364  * serializing an icon to and from strings.
5365  *
5366  * #GIcon does not provide the actual pixmap for the icon as this is out
5367  * of GIO's scope, however implementations of #GIcon may contain the name
5368  * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5369  *
5370  * To obtain a hash of a #GIcon, see g_icon_hash().
5371  *
5372  * To check if two #GIcons are equal, see g_icon_equal().
5373  *
5374  * For serializing a #GIcon, use g_icon_serialize() and
5375  * g_icon_deserialize().
5376  *
5377  * If you want to consume #GIcon (for example, in a toolkit) you must
5378  * be prepared to handle at least the three following cases:
5379  * #GLoadableIcon, #GThemedIcon and #GEmblemedIcon.  It may also make
5380  * sense to have fast-paths for other cases (like handling #GdkPixbuf
5381  * directly, for example) but all compliant #GIcon implementations
5382  * outside of GIO must implement #GLoadableIcon.
5383  *
5384  * If your application or library provides one or more #GIcon
5385  * implementations you need to ensure that your new implementation also
5386  * implements #GLoadableIcon.  Additionally, you must provide an
5387  * implementation of g_icon_serialize() that gives a result that is
5388  * understood by g_icon_deserialize(), yielding one of the built-in icon
5389  * types.
5390  */
5391
5392
5393 /**
5394  * SECTION:ginetaddress
5395  * @short_description: An IPv4/IPv6 address
5396  *
5397  * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5398  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5399  * look up the #GInetAddress for a hostname. Use
5400  * g_resolver_lookup_by_address() or
5401  * g_resolver_lookup_by_address_async() to look up the hostname for a
5402  * #GInetAddress.
5403  *
5404  * To actually connect to a remote host, you will need a
5405  * #GInetSocketAddress (which includes a #GInetAddress as well as a
5406  * port number).
5407  */
5408
5409
5410 /**
5411  * SECTION:ginetaddressmask
5412  * @short_description: An IPv4/IPv6 address mask
5413  *
5414  * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5415  * described by a base address and a length indicating how many bits
5416  * of the base address are relevant for matching purposes. These are
5417  * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5418  */
5419
5420
5421 /**
5422  * SECTION:ginetsocketaddress
5423  * @short_description: Internet GSocketAddress
5424  *
5425  * An IPv4 or IPv6 socket address; that is, the combination of a
5426  * #GInetAddress and a port number.
5427  */
5428
5429
5430 /**
5431  * SECTION:ginitable
5432  * @short_description: Failable object initialization interface
5433  * @include: gio/gio.h
5434  * @see_also: #GAsyncInitable
5435  *
5436  * #GInitable is implemented by objects that can fail during
5437  * initialization. If an object implements this interface then
5438  * it must be initialized as the first thing after construction,
5439  * either via g_initable_init() or g_async_initable_init_async()
5440  * (the latter is only available if it also implements #GAsyncInitable).
5441  *
5442  * If the object is not initialized, or initialization returns with an
5443  * error, then all operations on the object except g_object_ref() and
5444  * g_object_unref() are considered to be invalid, and have undefined
5445  * behaviour. They will often fail with g_critical() or g_warning(), but
5446  * this must not be relied on.
5447  *
5448  * Users of objects implementing this are not intended to use
5449  * the interface method directly, instead it will be used automatically
5450  * in various ways. For C applications you generally just call
5451  * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5452  * This will call g_initable_init() under the cover, returning %NULL and
5453  * setting a #GError on failure (at which point the instance is
5454  * unreferenced).
5455  *
5456  * For bindings in languages where the native constructor supports
5457  * exceptions the binding could check for objects implemention %GInitable
5458  * during normal construction and automatically initialize them, throwing
5459  * an exception on failure.
5460  */
5461
5462
5463 /**
5464  * SECTION:ginputstream
5465  * @short_description: Base class for implementing streaming input
5466  * @include: gio/gio.h
5467  *
5468  * #GInputStream has functions to read from a stream (g_input_stream_read()),
5469  * to close a stream (g_input_stream_close()) and to skip some content
5470  * (g_input_stream_skip()).
5471  *
5472  * To copy the content of an input stream to an output stream without
5473  * manually handling the reads and writes, use g_output_stream_splice().
5474  *
5475  * All of these functions have async variants too.
5476  */
5477
5478
5479 /**
5480  * SECTION:gioerror
5481  * @short_description: Error helper functions
5482  * @include: gio/gio.h
5483  *
5484  * Contains helper functions for reporting errors to the user.
5485  */
5486
5487
5488 /**
5489  * SECTION:giomodule
5490  * @short_description: Loadable GIO Modules
5491  * @include: gio/gio.h
5492  *
5493  * Provides an interface and default functions for loading and unloading
5494  * modules. This is used internally to make GIO extensible, but can also
5495  * be used by others to implement module loading.
5496  */
5497
5498
5499 /**
5500  * SECTION:gioscheduler
5501  * @short_description: I/O Scheduler
5502  * @include: gio/gio.h
5503  *
5504  * <note><para>
5505  *   As of GLib 2.36, the <literal>g_io_scheduler</literal> methods
5506  *   are deprecated in favor of #GThreadPool and #GTask.
5507  * </para></note>
5508  *
5509  * Schedules asynchronous I/O operations. #GIOScheduler integrates
5510  * into the main event loop (#GMainLoop) and uses threads.
5511  */
5512
5513
5514 /**
5515  * SECTION:giostream
5516  * @short_description: Base class for implementing read/write streams
5517  * @include: gio/gio.h
5518  * @see_also: #GInputStream, #GOutputStream
5519  *
5520  * GIOStream represents an object that has both read and write streams.
5521  * Generally the two streams acts as separate input and output streams,
5522  * but they share some common resources and state. For instance, for
5523  * seekable streams they may use the same position in both streams.
5524  *
5525  * Examples of #GIOStream objects are #GSocketConnection which represents
5526  * a two-way network connection, and #GFileIOStream which represent a
5527  * file handle opened in read-write mode.
5528  *
5529  * To do the actual reading and writing you need to get the substreams
5530  * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5531  *
5532  * The #GIOStream object owns the input and the output streams, not the other
5533  * way around, so keeping the substreams alive will not keep the #GIOStream
5534  * object alive. If the #GIOStream object is freed it will be closed, thus
5535  * closing the substream, so even if the substreams stay alive they will
5536  * always just return a %G_IO_ERROR_CLOSED for all operations.
5537  *
5538  * To close a stream use g_io_stream_close() which will close the common
5539  * stream object and also the individual substreams. You can also close
5540  * the substreams themselves. In most cases this only marks the
5541  * substream as closed, so further I/O on it fails. However, some streams
5542  * may support "half-closed" states where one direction of the stream
5543  * is actually shut down.
5544  *
5545  * Since: 2.22
5546  */
5547
5548
5549 /**
5550  * SECTION:gloadableicon
5551  * @short_description: Loadable Icons
5552  * @include: gio/gio.h
5553  * @see_also: #GIcon, #GThemedIcon
5554  *
5555  * Extends the #GIcon interface and adds the ability to
5556  * load icons from streams.
5557  */
5558
5559
5560 /**
5561  * SECTION:gmemoryinputstream
5562  * @short_description: Streaming input operations on memory chunks
5563  * @include: gio/gio.h
5564  * @see_also: #GMemoryOutputStream
5565  *
5566  * #GMemoryInputStream is a class for using arbitrary
5567  * memory chunks as input for GIO streaming input operations.
5568  *
5569  * As of GLib 2.34, #GMemoryInputStream implements
5570  * #GPollableInputStream.
5571  */
5572
5573
5574 /**
5575  * SECTION:gmemoryoutputstream
5576  * @short_description: Streaming output operations on memory chunks
5577  * @include: gio/gio.h
5578  * @see_also: #GMemoryInputStream
5579  *
5580  * #GMemoryOutputStream is a class for using arbitrary
5581  * memory chunks as output for GIO streaming output operations.
5582  *
5583  * As of GLib 2.34, #GMemoryOutputStream implements
5584  * #GPollableOutputStream.
5585  */
5586
5587
5588 /**
5589  * SECTION:gmenu
5590  * @title: GMenu
5591  * @short_description: A simple implementation of GMenuModel
5592  *
5593  * #GMenu is a simple implementation of #GMenuModel.
5594  * You populate a #GMenu by adding #GMenuItem instances to it.
5595  *
5596  * There are some convenience functions to allow you to directly
5597  * add items (avoiding #GMenuItem) for the common cases. To add
5598  * a regular item, use g_menu_insert(). To add a section, use
5599  * g_menu_insert_section(). To add a submenu, use
5600  * g_menu_insert_submenu().
5601  */
5602
5603
5604 /**
5605  * SECTION:gmenuexporter
5606  * @title: GMenuModel exporter
5607  * @short_description: Export GMenuModels on D-Bus
5608  * @see_also: #GMenuModel, #GDBusMenuModel
5609  *
5610  * These functions support exporting a #GMenuModel on D-Bus.
5611  * The D-Bus interface that is used is a private implementation
5612  * detail.
5613  *
5614  * To access an exported #GMenuModel remotely, use
5615  * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5616  */
5617
5618
5619 /**
5620  * SECTION:gmenumodel
5621  * @title: GMenuModel
5622  * @short_description: An abstract class representing the contents of a menu
5623  * @see_also: #GActionGroup
5624  *
5625  * #GMenuModel represents the contents of a menu -- an ordered list of
5626  * menu items. The items are associated with actions, which can be
5627  * activated through them. Items can be grouped in sections, and may
5628  * have submenus associated with them. Both items and sections usually
5629  * have some representation data, such as labels or icons. The type of
5630  * the associated action (ie whether it is stateful, and what kind of
5631  * state it has) can influence the representation of the item.
5632  *
5633  * The conceptual model of menus in #GMenuModel is hierarchical:
5634  * sections and submenus are again represented by #GMenuModels.
5635  * Menus themselves do not define their own roles. Rather, the role
5636  * of a particular #GMenuModel is defined by the item that references
5637  * it (or, in the case of the 'root' menu, is defined by the context
5638  * in which it is used).
5639  *
5640  * As an example, consider the visible portions of the menu in
5641  * <xref linkend="menu-example"/>.
5642  *
5643  * <figure id="menu-example">
5644  *   <title>An example menu</title>
5645  *   <graphic fileref="menu-example.png" format="PNG"></graphic>
5646  * </figure>
5647  *
5648  * There are 8 "menus" visible in the screenshot: one menubar, two
5649  * submenus and 5 sections:
5650  * <itemizedlist>
5651  * <listitem>the toplevel menubar (containing 4 items)</listitem>
5652  * <listitem>the View submenu (containing 3 sections)</listitem>
5653  * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5654  * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5655  * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5656  * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5657  * <listitem>the Sources section (containing 2 items)</listitem>
5658  * <listitem>the Markup section (containing 2 items)</listitem>
5659  * </itemizedlist>
5660  *
5661  * <xref linkend="menu-model"/> illustrates the conceptual connection between
5662  * these 8 menus. Each large block in the figure represents a menu and the
5663  * smaller blocks within the large block represent items in that menu. Some
5664  * items contain references to other menus.
5665  *
5666  * <figure id="menu-model">
5667  *   <title>A menu model</title>
5668  *   <graphic fileref="menu-model.png" format="PNG"></graphic>
5669  * </figure>
5670  *
5671  * Notice that the separators visible in <xref linkend="menu-example"/>
5672  * appear nowhere in <xref linkend="menu-model"/>. This is because
5673  * separators are not explicitly represented in the menu model. Instead,
5674  * a separator is inserted between any two non-empty sections of a menu.
5675  * Section items can have labels just like any other item. In that case,
5676  * a display system may show a section header instead of a separator.
5677  *
5678  * The motivation for this abstract model of application controls is
5679  * that modern user interfaces tend to make these controls available
5680  * outside the application. Examples include global menus, jumplists,
5681  * dash boards, etc. To support such uses, it is necessary to 'export'
5682  * information about actions and their representation in menus, which
5683  * is exactly what the
5684  * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5685  * and the
5686  * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5687  * do for #GActionGroup and #GMenuModel. The client-side counterparts
5688  * to make use of the exported information are #GDBusActionGroup and
5689  * #GDBusMenuModel.
5690  *
5691  * The API of #GMenuModel is very generic, with iterators for the
5692  * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5693  * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5694  * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5695  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5696  * and %G_MENU_LINK_SUBMENU.
5697  *
5698  * Items in a #GMenuModel represent active controls if they refer to
5699  * an action that can get activated when the user interacts with the
5700  * menu item. The reference to the action is encoded by the string id
5701  * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5702  * identifies an action in an action group. Which action group(s) provide
5703  * actions depends on the context in which the menu model is used.
5704  * E.g. when the model is exported as the application menu of a
5705  * #GtkApplication, actions can be application-wide or window-specific
5706  * (and thus come from two different action groups). By convention, the
5707  * application-wide actions have names that start with "app.", while the
5708  * names of window-specific actions start with "win.".
5709  *
5710  * While a wide variety of stateful actions is possible, the following
5711  * is the minimum that is expected to be supported by all users of exported
5712  * menu information:
5713  * <itemizedlist>
5714  * <listitem>an action with no parameter type and no state</listitem>
5715  * <listitem>an action with no parameter type and boolean state</listitem>
5716  * <listitem>an action with string parameter type and string state</listitem>
5717  * </itemizedlist>
5718  *
5719  * <formalpara><title>Stateless</title>
5720  * <para>
5721  * A stateless action typically corresponds to an ordinary menu item.
5722  * </para>
5723  * <para>
5724  * Selecting such a menu item will activate the action (with no parameter).
5725  * </para>
5726  * </formalpara>
5727  *
5728  * <formalpara><title>Boolean State</title>
5729  * <para>
5730  * An action with a boolean state will most typically be used with a "toggle"
5731  * or "switch" menu item. The state can be set directly, but activating the
5732  * action (with no parameter) results in the state being toggled.
5733  * </para>
5734  * <para>
5735  * Selecting a toggle menu item will activate the action. The menu item should
5736  * be rendered as "checked" when the state is true.
5737  * </para>
5738  * </formalpara>
5739  *
5740  * <formalpara><title>String Parameter and State</title>
5741  * <para>
5742  * Actions with string parameters and state will most typically be used to
5743  * represent an enumerated choice over the items available for a group of
5744  * radio menu items. Activating the action with a string parameter is
5745  * equivalent to setting that parameter as the state.
5746  * </para>
5747  * <para>
5748  * Radio menu items, in addition to being associated with the action, will
5749  * have a target value. Selecting that menu item will result in activation
5750  * of the action with the target value as the parameter. The menu item should
5751  * be rendered as "selected" when the state of the action is equal to the
5752  * target value of the menu item.
5753  * </para>
5754  * </formalpara>
5755  */
5756
5757
5758 /**
5759  * SECTION:gmount
5760  * @short_description: Mount management
5761  * @include: gio/gio.h
5762  * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5763  *
5764  * The #GMount interface represents user-visible mounts. Note, when
5765  * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5766  *
5767  * #GMount is a "mounted" filesystem that you can access. Mounted is in
5768  * quotes because it's not the same as a unix mount, it might be a gvfs
5769  * mount, but you can still access the files on it if you use GIO. Might or
5770  * might not be related to a volume object.
5771  *
5772  * Unmounting a #GMount instance is an asynchronous operation. For
5773  * more information about asynchronous operations, see #GAsyncResult
5774  * and #GTask. To unmount a #GMount instance, first call
5775  * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5776  * #GAsyncReadyCallback.  The callback will be fired when the
5777  * operation has resolved (either with success or failure), and a
5778  * #GAsyncReady structure will be passed to the callback.  That
5779  * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5780  * and the #GAsyncReady data to see if the operation was completed
5781  * successfully.  If an @error is present when g_mount_unmount_with_operation_finish()
5782  * is called, then it will be filled with any error information.
5783  */
5784
5785
5786 /**
5787  * SECTION:gmountoperation
5788  * @short_description: Object used for authentication and user interaction
5789  * @include: gio/gio.h
5790  *
5791  * #GMountOperation provides a mechanism for interacting with the user.
5792  * It can be used for authenticating mountable operations, such as loop
5793  * mounting files, hard drive partitions or server locations. It can
5794  * also be used to ask the user questions or show a list of applications
5795  * preventing unmount or eject operations from completing.
5796  *
5797  * Note that #GMountOperation is used for more than just #GMount
5798  * objects â€“ for example it is also used in g_drive_start() and
5799  * g_drive_stop().
5800  *
5801  * Users should instantiate a subclass of this that implements all the
5802  * various callbacks to show the required dialogs, such as
5803  * #GtkMountOperation. If no user interaction is desired (for example
5804  * when automounting filesystems at login time), usually %NULL can be
5805  * passed, see each method taking a #GMountOperation for details.
5806  */
5807
5808
5809 /**
5810  * SECTION:gnetworkaddress
5811  * @short_description: A GSocketConnectable for resolving hostnames
5812  * @include: gio/gio.h
5813  *
5814  * #GNetworkAddress provides an easy way to resolve a hostname and
5815  * then attempt to connect to that host, handling the possibility of
5816  * multiple IP addresses and multiple address families.
5817  *
5818  * See #GSocketConnectable for and example of using the connectable
5819  * interface.
5820  */
5821
5822
5823 /**
5824  * SECTION:gnetworking
5825  * @title: gnetworking.h
5826  * @short_description: System networking includes
5827  * @include: gio/gnetworking.h
5828  *
5829  * The <literal>gnetworking.h</literal> header can be included to get
5830  * various low-level networking-related system headers, automatically
5831  * taking care of certain portability issues for you.
5832  *
5833  * This can be used, for example, if you want to call setsockopt()
5834  * on a #GSocket.
5835  *
5836  * Note that while WinSock has many of the same APIs as the
5837  * traditional UNIX socket API, most of them behave at least slightly
5838  * differently (particularly with respect to error handling). If you
5839  * want your code to work under both UNIX and Windows, you will need
5840  * to take these differences into account.
5841  *
5842  * Also, under glibc, certain non-portable functions are only visible
5843  * in the headers if you define <literal>_GNU_SOURCE</literal> before
5844  * including them. Note that this symbol must be defined before
5845  * including <emphasis>any</emphasis> headers, or it may not take
5846  * effect.
5847  */
5848
5849
5850 /**
5851  * SECTION:gnetworkmonitor
5852  * @title: GNetworkMonitor
5853  * @short_description: Network status monitor
5854  * @include: gio/gio.h
5855  *
5856  * #GNetworkMonitor provides an easy-to-use cross-platform API
5857  * for monitoring network connectivity. On Linux, the implementation
5858  * is based on the kernel's netlink interface.
5859  */
5860
5861
5862 /**
5863  * SECTION:gnetworkservice
5864  * @short_description: A GSocketConnectable for resolving SRV records
5865  * @include: gio/gio.h
5866  *
5867  * Like #GNetworkAddress does with hostnames, #GNetworkService
5868  * provides an easy way to resolve a SRV record, and then attempt to
5869  * connect to one of the hosts that implements that service, handling
5870  * service priority/weighting, multiple IP addresses, and multiple
5871  * address families.
5872  *
5873  * See #GSrvTarget for more information about SRV records, and see
5874  * #GSocketConnectable for and example of using the connectable
5875  * interface.
5876  */
5877
5878
5879 /**
5880  * SECTION:goutputstream
5881  * @short_description: Base class for implementing streaming output
5882  * @include: gio/gio.h
5883  *
5884  * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5885  * to close a stream (g_output_stream_close()) and to flush pending writes
5886  * (g_output_stream_flush()).
5887  *
5888  * To copy the content of an input stream to an output stream without
5889  * manually handling the reads and writes, use g_output_stream_splice().
5890  *
5891  * All of these functions have async variants too.
5892  */
5893
5894
5895 /**
5896  * SECTION:gpermission
5897  * @title: GPermission
5898  * @short_description: An object representing the permission to perform a certain action
5899  *
5900  * A #GPermission represents the status of the caller's permission to
5901  * perform a certain action.
5902  *
5903  * You can query if the action is currently allowed and if it is
5904  * possible to acquire the permission so that the action will be allowed
5905  * in the future.
5906  *
5907  * There is also an API to actually acquire the permission and one to
5908  * release it.
5909  *
5910  * As an example, a #GPermission might represent the ability for the
5911  * user to write to a #GSettings object.  This #GPermission object could
5912  * then be used to decide if it is appropriate to show a "Click here to
5913  * unlock" button in a dialog and to provide the mechanism to invoke
5914  * when that button is clicked.
5915  */
5916
5917
5918 /**
5919  * SECTION:gpollableinputstream
5920  * @short_description: Interface for pollable input streams
5921  * @include: gio/gio.h
5922  * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5923  *
5924  * #GPollableInputStream is implemented by #GInputStreams that
5925  * can be polled for readiness to read. This can be used when
5926  * interfacing with a non-GIO API that expects
5927  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5928  *
5929  * Since: 2.28
5930  */
5931
5932
5933 /**
5934  * SECTION:gpollableoutputstream
5935  * @short_description: Interface for pollable output streams
5936  * @include: gio/gio.h
5937  * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5938  *
5939  * #GPollableOutputStream is implemented by #GOutputStreams that
5940  * can be polled for readiness to write. This can be used when
5941  * interfacing with a non-GIO API that expects
5942  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5943  *
5944  * Since: 2.28
5945  */
5946
5947
5948 /**
5949  * SECTION:gpollableutils
5950  * @short_description: Utilities for pollable streams
5951  * @include: gio/gio.h
5952  *
5953  * Utility functions for #GPollableInputStream and
5954  * #GPollableOutputStream implementations.
5955  */
5956
5957
5958 /**
5959  * SECTION:gpropertyaction
5960  * @title: GPropertyAction
5961  * @short_description: A GAction reflecting a GObject property
5962  *
5963  * A #GPropertyAction is a way to get a #GAction with a state value
5964  * reflecting and controlling the value of a #GObject property.
5965  *
5966  * The state of the action will correspond to the value of the property.
5967  * Changing it will change the property (assuming the requested value
5968  * matches the requirements as specified in the #GParamSpec).
5969  *
5970  * Only the most common types are presently supported.  Booleans are
5971  * mapped to booleans, strings to strings, signed/unsigned integers to
5972  * int32/uint32 and floats and doubles to doubles.
5973  *
5974  * If the property is an enum then the state will be string-typed and
5975  * conversion will automatically be performed between the enum value and
5976  * "nick" string as per the #GEnumValue table.
5977  *
5978  * Flags types are not currently supported.
5979  *
5980  * Properties of object types, boxed types and pointer types are not
5981  * supported and probably never will be.
5982  *
5983  * Properties of #GVariant types are not currently supported.
5984  *
5985  * If the property is boolean-valued then the action will have a NULL
5986  * parameter type, and activating the action (with no parameter) will
5987  * toggle the value of the property.
5988  *
5989  * In all other cases, the parameter type will correspond to the type of
5990  * the property.
5991  *
5992  * The general idea here is to reduce the number of locations where a
5993  * particular piece of state is kept (and therefore has to be
5994  * synchronised between).  #GPropertyAction does not have a separate
5995  * state that is kept in sync with the property value -- its state
5996  * <em>is</em> the property value.
5997  *
5998  * For example, it might be useful to create a #GAction corresponding to
5999  * the "visible-child-name" property of a #GtkStack so that the current
6000  * page can be switched from a menu.  The active radio indication in the
6001  * menu is then directly determined from the active page of the
6002  * #GtkStack.
6003  *
6004  * An anti-example would be binding the "active-id" property on a
6005  * #GtkComboBox.  This is because the state of the combobox itself is
6006  * probably uninteresting and is actually being used to control
6007  * something else.
6008  *
6009  * Another anti-example would be to bind to the "visible-child-name"
6010  * property of a #GtkStack if this value is actually stored in
6011  * #GSettings.  In that case, the real source of the value is
6012  * #GSettings.  If you want a #GAction to control a setting stored in
6013  * #GSettings, see g_settings_create_action() instead, and possibly
6014  * combine its use with g_settings_bind().
6015  *
6016  * Since: 2.38
6017  */
6018
6019
6020 /**
6021  * SECTION:gproxy
6022  * @short_description: Interface for proxy handling
6023  *
6024  * A #GProxy handles connecting to a remote host via a given type of
6025  * proxy server. It is implemented by the 'gio-proxy' extension point.
6026  * The extensions are named after their proxy protocol name. As an
6027  * example, a SOCKS5 proxy implementation can be retrieved with the
6028  * name 'socks5' using the function
6029  * g_io_extension_point_get_extension_by_name().
6030  *
6031  * Since: 2.26
6032  */
6033
6034
6035 /**
6036  * SECTION:gproxyaddress
6037  * @short_description: An internet address with proxy information
6038  *
6039  * Support for proxied #GInetSocketAddress.
6040  */
6041
6042
6043 /**
6044  * SECTION:gproxyresolver
6045  * @short_description: Asynchronous and cancellable network proxy resolver
6046  * @include: gio/gio.h
6047  *
6048  * #GProxyResolver provides synchronous and asynchronous network proxy
6049  * resolution. #GProxyResolver is used within #GSocketClient through
6050  * the method g_socket_connectable_proxy_enumerate().
6051  */
6052
6053
6054 /**
6055  * SECTION:gremoteactiongroup
6056  * @title: GRemoteActionGroup
6057  * @short_description: A GActionGroup that interacts with other processes
6058  *
6059  * The GRemoteActionGroup interface is implemented by #GActionGroup
6060  * instances that either transmit action invocations to other processes
6061  * or receive action invocations in the local process from other
6062  * processes.
6063  *
6064  * The interface has <literal>_full</literal> variants of the two
6065  * methods on #GActionGroup used to activate actions:
6066  * g_action_group_activate_action() and
6067  * g_action_group_change_action_state().  These variants allow a
6068  * "platform data" #GVariant to be specified: a dictionary providing
6069  * context for the action invocation (for example: timestamps, startup
6070  * notification IDs, etc).
6071  *
6072  * #GDBusActionGroup implements #GRemoteActionGroup.  This provides a
6073  * mechanism to send platform data for action invocations over D-Bus.
6074  *
6075  * Additionally, g_dbus_connection_export_action_group() will check if
6076  * the exported #GActionGroup implements #GRemoteActionGroup and use the
6077  * <literal>_full</literal> variants of the calls if available.  This
6078  * provides a mechanism by which to receive platform data for action
6079  * invocations that arrive by way of D-Bus.
6080  *
6081  * Since: 2.32
6082  */
6083
6084
6085 /**
6086  * SECTION:gresolver
6087  * @short_description: Asynchronous and cancellable DNS resolver
6088  * @include: gio/gio.h
6089  *
6090  * #GResolver provides cancellable synchronous and asynchronous DNS
6091  * resolution, for hostnames (g_resolver_lookup_by_address(),
6092  * g_resolver_lookup_by_name() and their async variants) and SRV
6093  * (service) records (g_resolver_lookup_service()).
6094  *
6095  * #GNetworkAddress and #GNetworkService provide wrappers around
6096  * #GResolver functionality that also implement #GSocketConnectable,
6097  * making it easy to connect to a remote host/service.
6098  */
6099
6100
6101 /**
6102  * SECTION:gresource
6103  * @short_description: Resource framework
6104  * @include: gio/gio.h
6105  *
6106  * Applications and libraries often contain binary or textual data that is really part of the
6107  * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
6108  * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
6109  * manually included as literal strings in the code.
6110  *
6111  * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
6112  * provide a convenient and efficient alternative to this which has some nice properties. You
6113  * maintain the files as normal files, so its easy to edit them, but during the build the files
6114  * are combined into a binary bundle that is linked into the executable. This means that loading
6115  * the resource files are efficient (as they are already in memory, shared with other instances) and
6116  * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
6117  * also makes it easier to create relocatable applications.
6118  *
6119  * Resource files can also be marked as compressed. Such files will be included in the resource bundle
6120  * in a compressed form, but will be automatically uncompressed when the resource is used. This
6121  * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
6122  *
6123  * Resource files can also be marked to be preprocessed, by setting the value of the
6124  * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
6125  * The only options currently supported are:
6126  *
6127  * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
6128  * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
6129  * environment variable must be set to the full path to the xmllint executable, or xmllint
6130  * must be in the PATH; otherwise the preprocessing step is skipped.
6131  *
6132  * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
6133  * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
6134  * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
6135  * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
6136  * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
6137  * abort.
6138  *
6139  * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
6140  * which takes an xml file that describes the bundle, and a set of files that the xml references. These
6141  * are combined into a binary resource bundle.
6142  *
6143  * <example id="resource-example"><title>Example resource description</title>
6144  * <programlisting><![CDATA[
6145  * <?xml version="1.0" encoding="UTF-8"?>
6146  * <gresources>
6147  *   <gresource prefix="/org/gtk/Example">
6148  *     <file>data/splashscreen.png</file>
6149  *     <file compressed="true">dialog.ui</file>
6150  *     <file preprocess="xml-stripblanks">menumarkup.xml</file>
6151  *   </gresource>
6152  * </gresources>
6153  * ]]></programlisting></example>
6154  *
6155  * This will create a resource bundle with the following files:
6156  * <programlisting><![CDATA[
6157  * /org/gtk/Example/data/splashscreen.png
6158  * /org/gtk/Example/dialog.ui
6159  * /org/gtk/Example/menumarkup.xml
6160  * ]]></programlisting>
6161  *
6162  * Note that all resources in the process share the same namespace, so use java-style
6163  * path prefixes (like in the above example) to avoid conflicts.
6164  *
6165  * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
6166  * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
6167  * --generate-header arguments to create a source file and header to link directly into your application.
6168  *
6169  * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
6170  * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
6171  * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
6172  * the resource data.
6173  *
6174  * There are two forms of the generated source, the default version uses the compiler support for constructor
6175  * and destructor functions (where available) to automatically create and register the #GResource on startup
6176  * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
6177  * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
6178  * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
6179  *
6180  * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
6181  * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
6182  * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
6183  * is for your own resources, and resource data is often used once, during parsing, and then released.
6184  *
6185  * Since: 2.32
6186  */
6187
6188
6189 /**
6190  * SECTION:gseekable
6191  * @short_description: Stream seeking interface
6192  * @include: gio/gio.h
6193  * @see_also: #GInputStream, #GOutputStream
6194  *
6195  * #GSeekable is implemented by streams (implementations of
6196  * #GInputStream or #GOutputStream) that support seeking.
6197  */
6198
6199
6200 /**
6201  * SECTION:gsettings
6202  * @short_description: High-level API for application settings
6203  *
6204  * The #GSettings class provides a convenient API for storing and retrieving
6205  * application settings.
6206  *
6207  * Reads and writes can be considered to be non-blocking.  Reading
6208  * settings with #GSettings is typically extremely fast: on
6209  * approximately the same order of magnitude (but slower than) a
6210  * #GHashTable lookup.  Writing settings is also extremely fast in terms
6211  * of time to return to your application, but can be extremely expensive
6212  * for other threads and other processes.  Many settings backends
6213  * (including dconf) have lazy initialisation which means in the common
6214  * case of the user using their computer without modifying any settings
6215  * a lot of work can be avoided.  For dconf, the D-Bus service doesn't
6216  * even need to be started in this case.  For this reason, you should
6217  * only ever modify #GSettings keys in response to explicit user action.
6218  * Particular care should be paid to ensure that modifications are not
6219  * made during startup -- for example, when setting the initial value
6220  * of preferences widgets.  The built-in g_settings_bind() functionality
6221  * is careful not to write settings in response to notify signals as a
6222  * result of modifications that it makes to widgets.
6223  *
6224  * When creating a GSettings instance, you have to specify a schema
6225  * that describes the keys in your settings and their types and default
6226  * values, as well as some other information.
6227  *
6228  * Normally, a schema has as fixed path that determines where the settings
6229  * are stored in the conceptual global tree of settings. However, schemas
6230  * can also be 'relocatable', i.e. not equipped with a fixed path. This is
6231  * useful e.g. when the schema describes an 'account', and you want to be
6232  * able to store a arbitrary number of accounts.
6233  *
6234  * Paths must start with and end with a forward slash character ('/')
6235  * and must not contain two sequential slash characters.  Paths should
6236  * be chosen based on a domain name associated with the program or
6237  * library to which the settings belong.  Examples of paths are
6238  * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
6239  * Paths should not start with "/apps/", "/desktop/" or "/system/" as
6240  * they often did in GConf.
6241  *
6242  * Unlike other configuration systems (like GConf), GSettings does not
6243  * restrict keys to basic types like strings and numbers. GSettings stores
6244  * values as #GVariant, and allows any #GVariantType for keys. Key names
6245  * are restricted to lowercase characters, numbers and '-'. Furthermore,
6246  * the names must begin with a lowercase character, must not end
6247  * with a '-', and must not contain consecutive dashes.
6248  *
6249  * Similar to GConf, the default values in GSettings schemas can be
6250  * localized, but the localized values are stored in gettext catalogs
6251  * and looked up with the domain that is specified in the
6252  * <tag class="attribute">gettext-domain</tag> attribute of the
6253  * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
6254  * elements and the category that is specified in the l10n attribute of the
6255  * <tag class="starttag">key</tag> element.
6256  *
6257  * GSettings uses schemas in a compact binary form that is created
6258  * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
6259  * utility. The input is a schema description in an XML format that can be
6260  * described by the following DTD:
6261  * |[<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/gschema.dtd"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>]|
6262  *
6263  * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
6264  *
6265  * At runtime, schemas are identified by their id (as specified
6266  * in the <tag class="attribute">id</tag> attribute of the
6267  * <tag class="starttag">schema</tag> element). The
6268  * convention for schema ids is to use a dotted name, similar in
6269  * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
6270  * if the settings are for a specific service that owns a D-Bus bus name,
6271  * the D-Bus bus name and schema id should match. For schemas which deal
6272  * with settings not associated with one named application, the id should
6273  * not use StudlyCaps, e.g. "org.gnome.font-rendering".
6274  *
6275  * In addition to #GVariant types, keys can have types that have enumerated
6276  * types. These can be described by a <tag class="starttag">choice</tag>,
6277  * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
6278  * <xref linkend="schema-enumerated"/>. The underlying type of
6279  * such a key is string, but you can use g_settings_get_enum(),
6280  * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
6281  * access the numeric values corresponding to the string value of enum
6282  * and flags keys.
6283  *
6284  * <example id="schema-default-values"><title>Default values</title>
6285  * <programlisting><![CDATA[
6286  * <schemalist>
6287  *   <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
6288  *
6289  *     <key name="greeting" type="s">
6290  *       <default l10n="messages">"Hello, earthlings"</default>
6291  *       <summary>A greeting</summary>
6292  *       <description>
6293  *         Greeting of the invading martians
6294  *       </description>
6295  *     </key>
6296  *
6297  *     <key name="box" type="(ii)">
6298  *       <default>(20,30)</default>
6299  *     </key>
6300  *
6301  *   </schema>
6302  * </schemalist>
6303  * ]]></programlisting></example>
6304  *
6305  * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
6306  * <programlisting><![CDATA[
6307  * <schemalist>
6308  *
6309  *   <enum id="org.gtk.Test.myenum">
6310  *     <value nick="first" value="1"/>
6311  *     <value nick="second" value="2"/>
6312  *   </enum>
6313  *
6314  *   <flags id="org.gtk.Test.myflags">
6315  *     <value nick="flag1" value="1"/>
6316  *     <value nick="flag2" value="2"/>
6317  *     <value nick="flag3" value="4"/>
6318  *   </flags>
6319  *
6320  *   <schema id="org.gtk.Test">
6321  *
6322  *     <key name="key-with-range" type="i">
6323  *       <range min="1" max="100"/>
6324  *       <default>10</default>
6325  *     </key>
6326  *
6327  *     <key name="key-with-choices" type="s">
6328  *       <choices>
6329  *         <choice value='Elisabeth'/>
6330  *         <choice value='Annabeth'/>
6331  *         <choice value='Joe'/>
6332  *       </choices>
6333  *       <aliases>
6334  *         <alias value='Anna' target='Annabeth'/>
6335  *         <alias value='Beth' target='Elisabeth'/>
6336  *       </aliases>
6337  *       <default>'Joe'</default>
6338  *     </key>
6339  *
6340  *     <key name='enumerated-key' enum='org.gtk.Test.myenum'>
6341  *       <default>'first'</default>
6342  *     </key>
6343  *
6344  *     <key name='flags-key' flags='org.gtk.Test.myflags'>
6345  *       <default>["flag1",flag2"]</default>
6346  *     </key>
6347  *   </schema>
6348  * </schemalist>
6349  * ]]></programlisting></example>
6350  *
6351  * <refsect2>
6352  *   <title>Vendor overrides</title>
6353  *   <para>
6354  *     Default values are defined in the schemas that get installed by
6355  *     an application. Sometimes, it is necessary for a vendor or distributor
6356  *     to adjust these defaults. Since patching the XML source for the schema
6357  *     is inconvenient and error-prone,
6358  *     <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6359  *     so-called 'vendor override' files. These are keyfiles in the same
6360  *     directory as the XML schema sources which can override default values.
6361  *     The schema id serves as the group name in the key file, and the values
6362  *     are expected in serialized GVariant form, as in the following example:
6363  *     <informalexample><programlisting>
6364  *     [org.gtk.Example]
6365  *     key1='string'
6366  *     key2=1.5
6367  *     </programlisting></informalexample>
6368  *   </para>
6369  *   <para>
6370  *     glib-compile-schemas expects schema files to have the extension
6371  *     <filename>.gschema.override</filename>
6372  *   </para>
6373  * </refsect2>
6374  *
6375  * <refsect2>
6376  *   <title>Binding</title>
6377  *   <para>
6378  *     A very convenient feature of GSettings lets you bind #GObject properties
6379  *     directly to settings, using g_settings_bind(). Once a GObject property
6380  *     has been bound to a setting, changes on either side are automatically
6381  *     propagated to the other side. GSettings handles details like
6382  *     mapping between GObject and GVariant types, and preventing infinite
6383  *     cycles.
6384  *   </para>
6385  *   <para>
6386  *     This makes it very easy to hook up a preferences dialog to the
6387  *     underlying settings. To make this even more convenient, GSettings
6388  *     looks for a boolean property with the name "sensitivity" and
6389  *     automatically binds it to the writability of the bound setting.
6390  *     If this 'magic' gets in the way, it can be suppressed with the
6391  *     #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6392  *   </para>
6393  * </refsect2>
6394  */
6395
6396
6397 /**
6398  * SECTION:gsettingsbackend
6399  * @title: GSettingsBackend
6400  * @short_description: Interface for settings backend implementations
6401  * @include: gio/gsettingsbackend.h
6402  * @see_also: #GSettings, #GIOExtensionPoint
6403  *
6404  * The #GSettingsBackend interface defines a generic interface for
6405  * non-strictly-typed data that is stored in a hierarchy. To implement
6406  * an alternative storage backend for #GSettings, you need to implement
6407  * the #GSettingsBackend interface and then make it implement the
6408  * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6409  *
6410  * The interface defines methods for reading and writing values, a
6411  * method for determining if writing of certain values will fail
6412  * (lockdown) and a change notification mechanism.
6413  *
6414  * The semantics of the interface are very precisely defined and
6415  * implementations must carefully adhere to the expectations of
6416  * callers that are documented on each of the interface methods.
6417  *
6418  * Some of the GSettingsBackend functions accept or return a #GTree.
6419  * These trees always have strings as keys and #GVariant as values.
6420  * g_settings_backend_create_tree() is a convenience function to create
6421  * suitable trees.
6422  *
6423  * <note><para>
6424  * The #GSettingsBackend API is exported to allow third-party
6425  * implementations, but does not carry the same stability guarantees
6426  * as the public GIO API. For this reason, you have to define the
6427  * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6428  * <filename>gio/gsettingsbackend.h</filename>
6429  * </para></note>
6430  */
6431
6432
6433 /**
6434  * SECTION:gsettingsschema
6435  * @short_description: Introspecting and controlling the loading of GSettings schemas
6436  *
6437  * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6438  * mechanism for advanced control over the loading of schemas and a
6439  * mechanism for introspecting their content.
6440  *
6441  * Plugin loading systems that wish to provide plugins a way to access
6442  * settings face the problem of how to make the schemas for these
6443  * settings visible to GSettings.  Typically, a plugin will want to ship
6444  * the schema along with itself and it won't be installed into the
6445  * standard system directories for schemas.
6446  *
6447  * #GSettingsSchemaSource provides a mechanism for dealing with this by
6448  * allowing the creation of a new 'schema source' from which schemas can
6449  * be acquired.  This schema source can then become part of the metadata
6450  * associated with the plugin and queried whenever the plugin requires
6451  * access to some settings.
6452  *
6453  * Consider the following example:
6454  *
6455  * |[
6456  * typedef struct
6457  * {
6458  *    ...
6459  *    GSettingsSchemaSource *schema_source;
6460  *    ...
6461  * } Plugin;
6462  *
6463  * Plugin *
6464  * initialise_plugin (const gchar *dir)
6465  * {
6466  *   Plugin *plugin;
6467  *
6468  *   ...
6469  *
6470  *   plugin->schema_source =
6471  *     g_settings_new_schema_source_from_directory (dir,
6472  *       g_settings_schema_source_get_default (), FALSE, NULL);
6473  *
6474  *   ...
6475  *
6476  *   return plugin;
6477  * }
6478  *
6479  * ...
6480  *
6481  * GSettings *
6482  * plugin_get_settings (Plugin      *plugin,
6483  *                      const gchar *schema_id)
6484  * {
6485  *   GSettingsSchema *schema;
6486  *
6487  *   if (schema_id == NULL)
6488  *     schema_id = plugin->identifier;
6489  *
6490  *   schema = g_settings_schema_source_lookup (plugin->schema_source,
6491  *                                             schema_id, FALSE);
6492  *
6493  *   if (schema == NULL)
6494  *     {
6495  *       ... disable the plugin or abort, etc ...
6496  *     }
6497  *
6498  *   return g_settings_new_full (schema, NULL, NULL);
6499  * }
6500  * ]|
6501  *
6502  * The code above shows how hooks should be added to the code that
6503  * initialises (or enables) the plugin to create the schema source and
6504  * how an API can be added to the plugin system to provide a convenient
6505  * way for the plugin to access its settings, using the schemas that it
6506  * ships.
6507  *
6508  * From the standpoint of the plugin, it would need to ensure that it
6509  * ships a gschemas.compiled file as part of itself, and then simply do
6510  * the following:
6511  *
6512  * |[
6513  * {
6514  *   GSettings *settings;
6515  *   gint some_value;
6516  *
6517  *   settings = plugin_get_settings (self, NULL);
6518  *   some_value = g_settings_get_int (settings, "some-value");
6519  *   ...
6520  * }
6521  * ]|
6522  *
6523  * It's also possible that the plugin system expects the schema source
6524  * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6525  * In that case, the plugin loading system must compile the schemas for
6526  * itself before attempting to create the settings source.
6527  *
6528  * Since: 2.32
6529  */
6530
6531
6532 /**
6533  * SECTION:gsimpleaction
6534  * @title: GSimpleAction
6535  * @short_description: A simple GAction implementation
6536  *
6537  * A #GSimpleAction is the obvious simple implementation of the #GAction
6538  * interface. This is the easiest way to create an action for purposes of
6539  * adding it to a #GSimpleActionGroup.
6540  *
6541  * See also #GtkAction.
6542  */
6543
6544
6545 /**
6546  * SECTION:gsimpleactiongroup
6547  * @title: GSimpleActionGroup
6548  * @short_description: A simple GActionGroup implementation
6549  *
6550  * #GSimpleActionGroup is a hash table filled with #GAction objects,
6551  * implementing the #GActionGroup and #GActionMap interfaces.
6552  */
6553
6554
6555 /**
6556  * SECTION:gsimpleasyncresult
6557  * @short_description: Simple asynchronous results implementation
6558  * @include: gio/gio.h
6559  * @see_also: #GAsyncResult
6560  *
6561  * <note><para>
6562  *   As of GLib 2.36, #GSimpleAsyncResult is deprecated in favor of
6563  *   #GTask, which provides a simpler API.
6564  * </para></note>
6565  *
6566  * #GSimpleAsyncResult implements #GAsyncResult.
6567  *
6568  * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6569  * reporting, operation cancellation and the final state of an operation,
6570  * completely transparent to the application. Results can be returned
6571  * as a pointer e.g. for functions that return data that is collected
6572  * asynchronously, a boolean value for checking the success or failure
6573  * of an operation, or a #gssize for operations which return the number
6574  * of bytes modified by the operation; all of the simple return cases
6575  * are covered.
6576  *
6577  * Most of the time, an application will not need to know of the details
6578  * of this API; it is handled transparently, and any necessary operations
6579  * are handled by #GAsyncResult's interface. However, if implementing a
6580  * new GIO module, for writing language bindings, or for complex
6581  * applications that need better control of how asynchronous operations
6582  * are completed, it is important to understand this functionality.
6583  *
6584  * GSimpleAsyncResults are tagged with the calling function to ensure
6585  * that asynchronous functions and their finishing functions are used
6586  * together correctly.
6587  *
6588  * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6589  * If the result needs to be created for a #GError, use
6590  * g_simple_async_result_new_from_error() or
6591  * g_simple_async_result_new_take_error(). If a #GError is not available
6592  * (e.g. the asynchronous operation's doesn't take a #GError argument),
6593  * but the result still needs to be created for an error condition, use
6594  * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6595  * if your application or binding requires passing a variable argument list
6596  * directly), and the error can then be propagated through the use of
6597  * g_simple_async_result_propagate_error().
6598  *
6599  * An asynchronous operation can be made to ignore a cancellation event by
6600  * calling g_simple_async_result_set_handle_cancellation() with a
6601  * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6602  * operations that are dangerous to cancel, such as close (which would
6603  * cause a leak if cancelled before being run).
6604  *
6605  * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6606  * or it can use #GThread<!-- -->s.
6607  * g_simple_async_result_complete() will finish an I/O task directly
6608  * from the point where it is called. g_simple_async_result_complete_in_idle()
6609  * will finish it from an idle handler in the <link
6610  * linkend="g-main-context-push-thread-default">thread-default main
6611  * context</link>. g_simple_async_result_run_in_thread() will run the
6612  * job in a separate thread and then deliver the result to the
6613  * thread-default main context.
6614  *
6615  * To set the results of an asynchronous function,
6616  * g_simple_async_result_set_op_res_gpointer(),
6617  * g_simple_async_result_set_op_res_gboolean(), and
6618  * g_simple_async_result_set_op_res_gssize()
6619  * are provided, setting the operation's result to a gpointer, gboolean, or
6620  * gssize, respectively.
6621  *
6622  * Likewise, to get the result of an asynchronous function,
6623  * g_simple_async_result_get_op_res_gpointer(),
6624  * g_simple_async_result_get_op_res_gboolean(), and
6625  * g_simple_async_result_get_op_res_gssize() are
6626  * provided, getting the operation's result as a gpointer, gboolean, and
6627  * gssize, respectively.
6628  *
6629  * For the details of the requirements implementations must respect, see
6630  * #GAsyncResult.  A typical implementation of an asynchronous operation
6631  * using GSimpleAsyncResult looks something like this:
6632  *
6633  * |[
6634  * static void
6635  * baked_cb (Cake    *cake,
6636  *           gpointer user_data)
6637  * {
6638  *   /&ast; In this example, this callback is not given a reference to the cake, so
6639  *    &ast; the GSimpleAsyncResult has to take a reference to it.
6640  *    &ast;/
6641  *   GSimpleAsyncResult *result = user_data;
6642  *
6643  *   if (cake == NULL)
6644  *     g_simple_async_result_set_error (result,
6645  *                                      BAKER_ERRORS,
6646  *                                      BAKER_ERROR_NO_FLOUR,
6647  *                                      "Go to the supermarket");
6648  *   else
6649  *     g_simple_async_result_set_op_res_gpointer (result,
6650  *                                                g_object_ref (cake),
6651  *                                                g_object_unref);
6652  *
6653  *
6654  *   /&ast; In this example, we assume that baked_cb is called as a callback from
6655  *    &ast; the mainloop, so it's safe to complete the operation synchronously here.
6656  *    &ast; If, however, _baker_prepare_cake () might call its callback without
6657  *    &ast; first returning to the mainloop â€” inadvisable, but some APIs do so â€”
6658  *    &ast; we would need to use g_simple_async_result_complete_in_idle().
6659  *    &ast;/
6660  *   g_simple_async_result_complete (result);
6661  *   g_object_unref (result);
6662  * }
6663  *
6664  * void
6665  * baker_bake_cake_async (Baker              *self,
6666  *                        guint               radius,
6667  *                        GAsyncReadyCallback callback,
6668  *                        gpointer            user_data)
6669  * {
6670  *   GSimpleAsyncResult *simple;
6671  *   Cake               *cake;
6672  *
6673  *   if (radius < 3)
6674  *     {
6675  *       g_simple_async_report_error_in_idle (G_OBJECT (self),
6676  *                                            callback,
6677  *                                            user_data,
6678  *                                            BAKER_ERRORS,
6679  *                                            BAKER_ERROR_TOO_SMALL,
6680  *                                            "%ucm radius cakes are silly",
6681  *                                            radius);
6682  *       return;
6683  *     }
6684  *
6685  *   simple = g_simple_async_result_new (G_OBJECT (self),
6686  *                                       callback,
6687  *                                       user_data,
6688  *                                       baker_bake_cake_async);
6689  *   cake = _baker_get_cached_cake (self, radius);
6690  *
6691  *   if (cake != NULL)
6692  *     {
6693  *       g_simple_async_result_set_op_res_gpointer (simple,
6694  *                                                  g_object_ref (cake),
6695  *                                                  g_object_unref);
6696  *       g_simple_async_result_complete_in_idle (simple);
6697  *       g_object_unref (simple);
6698  *       /&ast; Drop the reference returned by _baker_get_cached_cake(); the
6699  *        &ast; GSimpleAsyncResult has taken its own reference.
6700  *        &ast;/
6701  *       g_object_unref (cake);
6702  *       return;
6703  *     }
6704  *
6705  *   _baker_prepare_cake (self, radius, baked_cb, simple);
6706  * }
6707  *
6708  * Cake *
6709  * baker_bake_cake_finish (Baker        *self,
6710  *                         GAsyncResult *result,
6711  *                         GError      **error)
6712  * {
6713  *   GSimpleAsyncResult *simple;
6714  *   Cake               *cake;
6715  *
6716  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
6717  *                                                         G_OBJECT (self),
6718  *                                                         baker_bake_cake_async),
6719  *                         NULL);
6720  *
6721  *   simple = (GSimpleAsyncResult *) result;
6722  *
6723  *   if (g_simple_async_result_propagate_error (simple, error))
6724  *     return NULL;
6725  *
6726  *   cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6727  *   return g_object_ref (cake);
6728  * }
6729  * ]|
6730  */
6731
6732
6733 /**
6734  * SECTION:gsimplepermission
6735  * @title: GSimplePermission
6736  * @short_description: A GPermission that doesn't change value
6737  *
6738  * #GSimplePermission is a trivial implementation of #GPermission that
6739  * represents a permission that is either always or never allowed.  The
6740  * value is given at construction and doesn't change.
6741  *
6742  * Calling request or release will result in errors.
6743  */
6744
6745
6746 /**
6747  * SECTION:gsimpleproxyresolver
6748  * @short_description: Simple proxy resolver implementation
6749  * @include: gio/gio.h
6750  * @see_also: g_socket_client_set_proxy_resolver()
6751  *
6752  * #GSimpleProxyResolver is a simple #GProxyResolver implementation
6753  * that handles a single default proxy, multiple URI-scheme-specific
6754  * proxies, and a list of hosts that proxies should not be used for.
6755  *
6756  * #GSimpleProxyResolver is never the default proxy resolver, but it
6757  * can be used as the base class for another proxy resolver
6758  * implementation, or it can be created and used manually, such as
6759  * with g_socket_client_set_proxy_resolver().
6760  *
6761  * Since: 2.36
6762  */
6763
6764
6765 /**
6766  * SECTION:gsocket
6767  * @short_description: Low-level socket object
6768  * @include: gio/gio.h
6769  * @see_also: #GInitable, <link linkend="gio-gnetworking.h">gnetworking.h</link>
6770  *
6771  * A #GSocket is a low-level networking primitive. It is a more or less
6772  * direct mapping of the BSD socket API in a portable GObject based API.
6773  * It supports both the UNIX socket implementations and winsock2 on Windows.
6774  *
6775  * #GSocket is the platform independent base upon which the higher level
6776  * network primitives are based. Applications are not typically meant to
6777  * use it directly, but rather through classes like #GSocketClient,
6778  * #GSocketService and #GSocketConnection. However there may be cases where
6779  * direct use of #GSocket is useful.
6780  *
6781  * #GSocket implements the #GInitable interface, so if it is manually constructed
6782  * by e.g. g_object_new() you must call g_initable_init() and check the
6783  * results before using the object. This is done automatically in
6784  * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6785  * %NULL.
6786  *
6787  * Sockets operate in two general modes, blocking or non-blocking. When
6788  * in blocking mode all operations block until the requested operation
6789  * is finished or there is an error. In non-blocking mode all calls that
6790  * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6791  * To know when a call would successfully run you can call g_socket_condition_check(),
6792  * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6793  * attach it to a #GMainContext to get callbacks when I/O is possible.
6794  * Note that all sockets are always set to non blocking mode in the system, and
6795  * blocking mode is emulated in GSocket.
6796  *
6797  * When working in non-blocking mode applications should always be able to
6798  * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6799  * function said that I/O was possible. This can easily happen in case
6800  * of a race condition in the application, but it can also happen for other
6801  * reasons. For instance, on Windows a socket is always seen as writable
6802  * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6803  *
6804  * #GSocket<!-- -->s can be either connection oriented or datagram based.
6805  * For connection oriented types you must first establish a connection by
6806  * either connecting to an address or accepting a connection from another
6807  * address. For connectionless socket types the target/source address is
6808  * specified or received in each I/O operation.
6809  *
6810  * All socket file descriptors are set to be close-on-exec.
6811  *
6812  * Note that creating a #GSocket causes the signal %SIGPIPE to be
6813  * ignored for the remainder of the program. If you are writing a
6814  * command-line utility that uses #GSocket, you may need to take into
6815  * account the fact that your program will not automatically be killed
6816  * if it tries to write to %stdout after it has been closed.
6817  *
6818  * Since: 2.22
6819  */
6820
6821
6822 /**
6823  * SECTION:gsocketaddress
6824  * @short_description: Abstract base class representing endpoints for socket communication
6825  *
6826  * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6827  * in the BSD sockets API. This is an abstract class; use
6828  * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6829  * for UNIX domain sockets.
6830  */
6831
6832
6833 /**
6834  * SECTION:gsocketclient
6835  * @short_description: Helper for connecting to a network service
6836  * @include: gio/gio.h
6837  * @see_also: #GSocketConnection, #GSocketListener
6838  *
6839  * #GSocketClient is a lightweight high-level utility class for connecting to
6840  * a network host using a connection oriented socket type.
6841  *
6842  * You create a #GSocketClient object, set any options you want, and then
6843  * call a sync or async connect operation, which returns a #GSocketConnection
6844  * subclass on success.
6845  *
6846  * The type of the #GSocketConnection object returned depends on the type of
6847  * the underlying socket that is in use. For instance, for a TCP/IP connection
6848  * it will be a #GTcpConnection.
6849  *
6850  * As #GSocketClient is a lightweight object, you don't need to cache it. You
6851  * can just create a new one any time you need one.
6852  *
6853  * Since: 2.22
6854  */
6855
6856
6857 /**
6858  * SECTION:gsocketconnectable
6859  * @short_description: Interface for potential socket endpoints
6860  *
6861  * Objects that describe one or more potential socket endpoints
6862  * implement #GSocketConnectable. Callers can then use
6863  * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6864  * to try out each socket address in turn until one succeeds, as shown
6865  * in the sample code below.
6866  *
6867  * |[
6868  * MyConnectionType *
6869  * connect_to_host (const char    *hostname,
6870  *                  guint16        port,
6871  *                  GCancellable  *cancellable,
6872  *                  GError       **error)
6873  * {
6874  *   MyConnection *conn = NULL;
6875  *   GSocketConnectable *addr;
6876  *   GSocketAddressEnumerator *enumerator;
6877  *   GSocketAddress *sockaddr;
6878  *   GError *conn_error = NULL;
6879  *
6880  *   addr = g_network_address_new (hostname, port);
6881  *   enumerator = g_socket_connectable_enumerate (addr);
6882  *   g_object_unref (addr);
6883  *
6884  *   /<!-- -->* Try each sockaddr until we succeed. Record the first
6885  *    * connection error, but not any further ones (since they'll probably
6886  *    * be basically the same as the first).
6887  *    *<!-- -->/
6888  *   while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6889  *     {
6890  *       conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6891  *       g_object_unref (sockaddr);
6892  *     }
6893  *   g_object_unref (enumerator);
6894  *
6895  *   if (conn)
6896  *     {
6897  *       if (conn_error)
6898  *         {
6899  *           /<!-- -->* We couldn't connect to the first address, but we succeeded
6900  *            * in connecting to a later address.
6901  *            *<!-- -->/
6902  *           g_error_free (conn_error);
6903  *         }
6904  *       return conn;
6905  *     }
6906  *   else if (error)
6907  *     {
6908  *       /<!-- -->* Either the initial lookup failed, or else the caller
6909  *        * cancelled us.
6910  *        *<!-- -->/
6911  *       if (conn_error)
6912  *         g_error_free (conn_error);
6913  *       return NULL;
6914  *     }
6915  *   else
6916  *     {
6917  *       g_error_propagate (error, conn_error);
6918  *       return NULL;
6919  *     }
6920  * }
6921  * ]|
6922  */
6923
6924
6925 /**
6926  * SECTION:gsocketconnection
6927  * @short_description: A socket connection
6928  * @include: gio/gio.h
6929  * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6930  *
6931  * #GSocketConnection is a #GIOStream for a connected socket. They
6932  * can be created either by #GSocketClient when connecting to a host,
6933  * or by #GSocketListener when accepting a new client.
6934  *
6935  * The type of the #GSocketConnection object returned from these calls
6936  * depends on the type of the underlying socket that is in use. For
6937  * instance, for a TCP/IP connection it will be a #GTcpConnection.
6938  *
6939  * Choosing what type of object to construct is done with the socket
6940  * connection factory, and it is possible for 3rd parties to register
6941  * custom socket connection types for specific combination of socket
6942  * family/type/protocol using g_socket_connection_factory_register_type().
6943  *
6944  * Since: 2.22
6945  */
6946
6947
6948 /**
6949  * SECTION:gsocketcontrolmessage
6950  * @title: GSocketControlMessage
6951  * @short_description: A GSocket control message
6952  * @see_also: #GSocket.
6953  *
6954  * A #GSocketControlMessage is a special-purpose utility message that
6955  * can be sent to or received from a #GSocket. These types of
6956  * messages are often called "ancillary data".
6957  *
6958  * The message can represent some sort of special instruction to or
6959  * information from the socket or can represent a special kind of
6960  * transfer to the peer (for example, sending a file description over
6961  * a UNIX socket).
6962  *
6963  * These messages are sent with g_socket_send_message() and received
6964  * with g_socket_receive_message().
6965  *
6966  * To extend the set of control message that can be sent, subclass this
6967  * class and override the get_size, get_level, get_type and serialize
6968  * methods.
6969  *
6970  * To extend the set of control messages that can be received, subclass
6971  * this class and implement the deserialize method. Also, make sure your
6972  * class is registered with the GType typesystem before calling
6973  * g_socket_receive_message() to read such a message.
6974  *
6975  * Since: 2.22
6976  */
6977
6978
6979 /**
6980  * SECTION:gsocketlistener
6981  * @title: GSocketListener
6982  * @short_description: Helper for accepting network client connections
6983  * @see_also: #GThreadedSocketService, #GSocketService.
6984  *
6985  * A #GSocketListener is an object that keeps track of a set
6986  * of server sockets and helps you accept sockets from any of the
6987  * socket, either sync or async.
6988  *
6989  * If you want to implement a network server, also look at #GSocketService
6990  * and #GThreadedSocketService which are subclass of #GSocketListener
6991  * that makes this even easier.
6992  *
6993  * Since: 2.22
6994  */
6995
6996
6997 /**
6998  * SECTION:gsocketservice
6999  * @title: GSocketService
7000  * @short_description: Make it easy to implement a network service
7001  * @see_also: #GThreadedSocketService, #GSocketListener.
7002  *
7003  * A #GSocketService is an object that represents a service that
7004  * is provided to the network or over local sockets.  When a new
7005  * connection is made to the service the #GSocketService::incoming
7006  * signal is emitted.
7007  *
7008  * A #GSocketService is a subclass of #GSocketListener and you need
7009  * to add the addresses you want to accept connections on with the
7010  * #GSocketListener APIs.
7011  *
7012  * There are two options for implementing a network service based on
7013  * #GSocketService. The first is to create the service using
7014  * g_socket_service_new() and to connect to the #GSocketService::incoming
7015  * signal. The second is to subclass #GSocketService and override the
7016  * default signal handler implementation.
7017  *
7018  * In either case, the handler must immediately return, or else it
7019  * will block additional incoming connections from being serviced.
7020  * If you are interested in writing connection handlers that contain
7021  * blocking code then see #GThreadedSocketService.
7022  *
7023  * The socket service runs on the main loop of the <link
7024  * linkend="g-main-context-push-thread-default-context">thread-default
7025  * context</link> of the thread it is created in, and is not
7026  * threadsafe in general. However, the calls to start and stop the
7027  * service are thread-safe so these can be used from threads that
7028  * handle incoming clients.
7029  *
7030  * Since: 2.22
7031  */
7032
7033
7034 /**
7035  * SECTION:gsrvtarget
7036  * @short_description: DNS SRV record target
7037  * @include: gio/gio.h
7038  *
7039  * SRV (service) records are used by some network protocols to provide
7040  * service-specific aliasing and load-balancing. For example, XMPP
7041  * (Jabber) uses SRV records to locate the XMPP server for a domain;
7042  * rather than connecting directly to "example.com" or assuming a
7043  * specific server hostname like "xmpp.example.com", an XMPP client
7044  * would look up the "xmpp-client" SRV record for "example.com", and
7045  * then connect to whatever host was pointed to by that record.
7046  *
7047  * You can use g_resolver_lookup_service() or
7048  * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
7049  * for a given service. However, if you are simply planning to connect
7050  * to the remote service, you can use #GNetworkService's
7051  * #GSocketConnectable interface and not need to worry about
7052  * #GSrvTarget at all.
7053  */
7054
7055
7056 /**
7057  * SECTION:gtask
7058  * @short_description: Cancellable synchronous or asynchronous task and result
7059  * @include: gio/gio.h
7060  * @see_also: #GAsyncResult
7061  *
7062  * <para>
7063  *   A #GTask represents and manages a cancellable "task".
7064  * </para>
7065  * <refsect2>
7066  *   <title>Asynchronous operations</title>
7067  *   <para>
7068  *     The most common usage of #GTask is as a #GAsyncResult, to
7069  *     manage data during an asynchronous operation. You call
7070  *     g_task_new() in the "start" method, followed by
7071  *     g_task_set_task_data() and the like if you need to keep some
7072  *     additional data associated with the task, and then pass the
7073  *     task object around through your asynchronous operation.
7074  *     Eventually, you will call a method such as
7075  *     g_task_return_pointer() or g_task_return_error(), which will
7076  *     save the value you give it and then invoke the task's callback
7077  *     function (waiting until the next iteration of the main
7078  *     loop first, if necessary). The caller will pass the #GTask back
7079  *     to the operation's finish function (as a #GAsyncResult), and
7080  *     you can use g_task_propagate_pointer() or the like to extract
7081  *     the return value.
7082  *   </para>
7083  *   <example id="gtask-async"><title>GTask as a GAsyncResult</title>
7084  *   <programlisting>
7085  *     typedef struct {
7086  *       CakeFrostingType frosting;
7087  *       char *message;
7088  *     } DecorationData;
7089  *
7090  *     static void
7091  *     decoration_data_free (DecorationData *decoration)
7092  *     {
7093  *       g_free (decoration->message);
7094  *       g_slice_free (DecorationData, decoration);
7095  *     }
7096  *
7097  *     static void
7098  *     baked_cb (Cake     *cake,
7099  *               gpointer  user_data)
7100  *     {
7101  *       GTask *task = user_data;
7102  *       DecorationData *decoration = g_task_get_task_data (task);
7103  *       GError *error = NULL;
7104  *
7105  *       if (cake == NULL)
7106  *         {
7107  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
7108  *                                    "Go to the supermarket");
7109  *           g_object_unref (task);
7110  *           return;
7111  *         }
7112  *
7113  *       if (!cake_decorate (cake, decoration->frosting, decoration->message, &error))
7114  *         {
7115  *           g_object_unref (cake);
7116  *           /&ast; g_task_return_error() takes ownership of error &ast;/
7117  *           g_task_return_error (task, error);
7118  *           g_object_unref (task);
7119  *           return;
7120  *         }
7121  *
7122  *       g_task_return_pointer (result, cake, g_object_unref);
7123  *       g_object_unref (task);
7124  *     }
7125  *
7126  *     void
7127  *     baker_bake_cake_async (Baker               *self,
7128  *                            guint                radius,
7129  *                            CakeFlavor           flavor,
7130  *                            CakeFrostingType     frosting,
7131  *                            const char          *message,
7132  *                            GCancellable        *cancellable,
7133  *                            GAsyncReadyCallback  callback,
7134  *                            gpointer             user_data)
7135  *     {
7136  *       GTask *task;
7137  *       DecorationData *decoration;
7138  *       Cake  *cake;
7139  *
7140  *       task = g_task_new (self, cancellable, callback, user_data);
7141  *       if (radius < 3)
7142  *         {
7143  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_TOO_SMALL,
7144  *                                    "%ucm radius cakes are silly",
7145  *                                    radius);
7146  *           g_object_unref (task);
7147  *           return;
7148  *         }
7149  *
7150  *       cake = _baker_get_cached_cake (self, radius, flavor, frosting, message);
7151  *       if (cake != NULL)
7152  *         {
7153  *           /&ast; _baker_get_cached_cake() returns a reffed cake &ast;/
7154  *           g_task_return_pointer (task, cake, g_object_unref);
7155  *           g_object_unref (task);
7156  *           return;
7157  *         }
7158  *
7159  *       decoration = g_slice_new (DecorationData);
7160  *       decoration->frosting = frosting;
7161  *       decoration->message = g_strdup (message);
7162  *       g_task_set_task_data (task, decoration, (GDestroyNotify) decoration_data_free);
7163  *
7164  *       _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
7165  *     }
7166  *
7167  *     Cake *
7168  *     baker_bake_cake_finish (Baker         *self,
7169  *                             GAsyncResult  *result,
7170  *                             GError       **error)
7171  *     {
7172  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7173  *
7174  *       return g_task_propagate_pointer (G_TASK (result), error);
7175  *     }
7176  *   </programlisting>
7177  *   </example>
7178  * </refsect2>
7179  * <refsect2>
7180  *   <title>Chained asynchronous operations</title>
7181  *   <para>
7182  *     #GTask also tries to simplify asynchronous operations that
7183  *     internally chain together several smaller asynchronous
7184  *     operations. g_task_get_cancellable(), g_task_get_context(), and
7185  *     g_task_get_priority() allow you to get back the task's
7186  *     #GCancellable, #GMainContext, and <link
7187  *     linkend="io-priority">I/O priority</link> when starting a new
7188  *     subtask, so you don't have to keep track of them yourself.
7189  *     g_task_attach_source() simplifies the case of waiting for a
7190  *     source to fire (automatically using the correct #GMainContext
7191  *     and priority).
7192  *   </para>
7193  *   <example id="gtask-chained"><title>Chained asynchronous operations</title>
7194  *   <programlisting>
7195  *     typedef struct {
7196  *       Cake *cake;
7197  *       CakeFrostingType frosting;
7198  *       char *message;
7199  *     } BakingData;
7200  *
7201  *     static void
7202  *     decoration_data_free (BakingData *bd)
7203  *     {
7204  *       if (bd->cake)
7205  *         g_object_unref (bd->cake);
7206  *       g_free (bd->message);
7207  *       g_slice_free (BakingData, bd);
7208  *     }
7209  *
7210  *     static void
7211  *     decorated_cb (Cake         *cake,
7212  *                   GAsyncResult *result,
7213  *                   gpointer      user_data)
7214  *     {
7215  *       GTask *task = user_data;
7216  *       GError *error = NULL;
7217  *
7218  *       if (!cake_decorate_finish (cake, result, &error))
7219  *         {
7220  *           g_object_unref (cake);
7221  *           g_task_return_error (task, error);
7222  *           g_object_unref (task);
7223  *           return;
7224  *         }
7225  *
7226  *       /&ast; baking_data_free() will drop its ref on the cake, so
7227  *        &ast; we have to take another here to give to the caller.
7228  *        &ast;/
7229  *       g_task_return_pointer (result, g_object_ref (cake), g_object_unref);
7230  *       g_object_unref (task);
7231  *     }
7232  *
7233  *     static void
7234  *     decorator_ready (gpointer user_data)
7235  *     {
7236  *       GTask *task = user_data;
7237  *       BakingData *bd = g_task_get_task_data (task);
7238  *
7239  *       cake_decorate_async (bd->cake, bd->frosting, bd->message,
7240  *                            g_task_get_cancellable (task),
7241  *                            decorated_cb, task);
7242  *     }
7243  *
7244  *     static void
7245  *     baked_cb (Cake     *cake,
7246  *               gpointer  user_data)
7247  *     {
7248  *       GTask *task = user_data;
7249  *       BakingData *bd = g_task_get_task_data (task);
7250  *       GError *error = NULL;
7251  *
7252  *       if (cake == NULL)
7253  *         {
7254  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
7255  *                                    "Go to the supermarket");
7256  *           g_object_unref (task);
7257  *           return;
7258  *         }
7259  *
7260  *       bd->cake = cake;
7261  *
7262  *       /&ast; Bail out now if the user has already cancelled &ast;/
7263  *       if (g_task_return_error_if_cancelled (g_task_get_cancellable (task)))
7264  *         {
7265  *           g_object_unref (task);
7266  *           return;
7267  *         }
7268  *
7269  *       if (cake_decorator_available (cake))
7270  *         decorator_ready (task);
7271  *       else
7272  *         {
7273  *           GSource *source;
7274  *
7275  *           source = cake_decorator_wait_source_new (cake);
7276  *           /&ast; Attach @source to @task's GMainContext and have it call
7277  *            &ast; decorator_ready() when it is ready.
7278  *            &ast;/
7279  *           g_task_attach_source (task, source,
7280  *                                 G_CALLBACK (decorator_ready));
7281  *           g_source_unref (source);
7282  *         }
7283  *     }
7284  *
7285  *     void
7286  *     baker_bake_cake_async (Baker               *self,
7287  *                            guint                radius,
7288  *                            CakeFlavor           flavor,
7289  *                            CakeFrostingType     frosting,
7290  *                            const char          *message,
7291  *                            gint                 priority,
7292  *                            GCancellable        *cancellable,
7293  *                            GAsyncReadyCallback  callback,
7294  *                            gpointer             user_data)
7295  *     {
7296  *       GTask *task;
7297  *       BakingData *bd;
7298  *
7299  *       task = g_task_new (self, cancellable, callback, user_data);
7300  *       g_task_set_priority (task, priority);
7301  *
7302  *       bd = g_slice_new0 (BakingData);
7303  *       bd->frosting = frosting;
7304  *       bd->message = g_strdup (message);
7305  *       g_task_set_task_data (task, bd, (GDestroyNotify) baking_data_free);
7306  *
7307  *       _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
7308  *     }
7309  *
7310  *     Cake *
7311  *     baker_bake_cake_finish (Baker         *self,
7312  *                             GAsyncResult  *result,
7313  *                             GError       **error)
7314  *     {
7315  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7316  *
7317  *       return g_task_propagate_pointer (G_TASK (result), error);
7318  *     }
7319  *   </programlisting>
7320  *   </example>
7321  * </refsect2>
7322  * <refsect2>
7323  *   <title>Asynchronous operations from synchronous ones</title>
7324  *   <para>
7325  *     You can use g_task_run_in_thread() to turn a synchronous
7326  *     operation into an asynchronous one, by running it in a thread
7327  *     which will then dispatch the result back to the caller's
7328  *     #GMainContext when it completes.
7329  *   </para>
7330  *   <example id="gtask-run-in-thread"><title>g_task_run_in_thread()</title>
7331  *   <programlisting>
7332  *     typedef struct {
7333  *       guint radius;
7334  *       CakeFlavor flavor;
7335  *       CakeFrostingType frosting;
7336  *       char *message;
7337  *     } CakeData;
7338  *
7339  *     static void
7340  *     cake_data_free (CakeData *cake_data)
7341  *     {
7342  *       g_free (cake_data->message);
7343  *       g_slice_free (CakeData, cake_data);
7344  *     }
7345  *
7346  *     static void
7347  *     bake_cake_thread (GTask         *task,
7348  *                       gpointer       source_object,
7349  *                       gpointer       task_data,
7350  *                       GCancellable  *cancellable)
7351  *     {
7352  *       Baker *self = source_object;
7353  *       CakeData *cake_data = task_data;
7354  *       Cake *cake;
7355  *       GError *error = NULL;
7356  *
7357  *       cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7358  *                         cake_data->frosting, cake_data->message,
7359  *                         cancellable, &error);
7360  *       if (cake)
7361  *         g_task_return_pointer (task, cake, g_object_unref);
7362  *       else
7363  *         g_task_return_error (task, error);
7364  *     }
7365  *
7366  *     void
7367  *     baker_bake_cake_async (Baker               *self,
7368  *                            guint                radius,
7369  *                            CakeFlavor           flavor,
7370  *                            CakeFrostingType     frosting,
7371  *                            const char          *message,
7372  *                            GCancellable        *cancellable,
7373  *                            GAsyncReadyCallback  callback,
7374  *                            gpointer             user_data)
7375  *     {
7376  *       CakeData *cake_data;
7377  *       GTask *task;
7378  *
7379  *       cake_data = g_slice_new (CakeData);
7380  *       cake_data->radius = radius;
7381  *       cake_data->flavor = flavor;
7382  *       cake_data->frosting = frosting;
7383  *       cake_data->message = g_strdup (message);
7384  *       task = g_task_new (self, cancellable, callback, user_data);
7385  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7386  *       g_task_run_in_thread (task, bake_cake_thread);
7387  *     }
7388  *
7389  *     Cake *
7390  *     baker_bake_cake_finish (Baker         *self,
7391  *                             GAsyncResult  *result,
7392  *                             GError       **error)
7393  *     {
7394  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7395  *
7396  *       return g_task_propagate_pointer (G_TASK (result), error);
7397  *     }
7398  *   </programlisting>
7399  *   </example>
7400  * </refsect2>
7401  * <refsect2>
7402  *   <title>Adding cancellability to uncancellable tasks</title>
7403  *   <para>
7404  *     Finally, g_task_run_in_thread() and g_task_run_in_thread_sync()
7405  *     can be used to turn an uncancellable operation into a
7406  *     cancellable one. If you call g_task_set_return_on_cancel(),
7407  *     passing %TRUE, then if the task's #GCancellable is cancelled,
7408  *     it will return control back to the caller immediately, while
7409  *     allowing the task thread to continue running in the background
7410  *     (and simply discarding its result when it finally does finish).
7411  *     Provided that the task thread is careful about how it uses
7412  *     locks and other externally-visible resources, this allows you
7413  *     to make "GLib-friendly" asynchronous and cancellable
7414  *     synchronous variants of blocking APIs.
7415  *   </para>
7416  *   <example id="gtask-cancellable"><title>g_task_set_return_on_cancel()</title>
7417  *   <programlisting>
7418  *     static void
7419  *     bake_cake_thread (GTask         *task,
7420  *                       gpointer       source_object,
7421  *                       gpointer       task_data,
7422  *                       GCancellable  *cancellable)
7423  *     {
7424  *       Baker *self = source_object;
7425  *       CakeData *cake_data = task_data;
7426  *       Cake *cake;
7427  *       GError *error = NULL;
7428  *
7429  *       cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7430  *                         cake_data->frosting, cake_data->message,
7431  *                         &error);
7432  *       if (error)
7433  *         {
7434  *           g_task_return_error (task, error);
7435  *           return;
7436  *         }
7437  *
7438  *       /&ast; If the task has already been cancelled, then we don't
7439  *        &ast; want to add the cake to the cake cache. Likewise, we don't
7440  *        &ast; want to have the task get cancelled in the middle of
7441  *        &ast; updating the cache. g_task_set_return_on_cancel() will
7442  *        &ast; return %TRUE here if it managed to disable return-on-cancel,
7443  *        &ast; or %FALSE if the task was cancelled before it could.
7444  *        &ast;/
7445  *       if (g_task_set_return_on_cancel (task, FALSE))
7446  *         {
7447  *           /&ast; If the caller cancels at this point, their
7448  *            &ast; GAsyncReadyCallback won't be invoked until we return,
7449  *            &ast; so we don't have to worry that this code will run at
7450  *            &ast; the same time as that code does. But if there were
7451  *            &ast; other functions that might look at the cake cache,
7452  *            &ast; then we'd probably need a GMutex here as well.
7453  *            &ast;/
7454  *           baker_add_cake_to_cache (baker, cake);
7455  *           g_task_return_pointer (task, cake, g_object_unref);
7456  *         }
7457  *     }
7458  *
7459  *     void
7460  *     baker_bake_cake_async (Baker               *self,
7461  *                            guint                radius,
7462  *                            CakeFlavor           flavor,
7463  *                            CakeFrostingType     frosting,
7464  *                            const char          *message,
7465  *                            GCancellable        *cancellable,
7466  *                            GAsyncReadyCallback  callback,
7467  *                            gpointer             user_data)
7468  *     {
7469  *       CakeData *cake_data;
7470  *       GTask *task;
7471  *
7472  *       cake_data = g_slice_new (CakeData);
7473  *       /&ast; ... &ast;/
7474  *
7475  *       task = g_task_new (self, cancellable, callback, user_data);
7476  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7477  *       g_task_set_return_on_cancel (task, TRUE);
7478  *       g_task_run_in_thread (task, bake_cake_thread);
7479  *     }
7480  *
7481  *     Cake *
7482  *     baker_bake_cake_sync (Baker               *self,
7483  *                           guint                radius,
7484  *                           CakeFlavor           flavor,
7485  *                           CakeFrostingType     frosting,
7486  *                           const char          *message,
7487  *                           GCancellable        *cancellable,
7488  *                           GError             **error)
7489  *     {
7490  *       CakeData *cake_data;
7491  *       GTask *task;
7492  *       Cake *cake;
7493  *
7494  *       cake_data = g_slice_new (CakeData);
7495  *       /&ast; ... &ast;/
7496  *
7497  *       task = g_task_new (self, cancellable, NULL, NULL);
7498  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7499  *       g_task_set_return_on_cancel (task, TRUE);
7500  *       g_task_run_in_thread_sync (task, bake_cake_thread);
7501  *
7502  *       cake = g_task_propagate_pointer (task, error);
7503  *       g_object_unref (task);
7504  *       return cake;
7505  *     }
7506  *   </programlisting>
7507  *   </example>
7508  * </refsect2>
7509  * <refsect2>
7510  *   <title>Porting from <literal>GSimpleAsyncResult</literal></title>
7511  *   <para>
7512  *     #GTask's API attempts to be simpler than #GSimpleAsyncResult's
7513  *     in several ways:
7514  *   </para>
7515  *   <itemizedlist>
7516  *     <listitem><para>
7517  *       You can save task-specific data with g_task_set_task_data(), and
7518  *       retrieve it later with g_task_get_task_data(). This replaces the
7519  *       abuse of g_simple_async_result_set_op_res_gpointer() for the same
7520  *       purpose with #GSimpleAsyncResult.
7521  *     </para></listitem>
7522  *     <listitem><para>
7523  *       In addition to the task data, #GTask also keeps track of the
7524  *       <link linkend="io-priority">priority</link>, #GCancellable, and
7525  *       #GMainContext associated with the task, so tasks that consist of
7526  *       a chain of simpler asynchronous operations will have easy access
7527  *       to those values when starting each sub-task.
7528  *     </para></listitem>
7529  *     <listitem><para>
7530  *       g_task_return_error_if_cancelled() provides simplified
7531  *       handling for cancellation. In addition, cancellation
7532  *       overrides any other #GTask return value by default, like
7533  *       #GSimpleAsyncResult does when
7534  *       g_simple_async_result_set_check_cancellable() is called.
7535  *       (You can use g_task_set_check_cancellable() to turn off that
7536  *       behavior.) On the other hand, g_task_run_in_thread()
7537  *       guarantees that it will always run your
7538  *       <literal>task_func</literal>, even if the task's #GCancellable
7539  *       is already cancelled before the task gets a chance to run;
7540  *       you can start your <literal>task_func</literal> with a
7541  *       g_task_return_error_if_cancelled() check if you need the
7542  *       old behavior.
7543  *     </para></listitem>
7544  *     <listitem><para>
7545  *       The "return" methods (eg, g_task_return_pointer())
7546  *       automatically cause the task to be "completed" as well, and
7547  *       there is no need to worry about the "complete" vs "complete
7548  *       in idle" distinction. (#GTask automatically figures out
7549  *       whether the task's callback can be invoked directly, or
7550  *       if it needs to be sent to another #GMainContext, or delayed
7551  *       until the next iteration of the current #GMainContext.)
7552  *     </para></listitem>
7553  *     <listitem><para>
7554  *       The "finish" functions for #GTask-based operations are generally
7555  *       much simpler than #GSimpleAsyncResult ones, normally consisting
7556  *       of only a single call to g_task_propagate_pointer() or the like.
7557  *       Since g_task_propagate_pointer() "steals" the return value from
7558  *       the #GTask, it is not necessary to juggle pointers around to
7559  *       prevent it from being freed twice.
7560  *     </para></listitem>
7561  *     <listitem><para>
7562  *       With #GSimpleAsyncResult, it was common to call
7563  *       g_simple_async_result_propagate_error() from the
7564  *       <literal>_finish()</literal> wrapper function, and have
7565  *       virtual method implementations only deal with successful
7566  *       returns. This behavior is deprecated, because it makes it
7567  *       difficult for a subclass to chain to a parent class's async
7568  *       methods. Instead, the wrapper function should just be a
7569  *       simple wrapper, and the virtual method should call an
7570  *       appropriate <literal>g_task_propagate_</literal> function.
7571  *       Note that wrapper methods can now use
7572  *       g_async_result_legacy_propagate_error() to do old-style
7573  *       #GSimpleAsyncResult error-returning behavior, and
7574  *       g_async_result_is_tagged() to check if a result is tagged as
7575  *       having come from the <literal>_async()</literal> wrapper
7576  *       function (for "short-circuit" results, such as when passing
7577  *       0 to g_input_stream_read_async()).
7578  *     </para></listitem>
7579  *   </itemizedlist>
7580  * </refsect2>
7581  */
7582
7583
7584 /**
7585  * SECTION:gtcpconnection
7586  * @title: GTcpConnection
7587  * @short_description: A TCP GSocketConnection
7588  * @see_also: #GSocketConnection.
7589  *
7590  * This is the subclass of #GSocketConnection that is created
7591  * for TCP/IP sockets.
7592  *
7593  * Since: 2.22
7594  */
7595
7596
7597 /**
7598  * SECTION:gtcpwrapperconnection
7599  * @title: GTcpWrapperConnection
7600  * @short_description: Wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
7601  * @see_also: #GSocketConnection.
7602  *
7603  * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
7604  * based on a #GSocket, but which is not actually a
7605  * #GSocketConnection. This is used by #GSocketClient so that it can
7606  * always return a #GSocketConnection, even when the connection it has
7607  * actually created is not directly a #GSocketConnection.
7608  *
7609  * Since: 2.28
7610  */
7611
7612
7613 /**
7614  * SECTION:gtestdbus
7615  * @short_description: D-Bus testing helper
7616  * @include: gio/gio.h
7617  *
7618  * A helper class for testing code which uses D-Bus without touching the user's
7619  * session bus.
7620  *
7621  * <refsect2 id="gio-D-Bus-Test-Scaffolding">
7622  *   <title>Creating unit tests using GTestDBus</title>
7623  *   <para>
7624  *     Testing of D-Bus services can be tricky because normally we only ever run
7625  *     D-Bus services over an existing instance of the D-Bus daemon thus we
7626  *     usually don't activate D-Bus services that are not yet installed into the
7627  *     target system. The #GTestDBus object makes this easier for us by taking care
7628  *     of the lower level tasks such as running a private D-Bus daemon and looking
7629  *     up uninstalled services in customizable locations, typically in your source code tree.
7630  *   </para>
7631  *   <para>
7632  *     The first thing you will need is a separate service description file for the
7633  *     D-Bus daemon. Typically a 'services' subdirectory of your 'tests' directory
7634  *     is a good place to put this file.
7635  *   </para>
7636  *   <para>
7637  *     The service file should list your service along with an absolute path to the
7638  *     uninstalled service executable in your source tree. Using autotools we would
7639  *     achieve this by adding a file such as 'my-server.service.in' in the services
7640  *     directory and have it processed by configure.
7641  *     <informalexample><programlisting>
7642  *     [D-BUS Service]
7643  *     Name=org.gtk.GDBus.Examples.ObjectManager
7644  *     Exec=@abs_top_builddir@/gio/tests/gdbus-example-objectmanager-server
7645  *     </programlisting></informalexample>
7646  *     You will also need to indicate this service directory in your test
7647  *     fixtures, so you will need to pass the path while compiling your
7648  *     test cases. Typically this is done with autotools with an added
7649  *     preprocessor flag specified to compile your tests such as:
7650  *     <informalexample><programlisting>
7651  *     -DTEST_SERVICES=\""$(abs_top_builddir)/tests/services"\"
7652  *     </programlisting></informalexample>
7653  *   </para>
7654  *   <para>
7655  *     Once you have a service definition file which is local to your source tree,
7656  *     you can proceed to setup a GTest fixture using the GTestDBus scaffolding.
7657  *     <example id="gdbus-test-fixture">
7658  *       <title>Test Fixture for D-Bus services</title>
7659  *       <programlisting>
7660  *         <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-test-fixture.c">
7661  *           <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
7662  *         </xi:include>
7663  *       </programlisting>
7664  *     </example>
7665  *   </para>
7666  *   <para>
7667  *     Note that these examples only deal with isolating the D-Bus aspect of your
7668  *     service. To successfully run isolated unit tests on your service you may need
7669  *     some additional modifications to your test case fixture. For example; if your
7670  *     service uses GSettings and installs a schema then it is important that your test service
7671  *     not load the schema in the ordinary installed location (chances are that your service
7672  *     and schema files are not yet installed, or worse; there is an older version of the
7673  *     schema file sitting in the install location).
7674  *   </para>
7675  *   <para>
7676  *     Most of the time we can work around these obstacles using the environment. Since the
7677  *     environment is inherited by the D-Bus daemon created by GTestDBus and then in turn
7678  *     inherited by any services the D-Bus daemon activates, using the setup routine for your
7679  *     fixture is a practical place to help sandbox your runtime environment. For the rather
7680  *     typical GSettings case we can work around this by setting GSETTINGS_SCHEMA_DIR to the
7681  *     in tree directory holding your schemas in the above fixture_setup() routine.
7682  *   </para>
7683  *   <para>
7684  *     The GSettings schemas need to be locally pre-compiled for this to work. This can be achieved
7685  *     by compiling the schemas locally as a step before running test cases, an autotools setup might
7686  *     do the following in the directory holding schemas:
7687  *     <informalexample><programlisting>
7688  *     all-am:
7689  *             $(GLIB_COMPILE_SCHEMAS) .
7690  *
7691  *     CLEANFILES += gschemas.compiled
7692  *     </programlisting></informalexample>
7693  *   </para>
7694  * </refsect2>
7695  */
7696
7697
7698 /**
7699  * SECTION:gthemedicon
7700  * @short_description: Icon theming support
7701  * @include: gio/gio.h
7702  * @see_also: #GIcon, #GLoadableIcon
7703  *
7704  * #GThemedIcon is an implementation of #GIcon that supports icon themes.
7705  * #GThemedIcon contains a list of all of the icons present in an icon
7706  * theme, so that icons can be looked up quickly. #GThemedIcon does
7707  * not provide actual pixmaps for icons, just the icon names.
7708  * Ideally something like gtk_icon_theme_choose_icon() should be used to
7709  * resolve the list of names so that fallback icons work nicely with
7710  * themes that inherit other themes.
7711  */
7712
7713
7714 /**
7715  * SECTION:gthreadedsocketservice
7716  * @title: GThreadedSocketService
7717  * @short_description: A threaded GSocketService
7718  * @see_also: #GSocketService.
7719  *
7720  * A #GThreadedSocketService is a simple subclass of #GSocketService
7721  * that handles incoming connections by creating a worker thread and
7722  * dispatching the connection to it by emitting the
7723  * #GThreadedSocketService::run signal in the new thread.
7724  *
7725  * The signal handler may perform blocking IO and need not return
7726  * until the connection is closed.
7727  *
7728  * The service is implemented using a thread pool, so there is a
7729  * limited amount of threads available to serve incoming requests.
7730  * The service automatically stops the #GSocketService from accepting
7731  * new connections when all threads are busy.
7732  *
7733  * As with #GSocketService, you may connect to #GThreadedSocketService::run,
7734  * or subclass and override the default handler.
7735  */
7736
7737
7738 /**
7739  * SECTION:gtls
7740  * @title: TLS Overview
7741  * @short_description: TLS (aka SSL) support for GSocketConnection
7742  * @include: gio/gio.h
7743  *
7744  * #GTlsConnection and related classes provide TLS (Transport Layer
7745  * Security, previously known as SSL, Secure Sockets Layer) support for
7746  * gio-based network streams.
7747  *
7748  * In the simplest case, for a client connection, you can just set the
7749  * #GSocketClient:tls flag on a #GSocketClient, and then any
7750  * connections created by that client will have TLS negotiated
7751  * automatically, using appropriate default settings, and rejecting
7752  * any invalid or self-signed certificates (unless you change that
7753  * default by setting the #GSocketClient:tls-validation-flags
7754  * property). The returned object will be a #GTcpWrapperConnection,
7755  * which wraps the underlying #GTlsClientConnection.
7756  *
7757  * For greater control, you can create your own #GTlsClientConnection,
7758  * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
7759  * pollable input and output streams) and then connect to its signals,
7760  * such as #GTlsConnection::accept-certificate, before starting the
7761  * handshake.
7762  *
7763  * Server-side TLS is similar, using #GTlsServerConnection. At the
7764  * moment, there is no support for automatically wrapping server-side
7765  * connections in the way #GSocketClient does for client-side
7766  * connections.
7767  */
7768
7769
7770 /**
7771  * SECTION:gtlsbackend
7772  * @title: GTlsBackend
7773  * @short_description: TLS backend implementation
7774  * @include: gio/gio.h
7775  */
7776
7777
7778 /**
7779  * SECTION:gtlscertificate
7780  * @title: GTlsCertificate
7781  * @short_description: TLS certificate
7782  * @see_also: #GTlsConnection
7783  *
7784  * A certificate used for TLS authentication and encryption.
7785  * This can represent either a certificate only (eg, the certificate
7786  * received by a client from a server), or the combination of
7787  * a certificate and a private key (which is needed when acting as a
7788  * #GTlsServerConnection).
7789  *
7790  * Since: 2.28
7791  */
7792
7793
7794 /**
7795  * SECTION:gtlsclientconnection
7796  * @short_description: TLS client-side connection
7797  * @include: gio/gio.h
7798  *
7799  * #GTlsClientConnection is the client-side subclass of
7800  * #GTlsConnection, representing a client-side TLS connection.
7801  */
7802
7803
7804 /**
7805  * SECTION:gtlsconnection
7806  * @short_description: TLS connection type
7807  * @include: gio/gio.h
7808  *
7809  * #GTlsConnection is the base TLS connection class type, which wraps
7810  * a #GIOStream and provides TLS encryption on top of it. Its
7811  * subclasses, #GTlsClientConnection and #GTlsServerConnection,
7812  * implement client-side and server-side TLS, respectively.
7813  *
7814  * Since: 2.28
7815  */
7816
7817
7818 /**
7819  * SECTION:gtlsdatabase
7820  * @short_description: TLS database type
7821  * @include: gio/gio.h
7822  *
7823  * #GTlsDatabase is used to lookup certificates and other information
7824  * from a certificate or key store. It is an abstract base class which
7825  * TLS library specific subtypes override.
7826  *
7827  * Most common client applications will not directly interact with
7828  * #GTlsDatabase. It is used internally by #GTlsConnection.
7829  *
7830  * Since: 2.30
7831  */
7832
7833
7834 /**
7835  * SECTION:gtlsfiledatabase
7836  * @short_description: TLS file based database type
7837  * @include: gio/gio.h
7838  *
7839  * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
7840  * their certificate information from a file. It is an interface which
7841  * TLS library specific subtypes implement.
7842  *
7843  * Since: 2.30
7844  */
7845
7846
7847 /**
7848  * SECTION:gtlsinteraction
7849  * @short_description: Interaction with the user during TLS operations.
7850  * @include: gio/gio.h
7851  *
7852  * #GTlsInteraction provides a mechanism for the TLS connection and database
7853  * code to interact with the user. It can be used to ask the user for passwords.
7854  *
7855  * To use a #GTlsInteraction with a TLS connection use
7856  * g_tls_connection_set_interaction().
7857  *
7858  * Callers should instantiate a derived class that implements the various
7859  * interaction methods to show the required dialogs.
7860  *
7861  * Callers should use the 'invoke' functions like
7862  * g_tls_interaction_invoke_ask_password() to run interaction methods. These
7863  * functions make sure that the interaction is invoked in the main loop
7864  * and not in the current thread, if the current thread is not running the
7865  * main loop.
7866  *
7867  * Derived classes can choose to implement whichever interactions methods they'd
7868  * like to support by overriding those virtual methods in their class
7869  * initialization function. Any interactions not implemented will return
7870  * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
7871  * it must also implement the corresponding finish method.
7872  */
7873
7874
7875 /**
7876  * SECTION:gtlspassword
7877  * @title: GTlsPassword
7878  * @short_description: TLS Passwords for prompting
7879  * @include: gio/gio.h
7880  *
7881  * Holds a password used in TLS.
7882  */
7883
7884
7885 /**
7886  * SECTION:gtlsserverconnection
7887  * @short_description: TLS server-side connection
7888  * @include: gio/gio.h
7889  *
7890  * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
7891  * representing a server-side TLS connection.
7892  *
7893  * Since: 2.28
7894  */
7895
7896
7897 /**
7898  * SECTION:gunixconnection
7899  * @title: GUnixConnection
7900  * @short_description: A UNIX domain GSocketConnection
7901  * @include: gio/gunixconnection.h
7902  * @see_also: #GSocketConnection.
7903  *
7904  * This is the subclass of #GSocketConnection that is created
7905  * for UNIX domain sockets.
7906  *
7907  * It contains functions to do some of the UNIX socket specific
7908  * functionality like passing file descriptors.
7909  *
7910  * Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
7911  * the UNIX-specific GIO interfaces, thus you have to use the
7912  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7913  *
7914  * Since: 2.22
7915  */
7916
7917
7918 /**
7919  * SECTION:gunixcredentialsmessage
7920  * @title: GUnixCredentialsMessage
7921  * @short_description: A GSocketControlMessage containing credentials
7922  * @include: gio/gunixcredentialsmessage.h
7923  * @see_also: #GUnixConnection, #GSocketControlMessage
7924  *
7925  * This #GSocketControlMessage contains a #GCredentials instance.  It
7926  * may be sent using g_socket_send_message() and received using
7927  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7928  * %G_SOCKET_FAMILY_UNIX family).
7929  *
7930  * For an easier way to send and receive credentials over
7931  * stream-oriented UNIX sockets, see
7932  * g_unix_connection_send_credentials() and
7933  * g_unix_connection_receive_credentials(). To receive credentials of
7934  * a foreign process connected to a socket, use
7935  * g_socket_get_credentials().
7936  */
7937
7938
7939 /**
7940  * SECTION:gunixfdlist
7941  * @title: GUnixFDList
7942  * @short_description: An object containing a set of UNIX file descriptors
7943  * @include: gio/gunixfdlist.h
7944  * @see_also: #GUnixFDMessage
7945  *
7946  * A #GUnixFDList contains a list of file descriptors.  It owns the file
7947  * descriptors that it contains, closing them when finalized.
7948  *
7949  * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
7950  * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
7951  * and received using g_socket_receive_message().
7952  *
7953  * Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
7954  * the UNIX-specific GIO interfaces, thus you have to use the
7955  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7956  */
7957
7958
7959 /**
7960  * SECTION:gunixfdmessage
7961  * @title: GUnixFDMessage
7962  * @short_description: A GSocketControlMessage containing a GUnixFDList
7963  * @include: gio/gunixfdmessage.h
7964  * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
7965  *
7966  * This #GSocketControlMessage contains a #GUnixFDList.
7967  * It may be sent using g_socket_send_message() and received using
7968  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7969  * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
7970  * between processes by the kernel.
7971  *
7972  * For an easier way to send and receive file descriptors over
7973  * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7974  * g_unix_connection_receive_fd().
7975  *
7976  * Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
7977  * the UNIX-specific GIO interfaces, thus you have to use the
7978  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7979  */
7980
7981
7982 /**
7983  * SECTION:gunixinputstream
7984  * @short_description: Streaming input operations for UNIX file descriptors
7985  * @include: gio/gunixinputstream.h
7986  * @see_also: #GInputStream
7987  *
7988  * #GUnixInputStream implements #GInputStream for reading from a UNIX
7989  * file descriptor, including asynchronous operations. (If the file
7990  * descriptor refers to a socket or pipe, this will use poll() to do
7991  * asynchronous I/O. If it refers to a regular file, it will fall back
7992  * to doing asynchronous I/O in another thread.)
7993  *
7994  * Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
7995  * to the UNIX-specific GIO interfaces, thus you have to use the
7996  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7997  */
7998
7999
8000 /**
8001  * SECTION:gunixmounts
8002  * @include: gio/gunixmounts.h
8003  * @short_description: UNIX mounts
8004  *
8005  * Routines for managing mounted UNIX mount points and paths.
8006  *
8007  * Note that <filename>&lt;gio/gunixmounts.h&gt;</filename> belongs to the
8008  * UNIX-specific GIO interfaces, thus you have to use the
8009  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8010  */
8011
8012
8013 /**
8014  * SECTION:gunixoutputstream
8015  * @short_description: Streaming output operations for UNIX file descriptors
8016  * @include: gio/gunixoutputstream.h
8017  * @see_also: #GOutputStream
8018  *
8019  * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
8020  * file descriptor, including asynchronous operations. (If the file
8021  * descriptor refers to a socket or pipe, this will use poll() to do
8022  * asynchronous I/O. If it refers to a regular file, it will fall back
8023  * to doing asynchronous I/O in another thread.)
8024  *
8025  * Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
8026  * to the UNIX-specific GIO interfaces, thus you have to use the
8027  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8028  */
8029
8030
8031 /**
8032  * SECTION:gunixsocketaddress
8033  * @short_description: UNIX GSocketAddress
8034  * @include: gio/gunixsocketaddress.h
8035  *
8036  * Support for UNIX-domain (also known as local) sockets.
8037  *
8038  * UNIX domain sockets are generally visible in the filesystem.
8039  * However, some systems support abstract socket names which are not
8040  * visible in the filesystem and not affected by the filesystem
8041  * permissions, visibility, etc. Currently this is only supported
8042  * under Linux. If you attempt to use abstract sockets on other
8043  * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
8044  * errors. You can use g_unix_socket_address_abstract_names_supported()
8045  * to see if abstract names are supported.
8046  *
8047  * Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
8048  * the UNIX-specific GIO interfaces, thus you have to use the
8049  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8050  */
8051
8052
8053 /**
8054  * SECTION:gvfs
8055  * @short_description: Virtual File System
8056  * @include: gio/gio.h
8057  *
8058  * Entry point for using GIO functionality.
8059  */
8060
8061
8062 /**
8063  * SECTION:gvolume
8064  * @short_description: Volume management
8065  * @include: gio/gio.h
8066  *
8067  * The #GVolume interface represents user-visible objects that can be
8068  * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
8069  * equivalent of #GnomeVFSDrive.
8070  *
8071  * Mounting a #GVolume instance is an asynchronous operation. For more
8072  * information about asynchronous operations, see #GAsyncResult and
8073  * #GTask. To mount a #GVolume, first call g_volume_mount() with (at
8074  * least) the #GVolume instance, optionally a #GMountOperation object
8075  * and a #GAsyncReadyCallback.
8076  *
8077  * Typically, one will only want to pass %NULL for the
8078  * #GMountOperation if automounting all volumes when a desktop session
8079  * starts since it's not desirable to put up a lot of dialogs asking
8080  * for credentials.
8081  *
8082  * The callback will be fired when the operation has resolved (either
8083  * with success or failure), and a #GAsyncReady structure will be
8084  * passed to the callback.  That callback should then call
8085  * g_volume_mount_finish() with the #GVolume instance and the
8086  * #GAsyncReady data to see if the operation was completed
8087  * successfully.  If an @error is present when g_volume_mount_finish()
8088  * is called, then it will be filled with any error information.
8089  *
8090  * <para id="volume-identifier">
8091  * It is sometimes necessary to directly access the underlying
8092  * operating system object behind a volume (e.g. for passing a volume
8093  * to an application via the commandline). For this purpose, GIO
8094  * allows to obtain an 'identifier' for the volume. There can be
8095  * different kinds of identifiers, such as Hal UDIs, filesystem labels,
8096  * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
8097  * uuids. GIO uses predefind strings as names for the different kinds
8098  * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
8099  * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
8100  * to obtain an identifier for a volume.
8101  * </para>
8102  *
8103  * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
8104  * when the gvfs hal volume monitor is in use. Other volume monitors
8105  * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
8106  * identifier, which can be used to obtain a hal device by means of
8107  * libhal_manager_find_device_string_match().
8108  */
8109
8110
8111 /**
8112  * SECTION:gvolumemonitor
8113  * @short_description: Volume Monitor
8114  * @include: gio/gio.h
8115  * @see_also: #GFileMonitor
8116  *
8117  * #GVolumeMonitor is for listing the user interesting devices and volumes
8118  * on the computer. In other words, what a file selector or file manager
8119  * would show in a sidebar.
8120  *
8121  * #GVolumeMonitor is not <link
8122  * linkend="g-main-context-push-thread-default">thread-default-context
8123  * aware</link>, and so should not be used other than from the main
8124  * thread, with no thread-default-context active.
8125  */
8126
8127
8128 /**
8129  * SECTION:gwin32inputstream
8130  * @short_description: Streaming input operations for Windows file handles
8131  * @include: gio/gwin32inputstream.h
8132  * @see_also: #GInputStream
8133  *
8134  * #GWin32InputStream implements #GInputStream for reading from a
8135  * Windows file handle.
8136  *
8137  * Note that <filename>&lt;gio/gwin32inputstream.h&gt;</filename> belongs
8138  * to the Windows-specific GIO interfaces, thus you have to use the
8139  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
8140  */
8141
8142
8143 /**
8144  * SECTION:gwin32outputstream
8145  * @short_description: Streaming output operations for Windows file handles
8146  * @include: gio/gwin32outputstream.h
8147  * @see_also: #GOutputStream
8148  *
8149  * #GWin32OutputStream implements #GOutputStream for writing to a
8150  * Windows file handle.
8151  *
8152  * Note that <filename>&lt;gio/gwin32outputstream.h&gt;</filename> belongs
8153  * to the Windows-specific GIO interfaces, thus you have to use the
8154  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
8155  */
8156
8157
8158 /**
8159  * SECTION:gzcompressor
8160  * @short_description: Zlib compressor
8161  * @include: gio/gio.h
8162  *
8163  * #GZlibCompressor is an implementation of #GConverter that
8164  * compresses data using zlib.
8165  */
8166
8167
8168 /**
8169  * SECTION:gzdecompressor
8170  * @short_description: Zlib decompressor
8171  * @include: gio/gio.h
8172  *
8173  * #GZlibDecompressor is an implementation of #GConverter that
8174  * decompresses data compressed with zlib.
8175  */
8176
8177
8178 /**
8179  * _g_io_module_get_default:
8180  * @extension_point: the name of an extension point
8181  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8182  * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
8183  *
8184  * Retrieves the default object implementing @extension_point.
8185  *
8186  * If @envvar is not %NULL, and the environment variable with that
8187  * name is set, then the implementation it specifies will be tried
8188  * first. After that, or if @envvar is not set, all other
8189  * implementations will be tried in order of decreasing priority.
8190  *
8191  * If an extension point implementation implements #GInitable, then
8192  * that implementation will only be used if it initializes
8193  * successfully. Otherwise, if @verify_func is not %NULL, then it will
8194  * be called on each candidate implementation after construction, to
8195  * check if it is actually usable or not.
8196  *
8197  * The result is cached after it is generated the first time, and
8198  * the function is thread-safe.
8199  *
8200  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8201  */
8202
8203
8204 /**
8205  * _g_io_module_get_default_type:
8206  * @extension_point: the name of an extension point
8207  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8208  * @is_supported_offset: a vtable offset, or zero
8209  *
8210  * Retrieves the default class implementing @extension_point.
8211  *
8212  * If @envvar is not %NULL, and the environment variable with that
8213  * name is set, then the implementation it specifies will be tried
8214  * first. After that, or if @envvar is not set, all other
8215  * implementations will be tried in order of decreasing priority.
8216  *
8217  * If @is_supported_offset is non-zero, then it is the offset into the
8218  * class vtable at which there is a function that takes no arguments and
8219  * returns a boolean.  This function will be called on each candidate
8220  * implementation to check if it is actually usable or not.
8221  *
8222  * The result is cached after it is generated the first time, and
8223  * the function is thread-safe.
8224  *
8225  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8226  */
8227
8228
8229 /**
8230  * g_action_activate:
8231  * @action: a #GAction
8232  * @parameter: (allow-none): the parameter to the activation
8233  *
8234  * Activates the action.
8235  *
8236  * @parameter must be the correct type of parameter for the action (ie:
8237  * the parameter type given at construction time).  If the parameter
8238  * type was %NULL then @parameter must also be %NULL.
8239  *
8240  * If the @parameter GVariant is floating, it is consumed.
8241  *
8242  * Since: 2.28
8243  */
8244
8245
8246 /**
8247  * g_action_change_state:
8248  * @action: a #GAction
8249  * @value: the new state
8250  *
8251  * Request for the state of @action to be changed to @value.
8252  *
8253  * The action must be stateful and @value must be of the correct type.
8254  * See g_action_get_state_type().
8255  *
8256  * This call merely requests a change.  The action may refuse to change
8257  * its state or may change its state to something other than @value.
8258  * See g_action_get_state_hint().
8259  *
8260  * If the @value GVariant is floating, it is consumed.
8261  *
8262  * Since: 2.30
8263  */
8264
8265
8266 /**
8267  * g_action_get_enabled:
8268  * @action: a #GAction
8269  *
8270  * Checks if @action is currently enabled.
8271  *
8272  * An action must be enabled in order to be activated or in order to
8273  * have its state changed from outside callers.
8274  *
8275  * Returns: whether the action is enabled
8276  * Since: 2.28
8277  */
8278
8279
8280 /**
8281  * g_action_get_name:
8282  * @action: a #GAction
8283  *
8284  * Queries the name of @action.
8285  *
8286  * Returns: the name of the action
8287  * Since: 2.28
8288  */
8289
8290
8291 /**
8292  * g_action_get_parameter_type:
8293  * @action: a #GAction
8294  *
8295  * Queries the type of the parameter that must be given when activating
8296  * @action.
8297  *
8298  * When activating the action using g_action_activate(), the #GVariant
8299  * given to that function must be of the type returned by this function.
8300  *
8301  * In the case that this function returns %NULL, you must not give any
8302  * #GVariant, but %NULL instead.
8303  *
8304  * Returns: (allow-none): the parameter type
8305  * Since: 2.28
8306  */
8307
8308
8309 /**
8310  * g_action_get_state:
8311  * @action: a #GAction
8312  *
8313  * Queries the current state of @action.
8314  *
8315  * If the action is not stateful then %NULL will be returned.  If the
8316  * action is stateful then the type of the return value is the type
8317  * given by g_action_get_state_type().
8318  *
8319  * The return value (if non-%NULL) should be freed with
8320  * g_variant_unref() when it is no longer required.
8321  *
8322  * Returns: (transfer full): the current state of the action
8323  * Since: 2.28
8324  */
8325
8326
8327 /**
8328  * g_action_get_state_hint:
8329  * @action: a #GAction
8330  *
8331  * Requests a hint about the valid range of values for the state of
8332  * @action.
8333  *
8334  * If %NULL is returned it either means that the action is not stateful
8335  * or that there is no hint about the valid range of values for the
8336  * state of the action.
8337  *
8338  * If a #GVariant array is returned then each item in the array is a
8339  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8340  * returned then the tuple specifies the inclusive lower and upper bound
8341  * of valid values for the state.
8342  *
8343  * In any case, the information is merely a hint.  It may be possible to
8344  * have a state value outside of the hinted range and setting a value
8345  * within the range may fail.
8346  *
8347  * The return value (if non-%NULL) should be freed with
8348  * g_variant_unref() when it is no longer required.
8349  *
8350  * Returns: (transfer full): the state range hint
8351  * Since: 2.28
8352  */
8353
8354
8355 /**
8356  * g_action_get_state_type:
8357  * @action: a #GAction
8358  *
8359  * Queries the type of the state of @action.
8360  *
8361  * If the action is stateful (e.g. created with
8362  * g_simple_action_new_stateful()) then this function returns the
8363  * #GVariantType of the state.  This is the type of the initial value
8364  * given as the state. All calls to g_action_change_state() must give a
8365  * #GVariant of this type and g_action_get_state() will return a
8366  * #GVariant of the same type.
8367  *
8368  * If the action is not stateful (e.g. created with g_simple_action_new())
8369  * then this function will return %NULL. In that case, g_action_get_state()
8370  * will return %NULL and you must not call g_action_change_state().
8371  *
8372  * Returns: (allow-none): the state type, if the action is stateful
8373  * Since: 2.28
8374  */
8375
8376
8377 /**
8378  * g_action_group_action_added:
8379  * @action_group: a #GActionGroup
8380  * @action_name: the name of an action in the group
8381  *
8382  * Emits the #GActionGroup::action-added signal on @action_group.
8383  *
8384  * This function should only be called by #GActionGroup implementations.
8385  *
8386  * Since: 2.28
8387  */
8388
8389
8390 /**
8391  * g_action_group_action_enabled_changed:
8392  * @action_group: a #GActionGroup
8393  * @action_name: the name of an action in the group
8394  * @enabled: whether or not the action is now enabled
8395  *
8396  * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8397  *
8398  * This function should only be called by #GActionGroup implementations.
8399  *
8400  * Since: 2.28
8401  */
8402
8403
8404 /**
8405  * g_action_group_action_removed:
8406  * @action_group: a #GActionGroup
8407  * @action_name: the name of an action in the group
8408  *
8409  * Emits the #GActionGroup::action-removed signal on @action_group.
8410  *
8411  * This function should only be called by #GActionGroup implementations.
8412  *
8413  * Since: 2.28
8414  */
8415
8416
8417 /**
8418  * g_action_group_action_state_changed:
8419  * @action_group: a #GActionGroup
8420  * @action_name: the name of an action in the group
8421  * @state: the new state of the named action
8422  *
8423  * Emits the #GActionGroup::action-state-changed signal on @action_group.
8424  *
8425  * This function should only be called by #GActionGroup implementations.
8426  *
8427  * Since: 2.28
8428  */
8429
8430
8431 /**
8432  * g_action_group_activate_action:
8433  * @action_group: a #GActionGroup
8434  * @action_name: the name of the action to activate
8435  * @parameter: (allow-none): parameters to the activation
8436  *
8437  * Activate the named action within @action_group.
8438  *
8439  * If the action is expecting a parameter, then the correct type of
8440  * parameter must be given as @parameter.  If the action is expecting no
8441  * parameters then @parameter must be %NULL.  See
8442  * g_action_group_get_action_parameter_type().
8443  *
8444  * Since: 2.28
8445  */
8446
8447
8448 /**
8449  * g_action_group_change_action_state:
8450  * @action_group: a #GActionGroup
8451  * @action_name: the name of the action to request the change on
8452  * @value: the new state
8453  *
8454  * Request for the state of the named action within @action_group to be
8455  * changed to @value.
8456  *
8457  * The action must be stateful and @value must be of the correct type.
8458  * See g_action_group_get_action_state_type().
8459  *
8460  * This call merely requests a change.  The action may refuse to change
8461  * its state or may change its state to something other than @value.
8462  * See g_action_group_get_action_state_hint().
8463  *
8464  * If the @value GVariant is floating, it is consumed.
8465  *
8466  * Since: 2.28
8467  */
8468
8469
8470 /**
8471  * g_action_group_get_action_enabled:
8472  * @action_group: a #GActionGroup
8473  * @action_name: the name of the action to query
8474  *
8475  * Checks if the named action within @action_group is currently enabled.
8476  *
8477  * An action must be enabled in order to be activated or in order to
8478  * have its state changed from outside callers.
8479  *
8480  * Returns: whether or not the action is currently enabled
8481  * Since: 2.28
8482  */
8483
8484
8485 /**
8486  * g_action_group_get_action_parameter_type:
8487  * @action_group: a #GActionGroup
8488  * @action_name: the name of the action to query
8489  *
8490  * Queries the type of the parameter that must be given when activating
8491  * the named action within @action_group.
8492  *
8493  * When activating the action using g_action_group_activate_action(),
8494  * the #GVariant given to that function must be of the type returned
8495  * by this function.
8496  *
8497  * In the case that this function returns %NULL, you must not give any
8498  * #GVariant, but %NULL instead.
8499  *
8500  * The parameter type of a particular action will never change but it is
8501  * possible for an action to be removed and for a new action to be added
8502  * with the same name but a different parameter type.
8503  *
8504  * Returns: the parameter type
8505  * Since: 2.28
8506  */
8507
8508
8509 /**
8510  * g_action_group_get_action_state:
8511  * @action_group: a #GActionGroup
8512  * @action_name: the name of the action to query
8513  *
8514  * Queries the current state of the named action within @action_group.
8515  *
8516  * If the action is not stateful then %NULL will be returned.  If the
8517  * action is stateful then the type of the return value is the type
8518  * given by g_action_group_get_action_state_type().
8519  *
8520  * The return value (if non-%NULL) should be freed with
8521  * g_variant_unref() when it is no longer required.
8522  *
8523  * Returns: (allow-none): the current state of the action
8524  * Since: 2.28
8525  */
8526
8527
8528 /**
8529  * g_action_group_get_action_state_hint:
8530  * @action_group: a #GActionGroup
8531  * @action_name: the name of the action to query
8532  *
8533  * Requests a hint about the valid range of values for the state of the
8534  * named action within @action_group.
8535  *
8536  * If %NULL is returned it either means that the action is not stateful
8537  * or that there is no hint about the valid range of values for the
8538  * state of the action.
8539  *
8540  * If a #GVariant array is returned then each item in the array is a
8541  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8542  * returned then the tuple specifies the inclusive lower and upper bound
8543  * of valid values for the state.
8544  *
8545  * In any case, the information is merely a hint.  It may be possible to
8546  * have a state value outside of the hinted range and setting a value
8547  * within the range may fail.
8548  *
8549  * The return value (if non-%NULL) should be freed with
8550  * g_variant_unref() when it is no longer required.
8551  *
8552  * Returns: (transfer full): the state range hint
8553  * Since: 2.28
8554  */
8555
8556
8557 /**
8558  * g_action_group_get_action_state_type:
8559  * @action_group: a #GActionGroup
8560  * @action_name: the name of the action to query
8561  *
8562  * Queries the type of the state of the named action within
8563  * @action_group.
8564  *
8565  * If the action is stateful then this function returns the
8566  * #GVariantType of the state.  All calls to
8567  * g_action_group_change_action_state() must give a #GVariant of this
8568  * type and g_action_group_get_action_state() will return a #GVariant
8569  * of the same type.
8570  *
8571  * If the action is not stateful then this function will return %NULL.
8572  * In that case, g_action_group_get_action_state() will return %NULL
8573  * and you must not call g_action_group_change_action_state().
8574  *
8575  * The state type of a particular action will never change but it is
8576  * possible for an action to be removed and for a new action to be added
8577  * with the same name but a different state type.
8578  *
8579  * Returns: (transfer full): the state type, if the action is stateful
8580  * Since: 2.28
8581  */
8582
8583
8584 /**
8585  * g_action_group_has_action:
8586  * @action_group: a #GActionGroup
8587  * @action_name: the name of the action to check for
8588  *
8589  * Checks if the named action exists within @action_group.
8590  *
8591  * Returns: whether the named action exists
8592  * Since: 2.28
8593  */
8594
8595
8596 /**
8597  * g_action_group_list_actions:
8598  * @action_group: a #GActionGroup
8599  *
8600  * Lists the actions contained within @action_group.
8601  *
8602  * The caller is responsible for freeing the list with g_strfreev() when
8603  * it is no longer required.
8604  *
8605  * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
8606  * Since: 2.28
8607  */
8608
8609
8610 /**
8611  * g_action_group_query_action:
8612  * @action_group: a #GActionGroup
8613  * @action_name: the name of an action in the group
8614  * @enabled: (out): if the action is presently enabled
8615  * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
8616  * @state_type: (out) (allow-none): the state type, or %NULL if stateless
8617  * @state_hint: (out) (allow-none): the state hint, or %NULL if none
8618  * @state: (out) (allow-none): the current state, or %NULL if stateless
8619  *
8620  * Queries all aspects of the named action within an @action_group.
8621  *
8622  * This function acquires the information available from
8623  * g_action_group_has_action(), g_action_group_get_action_enabled(),
8624  * g_action_group_get_action_parameter_type(),
8625  * g_action_group_get_action_state_type(),
8626  * g_action_group_get_action_state_hint() and
8627  * g_action_group_get_action_state() with a single function call.
8628  *
8629  * This provides two main benefits.
8630  *
8631  * The first is the improvement in efficiency that comes with not having
8632  * to perform repeated lookups of the action in order to discover
8633  * different things about it.  The second is that implementing
8634  * #GActionGroup can now be done by only overriding this one virtual
8635  * function.
8636  *
8637  * The interface provides a default implementation of this function that
8638  * calls the individual functions, as required, to fetch the
8639  * information.  The interface also provides default implementations of
8640  * those functions that call this function.  All implementations,
8641  * therefore, must override either this function or all of the others.
8642  *
8643  * If the action exists, %TRUE is returned and any of the requested
8644  * fields (as indicated by having a non-%NULL reference passed in) are
8645  * filled.  If the action doesn't exist, %FALSE is returned and the
8646  * fields may or may not have been modified.
8647  *
8648  * Returns: %TRUE if the action exists, else %FALSE
8649  * Since: 2.32
8650  */
8651
8652
8653 /**
8654  * g_action_map_add_action:
8655  * @action_map: a #GActionMap
8656  * @action: a #GAction
8657  *
8658  * Adds an action to the @action_map.
8659  *
8660  * If the action map already contains an action with the same name
8661  * as @action then the old action is dropped from the action map.
8662  *
8663  * The action map takes its own reference on @action.
8664  *
8665  * Since: 2.32
8666  */
8667
8668
8669 /**
8670  * g_action_map_add_action_entries:
8671  * @action_map: a #GActionMap
8672  * @entries: (array length=n_entries) (element-type GActionEntry): a pointer to the first item in an array of #GActionEntry structs
8673  * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
8674  * @user_data: the user data for signal connections
8675  *
8676  * A convenience function for creating multiple #GSimpleAction instances
8677  * and adding them to a #GActionMap.
8678  *
8679  * Each action is constructed as per one #GActionEntry.
8680  *
8681  * <example>
8682  * <title>Using g_action_map_add_action_entries()</title>
8683  * <programlisting>
8684  * static void
8685  * activate_quit (GSimpleAction *simple,
8686  *                GVariant      *parameter,
8687  *                gpointer       user_data)
8688  * {
8689  *   exit (0);
8690  * }
8691  *
8692  * static void
8693  * activate_print_string (GSimpleAction *simple,
8694  *                        GVariant      *parameter,
8695  *                        gpointer       user_data)
8696  * {
8697  *   g_print ("%s\n", g_variant_get_string (parameter, NULL));
8698  * }
8699  *
8700  * static GActionGroup *
8701  * create_action_group (void)
8702  * {
8703  *   const GActionEntry entries[] = {
8704  *     { "quit",         activate_quit              },
8705  *     { "print-string", activate_print_string, "s" }
8706  *   };
8707  *   GSimpleActionGroup *group;
8708  *
8709  *   group = g_simple_action_group_new ();
8710  *   g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
8711  *
8712  *   return G_ACTION_GROUP (group);
8713  * }
8714  * </programlisting>
8715  * </example>
8716  *
8717  * Since: 2.32
8718  */
8719
8720
8721 /**
8722  * g_action_map_lookup_action:
8723  * @action_map: a #GActionMap
8724  * @action_name: the name of an action
8725  *
8726  * Looks up the action with the name @action_name in @action_map.
8727  *
8728  * If no such action exists, returns %NULL.
8729  *
8730  * Returns: (transfer none): a #GAction, or %NULL
8731  * Since: 2.32
8732  */
8733
8734
8735 /**
8736  * g_action_map_remove_action:
8737  * @action_map: a #GActionMap
8738  * @action_name: the name of the action
8739  *
8740  * Removes the named action from the action map.
8741  *
8742  * If no action of this name is in the map then nothing happens.
8743  *
8744  * Since: 2.32
8745  */
8746
8747
8748 /**
8749  * g_action_name_is_valid:
8750  * @action_name: an potential action name
8751  *
8752  * Checks if @action_name is valid.
8753  *
8754  * @action_name is valid if it consists only of alphanumeric characters,
8755  * plus '-' and '.'.  The empty string is not a valid action name.
8756  *
8757  * It is an error to call this function with a non-utf8 @action_name.
8758  * @action_name must not be %NULL.
8759  *
8760  * Returns: %TRUE if @action_name is valid
8761  * Since: 2.38
8762  */
8763
8764
8765 /**
8766  * g_action_parse_detailed_name:
8767  * @detailed_name: a detailed action name
8768  * @action_name: (out): the action name
8769  * @target_value: (out): the target value, or %NULL for no target
8770  * @error: a pointer to a %NULL #GError, or %NULL
8771  *
8772  * Parses a detailed action name into its separate name and target
8773  * components.
8774  *
8775  * Detailed action names can have three formats.
8776  *
8777  * The first format is used to represent an action name with no target
8778  * value and consists of just an action name containing no whitespace
8779  * nor the characters ':', '(' or ')'.  For example: "app.action".
8780  *
8781  * The second format is used to represent an action with a target value
8782  * that is a non-empty string consisting only of alphanumerics, plus '-'
8783  * and '.'.  In that case, the action name and target value are
8784  * separated by a double colon ("::").  For example:
8785  * "app.action::target".
8786  *
8787  * The third format is used to represent an action with any type of
8788  * target value, including strings.  The target value follows the action
8789  * name, surrounded in parens.  For example: "app.action(42)".  The
8790  * target value is parsed using g_variant_parse().  If a tuple-typed
8791  * value is desired, it must be specified in the same way, resulting in
8792  * two sets of parens, for example: "app.action((1,2,3))".  A string
8793  * target can be specified this way as well: "app.action('target')".
8794  * For strings, this third format must be used if * target value is
8795  * empty or contains characters other than alphanumerics, '-' and '.'.
8796  *
8797  * Returns: %TRUE if successful, else %FALSE with @error set
8798  * Since: 2.38
8799  */
8800
8801
8802 /**
8803  * g_action_print_detailed_name:
8804  * @action_name: a valid action name
8805  * @target_value: (allow-none): a #GVariant target value, or %NULL
8806  *
8807  * Formats a detailed action name from @action_name and @target_value.
8808  *
8809  * It is an error to call this function with an invalid action name.
8810  *
8811  * This function is the opposite of
8812  * g_action_parse_detailed_action_name().  It will produce a string that
8813  * can be parsed back to the @action_name and @target_value by that
8814  * function.
8815  *
8816  * See that function for the types of strings that will be printed by
8817  * this function.
8818  *
8819  * Returns: a detailed format string
8820  * Since: 2.38
8821  */
8822
8823
8824 /**
8825  * g_app_info_add_supports_type:
8826  * @appinfo: a #GAppInfo.
8827  * @content_type: a string.
8828  * @error: a #GError.
8829  *
8830  * Adds a content type to the application information to indicate the
8831  * application is capable of opening files with the given content type.
8832  *
8833  * Returns: %TRUE on success, %FALSE on error.
8834  */
8835
8836
8837 /**
8838  * g_app_info_can_delete:
8839  * @appinfo: a #GAppInfo
8840  *
8841  * Obtains the information whether the #GAppInfo can be deleted.
8842  * See g_app_info_delete().
8843  *
8844  * Returns: %TRUE if @appinfo can be deleted
8845  * Since: 2.20
8846  */
8847
8848
8849 /**
8850  * g_app_info_can_remove_supports_type:
8851  * @appinfo: a #GAppInfo.
8852  *
8853  * Checks if a supported content type can be removed from an application.
8854  *
8855  * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
8856  */
8857
8858
8859 /**
8860  * g_app_info_create_from_commandline:
8861  * @commandline: the commandline to use
8862  * @application_name: (allow-none): the application name, or %NULL to use @commandline
8863  * @flags: flags that can specify details of the created #GAppInfo
8864  * @error: a #GError location to store the error occurring, %NULL to ignore.
8865  *
8866  * Creates a new #GAppInfo from the given information.
8867  *
8868  * Note that for @commandline, the quoting rules of the Exec key of the
8869  * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
8870  * Entry Specification</ulink> are applied. For example, if the @commandline contains
8871  * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
8872  * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
8873  *
8874  * Returns: (transfer full): new #GAppInfo for given command.
8875  */
8876
8877
8878 /**
8879  * g_app_info_delete:
8880  * @appinfo: a #GAppInfo
8881  *
8882  * Tries to delete a #GAppInfo.
8883  *
8884  * On some platforms, there may be a difference between user-defined
8885  * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
8886  * cannot. See g_app_info_can_delete().
8887  *
8888  * Virtual: do_delete
8889  * Returns: %TRUE if @appinfo has been deleted
8890  * Since: 2.20
8891  */
8892
8893
8894 /**
8895  * g_app_info_dup:
8896  * @appinfo: a #GAppInfo.
8897  *
8898  * Creates a duplicate of a #GAppInfo.
8899  *
8900  * Returns: (transfer full): a duplicate of @appinfo.
8901  */
8902
8903
8904 /**
8905  * g_app_info_equal:
8906  * @appinfo1: the first #GAppInfo.
8907  * @appinfo2: the second #GAppInfo.
8908  *
8909  * Checks if two #GAppInfo<!-- -->s are equal.
8910  *
8911  * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
8912  */
8913
8914
8915 /**
8916  * g_app_info_get_all:
8917  *
8918  * Gets a list of all of the applications currently registered
8919  * on this system.
8920  *
8921  * For desktop files, this includes applications that have
8922  * <literal>NoDisplay=true</literal> set or are excluded from
8923  * display by means of <literal>OnlyShowIn</literal> or
8924  * <literal>NotShowIn</literal>. See g_app_info_should_show().
8925  * The returned list does not include applications which have
8926  * the <literal>Hidden</literal> key set.
8927  *
8928  * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
8929  */
8930
8931
8932 /**
8933  * g_app_info_get_all_for_type:
8934  * @content_type: the content type to find a #GAppInfo for
8935  *
8936  * Gets a list of all #GAppInfos for a given content type,
8937  * including the recommended and fallback #GAppInfos. See
8938  * g_app_info_get_recommended_for_type() and
8939  * g_app_info_get_fallback_for_type().
8940  *
8941  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8942  */
8943
8944
8945 /**
8946  * g_app_info_get_commandline:
8947  * @appinfo: a #GAppInfo
8948  *
8949  * Gets the commandline with which the application will be
8950  * started.
8951  *
8952  * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
8953  * Since: 2.20
8954  */
8955
8956
8957 /**
8958  * g_app_info_get_default_for_type:
8959  * @content_type: the content type to find a #GAppInfo for
8960  * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
8961  *
8962  * Gets the default #GAppInfo for a given content type.
8963  *
8964  * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
8965  */
8966
8967
8968 /**
8969  * g_app_info_get_default_for_uri_scheme:
8970  * @uri_scheme: a string containing a URI scheme.
8971  *
8972  * Gets the default application for handling URIs with
8973  * the given URI scheme. A URI scheme is the initial part
8974  * of the URI, up to but not including the ':', e.g. "http",
8975  * "ftp" or "sip".
8976  *
8977  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
8978  */
8979
8980
8981 /**
8982  * g_app_info_get_description:
8983  * @appinfo: a #GAppInfo.
8984  *
8985  * Gets a human-readable description of an installed application.
8986  *
8987  * Returns: a string containing a description of the application @appinfo, or %NULL if none.
8988  */
8989
8990
8991 /**
8992  * g_app_info_get_display_name:
8993  * @appinfo: a #GAppInfo.
8994  *
8995  * Gets the display name of the application. The display name is often more
8996  * descriptive to the user than the name itself.
8997  *
8998  * Returns: the display name of the application for @appinfo, or the name if no display name is available.
8999  * Since: 2.24
9000  */
9001
9002
9003 /**
9004  * g_app_info_get_executable:
9005  * @appinfo: a #GAppInfo
9006  *
9007  * Gets the executable's name for the installed application.
9008  *
9009  * Returns: a string containing the @appinfo's application binaries name
9010  */
9011
9012
9013 /**
9014  * g_app_info_get_fallback_for_type:
9015  * @content_type: the content type to find a #GAppInfo for
9016  *
9017  * Gets a list of fallback #GAppInfos for a given content type, i.e.
9018  * those applications which claim to support the given content type
9019  * by MIME type subclassing and not directly.
9020  *
9021  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9022  * Since: 2.28
9023  */
9024
9025
9026 /**
9027  * g_app_info_get_icon:
9028  * @appinfo: a #GAppInfo.
9029  *
9030  * Gets the icon for the application.
9031  *
9032  * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9033  */
9034
9035
9036 /**
9037  * g_app_info_get_id:
9038  * @appinfo: a #GAppInfo.
9039  *
9040  * Gets the ID of an application. An id is a string that
9041  * identifies the application. The exact format of the id is
9042  * platform dependent. For instance, on Unix this is the
9043  * desktop file id from the xdg menu specification.
9044  *
9045  * Note that the returned ID may be %NULL, depending on how
9046  * the @appinfo has been constructed.
9047  *
9048  * Returns: a string containing the application's ID.
9049  */
9050
9051
9052 /**
9053  * g_app_info_get_name:
9054  * @appinfo: a #GAppInfo.
9055  *
9056  * Gets the installed name of the application.
9057  *
9058  * Returns: the name of the application for @appinfo.
9059  */
9060
9061
9062 /**
9063  * g_app_info_get_recommended_for_type:
9064  * @content_type: the content type to find a #GAppInfo for
9065  *
9066  * Gets a list of recommended #GAppInfos for a given content type, i.e.
9067  * those applications which claim to support the given content type exactly,
9068  * and not by MIME type subclassing.
9069  * Note that the first application of the list is the last used one, i.e.
9070  * the last one for which g_app_info_set_as_last_used_for_type() has been
9071  * called.
9072  *
9073  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9074  * Since: 2.28
9075  */
9076
9077
9078 /**
9079  * g_app_info_get_supported_types:
9080  * @appinfo: a #GAppInfo that can handle files
9081  *
9082  * Retrieves the list of content types that @app_info claims to support.
9083  * If this information is not provided by the environment, this function
9084  * will return %NULL.
9085  * This function does not take in consideration associations added with
9086  * g_app_info_add_supports_type(), but only those exported directly by
9087  * the application.
9088  *
9089  * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
9090  * Since: 2.34
9091  */
9092
9093
9094 /**
9095  * g_app_info_launch:
9096  * @appinfo: a #GAppInfo
9097  * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
9098  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9099  * @error: a #GError
9100  *
9101  * Launches the application. Passes @files to the launched application
9102  * as arguments, using the optional @launch_context to get information
9103  * about the details of the launcher (like what screen it is on).
9104  * On error, @error will be set accordingly.
9105  *
9106  * To launch the application without arguments pass a %NULL @files list.
9107  *
9108  * Note that even if the launch is successful the application launched
9109  * can fail to start if it runs into problems during startup. There is
9110  * no way to detect this.
9111  *
9112  * Some URIs can be changed when passed through a GFile (for instance
9113  * unsupported URIs with strange formats like mailto:), so if you have
9114  * a textual URI you want to pass in as argument, consider using
9115  * g_app_info_launch_uris() instead.
9116  *
9117  * The launched application inherits the environment of the launching
9118  * process, but it can be modified with g_app_launch_context_setenv() and
9119  * g_app_launch_context_unsetenv().
9120  *
9121  * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
9122  * environment variable with the path of the launched desktop file and
9123  * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
9124  * id of the launched process. This can be used to ignore
9125  * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
9126  * by further processes. The <envar>DISPLAY</envar> and
9127  * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
9128  * set, based on information provided in @launch_context.
9129  *
9130  * Returns: %TRUE on successful launch, %FALSE otherwise.
9131  */
9132
9133
9134 /**
9135  * g_app_info_launch_default_for_uri:
9136  * @uri: the uri to show
9137  * @launch_context: (allow-none): an optional #GAppLaunchContext.
9138  * @error: a #GError.
9139  *
9140  * Utility function that launches the default application
9141  * registered to handle the specified uri. Synchronous I/O
9142  * is done on the uri to detect the type of the file if
9143  * required.
9144  *
9145  * Returns: %TRUE on success, %FALSE on error.
9146  */
9147
9148
9149 /**
9150  * g_app_info_launch_uris:
9151  * @appinfo: a #GAppInfo
9152  * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
9153  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9154  * @error: a #GError
9155  *
9156  * Launches the application. This passes the @uris to the launched application
9157  * as arguments, using the optional @launch_context to get information
9158  * about the details of the launcher (like what screen it is on).
9159  * On error, @error will be set accordingly.
9160  *
9161  * To launch the application without arguments pass a %NULL @uris list.
9162  *
9163  * Note that even if the launch is successful the application launched
9164  * can fail to start if it runs into problems during startup. There is
9165  * no way to detect this.
9166  *
9167  * Returns: %TRUE on successful launch, %FALSE otherwise.
9168  */
9169
9170
9171 /**
9172  * g_app_info_remove_supports_type:
9173  * @appinfo: a #GAppInfo.
9174  * @content_type: a string.
9175  * @error: a #GError.
9176  *
9177  * Removes a supported type from an application, if possible.
9178  *
9179  * Returns: %TRUE on success, %FALSE on error.
9180  */
9181
9182
9183 /**
9184  * g_app_info_reset_type_associations:
9185  * @content_type: a content type
9186  *
9187  * Removes all changes to the type associations done by
9188  * g_app_info_set_as_default_for_type(),
9189  * g_app_info_set_as_default_for_extension(),
9190  * g_app_info_add_supports_type() or
9191  * g_app_info_remove_supports_type().
9192  *
9193  * Since: 2.20
9194  */
9195
9196
9197 /**
9198  * g_app_info_set_as_default_for_extension:
9199  * @appinfo: a #GAppInfo.
9200  * @extension: a string containing the file extension (without the dot).
9201  * @error: a #GError.
9202  *
9203  * Sets the application as the default handler for the given file extension.
9204  *
9205  * Returns: %TRUE on success, %FALSE on error.
9206  */
9207
9208
9209 /**
9210  * g_app_info_set_as_default_for_type:
9211  * @appinfo: a #GAppInfo.
9212  * @content_type: the content type.
9213  * @error: a #GError.
9214  *
9215  * Sets the application as the default handler for a given type.
9216  *
9217  * Returns: %TRUE on success, %FALSE on error.
9218  */
9219
9220
9221 /**
9222  * g_app_info_set_as_last_used_for_type:
9223  * @appinfo: a #GAppInfo.
9224  * @content_type: the content type.
9225  * @error: a #GError.
9226  *
9227  * Sets the application as the last used application for a given type.
9228  * This will make the application appear as first in the list returned
9229  * by g_app_info_get_recommended_for_type(), regardless of the default
9230  * application for that content type.
9231  *
9232  * Returns: %TRUE on success, %FALSE on error.
9233  */
9234
9235
9236 /**
9237  * g_app_info_should_show:
9238  * @appinfo: a #GAppInfo.
9239  *
9240  * Checks if the application info should be shown in menus that
9241  * list available applications.
9242  *
9243  * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
9244  */
9245
9246
9247 /**
9248  * g_app_info_supports_files:
9249  * @appinfo: a #GAppInfo.
9250  *
9251  * Checks if the application accepts files as arguments.
9252  *
9253  * Returns: %TRUE if the @appinfo supports files.
9254  */
9255
9256
9257 /**
9258  * g_app_info_supports_uris:
9259  * @appinfo: a #GAppInfo.
9260  *
9261  * Checks if the application supports reading files and directories from URIs.
9262  *
9263  * Returns: %TRUE if the @appinfo supports URIs.
9264  */
9265
9266
9267 /**
9268  * g_app_launch_context_get_display:
9269  * @context: a #GAppLaunchContext
9270  * @info: a #GAppInfo
9271  * @files: (element-type GFile): a #GList of #GFile objects
9272  *
9273  * Gets the display string for the @context. This is used to ensure new
9274  * applications are started on the same display as the launching
9275  * application, by setting the <envar>DISPLAY</envar> environment variable.
9276  *
9277  * Returns: a display string for the display.
9278  */
9279
9280
9281 /**
9282  * g_app_launch_context_get_environment:
9283  * @context: a #GAppLaunchContext
9284  *
9285  * Gets the complete environment variable list to be passed to
9286  * the child process when @context is used to launch an application.
9287  * This is a %NULL-terminated array of strings, where each string has
9288  * the form <literal>KEY=VALUE</literal>.
9289  *
9290  * Returns: (array zero-terminated=1) (transfer full): the child's environment
9291  * Since: 2.32
9292  */
9293
9294
9295 /**
9296  * g_app_launch_context_get_startup_notify_id:
9297  * @context: a #GAppLaunchContext
9298  * @info: a #GAppInfo
9299  * @files: (element-type GFile): a #GList of of #GFile objects
9300  *
9301  * Initiates startup notification for the application and returns the
9302  * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
9303  * if supported.
9304  *
9305  * Startup notification IDs are defined in the <ulink
9306  * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
9307  * FreeDesktop.Org Startup Notifications standard</ulink>.
9308  *
9309  * Returns: a startup notification ID for the application, or %NULL if not supported.
9310  */
9311
9312
9313 /**
9314  * g_app_launch_context_launch_failed:
9315  * @context: a #GAppLaunchContext.
9316  * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
9317  *
9318  * Called when an application has failed to launch, so that it can cancel
9319  * the application startup notification started in g_app_launch_context_get_startup_notify_id().
9320  */
9321
9322
9323 /**
9324  * g_app_launch_context_new:
9325  *
9326  * Creates a new application launch context. This is not normally used,
9327  * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
9328  *
9329  * Returns: a #GAppLaunchContext.
9330  */
9331
9332
9333 /**
9334  * g_app_launch_context_setenv:
9335  * @context: a #GAppLaunchContext
9336  * @variable: the environment variable to set
9337  * @value: the value for to set the variable to.
9338  *
9339  * Arranges for @variable to be set to @value in the child's
9340  * environment when @context is used to launch an application.
9341  *
9342  * Since: 2.32
9343  */
9344
9345
9346 /**
9347  * g_app_launch_context_unsetenv:
9348  * @context: a #GAppLaunchContext
9349  * @variable: the environment variable to remove
9350  *
9351  * Arranges for @variable to be unset in the child's environment
9352  * when @context is used to launch an application.
9353  *
9354  * Since: 2.32
9355  */
9356
9357
9358 /**
9359  * g_application_activate:
9360  * @application: a #GApplication
9361  *
9362  * Activates the application.
9363  *
9364  * In essence, this results in the #GApplication::activate signal being
9365  * emitted in the primary instance.
9366  *
9367  * The application must be registered before calling this function.
9368  *
9369  * Since: 2.28
9370  */
9371
9372
9373 /**
9374  * g_application_command_line_create_file_for_arg:
9375  * @cmdline: a #GApplicationCommandLine
9376  * @arg: an argument from @cmdline
9377  *
9378  * Creates a #GFile corresponding to a filename that was given as part
9379  * of the invocation of @cmdline.
9380  *
9381  * This differs from g_file_new_for_commandline_arg() in that it
9382  * resolves relative pathnames using the current working directory of
9383  * the invoking process rather than the local process.
9384  *
9385  * Returns: (transfer full): a new #GFile
9386  * Since: 2.36
9387  */
9388
9389
9390 /**
9391  * g_application_command_line_get_arguments:
9392  * @cmdline: a #GApplicationCommandLine
9393  * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9394  *
9395  * Gets the list of arguments that was passed on the command line.
9396  *
9397  * The strings in the array may contain non-utf8 data.
9398  *
9399  * The return value is %NULL-terminated and should be freed using
9400  * g_strfreev().
9401  *
9402  * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9403  * Since: 2.28
9404  */
9405
9406
9407 /**
9408  * g_application_command_line_get_cwd:
9409  * @cmdline: a #GApplicationCommandLine
9410  *
9411  * Gets the working directory of the command line invocation.
9412  * The string may contain non-utf8 data.
9413  *
9414  * It is possible that the remote application did not send a working
9415  * directory, so this may be %NULL.
9416  *
9417  * The return value should not be modified or freed and is valid for as
9418  * long as @cmdline exists.
9419  *
9420  * Returns: the current directory, or %NULL
9421  * Since: 2.28
9422  */
9423
9424
9425 /**
9426  * g_application_command_line_get_environ:
9427  * @cmdline: a #GApplicationCommandLine
9428  *
9429  * Gets the contents of the 'environ' variable of the command line
9430  * invocation, as would be returned by g_get_environ(), ie as a
9431  * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9432  * The strings may contain non-utf8 data.
9433  *
9434  * The remote application usually does not send an environment.  Use
9435  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9436  * set it is possible that the environment is still not available (due
9437  * to invocation messages from other applications).
9438  *
9439  * The return value should not be modified or freed and is valid for as
9440  * long as @cmdline exists.
9441  *
9442  * See g_application_command_line_getenv() if you are only interested
9443  * in the value of a single environment variable.
9444  *
9445  * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9446  * Since: 2.28
9447  */
9448
9449
9450 /**
9451  * g_application_command_line_get_exit_status:
9452  * @cmdline: a #GApplicationCommandLine
9453  *
9454  * Gets the exit status of @cmdline.  See
9455  * g_application_command_line_set_exit_status() for more information.
9456  *
9457  * Returns: the exit status
9458  * Since: 2.28
9459  */
9460
9461
9462 /**
9463  * g_application_command_line_get_is_remote:
9464  * @cmdline: a #GApplicationCommandLine
9465  *
9466  * Determines if @cmdline represents a remote invocation.
9467  *
9468  * Returns: %TRUE if the invocation was remote
9469  * Since: 2.28
9470  */
9471
9472
9473 /**
9474  * g_application_command_line_get_platform_data:
9475  * @cmdline: #GApplicationCommandLine
9476  *
9477  * Gets the platform data associated with the invocation of @cmdline.
9478  *
9479  * This is a #GVariant dictionary containing information about the
9480  * context in which the invocation occurred.  It typically contains
9481  * information like the current working directory and the startup
9482  * notification ID.
9483  *
9484  * For local invocation, it will be %NULL.
9485  *
9486  * Returns: (allow-none): the platform data, or %NULL
9487  * Since: 2.28
9488  */
9489
9490
9491 /**
9492  * g_application_command_line_get_stdin:
9493  * @cmdline: a #GApplicationCommandLine
9494  *
9495  * Gets the stdin of the invoking process.
9496  *
9497  * The #GInputStream can be used to read data passed to the standard
9498  * input of the invoking process.
9499  * This doesn't work on all platforms.  Presently, it is only available
9500  * on UNIX when using a DBus daemon capable of passing file descriptors.
9501  * If stdin is not available then %NULL will be returned.  In the
9502  * future, support may be expanded to other platforms.
9503  *
9504  * You must only call this function once per commandline invocation.
9505  *
9506  * Returns: (transfer full): a #GInputStream for stdin
9507  * Since: 2.34
9508  */
9509
9510
9511 /**
9512  * g_application_command_line_getenv:
9513  * @cmdline: a #GApplicationCommandLine
9514  * @name: the environment variable to get
9515  *
9516  * Gets the value of a particular environment variable of the command
9517  * line invocation, as would be returned by g_getenv().  The strings may
9518  * contain non-utf8 data.
9519  *
9520  * The remote application usually does not send an environment.  Use
9521  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9522  * set it is possible that the environment is still not available (due
9523  * to invocation messages from other applications).
9524  *
9525  * The return value should not be modified or freed and is valid for as
9526  * long as @cmdline exists.
9527  *
9528  * Returns: the value of the variable, or %NULL if unset or unsent
9529  * Since: 2.28
9530  */
9531
9532
9533 /**
9534  * g_application_command_line_print:
9535  * @cmdline: a #GApplicationCommandLine
9536  * @format: a printf-style format string
9537  * @...: arguments, as per @format
9538  *
9539  * Formats a message and prints it using the stdout print handler in the
9540  * invoking process.
9541  *
9542  * If @cmdline is a local invocation then this is exactly equivalent to
9543  * g_print().  If @cmdline is remote then this is equivalent to calling
9544  * g_print() in the invoking process.
9545  *
9546  * Since: 2.28
9547  */
9548
9549
9550 /**
9551  * g_application_command_line_printerr:
9552  * @cmdline: a #GApplicationCommandLine
9553  * @format: a printf-style format string
9554  * @...: arguments, as per @format
9555  *
9556  * Formats a message and prints it using the stderr print handler in the
9557  * invoking process.
9558  *
9559  * If @cmdline is a local invocation then this is exactly equivalent to
9560  * g_printerr().  If @cmdline is remote then this is equivalent to
9561  * calling g_printerr() in the invoking process.
9562  *
9563  * Since: 2.28
9564  */
9565
9566
9567 /**
9568  * g_application_command_line_set_exit_status:
9569  * @cmdline: a #GApplicationCommandLine
9570  * @exit_status: the exit status
9571  *
9572  * Sets the exit status that will be used when the invoking process
9573  * exits.
9574  *
9575  * The return value of the #GApplication::command-line signal is
9576  * passed to this function when the handler returns.  This is the usual
9577  * way of setting the exit status.
9578  *
9579  * In the event that you want the remote invocation to continue running
9580  * and want to decide on the exit status in the future, you can use this
9581  * call.  For the case of a remote invocation, the remote process will
9582  * typically exit when the last reference is dropped on @cmdline.  The
9583  * exit status of the remote process will be equal to the last value
9584  * that was set with this function.
9585  *
9586  * In the case that the commandline invocation is local, the situation
9587  * is slightly more complicated.  If the commandline invocation results
9588  * in the mainloop running (ie: because the use-count of the application
9589  * increased to a non-zero value) then the application is considered to
9590  * have been 'successful' in a certain sense, and the exit status is
9591  * always zero.  If the application use count is zero, though, the exit
9592  * status of the local #GApplicationCommandLine is used.
9593  *
9594  * Since: 2.28
9595  */
9596
9597
9598 /**
9599  * g_application_get_application_id:
9600  * @application: a #GApplication
9601  *
9602  * Gets the unique identifier for @application.
9603  *
9604  * Returns: the identifier for @application, owned by @application
9605  * Since: 2.28
9606  */
9607
9608
9609 /**
9610  * g_application_get_dbus_connection:
9611  * @application: a #GApplication
9612  *
9613  * Gets the #GDBusConnection being used by the application, or %NULL.
9614  *
9615  * If #GApplication is using its D-Bus backend then this function will
9616  * return the #GDBusConnection being used for uniqueness and
9617  * communication with the desktop environment and other instances of the
9618  * application.
9619  *
9620  * If #GApplication is not using D-Bus then this function will return
9621  * %NULL.  This includes the situation where the D-Bus backend would
9622  * normally be in use but we were unable to connect to the bus.
9623  *
9624  * This function must not be called before the application has been
9625  * registered.  See g_application_get_is_registered().
9626  *
9627  * Returns: (transfer none): a #GDBusConnection, or %NULL
9628  * Since: 2.34
9629  */
9630
9631
9632 /**
9633  * g_application_get_dbus_object_path:
9634  * @application: a #GApplication
9635  *
9636  * Gets the D-Bus object path being used by the application, or %NULL.
9637  *
9638  * If #GApplication is using its D-Bus backend then this function will
9639  * return the D-Bus object path that #GApplication is using.  If the
9640  * application is the primary instance then there is an object published
9641  * at this path.  If the application is not the primary instance then
9642  * the result of this function is undefined.
9643  *
9644  * If #GApplication is not using D-Bus then this function will return
9645  * %NULL.  This includes the situation where the D-Bus backend would
9646  * normally be in use but we were unable to connect to the bus.
9647  *
9648  * This function must not be called before the application has been
9649  * registered.  See g_application_get_is_registered().
9650  *
9651  * Returns: the object path, or %NULL
9652  * Since: 2.34
9653  */
9654
9655
9656 /**
9657  * g_application_get_default:
9658  *
9659  * Returns the default #GApplication instance for this process.
9660  *
9661  * Normally there is only one #GApplication per process and it becomes
9662  * the default when it is created.  You can exercise more control over
9663  * this by using g_application_set_default().
9664  *
9665  * If there is no default application then %NULL is returned.
9666  *
9667  * Returns: (transfer none): the default application for this process, or %NULL
9668  * Since: 2.32
9669  */
9670
9671
9672 /**
9673  * g_application_get_flags:
9674  * @application: a #GApplication
9675  *
9676  * Gets the flags for @application.
9677  *
9678  * See #GApplicationFlags.
9679  *
9680  * Returns: the flags for @application
9681  * Since: 2.28
9682  */
9683
9684
9685 /**
9686  * g_application_get_inactivity_timeout:
9687  * @application: a #GApplication
9688  *
9689  * Gets the current inactivity timeout for the application.
9690  *
9691  * This is the amount of time (in milliseconds) after the last call to
9692  * g_application_release() before the application stops running.
9693  *
9694  * Returns: the timeout, in milliseconds
9695  * Since: 2.28
9696  */
9697
9698
9699 /**
9700  * g_application_get_is_registered:
9701  * @application: a #GApplication
9702  *
9703  * Checks if @application is registered.
9704  *
9705  * An application is registered if g_application_register() has been
9706  * successfully called.
9707  *
9708  * Returns: %TRUE if @application is registered
9709  * Since: 2.28
9710  */
9711
9712
9713 /**
9714  * g_application_get_is_remote:
9715  * @application: a #GApplication
9716  *
9717  * Checks if @application is remote.
9718  *
9719  * If @application is remote then it means that another instance of
9720  * application already exists (the 'primary' instance).  Calls to
9721  * perform actions on @application will result in the actions being
9722  * performed by the primary instance.
9723  *
9724  * The value of this property cannot be accessed before
9725  * g_application_register() has been called.  See
9726  * g_application_get_is_registered().
9727  *
9728  * Returns: %TRUE if @application is remote
9729  * Since: 2.28
9730  */
9731
9732
9733 /**
9734  * g_application_hold:
9735  * @application: a #GApplication
9736  *
9737  * Increases the use count of @application.
9738  *
9739  * Use this function to indicate that the application has a reason to
9740  * continue to run.  For example, g_application_hold() is called by GTK+
9741  * when a toplevel window is on the screen.
9742  *
9743  * To cancel the hold, call g_application_release().
9744  */
9745
9746
9747 /**
9748  * g_application_id_is_valid:
9749  * @application_id: a potential application identifier
9750  *
9751  * Checks if @application_id is a valid application identifier.
9752  *
9753  * A valid ID is required for calls to g_application_new() and
9754  * g_application_set_application_id().
9755  *
9756  * For convenience, the restrictions on application identifiers are
9757  * reproduced here:
9758  * <itemizedlist>
9759  *   <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
9760  *   <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
9761  *   <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
9762  *   <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
9763  *   <listitem>Application identifiers must not exceed 255 characters.</listitem>
9764  * </itemizedlist>
9765  *
9766  * Returns: %TRUE if @application_id is valid
9767  */
9768
9769
9770 /**
9771  * g_application_mark_busy:
9772  * @application: a #GApplication
9773  *
9774  * Increases the busy count of @application.
9775  *
9776  * Use this function to indicate that the application is busy, for instance
9777  * while a long running operation is pending.
9778  *
9779  * The busy state will be exposed to other processes, so a session shell will
9780  * use that information to indicate the state to the user (e.g. with a
9781  * spinner).
9782  *
9783  * To cancel the busy indication, use g_application_unmark_busy().
9784  *
9785  * Since: 2.38
9786  */
9787
9788
9789 /**
9790  * g_application_new:
9791  * @application_id: (allow-none): the application id
9792  * @flags: the application flags
9793  *
9794  * Creates a new #GApplication instance.
9795  *
9796  * If non-%NULL, the application id must be valid.  See
9797  * g_application_id_is_valid().
9798  *
9799  * If no application ID is given then some features of #GApplication
9800  * (most notably application uniqueness) will be disabled.
9801  *
9802  * Returns: a new #GApplication instance
9803  */
9804
9805
9806 /**
9807  * g_application_open:
9808  * @application: a #GApplication
9809  * @files: (array length=n_files): an array of #GFiles to open
9810  * @n_files: the length of the @files array
9811  * @hint: a hint (or ""), but never %NULL
9812  *
9813  * Opens the given files.
9814  *
9815  * In essence, this results in the #GApplication::open signal being emitted
9816  * in the primary instance.
9817  *
9818  * @n_files must be greater than zero.
9819  *
9820  * @hint is simply passed through to the ::open signal.  It is
9821  * intended to be used by applications that have multiple modes for
9822  * opening files (eg: "view" vs "edit", etc).  Unless you have a need
9823  * for this functionality, you should use "".
9824  *
9825  * The application must be registered before calling this function
9826  * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
9827  *
9828  * Since: 2.28
9829  */
9830
9831
9832 /**
9833  * g_application_quit:
9834  * @application: a #GApplication
9835  *
9836  * Immediately quits the application.
9837  *
9838  * Upon return to the mainloop, g_application_run() will return,
9839  * calling only the 'shutdown' function before doing so.
9840  *
9841  * The hold count is ignored.
9842  *
9843  * The result of calling g_application_run() again after it returns is
9844  * unspecified.
9845  *
9846  * Since: 2.32
9847  */
9848
9849
9850 /**
9851  * g_application_register:
9852  * @application: a #GApplication
9853  * @cancellable: (allow-none): a #GCancellable, or %NULL
9854  * @error: a pointer to a NULL #GError, or %NULL
9855  *
9856  * Attempts registration of the application.
9857  *
9858  * This is the point at which the application discovers if it is the
9859  * primary instance or merely acting as a remote for an already-existing
9860  * primary instance.  This is implemented by attempting to acquire the
9861  * application identifier as a unique bus name on the session bus using
9862  * GDBus.
9863  *
9864  * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
9865  * given, then this process will always become the primary instance.
9866  *
9867  * Due to the internal architecture of GDBus, method calls can be
9868  * dispatched at any time (even if a main loop is not running).  For
9869  * this reason, you must ensure that any object paths that you wish to
9870  * register are registered before calling this function.
9871  *
9872  * If the application has already been registered then %TRUE is
9873  * returned with no work performed.
9874  *
9875  * The #GApplication::startup signal is emitted if registration succeeds
9876  * and @application is the primary instance (including the non-unique
9877  * case).
9878  *
9879  * In the event of an error (such as @cancellable being cancelled, or a
9880  * failure to connect to the session bus), %FALSE is returned and @error
9881  * is set appropriately.
9882  *
9883  * Note: the return value of this function is not an indicator that this
9884  * instance is or is not the primary instance of the application.  See
9885  * g_application_get_is_remote() for that.
9886  *
9887  * Returns: %TRUE if registration succeeded
9888  * Since: 2.28
9889  */
9890
9891
9892 /**
9893  * g_application_release:
9894  * @application: a #GApplication
9895  *
9896  * Decrease the use count of @application.
9897  *
9898  * When the use count reaches zero, the application will stop running.
9899  *
9900  * Never call this function except to cancel the effect of a previous
9901  * call to g_application_hold().
9902  */
9903
9904
9905 /**
9906  * g_application_run:
9907  * @application: a #GApplication
9908  * @argc: the argc from main() (or 0 if @argv is %NULL)
9909  * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
9910  *
9911  * Runs the application.
9912  *
9913  * This function is intended to be run from main() and its return value
9914  * is intended to be returned by main(). Although you are expected to pass
9915  * the @argc, @argv parameters from main() to this function, it is possible
9916  * to pass %NULL if @argv is not available or commandline handling is not
9917  * required.
9918  *
9919  * First, the local_command_line() virtual function is invoked.
9920  * This function always runs on the local instance. It gets passed a pointer
9921  * to a %NULL-terminated copy of @argv and is expected to remove the arguments
9922  * that it handled (shifting up remaining arguments). See
9923  * <xref linkend="gapplication-example-cmdline2"/> for an example of
9924  * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
9925  * after setting <literal>argc = g_strv_length (argv);</literal>.
9926  *
9927  * The last argument to local_command_line() is a pointer to the @status
9928  * variable which can used to set the exit status that is returned from
9929  * g_application_run().
9930  *
9931  * If local_command_line() returns %TRUE, the command line is expected
9932  * to be completely handled, including possibly registering as the primary
9933  * instance, calling g_application_activate() or g_application_open(), etc.
9934  *
9935  * If local_command_line() returns %FALSE then the application is registered
9936  * and the #GApplication::command-line signal is emitted in the primary
9937  * instance (which may or may not be this instance). The signal handler
9938  * gets passed a #GApplicationCommandLine object that (among other things)
9939  * contains the remaining commandline arguments that have not been handled
9940  * by local_command_line().
9941  *
9942  * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
9943  * flag set then the default implementation of local_command_line()
9944  * always returns %FALSE immediately, resulting in the commandline
9945  * always being handled in the primary instance.
9946  *
9947  * Otherwise, the default implementation of local_command_line() tries
9948  * to do a couple of things that are probably reasonable for most
9949  * applications.  First, g_application_register() is called to attempt
9950  * to register the application.  If that works, then the command line
9951  * arguments are inspected.  If no commandline arguments are given, then
9952  * g_application_activate() is called.  If commandline arguments are
9953  * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
9954  * are assumed to be filenames and g_application_open() is called.
9955  *
9956  * If you need to handle commandline arguments that are not filenames,
9957  * and you don't mind commandline handling to happen in the primary
9958  * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
9959  * process the commandline arguments in your #GApplication::command-line
9960  * signal handler, either manually or using the #GOptionContext API.
9961  *
9962  * If you are interested in doing more complicated local handling of the
9963  * commandline then you should implement your own #GApplication subclass
9964  * and override local_command_line(). In this case, you most likely want
9965  * to return %TRUE from your local_command_line() implementation to
9966  * suppress the default handling. See
9967  * <xref linkend="gapplication-example-cmdline2"/> for an example.
9968  *
9969  * If, after the above is done, the use count of the application is zero
9970  * then the exit status is returned immediately.  If the use count is
9971  * non-zero then the default main context is iterated until the use count
9972  * falls to zero, at which point 0 is returned.
9973  *
9974  * If the %G_APPLICATION_IS_SERVICE flag is set, then the service will
9975  * run for as much as 10 seconds with a use count of zero while waiting
9976  * for the message that caused the activation to arrive.  After that,
9977  * if the use count falls to zero the application will exit immediately,
9978  * except in the case that g_application_set_inactivity_timeout() is in
9979  * use.
9980  *
9981  * This function sets the prgname (g_set_prgname()), if not already set,
9982  * to the basename of argv[0].  Since 2.38, if %G_APPLICATION_IS_SERVICE
9983  * is specified, the prgname is set to the application ID.  The main
9984  * impact of this is is that the wmclass of windows created by Gtk+ will
9985  * be set accordingly, which helps the window manager determine which
9986  * application is showing the window.
9987  *
9988  * Returns: the exit status
9989  * Since: 2.28
9990  */
9991
9992
9993 /**
9994  * g_application_set_action_group:
9995  * @application: a #GApplication
9996  * @action_group: (allow-none): a #GActionGroup, or %NULL
9997  *
9998  * This used to be how actions were associated with a #GApplication.
9999  * Now there is #GActionMap for that.
10000  *
10001  * Since: 2.28
10002  * Deprecated: 2.32:Use the #GActionMap interface instead.  Never ever mix use of this API with use of #GActionMap on the same @application or things will go very badly wrong.  This function is known to introduce buggy behaviour (ie: signals not emitted on changes to the action group), so you should really use #GActionMap instead.
10003  */
10004
10005
10006 /**
10007  * g_application_set_application_id:
10008  * @application: a #GApplication
10009  * @application_id: (allow-none): the identifier for @application
10010  *
10011  * Sets the unique identifier for @application.
10012  *
10013  * The application id can only be modified if @application has not yet
10014  * been registered.
10015  *
10016  * If non-%NULL, the application id must be valid.  See
10017  * g_application_id_is_valid().
10018  *
10019  * Since: 2.28
10020  */
10021
10022
10023 /**
10024  * g_application_set_default:
10025  * @application: (allow-none): the application to set as default, or %NULL
10026  *
10027  * Sets or unsets the default application for the process, as returned
10028  * by g_application_get_default().
10029  *
10030  * This function does not take its own reference on @application.  If
10031  * @application is destroyed then the default application will revert
10032  * back to %NULL.
10033  *
10034  * Since: 2.32
10035  */
10036
10037
10038 /**
10039  * g_application_set_flags:
10040  * @application: a #GApplication
10041  * @flags: the flags for @application
10042  *
10043  * Sets the flags for @application.
10044  *
10045  * The flags can only be modified if @application has not yet been
10046  * registered.
10047  *
10048  * See #GApplicationFlags.
10049  *
10050  * Since: 2.28
10051  */
10052
10053
10054 /**
10055  * g_application_set_inactivity_timeout:
10056  * @application: a #GApplication
10057  * @inactivity_timeout: the timeout, in milliseconds
10058  *
10059  * Sets the current inactivity timeout for the application.
10060  *
10061  * This is the amount of time (in milliseconds) after the last call to
10062  * g_application_release() before the application stops running.
10063  *
10064  * This call has no side effects of its own.  The value set here is only
10065  * used for next time g_application_release() drops the use count to
10066  * zero.  Any timeouts currently in progress are not impacted.
10067  *
10068  * Since: 2.28
10069  */
10070
10071
10072 /**
10073  * g_application_unmark_busy:
10074  * @application: a #GApplication
10075  *
10076  * Decreases the busy count of @application.
10077  *
10078  * When the busy count reaches zero, the new state will be propagated
10079  * to other processes.
10080  *
10081  * This function must only be called to cancel the effect of a previous
10082  * call to g_application_mark_busy().
10083  *
10084  * Since: 2.38
10085  */
10086
10087
10088 /**
10089  * g_async_initable_init_async:
10090  * @initable: a #GAsyncInitable.
10091  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10092  * @cancellable: optional #GCancellable object, %NULL to ignore.
10093  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10094  * @user_data: the data to pass to callback function
10095  *
10096  * Starts asynchronous initialization of the object implementing the
10097  * interface. This must be done before any real use of the object after
10098  * initial construction. If the object also implements #GInitable you can
10099  * optionally call g_initable_init() instead.
10100  *
10101  * When the initialization is finished, @callback will be called. You can
10102  * then call g_async_initable_init_finish() to get the result of the
10103  * initialization.
10104  *
10105  * Implementations may also support cancellation. If @cancellable is not
10106  * %NULL, then initialization can be cancelled by triggering the cancellable
10107  * object from another thread. If the operation was cancelled, the error
10108  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10109  * the object doesn't support cancellable initialization, the error
10110  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10111  *
10112  * As with #GInitable, if the object is not initialized, or initialization
10113  * returns with an error, then all operations on the object except
10114  * g_object_ref() and g_object_unref() are considered to be invalid, and
10115  * have undefined behaviour. They will often fail with g_critical() or
10116  * g_warning(), but this must not be relied on.
10117  *
10118  * Implementations of this method must be idempotent: i.e. multiple calls
10119  * to this function with the same argument should return the same results.
10120  * Only the first call initializes the object; further calls return the result
10121  * of the first call. This is so that it's safe to implement the singleton
10122  * pattern in the GObject constructor function.
10123  *
10124  * For classes that also support the #GInitable interface, the default
10125  * implementation of this method will run the g_initable_init() function
10126  * in a thread, so if you want to support asynchronous initialization via
10127  * threads, just implement the #GAsyncInitable interface without overriding
10128  * any interface methods.
10129  *
10130  * Since: 2.22
10131  */
10132
10133
10134 /**
10135  * g_async_initable_init_finish:
10136  * @initable: a #GAsyncInitable.
10137  * @res: a #GAsyncResult.
10138  * @error: a #GError location to store the error occurring, or %NULL to ignore.
10139  *
10140  * Finishes asynchronous initialization and returns the result.
10141  * See g_async_initable_init_async().
10142  *
10143  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
10144  * Since: 2.22
10145  */
10146
10147
10148 /**
10149  * g_async_initable_new_async:
10150  * @object_type: a #GType supporting #GAsyncInitable.
10151  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10152  * @cancellable: optional #GCancellable object, %NULL to ignore.
10153  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10154  * @user_data: the data to pass to callback function
10155  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
10156  * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
10157  *
10158  * Helper function for constructing #GAsyncInitable object. This is
10159  * similar to g_object_new() but also initializes the object asynchronously.
10160  *
10161  * When the initialization is finished, @callback will be called. You can
10162  * then call g_async_initable_new_finish() to get the new object and check
10163  * for any errors.
10164  *
10165  * Since: 2.22
10166  */
10167
10168
10169 /**
10170  * g_async_initable_new_finish:
10171  * @initable: the #GAsyncInitable from the callback
10172  * @res: the #GAsyncResult from the callback
10173  * @error: return location for errors, or %NULL to ignore
10174  *
10175  * Finishes the async construction for the various g_async_initable_new
10176  * calls, returning the created object or %NULL on error.
10177  *
10178  * Returns: (type GObject.Object) (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
10179  * Since: 2.22
10180  */
10181
10182
10183 /**
10184  * g_async_initable_new_valist_async:
10185  * @object_type: a #GType supporting #GAsyncInitable.
10186  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
10187  * @var_args: The var args list generated from @first_property_name.
10188  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10189  * @cancellable: optional #GCancellable object, %NULL to ignore.
10190  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10191  * @user_data: the data to pass to callback function
10192  *
10193  * Helper function for constructing #GAsyncInitable object. This is
10194  * similar to g_object_new_valist() but also initializes the object
10195  * asynchronously.
10196  *
10197  * When the initialization is finished, @callback will be called. You can
10198  * then call g_async_initable_new_finish() to get the new object and check
10199  * for any errors.
10200  *
10201  * Since: 2.22
10202  */
10203
10204
10205 /**
10206  * g_async_initable_newv_async:
10207  * @object_type: a #GType supporting #GAsyncInitable.
10208  * @n_parameters: the number of parameters in @parameters
10209  * @parameters: the parameters to use to construct the object
10210  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10211  * @cancellable: optional #GCancellable object, %NULL to ignore.
10212  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10213  * @user_data: the data to pass to callback function
10214  *
10215  * Helper function for constructing #GAsyncInitable object. This is
10216  * similar to g_object_newv() but also initializes the object asynchronously.
10217  *
10218  * When the initialization is finished, @callback will be called. You can
10219  * then call g_async_initable_new_finish() to get the new object and check
10220  * for any errors.
10221  *
10222  * Since: 2.22
10223  */
10224
10225
10226 /**
10227  * g_async_result_get_source_object:
10228  * @res: a #GAsyncResult
10229  *
10230  * Gets the source object from a #GAsyncResult.
10231  *
10232  * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
10233  */
10234
10235
10236 /**
10237  * g_async_result_get_user_data:
10238  * @res: a #GAsyncResult.
10239  *
10240  * Gets the user data from a #GAsyncResult.
10241  *
10242  * Returns: (transfer full): the user data for @res.
10243  */
10244
10245
10246 /**
10247  * g_async_result_is_tagged:
10248  * @res: a #GAsyncResult
10249  * @source_tag: an application-defined tag
10250  *
10251  * Checks if @res has the given @source_tag (generally a function
10252  * pointer indicating the function @res was created by).
10253  *
10254  * Returns: %TRUE if @res has the indicated @source_tag, %FALSE if not.
10255  * Since: 2.34
10256  */
10257
10258
10259 /**
10260  * g_async_result_legacy_propagate_error:
10261  * @res: a #GAsyncResult
10262  * @error: (out): a location to propagate the error to.
10263  *
10264  * If @res is a #GSimpleAsyncResult, this is equivalent to
10265  * g_simple_async_result_propagate_error(). Otherwise it returns
10266  * %FALSE.
10267  *
10268  * This can be used for legacy error handling in async
10269  * <literal>_finish ()</literal> wrapper functions that traditionally
10270  * handled #GSimpleAsyncResult error returns themselves rather than
10271  * calling into the virtual method. This should not be used in new
10272  * code; #GAsyncResult errors that are set by virtual methods should
10273  * also be extracted by virtual methods, to enable subclasses to chain
10274  * up correctly.
10275  *
10276  * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
10277  * Since: 2.34
10278  */
10279
10280
10281 /**
10282  * g_buffered_input_stream_fill:
10283  * @stream: a #GBufferedInputStream
10284  * @count: the number of bytes that will be read from the stream
10285  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10286  * @error: location to store the error occurring, or %NULL to ignore
10287  *
10288  * Tries to read @count bytes from the stream into the buffer.
10289  * Will block during this read.
10290  *
10291  * If @count is zero, returns zero and does nothing. A value of @count
10292  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
10293  *
10294  * On success, the number of bytes read into the buffer is returned.
10295  * It is not an error if this is not the same as the requested size, as it
10296  * can happen e.g. near the end of a file. Zero is returned on end of file
10297  * (or if @count is zero),  but never otherwise.
10298  *
10299  * If @count is -1 then the attempted read size is equal to the number of
10300  * bytes that are required to fill the buffer.
10301  *
10302  * If @cancellable is not %NULL, then the operation can be cancelled by
10303  * triggering the cancellable object from another thread. If the operation
10304  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10305  * operation was partially finished when the operation was cancelled the
10306  * partial result will be returned, without an error.
10307  *
10308  * On error -1 is returned and @error is set accordingly.
10309  *
10310  * For the asynchronous, non-blocking, version of this function, see
10311  * g_buffered_input_stream_fill_async().
10312  *
10313  * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
10314  */
10315
10316
10317 /**
10318  * g_buffered_input_stream_fill_async:
10319  * @stream: a #GBufferedInputStream
10320  * @count: the number of bytes that will be read from the stream
10321  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
10322  * @cancellable: (allow-none): optional #GCancellable object
10323  * @callback: (scope async): a #GAsyncReadyCallback
10324  * @user_data: (closure): a #gpointer
10325  *
10326  * Reads data into @stream's buffer asynchronously, up to @count size.
10327  * @io_priority can be used to prioritize reads. For the synchronous
10328  * version of this function, see g_buffered_input_stream_fill().
10329  *
10330  * If @count is -1 then the attempted read size is equal to the number
10331  * of bytes that are required to fill the buffer.
10332  */
10333
10334
10335 /**
10336  * g_buffered_input_stream_fill_finish:
10337  * @stream: a #GBufferedInputStream
10338  * @result: a #GAsyncResult
10339  * @error: a #GError
10340  *
10341  * Finishes an asynchronous read.
10342  *
10343  * Returns: a #gssize of the read stream, or %-1 on an error.
10344  */
10345
10346
10347 /**
10348  * g_buffered_input_stream_get_available:
10349  * @stream: #GBufferedInputStream
10350  *
10351  * Gets the size of the available data within the stream.
10352  *
10353  * Returns: size of the available stream.
10354  */
10355
10356
10357 /**
10358  * g_buffered_input_stream_get_buffer_size:
10359  * @stream: a #GBufferedInputStream
10360  *
10361  * Gets the size of the input buffer.
10362  *
10363  * Returns: the current buffer size.
10364  */
10365
10366
10367 /**
10368  * g_buffered_input_stream_new:
10369  * @base_stream: a #GInputStream
10370  *
10371  * Creates a new #GInputStream from the given @base_stream, with
10372  * a buffer set to the default size (4 kilobytes).
10373  *
10374  * Returns: a #GInputStream for the given @base_stream.
10375  */
10376
10377
10378 /**
10379  * g_buffered_input_stream_new_sized:
10380  * @base_stream: a #GInputStream
10381  * @size: a #gsize
10382  *
10383  * Creates a new #GBufferedInputStream from the given @base_stream,
10384  * with a buffer set to @size.
10385  *
10386  * Returns: a #GInputStream.
10387  */
10388
10389
10390 /**
10391  * g_buffered_input_stream_peek:
10392  * @stream: a #GBufferedInputStream
10393  * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10394  * @offset: a #gsize
10395  * @count: a #gsize
10396  *
10397  * Peeks in the buffer, copying data of size @count into @buffer,
10398  * offset @offset bytes.
10399  *
10400  * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10401  */
10402
10403
10404 /**
10405  * g_buffered_input_stream_peek_buffer:
10406  * @stream: a #GBufferedInputStream
10407  * @count: (out): a #gsize to get the number of bytes available in the buffer
10408  *
10409  * Returns the buffer with the currently available bytes. The returned
10410  * buffer must not be modified and will become invalid when reading from
10411  * the stream or filling the buffer.
10412  *
10413  * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10414  */
10415
10416
10417 /**
10418  * g_buffered_input_stream_read_byte:
10419  * @stream: a #GBufferedInputStream
10420  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10421  * @error: location to store the error occurring, or %NULL to ignore
10422  *
10423  * Tries to read a single byte from the stream or the buffer. Will block
10424  * during this read.
10425  *
10426  * On success, the byte read from the stream is returned. On end of stream
10427  * -1 is returned but it's not an exceptional error and @error is not set.
10428  *
10429  * If @cancellable is not %NULL, then the operation can be cancelled by
10430  * triggering the cancellable object from another thread. If the operation
10431  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10432  * operation was partially finished when the operation was cancelled the
10433  * partial result will be returned, without an error.
10434  *
10435  * On error -1 is returned and @error is set accordingly.
10436  *
10437  * Returns: the byte read from the @stream, or -1 on end of stream or error.
10438  */
10439
10440
10441 /**
10442  * g_buffered_input_stream_set_buffer_size:
10443  * @stream: a #GBufferedInputStream
10444  * @size: a #gsize
10445  *
10446  * Sets the size of the internal buffer of @stream to @size, or to the
10447  * size of the contents of the buffer. The buffer can never be resized
10448  * smaller than its current contents.
10449  */
10450
10451
10452 /**
10453  * g_buffered_output_stream_get_auto_grow:
10454  * @stream: a #GBufferedOutputStream.
10455  *
10456  * Checks if the buffer automatically grows as data is added.
10457  *
10458  * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10459  */
10460
10461
10462 /**
10463  * g_buffered_output_stream_get_buffer_size:
10464  * @stream: a #GBufferedOutputStream.
10465  *
10466  * Gets the size of the buffer in the @stream.
10467  *
10468  * Returns: the current size of the buffer.
10469  */
10470
10471
10472 /**
10473  * g_buffered_output_stream_new:
10474  * @base_stream: a #GOutputStream.
10475  *
10476  * Creates a new buffered output stream for a base stream.
10477  *
10478  * Returns: a #GOutputStream for the given @base_stream.
10479  */
10480
10481
10482 /**
10483  * g_buffered_output_stream_new_sized:
10484  * @base_stream: a #GOutputStream.
10485  * @size: a #gsize.
10486  *
10487  * Creates a new buffered output stream with a given buffer size.
10488  *
10489  * Returns: a #GOutputStream with an internal buffer set to @size.
10490  */
10491
10492
10493 /**
10494  * g_buffered_output_stream_set_auto_grow:
10495  * @stream: a #GBufferedOutputStream.
10496  * @auto_grow: a #gboolean.
10497  *
10498  * Sets whether or not the @stream's buffer should automatically grow.
10499  * If @auto_grow is true, then each write will just make the buffer
10500  * larger, and you must manually flush the buffer to actually write out
10501  * the data to the underlying stream.
10502  */
10503
10504
10505 /**
10506  * g_buffered_output_stream_set_buffer_size:
10507  * @stream: a #GBufferedOutputStream.
10508  * @size: a #gsize.
10509  *
10510  * Sets the size of the internal buffer to @size.
10511  */
10512
10513
10514 /**
10515  * g_bus_get:
10516  * @bus_type: A #GBusType.
10517  * @cancellable: (allow-none): A #GCancellable or %NULL.
10518  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10519  * @user_data: The data to pass to @callback.
10520  *
10521  * Asynchronously connects to the message bus specified by @bus_type.
10522  *
10523  * When the operation is finished, @callback will be invoked. You can
10524  * then call g_bus_get_finish() to get the result of the operation.
10525  *
10526  * This is a asynchronous failable function. See g_bus_get_sync() for
10527  * the synchronous version.
10528  *
10529  * Since: 2.26
10530  */
10531
10532
10533 /**
10534  * g_bus_get_finish:
10535  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10536  * @error: Return location for error or %NULL.
10537  *
10538  * Finishes an operation started with g_bus_get().
10539  *
10540  * The returned object is a singleton, that is, shared with other
10541  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10542  * event that you need a private message bus connection, use
10543  * g_dbus_address_get_for_bus_sync() and
10544  * g_dbus_connection_new_for_address().
10545  *
10546  * Note that the returned #GDBusConnection object will (usually) have
10547  * the #GDBusConnection:exit-on-close property set to %TRUE.
10548  *
10549  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10550  * Since: 2.26
10551  */
10552
10553
10554 /**
10555  * g_bus_get_sync:
10556  * @bus_type: A #GBusType.
10557  * @cancellable: (allow-none): A #GCancellable or %NULL.
10558  * @error: Return location for error or %NULL.
10559  *
10560  * Synchronously connects to the message bus specified by @bus_type.
10561  * Note that the returned object may shared with other callers,
10562  * e.g. if two separate parts of a process calls this function with
10563  * the same @bus_type, they will share the same object.
10564  *
10565  * This is a synchronous failable function. See g_bus_get() and
10566  * g_bus_get_finish() for the asynchronous version.
10567  *
10568  * The returned object is a singleton, that is, shared with other
10569  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10570  * event that you need a private message bus connection, use
10571  * g_dbus_address_get_for_bus_sync() and
10572  * g_dbus_connection_new_for_address().
10573  *
10574  * Note that the returned #GDBusConnection object will (usually) have
10575  * the #GDBusConnection:exit-on-close property set to %TRUE.
10576  *
10577  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10578  * Since: 2.26
10579  */
10580
10581
10582 /**
10583  * g_bus_own_name:
10584  * @bus_type: The type of bus to own a name on.
10585  * @name: The well-known name to own.
10586  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10587  * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10588  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10589  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10590  * @user_data: User data to pass to handlers.
10591  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10592  *
10593  * Starts acquiring @name on the bus specified by @bus_type and calls
10594  * @name_acquired_handler and @name_lost_handler when the name is
10595  * acquired respectively lost. Callbacks will be invoked in the <link
10596  * linkend="g-main-context-push-thread-default">thread-default main
10597  * loop</link> of the thread you are calling this function from.
10598  *
10599  * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10600  * callbacks will be invoked after calling this function - there are three
10601  * possible cases:
10602  * <itemizedlist>
10603  *   <listitem><para>
10604  *     @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10605  *   </para></listitem>
10606  *   <listitem><para>
10607  *     @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10608  *   </para></listitem>
10609  *   <listitem><para>
10610  *     @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10611  *   </para></listitem>
10612  * </itemizedlist>
10613  * When you are done owning the name, just call g_bus_unown_name()
10614  * with the owner id this function returns.
10615  *
10616  * If the name is acquired or lost (for example another application
10617  * could acquire the name if you allow replacement or the application
10618  * currently owning the name exits), the handlers are also invoked. If the
10619  * #GDBusConnection that is used for attempting to own the name
10620  * closes, then @name_lost_handler is invoked since it is no
10621  * longer possible for other processes to access the process.
10622  *
10623  * You cannot use g_bus_own_name() several times for the same name (unless
10624  * interleaved with calls to g_bus_unown_name()) - only the first call
10625  * will work.
10626  *
10627  * Another guarantee is that invocations of @name_acquired_handler
10628  * and @name_lost_handler are guaranteed to alternate; that
10629  * is, if @name_acquired_handler is invoked then you are
10630  * guaranteed that the next time one of the handlers is invoked, it
10631  * will be @name_lost_handler. The reverse is also true.
10632  *
10633  * If you plan on exporting objects (using e.g.
10634  * g_dbus_connection_register_object()), note that it is generally too late
10635  * to export the objects in @name_acquired_handler. Instead, you can do this
10636  * in @bus_acquired_handler since you are guaranteed that this will run
10637  * before @name is requested from the bus.
10638  *
10639  * This behavior makes it very simple to write applications that wants
10640  * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10641  * Simply register objects to be exported in @bus_acquired_handler and
10642  * unregister the objects (if any) in @name_lost_handler.
10643  *
10644  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10645  * Since: 2.26
10646  */
10647
10648
10649 /**
10650  * g_bus_own_name_on_connection:
10651  * @connection: A #GDBusConnection.
10652  * @name: The well-known name to own.
10653  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10654  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10655  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10656  * @user_data: User data to pass to handlers.
10657  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10658  *
10659  * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10660  * #GBusType.
10661  *
10662  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10663  * Since: 2.26
10664  */
10665
10666
10667 /**
10668  * g_bus_own_name_on_connection_with_closures:
10669  * @connection: A #GDBusConnection.
10670  * @name: The well-known name to own.
10671  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10672  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10673  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10674  *
10675  * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10676  * easier binding in other languages.
10677  *
10678  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10679  * Rename to: g_bus_own_name_on_connection
10680  * Since: 2.26
10681  */
10682
10683
10684 /**
10685  * g_bus_own_name_with_closures:
10686  * @bus_type: The type of bus to own a name on.
10687  * @name: The well-known name to own.
10688  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10689  * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10690  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10691  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10692  *
10693  * Version of g_bus_own_name() using closures instead of callbacks for
10694  * easier binding in other languages.
10695  *
10696  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10697  * Rename to: g_bus_own_name
10698  * Since: 2.26
10699  */
10700
10701
10702 /**
10703  * g_bus_unown_name:
10704  * @owner_id: An identifier obtained from g_bus_own_name()
10705  *
10706  * Stops owning a name.
10707  *
10708  * Since: 2.26
10709  */
10710
10711
10712 /**
10713  * g_bus_unwatch_name:
10714  * @watcher_id: An identifier obtained from g_bus_watch_name()
10715  *
10716  * Stops watching a name.
10717  *
10718  * Since: 2.26
10719  */
10720
10721
10722 /**
10723  * g_bus_watch_name:
10724  * @bus_type: The type of bus to watch a name on.
10725  * @name: The name (well-known or unique) to watch.
10726  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10727  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10728  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10729  * @user_data: User data to pass to handlers.
10730  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10731  *
10732  * Starts watching @name on the bus specified by @bus_type and calls
10733  * @name_appeared_handler and @name_vanished_handler when the name is
10734  * known to have a owner respectively known to lose its
10735  * owner. Callbacks will be invoked in the <link
10736  * linkend="g-main-context-push-thread-default">thread-default main
10737  * loop</link> of the thread you are calling this function from.
10738  *
10739  * You are guaranteed that one of the handlers will be invoked after
10740  * calling this function. When you are done watching the name, just
10741  * call g_bus_unwatch_name() with the watcher id this function
10742  * returns.
10743  *
10744  * If the name vanishes or appears (for example the application owning
10745  * the name could restart), the handlers are also invoked. If the
10746  * #GDBusConnection that is used for watching the name disconnects, then
10747  * @name_vanished_handler is invoked since it is no longer
10748  * possible to access the name.
10749  *
10750  * Another guarantee is that invocations of @name_appeared_handler
10751  * and @name_vanished_handler are guaranteed to alternate; that
10752  * is, if @name_appeared_handler is invoked then you are
10753  * guaranteed that the next time one of the handlers is invoked, it
10754  * will be @name_vanished_handler. The reverse is also true.
10755  *
10756  * This behavior makes it very simple to write applications that wants
10757  * to take action when a certain name exists, see <xref
10758  * linkend="gdbus-watching-names"/>. Basically, the application
10759  * should create object proxies in @name_appeared_handler and destroy
10760  * them again (if any) in @name_vanished_handler.
10761  *
10762  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10763  * Since: 2.26
10764  */
10765
10766
10767 /**
10768  * g_bus_watch_name_on_connection:
10769  * @connection: A #GDBusConnection.
10770  * @name: The name (well-known or unique) to watch.
10771  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10772  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10773  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10774  * @user_data: User data to pass to handlers.
10775  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10776  *
10777  * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
10778  * #GBusType.
10779  *
10780  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10781  * Since: 2.26
10782  */
10783
10784
10785 /**
10786  * g_bus_watch_name_on_connection_with_closures:
10787  * @connection: A #GDBusConnection.
10788  * @name: The name (well-known or unique) to watch.
10789  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10790  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10791  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10792  *
10793  * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
10794  * easier binding in other languages.
10795  *
10796  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10797  * Rename to: g_bus_watch_name_on_connection
10798  * Since: 2.26
10799  */
10800
10801
10802 /**
10803  * g_bus_watch_name_with_closures:
10804  * @bus_type: The type of bus to watch a name on.
10805  * @name: The name (well-known or unique) to watch.
10806  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10807  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10808  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10809  *
10810  * Version of g_bus_watch_name() using closures instead of callbacks for
10811  * easier binding in other languages.
10812  *
10813  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10814  * Rename to: g_bus_watch_name
10815  * Since: 2.26
10816  */
10817
10818
10819 /**
10820  * g_bytes_icon_get_bytes:
10821  * @icon: a #GIcon.
10822  *
10823  * Gets the #GBytes associated with the given @icon.
10824  *
10825  * Returns: (transfer none): a #GBytes, or %NULL.
10826  * Since: 2.38
10827  */
10828
10829
10830 /**
10831  * g_bytes_icon_new:
10832  * @bytes: a #GBytes.
10833  *
10834  * Creates a new icon for a bytes.
10835  *
10836  * Returns: (transfer full) (type GBytesIcon): a #GIcon for the given @bytes, or %NULL on error.
10837  * Since: 2.38
10838  */
10839
10840
10841 /**
10842  * g_cancellable_cancel:
10843  * @cancellable: a #GCancellable object.
10844  *
10845  * Will set @cancellable to cancelled, and will emit the
10846  * #GCancellable::cancelled signal. (However, see the warning about
10847  * race conditions in the documentation for that signal if you are
10848  * planning to connect to it.)
10849  *
10850  * This function is thread-safe. In other words, you can safely call
10851  * it from a thread other than the one running the operation that was
10852  * passed the @cancellable.
10853  *
10854  * The convention within gio is that cancelling an asynchronous
10855  * operation causes it to complete asynchronously. That is, if you
10856  * cancel the operation from the same thread in which it is running,
10857  * then the operation's #GAsyncReadyCallback will not be invoked until
10858  * the application returns to the main loop.
10859  */
10860
10861
10862 /**
10863  * g_cancellable_connect:
10864  * @cancellable: A #GCancellable.
10865  * @callback: The #GCallback to connect.
10866  * @data: Data to pass to @callback.
10867  * @data_destroy_func: (allow-none): Free function for @data or %NULL.
10868  *
10869  * Convenience function to connect to the #GCancellable::cancelled
10870  * signal. Also handles the race condition that may happen
10871  * if the cancellable is cancelled right before connecting.
10872  *
10873  * @callback is called at most once, either directly at the
10874  * time of the connect if @cancellable is already cancelled,
10875  * or when @cancellable is cancelled in some thread.
10876  *
10877  * @data_destroy_func will be called when the handler is
10878  * disconnected, or immediately if the cancellable is already
10879  * cancelled.
10880  *
10881  * See #GCancellable::cancelled for details on how to use this.
10882  *
10883  * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
10884  * Since: 2.22
10885  */
10886
10887
10888 /**
10889  * g_cancellable_disconnect:
10890  * @cancellable: (allow-none): A #GCancellable or %NULL.
10891  * @handler_id: Handler id of the handler to be disconnected, or %0.
10892  *
10893  * Disconnects a handler from a cancellable instance similar to
10894  * g_signal_handler_disconnect().  Additionally, in the event that a
10895  * signal handler is currently running, this call will block until the
10896  * handler has finished.  Calling this function from a
10897  * #GCancellable::cancelled signal handler will therefore result in a
10898  * deadlock.
10899  *
10900  * This avoids a race condition where a thread cancels at the
10901  * same time as the cancellable operation is finished and the
10902  * signal handler is removed. See #GCancellable::cancelled for
10903  * details on how to use this.
10904  *
10905  * If @cancellable is %NULL or @handler_id is %0 this function does
10906  * nothing.
10907  *
10908  * Since: 2.22
10909  */
10910
10911
10912 /**
10913  * g_cancellable_get_current:
10914  *
10915  * Gets the top cancellable from the stack.
10916  *
10917  * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
10918  */
10919
10920
10921 /**
10922  * g_cancellable_get_fd:
10923  * @cancellable: a #GCancellable.
10924  *
10925  * Gets the file descriptor for a cancellable job. This can be used to
10926  * implement cancellable operations on Unix systems. The returned fd will
10927  * turn readable when @cancellable is cancelled.
10928  *
10929  * You are not supposed to read from the fd yourself, just check for
10930  * readable status. Reading to unset the readable status is done
10931  * with g_cancellable_reset().
10932  *
10933  * After a successful return from this function, you should use
10934  * g_cancellable_release_fd() to free up resources allocated for
10935  * the returned file descriptor.
10936  *
10937  * See also g_cancellable_make_pollfd().
10938  *
10939  * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
10940  */
10941
10942
10943 /**
10944  * g_cancellable_is_cancelled:
10945  * @cancellable: (allow-none): a #GCancellable or %NULL
10946  *
10947  * Checks if a cancellable job has been cancelled.
10948  *
10949  * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
10950  */
10951
10952
10953 /**
10954  * g_cancellable_make_pollfd:
10955  * @cancellable: (allow-none): a #GCancellable or %NULL
10956  * @pollfd: a pointer to a #GPollFD
10957  *
10958  * Creates a #GPollFD corresponding to @cancellable; this can be passed
10959  * to g_poll() and used to poll for cancellation. This is useful both
10960  * for unix systems without a native poll and for portability to
10961  * windows.
10962  *
10963  * When this function returns %TRUE, you should use
10964  * g_cancellable_release_fd() to free up resources allocated for the
10965  * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
10966  *
10967  * If this function returns %FALSE, either no @cancellable was given or
10968  * resource limits prevent this function from allocating the necessary
10969  * structures for polling. (On Linux, you will likely have reached
10970  * the maximum number of file descriptors.) The suggested way to handle
10971  * these cases is to ignore the @cancellable.
10972  *
10973  * You are not supposed to read from the fd yourself, just check for
10974  * readable status. Reading to unset the readable status is done
10975  * with g_cancellable_reset().
10976  *
10977  * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
10978  * Since: 2.22
10979  */
10980
10981
10982 /**
10983  * g_cancellable_new:
10984  *
10985  * Creates a new #GCancellable object.
10986  *
10987  * Applications that want to start one or more operations
10988  * that should be cancellable should create a #GCancellable
10989  * and pass it to the operations.
10990  *
10991  * One #GCancellable can be used in multiple consecutive
10992  * operations or in multiple concurrent operations.
10993  *
10994  * Returns: a #GCancellable.
10995  */
10996
10997
10998 /**
10999  * g_cancellable_pop_current:
11000  * @cancellable: a #GCancellable object
11001  *
11002  * Pops @cancellable off the cancellable stack (verifying that @cancellable
11003  * is on the top of the stack).
11004  */
11005
11006
11007 /**
11008  * g_cancellable_push_current:
11009  * @cancellable: a #GCancellable object
11010  *
11011  * Pushes @cancellable onto the cancellable stack. The current
11012  * cancellable can then be received using g_cancellable_get_current().
11013  *
11014  * This is useful when implementing cancellable operations in
11015  * code that does not allow you to pass down the cancellable object.
11016  *
11017  * This is typically called automatically by e.g. #GFile operations,
11018  * so you rarely have to call this yourself.
11019  */
11020
11021
11022 /**
11023  * g_cancellable_release_fd:
11024  * @cancellable: a #GCancellable
11025  *
11026  * Releases a resources previously allocated by g_cancellable_get_fd()
11027  * or g_cancellable_make_pollfd().
11028  *
11029  * For compatibility reasons with older releases, calling this function
11030  * is not strictly required, the resources will be automatically freed
11031  * when the @cancellable is finalized. However, the @cancellable will
11032  * block scarce file descriptors until it is finalized if this function
11033  * is not called. This can cause the application to run out of file
11034  * descriptors when many #GCancellables are used at the same time.
11035  *
11036  * Since: 2.22
11037  */
11038
11039
11040 /**
11041  * g_cancellable_reset:
11042  * @cancellable: a #GCancellable object.
11043  *
11044  * Resets @cancellable to its uncancelled state.
11045  *
11046  * If cancellable is currently in use by any cancellable operation
11047  * then the behavior of this function is undefined.
11048  */
11049
11050
11051 /**
11052  * g_cancellable_set_error_if_cancelled:
11053  * @cancellable: (allow-none): a #GCancellable or %NULL
11054  * @error: #GError to append error state to
11055  *
11056  * If the @cancellable is cancelled, sets the error to notify
11057  * that the operation was cancelled.
11058  *
11059  * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11060  */
11061
11062
11063 /**
11064  * g_cancellable_source_new: (skip)
11065  * @cancellable: (allow-none): a #GCancellable, or %NULL
11066  *
11067  * Creates a source that triggers if @cancellable is cancelled and
11068  * calls its callback of type #GCancellableSourceFunc. This is
11069  * primarily useful for attaching to another (non-cancellable) source
11070  * with g_source_add_child_source() to add cancellability to it.
11071  *
11072  * For convenience, you can call this with a %NULL #GCancellable,
11073  * in which case the source will never trigger.
11074  *
11075  * Returns: (transfer full): the new #GSource.
11076  * Since: 2.28
11077  */
11078
11079
11080 /**
11081  * g_charset_converter_get_num_fallbacks:
11082  * @converter: a #GCharsetConverter
11083  *
11084  * Gets the number of fallbacks that @converter has applied so far.
11085  *
11086  * Returns: the number of fallbacks that @converter has applied
11087  * Since: 2.24
11088  */
11089
11090
11091 /**
11092  * g_charset_converter_get_use_fallback:
11093  * @converter: a #GCharsetConverter
11094  *
11095  * Gets the #GCharsetConverter:use-fallback property.
11096  *
11097  * Returns: %TRUE if fallbacks are used by @converter
11098  * Since: 2.24
11099  */
11100
11101
11102 /**
11103  * g_charset_converter_new:
11104  * @to_charset: destination charset
11105  * @from_charset: source charset
11106  * @error: #GError for error reporting, or %NULL to ignore.
11107  *
11108  * Creates a new #GCharsetConverter.
11109  *
11110  * Returns: a new #GCharsetConverter or %NULL on error.
11111  * Since: 2.24
11112  */
11113
11114
11115 /**
11116  * g_charset_converter_set_use_fallback:
11117  * @converter: a #GCharsetConverter
11118  * @use_fallback: %TRUE to use fallbacks
11119  *
11120  * Sets the #GCharsetConverter:use-fallback property.
11121  *
11122  * Since: 2.24
11123  */
11124
11125
11126 /**
11127  * g_content_type_can_be_executable:
11128  * @type: a content type string
11129  *
11130  * Checks if a content type can be executable. Note that for instance
11131  * things like text files can be executables (i.e. scripts and batch files).
11132  *
11133  * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11134  */
11135
11136
11137 /**
11138  * g_content_type_equals:
11139  * @type1: a content type string
11140  * @type2: a content type string
11141  *
11142  * Compares two content types for equality.
11143  *
11144  * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11145  */
11146
11147
11148 /**
11149  * g_content_type_from_mime_type:
11150  * @mime_type: a mime type string
11151  *
11152  * Tries to find a content type based on the mime type name.
11153  *
11154  * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
11155  * Since: 2.18
11156  */
11157
11158
11159 /**
11160  * g_content_type_get_description:
11161  * @type: a content type string
11162  *
11163  * Gets the human readable description of the content type.
11164  *
11165  * Returns: a short description of the content type @type. Free the returned string with g_free()
11166  */
11167
11168
11169 /**
11170  * g_content_type_get_generic_icon_name:
11171  * @type: a content type string
11172  *
11173  * Gets the generic icon name for a content type.
11174  *
11175  * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11176  * specification for more on the generic icon name.
11177  *
11178  * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
11179  * Since: 2.34
11180  */
11181
11182
11183 /**
11184  * g_content_type_get_icon:
11185  * @type: a content type string
11186  *
11187  * Gets the icon for a content type.
11188  *
11189  * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11190  */
11191
11192
11193 /**
11194  * g_content_type_get_mime_type:
11195  * @type: a content type string
11196  *
11197  * Gets the mime type for the content type, if one is registered.
11198  *
11199  * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11200  */
11201
11202
11203 /**
11204  * g_content_type_get_symbolic_icon:
11205  * @type: a content type string
11206  *
11207  * Gets the symbolic icon for a content type.
11208  *
11209  * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11210  * Since: 2.34
11211  */
11212
11213
11214 /**
11215  * g_content_type_guess:
11216  * @filename: (allow-none): a string, or %NULL
11217  * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11218  * @data_size: the size of @data
11219  * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11220  *
11221  * Guesses the content type based on example data. If the function is
11222  * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11223  * or @data may be %NULL, in which case the guess will be based solely
11224  * on the other argument.
11225  *
11226  * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11227  */
11228
11229
11230 /**
11231  * g_content_type_guess_for_tree:
11232  * @root: the root of the tree to guess a type for
11233  *
11234  * Tries to guess the type of the tree with root @root, by
11235  * looking at the files it contains. The result is an array
11236  * of content types, with the best guess coming first.
11237  *
11238  * The types returned all have the form x-content/foo, e.g.
11239  * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11240  * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11241  * specification for more on x-content types.
11242  *
11243  * This function is useful in the implementation of
11244  * g_mount_guess_content_type().
11245  *
11246  * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11247  * Since: 2.18
11248  */
11249
11250
11251 /**
11252  * g_content_type_is_a:
11253  * @type: a content type string
11254  * @supertype: a content type string
11255  *
11256  * Determines if @type is a subset of @supertype.
11257  *
11258  * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11259  */
11260
11261
11262 /**
11263  * g_content_type_is_unknown:
11264  * @type: a content type string
11265  *
11266  * Checks if the content type is the generic "unknown" type.
11267  * On UNIX this is the "application/octet-stream" mimetype,
11268  * while on win32 it is "*".
11269  *
11270  * Returns: %TRUE if the type is the unknown type.
11271  */
11272
11273
11274 /**
11275  * g_content_types_get_registered:
11276  *
11277  * Gets a list of strings containing all the registered content types
11278  * known to the system. The list and its data should be freed using
11279  * <programlisting>
11280  * g_list_free_full (list, g_free);
11281  * </programlisting>
11282  *
11283  * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11284  */
11285
11286
11287 /**
11288  * g_converter_convert:
11289  * @converter: a #GConverter.
11290  * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11291  * @inbuf_size: the number of bytes in @inbuf
11292  * @outbuf: a buffer to write converted data in.
11293  * @outbuf_size: the number of bytes in @outbuf, must be at least one
11294  * @flags: a #GConverterFlags controlling the conversion details
11295  * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11296  * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11297  * @error: location to store the error occurring, or %NULL to ignore
11298  *
11299  * This is the main operation used when converting data. It is to be called
11300  * multiple times in a loop, and each time it will do some work, i.e.
11301  * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11302  * both. If its not possible to do any work an error is returned.
11303  *
11304  * Note that a single call may not consume all input (or any input at all).
11305  * Also a call may produce output even if given no input, due to state stored
11306  * in the converter producing output.
11307  *
11308  * If any data was either produced or consumed, and then an error happens, then
11309  * only the successful conversion is reported and the error is returned on the
11310  * next call.
11311  *
11312  * A full conversion loop involves calling this method repeatedly, each time
11313  * giving it new input and space output space. When there is no more input
11314  * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11315  * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11316  * each time until all data is consumed and all output is produced, then
11317  * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11318  * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11319  * in a decompression converter where the end of data is detectable from the
11320  * data (and there might even be other data after the end of the compressed data).
11321  *
11322  * When some data has successfully been converted @bytes_read and is set to
11323  * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11324  * how many bytes was written to @outbuf. If there are more data to output
11325  * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11326  * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11327  * then %G_CONVERTER_FINISHED is returned.
11328  *
11329  * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11330  * Some errors need special handling:
11331  *
11332  * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11333  * to write the resulting converted data, the application should
11334  * call the function again with a larger @outbuf to continue.
11335  *
11336  * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11337  * input to fully determine what the conversion should produce,
11338  * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11339  * example with an incomplete multibyte sequence when converting text,
11340  * or when a regexp matches up to the end of the input (and may match
11341  * further input). It may also happen when @inbuf_size is zero and
11342  * there is no more data to produce.
11343  *
11344  * When this happens the application should read more input and then
11345  * call the function again. If further input shows that there is no
11346  * more data call the function again with the same data but with
11347  * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11348  * to finish as e.g. in the regexp match case (or, to fail again with
11349  * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11350  * input is actually partial).
11351  *
11352  * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11353  * converter object is in an invalid state where its not allowed
11354  * to call g_converter_convert() anymore. At this time you can only
11355  * free the object or call g_converter_reset() to reset it to the
11356  * initial state.
11357  *
11358  * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11359  * to try to write out all internal state to the output. The application
11360  * has to call the function multiple times with the flag set, and when
11361  * the available input has been consumed and all internal state has
11362  * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11363  * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11364  * This is somewhat similar to what happens at the end of the input stream,
11365  * but done in the middle of the data.
11366  *
11367  * This has different meanings for different conversions. For instance
11368  * in a compression converter it would mean that we flush all the
11369  * compression state into output such that if you uncompress the
11370  * compressed data you get back all the input data. Doing this may
11371  * make the final file larger due to padding though. Another example
11372  * is a regexp conversion, where if you at the end of the flushed data
11373  * have a match, but there is also a potential longer match. In the
11374  * non-flushed case we would ask for more input, but when flushing we
11375  * treat this as the end of input and do the match.
11376  *
11377  * Flushing is not always possible (like if a charset converter flushes
11378  * at a partial multibyte sequence). Converters are supposed to try
11379  * to produce as much output as possible and then return an error
11380  * (typically %G_IO_ERROR_PARTIAL_INPUT).
11381  *
11382  * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11383  * Since: 2.24
11384  */
11385
11386
11387 /**
11388  * g_converter_input_stream_get_converter:
11389  * @converter_stream: a #GConverterInputStream
11390  *
11391  * Gets the #GConverter that is used by @converter_stream.
11392  *
11393  * Returns: (transfer none): the converter of the converter input stream
11394  * Since: 2.24
11395  */
11396
11397
11398 /**
11399  * g_converter_input_stream_new:
11400  * @base_stream: a #GInputStream
11401  * @converter: a #GConverter
11402  *
11403  * Creates a new converter input stream for the @base_stream.
11404  *
11405  * Returns: a new #GInputStream.
11406  */
11407
11408
11409 /**
11410  * g_converter_output_stream_get_converter:
11411  * @converter_stream: a #GConverterOutputStream
11412  *
11413  * Gets the #GConverter that is used by @converter_stream.
11414  *
11415  * Returns: (transfer none): the converter of the converter output stream
11416  * Since: 2.24
11417  */
11418
11419
11420 /**
11421  * g_converter_output_stream_new:
11422  * @base_stream: a #GOutputStream
11423  * @converter: a #GConverter
11424  *
11425  * Creates a new converter output stream for the @base_stream.
11426  *
11427  * Returns: a new #GOutputStream.
11428  */
11429
11430
11431 /**
11432  * g_converter_reset:
11433  * @converter: a #GConverter.
11434  *
11435  * Resets all internal state in the converter, making it behave
11436  * as if it was just created. If the converter has any internal
11437  * state that would produce output then that output is lost.
11438  *
11439  * Since: 2.24
11440  */
11441
11442
11443 /**
11444  * g_credentials_get_native: (skip)
11445  * @credentials: A #GCredentials.
11446  * @native_type: The type of native credentials to get.
11447  *
11448  * Gets a pointer to native credentials of type @native_type from
11449  * @credentials.
11450  *
11451  * It is a programming error (which will cause an warning to be
11452  * logged) to use this method if there is no #GCredentials support for
11453  * the OS or if @native_type isn't supported by the OS.
11454  *
11455  * Returns: The pointer to native credentials or %NULL if the operation there is no #GCredentials support for the OS or if @native_type isn't supported by the OS. Do not free the returned data, it is owned by @credentials.
11456  * Since: 2.26
11457  */
11458
11459
11460 /**
11461  * g_credentials_get_unix_pid:
11462  * @credentials: A #GCredentials
11463  * @error: Return location for error or %NULL.
11464  *
11465  * Tries to get the UNIX process identifier from @credentials. This
11466  * method is only available on UNIX platforms.
11467  *
11468  * This operation can fail if #GCredentials is not supported on the
11469  * OS or if the native credentials type does not contain information
11470  * about the UNIX process ID.
11471  *
11472  * Returns: The UNIX process ID, or -1 if @error is set.
11473  * Since: 2.36
11474  */
11475
11476
11477 /**
11478  * g_credentials_get_unix_user:
11479  * @credentials: A #GCredentials
11480  * @error: Return location for error or %NULL.
11481  *
11482  * Tries to get the UNIX user identifier from @credentials. This
11483  * method is only available on UNIX platforms.
11484  *
11485  * This operation can fail if #GCredentials is not supported on the
11486  * OS or if the native credentials type does not contain information
11487  * about the UNIX user.
11488  *
11489  * Returns: The UNIX user identifier or -1 if @error is set.
11490  * Since: 2.26
11491  */
11492
11493
11494 /**
11495  * g_credentials_is_same_user:
11496  * @credentials: A #GCredentials.
11497  * @other_credentials: A #GCredentials.
11498  * @error: Return location for error or %NULL.
11499  *
11500  * Checks if @credentials and @other_credentials is the same user.
11501  *
11502  * This operation can fail if #GCredentials is not supported on the
11503  * the OS.
11504  *
11505  * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11506  * Since: 2.26
11507  */
11508
11509
11510 /**
11511  * g_credentials_new:
11512  *
11513  * Creates a new #GCredentials object with credentials matching the
11514  * the current process.
11515  *
11516  * Returns: A #GCredentials. Free with g_object_unref().
11517  * Since: 2.26
11518  */
11519
11520
11521 /**
11522  * g_credentials_set_native:
11523  * @credentials: A #GCredentials.
11524  * @native_type: The type of native credentials to set.
11525  * @native: A pointer to native credentials.
11526  *
11527  * Copies the native credentials of type @native_type from @native
11528  * into @credentials.
11529  *
11530  * It is a programming error (which will cause an warning to be
11531  * logged) to use this method if there is no #GCredentials support for
11532  * the OS or if @native_type isn't supported by the OS.
11533  *
11534  * Since: 2.26
11535  */
11536
11537
11538 /**
11539  * g_credentials_set_unix_user:
11540  * @credentials: A #GCredentials.
11541  * @uid: The UNIX user identifier to set.
11542  * @error: Return location for error or %NULL.
11543  *
11544  * Tries to set the UNIX user identifier on @credentials. This method
11545  * is only available on UNIX platforms.
11546  *
11547  * This operation can fail if #GCredentials is not supported on the
11548  * OS or if the native credentials type does not contain information
11549  * about the UNIX user.
11550  *
11551  * Returns: %TRUE if @uid was set, %FALSE if error is set.
11552  * Since: 2.26
11553  */
11554
11555
11556 /**
11557  * g_credentials_to_string:
11558  * @credentials: A #GCredentials object.
11559  *
11560  * Creates a human-readable textual representation of @credentials
11561  * that can be used in logging and debug messages. The format of the
11562  * returned string may change in future GLib release.
11563  *
11564  * Returns: A string that should be freed with g_free().
11565  * Since: 2.26
11566  */
11567
11568
11569 /**
11570  * g_data_input_stream_get_byte_order:
11571  * @stream: a given #GDataInputStream.
11572  *
11573  * Gets the byte order for the data input stream.
11574  *
11575  * Returns: the @stream's current #GDataStreamByteOrder.
11576  */
11577
11578
11579 /**
11580  * g_data_input_stream_get_newline_type:
11581  * @stream: a given #GDataInputStream.
11582  *
11583  * Gets the current newline type for the @stream.
11584  *
11585  * Returns: #GDataStreamNewlineType for the given @stream.
11586  */
11587
11588
11589 /**
11590  * g_data_input_stream_new:
11591  * @base_stream: a #GInputStream.
11592  *
11593  * Creates a new data input stream for the @base_stream.
11594  *
11595  * Returns: a new #GDataInputStream.
11596  */
11597
11598
11599 /**
11600  * g_data_input_stream_read_byte:
11601  * @stream: a given #GDataInputStream.
11602  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11603  * @error: #GError for error reporting.
11604  *
11605  * Reads an unsigned 8-bit/1-byte value from @stream.
11606  *
11607  * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11608  */
11609
11610
11611 /**
11612  * g_data_input_stream_read_int16:
11613  * @stream: a given #GDataInputStream.
11614  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11615  * @error: #GError for error reporting.
11616  *
11617  * Reads a 16-bit/2-byte value from @stream.
11618  *
11619  * In order to get the correct byte order for this read operation,
11620  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11621  *
11622  * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11623  */
11624
11625
11626 /**
11627  * g_data_input_stream_read_int32:
11628  * @stream: a given #GDataInputStream.
11629  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11630  * @error: #GError for error reporting.
11631  *
11632  * Reads a signed 32-bit/4-byte value from @stream.
11633  *
11634  * In order to get the correct byte order for this read operation,
11635  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11636  *
11637  * If @cancellable is not %NULL, then the operation can be cancelled by
11638  * triggering the cancellable object from another thread. If the operation
11639  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11640  *
11641  * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11642  */
11643
11644
11645 /**
11646  * g_data_input_stream_read_int64:
11647  * @stream: a given #GDataInputStream.
11648  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11649  * @error: #GError for error reporting.
11650  *
11651  * Reads a 64-bit/8-byte value from @stream.
11652  *
11653  * In order to get the correct byte order for this read operation,
11654  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11655  *
11656  * If @cancellable is not %NULL, then the operation can be cancelled by
11657  * triggering the cancellable object from another thread. If the operation
11658  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11659  *
11660  * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11661  */
11662
11663
11664 /**
11665  * g_data_input_stream_read_line:
11666  * @stream: a given #GDataInputStream.
11667  * @length: (out): a #gsize to get the length of the data read in.
11668  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11669  * @error: #GError for error reporting.
11670  *
11671  * Reads a line from the data input stream.  Note that no encoding
11672  * checks or conversion is performed; the input is not guaranteed to
11673  * be UTF-8, and may in fact have embedded NUL characters.
11674  *
11675  * If @cancellable is not %NULL, then the operation can be cancelled by
11676  * triggering the cancellable object from another thread. If the operation
11677  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11678  *
11679  * Returns: (transfer full) (array zero-terminated=1) (element-type guint8): a NUL terminated byte array with the line that was read in (without the newlines).  Set @length to a #gsize to get the length of the read line.  On an error, it will return %NULL and @error will be set. If there's no content to read, it will still return %NULL, but @error won't be set.
11680  */
11681
11682
11683 /**
11684  * g_data_input_stream_read_line_async:
11685  * @stream: a given #GDataInputStream.
11686  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11687  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11688  * @callback: (scope async): callback to call when the request is satisfied.
11689  * @user_data: (closure): the data to pass to callback function.
11690  *
11691  * The asynchronous version of g_data_input_stream_read_line().  It is
11692  * an error to have two outstanding calls to this function.
11693  *
11694  * When the operation is finished, @callback will be called. You
11695  * can then call g_data_input_stream_read_line_finish() to get
11696  * the result of the operation.
11697  *
11698  * Since: 2.20
11699  */
11700
11701
11702 /**
11703  * g_data_input_stream_read_line_finish:
11704  * @stream: a given #GDataInputStream.
11705  * @result: the #GAsyncResult that was provided to the callback.
11706  * @length: (out): a #gsize to get the length of the data read in.
11707  * @error: #GError for error reporting.
11708  *
11709  * Finish an asynchronous call started by
11710  * g_data_input_stream_read_line_async().  Note the warning about
11711  * string encoding in g_data_input_stream_read_line() applies here as
11712  * well.
11713  *
11714  * Returns: (transfer full) (array zero-terminated=1) (element-type guint8): a NUL-terminated byte array with the line that was read in (without the newlines).  Set @length to a #gsize to get the length of the read line.  On an error, it will return %NULL and @error will be set. If there's no content to read, it will still return %NULL, but @error won't be set.
11715  * Since: 2.20
11716  */
11717
11718
11719 /**
11720  * g_data_input_stream_read_line_finish_utf8:
11721  * @stream: a given #GDataInputStream.
11722  * @result: the #GAsyncResult that was provided to the callback.
11723  * @length: (out): a #gsize to get the length of the data read in.
11724  * @error: #GError for error reporting.
11725  *
11726  * Finish an asynchronous call started by
11727  * g_data_input_stream_read_line_async().
11728  *
11729  * Returns: (transfer full): a string with the line that was read in (without the newlines).  Set @length to a #gsize to get the length of the read line.  On an error, it will return %NULL and @error will be set. For UTF-8 conversion errors, the set error domain is %G_CONVERT_ERROR.  If there's no content to read, it will still return %NULL, but @error won't be set.
11730  * Since: 2.30
11731  */
11732
11733
11734 /**
11735  * g_data_input_stream_read_line_utf8:
11736  * @stream: a given #GDataInputStream.
11737  * @length: (out): a #gsize to get the length of the data read in.
11738  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11739  * @error: #GError for error reporting.
11740  *
11741  * Reads a UTF-8 encoded line from the data input stream.
11742  *
11743  * If @cancellable is not %NULL, then the operation can be cancelled by
11744  * triggering the cancellable object from another thread. If the operation
11745  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11746  *
11747  * Returns: (transfer full): a NUL terminated UTF-8 string with the line that was read in (without the newlines).  Set @length to a #gsize to get the length of the read line.  On an error, it will return %NULL and @error will be set.  For UTF-8 conversion errors, the set error domain is %G_CONVERT_ERROR.  If there's no content to read, it will still return %NULL, but @error won't be set.
11748  * Since: 2.30
11749  */
11750
11751
11752 /**
11753  * g_data_input_stream_read_uint16:
11754  * @stream: a given #GDataInputStream.
11755  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11756  * @error: #GError for error reporting.
11757  *
11758  * Reads an unsigned 16-bit/2-byte value from @stream.
11759  *
11760  * In order to get the correct byte order for this read operation,
11761  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11762  *
11763  * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
11764  */
11765
11766
11767 /**
11768  * g_data_input_stream_read_uint32:
11769  * @stream: a given #GDataInputStream.
11770  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11771  * @error: #GError for error reporting.
11772  *
11773  * Reads an unsigned 32-bit/4-byte value from @stream.
11774  *
11775  * In order to get the correct byte order for this read operation,
11776  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11777  *
11778  * If @cancellable is not %NULL, then the operation can be cancelled by
11779  * triggering the cancellable object from another thread. If the operation
11780  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11781  *
11782  * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11783  */
11784
11785
11786 /**
11787  * g_data_input_stream_read_uint64:
11788  * @stream: a given #GDataInputStream.
11789  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11790  * @error: #GError for error reporting.
11791  *
11792  * Reads an unsigned 64-bit/8-byte value from @stream.
11793  *
11794  * In order to get the correct byte order for this read operation,
11795  * see g_data_input_stream_get_byte_order().
11796  *
11797  * If @cancellable is not %NULL, then the operation can be cancelled by
11798  * triggering the cancellable object from another thread. If the operation
11799  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11800  *
11801  * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
11802  */
11803
11804
11805 /**
11806  * g_data_input_stream_read_until:
11807  * @stream: a given #GDataInputStream.
11808  * @stop_chars: characters to terminate the read.
11809  * @length: (out): a #gsize to get the length of the data read in.
11810  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11811  * @error: #GError for error reporting.
11812  *
11813  * Reads a string from the data input stream, up to the first
11814  * occurrence of any of the stop characters.
11815  *
11816  * Note that, in contrast to g_data_input_stream_read_until_async(),
11817  * this function consumes the stop character that it finds.
11818  *
11819  * Don't use this function in new code.  Its functionality is
11820  * inconsistent with g_data_input_stream_read_until_async().  Both
11821  * functions will be marked as deprecated in a future release.  Use
11822  * g_data_input_stream_read_upto() instead, but note that that function
11823  * does not consume the stop character.
11824  *
11825  * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error.
11826  */
11827
11828
11829 /**
11830  * g_data_input_stream_read_until_async:
11831  * @stream: a given #GDataInputStream.
11832  * @stop_chars: characters to terminate the read.
11833  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11834  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11835  * @callback: (scope async): callback to call when the request is satisfied.
11836  * @user_data: (closure): the data to pass to callback function.
11837  *
11838  * The asynchronous version of g_data_input_stream_read_until().
11839  * It is an error to have two outstanding calls to this function.
11840  *
11841  * Note that, in contrast to g_data_input_stream_read_until(),
11842  * this function does not consume the stop character that it finds.  You
11843  * must read it for yourself.
11844  *
11845  * When the operation is finished, @callback will be called. You
11846  * can then call g_data_input_stream_read_until_finish() to get
11847  * the result of the operation.
11848  *
11849  * Don't use this function in new code.  Its functionality is
11850  * inconsistent with g_data_input_stream_read_until().  Both functions
11851  * will be marked as deprecated in a future release.  Use
11852  * g_data_input_stream_read_upto_async() instead.
11853  *
11854  * Since: 2.20
11855  */
11856
11857
11858 /**
11859  * g_data_input_stream_read_until_finish:
11860  * @stream: a given #GDataInputStream.
11861  * @result: the #GAsyncResult that was provided to the callback.
11862  * @length: (out): a #gsize to get the length of the data read in.
11863  * @error: #GError for error reporting.
11864  *
11865  * Finish an asynchronous call started by
11866  * g_data_input_stream_read_until_async().
11867  *
11868  * Since: 2.20
11869  * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error.
11870  */
11871
11872
11873 /**
11874  * g_data_input_stream_read_upto:
11875  * @stream: a #GDataInputStream
11876  * @stop_chars: characters to terminate the read
11877  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11878  * @length: (out): a #gsize to get the length of the data read in
11879  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11880  * @error: #GError for error reporting
11881  *
11882  * Reads a string from the data input stream, up to the first
11883  * occurrence of any of the stop characters.
11884  *
11885  * In contrast to g_data_input_stream_read_until(), this function
11886  * does <emphasis>not</emphasis> consume the stop character. You have
11887  * to use g_data_input_stream_read_byte() to get it before calling
11888  * g_data_input_stream_read_upto() again.
11889  *
11890  * Note that @stop_chars may contain '\0' if @stop_chars_len is
11891  * specified.
11892  *
11893  * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error
11894  * Since: 2.26
11895  */
11896
11897
11898 /**
11899  * g_data_input_stream_read_upto_async:
11900  * @stream: a #GDataInputStream
11901  * @stop_chars: characters to terminate the read
11902  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11903  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11904  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11905  * @callback: (scope async): callback to call when the request is satisfied
11906  * @user_data: (closure): the data to pass to callback function
11907  *
11908  * The asynchronous version of g_data_input_stream_read_upto().
11909  * It is an error to have two outstanding calls to this function.
11910  *
11911  * In contrast to g_data_input_stream_read_until(), this function
11912  * does <emphasis>not</emphasis> consume the stop character. You have
11913  * to use g_data_input_stream_read_byte() to get it before calling
11914  * g_data_input_stream_read_upto() again.
11915  *
11916  * Note that @stop_chars may contain '\0' if @stop_chars_len is
11917  * specified.
11918  *
11919  * When the operation is finished, @callback will be called. You
11920  * can then call g_data_input_stream_read_upto_finish() to get
11921  * the result of the operation.
11922  *
11923  * Since: 2.26
11924  */
11925
11926
11927 /**
11928  * g_data_input_stream_read_upto_finish:
11929  * @stream: a #GDataInputStream
11930  * @result: the #GAsyncResult that was provided to the callback
11931  * @length: (out): a #gsize to get the length of the data read in
11932  * @error: #GError for error reporting
11933  *
11934  * Finish an asynchronous call started by
11935  * g_data_input_stream_read_upto_async().
11936  *
11937  * Note that this function does <emphasis>not</emphasis> consume the
11938  * stop character. You have to use g_data_input_stream_read_byte() to
11939  * get it before calling g_data_input_stream_read_upto_async() again.
11940  *
11941  * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error.
11942  * Since: 2.24
11943  */
11944
11945
11946 /**
11947  * g_data_input_stream_set_byte_order:
11948  * @stream: a given #GDataInputStream.
11949  * @order: a #GDataStreamByteOrder to set.
11950  *
11951  * This function sets the byte order for the given @stream. All subsequent
11952  * reads from the @stream will be read in the given @order.
11953  */
11954
11955
11956 /**
11957  * g_data_input_stream_set_newline_type:
11958  * @stream: a #GDataInputStream.
11959  * @type: the type of new line return as #GDataStreamNewlineType.
11960  *
11961  * Sets the newline type for the @stream.
11962  *
11963  * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
11964  * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
11965  * "CR LF", and this might block if there is no more data available.
11966  */
11967
11968
11969 /**
11970  * g_data_output_stream_get_byte_order:
11971  * @stream: a #GDataOutputStream.
11972  *
11973  * Gets the byte order for the stream.
11974  *
11975  * Returns: the #GDataStreamByteOrder for the @stream.
11976  */
11977
11978
11979 /**
11980  * g_data_output_stream_new:
11981  * @base_stream: a #GOutputStream.
11982  *
11983  * Creates a new data output stream for @base_stream.
11984  *
11985  * Returns: #GDataOutputStream.
11986  */
11987
11988
11989 /**
11990  * g_data_output_stream_put_byte:
11991  * @stream: a #GDataOutputStream.
11992  * @data: a #guchar.
11993  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11994  * @error: a #GError, %NULL to ignore.
11995  *
11996  * Puts a byte into the output stream.
11997  *
11998  * Returns: %TRUE if @data was successfully added to the @stream.
11999  */
12000
12001
12002 /**
12003  * g_data_output_stream_put_int16:
12004  * @stream: a #GDataOutputStream.
12005  * @data: a #gint16.
12006  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12007  * @error: a #GError, %NULL to ignore.
12008  *
12009  * Puts a signed 16-bit integer into the output stream.
12010  *
12011  * Returns: %TRUE if @data was successfully added to the @stream.
12012  */
12013
12014
12015 /**
12016  * g_data_output_stream_put_int32:
12017  * @stream: a #GDataOutputStream.
12018  * @data: a #gint32.
12019  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12020  * @error: a #GError, %NULL to ignore.
12021  *
12022  * Puts a signed 32-bit integer into the output stream.
12023  *
12024  * Returns: %TRUE if @data was successfully added to the @stream.
12025  */
12026
12027
12028 /**
12029  * g_data_output_stream_put_int64:
12030  * @stream: a #GDataOutputStream.
12031  * @data: a #gint64.
12032  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12033  * @error: a #GError, %NULL to ignore.
12034  *
12035  * Puts a signed 64-bit integer into the stream.
12036  *
12037  * Returns: %TRUE if @data was successfully added to the @stream.
12038  */
12039
12040
12041 /**
12042  * g_data_output_stream_put_string:
12043  * @stream: a #GDataOutputStream.
12044  * @str: a string.
12045  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12046  * @error: a #GError, %NULL to ignore.
12047  *
12048  * Puts a string into the output stream.
12049  *
12050  * Returns: %TRUE if @string was successfully added to the @stream.
12051  */
12052
12053
12054 /**
12055  * g_data_output_stream_put_uint16:
12056  * @stream: a #GDataOutputStream.
12057  * @data: a #guint16.
12058  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12059  * @error: a #GError, %NULL to ignore.
12060  *
12061  * Puts an unsigned 16-bit integer into the output stream.
12062  *
12063  * Returns: %TRUE if @data was successfully added to the @stream.
12064  */
12065
12066
12067 /**
12068  * g_data_output_stream_put_uint32:
12069  * @stream: a #GDataOutputStream.
12070  * @data: a #guint32.
12071  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12072  * @error: a #GError, %NULL to ignore.
12073  *
12074  * Puts an unsigned 32-bit integer into the stream.
12075  *
12076  * Returns: %TRUE if @data was successfully added to the @stream.
12077  */
12078
12079
12080 /**
12081  * g_data_output_stream_put_uint64:
12082  * @stream: a #GDataOutputStream.
12083  * @data: a #guint64.
12084  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12085  * @error: a #GError, %NULL to ignore.
12086  *
12087  * Puts an unsigned 64-bit integer into the stream.
12088  *
12089  * Returns: %TRUE if @data was successfully added to the @stream.
12090  */
12091
12092
12093 /**
12094  * g_data_output_stream_set_byte_order:
12095  * @stream: a #GDataOutputStream.
12096  * @order: a %GDataStreamByteOrder.
12097  *
12098  * Sets the byte order of the data output stream to @order.
12099  */
12100
12101
12102 /**
12103  * g_dbus_action_group_get:
12104  * @connection: A #GDBusConnection
12105  * @bus_name: the bus name which exports the action group
12106  * @object_path: the object path at which the action group is exported
12107  *
12108  * Obtains a #GDBusActionGroup for the action group which is exported at
12109  * the given @bus_name and @object_path.
12110  *
12111  * The thread default main context is taken at the time of this call.
12112  * All signals on the menu model (and any linked models) are reported
12113  * with respect to this context.  All calls on the returned menu model
12114  * (and linked models) must also originate from this same context, with
12115  * the thread default main context unchanged.
12116  *
12117  * This call is non-blocking.  The returned action group may or may not
12118  * already be filled in.  The correct thing to do is connect the signals
12119  * for the action group to monitor for changes and then to call
12120  * g_action_group_list_actions() to get the initial list.
12121  *
12122  * Returns: (transfer full): a #GDBusActionGroup
12123  * Since: 2.32
12124  */
12125
12126
12127 /**
12128  * g_dbus_address_escape_value:
12129  * @string: an unescaped string to be included in a D-Bus address as the value in a key-value pair
12130  *
12131  * Escape @string so it can appear in a D-Bus address as the value
12132  * part of a key-value pair.
12133  *
12134  * For instance, if @string is <code>/run/bus-for-:0</code>,
12135  * this function would return <code>/run/bus-for-%3A0</code>,
12136  * which could be used in a D-Bus address like
12137  * <code>unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0</code>.
12138  *
12139  * Returns: (transfer full): a copy of @string with all non-optionally-escaped bytes escaped
12140  * Since: 2.36
12141  */
12142
12143
12144 /**
12145  * g_dbus_address_get_for_bus_sync:
12146  * @bus_type: A #GBusType.
12147  * @cancellable: (allow-none): A #GCancellable or %NULL.
12148  * @error: Return location for error or %NULL.
12149  *
12150  * Synchronously looks up the D-Bus address for the well-known message
12151  * bus instance specified by @bus_type. This may involve using various
12152  * platform specific mechanisms.
12153  *
12154  * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12155  * Since: 2.26
12156  */
12157
12158
12159 /**
12160  * g_dbus_address_get_stream:
12161  * @address: A valid D-Bus address.
12162  * @cancellable: (allow-none): A #GCancellable or %NULL.
12163  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12164  * @user_data: Data to pass to @callback.
12165  *
12166  * Asynchronously connects to an endpoint specified by @address and
12167  * sets up the connection so it is in a state to run the client-side
12168  * of the D-Bus authentication conversation.
12169  *
12170  * When the operation is finished, @callback will be invoked. You can
12171  * then call g_dbus_address_get_stream_finish() to get the result of
12172  * the operation.
12173  *
12174  * This is an asynchronous failable function. See
12175  * g_dbus_address_get_stream_sync() for the synchronous version.
12176  *
12177  * Since: 2.26
12178  */
12179
12180
12181 /**
12182  * g_dbus_address_get_stream_finish:
12183  * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12184  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12185  * @error: Return location for error or %NULL.
12186  *
12187  * Finishes an operation started with g_dbus_address_get_stream().
12188  *
12189  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12190  * Since: 2.26
12191  */
12192
12193
12194 /**
12195  * g_dbus_address_get_stream_sync:
12196  * @address: A valid D-Bus address.
12197  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12198  * @cancellable: (allow-none): A #GCancellable or %NULL.
12199  * @error: Return location for error or %NULL.
12200  *
12201  * Synchronously connects to an endpoint specified by @address and
12202  * sets up the connection so it is in a state to run the client-side
12203  * of the D-Bus authentication conversation.
12204  *
12205  * This is a synchronous failable function. See
12206  * g_dbus_address_get_stream() for the asynchronous version.
12207  *
12208  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12209  * Since: 2.26
12210  */
12211
12212
12213 /**
12214  * g_dbus_annotation_info_lookup:
12215  * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12216  * @name: The name of the annotation to look up.
12217  *
12218  * Looks up the value of an annotation.
12219  *
12220  * The cost of this function is O(n) in number of annotations.
12221  *
12222  * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12223  * Since: 2.26
12224  */
12225
12226
12227 /**
12228  * g_dbus_annotation_info_ref:
12229  * @info: A #GDBusNodeInfo
12230  *
12231  * If @info is statically allocated does nothing. Otherwise increases
12232  * the reference count.
12233  *
12234  * Returns: The same @info.
12235  * Since: 2.26
12236  */
12237
12238
12239 /**
12240  * g_dbus_annotation_info_unref:
12241  * @info: A #GDBusAnnotationInfo.
12242  *
12243  * If @info is statically allocated, does nothing. Otherwise decreases
12244  * the reference count of @info. When its reference count drops to 0,
12245  * the memory used is freed.
12246  *
12247  * Since: 2.26
12248  */
12249
12250
12251 /**
12252  * g_dbus_arg_info_ref:
12253  * @info: A #GDBusArgInfo
12254  *
12255  * If @info is statically allocated does nothing. Otherwise increases
12256  * the reference count.
12257  *
12258  * Returns: The same @info.
12259  * Since: 2.26
12260  */
12261
12262
12263 /**
12264  * g_dbus_arg_info_unref:
12265  * @info: A #GDBusArgInfo.
12266  *
12267  * If @info is statically allocated, does nothing. Otherwise decreases
12268  * the reference count of @info. When its reference count drops to 0,
12269  * the memory used is freed.
12270  *
12271  * Since: 2.26
12272  */
12273
12274
12275 /**
12276  * g_dbus_auth_observer_allow_mechanism:
12277  * @observer: A #GDBusAuthObserver.
12278  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12279  *
12280  * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12281  *
12282  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12283  * Since: 2.34
12284  */
12285
12286
12287 /**
12288  * g_dbus_auth_observer_authorize_authenticated_peer:
12289  * @observer: A #GDBusAuthObserver.
12290  * @stream: A #GIOStream for the #GDBusConnection.
12291  * @credentials: (allow-none): Credentials received from the peer or %NULL.
12292  *
12293  * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12294  *
12295  * Returns: %TRUE if the peer is authorized, %FALSE if not.
12296  * Since: 2.26
12297  */
12298
12299
12300 /**
12301  * g_dbus_auth_observer_new:
12302  *
12303  * Creates a new #GDBusAuthObserver object.
12304  *
12305  * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12306  * Since: 2.26
12307  */
12308
12309
12310 /**
12311  * g_dbus_connection_add_filter:
12312  * @connection: A #GDBusConnection.
12313  * @filter_function: A filter function.
12314  * @user_data: User data to pass to @filter_function.
12315  * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12316  *
12317  * Adds a message filter. Filters are handlers that are run on all
12318  * incoming and outgoing messages, prior to standard dispatch. Filters
12319  * are run in the order that they were added.  The same handler can be
12320  * added as a filter more than once, in which case it will be run more
12321  * than once.  Filters added during a filter callback won't be run on
12322  * the message being processed. Filter functions are allowed to modify
12323  * and even drop messages.
12324  *
12325  * Note that filters are run in a dedicated message handling thread so
12326  * they can't block and, generally, can't do anything but signal a
12327  * worker thread. Also note that filters are rarely needed - use API
12328  * such as g_dbus_connection_send_message_with_reply(),
12329  * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12330  *
12331  * If a filter consumes an incoming message the message is not
12332  * dispatched anywhere else - not even the standard dispatch machinery
12333  * (that API such as g_dbus_connection_signal_subscribe() and
12334  * g_dbus_connection_send_message_with_reply() relies on) will see the
12335  * message. Similary, if a filter consumes an outgoing message, the
12336  * message will not be sent to the other peer.
12337  *
12338  * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12339  * Since: 2.26
12340  */
12341
12342
12343 /**
12344  * g_dbus_connection_call:
12345  * @connection: A #GDBusConnection.
12346  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12347  * @object_path: Path of remote object.
12348  * @interface_name: D-Bus interface to invoke method on.
12349  * @method_name: The name of the method to invoke.
12350  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12351  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12352  * @flags: Flags from the #GDBusCallFlags enumeration.
12353  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12354  * @cancellable: (allow-none): A #GCancellable or %NULL.
12355  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
12356  * @user_data: The data to pass to @callback.
12357  *
12358  * Asynchronously invokes the @method_name method on the
12359  * @interface_name D-Bus interface on the remote object at
12360  * @object_path owned by @bus_name.
12361  *
12362  * If @connection is closed then the operation will fail with
12363  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12364  * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12365  * not compatible with the D-Bus protocol, the operation fails with
12366  * %G_IO_ERROR_INVALID_ARGUMENT.
12367  *
12368  * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12369  * error will be raised if it does not match.  Said another way, if you give a @reply_type
12370  * then any non-%NULL return value will be of this type.
12371  *
12372  * If the @parameters #GVariant is floating, it is consumed. This allows
12373  * convenient 'inline' use of g_variant_new(), e.g.:
12374  * |[
12375  *  g_dbus_connection_call (connection,
12376  *                          "org.freedesktop.StringThings",
12377  *                          "/org/freedesktop/StringThings",
12378  *                          "org.freedesktop.StringThings",
12379  *                          "TwoStrings",
12380  *                          g_variant_new ("(ss)",
12381  *                                         "Thing One",
12382  *                                         "Thing Two"),
12383  *                          NULL,
12384  *                          G_DBUS_CALL_FLAGS_NONE,
12385  *                          -1,
12386  *                          NULL,
12387  *                          (GAsyncReadyCallback) two_strings_done,
12388  *                          NULL);
12389  * ]|
12390  *
12391  * This is an asynchronous method. When the operation is finished, @callback will be invoked
12392  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12393  * of the thread you are calling this method from. You can then call
12394  * g_dbus_connection_call_finish() to get the result of the operation.
12395  * See g_dbus_connection_call_sync() for the synchronous version of this
12396  * function.
12397  *
12398  * If @callback is %NULL then the D-Bus method call message will be sent with
12399  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12400  *
12401  * Since: 2.26
12402  */
12403
12404
12405 /**
12406  * g_dbus_connection_call_finish:
12407  * @connection: A #GDBusConnection.
12408  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12409  * @error: Return location for error or %NULL.
12410  *
12411  * Finishes an operation started with g_dbus_connection_call().
12412  *
12413  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12414  * Since: 2.26
12415  */
12416
12417
12418 /**
12419  * g_dbus_connection_call_sync:
12420  * @connection: A #GDBusConnection.
12421  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12422  * @object_path: Path of remote object.
12423  * @interface_name: D-Bus interface to invoke method on.
12424  * @method_name: The name of the method to invoke.
12425  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12426  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12427  * @flags: Flags from the #GDBusCallFlags enumeration.
12428  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12429  * @cancellable: (allow-none): A #GCancellable or %NULL.
12430  * @error: Return location for error or %NULL.
12431  *
12432  * Synchronously invokes the @method_name method on the
12433  * @interface_name D-Bus interface on the remote object at
12434  * @object_path owned by @bus_name.
12435  *
12436  * If @connection is closed then the operation will fail with
12437  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12438  * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12439  * contains a value not compatible with the D-Bus protocol, the operation
12440  * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12441  *
12442  * If @reply_type is non-%NULL then the reply will be checked for having
12443  * this type and an error will be raised if it does not match.  Said
12444  * another way, if you give a @reply_type then any non-%NULL return
12445  * value will be of this type.
12446  *
12447  * If the @parameters #GVariant is floating, it is consumed.
12448  * This allows convenient 'inline' use of g_variant_new(), e.g.:
12449  * |[
12450  *  g_dbus_connection_call_sync (connection,
12451  *                               "org.freedesktop.StringThings",
12452  *                               "/org/freedesktop/StringThings",
12453  *                               "org.freedesktop.StringThings",
12454  *                               "TwoStrings",
12455  *                               g_variant_new ("(ss)",
12456  *                                              "Thing One",
12457  *                                              "Thing Two"),
12458  *                               NULL,
12459  *                               G_DBUS_CALL_FLAGS_NONE,
12460  *                               -1,
12461  *                               NULL,
12462  *                               &amp;error);
12463  * ]|
12464  *
12465  * The calling thread is blocked until a reply is received. See
12466  * g_dbus_connection_call() for the asynchronous version of
12467  * this method.
12468  *
12469  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12470  * Since: 2.26
12471  */
12472
12473
12474 /**
12475  * g_dbus_connection_call_with_unix_fd_list:
12476  * @connection: A #GDBusConnection.
12477  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12478  * @object_path: Path of remote object.
12479  * @interface_name: D-Bus interface to invoke method on.
12480  * @method_name: The name of the method to invoke.
12481  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12482  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12483  * @flags: Flags from the #GDBusCallFlags enumeration.
12484  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12485  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12486  * @cancellable: (allow-none): A #GCancellable or %NULL.
12487  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't * care about the result of the method invocation.
12488  * @user_data: The data to pass to @callback.
12489  *
12490  * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12491  *
12492  * This method is only available on UNIX.
12493  *
12494  * Since: 2.30
12495  */
12496
12497
12498 /**
12499  * g_dbus_connection_call_with_unix_fd_list_finish:
12500  * @connection: A #GDBusConnection.
12501  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12502  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12503  * @error: Return location for error or %NULL.
12504  *
12505  * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12506  *
12507  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12508  * Since: 2.30
12509  */
12510
12511
12512 /**
12513  * g_dbus_connection_call_with_unix_fd_list_sync:
12514  * @connection: A #GDBusConnection.
12515  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12516  * @object_path: Path of remote object.
12517  * @interface_name: D-Bus interface to invoke method on.
12518  * @method_name: The name of the method to invoke.
12519  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12520  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12521  * @flags: Flags from the #GDBusCallFlags enumeration.
12522  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12523  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12524  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12525  * @cancellable: (allow-none): A #GCancellable or %NULL.
12526  * @error: Return location for error or %NULL.
12527  *
12528  * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12529  *
12530  * This method is only available on UNIX.
12531  *
12532  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12533  * Since: 2.30
12534  */
12535
12536
12537 /**
12538  * g_dbus_connection_close:
12539  * @connection: A #GDBusConnection.
12540  * @cancellable: (allow-none): A #GCancellable or %NULL.
12541  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12542  * @user_data: The data to pass to @callback.
12543  *
12544  * Closes @connection. Note that this never causes the process to
12545  * exit (this might only happen if the other end of a shared message
12546  * bus connection disconnects, see #GDBusConnection:exit-on-close).
12547  *
12548  * Once the connection is closed, operations such as sending a message
12549  * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12550  * will not automatically flush the connection so queued messages may
12551  * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12552  *
12553  * If @connection is already closed, this method fails with
12554  * %G_IO_ERROR_CLOSED.
12555  *
12556  * When @connection has been closed, the #GDBusConnection::closed
12557  * signal is emitted in the <link
12558  * linkend="g-main-context-push-thread-default">thread-default main
12559  * loop</link> of the thread that @connection was constructed in.
12560  *
12561  * This is an asynchronous method. When the operation is finished,
12562  * @callback will be invoked in the <link
12563  * linkend="g-main-context-push-thread-default">thread-default main
12564  * loop</link> of the thread you are calling this method from. You can
12565  * then call g_dbus_connection_close_finish() to get the result of the
12566  * operation.  See g_dbus_connection_close_sync() for the synchronous
12567  * version.
12568  *
12569  * Since: 2.26
12570  */
12571
12572
12573 /**
12574  * g_dbus_connection_close_finish:
12575  * @connection: A #GDBusConnection.
12576  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12577  * @error: Return location for error or %NULL.
12578  *
12579  * Finishes an operation started with g_dbus_connection_close().
12580  *
12581  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12582  * Since: 2.26
12583  */
12584
12585
12586 /**
12587  * g_dbus_connection_close_sync:
12588  * @connection: A #GDBusConnection.
12589  * @cancellable: (allow-none): A #GCancellable or %NULL.
12590  * @error: Return location for error or %NULL.
12591  *
12592  * Synchronously closees @connection. The calling thread is blocked
12593  * until this is done. See g_dbus_connection_close() for the
12594  * asynchronous version of this method and more details about what it
12595  * does.
12596  *
12597  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12598  * Since: 2.26
12599  */
12600
12601
12602 /**
12603  * g_dbus_connection_emit_signal:
12604  * @connection: A #GDBusConnection.
12605  * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12606  * @object_path: Path of remote object.
12607  * @interface_name: D-Bus interface to emit a signal on.
12608  * @signal_name: The name of the signal to emit.
12609  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12610  * @error: Return location for error or %NULL.
12611  *
12612  * Emits a signal.
12613  *
12614  * If the parameters GVariant is floating, it is consumed.
12615  *
12616  * This can only fail if @parameters is not compatible with the D-Bus protocol.
12617  *
12618  * Returns: %TRUE unless @error is set.
12619  * Since: 2.26
12620  */
12621
12622
12623 /**
12624  * g_dbus_connection_export_action_group:
12625  * @connection: a #GDBusConnection
12626  * @object_path: a D-Bus object path
12627  * @action_group: a #GActionGroup
12628  * @error: a pointer to a %NULL #GError, or %NULL
12629  *
12630  * Exports @action_group on @connection at @object_path.
12631  *
12632  * The implemented D-Bus API should be considered private.  It is
12633  * subject to change in the future.
12634  *
12635  * A given object path can only have one action group exported on it.
12636  * If this constraint is violated, the export will fail and 0 will be
12637  * returned (with @error set accordingly).
12638  *
12639  * You can unexport the action group using
12640  * g_dbus_connection_unexport_action_group() with the return value of
12641  * this function.
12642  *
12643  * The thread default main context is taken at the time of this call.
12644  * All incoming action activations and state change requests are
12645  * reported from this context.  Any changes on the action group that
12646  * cause it to emit signals must also come from this same context.
12647  * Since incoming action activations and state change requests are
12648  * rather likely to cause changes on the action group, this effectively
12649  * limits a given action group to being exported from only one main
12650  * context.
12651  *
12652  * Returns: the ID of the export (never zero), or 0 in case of failure
12653  * Since: 2.32
12654  */
12655
12656
12657 /**
12658  * g_dbus_connection_export_menu_model:
12659  * @connection: a #GDBusConnection
12660  * @object_path: a D-Bus object path
12661  * @menu: a #GMenuModel
12662  * @error: return location for an error, or %NULL
12663  *
12664  * Exports @menu on @connection at @object_path.
12665  *
12666  * The implemented D-Bus API should be considered private.
12667  * It is subject to change in the future.
12668  *
12669  * An object path can only have one menu model exported on it. If this
12670  * constraint is violated, the export will fail and 0 will be
12671  * returned (with @error set accordingly).
12672  *
12673  * You can unexport the menu model using
12674  * g_dbus_connection_unexport_menu_model() with the return value of
12675  * this function.
12676  *
12677  * Returns: the ID of the export (never zero), or 0 in case of failure
12678  * Since: 2.32
12679  */
12680
12681
12682 /**
12683  * g_dbus_connection_flush:
12684  * @connection: A #GDBusConnection.
12685  * @cancellable: (allow-none): A #GCancellable or %NULL.
12686  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12687  * @user_data: The data to pass to @callback.
12688  *
12689  * Asynchronously flushes @connection, that is, writes all queued
12690  * outgoing message to the transport and then flushes the transport
12691  * (using g_output_stream_flush_async()). This is useful in programs
12692  * that wants to emit a D-Bus signal and then exit
12693  * immediately. Without flushing the connection, there is no guarantee
12694  * that the message has been sent to the networking buffers in the OS
12695  * kernel.
12696  *
12697  * This is an asynchronous method. When the operation is finished,
12698  * @callback will be invoked in the <link
12699  * linkend="g-main-context-push-thread-default">thread-default main
12700  * loop</link> of the thread you are calling this method from. You can
12701  * then call g_dbus_connection_flush_finish() to get the result of the
12702  * operation.  See g_dbus_connection_flush_sync() for the synchronous
12703  * version.
12704  *
12705  * Since: 2.26
12706  */
12707
12708
12709 /**
12710  * g_dbus_connection_flush_finish:
12711  * @connection: A #GDBusConnection.
12712  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12713  * @error: Return location for error or %NULL.
12714  *
12715  * Finishes an operation started with g_dbus_connection_flush().
12716  *
12717  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12718  * Since: 2.26
12719  */
12720
12721
12722 /**
12723  * g_dbus_connection_flush_sync:
12724  * @connection: A #GDBusConnection.
12725  * @cancellable: (allow-none): A #GCancellable or %NULL.
12726  * @error: Return location for error or %NULL.
12727  *
12728  * Synchronously flushes @connection. The calling thread is blocked
12729  * until this is done. See g_dbus_connection_flush() for the
12730  * asynchronous version of this method and more details about what it
12731  * does.
12732  *
12733  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12734  * Since: 2.26
12735  */
12736
12737
12738 /**
12739  * g_dbus_connection_get_capabilities:
12740  * @connection: A #GDBusConnection.
12741  *
12742  * Gets the capabilities negotiated with the remote peer
12743  *
12744  * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12745  * Since: 2.26
12746  */
12747
12748
12749 /**
12750  * g_dbus_connection_get_exit_on_close:
12751  * @connection: A #GDBusConnection.
12752  *
12753  * Gets whether the process is terminated when @connection is
12754  * closed by the remote peer. See
12755  * #GDBusConnection:exit-on-close for more details.
12756  *
12757  * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12758  * Since: 2.26
12759  */
12760
12761
12762 /**
12763  * g_dbus_connection_get_guid:
12764  * @connection: A #GDBusConnection.
12765  *
12766  * The GUID of the peer performing the role of server when
12767  * authenticating. See #GDBusConnection:guid for more details.
12768  *
12769  * Returns: The GUID. Do not free this string, it is owned by @connection.
12770  * Since: 2.26
12771  */
12772
12773
12774 /**
12775  * g_dbus_connection_get_last_serial:
12776  * @connection: A #GDBusConnection.
12777  *
12778  * Retrieves the last serial number assigned to a #GDBusMessage on
12779  * the current thread. This includes messages sent via both low-level
12780  * API such as g_dbus_connection_send_message() as well as
12781  * high-level API such as g_dbus_connection_emit_signal(),
12782  * g_dbus_connection_call() or g_dbus_proxy_call().
12783  *
12784  * Returns: the last used serial or zero when no message has been sent within the current thread.
12785  * Since: 2.34
12786  */
12787
12788
12789 /**
12790  * g_dbus_connection_get_peer_credentials:
12791  * @connection: A #GDBusConnection.
12792  *
12793  * Gets the credentials of the authenticated peer. This will always
12794  * return %NULL unless @connection acted as a server
12795  * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
12796  * when set up and the client passed credentials as part of the
12797  * authentication process.
12798  *
12799  * In a message bus setup, the message bus is always the server and
12800  * each application is a client. So this method will always return
12801  * %NULL for message bus clients.
12802  *
12803  * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
12804  * Since: 2.26
12805  */
12806
12807
12808 /**
12809  * g_dbus_connection_get_stream:
12810  * @connection: a #GDBusConnection
12811  *
12812  * Gets the underlying stream used for IO.
12813  *
12814  * While the #GDBusConnection is active, it will interact with this
12815  * stream from a worker thread, so it is not safe to interact with
12816  * the stream directly.
12817  *
12818  * Returns: (transfer none): the stream used for IO
12819  * Since: 2.26
12820  */
12821
12822
12823 /**
12824  * g_dbus_connection_get_unique_name:
12825  * @connection: A #GDBusConnection.
12826  *
12827  * Gets the unique name of @connection as assigned by the message
12828  * bus. This can also be used to figure out if @connection is a
12829  * message bus connection.
12830  *
12831  * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
12832  * Since: 2.26
12833  */
12834
12835
12836 /**
12837  * g_dbus_connection_is_closed:
12838  * @connection: A #GDBusConnection.
12839  *
12840  * Gets whether @connection is closed.
12841  *
12842  * Returns: %TRUE if the connection is closed, %FALSE otherwise.
12843  * Since: 2.26
12844  */
12845
12846
12847 /**
12848  * g_dbus_connection_new:
12849  * @stream: A #GIOStream.
12850  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12851  * @flags: Flags describing how to make the connection.
12852  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12853  * @cancellable: (allow-none): A #GCancellable or %NULL.
12854  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12855  * @user_data: The data to pass to @callback.
12856  *
12857  * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
12858  * with the end represented by @stream.
12859  *
12860  * If @stream is a #GSocketConnection, then the corresponding #GSocket
12861  * will be put into non-blocking mode.
12862  *
12863  * The D-Bus connection will interact with @stream from a worker thread.
12864  * As a result, the caller should not interact with @stream after this
12865  * method has been called, except by calling g_object_unref() on it.
12866  *
12867  * If @observer is not %NULL it may be used to control the
12868  * authentication process.
12869  *
12870  * When the operation is finished, @callback will be invoked. You can
12871  * then call g_dbus_connection_new_finish() to get the result of the
12872  * operation.
12873  *
12874  * This is a asynchronous failable constructor. See
12875  * g_dbus_connection_new_sync() for the synchronous
12876  * version.
12877  *
12878  * Since: 2.26
12879  */
12880
12881
12882 /**
12883  * g_dbus_connection_new_finish:
12884  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12885  * @error: Return location for error or %NULL.
12886  *
12887  * Finishes an operation started with g_dbus_connection_new().
12888  *
12889  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12890  * Since: 2.26
12891  */
12892
12893
12894 /**
12895  * g_dbus_connection_new_for_address:
12896  * @address: A D-Bus address.
12897  * @flags: Flags describing how to make the connection.
12898  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12899  * @cancellable: (allow-none): A #GCancellable or %NULL.
12900  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12901  * @user_data: The data to pass to @callback.
12902  *
12903  * Asynchronously connects and sets up a D-Bus client connection for
12904  * exchanging D-Bus messages with an endpoint specified by @address
12905  * which must be in the D-Bus address format.
12906  *
12907  * This constructor can only be used to initiate client-side
12908  * connections - use g_dbus_connection_new() if you need to act as the
12909  * server. In particular, @flags cannot contain the
12910  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12911  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12912  *
12913  * When the operation is finished, @callback will be invoked. You can
12914  * then call g_dbus_connection_new_finish() to get the result of the
12915  * operation.
12916  *
12917  * If @observer is not %NULL it may be used to control the
12918  * authentication process.
12919  *
12920  * This is a asynchronous failable constructor. See
12921  * g_dbus_connection_new_for_address_sync() for the synchronous
12922  * version.
12923  *
12924  * Since: 2.26
12925  */
12926
12927
12928 /**
12929  * g_dbus_connection_new_for_address_finish:
12930  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12931  * @error: Return location for error or %NULL.
12932  *
12933  * Finishes an operation started with g_dbus_connection_new_for_address().
12934  *
12935  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12936  * Since: 2.26
12937  */
12938
12939
12940 /**
12941  * g_dbus_connection_new_for_address_sync:
12942  * @address: A D-Bus address.
12943  * @flags: Flags describing how to make the connection.
12944  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12945  * @cancellable: (allow-none): A #GCancellable or %NULL.
12946  * @error: Return location for error or %NULL.
12947  *
12948  * Synchronously connects and sets up a D-Bus client connection for
12949  * exchanging D-Bus messages with an endpoint specified by @address
12950  * which must be in the D-Bus address format.
12951  *
12952  * This constructor can only be used to initiate client-side
12953  * connections - use g_dbus_connection_new_sync() if you need to act
12954  * as the server. In particular, @flags cannot contain the
12955  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12956  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12957  *
12958  * This is a synchronous failable constructor. See
12959  * g_dbus_connection_new_for_address() for the asynchronous version.
12960  *
12961  * If @observer is not %NULL it may be used to control the
12962  * authentication process.
12963  *
12964  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12965  * Since: 2.26
12966  */
12967
12968
12969 /**
12970  * g_dbus_connection_new_sync:
12971  * @stream: A #GIOStream.
12972  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12973  * @flags: Flags describing how to make the connection.
12974  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12975  * @cancellable: (allow-none): A #GCancellable or %NULL.
12976  * @error: Return location for error or %NULL.
12977  *
12978  * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
12979  * with the end represented by @stream.
12980  *
12981  * If @stream is a #GSocketConnection, then the corresponding #GSocket
12982  * will be put into non-blocking mode.
12983  *
12984  * The D-Bus connection will interact with @stream from a worker thread.
12985  * As a result, the caller should not interact with @stream after this
12986  * method has been called, except by calling g_object_unref() on it.
12987  *
12988  * If @observer is not %NULL it may be used to control the
12989  * authentication process.
12990  *
12991  * This is a synchronous failable constructor. See
12992  * g_dbus_connection_new() for the asynchronous version.
12993  *
12994  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12995  * Since: 2.26
12996  */
12997
12998
12999 /**
13000  * g_dbus_connection_register_object:
13001  * @connection: A #GDBusConnection.
13002  * @object_path: The object path to register at.
13003  * @interface_info: Introspection data for the interface.
13004  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13005  * @user_data: (allow-none): Data to pass to functions in @vtable.
13006  * @user_data_free_func: Function to call when the object path is unregistered.
13007  * @error: Return location for error or %NULL.
13008  *
13009  * Registers callbacks for exported objects at @object_path with the
13010  * D-Bus interface that is described in @interface_info.
13011  *
13012  * Calls to functions in @vtable (and @user_data_free_func) will
13013  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13014  * loop</link> of the thread you are calling this method from.
13015  *
13016  * Note that all #GVariant values passed to functions in @vtable will match
13017  * the signature given in @interface_info - if a remote caller passes
13018  * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13019  * is returned to the remote caller.
13020  *
13021  * Additionally, if the remote caller attempts to invoke methods or
13022  * access properties not mentioned in @interface_info the
13023  * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13024  * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13025  * are returned to the caller.
13026  *
13027  * It is considered a programming error if the
13028  * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13029  * #GVariant of incorrect type.
13030  *
13031  * If an existing callback is already registered at @object_path and
13032  * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13033  *
13034  * GDBus automatically implements the standard D-Bus interfaces
13035  * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13036  * and org.freedesktop.Peer, so you don't have to implement those for
13037  * the objects you export. You <emphasis>can</emphasis> implement
13038  * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13039  * and setting of properties asynchronously.
13040  *
13041  * Note that the reference count on @interface_info will be
13042  * incremented by 1 (unless allocated statically, e.g. if the
13043  * reference count is -1, see g_dbus_interface_info_ref()) for as long
13044  * as the object is exported. Also note that @vtable will be copied.
13045  *
13046  * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13047  *
13048  * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13049  * Since: 2.26
13050  */
13051
13052
13053 /**
13054  * g_dbus_connection_register_subtree:
13055  * @connection: A #GDBusConnection.
13056  * @object_path: The object path to register the subtree at.
13057  * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13058  * @flags: Flags used to fine tune the behavior of the subtree.
13059  * @user_data: Data to pass to functions in @vtable.
13060  * @user_data_free_func: Function to call when the subtree is unregistered.
13061  * @error: Return location for error or %NULL.
13062  *
13063  * Registers a whole subtree of <quote>dynamic</quote> objects.
13064  *
13065  * The @enumerate and @introspection functions in @vtable are used to
13066  * convey, to remote callers, what nodes exist in the subtree rooted
13067  * by @object_path.
13068  *
13069  * When handling remote calls into any node in the subtree, first the
13070  * @enumerate function is used to check if the node exists. If the node exists
13071  * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13072  * the @introspection function is used to check if the node supports the
13073  * requested method. If so, the @dispatch function is used to determine
13074  * where to dispatch the call. The collected #GDBusInterfaceVTable and
13075  * #gpointer will be used to call into the interface vtable for processing
13076  * the request.
13077  *
13078  * All calls into user-provided code will be invoked in the <link
13079  * linkend="g-main-context-push-thread-default">thread-default main
13080  * loop</link> of the thread you are calling this method from.
13081  *
13082  * If an existing subtree is already registered at @object_path or
13083  * then @error is set to #G_IO_ERROR_EXISTS.
13084  *
13085  * Note that it is valid to register regular objects (using
13086  * g_dbus_connection_register_object()) in a subtree registered with
13087  * g_dbus_connection_register_subtree() - if so, the subtree handler
13088  * is tried as the last resort. One way to think about a subtree
13089  * handler is to consider it a <quote>fallback handler</quote>
13090  * for object paths not registered via g_dbus_connection_register_object()
13091  * or other bindings.
13092  *
13093  * Note that @vtable will be copied so you cannot change it after
13094  * registration.
13095  *
13096  * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13097  *
13098  * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13099  * Since: 2.26
13100  */
13101
13102
13103 /**
13104  * g_dbus_connection_remove_filter:
13105  * @connection: a #GDBusConnection
13106  * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13107  *
13108  * Removes a filter.
13109  *
13110  * Since: 2.26
13111  */
13112
13113
13114 /**
13115  * g_dbus_connection_send_message:
13116  * @connection: A #GDBusConnection.
13117  * @message: A #GDBusMessage
13118  * @flags: Flags affecting how the message is sent.
13119  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13120  * @error: Return location for error or %NULL.
13121  *
13122  * Asynchronously sends @message to the peer represented by @connection.
13123  *
13124  * Unless @flags contain the
13125  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13126  * will be assigned by @connection and set on @message via
13127  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13128  * serial number used will be written to this location prior to
13129  * submitting the message to the underlying transport.
13130  *
13131  * If @connection is closed then the operation will fail with
13132  * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13133  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13134  *
13135  * See <xref linkend="gdbus-server"/> and <xref
13136  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13137  * low-level API to send and receive UNIX file descriptors.
13138  *
13139  * Note that @message must be unlocked, unless @flags contain the
13140  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13141  *
13142  * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13143  * Since: 2.26
13144  */
13145
13146
13147 /**
13148  * g_dbus_connection_send_message_with_reply:
13149  * @connection: A #GDBusConnection.
13150  * @message: A #GDBusMessage.
13151  * @flags: Flags affecting how the message is sent.
13152  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13153  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13154  * @cancellable: (allow-none): A #GCancellable or %NULL.
13155  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13156  * @user_data: The data to pass to @callback.
13157  *
13158  * Asynchronously sends @message to the peer represented by @connection.
13159  *
13160  * Unless @flags contain the
13161  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13162  * will be assigned by @connection and set on @message via
13163  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13164  * serial number used will be written to this location prior to
13165  * submitting the message to the underlying transport.
13166  *
13167  * If @connection is closed then the operation will fail with
13168  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13169  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13170  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13171  *
13172  * This is an asynchronous method. When the operation is finished, @callback will be invoked
13173  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13174  * of the thread you are calling this method from. You can then call
13175  * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13176  * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13177  *
13178  * Note that @message must be unlocked, unless @flags contain the
13179  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13180  *
13181  * See <xref linkend="gdbus-server"/> and <xref
13182  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13183  * low-level API to send and receive UNIX file descriptors.
13184  *
13185  * Since: 2.26
13186  */
13187
13188
13189 /**
13190  * g_dbus_connection_send_message_with_reply_finish:
13191  * @connection: a #GDBusConnection
13192  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13193  * @error: Return location for error or %NULL.
13194  *
13195  * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13196  *
13197  * Note that @error is only set if a local in-process error
13198  * occurred. That is to say that the returned #GDBusMessage object may
13199  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13200  * g_dbus_message_to_gerror() to transcode this to a #GError.
13201  *
13202  * See <xref linkend="gdbus-server"/> and <xref
13203  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13204  * low-level API to send and receive UNIX file descriptors.
13205  *
13206  * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13207  * Since: 2.26
13208  */
13209
13210
13211 /**
13212  * g_dbus_connection_send_message_with_reply_sync:
13213  * @connection: A #GDBusConnection.
13214  * @message: A #GDBusMessage.
13215  * @flags: Flags affecting how the message is sent.
13216  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13217  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13218  * @cancellable: (allow-none): A #GCancellable or %NULL.
13219  * @error: Return location for error or %NULL.
13220  *
13221  * Synchronously sends @message to the peer represented by @connection
13222  * and blocks the calling thread until a reply is received or the
13223  * timeout is reached. See g_dbus_connection_send_message_with_reply()
13224  * for the asynchronous version of this method.
13225  *
13226  * Unless @flags contain the
13227  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13228  * will be assigned by @connection and set on @message via
13229  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13230  * serial number used will be written to this location prior to
13231  * submitting the message to the underlying transport.
13232  *
13233  * If @connection is closed then the operation will fail with
13234  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13235  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13236  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13237  *
13238  * Note that @error is only set if a local in-process error
13239  * occurred. That is to say that the returned #GDBusMessage object may
13240  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13241  * g_dbus_message_to_gerror() to transcode this to a #GError.
13242  *
13243  * See <xref linkend="gdbus-server"/> and <xref
13244  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13245  * low-level API to send and receive UNIX file descriptors.
13246  *
13247  * Note that @message must be unlocked, unless @flags contain the
13248  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13249  *
13250  * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13251  * Since: 2.26
13252  */
13253
13254
13255 /**
13256  * g_dbus_connection_set_exit_on_close:
13257  * @connection: A #GDBusConnection.
13258  * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13259  *
13260  * Sets whether the process should be terminated when @connection is
13261  * closed by the remote peer. See #GDBusConnection:exit-on-close for
13262  * more details.
13263  *
13264  * Note that this function should be used with care. Most modern UNIX
13265  * desktops tie the notion of a user session the session bus, and expect
13266  * all of a users applications to quit when their bus connection goes away.
13267  * If you are setting @exit_on_close to %FALSE for the shared session
13268  * bus connection, you should make sure that your application exits
13269  * when the user session ends.
13270  *
13271  * Since: 2.26
13272  */
13273
13274
13275 /**
13276  * g_dbus_connection_signal_subscribe:
13277  * @connection: A #GDBusConnection.
13278  * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13279  * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13280  * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13281  * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13282  * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13283  * @flags: Flags describing how to subscribe to the signal (currently unused).
13284  * @callback: Callback to invoke when there is a signal matching the requested data.
13285  * @user_data: User data to pass to @callback.
13286  * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13287  *
13288  * Subscribes to signals on @connection and invokes @callback with a
13289  * whenever the signal is received. Note that @callback
13290  * will be invoked in the <link
13291  * linkend="g-main-context-push-thread-default">thread-default main
13292  * loop</link> of the thread you are calling this method from.
13293  *
13294  * If @connection is not a message bus connection, @sender must be
13295  * %NULL.
13296  *
13297  * If @sender is a well-known name note that @callback is invoked with
13298  * the unique name for the owner of @sender, not the well-known name
13299  * as one would expect. This is because the message bus rewrites the
13300  * name. As such, to avoid certain race conditions, users should be
13301  * tracking the name owner of the well-known name and use that when
13302  * processing the received signal.
13303  *
13304  * If one of %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE or
13305  * %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH are given, @arg0 is
13306  * interpreted as part of a namespace or path.  The first argument
13307  * of a signal is matched against that part as specified by D-Bus.
13308  *
13309  * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13310  * Since: 2.26
13311  */
13312
13313
13314 /**
13315  * g_dbus_connection_signal_unsubscribe:
13316  * @connection: A #GDBusConnection.
13317  * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13318  *
13319  * Unsubscribes from signals.
13320  *
13321  * Since: 2.26
13322  */
13323
13324
13325 /**
13326  * g_dbus_connection_start_message_processing:
13327  * @connection: A #GDBusConnection.
13328  *
13329  * If @connection was created with
13330  * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13331  * starts processing messages. Does nothing on if @connection wasn't
13332  * created with this flag or if the method has already been called.
13333  *
13334  * Since: 2.26
13335  */
13336
13337
13338 /**
13339  * g_dbus_connection_unexport_action_group:
13340  * @connection: a #GDBusConnection
13341  * @export_id: the ID from g_dbus_connection_export_action_group()
13342  *
13343  * Reverses the effect of a previous call to
13344  * g_dbus_connection_export_action_group().
13345  *
13346  * It is an error to call this function with an ID that wasn't returned
13347  * from g_dbus_connection_export_action_group() or to call it with the
13348  * same ID more than once.
13349  *
13350  * Since: 2.32
13351  */
13352
13353
13354 /**
13355  * g_dbus_connection_unexport_menu_model:
13356  * @connection: a #GDBusConnection
13357  * @export_id: the ID from g_dbus_connection_export_menu_model()
13358  *
13359  * Reverses the effect of a previous call to
13360  * g_dbus_connection_export_menu_model().
13361  *
13362  * It is an error to call this function with an ID that wasn't returned
13363  * from g_dbus_connection_export_menu_model() or to call it with the
13364  * same ID more than once.
13365  *
13366  * Since: 2.32
13367  */
13368
13369
13370 /**
13371  * g_dbus_connection_unregister_object:
13372  * @connection: A #GDBusConnection.
13373  * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13374  *
13375  * Unregisters an object.
13376  *
13377  * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13378  * Since: 2.26
13379  */
13380
13381
13382 /**
13383  * g_dbus_connection_unregister_subtree:
13384  * @connection: A #GDBusConnection.
13385  * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13386  *
13387  * Unregisters a subtree.
13388  *
13389  * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13390  * Since: 2.26
13391  */
13392
13393
13394 /**
13395  * g_dbus_error_encode_gerror:
13396  * @error: A #GError.
13397  *
13398  * Creates a D-Bus error name to use for @error. If @error matches
13399  * a registered error (cf. g_dbus_error_register_error()), the corresponding
13400  * D-Bus error name will be returned.
13401  *
13402  * Otherwise the a name of the form
13403  * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13404  * will be used. This allows other GDBus applications to map the error
13405  * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13406  *
13407  * This function is typically only used in object mappings to put a
13408  * #GError on the wire. Regular applications should not use it.
13409  *
13410  * Returns: A D-Bus error name (never %NULL). Free with g_free().
13411  * Since: 2.26
13412  */
13413
13414
13415 /**
13416  * g_dbus_error_get_remote_error:
13417  * @error: A #GError.
13418  *
13419  * Gets the D-Bus error name used for @error, if any.
13420  *
13421  * This function is guaranteed to return a D-Bus error name for all
13422  * #GError<!-- -->s returned from functions handling remote method
13423  * calls (e.g. g_dbus_connection_call_finish()) unless
13424  * g_dbus_error_strip_remote_error() has been used on @error.
13425  *
13426  * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13427  * Since: 2.26
13428  */
13429
13430
13431 /**
13432  * g_dbus_error_is_remote_error:
13433  * @error: A #GError.
13434  *
13435  * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13436  * use g_dbus_error_get_remote_error() to get the name of the error.
13437  *
13438  * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13439  * Since: 2.26
13440  */
13441
13442
13443 /**
13444  * g_dbus_error_new_for_dbus_error:
13445  * @dbus_error_name: D-Bus error name.
13446  * @dbus_error_message: D-Bus error message.
13447  *
13448  * Creates a #GError based on the contents of @dbus_error_name and
13449  * @dbus_error_message.
13450  *
13451  * Errors registered with g_dbus_error_register_error() will be looked
13452  * up using @dbus_error_name and if a match is found, the error domain
13453  * and code is used. Applications can use g_dbus_error_get_remote_error()
13454  * to recover @dbus_error_name.
13455  *
13456  * If a match against a registered error is not found and the D-Bus
13457  * error name is in a form as returned by g_dbus_error_encode_gerror()
13458  * the error domain and code encoded in the name is used to
13459  * create the #GError. Also, @dbus_error_name is added to the error message
13460  * such that it can be recovered with g_dbus_error_get_remote_error().
13461  *
13462  * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13463  * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13464  * added to the error message such that it can be recovered with
13465  * g_dbus_error_get_remote_error().
13466  *
13467  * In all three cases, @dbus_error_name can always be recovered from the
13468  * returned #GError using the g_dbus_error_get_remote_error() function
13469  * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13470  *
13471  * This function is typically only used in object mappings to prepare
13472  * #GError instances for applications. Regular applications should not use
13473  * it.
13474  *
13475  * Returns: An allocated #GError. Free with g_error_free().
13476  * Since: 2.26
13477  */
13478
13479
13480 /**
13481  * g_dbus_error_register_error:
13482  * @error_domain: A #GQuark for a error domain.
13483  * @error_code: An error code.
13484  * @dbus_error_name: A D-Bus error name.
13485  *
13486  * Creates an association to map between @dbus_error_name and
13487  * #GError<!-- -->s specified by @error_domain and @error_code.
13488  *
13489  * This is typically done in the routine that returns the #GQuark for
13490  * an error domain.
13491  *
13492  * Returns: %TRUE if the association was created, %FALSE if it already exists.
13493  * Since: 2.26
13494  */
13495
13496
13497 /**
13498  * g_dbus_error_register_error_domain:
13499  * @error_domain_quark_name: The error domain name.
13500  * @quark_volatile: A pointer where to store the #GQuark.
13501  * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13502  * @num_entries: Number of items to register.
13503  *
13504  * Helper function for associating a #GError error domain with D-Bus error names.
13505  *
13506  * Since: 2.26
13507  */
13508
13509
13510 /**
13511  * g_dbus_error_set_dbus_error:
13512  * @error: A pointer to a #GError or %NULL.
13513  * @dbus_error_name: D-Bus error name.
13514  * @dbus_error_message: D-Bus error message.
13515  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13516  * @...: Arguments for @format.
13517  *
13518  * Does nothing if @error is %NULL. Otherwise sets *@error to
13519  * a new #GError created with g_dbus_error_new_for_dbus_error()
13520  * with @dbus_error_message prepend with @format (unless %NULL).
13521  *
13522  * Since: 2.26
13523  */
13524
13525
13526 /**
13527  * g_dbus_error_set_dbus_error_valist:
13528  * @error: A pointer to a #GError or %NULL.
13529  * @dbus_error_name: D-Bus error name.
13530  * @dbus_error_message: D-Bus error message.
13531  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13532  * @var_args: Arguments for @format.
13533  *
13534  * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13535  *
13536  * Since: 2.26
13537  */
13538
13539
13540 /**
13541  * g_dbus_error_strip_remote_error:
13542  * @error: A #GError.
13543  *
13544  * Looks for extra information in the error message used to recover
13545  * the D-Bus error name and strips it if found. If stripped, the
13546  * message field in @error will correspond exactly to what was
13547  * received on the wire.
13548  *
13549  * This is typically used when presenting errors to the end user.
13550  *
13551  * Returns: %TRUE if information was stripped, %FALSE otherwise.
13552  * Since: 2.26
13553  */
13554
13555
13556 /**
13557  * g_dbus_error_unregister_error:
13558  * @error_domain: A #GQuark for a error domain.
13559  * @error_code: An error code.
13560  * @dbus_error_name: A D-Bus error name.
13561  *
13562  * Destroys an association previously set up with g_dbus_error_register_error().
13563  *
13564  * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13565  * Since: 2.26
13566  */
13567
13568
13569 /**
13570  * g_dbus_generate_guid:
13571  *
13572  * Generate a D-Bus GUID that can be used with
13573  * e.g. g_dbus_connection_new().
13574  *
13575  * See the D-Bus specification regarding what strings are valid D-Bus
13576  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13577  *
13578  * Returns: A valid D-Bus GUID. Free with g_free().
13579  * Since: 2.26
13580  */
13581
13582
13583 /**
13584  * g_dbus_gvalue_to_gvariant:
13585  * @gvalue: A #GValue to convert to a #GVariant.
13586  * @type: A #GVariantType.
13587  *
13588  * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13589  *
13590  * The conversion is using the following rules:
13591  * <table frame='all'>
13592  *   <title>#GValue / #GVariant conversion rules</title>
13593  *   <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13594  *     <thead>
13595  *       <row>
13596  *         <entry>If the #GType for @gvalue is...</entry>
13597  *         <entry>... then @type must be</entry>
13598  *       </row>
13599  *     </thead>
13600  *     <tbody>
13601  *       <row>
13602  *         <entry>#G_TYPE_STRING</entry>
13603  *         <entry><link linkend="G-VARIANT-TYPE-STRING:CAPS">'s'</link>, <link linkend="G-VARIANT-TYPE-OBJECT-PATH:CAPS">'o'</link>, <link linkend="G-VARIANT-TYPE-SIGNATURE:CAPS">'g'</link> or <link linkend="G-VARIANT-TYPE-BYTESTRING:CAPS">'ay'</link></entry>
13604  *       </row>
13605  *       <row>
13606  *         <entry>#G_TYPE_STRV</entry>
13607  *         <entry><link linkend="G-VARIANT-TYPE-STRING-ARRAY:CAPS">'as'</link>, <link linkend="G-VARIANT-TYPE-OBJECT-PATH-ARRAY:CAPS">'ao'</link> or <link linkend="G-VARIANT-TYPE-BYTESTRING-ARRAY:CAPS">'aay'</link></entry>
13608  *       </row>
13609  *       <row>
13610  *         <entry>#G_TYPE_BOOLEAN</entry>
13611  *         <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13612  *       </row>
13613  *       <row>
13614  *         <entry>#G_TYPE_UCHAR</entry>
13615  *         <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13616  *       </row>
13617  *       <row>
13618  *         <entry>#G_TYPE_INT</entry>
13619  *         <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13620  *       </row>
13621  *       <row>
13622  *         <entry>#G_TYPE_UINT</entry>
13623  *         <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13624  *       </row>
13625  *       <row>
13626  *         <entry>#G_TYPE_INT64</entry>
13627  *         <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13628  *       </row>
13629  *       <row>
13630  *         <entry>#G_TYPE_UINT64</entry>
13631  *         <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13632  *       </row>
13633  *       <row>
13634  *         <entry>#G_TYPE_DOUBLE</entry>
13635  *         <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13636  *       </row>
13637  *       <row>
13638  *         <entry>#G_TYPE_VARIANT</entry>
13639  *         <entry>Any #GVariantType</entry>
13640  *       </row>
13641  *     </tbody>
13642  *   </tgroup>
13643  * </table>
13644  * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13645  * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13646  * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13647  * #G_TYPE_BOXED derived-types) not in the table above.
13648  *
13649  * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13650  * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13651  * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13652  * string for string types, <literal>'/'</literal> for object path
13653  * types, the empty array for any array type and so on).
13654  *
13655  * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13656  * #GVariant to a #GValue.
13657  *
13658  * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13659  * Since: 2.30
13660  */
13661
13662
13663 /**
13664  * g_dbus_gvariant_to_gvalue:
13665  * @value: A #GVariant.
13666  * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13667  *
13668  * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13669  *
13670  * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13671  * used - this function is essentially its reverse form.
13672  *
13673  * The conversion never fails - a valid #GValue is always returned in
13674  * @out_gvalue.
13675  *
13676  * Since: 2.30
13677  */
13678
13679
13680 /**
13681  * g_dbus_interface_dup_object:
13682  * @interface_: An exported D-Bus interface.
13683  *
13684  * Gets the #GDBusObject that @interface_ belongs to, if any.
13685  *
13686  * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13687  * Since: 2.32
13688  * Rename to: g_dbus_interface_get_object
13689  */
13690
13691
13692 /**
13693  * g_dbus_interface_get_info:
13694  * @interface_: An exported D-Bus interface.
13695  *
13696  * Gets D-Bus introspection information for the D-Bus interface
13697  * implemented by @interface_.
13698  *
13699  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13700  * Since: 2.30
13701  */
13702
13703
13704 /**
13705  * g_dbus_interface_get_object: (skip)
13706  * @interface_: An exported D-Bus interface.
13707  *
13708  * Gets the #GDBusObject that @interface_ belongs to, if any.
13709  *
13710  * <warning>It is not safe to use the returned object if @interface_
13711  * or the returned object is being used from other threads. See
13712  * g_dbus_interface_dup_object() for a thread-safe
13713  * alternative.</warning>
13714  *
13715  * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13716  * Since: 2.30
13717  */
13718
13719
13720 /**
13721  * g_dbus_interface_info_cache_build:
13722  * @info: A #GDBusInterfaceInfo.
13723  *
13724  * Builds a lookup-cache to speed up
13725  * g_dbus_interface_info_lookup_method(),
13726  * g_dbus_interface_info_lookup_signal() and
13727  * g_dbus_interface_info_lookup_property().
13728  *
13729  * If this has already been called with @info, the existing cache is
13730  * used and its use count is increased.
13731  *
13732  * Note that @info cannot be modified until
13733  * g_dbus_interface_info_cache_release() is called.
13734  *
13735  * Since: 2.30
13736  */
13737
13738
13739 /**
13740  * g_dbus_interface_info_cache_release:
13741  * @info: A GDBusInterfaceInfo
13742  *
13743  * Decrements the usage count for the cache for @info built by
13744  * g_dbus_interface_info_cache_build() (if any) and frees the
13745  * resources used by the cache if the usage count drops to zero.
13746  *
13747  * Since: 2.30
13748  */
13749
13750
13751 /**
13752  * g_dbus_interface_info_generate_xml:
13753  * @info: A #GDBusNodeInfo
13754  * @indent: Indentation level.
13755  * @string_builder: (out): A #GString to to append XML data to.
13756  *
13757  * Appends an XML representation of @info (and its children) to @string_builder.
13758  *
13759  * This function is typically used for generating introspection XML
13760  * documents at run-time for handling the
13761  * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13762  * method.
13763  *
13764  * Since: 2.26
13765  */
13766
13767
13768 /**
13769  * g_dbus_interface_info_lookup_method:
13770  * @info: A #GDBusInterfaceInfo.
13771  * @name: A D-Bus method name (typically in CamelCase)
13772  *
13773  * Looks up information about a method.
13774  *
13775  * The cost of this function is O(n) in number of methods unless
13776  * g_dbus_interface_info_cache_build() has been used on @info.
13777  *
13778  * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13779  * Since: 2.26
13780  */
13781
13782
13783 /**
13784  * g_dbus_interface_info_lookup_property:
13785  * @info: A #GDBusInterfaceInfo.
13786  * @name: A D-Bus property name (typically in CamelCase).
13787  *
13788  * Looks up information about a property.
13789  *
13790  * The cost of this function is O(n) in number of properties unless
13791  * g_dbus_interface_info_cache_build() has been used on @info.
13792  *
13793  * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
13794  * Since: 2.26
13795  */
13796
13797
13798 /**
13799  * g_dbus_interface_info_lookup_signal:
13800  * @info: A #GDBusInterfaceInfo.
13801  * @name: A D-Bus signal name (typically in CamelCase)
13802  *
13803  * Looks up information about a signal.
13804  *
13805  * The cost of this function is O(n) in number of signals unless
13806  * g_dbus_interface_info_cache_build() has been used on @info.
13807  *
13808  * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
13809  * Since: 2.26
13810  */
13811
13812
13813 /**
13814  * g_dbus_interface_info_ref:
13815  * @info: A #GDBusInterfaceInfo
13816  *
13817  * If @info is statically allocated does nothing. Otherwise increases
13818  * the reference count.
13819  *
13820  * Returns: The same @info.
13821  * Since: 2.26
13822  */
13823
13824
13825 /**
13826  * g_dbus_interface_info_unref:
13827  * @info: A #GDBusInterfaceInfo.
13828  *
13829  * If @info is statically allocated, does nothing. Otherwise decreases
13830  * the reference count of @info. When its reference count drops to 0,
13831  * the memory used is freed.
13832  *
13833  * Since: 2.26
13834  */
13835
13836
13837 /**
13838  * g_dbus_interface_set_object:
13839  * @interface_: An exported D-Bus interface.
13840  * @object: (allow-none): A #GDBusObject or %NULL.
13841  *
13842  * Sets the #GDBusObject for @interface_ to @object.
13843  *
13844  * Note that @interface_ will hold a weak reference to @object.
13845  *
13846  * Since: 2.30
13847  */
13848
13849
13850 /**
13851  * g_dbus_interface_skeleton_export:
13852  * @interface_: The D-Bus interface to export.
13853  * @connection: A #GDBusConnection to export @interface_ on.
13854  * @object_path: The path to export the interface at.
13855  * @error: Return location for error or %NULL.
13856  *
13857  * Exports @interface_ at @object_path on @connection.
13858  *
13859  * This can be called multiple times to export the same @interface_
13860  * onto multiple connections however the @object_path provided must be
13861  * the same for all connections.
13862  *
13863  * Use g_dbus_interface_skeleton_unexport() to unexport the object.
13864  *
13865  * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
13866  * Since: 2.30
13867  */
13868
13869
13870 /**
13871  * g_dbus_interface_skeleton_flush:
13872  * @interface_: A #GDBusInterfaceSkeleton.
13873  *
13874  * If @interface_ has outstanding changes, request for these changes to be
13875  * emitted immediately.
13876  *
13877  * For example, an exported D-Bus interface may queue up property
13878  * changes and emit the
13879  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
13880  * signal later (e.g. in an idle handler). This technique is useful
13881  * for collapsing multiple property changes into one.
13882  *
13883  * Since: 2.30
13884  */
13885
13886
13887 /**
13888  * g_dbus_interface_skeleton_get_connection:
13889  * @interface_: A #GDBusInterfaceSkeleton.
13890  *
13891  * Gets the first connection that @interface_ is exported on, if any.
13892  *
13893  * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
13894  * Since: 2.30
13895  */
13896
13897
13898 /**
13899  * g_dbus_interface_skeleton_get_connections:
13900  * @interface_: A #GDBusInterfaceSkeleton.
13901  *
13902  * Gets a list of the connections that @interface_ is exported on.
13903  *
13904  * Returns: (element-type GDBusConnection) (transfer full): A list of all the connections that @interface_ is exported on. The returned list should be freed with g_list_free() after each element has been freed with g_object_unref().
13905  * Since: 2.32
13906  */
13907
13908
13909 /**
13910  * g_dbus_interface_skeleton_get_flags:
13911  * @interface_: A #GDBusInterfaceSkeleton.
13912  *
13913  * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
13914  * of @interface_
13915  *
13916  * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
13917  * Since: 2.30
13918  */
13919
13920
13921 /**
13922  * g_dbus_interface_skeleton_get_info:
13923  * @interface_: A #GDBusInterfaceSkeleton.
13924  *
13925  * Gets D-Bus introspection information for the D-Bus interface
13926  * implemented by @interface_.
13927  *
13928  * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
13929  * Since: 2.30
13930  */
13931
13932
13933 /**
13934  * g_dbus_interface_skeleton_get_object_path:
13935  * @interface_: A #GDBusInterfaceSkeleton.
13936  *
13937  * Gets the object path that @interface_ is exported on, if any.
13938  *
13939  * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
13940  * Since: 2.30
13941  */
13942
13943
13944 /**
13945  * g_dbus_interface_skeleton_get_properties:
13946  * @interface_: A #GDBusInterfaceSkeleton.
13947  *
13948  * Gets all D-Bus properties for @interface_.
13949  *
13950  * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
13951  * Since: 2.30
13952  */
13953
13954
13955 /**
13956  * g_dbus_interface_skeleton_get_vtable: (skip)
13957  * @interface_: A #GDBusInterfaceSkeleton.
13958  *
13959  * Gets the interface vtable for the D-Bus interface implemented by
13960  * @interface_. The returned function pointers should expect @interface_
13961  * itself to be passed as @user_data.
13962  *
13963  * Returns: A #GDBusInterfaceVTable (never %NULL).
13964  * Since: 2.30
13965  */
13966
13967
13968 /**
13969  * g_dbus_interface_skeleton_has_connection:
13970  * @interface_: A #GDBusInterfaceSkeleton.
13971  * @connection: A #GDBusConnection.
13972  *
13973  * Checks if @interface_ is exported on @connection.
13974  *
13975  * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
13976  * Since: 2.32
13977  */
13978
13979
13980 /**
13981  * g_dbus_interface_skeleton_set_flags:
13982  * @interface_: A #GDBusInterfaceSkeleton.
13983  * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
13984  *
13985  * Sets flags describing what the behavior of @skeleton should be.
13986  *
13987  * Since: 2.30
13988  */
13989
13990
13991 /**
13992  * g_dbus_interface_skeleton_unexport:
13993  * @interface_: A #GDBusInterfaceSkeleton.
13994  *
13995  * Stops exporting @interface_ on all connections it is exported on.
13996  *
13997  * To unexport @interface_ from only a single connection, use
13998  * g_dbus_interface_skeleton_unexport_from_connection()
13999  *
14000  * Since: 2.30
14001  */
14002
14003
14004 /**
14005  * g_dbus_interface_skeleton_unexport_from_connection:
14006  * @interface_: A #GDBusInterfaceSkeleton.
14007  * @connection: A #GDBusConnection.
14008  *
14009  * Stops exporting @interface_ on @connection.
14010  *
14011  * To stop exporting on all connections the interface is exported on,
14012  * use g_dbus_interface_skeleton_unexport().
14013  *
14014  * Since: 2.32
14015  */
14016
14017
14018 /**
14019  * g_dbus_is_address:
14020  * @string: A string.
14021  *
14022  * Checks if @string is a D-Bus address.
14023  *
14024  * This doesn't check if @string is actually supported by #GDBusServer
14025  * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14026  * checks.
14027  *
14028  * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14029  * Since: 2.26
14030  */
14031
14032
14033 /**
14034  * g_dbus_is_guid:
14035  * @string: The string to check.
14036  *
14037  * Checks if @string is a D-Bus GUID.
14038  *
14039  * See the D-Bus specification regarding what strings are valid D-Bus
14040  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14041  *
14042  * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14043  * Since: 2.26
14044  */
14045
14046
14047 /**
14048  * g_dbus_is_interface_name:
14049  * @string: The string to check.
14050  *
14051  * Checks if @string is a valid D-Bus interface name.
14052  *
14053  * Returns: %TRUE if valid, %FALSE otherwise.
14054  * Since: 2.26
14055  */
14056
14057
14058 /**
14059  * g_dbus_is_member_name:
14060  * @string: The string to check.
14061  *
14062  * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14063  *
14064  * Returns: %TRUE if valid, %FALSE otherwise.
14065  * Since: 2.26
14066  */
14067
14068
14069 /**
14070  * g_dbus_is_name:
14071  * @string: The string to check.
14072  *
14073  * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14074  *
14075  * Returns: %TRUE if valid, %FALSE otherwise.
14076  * Since: 2.26
14077  */
14078
14079
14080 /**
14081  * g_dbus_is_supported_address:
14082  * @string: A string.
14083  * @error: Return location for error or %NULL.
14084  *
14085  * Like g_dbus_is_address() but also checks if the library suppors the
14086  * transports in @string and that key/value pairs for each transport
14087  * are valid.
14088  *
14089  * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14090  * Since: 2.26
14091  */
14092
14093
14094 /**
14095  * g_dbus_is_unique_name:
14096  * @string: The string to check.
14097  *
14098  * Checks if @string is a valid D-Bus unique bus name.
14099  *
14100  * Returns: %TRUE if valid, %FALSE otherwise.
14101  * Since: 2.26
14102  */
14103
14104
14105 /**
14106  * g_dbus_menu_model_get:
14107  * @connection: a #GDBusConnection
14108  * @bus_name: the bus name which exports the menu model
14109  * @object_path: the object path at which the menu model is exported
14110  *
14111  * Obtains a #GDBusMenuModel for the menu model which is exported
14112  * at the given @bus_name and @object_path.
14113  *
14114  * The thread default main context is taken at the time of this call.
14115  * All signals on the menu model (and any linked models) are reported
14116  * with respect to this context.  All calls on the returned menu model
14117  * (and linked models) must also originate from this same context, with
14118  * the thread default main context unchanged.
14119  *
14120  * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14121  * Since: 2.32
14122  */
14123
14124
14125 /**
14126  * g_dbus_message_bytes_needed:
14127  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14128  * @blob_len: The length of @blob (must be at least 16).
14129  * @error: Return location for error or %NULL.
14130  *
14131  * Utility function to calculate how many bytes are needed to
14132  * completely deserialize the D-Bus message stored at @blob.
14133  *
14134  * Returns: Number of bytes needed or -1 if @error is set (e.g. if @blob contains invalid data or not enough data is available to determine the size).
14135  * Since: 2.26
14136  */
14137
14138
14139 /**
14140  * g_dbus_message_copy:
14141  * @message: A #GDBusMessage.
14142  * @error: Return location for error or %NULL.
14143  *
14144  * Copies @message. The copy is a deep copy and the returned
14145  * #GDBusMessage is completely identical except that it is guaranteed
14146  * to not be locked.
14147  *
14148  * This operation can fail if e.g. @message contains file descriptors
14149  * and the per-process or system-wide open files limit is reached.
14150  *
14151  * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14152  * Since: 2.26
14153  */
14154
14155
14156 /**
14157  * g_dbus_message_get_arg0:
14158  * @message: A #GDBusMessage.
14159  *
14160  * Convenience to get the first item in the body of @message.
14161  *
14162  * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14163  * Since: 2.26
14164  */
14165
14166
14167 /**
14168  * g_dbus_message_get_body:
14169  * @message: A #GDBusMessage.
14170  *
14171  * Gets the body of a message.
14172  *
14173  * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14174  * Since: 2.26
14175  */
14176
14177
14178 /**
14179  * g_dbus_message_get_byte_order:
14180  * @message: A #GDBusMessage.
14181  *
14182  * Gets the byte order of @message.
14183  *
14184  * Returns: The byte order.
14185  */
14186
14187
14188 /**
14189  * g_dbus_message_get_destination:
14190  * @message: A #GDBusMessage.
14191  *
14192  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14193  *
14194  * Returns: The value.
14195  * Since: 2.26
14196  */
14197
14198
14199 /**
14200  * g_dbus_message_get_error_name:
14201  * @message: A #GDBusMessage.
14202  *
14203  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14204  *
14205  * Returns: The value.
14206  * Since: 2.26
14207  */
14208
14209
14210 /**
14211  * g_dbus_message_get_flags:
14212  * @message: A #GDBusMessage.
14213  *
14214  * Gets the flags for @message.
14215  *
14216  * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14217  * Since: 2.26
14218  */
14219
14220
14221 /**
14222  * g_dbus_message_get_header:
14223  * @message: A #GDBusMessage.
14224  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14225  *
14226  * Gets a header field on @message.
14227  *
14228  * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14229  * Since: 2.26
14230  */
14231
14232
14233 /**
14234  * g_dbus_message_get_header_fields:
14235  * @message: A #GDBusMessage.
14236  *
14237  * Gets an array of all header fields on @message that are set.
14238  *
14239  * Returns: (array zero-terminated=1): An array of header fields terminated by %G_DBUS_MESSAGE_HEADER_FIELD_INVALID.  Each element is a #guchar. Free with g_free().
14240  * Since: 2.26
14241  */
14242
14243
14244 /**
14245  * g_dbus_message_get_interface:
14246  * @message: A #GDBusMessage.
14247  *
14248  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14249  *
14250  * Returns: The value.
14251  * Since: 2.26
14252  */
14253
14254
14255 /**
14256  * g_dbus_message_get_locked:
14257  * @message: A #GDBusMessage.
14258  *
14259  * Checks whether @message is locked. To monitor changes to this
14260  * value, conncet to the #GObject::notify signal to listen for changes
14261  * on the #GDBusMessage:locked property.
14262  *
14263  * Returns: %TRUE if @message is locked, %FALSE otherwise.
14264  * Since: 2.26
14265  */
14266
14267
14268 /**
14269  * g_dbus_message_get_member:
14270  * @message: A #GDBusMessage.
14271  *
14272  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14273  *
14274  * Returns: The value.
14275  * Since: 2.26
14276  */
14277
14278
14279 /**
14280  * g_dbus_message_get_message_type:
14281  * @message: A #GDBusMessage.
14282  *
14283  * Gets the type of @message.
14284  *
14285  * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14286  * Since: 2.26
14287  */
14288
14289
14290 /**
14291  * g_dbus_message_get_num_unix_fds:
14292  * @message: A #GDBusMessage.
14293  *
14294  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14295  *
14296  * Returns: The value.
14297  * Since: 2.26
14298  */
14299
14300
14301 /**
14302  * g_dbus_message_get_path:
14303  * @message: A #GDBusMessage.
14304  *
14305  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14306  *
14307  * Returns: The value.
14308  * Since: 2.26
14309  */
14310
14311
14312 /**
14313  * g_dbus_message_get_reply_serial:
14314  * @message: A #GDBusMessage.
14315  *
14316  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14317  *
14318  * Returns: The value.
14319  * Since: 2.26
14320  */
14321
14322
14323 /**
14324  * g_dbus_message_get_sender:
14325  * @message: A #GDBusMessage.
14326  *
14327  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14328  *
14329  * Returns: The value.
14330  * Since: 2.26
14331  */
14332
14333
14334 /**
14335  * g_dbus_message_get_serial:
14336  * @message: A #GDBusMessage.
14337  *
14338  * Gets the serial for @message.
14339  *
14340  * Returns: A #guint32.
14341  * Since: 2.26
14342  */
14343
14344
14345 /**
14346  * g_dbus_message_get_signature:
14347  * @message: A #GDBusMessage.
14348  *
14349  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14350  *
14351  * Returns: The value.
14352  * Since: 2.26
14353  */
14354
14355
14356 /**
14357  * g_dbus_message_get_unix_fd_list:
14358  * @message: A #GDBusMessage.
14359  *
14360  * Gets the UNIX file descriptors associated with @message, if any.
14361  *
14362  * This method is only available on UNIX.
14363  *
14364  * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14365  * Since: 2.26
14366  */
14367
14368
14369 /**
14370  * g_dbus_message_lock:
14371  * @message: A #GDBusMessage.
14372  *
14373  * If @message is locked, does nothing. Otherwise locks the message.
14374  *
14375  * Since: 2.26
14376  */
14377
14378
14379 /**
14380  * g_dbus_message_new:
14381  *
14382  * Creates a new empty #GDBusMessage.
14383  *
14384  * Returns: A #GDBusMessage. Free with g_object_unref().
14385  * Since: 2.26
14386  */
14387
14388
14389 /**
14390  * g_dbus_message_new_from_blob:
14391  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14392  * @blob_len: The length of @blob.
14393  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14394  * @error: Return location for error or %NULL.
14395  *
14396  * Creates a new #GDBusMessage from the data stored at @blob. The byte
14397  * order that the message was in can be retrieved using
14398  * g_dbus_message_get_byte_order().
14399  *
14400  * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14401  * Since: 2.26
14402  */
14403
14404
14405 /**
14406  * g_dbus_message_new_method_call:
14407  * @name: (allow-none): A valid D-Bus name or %NULL.
14408  * @path: A valid object path.
14409  * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14410  * @method: A valid method name.
14411  *
14412  * Creates a new #GDBusMessage for a method call.
14413  *
14414  * Returns: A #GDBusMessage. Free with g_object_unref().
14415  * Since: 2.26
14416  */
14417
14418
14419 /**
14420  * g_dbus_message_new_method_error:
14421  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14422  * @error_name: A valid D-Bus error name.
14423  * @error_message_format: The D-Bus error message in a printf() format.
14424  * @...: Arguments for @error_message_format.
14425  *
14426  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14427  *
14428  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14429  * Since: 2.26
14430  */
14431
14432
14433 /**
14434  * g_dbus_message_new_method_error_literal:
14435  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14436  * @error_name: A valid D-Bus error name.
14437  * @error_message: The D-Bus error message.
14438  *
14439  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14440  *
14441  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14442  * Since: 2.26
14443  */
14444
14445
14446 /**
14447  * g_dbus_message_new_method_error_valist:
14448  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14449  * @error_name: A valid D-Bus error name.
14450  * @error_message_format: The D-Bus error message in a printf() format.
14451  * @var_args: Arguments for @error_message_format.
14452  *
14453  * Like g_dbus_message_new_method_error() but intended for language bindings.
14454  *
14455  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14456  * Since: 2.26
14457  */
14458
14459
14460 /**
14461  * g_dbus_message_new_method_reply:
14462  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14463  *
14464  * Creates a new #GDBusMessage that is a reply to @method_call_message.
14465  *
14466  * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14467  * Since: 2.26
14468  */
14469
14470
14471 /**
14472  * g_dbus_message_new_signal:
14473  * @path: A valid object path.
14474  * @interface_: A valid D-Bus interface name.
14475  * @signal: A valid signal name.
14476  *
14477  * Creates a new #GDBusMessage for a signal emission.
14478  *
14479  * Returns: A #GDBusMessage. Free with g_object_unref().
14480  * Since: 2.26
14481  */
14482
14483
14484 /**
14485  * g_dbus_message_print:
14486  * @message: A #GDBusMessage.
14487  * @indent: Indentation level.
14488  *
14489  * Produces a human-readable multi-line description of @message.
14490  *
14491  * The contents of the description has no ABI guarantees, the contents
14492  * and formatting is subject to change at any time. Typical output
14493  * looks something like this:
14494  * <programlisting>
14495  * Type&colon;    method-call
14496  * Flags&colon;   none
14497  * Version&colon; 0
14498  * Serial&colon;  4
14499  * Headers&colon;
14500  *   path -> objectpath '/org/gtk/GDBus/TestObject'
14501  *   interface -> 'org.gtk.GDBus.TestInterface'
14502  *   member -> 'GimmeStdout'
14503  *   destination -> ':1.146'
14504  * Body&colon; ()
14505  * UNIX File Descriptors:
14506  *   (none)
14507  * </programlisting>
14508  * or
14509  * <programlisting>
14510  * Type&colon;    method-return
14511  * Flags&colon;   no-reply-expected
14512  * Version&colon; 0
14513  * Serial&colon;  477
14514  * Headers&colon;
14515  *   reply-serial -> uint32 4
14516  *   destination -> ':1.159'
14517  *   sender -> ':1.146'
14518  *   num-unix-fds -> uint32 1
14519  * Body&colon; ()
14520  * UNIX File Descriptors&colon;
14521  *   fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14522  * </programlisting>
14523  *
14524  * Returns: A string that should be freed with g_free().
14525  * Since: 2.26
14526  */
14527
14528
14529 /**
14530  * g_dbus_message_set_body:
14531  * @message: A #GDBusMessage.
14532  * @body: Either %NULL or a #GVariant that is a tuple.
14533  *
14534  * Sets the body @message. As a side-effect the
14535  * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14536  * type string of @body (or cleared if @body is %NULL).
14537  *
14538  * If @body is floating, @message assumes ownership of @body.
14539  *
14540  * Since: 2.26
14541  */
14542
14543
14544 /**
14545  * g_dbus_message_set_byte_order:
14546  * @message: A #GDBusMessage.
14547  * @byte_order: The byte order.
14548  *
14549  * Sets the byte order of @message.
14550  */
14551
14552
14553 /**
14554  * g_dbus_message_set_destination:
14555  * @message: A #GDBusMessage.
14556  * @value: The value to set.
14557  *
14558  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14559  *
14560  * Since: 2.26
14561  */
14562
14563
14564 /**
14565  * g_dbus_message_set_error_name:
14566  * @message: A #GDBusMessage.
14567  * @value: The value to set.
14568  *
14569  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14570  *
14571  * Since: 2.26
14572  */
14573
14574
14575 /**
14576  * g_dbus_message_set_flags:
14577  * @message: A #GDBusMessage.
14578  * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14579  *
14580  * Sets the flags to set on @message.
14581  *
14582  * Since: 2.26
14583  */
14584
14585
14586 /**
14587  * g_dbus_message_set_header:
14588  * @message: A #GDBusMessage.
14589  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14590  * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14591  *
14592  * Sets a header field on @message.
14593  *
14594  * If @value is floating, @message assumes ownership of @value.
14595  *
14596  * Since: 2.26
14597  */
14598
14599
14600 /**
14601  * g_dbus_message_set_interface:
14602  * @message: A #GDBusMessage.
14603  * @value: The value to set.
14604  *
14605  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14606  *
14607  * Since: 2.26
14608  */
14609
14610
14611 /**
14612  * g_dbus_message_set_member:
14613  * @message: A #GDBusMessage.
14614  * @value: The value to set.
14615  *
14616  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14617  *
14618  * Since: 2.26
14619  */
14620
14621
14622 /**
14623  * g_dbus_message_set_message_type:
14624  * @message: A #GDBusMessage.
14625  * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14626  *
14627  * Sets @message to be of @type.
14628  *
14629  * Since: 2.26
14630  */
14631
14632
14633 /**
14634  * g_dbus_message_set_num_unix_fds:
14635  * @message: A #GDBusMessage.
14636  * @value: The value to set.
14637  *
14638  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14639  *
14640  * Since: 2.26
14641  */
14642
14643
14644 /**
14645  * g_dbus_message_set_path:
14646  * @message: A #GDBusMessage.
14647  * @value: The value to set.
14648  *
14649  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14650  *
14651  * Since: 2.26
14652  */
14653
14654
14655 /**
14656  * g_dbus_message_set_reply_serial:
14657  * @message: A #GDBusMessage.
14658  * @value: The value to set.
14659  *
14660  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14661  *
14662  * Since: 2.26
14663  */
14664
14665
14666 /**
14667  * g_dbus_message_set_sender:
14668  * @message: A #GDBusMessage.
14669  * @value: The value to set.
14670  *
14671  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14672  *
14673  * Since: 2.26
14674  */
14675
14676
14677 /**
14678  * g_dbus_message_set_serial:
14679  * @message: A #GDBusMessage.
14680  * @serial: A #guint32.
14681  *
14682  * Sets the serial for @message.
14683  *
14684  * Since: 2.26
14685  */
14686
14687
14688 /**
14689  * g_dbus_message_set_signature:
14690  * @message: A #GDBusMessage.
14691  * @value: The value to set.
14692  *
14693  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14694  *
14695  * Since: 2.26
14696  */
14697
14698
14699 /**
14700  * g_dbus_message_set_unix_fd_list:
14701  * @message: A #GDBusMessage.
14702  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14703  *
14704  * Sets the UNIX file descriptors associated with @message. As a
14705  * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14706  * field is set to the number of fds in @fd_list (or cleared if
14707  * @fd_list is %NULL).
14708  *
14709  * This method is only available on UNIX.
14710  *
14711  * Since: 2.26
14712  */
14713
14714
14715 /**
14716  * g_dbus_message_to_blob:
14717  * @message: A #GDBusMessage.
14718  * @out_size: Return location for size of generated blob.
14719  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14720  * @error: Return location for error.
14721  *
14722  * Serializes @message to a blob. The byte order returned by
14723  * g_dbus_message_get_byte_order() will be used.
14724  *
14725  * Returns: (array length=out_size) (transfer full): A pointer to a valid binary D-Bus message of @out_size bytes generated by @message or %NULL if @error is set. Free with g_free().
14726  * Since: 2.26
14727  */
14728
14729
14730 /**
14731  * g_dbus_message_to_gerror:
14732  * @message: A #GDBusMessage.
14733  * @error: The #GError to set.
14734  *
14735  * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14736  * nothing and returns %FALSE.
14737  *
14738  * Otherwise this method encodes the error in @message as a #GError
14739  * using g_dbus_error_set_dbus_error() using the information in the
14740  * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14741  * well as the first string item in @message's body.
14742  *
14743  * Returns: %TRUE if @error was set, %FALSE otherwise.
14744  * Since: 2.26
14745  */
14746
14747
14748 /**
14749  * g_dbus_method_info_ref:
14750  * @info: A #GDBusMethodInfo
14751  *
14752  * If @info is statically allocated does nothing. Otherwise increases
14753  * the reference count.
14754  *
14755  * Returns: The same @info.
14756  * Since: 2.26
14757  */
14758
14759
14760 /**
14761  * g_dbus_method_info_unref:
14762  * @info: A #GDBusMethodInfo.
14763  *
14764  * If @info is statically allocated, does nothing. Otherwise decreases
14765  * the reference count of @info. When its reference count drops to 0,
14766  * the memory used is freed.
14767  *
14768  * Since: 2.26
14769  */
14770
14771
14772 /**
14773  * g_dbus_method_invocation_get_connection:
14774  * @invocation: A #GDBusMethodInvocation.
14775  *
14776  * Gets the #GDBusConnection the method was invoked on.
14777  *
14778  * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14779  * Since: 2.26
14780  */
14781
14782
14783 /**
14784  * g_dbus_method_invocation_get_interface_name:
14785  * @invocation: A #GDBusMethodInvocation.
14786  *
14787  * Gets the name of the D-Bus interface the method was invoked on.
14788  *
14789  * If this method call is a property Get, Set or GetAll call that has
14790  * been redirected to the method call handler then
14791  * "org.freedesktop.DBus.Properties" will be returned.  See
14792  * #GDBusInterfaceVTable for more information.
14793  *
14794  * Returns: A string. Do not free, it is owned by @invocation.
14795  * Since: 2.26
14796  */
14797
14798
14799 /**
14800  * g_dbus_method_invocation_get_message:
14801  * @invocation: A #GDBusMethodInvocation.
14802  *
14803  * Gets the #GDBusMessage for the method invocation. This is useful if
14804  * you need to use low-level protocol features, such as UNIX file
14805  * descriptor passing, that cannot be properly expressed in the
14806  * #GVariant API.
14807  *
14808  * See <xref linkend="gdbus-server"/> and <xref
14809  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14810  * low-level API to send and receive UNIX file descriptors.
14811  *
14812  * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
14813  * Since: 2.26
14814  */
14815
14816
14817 /**
14818  * g_dbus_method_invocation_get_method_info:
14819  * @invocation: A #GDBusMethodInvocation.
14820  *
14821  * Gets information about the method call, if any.
14822  *
14823  * If this method invocation is a property Get, Set or GetAll call that
14824  * has been redirected to the method call handler then %NULL will be
14825  * returned.  See g_dbus_method_invocation_get_property_info() and
14826  * #GDBusInterfaceVTable for more information.
14827  *
14828  * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
14829  * Since: 2.26
14830  */
14831
14832
14833 /**
14834  * g_dbus_method_invocation_get_method_name:
14835  * @invocation: A #GDBusMethodInvocation.
14836  *
14837  * Gets the name of the method that was invoked.
14838  *
14839  * Returns: A string. Do not free, it is owned by @invocation.
14840  * Since: 2.26
14841  */
14842
14843
14844 /**
14845  * g_dbus_method_invocation_get_object_path:
14846  * @invocation: A #GDBusMethodInvocation.
14847  *
14848  * Gets the object path the method was invoked on.
14849  *
14850  * Returns: A string. Do not free, it is owned by @invocation.
14851  * Since: 2.26
14852  */
14853
14854
14855 /**
14856  * g_dbus_method_invocation_get_parameters:
14857  * @invocation: A #GDBusMethodInvocation.
14858  *
14859  * Gets the parameters of the method invocation. If there are no input
14860  * parameters then this will return a GVariant with 0 children rather than NULL.
14861  *
14862  * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
14863  * Since: 2.26
14864  */
14865
14866
14867 /**
14868  * g_dbus_method_invocation_get_property_info:
14869  * @invocation: A #GDBusMethodInvocation
14870  *
14871  * Gets information about the property that this method call is for, if
14872  * any.
14873  *
14874  * This will only be set in the case of an invocation in response to a
14875  * property Get or Set call that has been directed to the method call
14876  * handler for an object on account of its property_get() or
14877  * property_set() vtable pointers being unset.
14878  *
14879  * See #GDBusInterfaceVTable for more information.
14880  *
14881  * If the call was GetAll, %NULL will be returned.
14882  *
14883  * Returns: (transfer none): a #GDBusPropertyInfo or %NULL
14884  * Since: 2.38
14885  */
14886
14887
14888 /**
14889  * g_dbus_method_invocation_get_sender:
14890  * @invocation: A #GDBusMethodInvocation.
14891  *
14892  * Gets the bus name that invoked the method.
14893  *
14894  * Returns: A string. Do not free, it is owned by @invocation.
14895  * Since: 2.26
14896  */
14897
14898
14899 /**
14900  * g_dbus_method_invocation_get_user_data: (skip)
14901  * @invocation: A #GDBusMethodInvocation.
14902  *
14903  * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
14904  *
14905  * Returns: A #gpointer.
14906  * Since: 2.26
14907  */
14908
14909
14910 /**
14911  * g_dbus_method_invocation_return_dbus_error:
14912  * @invocation: (transfer full): A #GDBusMethodInvocation.
14913  * @error_name: A valid D-Bus error name.
14914  * @error_message: A valid D-Bus error message.
14915  *
14916  * Finishes handling a D-Bus method call by returning an error.
14917  *
14918  * This method will free @invocation, you cannot use it afterwards.
14919  *
14920  * Since: 2.26
14921  */
14922
14923
14924 /**
14925  * g_dbus_method_invocation_return_error:
14926  * @invocation: (transfer full): A #GDBusMethodInvocation.
14927  * @domain: A #GQuark for the #GError error domain.
14928  * @code: The error code.
14929  * @format: printf()-style format.
14930  * @...: Parameters for @format.
14931  *
14932  * Finishes handling a D-Bus method call by returning an error.
14933  *
14934  * See g_dbus_error_encode_gerror() for details about what error name
14935  * will be returned on the wire. In a nutshell, if the given error is
14936  * registered using g_dbus_error_register_error() the name given
14937  * during registration is used. Otherwise, a name of the form
14938  * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
14939  * used. This provides transparent mapping of #GError between
14940  * applications using GDBus.
14941  *
14942  * If you are writing an application intended to be portable,
14943  * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
14944  * or use g_dbus_method_invocation_return_dbus_error().
14945  *
14946  * This method will free @invocation, you cannot use it afterwards.
14947  *
14948  * Since: 2.26
14949  */
14950
14951
14952 /**
14953  * g_dbus_method_invocation_return_error_literal:
14954  * @invocation: (transfer full): A #GDBusMethodInvocation.
14955  * @domain: A #GQuark for the #GError error domain.
14956  * @code: The error code.
14957  * @message: The error message.
14958  *
14959  * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
14960  *
14961  * This method will free @invocation, you cannot use it afterwards.
14962  *
14963  * Since: 2.26
14964  */
14965
14966
14967 /**
14968  * g_dbus_method_invocation_return_error_valist:
14969  * @invocation: (transfer full): A #GDBusMethodInvocation.
14970  * @domain: A #GQuark for the #GError error domain.
14971  * @code: The error code.
14972  * @format: printf()-style format.
14973  * @var_args: #va_list of parameters for @format.
14974  *
14975  * Like g_dbus_method_invocation_return_error() but intended for
14976  * language bindings.
14977  *
14978  * This method will free @invocation, you cannot use it afterwards.
14979  *
14980  * Since: 2.26
14981  */
14982
14983
14984 /**
14985  * g_dbus_method_invocation_return_gerror:
14986  * @invocation: (transfer full): A #GDBusMethodInvocation.
14987  * @error: A #GError.
14988  *
14989  * Like g_dbus_method_invocation_return_error() but takes a #GError
14990  * instead of the error domain, error code and message.
14991  *
14992  * This method will free @invocation, you cannot use it afterwards.
14993  *
14994  * Since: 2.26
14995  */
14996
14997
14998 /**
14999  * g_dbus_method_invocation_return_value:
15000  * @invocation: (transfer full): A #GDBusMethodInvocation.
15001  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15002  *
15003  * Finishes handling a D-Bus method call by returning @parameters.
15004  * If the @parameters GVariant is floating, it is consumed.
15005  *
15006  * It is an error if @parameters is not of the right format.
15007  *
15008  * This method will free @invocation, you cannot use it afterwards.
15009  *
15010  * Since: 2.26
15011  */
15012
15013
15014 /**
15015  * g_dbus_method_invocation_return_value_with_unix_fd_list:
15016  * @invocation: (transfer full): A #GDBusMethodInvocation.
15017  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15018  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15019  *
15020  * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15021  *
15022  * This method is only available on UNIX.
15023  *
15024  * This method will free @invocation, you cannot use it afterwards.
15025  *
15026  * Since: 2.30
15027  */
15028
15029
15030 /**
15031  * g_dbus_method_invocation_take_error: (skip)
15032  * @invocation: (transfer full): A #GDBusMethodInvocation.
15033  * @error: (transfer full): A #GError.
15034  *
15035  * Like g_dbus_method_invocation_return_gerror() but takes ownership
15036  * of @error so the caller does not need to free it.
15037  *
15038  * This method will free @invocation, you cannot use it afterwards.
15039  *
15040  * Since: 2.30
15041  */
15042
15043
15044 /**
15045  * g_dbus_node_info_generate_xml:
15046  * @info: A #GDBusNodeInfo.
15047  * @indent: Indentation level.
15048  * @string_builder: (out): A #GString to to append XML data to.
15049  *
15050  * Appends an XML representation of @info (and its children) to @string_builder.
15051  *
15052  * This function is typically used for generating introspection XML documents at run-time for
15053  * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15054  *
15055  * Since: 2.26
15056  */
15057
15058
15059 /**
15060  * g_dbus_node_info_lookup_interface:
15061  * @info: A #GDBusNodeInfo.
15062  * @name: A D-Bus interface name.
15063  *
15064  * Looks up information about an interface.
15065  *
15066  * The cost of this function is O(n) in number of interfaces.
15067  *
15068  * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15069  * Since: 2.26
15070  */
15071
15072
15073 /**
15074  * g_dbus_node_info_new_for_xml:
15075  * @xml_data: Valid D-Bus introspection XML.
15076  * @error: Return location for error.
15077  *
15078  * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15079  *
15080  * The introspection XML must contain exactly one top-level
15081  * <tag class="starttag">node</tag> element.
15082  *
15083  * Note that this routine is using a
15084  * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15085  * parser that only accepts a subset of valid XML documents.
15086  *
15087  * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15088  * Since: 2.26
15089  */
15090
15091
15092 /**
15093  * g_dbus_node_info_ref:
15094  * @info: A #GDBusNodeInfo
15095  *
15096  * If @info is statically allocated does nothing. Otherwise increases
15097  * the reference count.
15098  *
15099  * Returns: The same @info.
15100  * Since: 2.26
15101  */
15102
15103
15104 /**
15105  * g_dbus_node_info_unref:
15106  * @info: A #GDBusNodeInfo.
15107  *
15108  * If @info is statically allocated, does nothing. Otherwise decreases
15109  * the reference count of @info. When its reference count drops to 0,
15110  * the memory used is freed.
15111  *
15112  * Since: 2.26
15113  */
15114
15115
15116 /**
15117  * g_dbus_object_get_interface:
15118  * @object: A #GDBusObject.
15119  * @interface_name: A D-Bus interface name.
15120  *
15121  * Gets the D-Bus interface with name @interface_name associated with
15122  * @object, if any.
15123  *
15124  * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15125  * Since: 2.30
15126  */
15127
15128
15129 /**
15130  * g_dbus_object_get_interfaces:
15131  * @object: A #GDBusObject.
15132  *
15133  * Gets the D-Bus interfaces associated with @object.
15134  *
15135  * Returns: (element-type GDBusInterface) (transfer full): A list of #GDBusInterface instances. The returned list must be freed by g_list_free() after each element has been freed with g_object_unref().
15136  * Since: 2.30
15137  */
15138
15139
15140 /**
15141  * g_dbus_object_get_object_path:
15142  * @object: A #GDBusObject.
15143  *
15144  * Gets the object path for @object.
15145  *
15146  * Returns: A string owned by @object. Do not free.
15147  * Since: 2.30
15148  */
15149
15150
15151 /**
15152  * g_dbus_object_manager_client_get_connection:
15153  * @manager: A #GDBusObjectManagerClient
15154  *
15155  * Gets the #GDBusConnection used by @manager.
15156  *
15157  * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15158  * Since: 2.30
15159  */
15160
15161
15162 /**
15163  * g_dbus_object_manager_client_get_flags:
15164  * @manager: A #GDBusObjectManagerClient
15165  *
15166  * Gets the flags that @manager was constructed with.
15167  *
15168  * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15169  * Since: 2.30
15170  */
15171
15172
15173 /**
15174  * g_dbus_object_manager_client_get_name:
15175  * @manager: A #GDBusObjectManagerClient
15176  *
15177  * Gets the name that @manager is for, or %NULL if not a message bus
15178  * connection.
15179  *
15180  * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15181  * Since: 2.30
15182  */
15183
15184
15185 /**
15186  * g_dbus_object_manager_client_get_name_owner:
15187  * @manager: A #GDBusObjectManagerClient.
15188  *
15189  * The unique name that owns the name that @manager is for or %NULL if
15190  * no-one currently owns that name. You can connect to the
15191  * #GObject::notify signal to track changes to the
15192  * #GDBusObjectManagerClient:name-owner property.
15193  *
15194  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15195  * Since: 2.30
15196  */
15197
15198
15199 /**
15200  * g_dbus_object_manager_client_new:
15201  * @connection: A #GDBusConnection.
15202  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15203  * @name: The owner of the control object (unique or well-known name).
15204  * @object_path: The object path of the control object.
15205  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15206  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15207  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15208  * @cancellable: (allow-none): A #GCancellable or %NULL
15209  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15210  * @user_data: The data to pass to @callback.
15211  *
15212  * Asynchronously creates a new #GDBusObjectManagerClient object.
15213  *
15214  * This is an asynchronous failable constructor. When the result is
15215  * ready, @callback will be invoked in the
15216  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15217  * of the thread you are calling this method from. You can
15218  * then call g_dbus_object_manager_client_new_finish() to get the result. See
15219  * g_dbus_object_manager_client_new_sync() for the synchronous version.
15220  *
15221  * Since: 2.30
15222  */
15223
15224
15225 /**
15226  * g_dbus_object_manager_client_new_finish:
15227  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15228  * @error: Return location for error or %NULL.
15229  *
15230  * Finishes an operation started with g_dbus_object_manager_client_new().
15231  *
15232  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15233  * Since: 2.30
15234  */
15235
15236
15237 /**
15238  * g_dbus_object_manager_client_new_for_bus:
15239  * @bus_type: A #GBusType.
15240  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15241  * @name: The owner of the control object (unique or well-known name).
15242  * @object_path: The object path of the control object.
15243  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15244  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15245  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15246  * @cancellable: (allow-none): A #GCancellable or %NULL
15247  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15248  * @user_data: The data to pass to @callback.
15249  *
15250  * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15251  * #GDBusConnection.
15252  *
15253  * This is an asynchronous failable constructor. When the result is
15254  * ready, @callback will be invoked in the
15255  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15256  * of the thread you are calling this method from. You can
15257  * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15258  * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15259  *
15260  * Since: 2.30
15261  */
15262
15263
15264 /**
15265  * g_dbus_object_manager_client_new_for_bus_finish:
15266  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15267  * @error: Return location for error or %NULL.
15268  *
15269  * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15270  *
15271  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15272  * Since: 2.30
15273  */
15274
15275
15276 /**
15277  * g_dbus_object_manager_client_new_for_bus_sync:
15278  * @bus_type: A #GBusType.
15279  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15280  * @name: The owner of the control object (unique or well-known name).
15281  * @object_path: The object path of the control object.
15282  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15283  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15284  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15285  * @cancellable: (allow-none): A #GCancellable or %NULL
15286  * @error: Return location for error or %NULL.
15287  *
15288  * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15289  * of a #GDBusConnection.
15290  *
15291  * This is a synchronous failable constructor - the calling thread is
15292  * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15293  * for the asynchronous version.
15294  *
15295  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15296  * Since: 2.30
15297  */
15298
15299
15300 /**
15301  * g_dbus_object_manager_client_new_sync:
15302  * @connection: A #GDBusConnection.
15303  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15304  * @name: (allow-none): The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.
15305  * @object_path: The object path of the control object.
15306  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15307  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15308  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15309  * @cancellable: (allow-none): A #GCancellable or %NULL
15310  * @error: Return location for error or %NULL.
15311  *
15312  * Creates a new #GDBusObjectManagerClient object.
15313  *
15314  * This is a synchronous failable constructor - the calling thread is
15315  * blocked until a reply is received. See g_dbus_object_manager_client_new()
15316  * for the asynchronous version.
15317  *
15318  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15319  * Since: 2.30
15320  */
15321
15322
15323 /**
15324  * g_dbus_object_manager_get_interface:
15325  * @manager: A #GDBusObjectManager.
15326  * @object_path: Object path to lookup.
15327  * @interface_name: D-Bus interface name to lookup.
15328  *
15329  * Gets the interface proxy for @interface_name at @object_path, if
15330  * any.
15331  *
15332  * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15333  * Since: 2.30
15334  */
15335
15336
15337 /**
15338  * g_dbus_object_manager_get_object:
15339  * @manager: A #GDBusObjectManager.
15340  * @object_path: Object path to lookup.
15341  *
15342  * Gets the #GDBusObjectProxy at @object_path, if any.
15343  *
15344  * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15345  * Since: 2.30
15346  */
15347
15348
15349 /**
15350  * g_dbus_object_manager_get_object_path:
15351  * @manager: A #GDBusObjectManager.
15352  *
15353  * Gets the object path that @manager is for.
15354  *
15355  * Returns: A string owned by @manager. Do not free.
15356  * Since: 2.30
15357  */
15358
15359
15360 /**
15361  * g_dbus_object_manager_get_objects:
15362  * @manager: A #GDBusObjectManager.
15363  *
15364  * Gets all #GDBusObject objects known to @manager.
15365  *
15366  * Returns: (transfer full) (element-type GDBusObject): A list of #GDBusObject objects. The returned list should be freed with g_list_free() after each element has been freed with g_object_unref().
15367  * Since: 2.30
15368  */
15369
15370
15371 /**
15372  * g_dbus_object_manager_server_export:
15373  * @manager: A #GDBusObjectManagerServer.
15374  * @object: A #GDBusObjectSkeleton.
15375  *
15376  * Exports @object on @manager.
15377  *
15378  * If there is already a #GDBusObject exported at the object path,
15379  * then the old object is removed.
15380  *
15381  * The object path for @object must be in the hierarchy rooted by the
15382  * object path for @manager.
15383  *
15384  * Note that @manager will take a reference on @object for as long as
15385  * it is exported.
15386  *
15387  * Since: 2.30
15388  */
15389
15390
15391 /**
15392  * g_dbus_object_manager_server_export_uniquely:
15393  * @manager: A #GDBusObjectManagerServer.
15394  * @object: An object.
15395  *
15396  * Like g_dbus_object_manager_server_export() but appends a string of
15397  * the form <literal>_N</literal> (with N being a natural number) to
15398  * @object<!-- -->'s object path if an object with the given path
15399  * already exists. As such, the #GDBusObjectProxy:g-object-path property
15400  * of @object may be modified.
15401  *
15402  * Since: 2.30
15403  */
15404
15405
15406 /**
15407  * g_dbus_object_manager_server_get_connection:
15408  * @manager: A #GDBusObjectManagerServer
15409  *
15410  * Gets the #GDBusConnection used by @manager.
15411  *
15412  * Returns: (transfer full): A #GDBusConnection object or %NULL if @manager isn't exported on a connection. The returned object should be freed with g_object_unref().
15413  * Since: 2.30
15414  */
15415
15416
15417 /**
15418  * g_dbus_object_manager_server_is_exported:
15419  * @manager: A #GDBusObjectManagerServer.
15420  * @object: An object.
15421  *
15422  * Returns whether @object is currently exported on @manager.
15423  *
15424  * Returns: %TRUE if @object is exported
15425  * Since: 2.34
15426  */
15427
15428
15429 /**
15430  * g_dbus_object_manager_server_new:
15431  * @object_path: The object path to export the manager object at.
15432  *
15433  * Creates a new #GDBusObjectManagerServer object.
15434  *
15435  * The returned server isn't yet exported on any connection. To do so,
15436  * use g_dbus_object_manager_server_set_connection(). Normally you
15437  * want to export all of your objects before doing so to avoid <ulink
15438  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15439  * signals being emitted.
15440  *
15441  * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15442  * Since: 2.30
15443  */
15444
15445
15446 /**
15447  * g_dbus_object_manager_server_set_connection:
15448  * @manager: A #GDBusObjectManagerServer.
15449  * @connection: (allow-none): A #GDBusConnection or %NULL.
15450  *
15451  * Exports all objects managed by @manager on @connection. If
15452  * @connection is %NULL, stops exporting objects.
15453  */
15454
15455
15456 /**
15457  * g_dbus_object_manager_server_unexport:
15458  * @manager: A #GDBusObjectManagerServer.
15459  * @object_path: An object path.
15460  *
15461  * If @manager has an object at @path, removes the object. Otherwise
15462  * does nothing.
15463  *
15464  * Note that @object_path must be in the hierarchy rooted by the
15465  * object path for @manager.
15466  *
15467  * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15468  * Since: 2.30
15469  */
15470
15471
15472 /**
15473  * g_dbus_object_proxy_get_connection:
15474  * @proxy: a #GDBusObjectProxy
15475  *
15476  * Gets the connection that @proxy is for.
15477  *
15478  * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15479  * Since: 2.30
15480  */
15481
15482
15483 /**
15484  * g_dbus_object_proxy_new:
15485  * @connection: a #GDBusConnection
15486  * @object_path: the object path
15487  *
15488  * Creates a new #GDBusObjectProxy for the given connection and
15489  * object path.
15490  *
15491  * Returns: a new #GDBusObjectProxy
15492  * Since: 2.30
15493  */
15494
15495
15496 /**
15497  * g_dbus_object_skeleton_add_interface:
15498  * @object: A #GDBusObjectSkeleton.
15499  * @interface_: A #GDBusInterfaceSkeleton.
15500  *
15501  * Adds @interface_ to @object.
15502  *
15503  * If @object already contains a #GDBusInterfaceSkeleton with the same
15504  * interface name, it is removed before @interface_ is added.
15505  *
15506  * Note that @object takes its own reference on @interface_ and holds
15507  * it until removed.
15508  *
15509  * Since: 2.30
15510  */
15511
15512
15513 /**
15514  * g_dbus_object_skeleton_flush:
15515  * @object: A #GDBusObjectSkeleton.
15516  *
15517  * This method simply calls g_dbus_interface_skeleton_flush() on all
15518  * interfaces belonging to @object. See that method for when flushing
15519  * is useful.
15520  *
15521  * Since: 2.30
15522  */
15523
15524
15525 /**
15526  * g_dbus_object_skeleton_new:
15527  * @object_path: An object path.
15528  *
15529  * Creates a new #GDBusObjectSkeleton.
15530  *
15531  * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15532  * Since: 2.30
15533  */
15534
15535
15536 /**
15537  * g_dbus_object_skeleton_remove_interface:
15538  * @object: A #GDBusObjectSkeleton.
15539  * @interface_: A #GDBusInterfaceSkeleton.
15540  *
15541  * Removes @interface_ from @object.
15542  *
15543  * Since: 2.30
15544  */
15545
15546
15547 /**
15548  * g_dbus_object_skeleton_remove_interface_by_name:
15549  * @object: A #GDBusObjectSkeleton.
15550  * @interface_name: A D-Bus interface name.
15551  *
15552  * Removes the #GDBusInterface with @interface_name from @object.
15553  *
15554  * If no D-Bus interface of the given interface exists, this function
15555  * does nothing.
15556  *
15557  * Since: 2.30
15558  */
15559
15560
15561 /**
15562  * g_dbus_object_skeleton_set_object_path:
15563  * @object: A #GDBusObjectSkeleton.
15564  * @object_path: A valid D-Bus object path.
15565  *
15566  * Sets the object path for @object.
15567  *
15568  * Since: 2.30
15569  */
15570
15571
15572 /**
15573  * g_dbus_property_info_ref:
15574  * @info: A #GDBusPropertyInfo
15575  *
15576  * If @info is statically allocated does nothing. Otherwise increases
15577  * the reference count.
15578  *
15579  * Returns: The same @info.
15580  * Since: 2.26
15581  */
15582
15583
15584 /**
15585  * g_dbus_property_info_unref:
15586  * @info: A #GDBusPropertyInfo.
15587  *
15588  * If @info is statically allocated, does nothing. Otherwise decreases
15589  * the reference count of @info. When its reference count drops to 0,
15590  * the memory used is freed.
15591  *
15592  * Since: 2.26
15593  */
15594
15595
15596 /**
15597  * g_dbus_proxy_call:
15598  * @proxy: A #GDBusProxy.
15599  * @method_name: Name of method to invoke.
15600  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15601  * @flags: Flags from the #GDBusCallFlags enumeration.
15602  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15603  * @cancellable: (allow-none): A #GCancellable or %NULL.
15604  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
15605  * @user_data: The data to pass to @callback.
15606  *
15607  * Asynchronously invokes the @method_name method on @proxy.
15608  *
15609  * If @method_name contains any dots, then @name is split into interface and
15610  * method name parts. This allows using @proxy for invoking methods on
15611  * other interfaces.
15612  *
15613  * If the #GDBusConnection associated with @proxy is closed then
15614  * the operation will fail with %G_IO_ERROR_CLOSED. If
15615  * @cancellable is canceled, the operation will fail with
15616  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15617  * compatible with the D-Bus protocol, the operation fails with
15618  * %G_IO_ERROR_INVALID_ARGUMENT.
15619  *
15620  * If the @parameters #GVariant is floating, it is consumed. This allows
15621  * convenient 'inline' use of g_variant_new(), e.g.:
15622  * |[
15623  *  g_dbus_proxy_call (proxy,
15624  *                     "TwoStrings",
15625  *                     g_variant_new ("(ss)",
15626  *                                    "Thing One",
15627  *                                    "Thing Two"),
15628  *                     G_DBUS_CALL_FLAGS_NONE,
15629  *                     -1,
15630  *                     NULL,
15631  *                     (GAsyncReadyCallback) two_strings_done,
15632  *                     &amp;data);
15633  * ]|
15634  *
15635  * If @proxy has an expected interface (see
15636  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15637  * then the return value is checked against the return type.
15638  *
15639  * This is an asynchronous method. When the operation is finished,
15640  * @callback will be invoked in the
15641  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15642  * of the thread you are calling this method from.
15643  * You can then call g_dbus_proxy_call_finish() to get the result of
15644  * the operation. See g_dbus_proxy_call_sync() for the synchronous
15645  * version of this method.
15646  *
15647  * If @callback is %NULL then the D-Bus method call message will be sent with
15648  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15649  *
15650  * Since: 2.26
15651  */
15652
15653
15654 /**
15655  * g_dbus_proxy_call_finish:
15656  * @proxy: A #GDBusProxy.
15657  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15658  * @error: Return location for error or %NULL.
15659  *
15660  * Finishes an operation started with g_dbus_proxy_call().
15661  *
15662  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15663  * Since: 2.26
15664  */
15665
15666
15667 /**
15668  * g_dbus_proxy_call_sync:
15669  * @proxy: A #GDBusProxy.
15670  * @method_name: Name of method to invoke.
15671  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15672  * @flags: Flags from the #GDBusCallFlags enumeration.
15673  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15674  * @cancellable: (allow-none): A #GCancellable or %NULL.
15675  * @error: Return location for error or %NULL.
15676  *
15677  * Synchronously invokes the @method_name method on @proxy.
15678  *
15679  * If @method_name contains any dots, then @name is split into interface and
15680  * method name parts. This allows using @proxy for invoking methods on
15681  * other interfaces.
15682  *
15683  * If the #GDBusConnection associated with @proxy is disconnected then
15684  * the operation will fail with %G_IO_ERROR_CLOSED. If
15685  * @cancellable is canceled, the operation will fail with
15686  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15687  * compatible with the D-Bus protocol, the operation fails with
15688  * %G_IO_ERROR_INVALID_ARGUMENT.
15689  *
15690  * If the @parameters #GVariant is floating, it is consumed. This allows
15691  * convenient 'inline' use of g_variant_new(), e.g.:
15692  * |[
15693  *  g_dbus_proxy_call_sync (proxy,
15694  *                          "TwoStrings",
15695  *                          g_variant_new ("(ss)",
15696  *                                         "Thing One",
15697  *                                         "Thing Two"),
15698  *                          G_DBUS_CALL_FLAGS_NONE,
15699  *                          -1,
15700  *                          NULL,
15701  *                          &amp;error);
15702  * ]|
15703  *
15704  * The calling thread is blocked until a reply is received. See
15705  * g_dbus_proxy_call() for the asynchronous version of this
15706  * method.
15707  *
15708  * If @proxy has an expected interface (see
15709  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15710  * then the return value is checked against the return type.
15711  *
15712  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15713  * Since: 2.26
15714  */
15715
15716
15717 /**
15718  * g_dbus_proxy_call_with_unix_fd_list:
15719  * @proxy: A #GDBusProxy.
15720  * @method_name: Name of method to invoke.
15721  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15722  * @flags: Flags from the #GDBusCallFlags enumeration.
15723  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15724  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15725  * @cancellable: (allow-none): A #GCancellable or %NULL.
15726  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
15727  * @user_data: The data to pass to @callback.
15728  *
15729  * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15730  *
15731  * This method is only available on UNIX.
15732  *
15733  * Since: 2.30
15734  */
15735
15736
15737 /**
15738  * g_dbus_proxy_call_with_unix_fd_list_finish:
15739  * @proxy: A #GDBusProxy.
15740  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15741  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15742  * @error: Return location for error or %NULL.
15743  *
15744  * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15745  *
15746  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15747  * Since: 2.30
15748  */
15749
15750
15751 /**
15752  * g_dbus_proxy_call_with_unix_fd_list_sync:
15753  * @proxy: A #GDBusProxy.
15754  * @method_name: Name of method to invoke.
15755  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15756  * @flags: Flags from the #GDBusCallFlags enumeration.
15757  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15758  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15759  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15760  * @cancellable: (allow-none): A #GCancellable or %NULL.
15761  * @error: Return location for error or %NULL.
15762  *
15763  * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15764  *
15765  * This method is only available on UNIX.
15766  *
15767  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15768  * Since: 2.30
15769  */
15770
15771
15772 /**
15773  * g_dbus_proxy_get_cached_property:
15774  * @proxy: A #GDBusProxy.
15775  * @property_name: Property name.
15776  *
15777  * Looks up the value for a property from the cache. This call does no
15778  * blocking IO.
15779  *
15780  * If @proxy has an expected interface (see
15781  * #GDBusProxy:g-interface-info) and @property_name is referenced by
15782  * it, then @value is checked against the type of the property.
15783  *
15784  * Returns: A reference to the #GVariant instance that holds the value for @property_name or %NULL if the value is not in the cache. The returned reference must be freed with g_variant_unref().
15785  * Since: 2.26
15786  */
15787
15788
15789 /**
15790  * g_dbus_proxy_get_cached_property_names:
15791  * @proxy: A #GDBusProxy.
15792  *
15793  * Gets the names of all cached properties on @proxy.
15794  *
15795  * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15796  * Since: 2.26
15797  */
15798
15799
15800 /**
15801  * g_dbus_proxy_get_connection:
15802  * @proxy: A #GDBusProxy.
15803  *
15804  * Gets the connection @proxy is for.
15805  *
15806  * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15807  * Since: 2.26
15808  */
15809
15810
15811 /**
15812  * g_dbus_proxy_get_default_timeout:
15813  * @proxy: A #GDBusProxy.
15814  *
15815  * Gets the timeout to use if -1 (specifying default timeout) is
15816  * passed as @timeout_msec in the g_dbus_proxy_call() and
15817  * g_dbus_proxy_call_sync() functions.
15818  *
15819  * See the #GDBusProxy:g-default-timeout property for more details.
15820  *
15821  * Returns: Timeout to use for @proxy.
15822  * Since: 2.26
15823  */
15824
15825
15826 /**
15827  * g_dbus_proxy_get_flags:
15828  * @proxy: A #GDBusProxy.
15829  *
15830  * Gets the flags that @proxy was constructed with.
15831  *
15832  * Returns: Flags from the #GDBusProxyFlags enumeration.
15833  * Since: 2.26
15834  */
15835
15836
15837 /**
15838  * g_dbus_proxy_get_interface_info:
15839  * @proxy: A #GDBusProxy
15840  *
15841  * Returns the #GDBusInterfaceInfo, if any, specifying the interface
15842  * that @proxy conforms to. See the #GDBusProxy:g-interface-info
15843  * property for more details.
15844  *
15845  * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
15846  * Since: 2.26
15847  */
15848
15849
15850 /**
15851  * g_dbus_proxy_get_interface_name:
15852  * @proxy: A #GDBusProxy.
15853  *
15854  * Gets the D-Bus interface name @proxy is for.
15855  *
15856  * Returns: A string owned by @proxy. Do not free.
15857  * Since: 2.26
15858  */
15859
15860
15861 /**
15862  * g_dbus_proxy_get_name:
15863  * @proxy: A #GDBusProxy.
15864  *
15865  * Gets the name that @proxy was constructed for.
15866  *
15867  * Returns: A string owned by @proxy. Do not free.
15868  * Since: 2.26
15869  */
15870
15871
15872 /**
15873  * g_dbus_proxy_get_name_owner:
15874  * @proxy: A #GDBusProxy.
15875  *
15876  * The unique name that owns the name that @proxy is for or %NULL if
15877  * no-one currently owns that name. You may connect to the
15878  * #GObject::notify signal to track changes to the
15879  * #GDBusProxy:g-name-owner property.
15880  *
15881  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15882  * Since: 2.26
15883  */
15884
15885
15886 /**
15887  * g_dbus_proxy_get_object_path:
15888  * @proxy: A #GDBusProxy.
15889  *
15890  * Gets the object path @proxy is for.
15891  *
15892  * Returns: A string owned by @proxy. Do not free.
15893  * Since: 2.26
15894  */
15895
15896
15897 /**
15898  * g_dbus_proxy_new:
15899  * @connection: A #GDBusConnection.
15900  * @flags: Flags used when constructing the proxy.
15901  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15902  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15903  * @object_path: An object path.
15904  * @interface_name: A D-Bus interface name.
15905  * @cancellable: (allow-none): A #GCancellable or %NULL.
15906  * @callback: Callback function to invoke when the proxy is ready.
15907  * @user_data: User data to pass to @callback.
15908  *
15909  * Creates a proxy for accessing @interface_name on the remote object
15910  * at @object_path owned by @name at @connection and asynchronously
15911  * loads D-Bus properties unless the
15912  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
15913  * the #GDBusProxy::g-properties-changed signal to get notified about
15914  * property changes.
15915  *
15916  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
15917  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
15918  * to handle signals from the remote object.
15919  *
15920  * If @name is a well-known name and the
15921  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
15922  * owner currently exists, the message bus will be requested to launch
15923  * a name owner for the name.
15924  *
15925  * This is a failable asynchronous constructor - when the proxy is
15926  * ready, @callback will be invoked and you can use
15927  * g_dbus_proxy_new_finish() to get the result.
15928  *
15929  * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
15930  *
15931  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15932  *
15933  * Since: 2.26
15934  */
15935
15936
15937 /**
15938  * g_dbus_proxy_new_finish:
15939  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
15940  * @error: Return location for error or %NULL.
15941  *
15942  * Finishes creating a #GDBusProxy.
15943  *
15944  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15945  * Since: 2.26
15946  */
15947
15948
15949 /**
15950  * g_dbus_proxy_new_for_bus:
15951  * @bus_type: A #GBusType.
15952  * @flags: Flags used when constructing the proxy.
15953  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15954  * @name: A bus name (well-known or unique).
15955  * @object_path: An object path.
15956  * @interface_name: A D-Bus interface name.
15957  * @cancellable: (allow-none): A #GCancellable or %NULL.
15958  * @callback: Callback function to invoke when the proxy is ready.
15959  * @user_data: User data to pass to @callback.
15960  *
15961  * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
15962  *
15963  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15964  *
15965  * Since: 2.26
15966  */
15967
15968
15969 /**
15970  * g_dbus_proxy_new_for_bus_finish:
15971  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
15972  * @error: Return location for error or %NULL.
15973  *
15974  * Finishes creating a #GDBusProxy.
15975  *
15976  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15977  * Since: 2.26
15978  */
15979
15980
15981 /**
15982  * g_dbus_proxy_new_for_bus_sync:
15983  * @bus_type: A #GBusType.
15984  * @flags: Flags used when constructing the proxy.
15985  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15986  * @name: A bus name (well-known or unique).
15987  * @object_path: An object path.
15988  * @interface_name: A D-Bus interface name.
15989  * @cancellable: (allow-none): A #GCancellable or %NULL.
15990  * @error: Return location for error or %NULL.
15991  *
15992  * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
15993  *
15994  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15995  *
15996  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
15997  * Since: 2.26
15998  */
15999
16000
16001 /**
16002  * g_dbus_proxy_new_sync:
16003  * @connection: A #GDBusConnection.
16004  * @flags: Flags used when constructing the proxy.
16005  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16006  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16007  * @object_path: An object path.
16008  * @interface_name: A D-Bus interface name.
16009  * @cancellable: (allow-none): A #GCancellable or %NULL.
16010  * @error: (allow-none): Return location for error or %NULL.
16011  *
16012  * Creates a proxy for accessing @interface_name on the remote object
16013  * at @object_path owned by @name at @connection and synchronously
16014  * loads D-Bus properties unless the
16015  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16016  *
16017  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16018  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16019  * to handle signals from the remote object.
16020  *
16021  * If @name is a well-known name and the
16022  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16023  * owner currently exists, the message bus will be requested to launch
16024  * a name owner for the name.
16025  *
16026  * This is a synchronous failable constructor. See g_dbus_proxy_new()
16027  * and g_dbus_proxy_new_finish() for the asynchronous version.
16028  *
16029  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16030  *
16031  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16032  * Since: 2.26
16033  */
16034
16035
16036 /**
16037  * g_dbus_proxy_set_cached_property:
16038  * @proxy: A #GDBusProxy
16039  * @property_name: Property name.
16040  * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16041  *
16042  * If @value is not %NULL, sets the cached value for the property with
16043  * name @property_name to the value in @value.
16044  *
16045  * If @value is %NULL, then the cached value is removed from the
16046  * property cache.
16047  *
16048  * If @proxy has an expected interface (see
16049  * #GDBusProxy:g-interface-info) and @property_name is referenced by
16050  * it, then @value is checked against the type of the property.
16051  *
16052  * If the @value #GVariant is floating, it is consumed. This allows
16053  * convenient 'inline' use of g_variant_new(), e.g.
16054  * |[
16055  *  g_dbus_proxy_set_cached_property (proxy,
16056  *                                    "SomeProperty",
16057  *                                    g_variant_new ("(si)",
16058  *                                                  "A String",
16059  *                                                  42));
16060  * ]|
16061  *
16062  * Normally you will not need to use this method since @proxy is
16063  * tracking changes using the
16064  * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16065  * D-Bus signal. However, for performance reasons an object may decide
16066  * to not use this signal for some properties and instead use a
16067  * proprietary out-of-band mechanism to transmit changes.
16068  *
16069  * As a concrete example, consider an object with a property
16070  * <literal>ChatroomParticipants</literal> which is an array of
16071  * strings. Instead of transmitting the same (long) array every time
16072  * the property changes, it is more efficient to only transmit the
16073  * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16074  * name)</literal> and <literal>ChatroomParticipantParted(String
16075  * name)</literal>.
16076  *
16077  * Since: 2.26
16078  */
16079
16080
16081 /**
16082  * g_dbus_proxy_set_default_timeout:
16083  * @proxy: A #GDBusProxy.
16084  * @timeout_msec: Timeout in milliseconds.
16085  *
16086  * Sets the timeout to use if -1 (specifying default timeout) is
16087  * passed as @timeout_msec in the g_dbus_proxy_call() and
16088  * g_dbus_proxy_call_sync() functions.
16089  *
16090  * See the #GDBusProxy:g-default-timeout property for more details.
16091  *
16092  * Since: 2.26
16093  */
16094
16095
16096 /**
16097  * g_dbus_proxy_set_interface_info:
16098  * @proxy: A #GDBusProxy
16099  * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16100  *
16101  * Ensure that interactions with @proxy conform to the given
16102  * interface. See the #GDBusProxy:g-interface-info property for more
16103  * details.
16104  *
16105  * Since: 2.26
16106  */
16107
16108
16109 /**
16110  * g_dbus_server_get_client_address:
16111  * @server: A #GDBusServer.
16112  *
16113  * Gets a D-Bus address string that can be used by clients to connect
16114  * to @server.
16115  *
16116  * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16117  * Since: 2.26
16118  */
16119
16120
16121 /**
16122  * g_dbus_server_get_flags:
16123  * @server: A #GDBusServer.
16124  *
16125  * Gets the flags for @server.
16126  *
16127  * Returns: A set of flags from the #GDBusServerFlags enumeration.
16128  * Since: 2.26
16129  */
16130
16131
16132 /**
16133  * g_dbus_server_get_guid:
16134  * @server: A #GDBusServer.
16135  *
16136  * Gets the GUID for @server.
16137  *
16138  * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16139  * Since: 2.26
16140  */
16141
16142
16143 /**
16144  * g_dbus_server_is_active:
16145  * @server: A #GDBusServer.
16146  *
16147  * Gets whether @server is active.
16148  *
16149  * Returns: %TRUE if server is active, %FALSE otherwise.
16150  * Since: 2.26
16151  */
16152
16153
16154 /**
16155  * g_dbus_server_new_sync:
16156  * @address: A D-Bus address.
16157  * @flags: Flags from the #GDBusServerFlags enumeration.
16158  * @guid: A D-Bus GUID.
16159  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16160  * @cancellable: (allow-none): A #GCancellable or %NULL.
16161  * @error: Return location for server or %NULL.
16162  *
16163  * Creates a new D-Bus server that listens on the first address in
16164  * @address that works.
16165  *
16166  * Once constructed, you can use g_dbus_server_get_client_address() to
16167  * get a D-Bus address string that clients can use to connect.
16168  *
16169  * Connect to the #GDBusServer::new-connection signal to handle
16170  * incoming connections.
16171  *
16172  * The returned #GDBusServer isn't active - you have to start it with
16173  * g_dbus_server_start().
16174  *
16175  * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16176  * be used.
16177  *
16178  * This is a synchronous failable constructor. See
16179  * g_dbus_server_new() for the asynchronous version.
16180  *
16181  * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16182  * Since: 2.26
16183  */
16184
16185
16186 /**
16187  * g_dbus_server_start:
16188  * @server: A #GDBusServer.
16189  *
16190  * Starts @server.
16191  *
16192  * Since: 2.26
16193  */
16194
16195
16196 /**
16197  * g_dbus_server_stop:
16198  * @server: A #GDBusServer.
16199  *
16200  * Stops @server.
16201  *
16202  * Since: 2.26
16203  */
16204
16205
16206 /**
16207  * g_dbus_signal_info_ref:
16208  * @info: A #GDBusSignalInfo
16209  *
16210  * If @info is statically allocated does nothing. Otherwise increases
16211  * the reference count.
16212  *
16213  * Returns: The same @info.
16214  * Since: 2.26
16215  */
16216
16217
16218 /**
16219  * g_dbus_signal_info_unref:
16220  * @info: A #GDBusSignalInfo.
16221  *
16222  * If @info is statically allocated, does nothing. Otherwise decreases
16223  * the reference count of @info. When its reference count drops to 0,
16224  * the memory used is freed.
16225  *
16226  * Since: 2.26
16227  */
16228
16229
16230 /**
16231  * g_desktop_app_info_get_action_name:
16232  * @info: a #GDesktopAppInfo
16233  * @action_name: the name of the action as from g_desktop_app_info_list_actions()
16234  *
16235  * Gets the user-visible display name of the "additional application
16236  * action" specified by @action_name.
16237  *
16238  * This corresponds to the "Name" key within the keyfile group for the
16239  * action.
16240  *
16241  * Returns: (transfer full): the locale-specific action name
16242  * Since: 2.38
16243  */
16244
16245
16246 /**
16247  * g_desktop_app_info_get_boolean:
16248  * @info: a #GDesktopAppInfo
16249  * @key: the key to look up
16250  *
16251  * Looks up a boolean value in the keyfile backing @info.
16252  *
16253  * The @key is looked up in the "Desktop Entry" group.
16254  *
16255  * Returns: the boolean value, or %FALSE if the key is not found
16256  * Since: 2.36
16257  */
16258
16259
16260 /**
16261  * g_desktop_app_info_get_categories:
16262  * @info: a #GDesktopAppInfo
16263  *
16264  * Gets the categories from the desktop file.
16265  *
16266  * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16267  */
16268
16269
16270 /**
16271  * g_desktop_app_info_get_filename:
16272  * @info: a #GDesktopAppInfo
16273  *
16274  * When @info was created from a known filename, return it.  In some
16275  * situations such as the #GDesktopAppInfo returned from
16276  * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16277  *
16278  * Returns: The full path to the file for @info, or %NULL if not known.
16279  * Since: 2.24
16280  */
16281
16282
16283 /**
16284  * g_desktop_app_info_get_generic_name:
16285  * @info: a #GDesktopAppInfo
16286  *
16287  * Gets the generic name from the destkop file.
16288  *
16289  * Returns: The value of the GenericName key
16290  */
16291
16292
16293 /**
16294  * g_desktop_app_info_get_is_hidden:
16295  * @info: a #GDesktopAppInfo.
16296  *
16297  * A desktop file is hidden if the Hidden key in it is
16298  * set to True.
16299  *
16300  * Returns: %TRUE if hidden, %FALSE otherwise.
16301  */
16302
16303
16304 /**
16305  * g_desktop_app_info_get_keywords:
16306  * @info: a #GDesktopAppInfo
16307  *
16308  * Gets the keywords from the desktop file.
16309  *
16310  * Returns: (transfer none): The value of the Keywords key
16311  * Since: 2.32
16312  */
16313
16314
16315 /**
16316  * g_desktop_app_info_get_nodisplay:
16317  * @info: a #GDesktopAppInfo
16318  *
16319  * Gets the value of the NoDisplay key, which helps determine if the
16320  * application info should be shown in menus. See
16321  * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16322  *
16323  * Returns: The value of the NoDisplay key
16324  * Since: 2.30
16325  */
16326
16327
16328 /**
16329  * g_desktop_app_info_get_show_in:
16330  * @info: a #GDesktopAppInfo
16331  * @desktop_env: a string specifying a desktop name
16332  *
16333  * Checks if the application info should be shown in menus that list available
16334  * applications for a specific name of the desktop, based on the
16335  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16336  *
16337  * If @desktop_env is %NULL, then the name of the desktop set with
16338  * g_desktop_app_info_set_desktop_env() is used.
16339  *
16340  * Note that g_app_info_should_show() for @info will include this check (with
16341  * %NULL for @desktop_env) as well as additional checks.
16342  *
16343  * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16344  * Since: 2.30
16345  */
16346
16347
16348 /**
16349  * g_desktop_app_info_get_startup_wm_class:
16350  * @info: a #GDesktopAppInfo that supports startup notify
16351  *
16352  * Retrieves the StartupWMClass field from @info. This represents the
16353  * WM_CLASS property of the main window of the application, if launched
16354  * through @info.
16355  *
16356  * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16357  * Since: 2.34
16358  */
16359
16360
16361 /**
16362  * g_desktop_app_info_get_string:
16363  * @info: a #GDesktopAppInfo
16364  * @key: the key to look up
16365  *
16366  * Looks up a string value in the keyfile backing @info.
16367  *
16368  * The @key is looked up in the "Desktop Entry" group.
16369  *
16370  * Returns: a newly allocated string, or %NULL if the key is not found
16371  * Since: 2.36
16372  */
16373
16374
16375 /**
16376  * g_desktop_app_info_has_key:
16377  * @info: a #GDesktopAppInfo
16378  * @key: the key to look up
16379  *
16380  * Returns whether @key exists in the "Desktop Entry" group
16381  * of the keyfile backing @info.
16382  *
16383  * Returns: %TRUE if the @key exists
16384  * Since: 2.26
16385  */
16386
16387
16388 /**
16389  * g_desktop_app_info_launch_action:
16390  * @info: a #GDesktopAppInfo
16391  * @action_name: the name of the action as from g_desktop_app_info_list_actions()
16392  * @launch_context: (allow-none): a #GAppLaunchContext
16393  *
16394  * Activates the named application action.
16395  *
16396  * You may only call this function on action names that were
16397  * returned from g_desktop_app_info_list_actions().
16398  *
16399  * Note that if the main entry of the desktop file indicates that the
16400  * application supports startup notification, and @launch_context is
16401  * non-%NULL, then startup notification will be used when activating the
16402  * action (and as such, invocation of the action on the receiving side
16403  * must signal the end of startup notification when it is completed).
16404  * This is the expected behaviour of applications declaring additional
16405  * actions, as per the desktop file specification.
16406  *
16407  * As with g_app_info_launch() there is no way to detect failures that
16408  * occur while using this function.
16409  *
16410  * Since: 2.38
16411  */
16412
16413
16414 /**
16415  * g_desktop_app_info_launch_uris_as_manager:
16416  * @appinfo: a #GDesktopAppInfo
16417  * @uris: (element-type utf8): List of URIs
16418  * @launch_context: a #GAppLaunchContext
16419  * @spawn_flags: #GSpawnFlags, used for each process
16420  * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16421  * @user_setup_data: (closure user_setup): User data for @user_setup
16422  * @pid_callback: (scope call): Callback for child processes
16423  * @pid_callback_data: (closure pid_callback): User data for @callback
16424  * @error: return location for a #GError, or %NULL
16425  *
16426  * This function performs the equivalent of g_app_info_launch_uris(),
16427  * but is intended primarily for operating system components that
16428  * launch applications.  Ordinary applications should use
16429  * g_app_info_launch_uris().
16430  *
16431  * If the application is launched via traditional UNIX fork()/exec()
16432  * then @spawn_flags, @user_setup and @user_setup_data are used for the
16433  * call to g_spawn_async().  Additionally, @pid_callback (with
16434  * @pid_callback_data) will be called to inform about the PID of the
16435  * created process.
16436  *
16437  * If application launching occurs via some other mechanism (eg: D-Bus
16438  * activation) then @spawn_flags, @user_setup, @user_setup_data,
16439  * @pid_callback and @pid_callback_data are ignored.
16440  *
16441  * Returns: %TRUE on successful launch, %FALSE otherwise.
16442  */
16443
16444
16445 /**
16446  * g_desktop_app_info_list_actions:
16447  * @info: a #GDesktopAppInfo
16448  *
16449  * Returns the list of "additional application actions" supported on the
16450  * desktop file, as per the desktop file specification.
16451  *
16452  * As per the specification, this is the list of actions that are
16453  * explicitly listed in the "Actions" key of the [Desktop Entry] group.
16454  *
16455  * Returns: (array zero-terminated=1) (element-type utf8) (transfer none): a list of strings, always non-%NULL
16456  * Since: 2.38
16457  */
16458
16459
16460 /**
16461  * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16462  * @lookup: a #GDesktopAppInfoLookup
16463  * @uri_scheme: a string containing a URI scheme.
16464  *
16465  * Gets the default application for launching applications
16466  * using this URI scheme for a particular GDesktopAppInfoLookup
16467  * implementation.
16468  *
16469  * The GDesktopAppInfoLookup interface and this function is used
16470  * to implement g_app_info_get_default_for_uri_scheme() backends
16471  * in a GIO module. There is no reason for applications to use it
16472  * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16473  *
16474  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16475  * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16476  */
16477
16478
16479 /**
16480  * g_desktop_app_info_new:
16481  * @desktop_id: the desktop file id
16482  *
16483  * Creates a new #GDesktopAppInfo based on a desktop file id.
16484  *
16485  * A desktop file id is the basename of the desktop file, including the
16486  * .desktop extension. GIO is looking for a desktop file with this name
16487  * in the <filename>applications</filename> subdirectories of the XDG data
16488  * directories (i.e. the directories specified in the
16489  * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16490  * variables). GIO also supports the prefix-to-subdirectory mapping that is
16491  * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16492  * (i.e. a desktop id of kde-foo.desktop will match
16493  * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16494  *
16495  * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16496  */
16497
16498
16499 /**
16500  * g_desktop_app_info_new_from_filename:
16501  * @filename: the path of a desktop file, in the GLib filename encoding
16502  *
16503  * Creates a new #GDesktopAppInfo.
16504  *
16505  * Returns: a new #GDesktopAppInfo or %NULL on error.
16506  */
16507
16508
16509 /**
16510  * g_desktop_app_info_new_from_keyfile:
16511  * @key_file: an opened #GKeyFile
16512  *
16513  * Creates a new #GDesktopAppInfo.
16514  *
16515  * Returns: a new #GDesktopAppInfo or %NULL on error.
16516  * Since: 2.18
16517  */
16518
16519
16520 /**
16521  * g_desktop_app_info_set_desktop_env:
16522  * @desktop_env: a string specifying what desktop this is
16523  *
16524  * Sets the name of the desktop that the application is running in.
16525  * This is used by g_app_info_should_show() and
16526  * g_desktop_app_info_get_show_in() to evaluate the
16527  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16528  * desktop entry fields.
16529  *
16530  * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16531  * Menu specification</ulink> recognizes the following:
16532  * <simplelist>
16533  *   <member>GNOME</member>
16534  *   <member>KDE</member>
16535  *   <member>ROX</member>
16536  *   <member>XFCE</member>
16537  *   <member>LXDE</member>
16538  *   <member>Unity</member>
16539  *   <member>Old</member>
16540  * </simplelist>
16541  *
16542  * Should be called only once; subsequent calls are ignored.
16543  */
16544
16545
16546 /**
16547  * g_drive_can_eject:
16548  * @drive: a #GDrive.
16549  *
16550  * Checks if a drive can be ejected.
16551  *
16552  * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16553  */
16554
16555
16556 /**
16557  * g_drive_can_poll_for_media:
16558  * @drive: a #GDrive.
16559  *
16560  * Checks if a drive can be polled for media changes.
16561  *
16562  * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16563  */
16564
16565
16566 /**
16567  * g_drive_can_start:
16568  * @drive: a #GDrive.
16569  *
16570  * Checks if a drive can be started.
16571  *
16572  * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16573  * Since: 2.22
16574  */
16575
16576
16577 /**
16578  * g_drive_can_start_degraded:
16579  * @drive: a #GDrive.
16580  *
16581  * Checks if a drive can be started degraded.
16582  *
16583  * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16584  * Since: 2.22
16585  */
16586
16587
16588 /**
16589  * g_drive_can_stop:
16590  * @drive: a #GDrive.
16591  *
16592  * Checks if a drive can be stopped.
16593  *
16594  * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16595  * Since: 2.22
16596  */
16597
16598
16599 /**
16600  * g_drive_eject:
16601  * @drive: a #GDrive.
16602  * @flags: flags affecting the unmount if required for eject
16603  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16604  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16605  * @user_data: user data to pass to @callback
16606  *
16607  * Asynchronously ejects a drive.
16608  *
16609  * When the operation is finished, @callback will be called.
16610  * You can then call g_drive_eject_finish() to obtain the
16611  * result of the operation.
16612  *
16613  * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16614  */
16615
16616
16617 /**
16618  * g_drive_eject_finish:
16619  * @drive: a #GDrive.
16620  * @result: a #GAsyncResult.
16621  * @error: a #GError, or %NULL
16622  *
16623  * Finishes ejecting a drive.
16624  *
16625  * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16626  * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16627  */
16628
16629
16630 /**
16631  * g_drive_eject_with_operation:
16632  * @drive: a #GDrive.
16633  * @flags: flags affecting the unmount if required for eject
16634  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16635  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16636  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16637  * @user_data: user data passed to @callback.
16638  *
16639  * Ejects a drive. This is an asynchronous operation, and is
16640  * finished by calling g_drive_eject_with_operation_finish() with the @drive
16641  * and #GAsyncResult data returned in the @callback.
16642  *
16643  * Since: 2.22
16644  */
16645
16646
16647 /**
16648  * g_drive_eject_with_operation_finish:
16649  * @drive: a #GDrive.
16650  * @result: a #GAsyncResult.
16651  * @error: a #GError location to store the error occurring, or %NULL to ignore.
16652  *
16653  * Finishes ejecting a drive. If any errors occurred during the operation,
16654  * @error will be set to contain the errors and %FALSE will be returned.
16655  *
16656  * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16657  * Since: 2.22
16658  */
16659
16660
16661 /**
16662  * g_drive_enumerate_identifiers:
16663  * @drive: a #GDrive
16664  *
16665  * Gets the kinds of identifiers that @drive has.
16666  * Use g_drive_get_identifier() to obtain the identifiers
16667  * themselves.
16668  *
16669  * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16670  */
16671
16672
16673 /**
16674  * g_drive_get_icon:
16675  * @drive: a #GDrive.
16676  *
16677  * Gets the icon for @drive.
16678  *
16679  * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16680  */
16681
16682
16683 /**
16684  * g_drive_get_identifier:
16685  * @drive: a #GDrive
16686  * @kind: the kind of identifier to return
16687  *
16688  * Gets the identifier of the given kind for @drive.
16689  *
16690  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16691  */
16692
16693
16694 /**
16695  * g_drive_get_name:
16696  * @drive: a #GDrive.
16697  *
16698  * Gets the name of @drive.
16699  *
16700  * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16701  */
16702
16703
16704 /**
16705  * g_drive_get_sort_key:
16706  * @drive: A #GDrive.
16707  *
16708  * Gets the sort key for @drive, if any.
16709  *
16710  * Returns: Sorting key for @drive or %NULL if no such key is available.
16711  * Since: 2.32
16712  */
16713
16714
16715 /**
16716  * g_drive_get_start_stop_type:
16717  * @drive: a #GDrive.
16718  *
16719  * Gets a hint about how a drive can be started/stopped.
16720  *
16721  * Returns: A value from the #GDriveStartStopType enumeration.
16722  * Since: 2.22
16723  */
16724
16725
16726 /**
16727  * g_drive_get_symbolic_icon:
16728  * @drive: a #GDrive.
16729  *
16730  * Gets the icon for @drive.
16731  *
16732  * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16733  * Since: 2.34
16734  */
16735
16736
16737 /**
16738  * g_drive_get_volumes:
16739  * @drive: a #GDrive.
16740  *
16741  * Get a list of mountable volumes for @drive.
16742  *
16743  * The returned list should be freed with g_list_free(), after
16744  * its elements have been unreffed with g_object_unref().
16745  *
16746  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16747  */
16748
16749
16750 /**
16751  * g_drive_has_media:
16752  * @drive: a #GDrive.
16753  *
16754  * Checks if the @drive has media. Note that the OS may not be polling
16755  * the drive for media changes; see g_drive_is_media_check_automatic()
16756  * for more details.
16757  *
16758  * Returns: %TRUE if @drive has media, %FALSE otherwise.
16759  */
16760
16761
16762 /**
16763  * g_drive_has_volumes:
16764  * @drive: a #GDrive.
16765  *
16766  * Check if @drive has any mountable volumes.
16767  *
16768  * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16769  */
16770
16771
16772 /**
16773  * g_drive_is_media_check_automatic:
16774  * @drive: a #GDrive.
16775  *
16776  * Checks if @drive is capabable of automatically detecting media changes.
16777  *
16778  * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16779  */
16780
16781
16782 /**
16783  * g_drive_is_media_removable:
16784  * @drive: a #GDrive.
16785  *
16786  * Checks if the @drive supports removable media.
16787  *
16788  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16789  */
16790
16791
16792 /**
16793  * g_drive_poll_for_media:
16794  * @drive: a #GDrive.
16795  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16796  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16797  * @user_data: user data to pass to @callback
16798  *
16799  * Asynchronously polls @drive to see if media has been inserted or removed.
16800  *
16801  * When the operation is finished, @callback will be called.
16802  * You can then call g_drive_poll_for_media_finish() to obtain the
16803  * result of the operation.
16804  */
16805
16806
16807 /**
16808  * g_drive_poll_for_media_finish:
16809  * @drive: a #GDrive.
16810  * @result: a #GAsyncResult.
16811  * @error: a #GError, or %NULL
16812  *
16813  * Finishes an operation started with g_drive_poll_for_media() on a drive.
16814  *
16815  * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16816  */
16817
16818
16819 /**
16820  * g_drive_start:
16821  * @drive: a #GDrive.
16822  * @flags: flags affecting the start operation.
16823  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16824  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16825  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16826  * @user_data: user data to pass to @callback
16827  *
16828  * Asynchronously starts a drive.
16829  *
16830  * When the operation is finished, @callback will be called.
16831  * You can then call g_drive_start_finish() to obtain the
16832  * result of the operation.
16833  *
16834  * Since: 2.22
16835  */
16836
16837
16838 /**
16839  * g_drive_start_finish:
16840  * @drive: a #GDrive.
16841  * @result: a #GAsyncResult.
16842  * @error: a #GError, or %NULL
16843  *
16844  * Finishes starting a drive.
16845  *
16846  * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16847  * Since: 2.22
16848  */
16849
16850
16851 /**
16852  * g_drive_stop:
16853  * @drive: a #GDrive.
16854  * @flags: flags affecting the unmount if required for stopping.
16855  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16856  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16857  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16858  * @user_data: user data to pass to @callback
16859  *
16860  * Asynchronously stops a drive.
16861  *
16862  * When the operation is finished, @callback will be called.
16863  * You can then call g_drive_stop_finish() to obtain the
16864  * result of the operation.
16865  *
16866  * Since: 2.22
16867  */
16868
16869
16870 /**
16871  * g_drive_stop_finish:
16872  * @drive: a #GDrive.
16873  * @result: a #GAsyncResult.
16874  * @error: a #GError, or %NULL
16875  *
16876  * Finishes stopping a drive.
16877  *
16878  * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16879  * Since: 2.22
16880  */
16881
16882
16883 /**
16884  * g_emblem_get_icon:
16885  * @emblem: a #GEmblem from which the icon should be extracted.
16886  *
16887  * Gives back the icon from @emblem.
16888  *
16889  * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16890  * Since: 2.18
16891  */
16892
16893
16894 /**
16895  * g_emblem_get_origin:
16896  * @emblem: a #GEmblem
16897  *
16898  * Gets the origin of the emblem.
16899  *
16900  * Returns: (transfer none): the origin of the emblem
16901  * Since: 2.18
16902  */
16903
16904
16905 /**
16906  * g_emblem_new:
16907  * @icon: a GIcon containing the icon.
16908  *
16909  * Creates a new emblem for @icon.
16910  *
16911  * Returns: a new #GEmblem.
16912  * Since: 2.18
16913  */
16914
16915
16916 /**
16917  * g_emblem_new_with_origin:
16918  * @icon: a GIcon containing the icon.
16919  * @origin: a GEmblemOrigin enum defining the emblem's origin
16920  *
16921  * Creates a new emblem for @icon.
16922  *
16923  * Returns: a new #GEmblem.
16924  * Since: 2.18
16925  */
16926
16927
16928 /**
16929  * g_emblemed_icon_add_emblem:
16930  * @emblemed: a #GEmblemedIcon
16931  * @emblem: a #GEmblem
16932  *
16933  * Adds @emblem to the #GList of #GEmblem <!-- -->s.
16934  *
16935  * Since: 2.18
16936  */
16937
16938
16939 /**
16940  * g_emblemed_icon_clear_emblems:
16941  * @emblemed: a #GEmblemedIcon
16942  *
16943  * Removes all the emblems from @icon.
16944  *
16945  * Since: 2.28
16946  */
16947
16948
16949 /**
16950  * g_emblemed_icon_get_emblems:
16951  * @emblemed: a #GEmblemedIcon
16952  *
16953  * Gets the list of emblems for the @icon.
16954  *
16955  * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
16956  * Since: 2.18
16957  */
16958
16959
16960 /**
16961  * g_emblemed_icon_get_icon:
16962  * @emblemed: a #GEmblemedIcon
16963  *
16964  * Gets the main icon for @emblemed.
16965  *
16966  * Returns: (transfer none): a #GIcon that is owned by @emblemed
16967  * Since: 2.18
16968  */
16969
16970
16971 /**
16972  * g_emblemed_icon_new:
16973  * @icon: a #GIcon
16974  * @emblem: (allow-none): a #GEmblem, or %NULL
16975  *
16976  * Creates a new emblemed icon for @icon with the emblem @emblem.
16977  *
16978  * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
16979  * Since: 2.18
16980  */
16981
16982
16983 /**
16984  * g_file_append_to:
16985  * @file: input #GFile
16986  * @flags: a set of #GFileCreateFlags
16987  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16988  * @error: a #GError, or %NULL
16989  *
16990  * Gets an output stream for appending data to the file.
16991  * If the file doesn't already exist it is created.
16992  *
16993  * By default files created are generally readable by everyone,
16994  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16995  * will be made readable only to the current user, to the level that
16996  * is supported on the target filesystem.
16997  *
16998  * If @cancellable is not %NULL, then the operation can be cancelled
16999  * by triggering the cancellable object from another thread. If the
17000  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17001  * returned.
17002  *
17003  * Some file systems don't allow all file names, and may return an
17004  * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17005  * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17006  * possible too, and depend on what kind of filesystem the file is on.
17007  *
17008  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17009  */
17010
17011
17012 /**
17013  * g_file_append_to_async:
17014  * @file: input #GFile
17015  * @flags: a set of #GFileCreateFlags
17016  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17017  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17018  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17019  * @user_data: (closure): the data to pass to callback function
17020  *
17021  * Asynchronously opens @file for appending.
17022  *
17023  * For more details, see g_file_append_to() which is
17024  * the synchronous version of this call.
17025  *
17026  * When the operation is finished, @callback will be called.
17027  * You can then call g_file_append_to_finish() to get the result
17028  * of the operation.
17029  */
17030
17031
17032 /**
17033  * g_file_append_to_finish:
17034  * @file: input #GFile
17035  * @res: #GAsyncResult
17036  * @error: a #GError, or %NULL
17037  *
17038  * Finishes an asynchronous file append operation started with
17039  * g_file_append_to_async().
17040  *
17041  * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17042  */
17043
17044
17045 /**
17046  * g_file_attribute_info_list_add:
17047  * @list: a #GFileAttributeInfoList.
17048  * @name: the name of the attribute to add.
17049  * @type: the #GFileAttributeType for the attribute.
17050  * @flags: #GFileAttributeInfoFlags for the attribute.
17051  *
17052  * Adds a new attribute with @name to the @list, setting
17053  * its @type and @flags.
17054  */
17055
17056
17057 /**
17058  * g_file_attribute_info_list_dup:
17059  * @list: a #GFileAttributeInfoList to duplicate.
17060  *
17061  * Makes a duplicate of a file attribute info list.
17062  *
17063  * Returns: a copy of the given @list.
17064  */
17065
17066
17067 /**
17068  * g_file_attribute_info_list_lookup:
17069  * @list: a #GFileAttributeInfoList.
17070  * @name: the name of the attribute to lookup.
17071  *
17072  * Gets the file attribute with the name @name from @list.
17073  *
17074  * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17075  */
17076
17077
17078 /**
17079  * g_file_attribute_info_list_new:
17080  *
17081  * Creates a new file attribute info list.
17082  *
17083  * Returns: a #GFileAttributeInfoList.
17084  */
17085
17086
17087 /**
17088  * g_file_attribute_info_list_ref:
17089  * @list: a #GFileAttributeInfoList to reference.
17090  *
17091  * References a file attribute info list.
17092  *
17093  * Returns: #GFileAttributeInfoList or %NULL on error.
17094  */
17095
17096
17097 /**
17098  * g_file_attribute_info_list_unref:
17099  * @list: The #GFileAttributeInfoList to unreference.
17100  *
17101  * Removes a reference from the given @list. If the reference count
17102  * falls to zero, the @list is deleted.
17103  */
17104
17105
17106 /**
17107  * g_file_attribute_matcher_enumerate_namespace:
17108  * @matcher: a #GFileAttributeMatcher.
17109  * @ns: a string containing a file attribute namespace.
17110  *
17111  * Checks if the matcher will match all of the keys in a given namespace.
17112  * This will always return %TRUE if a wildcard character is in use (e.g. if
17113  * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17114  * using "*" and namespace is anything.)
17115  *
17116  * TODO: this is awkwardly worded.
17117  *
17118  * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17119  */
17120
17121
17122 /**
17123  * g_file_attribute_matcher_enumerate_next:
17124  * @matcher: a #GFileAttributeMatcher.
17125  *
17126  * Gets the next matched attribute from a #GFileAttributeMatcher.
17127  *
17128  * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17129  */
17130
17131
17132 /**
17133  * g_file_attribute_matcher_matches:
17134  * @matcher: a #GFileAttributeMatcher.
17135  * @attribute: a file attribute key.
17136  *
17137  * Checks if an attribute will be matched by an attribute matcher. If
17138  * the matcher was created with the "*" matching string, this function
17139  * will always return %TRUE.
17140  *
17141  * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17142  */
17143
17144
17145 /**
17146  * g_file_attribute_matcher_matches_only:
17147  * @matcher: a #GFileAttributeMatcher.
17148  * @attribute: a file attribute key.
17149  *
17150  * Checks if a attribute matcher only matches a given attribute. Always
17151  * returns %FALSE if "*" was used when creating the matcher.
17152  *
17153  * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17154  */
17155
17156
17157 /**
17158  * g_file_attribute_matcher_new:
17159  * @attributes: an attribute string to match.
17160  *
17161  * Creates a new file attribute matcher, which matches attributes
17162  * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17163  * counted structures, and are created with a reference count of 1. If
17164  * the number of references falls to 0, the #GFileAttributeMatcher is
17165  * automatically destroyed.
17166  *
17167  * The @attribute string should be formatted with specific keys separated
17168  * from namespaces with a double colon. Several "namespace::key" strings may be
17169  * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17170  * The wildcard "*" may be used to match all keys and namespaces, or
17171  * "namespace::*" will match all keys in a given namespace.
17172  *
17173  * Examples of strings to use:
17174  * <table>
17175  * <title>File Attribute Matcher strings and results</title>
17176  * <tgroup cols='2' align='left'><thead>
17177  * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17178  * <tbody>
17179  * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17180  * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17181  * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17182  * all keys in the unix namespace.</entry></row>
17183  * </tbody></tgroup>
17184  * </table>
17185  *
17186  * Returns: a #GFileAttributeMatcher.
17187  */
17188
17189
17190 /**
17191  * g_file_attribute_matcher_ref:
17192  * @matcher: a #GFileAttributeMatcher.
17193  *
17194  * References a file attribute matcher.
17195  *
17196  * Returns: a #GFileAttributeMatcher.
17197  */
17198
17199
17200 /**
17201  * g_file_attribute_matcher_subtract:
17202  * @matcher: Matcher to subtract from
17203  * @subtract: The matcher to subtract
17204  *
17205  * Subtracts all attributes of @subtract from @matcher and returns
17206  * a matcher that supports those attributes.
17207  *
17208  * Note that currently it is not possible to remove a single
17209  * attribute when the @matcher matches the whole namespace - or remove
17210  * a namespace or attribute when the matcher matches everything. This
17211  * is a limitation of the current implementation, but may be fixed
17212  * in the future.
17213  *
17214  * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17215  */
17216
17217
17218 /**
17219  * g_file_attribute_matcher_to_string:
17220  * @matcher: (allow-none): a #GFileAttributeMatcher.
17221  *
17222  * Prints what the matcher is matching against. The format will be
17223  * equal to the format passed to g_file_attribute_matcher_new().
17224  * The output however, might not be identical, as the matcher may
17225  * decide to use a different order or omit needless parts.
17226  *
17227  * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17228  * Since: 2.32
17229  */
17230
17231
17232 /**
17233  * g_file_attribute_matcher_unref:
17234  * @matcher: a #GFileAttributeMatcher.
17235  *
17236  * Unreferences @matcher. If the reference count falls below 1,
17237  * the @matcher is automatically freed.
17238  */
17239
17240
17241 /**
17242  * g_file_copy:
17243  * @source: input #GFile
17244  * @destination: destination #GFile
17245  * @flags: set of #GFileCopyFlags
17246  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17247  * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17248  * @progress_callback_data: (closure): user data to pass to @progress_callback
17249  * @error: #GError to set on error, or %NULL
17250  *
17251  * Copies the file @source to the location specified by @destination.
17252  * Can not handle recursive copies of directories.
17253  *
17254  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17255  * existing @destination file is overwritten.
17256  *
17257  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17258  * will be copied as symlinks, otherwise the target of the
17259  * @source symlink will be copied.
17260  *
17261  * If @cancellable is not %NULL, then the operation can be cancelled by
17262  * triggering the cancellable object from another thread. If the operation
17263  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17264  *
17265  * If @progress_callback is not %NULL, then the operation can be monitored
17266  * by setting this to a #GFileProgressCallback function.
17267  * @progress_callback_data will be passed to this function. It is guaranteed
17268  * that this callback will be called after all data has been transferred with
17269  * the total number of bytes copied during the operation.
17270  *
17271  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17272  * is returned, independent on the status of the @destination.
17273  *
17274  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17275  * the error %G_IO_ERROR_EXISTS is returned.
17276  *
17277  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17278  * error is returned. If trying to overwrite a directory with a directory the
17279  * %G_IO_ERROR_WOULD_MERGE error is returned.
17280  *
17281  * If the source is a directory and the target does not exist, or
17282  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17283  * %G_IO_ERROR_WOULD_RECURSE error is returned.
17284  *
17285  * If you are interested in copying the #GFile object itself (not the on-disk
17286  * file), see g_file_dup().
17287  *
17288  * Returns: %TRUE on success, %FALSE otherwise.
17289  */
17290
17291
17292 /**
17293  * g_file_copy_async: (skip)
17294  * @source: input #GFile
17295  * @destination: destination #GFile
17296  * @flags: set of #GFileCopyFlags
17297  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17298  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17299  * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17300  * @progress_callback_data: (closure): user data to pass to @progress_callback
17301  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17302  * @user_data: the data to pass to callback function
17303  *
17304  * Copies the file @source to the location specified by @destination
17305  * asynchronously. For details of the behaviour, see g_file_copy().
17306  *
17307  * If @progress_callback is not %NULL, then that function that will be called
17308  * just like in g_file_copy(), however the callback will run in the main loop,
17309  * not in the thread that is doing the I/O operation.
17310  *
17311  * When the operation is finished, @callback will be called. You can then call
17312  * g_file_copy_finish() to get the result of the operation.
17313  */
17314
17315
17316 /**
17317  * g_file_copy_attributes:
17318  * @source: a #GFile with attributes
17319  * @destination: a #GFile to copy attributes to
17320  * @flags: a set of #GFileCopyFlags
17321  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17322  * @error: a #GError, %NULL to ignore
17323  *
17324  * Copies the file attributes from @source to @destination.
17325  *
17326  * Normally only a subset of the file attributes are copied,
17327  * those that are copies in a normal file copy operation
17328  * (which for instance does not include e.g. owner). However
17329  * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17330  * all the metadata that is possible to copy is copied. This
17331  * is useful when implementing move by copy + delete source.
17332  *
17333  * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17334  */
17335
17336
17337 /**
17338  * g_file_copy_finish:
17339  * @file: input #GFile
17340  * @res: a #GAsyncResult
17341  * @error: a #GError, or %NULL
17342  *
17343  * Finishes copying the file started with g_file_copy_async().
17344  *
17345  * Returns: a %TRUE on success, %FALSE on error.
17346  */
17347
17348
17349 /**
17350  * g_file_create:
17351  * @file: input #GFile
17352  * @flags: a set of #GFileCreateFlags
17353  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17354  * @error: a #GError, or %NULL
17355  *
17356  * Creates a new file and returns an output stream for writing to it.
17357  * The file must not already exist.
17358  *
17359  * By default files created are generally readable by everyone,
17360  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17361  * will be made readable only to the current user, to the level
17362  * that is supported on the target filesystem.
17363  *
17364  * If @cancellable is not %NULL, then the operation can be cancelled
17365  * by triggering the cancellable object from another thread. If the
17366  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17367  * returned.
17368  *
17369  * If a file or directory with this name already exists the
17370  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17371  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17372  * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
17373  * be returned. Other errors are possible too, and depend on what kind
17374  * of filesystem the file is on.
17375  *
17376  * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17377  */
17378
17379
17380 /**
17381  * g_file_create_async:
17382  * @file: input #GFile
17383  * @flags: a set of #GFileCreateFlags
17384  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17385  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17386  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17387  * @user_data: (closure): the data to pass to callback function
17388  *
17389  * Asynchronously creates a new file and returns an output stream
17390  * for writing to it. The file must not already exist.
17391  *
17392  * For more details, see g_file_create() which is
17393  * the synchronous version of this call.
17394  *
17395  * When the operation is finished, @callback will be called.
17396  * You can then call g_file_create_finish() to get the result
17397  * of the operation.
17398  */
17399
17400
17401 /**
17402  * g_file_create_finish:
17403  * @file: input #GFile
17404  * @res: a #GAsyncResult
17405  * @error: a #GError, or %NULL
17406  *
17407  * Finishes an asynchronous file create operation started with
17408  * g_file_create_async().
17409  *
17410  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17411  */
17412
17413
17414 /**
17415  * g_file_create_readwrite:
17416  * @file: a #GFile
17417  * @flags: a set of #GFileCreateFlags
17418  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17419  * @error: return location for a #GError, or %NULL
17420  *
17421  * Creates a new file and returns a stream for reading and
17422  * writing to it. The file must not already exist.
17423  *
17424  * By default files created are generally readable by everyone,
17425  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17426  * will be made readable only to the current user, to the level
17427  * that is supported on the target filesystem.
17428  *
17429  * If @cancellable is not %NULL, then the operation can be cancelled
17430  * by triggering the cancellable object from another thread. If the
17431  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17432  * returned.
17433  *
17434  * If a file or directory with this name already exists, the
17435  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17436  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17437  * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
17438  * will be returned. Other errors are possible too, and depend on what
17439  * kind of filesystem the file is on.
17440  *
17441  * Note that in many non-local file cases read and write streams are
17442  * not supported, so make sure you really need to do read and write
17443  * streaming, rather than just opening for reading or writing.
17444  *
17445  * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17446  * Since: 2.22
17447  */
17448
17449
17450 /**
17451  * g_file_create_readwrite_async:
17452  * @file: input #GFile
17453  * @flags: a set of #GFileCreateFlags
17454  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17455  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17456  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17457  * @user_data: (closure): the data to pass to callback function
17458  *
17459  * Asynchronously creates a new file and returns a stream
17460  * for reading and writing to it. The file must not already exist.
17461  *
17462  * For more details, see g_file_create_readwrite() which is
17463  * the synchronous version of this call.
17464  *
17465  * When the operation is finished, @callback will be called.
17466  * You can then call g_file_create_readwrite_finish() to get
17467  * the result of the operation.
17468  *
17469  * Since: 2.22
17470  */
17471
17472
17473 /**
17474  * g_file_create_readwrite_finish:
17475  * @file: input #GFile
17476  * @res: a #GAsyncResult
17477  * @error: a #GError, or %NULL
17478  *
17479  * Finishes an asynchronous file create operation started with
17480  * g_file_create_readwrite_async().
17481  *
17482  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17483  * Since: 2.22
17484  */
17485
17486
17487 /**
17488  * g_file_delete:
17489  * @file: input #GFile
17490  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17491  * @error: a #GError, or %NULL
17492  *
17493  * Deletes a file. If the @file is a directory, it will only be
17494  * deleted if it is empty. This has the same semantics as g_unlink().
17495  *
17496  * If @cancellable is not %NULL, then the operation can be cancelled by
17497  * triggering the cancellable object from another thread. If the operation
17498  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17499  *
17500  * Virtual: delete_file
17501  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17502  */
17503
17504
17505 /**
17506  * g_file_delete_async:
17507  * @file: input #GFile
17508  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17509  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17510  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17511  * @user_data: the data to pass to callback function
17512  *
17513  * Asynchronously delete a file. If the @file is a directory, it will
17514  * only be deleted if it is empty.  This has the same semantics as
17515  * g_unlink().
17516  *
17517  * Virtual: delete_file_async
17518  * Since: 2.34
17519  */
17520
17521
17522 /**
17523  * g_file_delete_finish:
17524  * @file: input #GFile
17525  * @result: a #GAsyncResult
17526  * @error: a #GError, or %NULL
17527  *
17528  * Finishes deleting a file started with g_file_delete_async().
17529  *
17530  * Virtual: delete_file_finish
17531  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17532  * Since: 2.34
17533  */
17534
17535
17536 /**
17537  * g_file_descriptor_based_get_fd:
17538  * @fd_based: a #GFileDescriptorBased.
17539  *
17540  * Gets the underlying file descriptor.
17541  *
17542  * Returns: The file descriptor
17543  * Since: 2.24
17544  */
17545
17546
17547 /**
17548  * g_file_dup:
17549  * @file: input #GFile
17550  *
17551  * Duplicates a #GFile handle. This operation does not duplicate
17552  * the actual file or directory represented by the #GFile; see
17553  * g_file_copy() if attempting to copy a file.
17554  *
17555  * This call does no blocking I/O.
17556  *
17557  * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17558  */
17559
17560
17561 /**
17562  * g_file_eject_mountable:
17563  * @file: input #GFile
17564  * @flags: flags affecting the operation
17565  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17566  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17567  * @user_data: (closure): the data to pass to callback function
17568  *
17569  * Starts an asynchronous eject on a mountable.
17570  * When this operation has completed, @callback will be called with
17571  * @user_user data, and the operation can be finalized with
17572  * g_file_eject_mountable_finish().
17573  *
17574  * If @cancellable is not %NULL, then the operation can be cancelled by
17575  * triggering the cancellable object from another thread. If the operation
17576  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17577  *
17578  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17579  */
17580
17581
17582 /**
17583  * g_file_eject_mountable_finish:
17584  * @file: input #GFile
17585  * @result: a #GAsyncResult
17586  * @error: a #GError, or %NULL
17587  *
17588  * Finishes an asynchronous eject operation started by
17589  * g_file_eject_mountable().
17590  *
17591  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17592  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17593  */
17594
17595
17596 /**
17597  * g_file_eject_mountable_with_operation:
17598  * @file: input #GFile
17599  * @flags: flags affecting the operation
17600  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17601  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17602  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17603  * @user_data: (closure): the data to pass to callback function
17604  *
17605  * Starts an asynchronous eject on a mountable.
17606  * When this operation has completed, @callback will be called with
17607  * @user_user data, and the operation can be finalized with
17608  * g_file_eject_mountable_with_operation_finish().
17609  *
17610  * If @cancellable is not %NULL, then the operation can be cancelled by
17611  * triggering the cancellable object from another thread. If the operation
17612  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17613  *
17614  * Since: 2.22
17615  */
17616
17617
17618 /**
17619  * g_file_eject_mountable_with_operation_finish:
17620  * @file: input #GFile
17621  * @result: a #GAsyncResult
17622  * @error: a #GError, or %NULL
17623  *
17624  * Finishes an asynchronous eject operation started by
17625  * g_file_eject_mountable_with_operation().
17626  *
17627  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17628  * Since: 2.22
17629  */
17630
17631
17632 /**
17633  * g_file_enumerate_children:
17634  * @file: input #GFile
17635  * @attributes: an attribute query string
17636  * @flags: a set of #GFileQueryInfoFlags
17637  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17638  * @error: #GError for error reporting
17639  *
17640  * Gets the requested information about the files in a directory.
17641  * The result is a #GFileEnumerator object that will give out
17642  * #GFileInfo objects for all the files in the directory.
17643  *
17644  * The @attributes value is a string that specifies the file
17645  * attributes that should be gathered. It is not an error if
17646  * it's not possible to read a particular requested attribute
17647  * from a file - it just won't be set. @attributes should
17648  * be a comma-separated list of attributes or attribute wildcards.
17649  * The wildcard "*" means all attributes, and a wildcard like
17650  * "standard::*" means all attributes in the standard namespace.
17651  * An example attribute query be "standard::*,owner::user".
17652  * The standard attributes are available as defines, like
17653  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17654  *
17655  * If @cancellable is not %NULL, then the operation can be cancelled
17656  * by triggering the cancellable object from another thread. If the
17657  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17658  * returned.
17659  *
17660  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17661  * be returned. If the file is not a directory, the %G_IO_ERROR_NOT_DIRECTORY
17662  * error will be returned. Other errors are possible too.
17663  *
17664  * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17665  */
17666
17667
17668 /**
17669  * g_file_enumerate_children_async:
17670  * @file: input #GFile
17671  * @attributes: an attribute query string
17672  * @flags: a set of #GFileQueryInfoFlags
17673  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17674  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17675  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17676  * @user_data: (closure): the data to pass to callback function
17677  *
17678  * Asynchronously gets the requested information about the files
17679  * in a directory. The result is a #GFileEnumerator object that will
17680  * give out #GFileInfo objects for all the files in the directory.
17681  *
17682  * For more details, see g_file_enumerate_children() which is
17683  * the synchronous version of this call.
17684  *
17685  * When the operation is finished, @callback will be called. You can
17686  * then call g_file_enumerate_children_finish() to get the result of
17687  * the operation.
17688  */
17689
17690
17691 /**
17692  * g_file_enumerate_children_finish:
17693  * @file: input #GFile
17694  * @res: a #GAsyncResult
17695  * @error: a #GError
17696  *
17697  * Finishes an async enumerate children operation.
17698  * See g_file_enumerate_children_async().
17699  *
17700  * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17701  */
17702
17703
17704 /**
17705  * g_file_enumerator_close:
17706  * @enumerator: a #GFileEnumerator.
17707  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17708  * @error: location to store the error occurring, or %NULL to ignore
17709  *
17710  * Releases all resources used by this enumerator, making the
17711  * enumerator return %G_IO_ERROR_CLOSED on all calls.
17712  *
17713  * This will be automatically called when the last reference
17714  * is dropped, but you might want to call this function to make
17715  * sure resources are released as early as possible.
17716  *
17717  * Returns: #TRUE on success or #FALSE on error.
17718  */
17719
17720
17721 /**
17722  * g_file_enumerator_close_async:
17723  * @enumerator: a #GFileEnumerator.
17724  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17725  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17726  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17727  * @user_data: (closure): the data to pass to callback function
17728  *
17729  * Asynchronously closes the file enumerator.
17730  *
17731  * If @cancellable is not %NULL, then the operation can be cancelled by
17732  * triggering the cancellable object from another thread. If the operation
17733  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17734  * g_file_enumerator_close_finish().
17735  */
17736
17737
17738 /**
17739  * g_file_enumerator_close_finish:
17740  * @enumerator: a #GFileEnumerator.
17741  * @result: a #GAsyncResult.
17742  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17743  *
17744  * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17745  *
17746  * If the file enumerator was already closed when g_file_enumerator_close_async()
17747  * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17748  * return %FALSE. If the file enumerator had pending operation when the close
17749  * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17750  * return %FALSE.  If @cancellable was not %NULL, then the operation may have been
17751  * cancelled by triggering the cancellable object from another thread. If the operation
17752  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17753  * returned.
17754  *
17755  * Returns: %TRUE if the close operation has finished successfully.
17756  */
17757
17758
17759 /**
17760  * g_file_enumerator_get_child:
17761  * @enumerator: a #GFileEnumerator
17762  * @info: a #GFileInfo gotten from g_file_enumerator_next_file() or the async equivalents.
17763  *
17764  * Return a new #GFile which refers to the file named by @info in the source
17765  * directory of @enumerator.  This function is primarily intended to be used
17766  * inside loops with g_file_enumerator_next_file().
17767  *
17768  * This is a convenience method that's equivalent to:
17769  * |[
17770  *   gchar *name = g_file_info_get_name (info);
17771  *   GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr),
17772  *                                    name);
17773  * ]|
17774  *
17775  * Returns: (transfer full): a #GFile for the #GFileInfo passed it.
17776  * Since: 2.36
17777  */
17778
17779
17780 /**
17781  * g_file_enumerator_get_container:
17782  * @enumerator: a #GFileEnumerator
17783  *
17784  * Get the #GFile container which is being enumerated.
17785  *
17786  * Returns: (transfer none): the #GFile which is being enumerated.
17787  * Since: 2.18
17788  */
17789
17790
17791 /**
17792  * g_file_enumerator_has_pending:
17793  * @enumerator: a #GFileEnumerator.
17794  *
17795  * Checks if the file enumerator has pending operations.
17796  *
17797  * Returns: %TRUE if the @enumerator has pending operations.
17798  */
17799
17800
17801 /**
17802  * g_file_enumerator_is_closed:
17803  * @enumerator: a #GFileEnumerator.
17804  *
17805  * Checks if the file enumerator has been closed.
17806  *
17807  * Returns: %TRUE if the @enumerator is closed.
17808  */
17809
17810
17811 /**
17812  * g_file_enumerator_next_file:
17813  * @enumerator: a #GFileEnumerator.
17814  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17815  * @error: location to store the error occurring, or %NULL to ignore
17816  *
17817  * Returns information for the next file in the enumerated object.
17818  * Will block until the information is available. The #GFileInfo
17819  * returned from this function will contain attributes that match the
17820  * attribute string that was passed when the #GFileEnumerator was created.
17821  *
17822  * See the documentation of #GFileEnumerator for information about the
17823  * order of returned files.
17824  *
17825  * On error, returns %NULL and sets @error to the error. If the
17826  * enumerator is at the end, %NULL will be returned and @error will
17827  * be unset.
17828  *
17829  * Returns: (transfer full): A #GFileInfo or %NULL on error or end of enumerator. Free the returned object with g_object_unref() when no longer needed.
17830  */
17831
17832
17833 /**
17834  * g_file_enumerator_next_files_async:
17835  * @enumerator: a #GFileEnumerator.
17836  * @num_files: the number of file info objects to request
17837  * @io_priority: the <link linkend="io-priority">io priority</link> of the request.
17838  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17839  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17840  * @user_data: (closure): the data to pass to callback function
17841  *
17842  * Request information for a number of files from the enumerator asynchronously.
17843  * When all i/o for the operation is finished the @callback will be called with
17844  * the requested information.
17845  *
17846  * See the documentation of #GFileEnumerator for information about the
17847  * order of returned files.
17848  *
17849  * The callback can be called with less than @num_files files in case of error
17850  * or at the end of the enumerator. In case of a partial error the callback will
17851  * be called with any succeeding items and no error, and on the next request the
17852  * error will be reported. If a request is cancelled the callback will be called
17853  * with %G_IO_ERROR_CANCELLED.
17854  *
17855  * During an async request no other sync and async calls are allowed, and will
17856  * result in %G_IO_ERROR_PENDING errors.
17857  *
17858  * Any outstanding i/o request with higher priority (lower numerical value) will
17859  * be executed before an outstanding request with lower priority. Default
17860  * priority is %G_PRIORITY_DEFAULT.
17861  */
17862
17863
17864 /**
17865  * g_file_enumerator_next_files_finish:
17866  * @enumerator: a #GFileEnumerator.
17867  * @result: a #GAsyncResult.
17868  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17869  *
17870  * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17871  *
17872  * Returns: (transfer full) (element-type Gio.FileInfo): a #GList of #GFileInfo<!---->s. You must free the list with g_list_free() and unref the infos with g_object_unref() when you're done with them.
17873  */
17874
17875
17876 /**
17877  * g_file_enumerator_set_pending:
17878  * @enumerator: a #GFileEnumerator.
17879  * @pending: a boolean value.
17880  *
17881  * Sets the file enumerator as having pending operations.
17882  */
17883
17884
17885 /**
17886  * g_file_equal:
17887  * @file1: the first #GFile
17888  * @file2: the second #GFile
17889  *
17890  * Checks equality of two given #GFiles.
17891  *
17892  * Note that two #GFiles that differ can still refer to the same
17893  * file on the filesystem due to various forms of filename
17894  * aliasing.
17895  *
17896  * This call does no blocking I/O.
17897  *
17898  * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17899  */
17900
17901
17902 /**
17903  * g_file_find_enclosing_mount:
17904  * @file: input #GFile
17905  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17906  * @error: a #GError
17907  *
17908  * Gets a #GMount for the #GFile.
17909  *
17910  * If the #GFileIface for @file does not have a mount (e.g.
17911  * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17912  * and %NULL will be returned.
17913  *
17914  * If @cancellable is not %NULL, then the operation can be cancelled by
17915  * triggering the cancellable object from another thread. If the operation
17916  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17917  *
17918  * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17919  */
17920
17921
17922 /**
17923  * g_file_find_enclosing_mount_async:
17924  * @file: a #GFile
17925  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17926  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17927  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17928  * @user_data: (closure): the data to pass to callback function
17929  *
17930  * Asynchronously gets the mount for the file.
17931  *
17932  * For more details, see g_file_find_enclosing_mount() which is
17933  * the synchronous version of this call.
17934  *
17935  * When the operation is finished, @callback will be called.
17936  * You can then call g_file_find_enclosing_mount_finish() to
17937  * get the result of the operation.
17938  */
17939
17940
17941 /**
17942  * g_file_find_enclosing_mount_finish:
17943  * @file: a #GFile
17944  * @res: a #GAsyncResult
17945  * @error: a #GError
17946  *
17947  * Finishes an asynchronous find mount request.
17948  * See g_file_find_enclosing_mount_async().
17949  *
17950  * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
17951  */
17952
17953
17954 /**
17955  * g_file_get_basename:
17956  * @file: input #GFile
17957  *
17958  * Gets the base name (the last component of the path) for a given #GFile.
17959  *
17960  * If called for the top level of a system (such as the filesystem root
17961  * or a uri like sftp://host/) it will return a single directory separator
17962  * (and on Windows, possibly a drive letter).
17963  *
17964  * The base name is a byte string (not UTF-8). It has no defined encoding
17965  * or rules other than it may not contain zero bytes.  If you want to use
17966  * filenames in a user interface you should use the display name that you
17967  * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
17968  * attribute with g_file_query_info().
17969  *
17970  * This call does no blocking I/O.
17971  *
17972  * Returns: string containing the #GFile's base name, or %NULL if given #GFile is invalid. The returned string should be freed with g_free() when no longer needed.
17973  */
17974
17975
17976 /**
17977  * g_file_get_child:
17978  * @file: input #GFile
17979  * @name: string containing the child's basename
17980  *
17981  * Gets a child of @file with basename equal to @name.
17982  *
17983  * Note that the file with that specific name might not exist, but
17984  * you can still have a #GFile that points to it. You can use this
17985  * for instance to create that file.
17986  *
17987  * This call does no blocking I/O.
17988  *
17989  * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
17990  */
17991
17992
17993 /**
17994  * g_file_get_child_for_display_name:
17995  * @file: input #GFile
17996  * @display_name: string to a possible child
17997  * @error: return location for an error
17998  *
17999  * Gets the child of @file for a given @display_name (i.e. a UTF-8
18000  * version of the name). If this function fails, it returns %NULL
18001  * and @error will be set. This is very useful when constructing a
18002  * #GFile for a new file and the user entered the filename in the
18003  * user interface, for instance when you select a directory and
18004  * type a filename in the file selector.
18005  *
18006  * This call does no blocking I/O.
18007  *
18008  * Returns: (transfer full): a #GFile to the specified child, or %NULL if the display name couldn't be converted. Free the returned object with g_object_unref().
18009  */
18010
18011
18012 /**
18013  * g_file_get_parent:
18014  * @file: input #GFile
18015  *
18016  * Gets the parent directory for the @file.
18017  * If the @file represents the root directory of the
18018  * file system, then %NULL will be returned.
18019  *
18020  * This call does no blocking I/O.
18021  *
18022  * Returns: (transfer full): a #GFile structure to the parent of the given #GFile or %NULL if there is no parent. Free the returned object with g_object_unref().
18023  */
18024
18025
18026 /**
18027  * g_file_get_parse_name:
18028  * @file: input #GFile
18029  *
18030  * Gets the parse name of the @file.
18031  * A parse name is a UTF-8 string that describes the
18032  * file such that one can get the #GFile back using
18033  * g_file_parse_name().
18034  *
18035  * This is generally used to show the #GFile as a nice
18036  * full-pathname kind of string in a user interface,
18037  * like in a location entry.
18038  *
18039  * For local files with names that can safely be converted
18040  * to UTF-8 the pathname is used, otherwise the IRI is used
18041  * (a form of URI that allows UTF-8 characters unescaped).
18042  *
18043  * This call does no blocking I/O.
18044  *
18045  * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18046  */
18047
18048
18049 /**
18050  * g_file_get_path:
18051  * @file: input #GFile
18052  *
18053  * Gets the local pathname for #GFile, if one exists.
18054  *
18055  * This call does no blocking I/O.
18056  *
18057  * Returns: string containing the #GFile's path, or %NULL if no such path exists. The returned string should be freed with g_free() when no longer needed.
18058  */
18059
18060
18061 /**
18062  * g_file_get_relative_path:
18063  * @parent: input #GFile
18064  * @descendant: input #GFile
18065  *
18066  * Gets the path for @descendant relative to @parent.
18067  *
18068  * This call does no blocking I/O.
18069  *
18070  * Returns: string with the relative path from @descendant to @parent, or %NULL if @descendant doesn't have @parent as prefix. The returned string should be freed with g_free() when no longer needed.
18071  */
18072
18073
18074 /**
18075  * g_file_get_uri:
18076  * @file: input #GFile
18077  *
18078  * Gets the URI for the @file.
18079  *
18080  * This call does no blocking I/O.
18081  *
18082  * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18083  */
18084
18085
18086 /**
18087  * g_file_get_uri_scheme:
18088  * @file: input #GFile
18089  *
18090  * Gets the URI scheme for a #GFile.
18091  * RFC 3986 decodes the scheme as:
18092  * <programlisting>
18093  * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18094  * </programlisting>
18095  * Common schemes include "file", "http", "ftp", etc.
18096  *
18097  * This call does no blocking I/O.
18098  *
18099  * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18100  */
18101
18102
18103 /**
18104  * g_file_has_parent:
18105  * @file: input #GFile
18106  * @parent: (allow-none): the parent to check for, or %NULL
18107  *
18108  * Checks if @file has a parent, and optionally, if it is @parent.
18109  *
18110  * If @parent is %NULL then this function returns %TRUE if @file has any
18111  * parent at all.  If @parent is non-%NULL then %TRUE is only returned
18112  * if @file is a child of @parent.
18113  *
18114  * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18115  * Since: 2.24
18116  */
18117
18118
18119 /**
18120  * g_file_has_prefix:
18121  * @file: input #GFile
18122  * @prefix: input #GFile
18123  *
18124  * Checks whether @file has the prefix specified by @prefix.
18125  *
18126  * In other words, if the names of initial elements of @file's
18127  * pathname match @prefix. Only full pathname elements are matched,
18128  * so a path like /foo is not considered a prefix of /foobar, only
18129  * of /foo/bar.
18130  *
18131  * This call does no I/O, as it works purely on names. As such it can
18132  * sometimes return %FALSE even if @file is inside a @prefix (from a
18133  * filesystem point of view), because the prefix of @file is an alias
18134  * of @prefix.
18135  *
18136  * Virtual: prefix_matches
18137  * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18138  */
18139
18140
18141 /**
18142  * g_file_has_uri_scheme:
18143  * @file: input #GFile
18144  * @uri_scheme: a string containing a URI scheme
18145  *
18146  * Checks to see if a #GFile has a given URI scheme.
18147  *
18148  * This call does no blocking I/O.
18149  *
18150  * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18151  */
18152
18153
18154 /**
18155  * g_file_hash:
18156  * @file: (type GFile): #gconstpointer to a #GFile
18157  *
18158  * Creates a hash value for a #GFile.
18159  *
18160  * This call does no blocking I/O.
18161  *
18162  * Virtual: hash
18163  * Returns: 0 if @file is not a valid #GFile, otherwise an integer that can be used as hash value for the #GFile. This function is intended for easily hashing a #GFile to add to a #GHashTable or similar data structure.
18164  */
18165
18166
18167 /**
18168  * g_file_icon_get_file:
18169  * @icon: a #GIcon.
18170  *
18171  * Gets the #GFile associated with the given @icon.
18172  *
18173  * Returns: (transfer none): a #GFile, or %NULL.
18174  */
18175
18176
18177 /**
18178  * g_file_icon_new:
18179  * @file: a #GFile.
18180  *
18181  * Creates a new icon for a file.
18182  *
18183  * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18184  */
18185
18186
18187 /**
18188  * g_file_info_clear_status:
18189  * @info: a #GFileInfo.
18190  *
18191  * Clears the status information from @info.
18192  */
18193
18194
18195 /**
18196  * g_file_info_copy_into:
18197  * @src_info: source to copy attributes from.
18198  * @dest_info: destination to copy attributes to.
18199  *
18200  * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18201  * from @src_info to @dest_info.
18202  */
18203
18204
18205 /**
18206  * g_file_info_dup:
18207  * @other: a #GFileInfo.
18208  *
18209  * Duplicates a file info structure.
18210  *
18211  * Returns: (transfer full): a duplicate #GFileInfo of @other.
18212  */
18213
18214
18215 /**
18216  * g_file_info_get_attribute_as_string:
18217  * @info: a #GFileInfo.
18218  * @attribute: a file attribute key.
18219  *
18220  * Gets the value of a attribute, formated as a string.
18221  * This escapes things as needed to make the string valid
18222  * utf8.
18223  *
18224  * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18225  */
18226
18227
18228 /**
18229  * g_file_info_get_attribute_boolean:
18230  * @info: a #GFileInfo.
18231  * @attribute: a file attribute key.
18232  *
18233  * Gets the value of a boolean attribute. If the attribute does not
18234  * contain a boolean value, %FALSE will be returned.
18235  *
18236  * Returns: the boolean value contained within the attribute.
18237  */
18238
18239
18240 /**
18241  * g_file_info_get_attribute_byte_string:
18242  * @info: a #GFileInfo.
18243  * @attribute: a file attribute key.
18244  *
18245  * Gets the value of a byte string attribute. If the attribute does
18246  * not contain a byte string, %NULL will be returned.
18247  *
18248  * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18249  */
18250
18251
18252 /**
18253  * g_file_info_get_attribute_data:
18254  * @info: a #GFileInfo
18255  * @attribute: a file attribute key
18256  * @type: (out) (allow-none): return location for the attribute type, or %NULL
18257  * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18258  * @status: (out) (allow-none): return location for the attribute status, or %NULL
18259  *
18260  * Gets the attribute type, value and status for an attribute key.
18261  *
18262  * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18263  */
18264
18265
18266 /**
18267  * g_file_info_get_attribute_int32:
18268  * @info: a #GFileInfo.
18269  * @attribute: a file attribute key.
18270  *
18271  * Gets a signed 32-bit integer contained within the attribute. If the
18272  * attribute does not contain a signed 32-bit integer, or is invalid,
18273  * 0 will be returned.
18274  *
18275  * Returns: a signed 32-bit integer from the attribute.
18276  */
18277
18278
18279 /**
18280  * g_file_info_get_attribute_int64:
18281  * @info: a #GFileInfo.
18282  * @attribute: a file attribute key.
18283  *
18284  * Gets a signed 64-bit integer contained within the attribute. If the
18285  * attribute does not contain an signed 64-bit integer, or is invalid,
18286  * 0 will be returned.
18287  *
18288  * Returns: a signed 64-bit integer from the attribute.
18289  */
18290
18291
18292 /**
18293  * g_file_info_get_attribute_object:
18294  * @info: a #GFileInfo.
18295  * @attribute: a file attribute key.
18296  *
18297  * Gets the value of a #GObject attribute. If the attribute does
18298  * not contain a #GObject, %NULL will be returned.
18299  *
18300  * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18301  */
18302
18303
18304 /**
18305  * g_file_info_get_attribute_status:
18306  * @info: a #GFileInfo
18307  * @attribute: a file attribute key
18308  *
18309  * Gets the attribute status for an attribute key.
18310  *
18311  * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18312  */
18313
18314
18315 /**
18316  * g_file_info_get_attribute_string:
18317  * @info: a #GFileInfo.
18318  * @attribute: a file attribute key.
18319  *
18320  * Gets the value of a string attribute. If the attribute does
18321  * not contain a string, %NULL will be returned.
18322  *
18323  * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18324  */
18325
18326
18327 /**
18328  * g_file_info_get_attribute_stringv:
18329  * @info: a #GFileInfo.
18330  * @attribute: a file attribute key.
18331  *
18332  * Gets the value of a stringv attribute. If the attribute does
18333  * not contain a stringv, %NULL will be returned.
18334  *
18335  * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18336  * Since: 2.22
18337  */
18338
18339
18340 /**
18341  * g_file_info_get_attribute_type:
18342  * @info: a #GFileInfo.
18343  * @attribute: a file attribute key.
18344  *
18345  * Gets the attribute type for an attribute key.
18346  *
18347  * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18348  */
18349
18350
18351 /**
18352  * g_file_info_get_attribute_uint32:
18353  * @info: a #GFileInfo.
18354  * @attribute: a file attribute key.
18355  *
18356  * Gets an unsigned 32-bit integer contained within the attribute. If the
18357  * attribute does not contain an unsigned 32-bit integer, or is invalid,
18358  * 0 will be returned.
18359  *
18360  * Returns: an unsigned 32-bit integer from the attribute.
18361  */
18362
18363
18364 /**
18365  * g_file_info_get_attribute_uint64:
18366  * @info: a #GFileInfo.
18367  * @attribute: a file attribute key.
18368  *
18369  * Gets a unsigned 64-bit integer contained within the attribute. If the
18370  * attribute does not contain an unsigned 64-bit integer, or is invalid,
18371  * 0 will be returned.
18372  *
18373  * Returns: a unsigned 64-bit integer from the attribute.
18374  */
18375
18376
18377 /**
18378  * g_file_info_get_content_type:
18379  * @info: a #GFileInfo.
18380  *
18381  * Gets the file's content type.
18382  *
18383  * Returns: a string containing the file's content type.
18384  */
18385
18386
18387 /**
18388  * g_file_info_get_deletion_date:
18389  * @info: a #GFileInfo.
18390  *
18391  * Returns the #GDateTime representing the deletion date of the file, as
18392  * available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
18393  * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
18394  *
18395  * Returns: a #GDateTime, or %NULL.
18396  * Since: 2.36
18397  */
18398
18399
18400 /**
18401  * g_file_info_get_display_name:
18402  * @info: a #GFileInfo.
18403  *
18404  * Gets a display name for a file.
18405  *
18406  * Returns: a string containing the display name.
18407  */
18408
18409
18410 /**
18411  * g_file_info_get_edit_name:
18412  * @info: a #GFileInfo.
18413  *
18414  * Gets the edit name for a file.
18415  *
18416  * Returns: a string containing the edit name.
18417  */
18418
18419
18420 /**
18421  * g_file_info_get_etag:
18422  * @info: a #GFileInfo.
18423  *
18424  * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18425  * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18426  *
18427  * Returns: a string containing the value of the "etag:value" attribute.
18428  */
18429
18430
18431 /**
18432  * g_file_info_get_file_type:
18433  * @info: a #GFileInfo.
18434  *
18435  * Gets a file's type (whether it is a regular file, symlink, etc).
18436  * This is different from the file's content type, see g_file_info_get_content_type().
18437  *
18438  * Returns: a #GFileType for the given file.
18439  */
18440
18441
18442 /**
18443  * g_file_info_get_icon:
18444  * @info: a #GFileInfo.
18445  *
18446  * Gets the icon for a file.
18447  *
18448  * Returns: (transfer none): #GIcon for the given @info.
18449  */
18450
18451
18452 /**
18453  * g_file_info_get_is_backup:
18454  * @info: a #GFileInfo.
18455  *
18456  * Checks if a file is a backup file.
18457  *
18458  * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18459  */
18460
18461
18462 /**
18463  * g_file_info_get_is_hidden:
18464  * @info: a #GFileInfo.
18465  *
18466  * Checks if a file is hidden.
18467  *
18468  * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18469  */
18470
18471
18472 /**
18473  * g_file_info_get_is_symlink:
18474  * @info: a #GFileInfo.
18475  *
18476  * Checks if a file is a symlink.
18477  *
18478  * Returns: %TRUE if the given @info is a symlink.
18479  */
18480
18481
18482 /**
18483  * g_file_info_get_modification_time:
18484  * @info: a #GFileInfo.
18485  * @result: (out caller-allocates): a #GTimeVal.
18486  *
18487  * Gets the modification time of the current @info and sets it
18488  * in @result.
18489  */
18490
18491
18492 /**
18493  * g_file_info_get_name:
18494  * @info: a #GFileInfo.
18495  *
18496  * Gets the name for a file.
18497  *
18498  * Returns: a string containing the file name.
18499  */
18500
18501
18502 /**
18503  * g_file_info_get_size:
18504  * @info: a #GFileInfo.
18505  *
18506  * Gets the file's size.
18507  *
18508  * Returns: a #goffset containing the file's size.
18509  */
18510
18511
18512 /**
18513  * g_file_info_get_sort_order:
18514  * @info: a #GFileInfo.
18515  *
18516  * Gets the value of the sort_order attribute from the #GFileInfo.
18517  * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18518  *
18519  * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18520  */
18521
18522
18523 /**
18524  * g_file_info_get_symbolic_icon:
18525  * @info: a #GFileInfo.
18526  *
18527  * Gets the symbolic icon for a file.
18528  *
18529  * Returns: (transfer none): #GIcon for the given @info.
18530  * Since: 2.34
18531  */
18532
18533
18534 /**
18535  * g_file_info_get_symlink_target:
18536  * @info: a #GFileInfo.
18537  *
18538  * Gets the symlink target for a given #GFileInfo.
18539  *
18540  * Returns: a string containing the symlink target.
18541  */
18542
18543
18544 /**
18545  * g_file_info_has_attribute:
18546  * @info: a #GFileInfo.
18547  * @attribute: a file attribute key.
18548  *
18549  * Checks if a file info structure has an attribute named @attribute.
18550  *
18551  * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18552  */
18553
18554
18555 /**
18556  * g_file_info_has_namespace:
18557  * @info: a #GFileInfo.
18558  * @name_space: a file attribute namespace.
18559  *
18560  * Checks if a file info structure has an attribute in the
18561  * specified @name_space.
18562  *
18563  * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18564  * Since: 2.22
18565  */
18566
18567
18568 /**
18569  * g_file_info_list_attributes:
18570  * @info: a #GFileInfo.
18571  * @name_space: a file attribute key's namespace.
18572  *
18573  * Lists the file info structure's attributes.
18574  *
18575  * Returns: (array zero-terminated=1) (transfer full): a null-terminated array of strings of all of the possible attribute types for the given @name_space, or %NULL on error.
18576  */
18577
18578
18579 /**
18580  * g_file_info_new:
18581  *
18582  * Creates a new file info structure.
18583  *
18584  * Returns: a #GFileInfo.
18585  */
18586
18587
18588 /**
18589  * g_file_info_remove_attribute:
18590  * @info: a #GFileInfo.
18591  * @attribute: a file attribute key.
18592  *
18593  * Removes all cases of @attribute from @info if it exists.
18594  */
18595
18596
18597 /**
18598  * g_file_info_set_attribute:
18599  * @info: a #GFileInfo.
18600  * @attribute: a file attribute key.
18601  * @type: a #GFileAttributeType
18602  * @value_p: pointer to the value
18603  *
18604  * Sets the @attribute to contain the given value, if possible. To unset the
18605  * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18606  */
18607
18608
18609 /**
18610  * g_file_info_set_attribute_boolean:
18611  * @info: a #GFileInfo.
18612  * @attribute: a file attribute key.
18613  * @attr_value: a boolean value.
18614  *
18615  * Sets the @attribute to contain the given @attr_value,
18616  * if possible.
18617  */
18618
18619
18620 /**
18621  * g_file_info_set_attribute_byte_string:
18622  * @info: a #GFileInfo.
18623  * @attribute: a file attribute key.
18624  * @attr_value: a byte string.
18625  *
18626  * Sets the @attribute to contain the given @attr_value,
18627  * if possible.
18628  */
18629
18630
18631 /**
18632  * g_file_info_set_attribute_int32:
18633  * @info: a #GFileInfo.
18634  * @attribute: a file attribute key.
18635  * @attr_value: a signed 32-bit integer
18636  *
18637  * Sets the @attribute to contain the given @attr_value,
18638  * if possible.
18639  */
18640
18641
18642 /**
18643  * g_file_info_set_attribute_int64:
18644  * @info: a #GFileInfo.
18645  * @attribute: attribute name to set.
18646  * @attr_value: int64 value to set attribute to.
18647  *
18648  * Sets the @attribute to contain the given @attr_value,
18649  * if possible.
18650  */
18651
18652
18653 /**
18654  * g_file_info_set_attribute_mask:
18655  * @info: a #GFileInfo.
18656  * @mask: a #GFileAttributeMatcher.
18657  *
18658  * Sets @mask on @info to match specific attribute types.
18659  */
18660
18661
18662 /**
18663  * g_file_info_set_attribute_object:
18664  * @info: a #GFileInfo.
18665  * @attribute: a file attribute key.
18666  * @attr_value: a #GObject.
18667  *
18668  * Sets the @attribute to contain the given @attr_value,
18669  * if possible.
18670  */
18671
18672
18673 /**
18674  * g_file_info_set_attribute_status:
18675  * @info: a #GFileInfo
18676  * @attribute: a file attribute key
18677  * @status: a #GFileAttributeStatus
18678  *
18679  * Sets the attribute status for an attribute key. This is only
18680  * needed by external code that implement g_file_set_attributes_from_info()
18681  * or similar functions.
18682  *
18683  * The attribute must exist in @info for this to work. Otherwise %FALSE
18684  * is returned and @info is unchanged.
18685  *
18686  * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18687  * Since: 2.22
18688  */
18689
18690
18691 /**
18692  * g_file_info_set_attribute_string:
18693  * @info: a #GFileInfo.
18694  * @attribute: a file attribute key.
18695  * @attr_value: a UTF-8 string.
18696  *
18697  * Sets the @attribute to contain the given @attr_value,
18698  * if possible.
18699  */
18700
18701
18702 /**
18703  * g_file_info_set_attribute_stringv:
18704  * @info: a #GFileInfo.
18705  * @attribute: a file attribute key
18706  * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18707  *
18708  * Sets the @attribute to contain the given @attr_value,
18709  * if possible.
18710  *
18711  * Sinze: 2.22
18712  */
18713
18714
18715 /**
18716  * g_file_info_set_attribute_uint32:
18717  * @info: a #GFileInfo.
18718  * @attribute: a file attribute key.
18719  * @attr_value: an unsigned 32-bit integer.
18720  *
18721  * Sets the @attribute to contain the given @attr_value,
18722  * if possible.
18723  */
18724
18725
18726 /**
18727  * g_file_info_set_attribute_uint64:
18728  * @info: a #GFileInfo.
18729  * @attribute: a file attribute key.
18730  * @attr_value: an unsigned 64-bit integer.
18731  *
18732  * Sets the @attribute to contain the given @attr_value,
18733  * if possible.
18734  */
18735
18736
18737 /**
18738  * g_file_info_set_content_type:
18739  * @info: a #GFileInfo.
18740  * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18741  *
18742  * Sets the content type attribute for a given #GFileInfo.
18743  * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18744  */
18745
18746
18747 /**
18748  * g_file_info_set_display_name:
18749  * @info: a #GFileInfo.
18750  * @display_name: a string containing a display name.
18751  *
18752  * Sets the display name for the current #GFileInfo.
18753  * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18754  */
18755
18756
18757 /**
18758  * g_file_info_set_edit_name:
18759  * @info: a #GFileInfo.
18760  * @edit_name: a string containing an edit name.
18761  *
18762  * Sets the edit name for the current file.
18763  * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18764  */
18765
18766
18767 /**
18768  * g_file_info_set_file_type:
18769  * @info: a #GFileInfo.
18770  * @type: a #GFileType.
18771  *
18772  * Sets the file type in a #GFileInfo to @type.
18773  * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18774  */
18775
18776
18777 /**
18778  * g_file_info_set_icon:
18779  * @info: a #GFileInfo.
18780  * @icon: a #GIcon.
18781  *
18782  * Sets the icon for a given #GFileInfo.
18783  * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18784  */
18785
18786
18787 /**
18788  * g_file_info_set_is_hidden:
18789  * @info: a #GFileInfo.
18790  * @is_hidden: a #gboolean.
18791  *
18792  * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18793  * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18794  */
18795
18796
18797 /**
18798  * g_file_info_set_is_symlink:
18799  * @info: a #GFileInfo.
18800  * @is_symlink: a #gboolean.
18801  *
18802  * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18803  * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18804  */
18805
18806
18807 /**
18808  * g_file_info_set_modification_time:
18809  * @info: a #GFileInfo.
18810  * @mtime: a #GTimeVal.
18811  *
18812  * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18813  * info to the given time value.
18814  */
18815
18816
18817 /**
18818  * g_file_info_set_name:
18819  * @info: a #GFileInfo.
18820  * @name: a string containing a name.
18821  *
18822  * Sets the name attribute for the current #GFileInfo.
18823  * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18824  */
18825
18826
18827 /**
18828  * g_file_info_set_size:
18829  * @info: a #GFileInfo.
18830  * @size: a #goffset containing the file's size.
18831  *
18832  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18833  * to the given size.
18834  */
18835
18836
18837 /**
18838  * g_file_info_set_sort_order:
18839  * @info: a #GFileInfo.
18840  * @sort_order: a sort order integer.
18841  *
18842  * Sets the sort order attribute in the file info structure. See
18843  * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18844  */
18845
18846
18847 /**
18848  * g_file_info_set_symbolic_icon:
18849  * @info: a #GFileInfo.
18850  * @icon: a #GIcon.
18851  *
18852  * Sets the symbolic icon for a given #GFileInfo.
18853  * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18854  *
18855  * Since: 2.34
18856  */
18857
18858
18859 /**
18860  * g_file_info_set_symlink_target:
18861  * @info: a #GFileInfo.
18862  * @symlink_target: a static string containing a path to a symlink target.
18863  *
18864  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18865  * to the given symlink target.
18866  */
18867
18868
18869 /**
18870  * g_file_info_unset_attribute_mask:
18871  * @info: #GFileInfo.
18872  *
18873  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18874  * is set.
18875  */
18876
18877
18878 /**
18879  * g_file_input_stream_query_info:
18880  * @stream: a #GFileInputStream.
18881  * @attributes: a file attribute query string.
18882  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18883  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18884  *
18885  * Queries a file input stream the given @attributes. This function blocks
18886  * while querying the stream. For the asynchronous (non-blocking) version
18887  * of this function, see g_file_input_stream_query_info_async(). While the
18888  * stream is blocked, the stream will set the pending flag internally, and
18889  * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18890  *
18891  * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18892  */
18893
18894
18895 /**
18896  * g_file_input_stream_query_info_async:
18897  * @stream: a #GFileInputStream.
18898  * @attributes: a file attribute query string.
18899  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18900  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18901  * @callback: (scope async): callback to call when the request is satisfied
18902  * @user_data: (closure): the data to pass to callback function
18903  *
18904  * Queries the stream information asynchronously.
18905  * When the operation is finished @callback will be called.
18906  * You can then call g_file_input_stream_query_info_finish()
18907  * to get the result of the operation.
18908  *
18909  * For the synchronous version of this function,
18910  * see g_file_input_stream_query_info().
18911  *
18912  * If @cancellable is not %NULL, then the operation can be cancelled by
18913  * triggering the cancellable object from another thread. If the operation
18914  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18915  */
18916
18917
18918 /**
18919  * g_file_input_stream_query_info_finish:
18920  * @stream: a #GFileInputStream.
18921  * @result: a #GAsyncResult.
18922  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18923  *
18924  * Finishes an asynchronous info query operation.
18925  *
18926  * Returns: (transfer full): #GFileInfo.
18927  */
18928
18929
18930 /**
18931  * g_file_io_stream_get_etag:
18932  * @stream: a #GFileIOStream.
18933  *
18934  * Gets the entity tag for the file when it has been written.
18935  * This must be called after the stream has been written
18936  * and closed, as the etag can change while writing.
18937  *
18938  * Returns: the entity tag for the stream.
18939  * Since: 2.22
18940  */
18941
18942
18943 /**
18944  * g_file_io_stream_query_info:
18945  * @stream: a #GFileIOStream.
18946  * @attributes: a file attribute query string.
18947  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18948  * @error: a #GError, %NULL to ignore.
18949  *
18950  * Queries a file io stream for the given @attributes.
18951  * This function blocks while querying the stream. For the asynchronous
18952  * version of this function, see g_file_io_stream_query_info_async().
18953  * While the stream is blocked, the stream will set the pending flag
18954  * internally, and any other operations on the stream will fail with
18955  * %G_IO_ERROR_PENDING.
18956  *
18957  * Can fail if the stream was already closed (with @error being set to
18958  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
18959  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
18960  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
18961  * all cases of failure, %NULL will be returned.
18962  *
18963  * If @cancellable is not %NULL, then the operation can be cancelled by
18964  * triggering the cancellable object from another thread. If the operation
18965  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
18966  * be returned.
18967  *
18968  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
18969  * Since: 2.22
18970  */
18971
18972
18973 /**
18974  * g_file_io_stream_query_info_async:
18975  * @stream: a #GFileIOStream.
18976  * @attributes: a file attribute query string.
18977  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
18978  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18979  * @callback: (scope async): callback to call when the request is satisfied
18980  * @user_data: (closure): the data to pass to callback function
18981  *
18982  * Asynchronously queries the @stream for a #GFileInfo. When completed,
18983  * @callback will be called with a #GAsyncResult which can be used to
18984  * finish the operation with g_file_io_stream_query_info_finish().
18985  *
18986  * For the synchronous version of this function, see
18987  * g_file_io_stream_query_info().
18988  *
18989  * Since: 2.22
18990  */
18991
18992
18993 /**
18994  * g_file_io_stream_query_info_finish:
18995  * @stream: a #GFileIOStream.
18996  * @result: a #GAsyncResult.
18997  * @error: a #GError, %NULL to ignore.
18998  *
18999  * Finalizes the asynchronous query started
19000  * by g_file_io_stream_query_info_async().
19001  *
19002  * Returns: (transfer full): A #GFileInfo for the finished query.
19003  * Since: 2.22
19004  */
19005
19006
19007 /**
19008  * g_file_is_native:
19009  * @file: input #GFile
19010  *
19011  * Checks to see if a file is native to the platform.
19012  *
19013  * A native file s one expressed in the platform-native filename format,
19014  * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19015  * as it might be on a locally mounted remote filesystem.
19016  *
19017  * On some systems non-native files may be available using the native
19018  * filesystem via a userspace filesystem (FUSE), in these cases this call
19019  * will return %FALSE, but g_file_get_path() will still return a native path.
19020  *
19021  * This call does no blocking I/O.
19022  *
19023  * Returns: %TRUE if @file is native
19024  */
19025
19026
19027 /**
19028  * g_file_load_contents:
19029  * @file: input #GFile
19030  * @cancellable: optional #GCancellable object, %NULL to ignore
19031  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19032  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19033  * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19034  * @error: a #GError, or %NULL
19035  *
19036  * Loads the content of the file into memory. The data is always
19037  * zero-terminated, but this is not included in the resultant @length.
19038  * The returned @content should be freed with g_free() when no longer
19039  * needed.
19040  *
19041  * If @cancellable is not %NULL, then the operation can be cancelled by
19042  * triggering the cancellable object from another thread. If the operation
19043  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19044  *
19045  * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19046  */
19047
19048
19049 /**
19050  * g_file_load_contents_async:
19051  * @file: input #GFile
19052  * @cancellable: optional #GCancellable object, %NULL to ignore
19053  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19054  * @user_data: the data to pass to callback function
19055  *
19056  * Starts an asynchronous load of the @file's contents.
19057  *
19058  * For more details, see g_file_load_contents() which is
19059  * the synchronous version of this call.
19060  *
19061  * When the load operation has completed, @callback will be called
19062  * with @user data. To finish the operation, call
19063  * g_file_load_contents_finish() with the #GAsyncResult returned by
19064  * the @callback.
19065  *
19066  * If @cancellable is not %NULL, then the operation can be cancelled by
19067  * triggering the cancellable object from another thread. If the operation
19068  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19069  */
19070
19071
19072 /**
19073  * g_file_load_contents_finish:
19074  * @file: input #GFile
19075  * @res: a #GAsyncResult
19076  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19077  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19078  * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19079  * @error: a #GError, or %NULL
19080  *
19081  * Finishes an asynchronous load of the @file's contents.
19082  * The contents are placed in @contents, and @length is set to the
19083  * size of the @contents string. The @content should be freed with
19084  * g_free() when no longer needed. If @etag_out is present, it will be
19085  * set to the new entity tag for the @file.
19086  *
19087  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19088  */
19089
19090
19091 /**
19092  * g_file_load_partial_contents_async: (skip)
19093  * @file: input #GFile
19094  * @cancellable: optional #GCancellable object, %NULL to ignore
19095  * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19096  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19097  * @user_data: the data to pass to the callback functions
19098  *
19099  * Reads the partial contents of a file. A #GFileReadMoreCallback should
19100  * be used to stop reading from the file when appropriate, else this
19101  * function will behave exactly as g_file_load_contents_async(). This
19102  * operation can be finished by g_file_load_partial_contents_finish().
19103  *
19104  * Users of this function should be aware that @user_data is passed to
19105  * both the @read_more_callback and the @callback.
19106  *
19107  * If @cancellable is not %NULL, then the operation can be cancelled by
19108  * triggering the cancellable object from another thread. If the operation
19109  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19110  */
19111
19112
19113 /**
19114  * g_file_load_partial_contents_finish:
19115  * @file: input #GFile
19116  * @res: a #GAsyncResult
19117  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19118  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19119  * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19120  * @error: a #GError, or %NULL
19121  *
19122  * Finishes an asynchronous partial load operation that was started
19123  * with g_file_load_partial_contents_async(). The data is always
19124  * zero-terminated, but this is not included in the resultant @length.
19125  * The returned @content should be freed with g_free() when no longer
19126  * needed.
19127  *
19128  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19129  */
19130
19131
19132 /**
19133  * g_file_make_directory:
19134  * @file: input #GFile
19135  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19136  * @error: a #GError, or %NULL
19137  *
19138  * Creates a directory. Note that this will only create a child directory
19139  * of the immediate parent directory of the path or URI given by the #GFile.
19140  * To recursively create directories, see g_file_make_directory_with_parents().
19141  * This function will fail if the parent directory does not exist, setting
19142  * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19143  * creating directories, this function will fail, setting @error to
19144  * %G_IO_ERROR_NOT_SUPPORTED.
19145  *
19146  * For a local #GFile the newly created directory will have the default
19147  * (current) ownership and permissions of the current process.
19148  *
19149  * If @cancellable is not %NULL, then the operation can be cancelled by
19150  * triggering the cancellable object from another thread. If the operation
19151  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19152  *
19153  * Returns: %TRUE on successful creation, %FALSE otherwise.
19154  */
19155
19156
19157 /**
19158  * g_file_make_directory_async:
19159  * @file: input #GFile
19160  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19161  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19162  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19163  * @user_data: the data to pass to callback function
19164  *
19165  * Asynchronously creates a directory.
19166  *
19167  * Virtual: make_directory_async
19168  * Since: 2.38
19169  */
19170
19171
19172 /**
19173  * g_file_make_directory_finish:
19174  * @file: input #GFile
19175  * @result: a #GAsyncResult
19176  * @error: a #GError, or %NULL
19177  *
19178  * Finishes an asynchronous directory creation, started with
19179  * g_file_make_directory_async().
19180  *
19181  * Virtual: make_directory_finish
19182  * Returns: %TRUE on successful directory creation, %FALSE otherwise.
19183  * Since: 2.38
19184  */
19185
19186
19187 /**
19188  * g_file_make_directory_with_parents:
19189  * @file: input #GFile
19190  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19191  * @error: a #GError, or %NULL
19192  *
19193  * Creates a directory and any parent directories that may not
19194  * exist similar to 'mkdir -p'. If the file system does not support
19195  * creating directories, this function will fail, setting @error to
19196  * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19197  * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19198  * the similar g_mkdir_with_parents().
19199  *
19200  * For a local #GFile the newly created directories will have the default
19201  * (current) ownership and permissions of the current process.
19202  *
19203  * If @cancellable is not %NULL, then the operation can be cancelled by
19204  * triggering the cancellable object from another thread. If the operation
19205  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19206  *
19207  * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19208  * Since: 2.18
19209  */
19210
19211
19212 /**
19213  * g_file_make_symbolic_link:
19214  * @file: a #GFile with the name of the symlink to create
19215  * @symlink_value: a string with the path for the target of the new symlink
19216  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19217  * @error: a #GError
19218  *
19219  * Creates a symbolic link named @file which contains the string
19220  * @symlink_value.
19221  *
19222  * If @cancellable is not %NULL, then the operation can be cancelled by
19223  * triggering the cancellable object from another thread. If the operation
19224  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19225  *
19226  * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19227  */
19228
19229
19230 /**
19231  * g_file_measure_disk_usage:
19232  * @file: a #GFile
19233  * @flags: #GFileMeasureFlags
19234  * @cancellable: (allow-none): optional #GCancellable
19235  * @progress_callback: (allow-none): a #GFileMeasureProgressCallback
19236  * @progress_data: user_data for @progress_callback
19237  * @disk_usage: (allow-none) (out): the number of bytes of disk space used
19238  * @num_dirs: (allow-none) (out): the number of directories encountered
19239  * @num_files: (allow-none) (out): the number of non-directories encountered
19240  * @error: (allow-none): %NULL, or a pointer to a %NULL #GError pointer
19241  *
19242  * Recursively measures the disk usage of @file.
19243  *
19244  * This is essentially an analog of the '<literal>du</literal>' command,
19245  * but it also reports the number of directories and non-directory files
19246  * encountered (including things like symbolic links).
19247  *
19248  * By default, errors are only reported against the toplevel file
19249  * itself.  Errors found while recursing are silently ignored, unless
19250  * %G_FILE_DISK_USAGE_REPORT_ALL_ERRORS is given in @flags.
19251  *
19252  * The returned size, @disk_usage, is in bytes and should be formatted
19253  * with g_format_size() in order to get something reasonable for showing
19254  * in a user interface.
19255  *
19256  * @progress_callback and @progress_data can be given to request
19257  * periodic progress updates while scanning.  See the documentation for
19258  * #GFileMeasureProgressCallback for information about when and how the
19259  * callback will be invoked.
19260  *
19261  * Returns: %TRUE if successful, with the out parameters set. %FALSE otherwise, with @error set.
19262  * Since: 2.38
19263  */
19264
19265
19266 /**
19267  * g_file_measure_disk_usage_async:
19268  * @file: a #GFile
19269  * @flags: #GFileMeasureFlags
19270  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19271  * @cancellable: (allow-none): optional #GCancellable
19272  * @progress_callback: (allow-none): a #GFileMeasureProgressCallback
19273  * @progress_data: user_data for @progress_callback
19274  * @callback: (allow-none): a #GAsyncReadyCallback to call when complete
19275  * @user_data: the data to pass to callback function
19276  *
19277  * Recursively measures the disk usage of @file.
19278  *
19279  * This is the asynchronous version of g_file_measure_disk_usage().  See
19280  * there for more information.
19281  *
19282  * Since: 2.38
19283  */
19284
19285
19286 /**
19287  * g_file_measure_disk_usage_finish:
19288  * @file: a #GFile
19289  * @result: the #GAsyncResult passed to your #GAsyncReadyCallback
19290  * @disk_usage: (allow-none) (out): the number of bytes of disk space used
19291  * @num_dirs: (allow-none) (out): the number of directories encountered
19292  * @num_files: (allow-none) (out): the number of non-directories encountered
19293  * @error: (allow-none): %NULL, or a pointer to a %NULL #GError pointer
19294  *
19295  * Collects the results from an earlier call to
19296  * g_file_measure_disk_usage_async().  See g_file_measure_disk_usage() for
19297  * more information.
19298  *
19299  * Returns: %TRUE if successful, with the out parameters set. %FALSE otherwise, with @error set.
19300  * Since: 2.38
19301  */
19302
19303
19304 /**
19305  * g_file_monitor:
19306  * @file: input #GFile
19307  * @flags: a set of #GFileMonitorFlags
19308  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19309  * @error: a #GError, or %NULL
19310  *
19311  * Obtains a file or directory monitor for the given file,
19312  * depending on the type of the file.
19313  *
19314  * If @cancellable is not %NULL, then the operation can be cancelled by
19315  * triggering the cancellable object from another thread. If the operation
19316  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19317  *
19318  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19319  * Since: 2.18
19320  */
19321
19322
19323 /**
19324  * g_file_monitor_cancel:
19325  * @monitor: a #GFileMonitor.
19326  *
19327  * Cancels a file monitor.
19328  *
19329  * Returns: %TRUE if monitor was cancelled.
19330  */
19331
19332
19333 /**
19334  * g_file_monitor_directory:
19335  * @file: input #GFile
19336  * @flags: a set of #GFileMonitorFlags
19337  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19338  * @error: a #GError, or %NULL
19339  *
19340  * Obtains a directory monitor for the given file.
19341  * This may fail if directory monitoring is not supported.
19342  *
19343  * If @cancellable is not %NULL, then the operation can be cancelled by
19344  * triggering the cancellable object from another thread. If the operation
19345  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19346  *
19347  * It does not make sense for @flags to contain
19348  * %G_FILE_MONITOR_WATCH_HARD_LINKS, since hard links can not be made to
19349  * directories.  It is not possible to monitor all the files in a
19350  * directory for changes made via hard links; if you want to do this then
19351  * you must register individual watches with g_file_monitor().
19352  *
19353  * Virtual: monitor_dir
19354  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19355  */
19356
19357
19358 /**
19359  * g_file_monitor_emit_event:
19360  * @monitor: a #GFileMonitor.
19361  * @child: a #GFile.
19362  * @other_file: a #GFile.
19363  * @event_type: a set of #GFileMonitorEvent flags.
19364  *
19365  * Emits the #GFileMonitor::changed signal if a change
19366  * has taken place. Should be called from file monitor
19367  * implementations only.
19368  *
19369  * The signal will be emitted from an idle handler (in the <link
19370  * linkend="g-main-context-push-thread-default">thread-default main
19371  * context</link>).
19372  */
19373
19374
19375 /**
19376  * g_file_monitor_file:
19377  * @file: input #GFile
19378  * @flags: a set of #GFileMonitorFlags
19379  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19380  * @error: a #GError, or %NULL
19381  *
19382  * Obtains a file monitor for the given file. If no file notification
19383  * mechanism exists, then regular polling of the file is used.
19384  *
19385  * If @cancellable is not %NULL, then the operation can be cancelled by
19386  * triggering the cancellable object from another thread. If the operation
19387  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19388  *
19389  * If @flags contains %G_FILE_MONITOR_WATCH_HARD_LINKS then the monitor
19390  * will also attempt to report changes made to the file via another
19391  * filename (ie, a hard link). Without this flag, you can only rely on
19392  * changes made through the filename contained in @file to be
19393  * reported. Using this flag may result in an increase in resource
19394  * usage, and may not have any effect depending on the #GFileMonitor
19395  * backend and/or filesystem type.
19396  *
19397  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19398  */
19399
19400
19401 /**
19402  * g_file_monitor_is_cancelled:
19403  * @monitor: a #GFileMonitor
19404  *
19405  * Returns whether the monitor is canceled.
19406  *
19407  * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19408  */
19409
19410
19411 /**
19412  * g_file_monitor_set_rate_limit:
19413  * @monitor: a #GFileMonitor.
19414  * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19415  *
19416  * Sets the rate limit to which the @monitor will report
19417  * consecutive change events to the same file.
19418  */
19419
19420
19421 /**
19422  * g_file_mount_enclosing_volume:
19423  * @location: input #GFile
19424  * @flags: flags affecting the operation
19425  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19426  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19427  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19428  * @user_data: the data to pass to callback function
19429  *
19430  * Starts a @mount_operation, mounting the volume that contains
19431  * the file @location.
19432  *
19433  * When this operation has completed, @callback will be called with
19434  * @user_user data, and the operation can be finalized with
19435  * g_file_mount_enclosing_volume_finish().
19436  *
19437  * If @cancellable is not %NULL, then the operation can be cancelled by
19438  * triggering the cancellable object from another thread. If the operation
19439  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19440  */
19441
19442
19443 /**
19444  * g_file_mount_enclosing_volume_finish:
19445  * @location: input #GFile
19446  * @result: a #GAsyncResult
19447  * @error: a #GError, or %NULL
19448  *
19449  * Finishes a mount operation started by g_file_mount_enclosing_volume().
19450  *
19451  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19452  */
19453
19454
19455 /**
19456  * g_file_mount_mountable:
19457  * @file: input #GFile
19458  * @flags: flags affecting the operation
19459  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19460  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19461  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19462  * @user_data: (closure): the data to pass to callback function
19463  *
19464  * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19465  * Using @mount_operation, you can request callbacks when, for instance,
19466  * passwords are needed during authentication.
19467  *
19468  * If @cancellable is not %NULL, then the operation can be cancelled by
19469  * triggering the cancellable object from another thread. If the operation
19470  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19471  *
19472  * When the operation is finished, @callback will be called.
19473  * You can then call g_file_mount_mountable_finish() to get
19474  * the result of the operation.
19475  */
19476
19477
19478 /**
19479  * g_file_mount_mountable_finish:
19480  * @file: input #GFile
19481  * @result: a #GAsyncResult
19482  * @error: a #GError, or %NULL
19483  *
19484  * Finishes a mount operation. See g_file_mount_mountable() for details.
19485  *
19486  * Finish an asynchronous mount operation that was started
19487  * with g_file_mount_mountable().
19488  *
19489  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19490  */
19491
19492
19493 /**
19494  * g_file_move:
19495  * @source: #GFile pointing to the source location
19496  * @destination: #GFile pointing to the destination location
19497  * @flags: set of #GFileCopyFlags
19498  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19499  * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
19500  * @progress_callback_data: (closure): gpointer to user data for the callback function
19501  * @error: #GError for returning error conditions, or %NULL
19502  *
19503  * Tries to move the file or directory @source to the location specified
19504  * by @destination. If native move operations are supported then this is
19505  * used, otherwise a copy + delete fallback is used. The native
19506  * implementation may support moving directories (for instance on moves
19507  * inside the same filesystem), but the fallback code does not.
19508  *
19509  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19510  * existing @destination file is overwritten.
19511  *
19512  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19513  * will be copied as symlinks, otherwise the target of the
19514  * @source symlink will be copied.
19515  *
19516  * If @cancellable is not %NULL, then the operation can be cancelled by
19517  * triggering the cancellable object from another thread. If the operation
19518  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19519  *
19520  * If @progress_callback is not %NULL, then the operation can be monitored
19521  * by setting this to a #GFileProgressCallback function.
19522  * @progress_callback_data will be passed to this function. It is
19523  * guaranteed that this callback will be called after all data has been
19524  * transferred with the total number of bytes copied during the operation.
19525  *
19526  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
19527  * error is returned, independent on the status of the @destination.
19528  *
19529  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
19530  * then the error %G_IO_ERROR_EXISTS is returned.
19531  *
19532  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
19533  * error is returned. If trying to overwrite a directory with a directory the
19534  * %G_IO_ERROR_WOULD_MERGE error is returned.
19535  *
19536  * If the source is a directory and the target does not exist, or
19537  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
19538  * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
19539  * move operation isn't available).
19540  *
19541  * Returns: %TRUE on successful move, %FALSE otherwise.
19542  */
19543
19544
19545 /**
19546  * g_file_new_for_commandline_arg:
19547  * @arg: a command line string
19548  *
19549  * Creates a #GFile with the given argument from the command line.
19550  * The value of @arg can be either a URI, an absolute path or a
19551  * relative path resolved relative to the current working directory.
19552  * This operation never fails, but the returned object might not
19553  * support any I/O operation if @arg points to a malformed path.
19554  *
19555  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19556  */
19557
19558
19559 /**
19560  * g_file_new_for_commandline_arg_and_cwd:
19561  * @arg: a command line string
19562  * @cwd: the current working directory of the commandline
19563  *
19564  * Creates a #GFile with the given argument from the command line.
19565  *
19566  * This function is similar to g_file_new_for_commandline_arg() except
19567  * that it allows for passing the current working directory as an
19568  * argument instead of using the current working directory of the
19569  * process.
19570  *
19571  * This is useful if the commandline argument was given in a context
19572  * other than the invocation of the current process.
19573  *
19574  * See also g_application_command_line_create_file_for_arg().
19575  *
19576  * Returns: (transfer full): a new #GFile
19577  * Since: 2.36
19578  */
19579
19580
19581 /**
19582  * g_file_new_for_path:
19583  * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19584  *
19585  * Constructs a #GFile for a given path. This operation never
19586  * fails, but the returned object might not support any I/O
19587  * operation if @path is malformed.
19588  *
19589  * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19590  */
19591
19592
19593 /**
19594  * g_file_new_for_uri:
19595  * @uri: a UTF-8 string containing a URI
19596  *
19597  * Constructs a #GFile for a given URI. This operation never
19598  * fails, but the returned object might not support any I/O
19599  * operation if @uri is malformed or if the uri type is
19600  * not supported.
19601  *
19602  * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19603  */
19604
19605
19606 /**
19607  * g_file_new_tmp:
19608  * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
19609  * @iostream: (out): on return, a #GFileIOStream for the created file
19610  * @error: a #GError, or %NULL
19611  *
19612  * Opens a file in the preferred directory for temporary files (as
19613  * returned by g_get_tmp_dir()) and returns a #GFile and
19614  * #GFileIOStream pointing to it.
19615  *
19616  * @tmpl should be a string in the GLib file name encoding
19617  * containing a sequence of six 'X' characters, and containing no
19618  * directory components. If it is %NULL, a default template is used.
19619  *
19620  * Unlike the other #GFile constructors, this will return %NULL if
19621  * a temporary file could not be created.
19622  *
19623  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19624  * Since: 2.32
19625  */
19626
19627
19628 /**
19629  * g_file_open_readwrite:
19630  * @file: #GFile to open
19631  * @cancellable: (allow-none): a #GCancellable
19632  * @error: a #GError, or %NULL
19633  *
19634  * Opens an existing file for reading and writing. The result is
19635  * a #GFileIOStream that can be used to read and write the contents
19636  * of the file.
19637  *
19638  * If @cancellable is not %NULL, then the operation can be cancelled
19639  * by triggering the cancellable object from another thread. If the
19640  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19641  * returned.
19642  *
19643  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19644  * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19645  * error will be returned. Other errors are possible too, and depend on
19646  * what kind of filesystem the file is on. Note that in many non-local
19647  * file cases read and write streams are not supported, so make sure you
19648  * really need to do read and write streaming, rather than just opening
19649  * for reading or writing.
19650  *
19651  * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19652  * Since: 2.22
19653  */
19654
19655
19656 /**
19657  * g_file_open_readwrite_async:
19658  * @file: input #GFile
19659  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19660  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19661  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19662  * @user_data: (closure): the data to pass to callback function
19663  *
19664  * Asynchronously opens @file for reading and writing.
19665  *
19666  * For more details, see g_file_open_readwrite() which is
19667  * the synchronous version of this call.
19668  *
19669  * When the operation is finished, @callback will be called.
19670  * You can then call g_file_open_readwrite_finish() to get
19671  * the result of the operation.
19672  *
19673  * Since: 2.22
19674  */
19675
19676
19677 /**
19678  * g_file_open_readwrite_finish:
19679  * @file: input #GFile
19680  * @res: a #GAsyncResult
19681  * @error: a #GError, or %NULL
19682  *
19683  * Finishes an asynchronous file read operation started with
19684  * g_file_open_readwrite_async().
19685  *
19686  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19687  * Since: 2.22
19688  */
19689
19690
19691 /**
19692  * g_file_output_stream_get_etag:
19693  * @stream: a #GFileOutputStream.
19694  *
19695  * Gets the entity tag for the file when it has been written.
19696  * This must be called after the stream has been written
19697  * and closed, as the etag can change while writing.
19698  *
19699  * Returns: the entity tag for the stream.
19700  */
19701
19702
19703 /**
19704  * g_file_output_stream_query_info:
19705  * @stream: a #GFileOutputStream.
19706  * @attributes: a file attribute query string.
19707  * @cancellable: optional #GCancellable object, %NULL to ignore.
19708  * @error: a #GError, %NULL to ignore.
19709  *
19710  * Queries a file output stream for the given @attributes.
19711  * This function blocks while querying the stream. For the asynchronous
19712  * version of this function, see g_file_output_stream_query_info_async().
19713  * While the stream is blocked, the stream will set the pending flag
19714  * internally, and any other operations on the stream will fail with
19715  * %G_IO_ERROR_PENDING.
19716  *
19717  * Can fail if the stream was already closed (with @error being set to
19718  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19719  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19720  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19721  * all cases of failure, %NULL will be returned.
19722  *
19723  * If @cancellable is not %NULL, then the operation can be cancelled by
19724  * triggering the cancellable object from another thread. If the operation
19725  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19726  * be returned.
19727  *
19728  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19729  */
19730
19731
19732 /**
19733  * g_file_output_stream_query_info_async:
19734  * @stream: a #GFileOutputStream.
19735  * @attributes: a file attribute query string.
19736  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19737  * @cancellable: optional #GCancellable object, %NULL to ignore.
19738  * @callback: callback to call when the request is satisfied
19739  * @user_data: the data to pass to callback function
19740  *
19741  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19742  * @callback will be called with a #GAsyncResult which can be used to
19743  * finish the operation with g_file_output_stream_query_info_finish().
19744  *
19745  * For the synchronous version of this function, see
19746  * g_file_output_stream_query_info().
19747  */
19748
19749
19750 /**
19751  * g_file_output_stream_query_info_finish:
19752  * @stream: a #GFileOutputStream.
19753  * @result: a #GAsyncResult.
19754  * @error: a #GError, %NULL to ignore.
19755  *
19756  * Finalizes the asynchronous query started
19757  * by g_file_output_stream_query_info_async().
19758  *
19759  * Returns: (transfer full): A #GFileInfo for the finished query.
19760  */
19761
19762
19763 /**
19764  * g_file_parse_name:
19765  * @parse_name: a file name or path to be parsed
19766  *
19767  * Constructs a #GFile with the given @parse_name (i.e. something
19768  * given by g_file_get_parse_name()). This operation never fails,
19769  * but the returned object might not support any I/O operation if
19770  * the @parse_name cannot be parsed.
19771  *
19772  * Returns: (transfer full): a new #GFile.
19773  */
19774
19775
19776 /**
19777  * g_file_poll_mountable:
19778  * @file: input #GFile
19779  * @cancellable: optional #GCancellable object, %NULL to ignore
19780  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19781  * @user_data: the data to pass to callback function
19782  *
19783  * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19784  *
19785  * If @cancellable is not %NULL, then the operation can be cancelled by
19786  * triggering the cancellable object from another thread. If the operation
19787  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19788  *
19789  * When the operation is finished, @callback will be called.
19790  * You can then call g_file_mount_mountable_finish() to get
19791  * the result of the operation.
19792  *
19793  * Since: 2.22
19794  */
19795
19796
19797 /**
19798  * g_file_poll_mountable_finish:
19799  * @file: input #GFile
19800  * @result: a #GAsyncResult
19801  * @error: a #GError, or %NULL
19802  *
19803  * Finishes a poll operation. See g_file_poll_mountable() for details.
19804  *
19805  * Finish an asynchronous poll operation that was polled
19806  * with g_file_poll_mountable().
19807  *
19808  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19809  * Since: 2.22
19810  */
19811
19812
19813 /**
19814  * g_file_query_default_handler:
19815  * @file: a #GFile to open
19816  * @cancellable: optional #GCancellable object, %NULL to ignore
19817  * @error: a #GError, or %NULL
19818  *
19819  * Returns the #GAppInfo that is registered as the default
19820  * application to handle the file specified by @file.
19821  *
19822  * If @cancellable is not %NULL, then the operation can be cancelled by
19823  * triggering the cancellable object from another thread. If the operation
19824  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19825  *
19826  * Returns: (transfer full): a #GAppInfo if the handle was found, %NULL if there were errors. When you are done with it, release it with g_object_unref()
19827  */
19828
19829
19830 /**
19831  * g_file_query_exists:
19832  * @file: input #GFile
19833  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19834  *
19835  * Utility function to check if a particular file exists. This is
19836  * implemented using g_file_query_info() and as such does blocking I/O.
19837  *
19838  * Note that in many cases it is racy to first check for file existence
19839  * and then execute something based on the outcome of that, because the
19840  * file might have been created or removed in between the operations. The
19841  * general approach to handling that is to not check, but just do the
19842  * operation and handle the errors as they come.
19843  *
19844  * As an example of race-free checking, take the case of reading a file,
19845  * and if it doesn't exist, creating it. There are two racy versions: read
19846  * it, and on error create it; and: check if it exists, if not create it.
19847  * These can both result in two processes creating the file (with perhaps
19848  * a partially written file as the result). The correct approach is to
19849  * always try to create the file with g_file_create() which will either
19850  * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19851  *
19852  * However, in many cases an existence check is useful in a user interface,
19853  * for instance to make a menu item sensitive/insensitive, so that you don't
19854  * have to fool users that something is possible and then just show an error
19855  * dialog. If you do this, you should make sure to also handle the errors
19856  * that can happen due to races when you execute the operation.
19857  *
19858  * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19859  */
19860
19861
19862 /**
19863  * g_file_query_file_type:
19864  * @file: input #GFile
19865  * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19866  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19867  *
19868  * Utility function to inspect the #GFileType of a file. This is
19869  * implemented using g_file_query_info() and as such does blocking I/O.
19870  *
19871  * The primary use case of this method is to check if a file is
19872  * a regular file, directory, or symlink.
19873  *
19874  * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19875  * Since: 2.18
19876  */
19877
19878
19879 /**
19880  * g_file_query_filesystem_info:
19881  * @file: input #GFile
19882  * @attributes: an attribute query string
19883  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19884  * @error: a #GError
19885  *
19886  * Similar to g_file_query_info(), but obtains information
19887  * about the filesystem the @file is on, rather than the file itself.
19888  * For instance the amount of space available and the type of
19889  * the filesystem.
19890  *
19891  * The @attributes value is a string that specifies the attributes
19892  * that should be gathered. It is not an error if it's not possible
19893  * to read a particular requested attribute from a file - it just
19894  * won't be set. @attributes should be a comma-separated list of
19895  * attributes or attribute wildcards. The wildcard "*" means all
19896  * attributes, and a wildcard like "filesystem::*" means all attributes
19897  * in the filesystem namespace. The standard namespace for filesystem
19898  * attributes is "filesystem". Common attributes of interest are
19899  * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19900  * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19901  * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19902  *
19903  * If @cancellable is not %NULL, then the operation can be cancelled
19904  * by triggering the cancellable object from another thread. If the
19905  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19906  * returned.
19907  *
19908  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19909  * be returned. Other errors are possible too, and depend on what
19910  * kind of filesystem the file is on.
19911  *
19912  * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19913  */
19914
19915
19916 /**
19917  * g_file_query_filesystem_info_async:
19918  * @file: input #GFile
19919  * @attributes: an attribute query string
19920  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19921  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19922  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19923  * @user_data: (closure): the data to pass to callback function
19924  *
19925  * Asynchronously gets the requested information about the filesystem
19926  * that the specified @file is on. The result is a #GFileInfo object
19927  * that contains key-value attributes (such as type or size for the
19928  * file).
19929  *
19930  * For more details, see g_file_query_filesystem_info() which is the
19931  * synchronous version of this call.
19932  *
19933  * When the operation is finished, @callback will be called. You can
19934  * then call g_file_query_info_finish() to get the result of the
19935  * operation.
19936  */
19937
19938
19939 /**
19940  * g_file_query_filesystem_info_finish:
19941  * @file: input #GFile
19942  * @res: a #GAsyncResult
19943  * @error: a #GError
19944  *
19945  * Finishes an asynchronous filesystem info query.
19946  * See g_file_query_filesystem_info_async().
19947  *
19948  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19949  */
19950
19951
19952 /**
19953  * g_file_query_info:
19954  * @file: input #GFile
19955  * @attributes: an attribute query string
19956  * @flags: a set of #GFileQueryInfoFlags
19957  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19958  * @error: a #GError
19959  *
19960  * Gets the requested information about specified @file.
19961  * The result is a #GFileInfo object that contains key-value
19962  * attributes (such as the type or size of the file).
19963  *
19964  * The @attributes value is a string that specifies the file
19965  * attributes that should be gathered. It is not an error if
19966  * it's not possible to read a particular requested attribute
19967  * from a file - it just won't be set. @attributes should be a
19968  * comma-separated list of attributes or attribute wildcards.
19969  * The wildcard "*" means all attributes, and a wildcard like
19970  * "standard::*" means all attributes in the standard namespace.
19971  * An example attribute query be "standard::*,owner::user".
19972  * The standard attributes are available as defines, like
19973  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19974  *
19975  * If @cancellable is not %NULL, then the operation can be cancelled
19976  * by triggering the cancellable object from another thread. If the
19977  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19978  * returned.
19979  *
19980  * For symlinks, normally the information about the target of the
19981  * symlink is returned, rather than information about the symlink
19982  * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19983  * in @flags the information about the symlink itself will be returned.
19984  * Also, for symlinks that point to non-existing files the information
19985  * about the symlink itself will be returned.
19986  *
19987  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19988  * returned. Other errors are possible too, and depend on what kind of
19989  * filesystem the file is on.
19990  *
19991  * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19992  */
19993
19994
19995 /**
19996  * g_file_query_info_async:
19997  * @file: input #GFile
19998  * @attributes: an attribute query string
19999  * @flags: a set of #GFileQueryInfoFlags
20000  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20001  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20002  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20003  * @user_data: (closure): the data to pass to callback function
20004  *
20005  * Asynchronously gets the requested information about specified @file.
20006  * The result is a #GFileInfo object that contains key-value attributes
20007  * (such as type or size for the file).
20008  *
20009  * For more details, see g_file_query_info() which is the synchronous
20010  * version of this call.
20011  *
20012  * When the operation is finished, @callback will be called. You can
20013  * then call g_file_query_info_finish() to get the result of the operation.
20014  */
20015
20016
20017 /**
20018  * g_file_query_info_finish:
20019  * @file: input #GFile
20020  * @res: a #GAsyncResult
20021  * @error: a #GError
20022  *
20023  * Finishes an asynchronous file info query.
20024  * See g_file_query_info_async().
20025  *
20026  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20027  */
20028
20029
20030 /**
20031  * g_file_query_settable_attributes:
20032  * @file: input #GFile
20033  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20034  * @error: a #GError, or %NULL
20035  *
20036  * Obtain the list of settable attributes for the file.
20037  *
20038  * Returns the type and full attribute name of all the attributes
20039  * that can be set on this file. This doesn't mean setting it will
20040  * always succeed though, you might get an access failure, or some
20041  * specific file may not support a specific attribute.
20042  *
20043  * If @cancellable is not %NULL, then the operation can be cancelled by
20044  * triggering the cancellable object from another thread. If the operation
20045  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20046  *
20047  * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
20048  */
20049
20050
20051 /**
20052  * g_file_query_writable_namespaces:
20053  * @file: input #GFile
20054  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20055  * @error: a #GError, or %NULL
20056  *
20057  * Obtain the list of attribute namespaces where new attributes
20058  * can be created by a user. An example of this is extended
20059  * attributes (in the "xattr" namespace).
20060  *
20061  * If @cancellable is not %NULL, then the operation can be cancelled by
20062  * triggering the cancellable object from another thread. If the operation
20063  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20064  *
20065  * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
20066  */
20067
20068
20069 /**
20070  * g_file_read:
20071  * @file: #GFile to read
20072  * @cancellable: (allow-none): a #GCancellable
20073  * @error: a #GError, or %NULL
20074  *
20075  * Opens a file for reading. The result is a #GFileInputStream that
20076  * can be used to read the contents of the file.
20077  *
20078  * If @cancellable is not %NULL, then the operation can be cancelled by
20079  * triggering the cancellable object from another thread. If the operation
20080  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20081  *
20082  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20083  * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20084  * error will be returned. Other errors are possible too, and depend
20085  * on what kind of filesystem the file is on.
20086  *
20087  * Virtual: read_fn
20088  * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20089  */
20090
20091
20092 /**
20093  * g_file_read_async:
20094  * @file: input #GFile
20095  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20096  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20097  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20098  * @user_data: (closure): the data to pass to callback function
20099  *
20100  * Asynchronously opens @file for reading.
20101  *
20102  * For more details, see g_file_read() which is
20103  * the synchronous version of this call.
20104  *
20105  * When the operation is finished, @callback will be called.
20106  * You can then call g_file_read_finish() to get the result
20107  * of the operation.
20108  */
20109
20110
20111 /**
20112  * g_file_read_finish:
20113  * @file: input #GFile
20114  * @res: a #GAsyncResult
20115  * @error: a #GError, or %NULL
20116  *
20117  * Finishes an asynchronous file read operation started with
20118  * g_file_read_async().
20119  *
20120  * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20121  */
20122
20123
20124 /**
20125  * g_file_replace:
20126  * @file: input #GFile
20127  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20128  * @make_backup: %TRUE if a backup should be created
20129  * @flags: a set of #GFileCreateFlags
20130  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20131  * @error: a #GError, or %NULL
20132  *
20133  * Returns an output stream for overwriting the file, possibly
20134  * creating a backup copy of the file first. If the file doesn't exist,
20135  * it will be created.
20136  *
20137  * This will try to replace the file in the safest way possible so
20138  * that any errors during the writing will not affect an already
20139  * existing copy of the file. For instance, for local files it
20140  * may write to a temporary file and then atomically rename over
20141  * the destination when the stream is closed.
20142  *
20143  * By default files created are generally readable by everyone,
20144  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20145  * will be made readable only to the current user, to the level that
20146  * is supported on the target filesystem.
20147  *
20148  * If @cancellable is not %NULL, then the operation can be cancelled
20149  * by triggering the cancellable object from another thread. If the
20150  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20151  * returned.
20152  *
20153  * If you pass in a non-%NULL @etag value, then this value is
20154  * compared to the current entity tag of the file, and if they differ
20155  * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20156  * that the file has been changed since you last read it. You can get
20157  * the new etag from g_file_output_stream_get_etag() after you've
20158  * finished writing and closed the #GFileOutputStream. When you load
20159  * a new file you can use g_file_input_stream_query_info() to get
20160  * the etag of the file.
20161  *
20162  * If @make_backup is %TRUE, this function will attempt to make a
20163  * backup of the current file before overwriting it. If this fails
20164  * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20165  * want to replace anyway, try again with @make_backup set to %FALSE.
20166  *
20167  * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20168  * be returned, and if the file is some other form of non-regular file
20169  * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20170  * file systems don't allow all file names, and may return an
20171  * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20172  * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20173  * possible too, and depend on what kind of filesystem the file is on.
20174  *
20175  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20176  */
20177
20178
20179 /**
20180  * g_file_replace_async:
20181  * @file: input #GFile
20182  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20183  * @make_backup: %TRUE if a backup should be created
20184  * @flags: a set of #GFileCreateFlags
20185  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20186  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20187  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20188  * @user_data: (closure): the data to pass to callback function
20189  *
20190  * Asynchronously overwrites the file, replacing the contents,
20191  * possibly creating a backup copy of the file first.
20192  *
20193  * For more details, see g_file_replace() which is
20194  * the synchronous version of this call.
20195  *
20196  * When the operation is finished, @callback will be called.
20197  * You can then call g_file_replace_finish() to get the result
20198  * of the operation.
20199  */
20200
20201
20202 /**
20203  * g_file_replace_contents:
20204  * @file: input #GFile
20205  * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20206  * @length: the length of @contents in bytes
20207  * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20208  * @make_backup: %TRUE if a backup should be created
20209  * @flags: a set of #GFileCreateFlags
20210  * @new_etag: (allow-none) (out): a location to a new <link linkend="gfile-etag">entity tag</link> for the document. This should be freed with g_free() when no longer needed, or %NULL
20211  * @cancellable: optional #GCancellable object, %NULL to ignore
20212  * @error: a #GError, or %NULL
20213  *
20214  * Replaces the contents of @file with @contents of @length bytes.
20215  *
20216  * If @etag is specified (not %NULL), any existing file must have that etag,
20217  * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20218  *
20219  * If @make_backup is %TRUE, this function will attempt to make a backup
20220  * of @file.
20221  *
20222  * If @cancellable is not %NULL, then the operation can be cancelled by
20223  * triggering the cancellable object from another thread. If the operation
20224  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20225  *
20226  * The returned @new_etag can be used to verify that the file hasn't
20227  * changed the next time it is saved over.
20228  *
20229  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20230  */
20231
20232
20233 /**
20234  * g_file_replace_contents_async:
20235  * @file: input #GFile
20236  * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20237  * @length: the length of @contents in bytes
20238  * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20239  * @make_backup: %TRUE if a backup should be created
20240  * @flags: a set of #GFileCreateFlags
20241  * @cancellable: optional #GCancellable object, %NULL to ignore
20242  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20243  * @user_data: the data to pass to callback function
20244  *
20245  * Starts an asynchronous replacement of @file with the given
20246  * @contents of @length bytes. @etag will replace the document's
20247  * current entity tag.
20248  *
20249  * When this operation has completed, @callback will be called with
20250  * @user_user data, and the operation can be finalized with
20251  * g_file_replace_contents_finish().
20252  *
20253  * If @cancellable is not %NULL, then the operation can be cancelled by
20254  * triggering the cancellable object from another thread. If the operation
20255  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20256  *
20257  * If @make_backup is %TRUE, this function will attempt to
20258  * make a backup of @file.
20259  */
20260
20261
20262 /**
20263  * g_file_replace_contents_finish:
20264  * @file: input #GFile
20265  * @res: a #GAsyncResult
20266  * @new_etag: (out) (allow-none): a location of a new <link linkend="gfile-etag">entity tag</link> for the document. This should be freed with g_free() when it is no longer needed, or %NULL
20267  * @error: a #GError, or %NULL
20268  *
20269  * Finishes an asynchronous replace of the given @file. See
20270  * g_file_replace_contents_async(). Sets @new_etag to the new entity
20271  * tag for the document, if present.
20272  *
20273  * Returns: %TRUE on success, %FALSE on failure.
20274  */
20275
20276
20277 /**
20278  * g_file_replace_finish:
20279  * @file: input #GFile
20280  * @res: a #GAsyncResult
20281  * @error: a #GError, or %NULL
20282  *
20283  * Finishes an asynchronous file replace operation started with
20284  * g_file_replace_async().
20285  *
20286  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20287  */
20288
20289
20290 /**
20291  * g_file_replace_readwrite:
20292  * @file: a #GFile
20293  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20294  * @make_backup: %TRUE if a backup should be created
20295  * @flags: a set of #GFileCreateFlags
20296  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20297  * @error: return location for a #GError, or %NULL
20298  *
20299  * Returns an output stream for overwriting the file in readwrite mode,
20300  * possibly creating a backup copy of the file first. If the file doesn't
20301  * exist, it will be created.
20302  *
20303  * For details about the behaviour, see g_file_replace() which does the
20304  * same thing but returns an output stream only.
20305  *
20306  * Note that in many non-local file cases read and write streams are not
20307  * supported, so make sure you really need to do read and write streaming,
20308  * rather than just opening for reading or writing.
20309  *
20310  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20311  * Since: 2.22
20312  */
20313
20314
20315 /**
20316  * g_file_replace_readwrite_async:
20317  * @file: input #GFile
20318  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20319  * @make_backup: %TRUE if a backup should be created
20320  * @flags: a set of #GFileCreateFlags
20321  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20322  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20323  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20324  * @user_data: (closure): the data to pass to callback function
20325  *
20326  * Asynchronously overwrites the file in read-write mode,
20327  * replacing the contents, possibly creating a backup copy
20328  * of the file first.
20329  *
20330  * For more details, see g_file_replace_readwrite() which is
20331  * the synchronous version of this call.
20332  *
20333  * When the operation is finished, @callback will be called.
20334  * You can then call g_file_replace_readwrite_finish() to get
20335  * the result of the operation.
20336  *
20337  * Since: 2.22
20338  */
20339
20340
20341 /**
20342  * g_file_replace_readwrite_finish:
20343  * @file: input #GFile
20344  * @res: a #GAsyncResult
20345  * @error: a #GError, or %NULL
20346  *
20347  * Finishes an asynchronous file replace operation started with
20348  * g_file_replace_readwrite_async().
20349  *
20350  * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20351  * Since: 2.22
20352  */
20353
20354
20355 /**
20356  * g_file_resolve_relative_path:
20357  * @file: input #GFile
20358  * @relative_path: a given relative path string
20359  *
20360  * Resolves a relative path for @file to an absolute path.
20361  *
20362  * This call does no blocking I/O.
20363  *
20364  * Returns: (transfer full): #GFile to the resolved path. %NULL if @relative_path is %NULL or if @file is invalid. Free the returned object with g_object_unref().
20365  */
20366
20367
20368 /**
20369  * g_file_set_attribute:
20370  * @file: input #GFile
20371  * @attribute: a string containing the attribute's name
20372  * @type: The type of the attribute
20373  * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20374  * @flags: a set of #GFileQueryInfoFlags
20375  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20376  * @error: a #GError, or %NULL
20377  *
20378  * Sets an attribute in the file with attribute name @attribute to @value.
20379  *
20380  * Some attributes can be unset by setting @attribute to
20381  * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20382  *
20383  * If @cancellable is not %NULL, then the operation can be cancelled by
20384  * triggering the cancellable object from another thread. If the operation
20385  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20386  *
20387  * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20388  */
20389
20390
20391 /**
20392  * g_file_set_attribute_byte_string:
20393  * @file: input #GFile
20394  * @attribute: a string containing the attribute's name
20395  * @value: a string containing the attribute's new value
20396  * @flags: a #GFileQueryInfoFlags
20397  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20398  * @error: a #GError, or %NULL
20399  *
20400  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20401  * If @attribute is of a different type, this operation will fail,
20402  * returning %FALSE.
20403  *
20404  * If @cancellable is not %NULL, then the operation can be cancelled by
20405  * triggering the cancellable object from another thread. If the operation
20406  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20407  *
20408  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20409  */
20410
20411
20412 /**
20413  * g_file_set_attribute_int32:
20414  * @file: input #GFile
20415  * @attribute: a string containing the attribute's name
20416  * @value: a #gint32 containing the attribute's new value
20417  * @flags: a #GFileQueryInfoFlags
20418  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20419  * @error: a #GError, or %NULL
20420  *
20421  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20422  * If @attribute is of a different type, this operation will fail.
20423  *
20424  * If @cancellable is not %NULL, then the operation can be cancelled by
20425  * triggering the cancellable object from another thread. If the operation
20426  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20427  *
20428  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20429  */
20430
20431
20432 /**
20433  * g_file_set_attribute_int64:
20434  * @file: input #GFile
20435  * @attribute: a string containing the attribute's name
20436  * @value: a #guint64 containing the attribute's new value
20437  * @flags: a #GFileQueryInfoFlags
20438  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20439  * @error: a #GError, or %NULL
20440  *
20441  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20442  * If @attribute is of a different type, this operation will fail.
20443  *
20444  * If @cancellable is not %NULL, then the operation can be cancelled by
20445  * triggering the cancellable object from another thread. If the operation
20446  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20447  *
20448  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20449  */
20450
20451
20452 /**
20453  * g_file_set_attribute_string:
20454  * @file: input #GFile
20455  * @attribute: a string containing the attribute's name
20456  * @value: a string containing the attribute's value
20457  * @flags: #GFileQueryInfoFlags
20458  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20459  * @error: a #GError, or %NULL
20460  *
20461  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20462  * If @attribute is of a different type, this operation will fail.
20463  *
20464  * If @cancellable is not %NULL, then the operation can be cancelled by
20465  * triggering the cancellable object from another thread. If the operation
20466  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20467  *
20468  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20469  */
20470
20471
20472 /**
20473  * g_file_set_attribute_uint32:
20474  * @file: input #GFile
20475  * @attribute: a string containing the attribute's name
20476  * @value: a #guint32 containing the attribute's new value
20477  * @flags: a #GFileQueryInfoFlags
20478  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20479  * @error: a #GError, or %NULL
20480  *
20481  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20482  * If @attribute is of a different type, this operation will fail.
20483  *
20484  * If @cancellable is not %NULL, then the operation can be cancelled by
20485  * triggering the cancellable object from another thread. If the operation
20486  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20487  *
20488  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20489  */
20490
20491
20492 /**
20493  * g_file_set_attribute_uint64:
20494  * @file: input #GFile
20495  * @attribute: a string containing the attribute's name
20496  * @value: a #guint64 containing the attribute's new value
20497  * @flags: a #GFileQueryInfoFlags
20498  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20499  * @error: a #GError, or %NULL
20500  *
20501  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20502  * If @attribute is of a different type, this operation will fail.
20503  *
20504  * If @cancellable is not %NULL, then the operation can be cancelled by
20505  * triggering the cancellable object from another thread. If the operation
20506  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20507  *
20508  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20509  */
20510
20511
20512 /**
20513  * g_file_set_attributes_async:
20514  * @file: input #GFile
20515  * @info: a #GFileInfo
20516  * @flags: a #GFileQueryInfoFlags
20517  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20518  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20519  * @callback: (scope async): a #GAsyncReadyCallback
20520  * @user_data: (closure): a #gpointer
20521  *
20522  * Asynchronously sets the attributes of @file with @info.
20523  *
20524  * For more details, see g_file_set_attributes_from_info(),
20525  * which is the synchronous version of this call.
20526  *
20527  * When the operation is finished, @callback will be called.
20528  * You can then call g_file_set_attributes_finish() to get
20529  * the result of the operation.
20530  */
20531
20532
20533 /**
20534  * g_file_set_attributes_finish:
20535  * @file: input #GFile
20536  * @result: a #GAsyncResult
20537  * @info: (out) (transfer full): a #GFileInfo
20538  * @error: a #GError, or %NULL
20539  *
20540  * Finishes setting an attribute started in g_file_set_attributes_async().
20541  *
20542  * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20543  */
20544
20545
20546 /**
20547  * g_file_set_attributes_from_info:
20548  * @file: input #GFile
20549  * @info: a #GFileInfo
20550  * @flags: #GFileQueryInfoFlags
20551  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20552  * @error: a #GError, or %NULL
20553  *
20554  * Tries to set all attributes in the #GFileInfo on the target
20555  * values, not stopping on the first error.
20556  *
20557  * If there is any error during this operation then @error will
20558  * be set to the first error. Error on particular fields are flagged
20559  * by setting the "status" field in the attribute value to
20560  * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
20561  * also detect further errors.
20562  *
20563  * If @cancellable is not %NULL, then the operation can be cancelled by
20564  * triggering the cancellable object from another thread. If the operation
20565  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20566  *
20567  * Returns: %FALSE if there was any error, %TRUE otherwise.
20568  */
20569
20570
20571 /**
20572  * g_file_set_display_name:
20573  * @file: input #GFile
20574  * @display_name: a string
20575  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20576  * @error: a #GError, or %NULL
20577  *
20578  * Renames @file to the specified display name.
20579  *
20580  * The display name is converted from UTF-8 to the correct encoding
20581  * for the target filesystem if possible and the @file is renamed to this.
20582  *
20583  * If you want to implement a rename operation in the user interface the
20584  * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
20585  * initial value in the rename widget, and then the result after editing
20586  * should be passed to g_file_set_display_name().
20587  *
20588  * On success the resulting converted filename is returned.
20589  *
20590  * If @cancellable is not %NULL, then the operation can be cancelled by
20591  * triggering the cancellable object from another thread. If the operation
20592  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20593  *
20594  * Returns: (transfer full): a #GFile specifying what @file was renamed to, or %NULL if there was an error. Free the returned object with g_object_unref().
20595  */
20596
20597
20598 /**
20599  * g_file_set_display_name_async:
20600  * @file: input #GFile
20601  * @display_name: a string
20602  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20603  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20604  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20605  * @user_data: (closure): the data to pass to callback function
20606  *
20607  * Asynchronously sets the display name for a given #GFile.
20608  *
20609  * For more details, see g_file_set_display_name() which is
20610  * the synchronous version of this call.
20611  *
20612  * When the operation is finished, @callback will be called.
20613  * You can then call g_file_set_display_name_finish() to get
20614  * the result of the operation.
20615  */
20616
20617
20618 /**
20619  * g_file_set_display_name_finish:
20620  * @file: input #GFile
20621  * @res: a #GAsyncResult
20622  * @error: a #GError, or %NULL
20623  *
20624  * Finishes setting a display name started with
20625  * g_file_set_display_name_async().
20626  *
20627  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20628  */
20629
20630
20631 /**
20632  * g_file_start_mountable:
20633  * @file: input #GFile
20634  * @flags: flags affecting the operation
20635  * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20636  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20637  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20638  * @user_data: the data to pass to callback function
20639  *
20640  * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20641  * Using @start_operation, you can request callbacks when, for instance,
20642  * passwords are needed during authentication.
20643  *
20644  * If @cancellable is not %NULL, then the operation can be cancelled by
20645  * triggering the cancellable object from another thread. If the operation
20646  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20647  *
20648  * When the operation is finished, @callback will be called.
20649  * You can then call g_file_mount_mountable_finish() to get
20650  * the result of the operation.
20651  *
20652  * Since: 2.22
20653  */
20654
20655
20656 /**
20657  * g_file_start_mountable_finish:
20658  * @file: input #GFile
20659  * @result: a #GAsyncResult
20660  * @error: a #GError, or %NULL
20661  *
20662  * Finishes a start operation. See g_file_start_mountable() for details.
20663  *
20664  * Finish an asynchronous start operation that was started
20665  * with g_file_start_mountable().
20666  *
20667  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20668  * Since: 2.22
20669  */
20670
20671
20672 /**
20673  * g_file_stop_mountable:
20674  * @file: input #GFile
20675  * @flags: flags affecting the operation
20676  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20677  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20678  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20679  * @user_data: the data to pass to callback function
20680  *
20681  * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20682  *
20683  * If @cancellable is not %NULL, then the operation can be cancelled by
20684  * triggering the cancellable object from another thread. If the operation
20685  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20686  *
20687  * When the operation is finished, @callback will be called.
20688  * You can then call g_file_stop_mountable_finish() to get
20689  * the result of the operation.
20690  *
20691  * Since: 2.22
20692  */
20693
20694
20695 /**
20696  * g_file_stop_mountable_finish:
20697  * @file: input #GFile
20698  * @result: a #GAsyncResult
20699  * @error: a #GError, or %NULL
20700  *
20701  * Finishes an stop operation, see g_file_stop_mountable() for details.
20702  *
20703  * Finish an asynchronous stop operation that was started
20704  * with g_file_stop_mountable().
20705  *
20706  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20707  * Since: 2.22
20708  */
20709
20710
20711 /**
20712  * g_file_supports_thread_contexts:
20713  * @file: a #GFile
20714  *
20715  * Checks if @file supports <link
20716  * linkend="g-main-context-push-thread-default-context">thread-default
20717  * contexts</link>. If this returns %FALSE, you cannot perform
20718  * asynchronous operations on @file in a thread that has a
20719  * thread-default context.
20720  *
20721  * Returns: Whether or not @file supports thread-default contexts.
20722  * Since: 2.22
20723  */
20724
20725
20726 /**
20727  * g_file_trash:
20728  * @file: #GFile to send to trash
20729  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20730  * @error: a #GError, or %NULL
20731  *
20732  * Sends @file to the "Trashcan", if possible. This is similar to
20733  * deleting it, but the user can recover it before emptying the trashcan.
20734  * Not all file systems support trashing, so this call can return the
20735  * %G_IO_ERROR_NOT_SUPPORTED error.
20736  *
20737  * If @cancellable is not %NULL, then the operation can be cancelled by
20738  * triggering the cancellable object from another thread. If the operation
20739  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20740  *
20741  * Virtual: trash
20742  * Returns: %TRUE on successful trash, %FALSE otherwise.
20743  */
20744
20745
20746 /**
20747  * g_file_trash_async:
20748  * @file: input #GFile
20749  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20750  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20751  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20752  * @user_data: the data to pass to callback function
20753  *
20754  * Asynchronously sends @file to the Trash location, if possible.
20755  *
20756  * Virtual: trash_async
20757  * Since: 2.38
20758  */
20759
20760
20761 /**
20762  * g_file_trash_finish:
20763  * @file: input #GFile
20764  * @result: a #GAsyncResult
20765  * @error: a #GError, or %NULL
20766  *
20767  * Finishes an asynchronous file trashing operation, started with
20768  * g_file_trash_async().
20769  *
20770  * Virtual: trash_finish
20771  * Returns: %TRUE on successful trash, %FALSE otherwise.
20772  * Since: 2.38
20773  */
20774
20775
20776 /**
20777  * g_file_unmount_mountable:
20778  * @file: input #GFile
20779  * @flags: flags affecting the operation
20780  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20781  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20782  * @user_data: (closure): the data to pass to callback function
20783  *
20784  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20785  *
20786  * If @cancellable is not %NULL, then the operation can be cancelled by
20787  * triggering the cancellable object from another thread. If the operation
20788  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20789  *
20790  * When the operation is finished, @callback will be called.
20791  * You can then call g_file_unmount_mountable_finish() to get
20792  * the result of the operation.
20793  *
20794  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20795  */
20796
20797
20798 /**
20799  * g_file_unmount_mountable_finish:
20800  * @file: input #GFile
20801  * @result: a #GAsyncResult
20802  * @error: a #GError, or %NULL
20803  *
20804  * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20805  *
20806  * Finish an asynchronous unmount operation that was started
20807  * with g_file_unmount_mountable().
20808  *
20809  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20810  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20811  */
20812
20813
20814 /**
20815  * g_file_unmount_mountable_with_operation:
20816  * @file: input #GFile
20817  * @flags: flags affecting the operation
20818  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20819  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20820  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20821  * @user_data: (closure): the data to pass to callback function
20822  *
20823  * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20824  *
20825  * If @cancellable is not %NULL, then the operation can be cancelled by
20826  * triggering the cancellable object from another thread. If the operation
20827  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20828  *
20829  * When the operation is finished, @callback will be called.
20830  * You can then call g_file_unmount_mountable_finish() to get
20831  * the result of the operation.
20832  *
20833  * Since: 2.22
20834  */
20835
20836
20837 /**
20838  * g_file_unmount_mountable_with_operation_finish:
20839  * @file: input #GFile
20840  * @result: a #GAsyncResult
20841  * @error: a #GError, or %NULL
20842  *
20843  * Finishes an unmount operation,
20844  * see g_file_unmount_mountable_with_operation() for details.
20845  *
20846  * Finish an asynchronous unmount operation that was started
20847  * with g_file_unmount_mountable_with_operation().
20848  *
20849  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20850  * Since: 2.22
20851  */
20852
20853
20854 /**
20855  * g_filename_completer_get_completion_suffix:
20856  * @completer: the filename completer.
20857  * @initial_text: text to be completed.
20858  *
20859  * Obtains a completion for @initial_text from @completer.
20860  *
20861  * Returns: a completed string, or %NULL if no completion exists. This string is not owned by GIO, so remember to g_free() it when finished.
20862  */
20863
20864
20865 /**
20866  * g_filename_completer_get_completions:
20867  * @completer: the filename completer.
20868  * @initial_text: text to be completed.
20869  *
20870  * Gets an array of completion strings for a given initial text.
20871  *
20872  * Returns: (array zero-terminated=1) (transfer full): array of strings with possible completions for @initial_text. This array must be freed by g_strfreev() when finished.
20873  */
20874
20875
20876 /**
20877  * g_filename_completer_new:
20878  *
20879  * Creates a new filename completer.
20880  *
20881  * Returns: a #GFilenameCompleter.
20882  */
20883
20884
20885 /**
20886  * g_filename_completer_set_dirs_only:
20887  * @completer: the filename completer.
20888  * @dirs_only: a #gboolean.
20889  *
20890  * If @dirs_only is %TRUE, @completer will only
20891  * complete directory names, and not file names.
20892  */
20893
20894
20895 /**
20896  * g_filter_input_stream_get_base_stream:
20897  * @stream: a #GFilterInputStream.
20898  *
20899  * Gets the base stream for the filter stream.
20900  *
20901  * Returns: (transfer none): a #GInputStream.
20902  */
20903
20904
20905 /**
20906  * g_filter_input_stream_get_close_base_stream:
20907  * @stream: a #GFilterInputStream.
20908  *
20909  * Returns whether the base stream will be closed when @stream is
20910  * closed.
20911  *
20912  * Returns: %TRUE if the base stream will be closed.
20913  */
20914
20915
20916 /**
20917  * g_filter_input_stream_set_close_base_stream:
20918  * @stream: a #GFilterInputStream.
20919  * @close_base: %TRUE to close the base stream.
20920  *
20921  * Sets whether the base stream will be closed when @stream is closed.
20922  */
20923
20924
20925 /**
20926  * g_filter_output_stream_get_base_stream:
20927  * @stream: a #GFilterOutputStream.
20928  *
20929  * Gets the base stream for the filter stream.
20930  *
20931  * Returns: (transfer none): a #GOutputStream.
20932  */
20933
20934
20935 /**
20936  * g_filter_output_stream_get_close_base_stream:
20937  * @stream: a #GFilterOutputStream.
20938  *
20939  * Returns whether the base stream will be closed when @stream is
20940  * closed.
20941  *
20942  * Returns: %TRUE if the base stream will be closed.
20943  */
20944
20945
20946 /**
20947  * g_filter_output_stream_set_close_base_stream:
20948  * @stream: a #GFilterOutputStream.
20949  * @close_base: %TRUE to close the base stream.
20950  *
20951  * Sets whether the base stream will be closed when @stream is closed.
20952  */
20953
20954
20955 /**
20956  * g_icon_deserialize:
20957  * @value: a #GVariant created with g_icon_serialize()
20958  *
20959  * Deserializes a #GIcon previously serialized using g_icon_serialize().
20960  *
20961  * Returns: (transfer full): a #GIcon, or %NULL when deserialization fails.
20962  * Since: 2.38
20963  */
20964
20965
20966 /**
20967  * g_icon_equal:
20968  * @icon1: (allow-none): pointer to the first #GIcon.
20969  * @icon2: (allow-none): pointer to the second #GIcon.
20970  *
20971  * Checks if two icons are equal.
20972  *
20973  * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20974  */
20975
20976
20977 /**
20978  * g_icon_hash:
20979  * @icon: #gconstpointer to an icon object.
20980  *
20981  * Gets a hash for an icon.
20982  *
20983  * Virtual: hash
20984  * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20985  */
20986
20987
20988 /**
20989  * g_icon_new_for_string:
20990  * @str: A string obtained via g_icon_to_string().
20991  * @error: Return location for error.
20992  *
20993  * Generate a #GIcon instance from @str. This function can fail if
20994  * @str is not valid - see g_icon_to_string() for discussion.
20995  *
20996  * If your application or library provides one or more #GIcon
20997  * implementations you need to ensure that each #GType is registered
20998  * with the type system prior to calling g_icon_new_for_string().
20999  *
21000  * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
21001  * Since: 2.20
21002  */
21003
21004
21005 /**
21006  * g_icon_serialize:
21007  * @icon: a #GIcon
21008  *
21009  * Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved
21010  * back by calling g_icon_deserialize() on the returned value.
21011  * As serialization will avoid using raw icon data when possible, it only
21012  * makes sense to transfer the #GVariant between processes on the same machine,
21013  * (as opposed to over the network), and within the same file system namespace.
21014  *
21015  * Returns: (transfer full): a #GVariant, or %NULL when serialization fails.
21016  * Since: 2.38
21017  */
21018
21019
21020 /**
21021  * g_icon_to_string:
21022  * @icon: a #GIcon.
21023  *
21024  * Generates a textual representation of @icon that can be used for
21025  * serialization such as when passing @icon to a different process or
21026  * saving it to persistent storage. Use g_icon_new_for_string() to
21027  * get @icon back from the returned string.
21028  *
21029  * The encoding of the returned string is proprietary to #GIcon except
21030  * in the following two cases
21031  *
21032  * <itemizedlist>
21033  * <listitem><para>
21034  *     If @icon is a #GFileIcon, the returned string is a native path
21035  *     (such as <literal>/path/to/my icon.png</literal>) without escaping
21036  *     if the #GFile for @icon is a native file.  If the file is not
21037  *     native, the returned string is the result of g_file_get_uri()
21038  *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
21039  * </para></listitem>
21040  * <listitem><para>
21041  *    If @icon is a #GThemedIcon with exactly one name, the encoding is
21042  *    simply the name (such as <literal>network-server</literal>).
21043  * </para></listitem>
21044  * </itemizedlist>
21045  *
21046  * Virtual: to_tokens
21047  * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
21048  * Since: 2.20
21049  */
21050
21051
21052 /**
21053  * g_inet_address_equal:
21054  * @address: A #GInetAddress.
21055  * @other_address: Another #GInetAddress.
21056  *
21057  * Checks if two #GInetAddress instances are equal, e.g. the same address.
21058  *
21059  * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
21060  * Since: 2.30
21061  */
21062
21063
21064 /**
21065  * g_inet_address_get_family:
21066  * @address: a #GInetAddress
21067  *
21068  * Gets @address's family
21069  *
21070  * Returns: @address's family
21071  * Since: 2.22
21072  */
21073
21074
21075 /**
21076  * g_inet_address_get_is_any:
21077  * @address: a #GInetAddress
21078  *
21079  * Tests whether @address is the "any" address for its family.
21080  *
21081  * Returns: %TRUE if @address is the "any" address for its family.
21082  * Since: 2.22
21083  */
21084
21085
21086 /**
21087  * g_inet_address_get_is_link_local:
21088  * @address: a #GInetAddress
21089  *
21090  * Tests whether @address is a link-local address (that is, if it
21091  * identifies a host on a local network that is not connected to the
21092  * Internet).
21093  *
21094  * Returns: %TRUE if @address is a link-local address.
21095  * Since: 2.22
21096  */
21097
21098
21099 /**
21100  * g_inet_address_get_is_loopback:
21101  * @address: a #GInetAddress
21102  *
21103  * Tests whether @address is the loopback address for its family.
21104  *
21105  * Returns: %TRUE if @address is the loopback address for its family.
21106  * Since: 2.22
21107  */
21108
21109
21110 /**
21111  * g_inet_address_get_is_mc_global:
21112  * @address: a #GInetAddress
21113  *
21114  * Tests whether @address is a global multicast address.
21115  *
21116  * Returns: %TRUE if @address is a global multicast address.
21117  * Since: 2.22
21118  */
21119
21120
21121 /**
21122  * g_inet_address_get_is_mc_link_local:
21123  * @address: a #GInetAddress
21124  *
21125  * Tests whether @address is a link-local multicast address.
21126  *
21127  * Returns: %TRUE if @address is a link-local multicast address.
21128  * Since: 2.22
21129  */
21130
21131
21132 /**
21133  * g_inet_address_get_is_mc_node_local:
21134  * @address: a #GInetAddress
21135  *
21136  * Tests whether @address is a node-local multicast address.
21137  *
21138  * Returns: %TRUE if @address is a node-local multicast address.
21139  * Since: 2.22
21140  */
21141
21142
21143 /**
21144  * g_inet_address_get_is_mc_org_local:
21145  * @address: a #GInetAddress
21146  *
21147  * Tests whether @address is an organization-local multicast address.
21148  *
21149  * Returns: %TRUE if @address is an organization-local multicast address.
21150  * Since: 2.22
21151  */
21152
21153
21154 /**
21155  * g_inet_address_get_is_mc_site_local:
21156  * @address: a #GInetAddress
21157  *
21158  * Tests whether @address is a site-local multicast address.
21159  *
21160  * Returns: %TRUE if @address is a site-local multicast address.
21161  * Since: 2.22
21162  */
21163
21164
21165 /**
21166  * g_inet_address_get_is_multicast:
21167  * @address: a #GInetAddress
21168  *
21169  * Tests whether @address is a multicast address.
21170  *
21171  * Returns: %TRUE if @address is a multicast address.
21172  * Since: 2.22
21173  */
21174
21175
21176 /**
21177  * g_inet_address_get_is_site_local:
21178  * @address: a #GInetAddress
21179  *
21180  * Tests whether @address is a site-local address such as 10.0.0.1
21181  * (that is, the address identifies a host on a local network that can
21182  * not be reached directly from the Internet, but which may have
21183  * outgoing Internet connectivity via a NAT or firewall).
21184  *
21185  * Returns: %TRUE if @address is a site-local address.
21186  * Since: 2.22
21187  */
21188
21189
21190 /**
21191  * g_inet_address_get_native_size:
21192  * @address: a #GInetAddress
21193  *
21194  * Gets the size of the native raw binary address for @address. This
21195  * is the size of the data that you get from g_inet_address_to_bytes().
21196  *
21197  * Returns: the number of bytes used for the native version of @address.
21198  * Since: 2.22
21199  */
21200
21201
21202 /**
21203  * g_inet_address_mask_equal:
21204  * @mask: a #GInetAddressMask
21205  * @mask2: another #GInetAddressMask
21206  *
21207  * Tests if @mask and @mask2 are the same mask.
21208  *
21209  * Returns: whether @mask and @mask2 are the same mask
21210  * Since: 2.32
21211  */
21212
21213
21214 /**
21215  * g_inet_address_mask_get_address:
21216  * @mask: a #GInetAddressMask
21217  *
21218  * Gets @mask's base address
21219  *
21220  * Returns: (transfer none): @mask's base address
21221  * Since: 2.32
21222  */
21223
21224
21225 /**
21226  * g_inet_address_mask_get_family:
21227  * @mask: a #GInetAddressMask
21228  *
21229  * Gets the #GSocketFamily of @mask's address
21230  *
21231  * Returns: the #GSocketFamily of @mask's address
21232  * Since: 2.32
21233  */
21234
21235
21236 /**
21237  * g_inet_address_mask_get_length:
21238  * @mask: a #GInetAddressMask
21239  *
21240  * Gets @mask's length
21241  *
21242  * Returns: @mask's length
21243  * Since: 2.32
21244  */
21245
21246
21247 /**
21248  * g_inet_address_mask_matches:
21249  * @mask: a #GInetAddressMask
21250  * @address: a #GInetAddress
21251  *
21252  * Tests if @address falls within the range described by @mask.
21253  *
21254  * Returns: whether @address falls within the range described by @mask.
21255  * Since: 2.32
21256  */
21257
21258
21259 /**
21260  * g_inet_address_mask_new:
21261  * @addr: a #GInetAddress
21262  * @length: number of bits of @addr to use
21263  * @error: return location for #GError, or %NULL
21264  *
21265  * Creates a new #GInetAddressMask representing all addresses whose
21266  * first @length bits match @addr.
21267  *
21268  * Returns: a new #GInetAddressMask, or %NULL on error
21269  * Since: 2.32
21270  */
21271
21272
21273 /**
21274  * g_inet_address_mask_new_from_string:
21275  * @mask_string: an IP address or address/length string
21276  * @error: return location for #GError, or %NULL
21277  *
21278  * Parses @mask_string as an IP address and (optional) length, and
21279  * creates a new #GInetAddressMask. The length, if present, is
21280  * delimited by a "/". If it is not present, then the length is
21281  * assumed to be the full length of the address.
21282  *
21283  * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21284  * Since: 2.32
21285  */
21286
21287
21288 /**
21289  * g_inet_address_mask_to_string:
21290  * @mask: a #GInetAddressMask
21291  *
21292  * Converts @mask back to its corresponding string form.
21293  *
21294  * Returns: a string corresponding to @mask.
21295  * Since: 2.32
21296  */
21297
21298
21299 /**
21300  * g_inet_address_new_any:
21301  * @family: the address family
21302  *
21303  * Creates a #GInetAddress for the "any" address (unassigned/"don't
21304  * care") for @family.
21305  *
21306  * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21307  * Since: 2.22
21308  */
21309
21310
21311 /**
21312  * g_inet_address_new_from_bytes:
21313  * @bytes: (array) (element-type guint8): raw address data
21314  * @family: the address family of @bytes
21315  *
21316  * Creates a new #GInetAddress from the given @family and @bytes.
21317  * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21318  * %G_SOCKET_FAMILY_IPV6.
21319  *
21320  * Returns: a new #GInetAddress corresponding to @family and @bytes.
21321  * Since: 2.22
21322  */
21323
21324
21325 /**
21326  * g_inet_address_new_from_string:
21327  * @string: a string representation of an IP address
21328  *
21329  * Parses @string as an IP address and creates a new #GInetAddress.
21330  *
21331  * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21332  * Since: 2.22
21333  */
21334
21335
21336 /**
21337  * g_inet_address_new_loopback:
21338  * @family: the address family
21339  *
21340  * Creates a #GInetAddress for the loopback address for @family.
21341  *
21342  * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21343  * Since: 2.22
21344  */
21345
21346
21347 /**
21348  * g_inet_address_to_bytes: (skip)
21349  * @address: a #GInetAddress
21350  *
21351  * Gets the raw binary address data from @address.
21352  *
21353  * Returns: a pointer to an internal array of the bytes in @address, which should not be modified, stored, or freed. The size of this array can be gotten with g_inet_address_get_native_size().
21354  * Since: 2.22
21355  */
21356
21357
21358 /**
21359  * g_inet_address_to_string:
21360  * @address: a #GInetAddress
21361  *
21362  * Converts @address to string form.
21363  *
21364  * Returns: a representation of @address as a string, which should be freed after use.
21365  * Since: 2.22
21366  */
21367
21368
21369 /**
21370  * g_inet_socket_address_get_address:
21371  * @address: a #GInetSocketAddress
21372  *
21373  * Gets @address's #GInetAddress.
21374  *
21375  * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21376  * Since: 2.22
21377  */
21378
21379
21380 /**
21381  * g_inet_socket_address_get_flowinfo:
21382  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21383  *
21384  * Gets the <literal>sin6_flowinfo</literal> field from @address,
21385  * which must be an IPv6 address.
21386  *
21387  * Returns: the flowinfo field
21388  * Since: 2.32
21389  */
21390
21391
21392 /**
21393  * g_inet_socket_address_get_port:
21394  * @address: a #GInetSocketAddress
21395  *
21396  * Gets @address's port.
21397  *
21398  * Returns: the port for @address
21399  * Since: 2.22
21400  */
21401
21402
21403 /**
21404  * g_inet_socket_address_get_scope_id:
21405  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21406  *
21407  * Gets the <literal>sin6_scope_id</literal> field from @address,
21408  * which must be an IPv6 address.
21409  *
21410  * Returns: the scope id field
21411  * Since: 2.32
21412  */
21413
21414
21415 /**
21416  * g_inet_socket_address_new:
21417  * @address: a #GInetAddress
21418  * @port: a port number
21419  *
21420  * Creates a new #GInetSocketAddress for @address and @port.
21421  *
21422  * Returns: a new #GInetSocketAddress
21423  * Since: 2.22
21424  */
21425
21426
21427 /**
21428  * g_initable_init:
21429  * @initable: a #GInitable.
21430  * @cancellable: optional #GCancellable object, %NULL to ignore.
21431  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21432  *
21433  * Initializes the object implementing the interface.
21434  *
21435  * The object must be initialized before any real use after initial
21436  * construction, either with this function or g_async_initable_init_async().
21437  *
21438  * Implementations may also support cancellation. If @cancellable is not %NULL,
21439  * then initialization can be cancelled by triggering the cancellable object
21440  * from another thread. If the operation was cancelled, the error
21441  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21442  * the object doesn't support cancellable initialization the error
21443  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21444  *
21445  * If the object is not initialized, or initialization returns with an
21446  * error, then all operations on the object except g_object_ref() and
21447  * g_object_unref() are considered to be invalid, and have undefined
21448  * behaviour. See the <xref linkend="ginitable"/> section introduction
21449  * for more details.
21450  *
21451  * Implementations of this method must be idempotent, i.e. multiple calls
21452  * to this function with the same argument should return the same results.
21453  * Only the first call initializes the object, further calls return the result
21454  * of the first call. This is so that it's safe to implement the singleton
21455  * pattern in the GObject constructor function.
21456  *
21457  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21458  * Since: 2.22
21459  */
21460
21461
21462 /**
21463  * g_initable_new:
21464  * @object_type: a #GType supporting #GInitable.
21465  * @cancellable: optional #GCancellable object, %NULL to ignore.
21466  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21467  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21468  * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21469  *
21470  * Helper function for constructing #GInitable object. This is
21471  * similar to g_object_new() but also initializes the object
21472  * and returns %NULL, setting an error on failure.
21473  *
21474  * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
21475  * Since: 2.22
21476  */
21477
21478
21479 /**
21480  * g_initable_new_valist:
21481  * @object_type: a #GType supporting #GInitable.
21482  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21483  * @var_args: The var args list generated from @first_property_name.
21484  * @cancellable: optional #GCancellable object, %NULL to ignore.
21485  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21486  *
21487  * Helper function for constructing #GInitable object. This is
21488  * similar to g_object_new_valist() but also initializes the object
21489  * and returns %NULL, setting an error on failure.
21490  *
21491  * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
21492  * Since: 2.22
21493  */
21494
21495
21496 /**
21497  * g_initable_newv:
21498  * @object_type: a #GType supporting #GInitable.
21499  * @n_parameters: the number of parameters in @parameters
21500  * @parameters: (array length=n_parameters): the parameters to use to construct the object
21501  * @cancellable: optional #GCancellable object, %NULL to ignore.
21502  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21503  *
21504  * Helper function for constructing #GInitable object. This is
21505  * similar to g_object_newv() but also initializes the object
21506  * and returns %NULL, setting an error on failure.
21507  *
21508  * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
21509  * Since: 2.22
21510  */
21511
21512
21513 /**
21514  * g_input_stream_clear_pending:
21515  * @stream: input stream
21516  *
21517  * Clears the pending flag on @stream.
21518  */
21519
21520
21521 /**
21522  * g_input_stream_close:
21523  * @stream: A #GInputStream.
21524  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21525  * @error: location to store the error occurring, or %NULL to ignore
21526  *
21527  * Closes the stream, releasing resources related to it.
21528  *
21529  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21530  * Closing a stream multiple times will not return an error.
21531  *
21532  * Streams will be automatically closed when the last reference
21533  * is dropped, but you might want to call this function to make sure
21534  * resources are released as early as possible.
21535  *
21536  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21537  * open after the stream is closed. See the documentation for the individual
21538  * stream for details.
21539  *
21540  * On failure the first error that happened will be reported, but the close
21541  * operation will finish as much as possible. A stream that failed to
21542  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21543  * is important to check and report the error to the user.
21544  *
21545  * If @cancellable is not %NULL, then the operation can be cancelled by
21546  * triggering the cancellable object from another thread. If the operation
21547  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21548  * Cancelling a close will still leave the stream closed, but some streams
21549  * can use a faster close that doesn't block to e.g. check errors.
21550  *
21551  * Returns: %TRUE on success, %FALSE on failure
21552  */
21553
21554
21555 /**
21556  * g_input_stream_close_async:
21557  * @stream: A #GInputStream.
21558  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21559  * @cancellable: (allow-none): optional cancellable object
21560  * @callback: (scope async): callback to call when the request is satisfied
21561  * @user_data: (closure): the data to pass to callback function
21562  *
21563  * Requests an asynchronous closes of the stream, releasing resources related to it.
21564  * When the operation is finished @callback will be called.
21565  * You can then call g_input_stream_close_finish() to get the result of the
21566  * operation.
21567  *
21568  * For behaviour details see g_input_stream_close().
21569  *
21570  * The asyncronous methods have a default fallback that uses threads to implement
21571  * asynchronicity, so they are optional for inheriting classes. However, if you
21572  * override one you must override all.
21573  */
21574
21575
21576 /**
21577  * g_input_stream_close_finish:
21578  * @stream: a #GInputStream.
21579  * @result: a #GAsyncResult.
21580  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21581  *
21582  * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21583  *
21584  * Returns: %TRUE if the stream was closed successfully.
21585  */
21586
21587
21588 /**
21589  * g_input_stream_has_pending:
21590  * @stream: input stream.
21591  *
21592  * Checks if an input stream has pending actions.
21593  *
21594  * Returns: %TRUE if @stream has pending actions.
21595  */
21596
21597
21598 /**
21599  * g_input_stream_is_closed:
21600  * @stream: input stream.
21601  *
21602  * Checks if an input stream is closed.
21603  *
21604  * Returns: %TRUE if the stream is closed.
21605  */
21606
21607
21608 /**
21609  * g_input_stream_read:
21610  * @stream: a #GInputStream.
21611  * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
21612  * @count: the number of bytes that will be read from the stream
21613  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21614  * @error: location to store the error occurring, or %NULL to ignore
21615  *
21616  * Tries to read @count bytes from the stream into the buffer starting at
21617  * @buffer. Will block during this read.
21618  *
21619  * If count is zero returns zero and does nothing. A value of @count
21620  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21621  *
21622  * On success, the number of bytes read into the buffer is returned.
21623  * It is not an error if this is not the same as the requested size, as it
21624  * can happen e.g. near the end of a file. Zero is returned on end of file
21625  * (or if @count is zero),  but never otherwise.
21626  *
21627  * If @cancellable is not %NULL, then the operation can be cancelled by
21628  * triggering the cancellable object from another thread. If the operation
21629  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21630  * operation was partially finished when the operation was cancelled the
21631  * partial result will be returned, without an error.
21632  *
21633  * On error -1 is returned and @error is set accordingly.
21634  *
21635  * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21636  */
21637
21638
21639 /**
21640  * g_input_stream_read_all:
21641  * @stream: a #GInputStream.
21642  * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
21643  * @count: the number of bytes that will be read from the stream
21644  * @bytes_read: (out): location to store the number of bytes that was read from the stream
21645  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21646  * @error: location to store the error occurring, or %NULL to ignore
21647  *
21648  * Tries to read @count bytes from the stream into the buffer starting at
21649  * @buffer. Will block during this read.
21650  *
21651  * This function is similar to g_input_stream_read(), except it tries to
21652  * read as many bytes as requested, only stopping on an error or end of stream.
21653  *
21654  * On a successful read of @count bytes, or if we reached the end of the
21655  * stream,  %TRUE is returned, and @bytes_read is set to the number of bytes
21656  * read into @buffer.
21657  *
21658  * If there is an error during the operation %FALSE is returned and @error
21659  * is set to indicate the error status, @bytes_read is updated to contain
21660  * the number of bytes read into @buffer before the error occurred.
21661  *
21662  * Returns: %TRUE on success, %FALSE if there was an error
21663  */
21664
21665
21666 /**
21667  * g_input_stream_read_async:
21668  * @stream: A #GInputStream.
21669  * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
21670  * @count: the number of bytes that will be read from the stream
21671  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21672  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21673  * @callback: (scope async): callback to call when the request is satisfied
21674  * @user_data: (closure): the data to pass to callback function
21675  *
21676  * Request an asynchronous read of @count bytes from the stream into the buffer
21677  * starting at @buffer. When the operation is finished @callback will be called.
21678  * You can then call g_input_stream_read_finish() to get the result of the
21679  * operation.
21680  *
21681  * During an async request no other sync and async calls are allowed on @stream, and will
21682  * result in %G_IO_ERROR_PENDING errors.
21683  *
21684  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21685  *
21686  * On success, the number of bytes read into the buffer will be passed to the
21687  * callback. It is not an error if this is not the same as the requested size, as it
21688  * can happen e.g. near the end of a file, but generally we try to read
21689  * as many bytes as requested. Zero is returned on end of file
21690  * (or if @count is zero),  but never otherwise.
21691  *
21692  * Any outstanding i/o request with higher priority (lower numerical value) will
21693  * be executed before an outstanding request with lower priority. Default
21694  * priority is %G_PRIORITY_DEFAULT.
21695  *
21696  * The asyncronous methods have a default fallback that uses threads to implement
21697  * asynchronicity, so they are optional for inheriting classes. However, if you
21698  * override one you must override all.
21699  */
21700
21701
21702 /**
21703  * g_input_stream_read_bytes:
21704  * @stream: a #GInputStream.
21705  * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21706  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21707  * @error: location to store the error occurring, or %NULL to ignore
21708  *
21709  * Like g_input_stream_read(), this tries to read @count bytes from
21710  * the stream in a blocking fashion. However, rather than reading into
21711  * a user-supplied buffer, this will create a new #GBytes containing
21712  * the data that was read. This may be easier to use from language
21713  * bindings.
21714  *
21715  * If count is zero, returns a zero-length #GBytes and does nothing. A
21716  * value of @count larger than %G_MAXSSIZE will cause a
21717  * %G_IO_ERROR_INVALID_ARGUMENT error.
21718  *
21719  * On success, a new #GBytes is returned. It is not an error if the
21720  * size of this object is not the same as the requested size, as it
21721  * can happen e.g. near the end of a file. A zero-length #GBytes is
21722  * returned on end of file (or if @count is zero), but never
21723  * otherwise.
21724  *
21725  * If @cancellable is not %NULL, then the operation can be cancelled by
21726  * triggering the cancellable object from another thread. If the operation
21727  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21728  * operation was partially finished when the operation was cancelled the
21729  * partial result will be returned, without an error.
21730  *
21731  * On error %NULL is returned and @error is set accordingly.
21732  *
21733  * Returns: a new #GBytes, or %NULL on error
21734  */
21735
21736
21737 /**
21738  * g_input_stream_read_bytes_async:
21739  * @stream: A #GInputStream.
21740  * @count: the number of bytes that will be read from the stream
21741  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21742  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21743  * @callback: (scope async): callback to call when the request is satisfied
21744  * @user_data: (closure): the data to pass to callback function
21745  *
21746  * Request an asynchronous read of @count bytes from the stream into a
21747  * new #GBytes. When the operation is finished @callback will be
21748  * called. You can then call g_input_stream_read_bytes_finish() to get the
21749  * result of the operation.
21750  *
21751  * During an async request no other sync and async calls are allowed
21752  * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21753  *
21754  * A value of @count larger than %G_MAXSSIZE will cause a
21755  * %G_IO_ERROR_INVALID_ARGUMENT error.
21756  *
21757  * On success, the new #GBytes will be passed to the callback. It is
21758  * not an error if this is smaller than the requested size, as it can
21759  * happen e.g. near the end of a file, but generally we try to read as
21760  * many bytes as requested. Zero is returned on end of file (or if
21761  * @count is zero), but never otherwise.
21762  *
21763  * Any outstanding I/O request with higher priority (lower numerical
21764  * value) will be executed before an outstanding request with lower
21765  * priority. Default priority is %G_PRIORITY_DEFAULT.
21766  */
21767
21768
21769 /**
21770  * g_input_stream_read_bytes_finish:
21771  * @stream: a #GInputStream.
21772  * @result: a #GAsyncResult.
21773  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21774  *
21775  * Finishes an asynchronous stream read-into-#GBytes operation.
21776  *
21777  * Returns: the newly-allocated #GBytes, or %NULL on error
21778  */
21779
21780
21781 /**
21782  * g_input_stream_read_finish:
21783  * @stream: a #GInputStream.
21784  * @result: a #GAsyncResult.
21785  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21786  *
21787  * Finishes an asynchronous stream read operation.
21788  *
21789  * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21790  */
21791
21792
21793 /**
21794  * g_input_stream_set_pending:
21795  * @stream: input stream
21796  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21797  *
21798  * Sets @stream to have actions pending. If the pending flag is
21799  * already set or @stream is closed, it will return %FALSE and set
21800  * @error.
21801  *
21802  * Returns: %TRUE if pending was previously unset and is now set.
21803  */
21804
21805
21806 /**
21807  * g_input_stream_skip:
21808  * @stream: a #GInputStream.
21809  * @count: the number of bytes that will be skipped from the stream
21810  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21811  * @error: location to store the error occurring, or %NULL to ignore
21812  *
21813  * Tries to skip @count bytes from the stream. Will block during the operation.
21814  *
21815  * This is identical to g_input_stream_read(), from a behaviour standpoint,
21816  * but the bytes that are skipped are not returned to the user. Some
21817  * streams have an implementation that is more efficient than reading the data.
21818  *
21819  * This function is optional for inherited classes, as the default implementation
21820  * emulates it using read.
21821  *
21822  * If @cancellable is not %NULL, then the operation can be cancelled by
21823  * triggering the cancellable object from another thread. If the operation
21824  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21825  * operation was partially finished when the operation was cancelled the
21826  * partial result will be returned, without an error.
21827  *
21828  * Returns: Number of bytes skipped, or -1 on error
21829  */
21830
21831
21832 /**
21833  * g_input_stream_skip_async:
21834  * @stream: A #GInputStream.
21835  * @count: the number of bytes that will be skipped from the stream
21836  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21837  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21838  * @callback: (scope async): callback to call when the request is satisfied
21839  * @user_data: (closure): the data to pass to callback function
21840  *
21841  * Request an asynchronous skip of @count bytes from the stream.
21842  * When the operation is finished @callback will be called.
21843  * You can then call g_input_stream_skip_finish() to get the result
21844  * of the operation.
21845  *
21846  * During an async request no other sync and async calls are allowed,
21847  * and will result in %G_IO_ERROR_PENDING errors.
21848  *
21849  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21850  *
21851  * On success, the number of bytes skipped will be passed to the callback.
21852  * It is not an error if this is not the same as the requested size, as it
21853  * can happen e.g. near the end of a file, but generally we try to skip
21854  * as many bytes as requested. Zero is returned on end of file
21855  * (or if @count is zero), but never otherwise.
21856  *
21857  * Any outstanding i/o request with higher priority (lower numerical value)
21858  * will be executed before an outstanding request with lower priority.
21859  * Default priority is %G_PRIORITY_DEFAULT.
21860  *
21861  * The asynchronous methods have a default fallback that uses threads to
21862  * implement asynchronicity, so they are optional for inheriting classes.
21863  * However, if you override one, you must override all.
21864  */
21865
21866
21867 /**
21868  * g_input_stream_skip_finish:
21869  * @stream: a #GInputStream.
21870  * @result: a #GAsyncResult.
21871  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21872  *
21873  * Finishes a stream skip operation.
21874  *
21875  * Returns: the size of the bytes skipped, or %-1 on error.
21876  */
21877
21878
21879 /**
21880  * g_io_error_from_errno:
21881  * @err_no: Error number as defined in errno.h.
21882  *
21883  * Converts errno.h error codes into GIO error codes.
21884  *
21885  * Returns: #GIOErrorEnum value for the given errno.h error number.
21886  */
21887
21888
21889 /**
21890  * g_io_error_from_win32_error:
21891  * @error_code: Windows error number.
21892  *
21893  * Converts some common error codes into GIO error codes. The
21894  * fallback value G_IO_ERROR_FAILED is returned for error codes not
21895  * handled.
21896  *
21897  * Returns: #GIOErrorEnum value for the given error number.
21898  * Since: 2.26
21899  */
21900
21901
21902 /**
21903  * g_io_error_quark:
21904  *
21905  * Gets the GIO Error Quark.
21906  *
21907  * Returns: a #GQuark.
21908  */
21909
21910
21911 /**
21912  * g_io_extension_get_name:
21913  * @extension: a #GIOExtension
21914  *
21915  * Gets the name under which @extension was registered.
21916  *
21917  * Note that the same type may be registered as extension
21918  * for multiple extension points, under different names.
21919  *
21920  * Returns: the name of @extension.
21921  */
21922
21923
21924 /**
21925  * g_io_extension_get_priority:
21926  * @extension: a #GIOExtension
21927  *
21928  * Gets the priority with which @extension was registered.
21929  *
21930  * Returns: the priority of @extension
21931  */
21932
21933
21934 /**
21935  * g_io_extension_get_type:
21936  * @extension: a #GIOExtension
21937  *
21938  * Gets the type associated with @extension.
21939  *
21940  * Returns: the type of @extension
21941  */
21942
21943
21944 /**
21945  * g_io_extension_point_get_extension_by_name:
21946  * @extension_point: a #GIOExtensionPoint
21947  * @name: the name of the extension to get
21948  *
21949  * Finds a #GIOExtension for an extension point by name.
21950  *
21951  * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21952  */
21953
21954
21955 /**
21956  * g_io_extension_point_get_extensions:
21957  * @extension_point: a #GIOExtensionPoint
21958  *
21959  * Gets a list of all extensions that implement this extension point.
21960  * The list is sorted by priority, beginning with the highest priority.
21961  *
21962  * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21963  */
21964
21965
21966 /**
21967  * g_io_extension_point_get_required_type:
21968  * @extension_point: a #GIOExtensionPoint
21969  *
21970  * Gets the required type for @extension_point.
21971  *
21972  * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21973  */
21974
21975
21976 /**
21977  * g_io_extension_point_implement:
21978  * @extension_point_name: the name of the extension point
21979  * @type: the #GType to register as extension
21980  * @extension_name: the name for the extension
21981  * @priority: the priority for the extension
21982  *
21983  * Registers @type as extension for the extension point with name
21984  * @extension_point_name.
21985  *
21986  * If @type has already been registered as an extension for this
21987  * extension point, the existing #GIOExtension object is returned.
21988  *
21989  * Returns: (transfer none): a #GIOExtension object for #GType
21990  */
21991
21992
21993 /**
21994  * g_io_extension_point_lookup:
21995  * @name: the name of the extension point
21996  *
21997  * Looks up an existing extension point.
21998  *
21999  * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
22000  */
22001
22002
22003 /**
22004  * g_io_extension_point_register:
22005  * @name: The name of the extension point
22006  *
22007  * Registers an extension point.
22008  *
22009  * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
22010  */
22011
22012
22013 /**
22014  * g_io_extension_point_set_required_type:
22015  * @extension_point: a #GIOExtensionPoint
22016  * @type: the #GType to require
22017  *
22018  * Sets the required type for @extension_point to @type.
22019  * All implementations must henceforth have this type.
22020  */
22021
22022
22023 /**
22024  * g_io_extension_ref_class:
22025  * @extension: a #GIOExtension
22026  *
22027  * Gets a reference to the class for the type that is
22028  * associated with @extension.
22029  *
22030  * Returns: (transfer full): the #GTypeClass for the type of @extension
22031  */
22032
22033
22034 /**
22035  * g_io_module_new:
22036  * @filename: filename of the shared library module.
22037  *
22038  * Creates a new GIOModule that will load the specific
22039  * shared library when in use.
22040  *
22041  * Returns: a #GIOModule from given @filename, or %NULL on error.
22042  */
22043
22044
22045 /**
22046  * g_io_module_scope_block:
22047  * @scope: a module loading scope
22048  * @basename: the basename to block
22049  *
22050  * Block modules with the given @basename from being loaded when
22051  * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
22052  * or g_io_modules_load_all_in_directory_with_scope().
22053  *
22054  * Since: 2.30
22055  */
22056
22057
22058 /**
22059  * g_io_module_scope_free:
22060  * @scope: a module loading scope
22061  *
22062  * Free a module scope.
22063  *
22064  * Since: 2.30
22065  */
22066
22067
22068 /**
22069  * g_io_module_scope_new:
22070  * @flags: flags for the new scope
22071  *
22072  * Create a new scope for loading of IO modules. A scope can be used for
22073  * blocking duplicate modules, or blocking a module you don't want to load.
22074  *
22075  * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
22076  * which have the same base name as a module that has already been seen
22077  * in this scope.
22078  *
22079  * Returns: (transfer full): the new module scope
22080  * Since: 2.30
22081  */
22082
22083
22084 /**
22085  * g_io_modules_load_all_in_directory:
22086  * @dirname: pathname for a directory containing modules to load.
22087  *
22088  * Loads all the modules in the specified directory.
22089  *
22090  * If don't require all modules to be initialized (and thus registering
22091  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22092  * which allows delayed/lazy loading of modules.
22093  *
22094  * Returns: (element-type GIOModule) (transfer full): a list of #GIOModules loaded from the directory, All the modules are loaded into memory, if you want to unload them (enabling on-demand loading) you must call g_type_module_unuse() on all the modules. Free the list with g_list_free().
22095  */
22096
22097
22098 /**
22099  * g_io_modules_load_all_in_directory_with_scope:
22100  * @dirname: pathname for a directory containing modules to load.
22101  * @scope: a scope to use when scanning the modules.
22102  *
22103  * Loads all the modules in the specified directory.
22104  *
22105  * If don't require all modules to be initialized (and thus registering
22106  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22107  * which allows delayed/lazy loading of modules.
22108  *
22109  * Returns: (element-type GIOModule) (transfer full): a list of #GIOModules loaded from the directory, All the modules are loaded into memory, if you want to unload them (enabling on-demand loading) you must call g_type_module_unuse() on all the modules. Free the list with g_list_free().
22110  * Since: 2.30
22111  */
22112
22113
22114 /**
22115  * g_io_modules_scan_all_in_directory:
22116  * @dirname: pathname for a directory containing modules to scan.
22117  *
22118  * Scans all the modules in the specified directory, ensuring that
22119  * any extension point implemented by a module is registered.
22120  *
22121  * This may not actually load and initialize all the types in each
22122  * module, some modules may be lazily loaded and initialized when
22123  * an extension point it implementes is used with e.g.
22124  * g_io_extension_point_get_extensions() or
22125  * g_io_extension_point_get_extension_by_name().
22126  *
22127  * If you need to guarantee that all types are loaded in all the modules,
22128  * use g_io_modules_load_all_in_directory().
22129  *
22130  * Since: 2.24
22131  */
22132
22133
22134 /**
22135  * g_io_modules_scan_all_in_directory_with_scope:
22136  * @dirname: pathname for a directory containing modules to scan.
22137  * @scope: a scope to use when scanning the modules
22138  *
22139  * Scans all the modules in the specified directory, ensuring that
22140  * any extension point implemented by a module is registered.
22141  *
22142  * This may not actually load and initialize all the types in each
22143  * module, some modules may be lazily loaded and initialized when
22144  * an extension point it implementes is used with e.g.
22145  * g_io_extension_point_get_extensions() or
22146  * g_io_extension_point_get_extension_by_name().
22147  *
22148  * If you need to guarantee that all types are loaded in all the modules,
22149  * use g_io_modules_load_all_in_directory().
22150  *
22151  * Since: 2.30
22152  */
22153
22154
22155 /**
22156  * g_io_scheduler_cancel_all_jobs:
22157  *
22158  * Cancels all cancellable I/O jobs.
22159  *
22160  * A job is cancellable if a #GCancellable was passed into
22161  * g_io_scheduler_push_job().
22162  *
22163  * Deprecated: You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler.
22164  */
22165
22166
22167 /**
22168  * g_io_scheduler_job_send_to_mainloop:
22169  * @job: a #GIOSchedulerJob
22170  * @func: a #GSourceFunc callback that will be called in the original thread
22171  * @user_data: data to pass to @func
22172  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22173  *
22174  * Used from an I/O job to send a callback to be run in the thread
22175  * that the job was started from, waiting for the result (and thus
22176  * blocking the I/O job).
22177  *
22178  * Returns: The return value of @func
22179  * Deprecated: Use g_main_context_invoke().
22180  */
22181
22182
22183 /**
22184  * g_io_scheduler_job_send_to_mainloop_async:
22185  * @job: a #GIOSchedulerJob
22186  * @func: a #GSourceFunc callback that will be called in the original thread
22187  * @user_data: data to pass to @func
22188  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22189  *
22190  * Used from an I/O job to send a callback to be run asynchronously in
22191  * the thread that the job was started from. The callback will be run
22192  * when the main loop is available, but at that time the I/O job might
22193  * have finished. The return value from the callback is ignored.
22194  *
22195  * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22196  * on to this function you have to ensure that it is not freed before
22197  * @func is called, either by passing %NULL as @notify to
22198  * g_io_scheduler_push_job() or by using refcounting for @user_data.
22199  *
22200  * Deprecated: Use g_main_context_invoke().
22201  */
22202
22203
22204 /**
22205  * g_io_scheduler_push_job:
22206  * @job_func: a #GIOSchedulerJobFunc.
22207  * @user_data: data to pass to @job_func
22208  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22209  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22210  * @cancellable: optional #GCancellable object, %NULL to ignore.
22211  *
22212  * Schedules the I/O job to run in another thread.
22213  *
22214  * @notify will be called on @user_data after @job_func has returned,
22215  * regardless whether the job was cancelled or has run to completion.
22216  *
22217  * If @cancellable is not %NULL, it can be used to cancel the I/O job
22218  * by calling g_cancellable_cancel() or by calling
22219  * g_io_scheduler_cancel_all_jobs().
22220  *
22221  * Deprecated: use #GThreadPool or g_task_run_in_thread()
22222  */
22223
22224
22225 /**
22226  * g_io_stream_clear_pending:
22227  * @stream: a #GIOStream
22228  *
22229  * Clears the pending flag on @stream.
22230  *
22231  * Since: 2.22
22232  */
22233
22234
22235 /**
22236  * g_io_stream_close:
22237  * @stream: a #GIOStream
22238  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22239  * @error: location to store the error occurring, or %NULL to ignore
22240  *
22241  * Closes the stream, releasing resources related to it. This will also
22242  * closes the individual input and output streams, if they are not already
22243  * closed.
22244  *
22245  * Once the stream is closed, all other operations will return
22246  * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22247  * return an error.
22248  *
22249  * Closing a stream will automatically flush any outstanding buffers
22250  * in the stream.
22251  *
22252  * Streams will be automatically closed when the last reference
22253  * is dropped, but you might want to call this function to make sure
22254  * resources are released as early as possible.
22255  *
22256  * Some streams might keep the backing store of the stream (e.g. a file
22257  * descriptor) open after the stream is closed. See the documentation for
22258  * the individual stream for details.
22259  *
22260  * On failure the first error that happened will be reported, but the
22261  * close operation will finish as much as possible. A stream that failed
22262  * to close will still return %G_IO_ERROR_CLOSED for all operations.
22263  * Still, it is important to check and report the error to the user,
22264  * otherwise there might be a loss of data as all data might not be written.
22265  *
22266  * If @cancellable is not NULL, then the operation can be cancelled by
22267  * triggering the cancellable object from another thread. If the operation
22268  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22269  * Cancelling a close will still leave the stream closed, but some streams
22270  * can use a faster close that doesn't block to e.g. check errors.
22271  *
22272  * The default implementation of this method just calls close on the
22273  * individual input/output streams.
22274  *
22275  * Returns: %TRUE on success, %FALSE on failure
22276  * Since: 2.22
22277  */
22278
22279
22280 /**
22281  * g_io_stream_close_async:
22282  * @stream: a #GIOStream
22283  * @io_priority: the io priority of the request
22284  * @cancellable: (allow-none): optional cancellable object
22285  * @callback: (scope async): callback to call when the request is satisfied
22286  * @user_data: (closure): the data to pass to callback function
22287  *
22288  * Requests an asynchronous close of the stream, releasing resources
22289  * related to it. When the operation is finished @callback will be
22290  * called. You can then call g_io_stream_close_finish() to get
22291  * the result of the operation.
22292  *
22293  * For behaviour details see g_io_stream_close().
22294  *
22295  * The asynchronous methods have a default fallback that uses threads
22296  * to implement asynchronicity, so they are optional for inheriting
22297  * classes. However, if you override one you must override all.
22298  *
22299  * Since: 2.22
22300  */
22301
22302
22303 /**
22304  * g_io_stream_close_finish:
22305  * @stream: a #GIOStream
22306  * @result: a #GAsyncResult
22307  * @error: a #GError location to store the error occurring, or %NULL to ignore
22308  *
22309  * Closes a stream.
22310  *
22311  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22312  * Since: 2.22
22313  */
22314
22315
22316 /**
22317  * g_io_stream_get_input_stream:
22318  * @stream: a #GIOStream
22319  *
22320  * Gets the input stream for this object. This is used
22321  * for reading.
22322  *
22323  * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22324  * Since: 2.22
22325  */
22326
22327
22328 /**
22329  * g_io_stream_get_output_stream:
22330  * @stream: a #GIOStream
22331  *
22332  * Gets the output stream for this object. This is used for
22333  * writing.
22334  *
22335  * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22336  * Since: 2.22
22337  */
22338
22339
22340 /**
22341  * g_io_stream_has_pending:
22342  * @stream: a #GIOStream
22343  *
22344  * Checks if a stream has pending actions.
22345  *
22346  * Returns: %TRUE if @stream has pending actions.
22347  * Since: 2.22
22348  */
22349
22350
22351 /**
22352  * g_io_stream_is_closed:
22353  * @stream: a #GIOStream
22354  *
22355  * Checks if a stream is closed.
22356  *
22357  * Returns: %TRUE if the stream is closed.
22358  * Since: 2.22
22359  */
22360
22361
22362 /**
22363  * g_io_stream_set_pending:
22364  * @stream: a #GIOStream
22365  * @error: a #GError location to store the error occurring, or %NULL to ignore
22366  *
22367  * Sets @stream to have actions pending. If the pending flag is
22368  * already set or @stream is closed, it will return %FALSE and set
22369  * @error.
22370  *
22371  * Returns: %TRUE if pending was previously unset and is now set.
22372  * Since: 2.22
22373  */
22374
22375
22376 /**
22377  * g_io_stream_splice_async:
22378  * @stream1: a #GIOStream.
22379  * @stream2: a #GIOStream.
22380  * @flags: a set of #GIOStreamSpliceFlags.
22381  * @io_priority: the io priority of the request.
22382  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22383  * @callback: (scope async): a #GAsyncReadyCallback.
22384  * @user_data: (closure): user data passed to @callback.
22385  *
22386  * Asyncronously splice the output stream of @stream1 to the input stream of
22387  * @stream2, and splice the output stream of @stream2 to the input stream of
22388  * @stream1.
22389  *
22390  * When the operation is finished @callback will be called.
22391  * You can then call g_io_stream_splice_finish() to get the
22392  * result of the operation.
22393  *
22394  * Since: 2.28
22395  */
22396
22397
22398 /**
22399  * g_io_stream_splice_finish:
22400  * @result: a #GAsyncResult.
22401  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22402  *
22403  * Finishes an asynchronous io stream splice operation.
22404  *
22405  * Returns: %TRUE on success, %FALSE otherwise.
22406  * Since: 2.28
22407  */
22408
22409
22410 /**
22411  * g_keyfile_settings_backend_new:
22412  * @filename: the filename of the keyfile
22413  * @root_path: the path under which all settings keys appear
22414  * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22415  *
22416  * Creates a keyfile-backed #GSettingsBackend.
22417  *
22418  * The filename of the keyfile to use is given by @filename.
22419  *
22420  * All settings read to or written from the backend must fall under the
22421  * path given in @root_path (which must start and end with a slash and
22422  * not contain two consecutive slashes).  @root_path may be "/".
22423  *
22424  * If @root_group is non-%NULL then it specifies the name of the keyfile
22425  * group used for keys that are written directly below @root_path.  For
22426  * example, if @root_path is "/apps/example/" and @root_group is
22427  * "toplevel", then settings the key "/apps/example/enabled" to a value
22428  * of %TRUE will cause the following to appear in the keyfile:
22429  *
22430  * |[
22431  *   [toplevel]
22432  *   enabled=true
22433  * ]|
22434  *
22435  * If @root_group is %NULL then it is not permitted to store keys
22436  * directly below the @root_path.
22437  *
22438  * For keys not stored directly below @root_path (ie: in a sub-path),
22439  * the name of the subpath (with the final slash stripped) is used as
22440  * the name of the keyfile group.  To continue the example, if
22441  * "/apps/example/profiles/default/font-size" were set to
22442  * 12 then the following would appear in the keyfile:
22443  *
22444  * |[
22445  *   [profiles/default]
22446  *   font-size=12
22447  * ]|
22448  *
22449  * The backend will refuse writes (and return writability as being
22450  * %FALSE) for keys outside of @root_path and, in the event that
22451  * @root_group is %NULL, also for keys directly under @root_path.
22452  * Writes will also be refused if the backend detects that it has the
22453  * inability to rewrite the keyfile (ie: the containing directory is not
22454  * writable).
22455  *
22456  * There is no checking done for your key namespace clashing with the
22457  * syntax of the key file format.  For example, if you have '[' or ']'
22458  * characters in your path names or '=' in your key names you may be in
22459  * trouble.
22460  *
22461  * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22462  */
22463
22464
22465 /**
22466  * g_loadable_icon_load:
22467  * @icon: a #GLoadableIcon.
22468  * @size: an integer.
22469  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22470  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22471  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22472  *
22473  * Loads a loadable icon. For the asynchronous version of this function,
22474  * see g_loadable_icon_load_async().
22475  *
22476  * Returns: (transfer full): a #GInputStream to read the icon from.
22477  */
22478
22479
22480 /**
22481  * g_loadable_icon_load_async:
22482  * @icon: a #GLoadableIcon.
22483  * @size: an integer.
22484  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22485  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22486  * @user_data: (closure): the data to pass to callback function
22487  *
22488  * Loads an icon asynchronously. To finish this function, see
22489  * g_loadable_icon_load_finish(). For the synchronous, blocking
22490  * version of this function, see g_loadable_icon_load().
22491  */
22492
22493
22494 /**
22495  * g_loadable_icon_load_finish:
22496  * @icon: a #GLoadableIcon.
22497  * @res: a #GAsyncResult.
22498  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22499  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22500  *
22501  * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22502  *
22503  * Returns: (transfer full): a #GInputStream to read the icon from.
22504  */
22505
22506
22507 /**
22508  * g_local_vfs_new:
22509  *
22510  * Returns a new #GVfs handle for a local vfs.
22511  *
22512  * Returns: a new #GVfs handle.
22513  */
22514
22515
22516 /**
22517  * g_memory_input_stream_add_bytes:
22518  * @stream: a #GMemoryInputStream
22519  * @bytes: input data
22520  *
22521  * Appends @bytes to data that can be read from the input stream.
22522  *
22523  * Since: 2.34
22524  */
22525
22526
22527 /**
22528  * g_memory_input_stream_add_data:
22529  * @stream: a #GMemoryInputStream
22530  * @data: (array length=len) (element-type guint8) (transfer full): input data
22531  * @len: length of the data, may be -1 if @data is a nul-terminated string
22532  * @destroy: (allow-none): function that is called to free @data, or %NULL
22533  *
22534  * Appends @data to data that can be read from the input stream
22535  */
22536
22537
22538 /**
22539  * g_memory_input_stream_new:
22540  *
22541  * Creates a new empty #GMemoryInputStream.
22542  *
22543  * Returns: a new #GInputStream
22544  */
22545
22546
22547 /**
22548  * g_memory_input_stream_new_from_bytes:
22549  * @bytes: a #GBytes
22550  *
22551  * Creates a new #GMemoryInputStream with data from the given @bytes.
22552  *
22553  * Returns: new #GInputStream read from @bytes
22554  * Since: 2.34
22555  */
22556
22557
22558 /**
22559  * g_memory_input_stream_new_from_data:
22560  * @data: (array length=len) (element-type guint8) (transfer full): input data
22561  * @len: length of the data, may be -1 if @data is a nul-terminated string
22562  * @destroy: (allow-none): function that is called to free @data, or %NULL
22563  *
22564  * Creates a new #GMemoryInputStream with data in memory of a given size.
22565  *
22566  * Returns: new #GInputStream read from @data of @len bytes.
22567  */
22568
22569
22570 /**
22571  * g_memory_output_stream_get_data:
22572  * @ostream: a #GMemoryOutputStream
22573  *
22574  * Gets any loaded data from the @ostream.
22575  *
22576  * Note that the returned pointer may become invalid on the next
22577  * write or truncate operation on the stream.
22578  *
22579  * Returns: (transfer none): pointer to the stream's data
22580  */
22581
22582
22583 /**
22584  * g_memory_output_stream_get_data_size:
22585  * @ostream: a #GMemoryOutputStream
22586  *
22587  * Returns the number of bytes from the start up
22588  * to including the last byte written in the stream
22589  * that has not been truncated away.
22590  *
22591  * Returns: the number of bytes written to the stream
22592  * Since: 2.18
22593  */
22594
22595
22596 /**
22597  * g_memory_output_stream_get_size:
22598  * @ostream: a #GMemoryOutputStream
22599  *
22600  * Gets the size of the currently allocated data area (available from
22601  * g_memory_output_stream_get_data()). If the stream isn't
22602  * growable (no realloc was passed to g_memory_output_stream_new()) then
22603  * this is the maximum size of the stream and further writes
22604  * will return %G_IO_ERROR_NO_SPACE.
22605  *
22606  * Note that for growable streams the returned size may become invalid on
22607  * the next write or truncate operation on the stream.
22608  *
22609  * If you want the number of bytes currently written to the stream, use
22610  * g_memory_output_stream_get_data_size().
22611  *
22612  * Returns: the number of bytes allocated for the data buffer
22613  */
22614
22615
22616 /**
22617  * g_memory_output_stream_new: (skip)
22618  * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22619  * @size: the size of @data
22620  * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22621  * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22622  *
22623  * Creates a new #GMemoryOutputStream.
22624  *
22625  * If @data is non-%NULL, the stream  will use that for its internal storage.
22626  * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22627  * storage when necessary. To construct a fixed-size output stream,
22628  * pass %NULL as @realloc_fn.
22629  *
22630  * |[
22631  * /&ast; a stream that can grow &ast;/
22632  * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22633  *
22634  * /&ast; another stream that can grow &ast;/
22635  * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22636  *
22637  * /&ast; a fixed-size stream &ast;/
22638  * data = malloc (200);
22639  * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22640  * ]|
22641  *
22642  * Returns: A newly created #GMemoryOutputStream object.
22643  */
22644
22645
22646 /**
22647  * g_memory_output_stream_new_resizable:
22648  *
22649  * Creates a new #GMemoryOutputStream, using g_realloc() and g_free()
22650  * for memory allocation.
22651  *
22652  * Since: 2.36
22653  */
22654
22655
22656 /**
22657  * g_memory_output_stream_steal_as_bytes:
22658  * @ostream: a #GMemoryOutputStream
22659  *
22660  * Returns data from the @ostream as a #GBytes. @ostream must be
22661  * closed before calling this function.
22662  *
22663  * Returns: (transfer full): the stream's data
22664  * Since: 2.34
22665  */
22666
22667
22668 /**
22669  * g_memory_output_stream_steal_data:
22670  * @ostream: a #GMemoryOutputStream
22671  *
22672  * Gets any loaded data from the @ostream. Ownership of the data
22673  * is transferred to the caller; when no longer needed it must be
22674  * freed using the free function set in @ostream's
22675  * #GMemoryOutputStream:destroy-function property.
22676  *
22677  * @ostream must be closed before calling this function.
22678  *
22679  * Returns: (transfer full): the stream's data
22680  * Since: 2.26
22681  */
22682
22683
22684 /**
22685  * g_memory_settings_backend_new:
22686  *
22687  * Creates a memory-backed #GSettingsBackend.
22688  *
22689  * This backend allows changes to settings, but does not write them
22690  * to any backing storage, so the next time you run your application,
22691  * the memory backend will start out with the default values again.
22692  *
22693  * Returns: (transfer full): a newly created #GSettingsBackend
22694  * Since: 2.28
22695  */
22696
22697
22698 /**
22699  * g_menu_append:
22700  * @menu: a #GMenu
22701  * @label: (allow-none): the section label, or %NULL
22702  * @detailed_action: (allow-none): the detailed action string, or %NULL
22703  *
22704  * Convenience function for appending a normal menu item to the end of
22705  * @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
22706  * flexible alternative.
22707  *
22708  * Since: 2.32
22709  */
22710
22711
22712 /**
22713  * g_menu_append_item:
22714  * @menu: a #GMenu
22715  * @item: a #GMenuItem to append
22716  *
22717  * Appends @item to the end of @menu.
22718  *
22719  * See g_menu_insert_item() for more information.
22720  *
22721  * Since: 2.32
22722  */
22723
22724
22725 /**
22726  * g_menu_append_section:
22727  * @menu: a #GMenu
22728  * @label: (allow-none): the section label, or %NULL
22729  * @section: a #GMenuModel with the items of the section
22730  *
22731  * Convenience function for appending a section menu item to the end of
22732  * @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for a
22733  * more flexible alternative.
22734  *
22735  * Since: 2.32
22736  */
22737
22738
22739 /**
22740  * g_menu_append_submenu:
22741  * @menu: a #GMenu
22742  * @label: (allow-none): the section label, or %NULL
22743  * @submenu: a #GMenuModel with the items of the submenu
22744  *
22745  * Convenience function for appending a submenu menu item to the end of
22746  * @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22747  * more flexible alternative.
22748  *
22749  * Since: 2.32
22750  */
22751
22752
22753 /**
22754  * g_menu_attribute_iter_get_name:
22755  * @iter: a #GMenuAttributeIter
22756  *
22757  * Gets the name of the attribute at the current iterator position, as
22758  * a string.
22759  *
22760  * The iterator is not advanced.
22761  *
22762  * Returns: the name of the attribute
22763  * Since: 2.32
22764  */
22765
22766
22767 /**
22768  * g_menu_attribute_iter_get_next:
22769  * @iter: a #GMenuAttributeIter
22770  * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22771  * @value: (out) (allow-none) (transfer full): the attribute value
22772  *
22773  * This function combines g_menu_attribute_iter_next() with
22774  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22775  *
22776  * First the iterator is advanced to the next (possibly first) attribute.
22777  * If that fails, then %FALSE is returned and there are no other
22778  * effects.
22779  *
22780  * If successful, @name and @value are set to the name and value of the
22781  * attribute that has just been advanced to.  At this point,
22782  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22783  * return the same values again.
22784  *
22785  * The value returned in @name remains valid for as long as the iterator
22786  * remains at the current position.  The value returned in @value must
22787  * be unreffed using g_variant_unref() when it is no longer in use.
22788  *
22789  * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22790  * Since: 2.32
22791  */
22792
22793
22794 /**
22795  * g_menu_attribute_iter_get_value:
22796  * @iter: a #GMenuAttributeIter
22797  *
22798  * Gets the value of the attribute at the current iterator position.
22799  *
22800  * The iterator is not advanced.
22801  *
22802  * Returns: (transfer full): the value of the current attribute
22803  * Since: 2.32
22804  */
22805
22806
22807 /**
22808  * g_menu_attribute_iter_next:
22809  * @iter: a #GMenuAttributeIter
22810  *
22811  * Attempts to advance the iterator to the next (possibly first)
22812  * attribute.
22813  *
22814  * %TRUE is returned on success, or %FALSE if there are no more
22815  * attributes.
22816  *
22817  * You must call this function when you first acquire the iterator
22818  * to advance it to the first attribute (and determine if the first
22819  * attribute exists at all).
22820  *
22821  * Returns: %TRUE on success, or %FALSE when there are no more attributes
22822  * Since: 2.32
22823  */
22824
22825
22826 /**
22827  * g_menu_freeze:
22828  * @menu: a #GMenu
22829  *
22830  * Marks @menu as frozen.
22831  *
22832  * After the menu is frozen, it is an error to attempt to make any
22833  * changes to it.  In effect this means that the #GMenu API must no
22834  * longer be used.
22835  *
22836  * This function causes g_menu_model_is_mutable() to begin returning
22837  * %FALSE, which has some positive performance implications.
22838  *
22839  * Since: 2.32
22840  */
22841
22842
22843 /**
22844  * g_menu_insert:
22845  * @menu: a #GMenu
22846  * @position: the position at which to insert the item
22847  * @label: (allow-none): the section label, or %NULL
22848  * @detailed_action: (allow-none): the detailed action string, or %NULL
22849  *
22850  * Convenience function for inserting a normal menu item into @menu.
22851  * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22852  * alternative.
22853  *
22854  * Since: 2.32
22855  */
22856
22857
22858 /**
22859  * g_menu_insert_item:
22860  * @menu: a #GMenu
22861  * @position: the position at which to insert the item
22862  * @item: the #GMenuItem to insert
22863  *
22864  * Inserts @item into @menu.
22865  *
22866  * The "insertion" is actually done by copying all of the attribute and
22867  * link values of @item and using them to form a new item within @menu.
22868  * As such, @item itself is not really inserted, but rather, a menu item
22869  * that is exactly the same as the one presently described by @item.
22870  *
22871  * This means that @item is essentially useless after the insertion
22872  * occurs.  Any changes you make to it are ignored unless it is inserted
22873  * again (at which point its updated values will be copied).
22874  *
22875  * You should probably just free @item once you're done.
22876  *
22877  * There are many convenience functions to take care of common cases.
22878  * See g_menu_insert(), g_menu_insert_section() and
22879  * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22880  * each of these functions.
22881  *
22882  * Since: 2.32
22883  */
22884
22885
22886 /**
22887  * g_menu_insert_section:
22888  * @menu: a #GMenu
22889  * @position: the position at which to insert the item
22890  * @label: (allow-none): the section label, or %NULL
22891  * @section: a #GMenuModel with the items of the section
22892  *
22893  * Convenience function for inserting a section menu item into @menu.
22894  * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22895  * flexible alternative.
22896  *
22897  * Since: 2.32
22898  */
22899
22900
22901 /**
22902  * g_menu_insert_submenu:
22903  * @menu: a #GMenu
22904  * @position: the position at which to insert the item
22905  * @label: (allow-none): the section label, or %NULL
22906  * @submenu: a #GMenuModel with the items of the submenu
22907  *
22908  * Convenience function for inserting a submenu menu item into @menu.
22909  * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22910  * flexible alternative.
22911  *
22912  * Since: 2.32
22913  */
22914
22915
22916 /**
22917  * g_menu_item_get_attribute:
22918  * @menu_item: a #GMenuItem
22919  * @attribute: the attribute name to query
22920  * @format_string: a #GVariant format string
22921  * @...: positional parameters, as per @format_string
22922  *
22923  * Queries the named @attribute on @menu_item.
22924  *
22925  * If the attribute exists and matches the #GVariantType corresponding
22926  * to @format_string then @format_string is used to deconstruct the
22927  * value into the positional parameters and %TRUE is returned.
22928  *
22929  * If the attribute does not exist, or it does exist but has the wrong
22930  * type, then the positional parameters are ignored and %FALSE is
22931  * returned.
22932  *
22933  * Returns: %TRUE if the named attribute was found with the expected type
22934  * Since: 2.34
22935  */
22936
22937
22938 /**
22939  * g_menu_item_get_attribute_value:
22940  * @menu_item: a #GMenuItem
22941  * @attribute: the attribute name to query
22942  * @expected_type: (allow-none): the expected type of the attribute
22943  *
22944  * Queries the named @attribute on @menu_item.
22945  *
22946  * If @expected_type is specified and the attribute does not have this
22947  * type, %NULL is returned.  %NULL is also returned if the attribute
22948  * simply does not exist.
22949  *
22950  * Returns: (transfer full): the attribute value, or %NULL
22951  * Since: 2.34
22952  */
22953
22954
22955 /**
22956  * g_menu_item_get_link:
22957  * @menu_item: a #GMenuItem
22958  * @link: the link name to query
22959  *
22960  * Queries the named @link on @menu_item.
22961  *
22962  * Returns: (transfer full): the link, or %NULL
22963  * Since: 2.34
22964  */
22965
22966
22967 /**
22968  * g_menu_item_new:
22969  * @label: (allow-none): the section label, or %NULL
22970  * @detailed_action: (allow-none): the detailed action string, or %NULL
22971  *
22972  * Creates a new #GMenuItem.
22973  *
22974  * If @label is non-%NULL it is used to set the "label" attribute of the
22975  * new item.
22976  *
22977  * If @detailed_action is non-%NULL it is used to set the "action" and
22978  * possibly the "target" attribute of the new item.  See
22979  * g_menu_item_set_detailed_action() for more information.
22980  *
22981  * Returns: a new #GMenuItem
22982  * Since: 2.32
22983  */
22984
22985
22986 /**
22987  * g_menu_item_new_from_model:
22988  * @model: a #GMenuModel
22989  * @item_index: the index of an item in @model
22990  *
22991  * Creates a #GMenuItem as an exact copy of an existing menu item in a
22992  * #GMenuModel.
22993  *
22994  * @item_index must be valid (ie: be sure to call
22995  * g_menu_model_get_n_items() first).
22996  *
22997  * Returns: a new #GMenuItem.
22998  * Since: 2.34
22999  */
23000
23001
23002 /**
23003  * g_menu_item_new_section:
23004  * @label: (allow-none): the section label, or %NULL
23005  * @section: a #GMenuModel with the items of the section
23006  *
23007  * Creates a new #GMenuItem representing a section.
23008  *
23009  * This is a convenience API around g_menu_item_new() and
23010  * g_menu_item_set_section().
23011  *
23012  * The effect of having one menu appear as a section of another is
23013  * exactly as it sounds: the items from @section become a direct part of
23014  * the menu that @menu_item is added to.
23015  *
23016  * Visual separation is typically displayed between two non-empty
23017  * sections.  If @label is non-%NULL then it will be encorporated into
23018  * this visual indication.  This allows for labeled subsections of a
23019  * menu.
23020  *
23021  * As a simple example, consider a typical "Edit" menu from a simple
23022  * program.  It probably contains an "Undo" and "Redo" item, followed by
23023  * a separator, followed by "Cut", "Copy" and "Paste".
23024  *
23025  * This would be accomplished by creating three #GMenu instances.  The
23026  * first would be populated with the "Undo" and "Redo" items, and the
23027  * second with the "Cut", "Copy" and "Paste" items.  The first and
23028  * second menus would then be added as submenus of the third.  In XML
23029  * format, this would look something like the following:
23030  *
23031  * <informalexample><programlisting><![CDATA[
23032  * <menu id='edit-menu'>
23033  *   <section>
23034  *     <item label='Undo'/>
23035  *     <item label='Redo'/>
23036  *   </section>
23037  *   <section>
23038  *     <item label='Cut'/>
23039  *     <item label='Copy'/>
23040  *     <item label='Paste'/>
23041  *   </section>
23042  * </menu>
23043  * ]]></programlisting></informalexample>
23044  *
23045  * The following example is exactly equivalent.  It is more illustrative
23046  * of the exact relationship between the menus and items (keeping in
23047  * mind that the 'link' element defines a new menu that is linked to the
23048  * containing one).  The style of the second example is more verbose and
23049  * difficult to read (and therefore not recommended except for the
23050  * purpose of understanding what is really going on).
23051  *
23052  * <informalexample><programlisting><![CDATA[
23053  * <menu id='edit-menu'>
23054  *   <item>
23055  *     <link name='section'>
23056  *       <item label='Undo'/>
23057  *       <item label='Redo'/>
23058  *     </link>
23059  *   </item>
23060  *   <item>
23061  *     <link name='section'>
23062  *       <item label='Cut'/>
23063  *       <item label='Copy'/>
23064  *       <item label='Paste'/>
23065  *     </link>
23066  *   </item>
23067  * </menu>
23068  * ]]></programlisting></informalexample>
23069  *
23070  * Returns: a new #GMenuItem
23071  * Since: 2.32
23072  */
23073
23074
23075 /**
23076  * g_menu_item_new_submenu:
23077  * @label: (allow-none): the section label, or %NULL
23078  * @submenu: a #GMenuModel with the items of the submenu
23079  *
23080  * Creates a new #GMenuItem representing a submenu.
23081  *
23082  * This is a convenience API around g_menu_item_new() and
23083  * g_menu_item_set_submenu().
23084  *
23085  * Returns: a new #GMenuItem
23086  * Since: 2.32
23087  */
23088
23089
23090 /**
23091  * g_menu_item_set_action_and_target:
23092  * @menu_item: a #GMenuItem
23093  * @action: (allow-none): the name of the action for this item
23094  * @format_string: (allow-none): a GVariant format string
23095  * @...: positional parameters, as per @format_string
23096  *
23097  * Sets or unsets the "action" and "target" attributes of @menu_item.
23098  *
23099  * If @action is %NULL then both the "action" and "target" attributes
23100  * are unset (and @format_string is ignored along with the positional
23101  * parameters).
23102  *
23103  * If @action is non-%NULL then the "action" attribute is set.
23104  * @format_string is then inspected.  If it is non-%NULL then the proper
23105  * position parameters are collected to create a #GVariant instance to
23106  * use as the target value.  If it is %NULL then the positional
23107  * parameters are ignored and the "target" attribute is unset.
23108  *
23109  * See also g_menu_item_set_action_and_target_value() for an equivalent
23110  * call that directly accepts a #GVariant.  See
23111  * g_menu_item_set_detailed_action() for a more convenient version that
23112  * works with string-typed targets.
23113  *
23114  * See also g_menu_item_set_action_and_target_value() for a
23115  * description of the semantics of the action and target attributes.
23116  *
23117  * Since: 2.32
23118  */
23119
23120
23121 /**
23122  * g_menu_item_set_action_and_target_value:
23123  * @menu_item: a #GMenuItem
23124  * @action: (allow-none): the name of the action for this item
23125  * @target_value: (allow-none): a #GVariant to use as the action target
23126  *
23127  * Sets or unsets the "action" and "target" attributes of @menu_item.
23128  *
23129  * If @action is %NULL then both the "action" and "target" attributes
23130  * are unset (and @target_value is ignored).
23131  *
23132  * If @action is non-%NULL then the "action" attribute is set.  The
23133  * "target" attribute is then set to the value of @target_value if it is
23134  * non-%NULL or unset otherwise.
23135  *
23136  * Normal menu items (ie: not submenu, section or other custom item
23137  * types) are expected to have the "action" attribute set to identify
23138  * the action that they are associated with.  The state type of the
23139  * action help to determine the disposition of the menu item.  See
23140  * #GAction and #GActionGroup for an overview of actions.
23141  *
23142  * In general, clicking on the menu item will result in activation of
23143  * the named action with the "target" attribute given as the parameter
23144  * to the action invocation.  If the "target" attribute is not set then
23145  * the action is invoked with no parameter.
23146  *
23147  * If the action has no state then the menu item is usually drawn as a
23148  * plain menu item (ie: with no additional decoration).
23149  *
23150  * If the action has a boolean state then the menu item is usually drawn
23151  * as a toggle menu item (ie: with a checkmark or equivalent
23152  * indication).  The item should be marked as 'toggled' or 'checked'
23153  * when the boolean state is %TRUE.
23154  *
23155  * If the action has a string state then the menu item is usually drawn
23156  * as a radio menu item (ie: with a radio bullet or equivalent
23157  * indication).  The item should be marked as 'selected' when the string
23158  * state is equal to the value of the @target property.
23159  *
23160  * See g_menu_item_set_action_and_target() or
23161  * g_menu_item_set_detailed_action() for two equivalent calls that are
23162  * probably more convenient for most uses.
23163  *
23164  * Since: 2.32
23165  */
23166
23167
23168 /**
23169  * g_menu_item_set_attribute:
23170  * @menu_item: a #GMenuItem
23171  * @attribute: the attribute to set
23172  * @format_string: (allow-none): a #GVariant format string, or %NULL
23173  * @...: positional parameters, as per @format_string
23174  *
23175  * Sets or unsets an attribute on @menu_item.
23176  *
23177  * The attribute to set or unset is specified by @attribute. This
23178  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23179  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23180  * attribute name.
23181  * Attribute names are restricted to lowercase characters, numbers
23182  * and '-'. Furthermore, the names must begin with a lowercase character,
23183  * must not end with a '-', and must not contain consecutive dashes.
23184  *
23185  * If @format_string is non-%NULL then the proper position parameters
23186  * are collected to create a #GVariant instance to use as the attribute
23187  * value.  If it is %NULL then the positional parameterrs are ignored
23188  * and the named attribute is unset.
23189  *
23190  * See also g_menu_item_set_attribute_value() for an equivalent call
23191  * that directly accepts a #GVariant.
23192  *
23193  * Since: 2.32
23194  */
23195
23196
23197 /**
23198  * g_menu_item_set_attribute_value:
23199  * @menu_item: a #GMenuItem
23200  * @attribute: the attribute to set
23201  * @value: (allow-none): a #GVariant to use as the value, or %NULL
23202  *
23203  * Sets or unsets an attribute on @menu_item.
23204  *
23205  * The attribute to set or unset is specified by @attribute. This
23206  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23207  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23208  * attribute name.
23209  * Attribute names are restricted to lowercase characters, numbers
23210  * and '-'. Furthermore, the names must begin with a lowercase character,
23211  * must not end with a '-', and must not contain consecutive dashes.
23212  *
23213  * must consist only of lowercase
23214  * ASCII characters, digits and '-'.
23215  *
23216  * If @value is non-%NULL then it is used as the new value for the
23217  * attribute.  If @value is %NULL then the attribute is unset. If
23218  * the @value #GVariant is floating, it is consumed.
23219  *
23220  * See also g_menu_item_set_attribute() for a more convenient way to do
23221  * the same.
23222  *
23223  * Since: 2.32
23224  */
23225
23226
23227 /**
23228  * g_menu_item_set_detailed_action:
23229  * @menu_item: a #GMenuItem
23230  * @detailed_action: the "detailed" action string
23231  *
23232  * Sets the "action" and possibly the "target" attribute of @menu_item.
23233  *
23234  * The format of @detailed_action is the same format parsed by
23235  * g_action_parse_detailed_name().
23236  *
23237  * See g_menu_item_set_action_and_target() or
23238  * g_menu_item_set_action_and_target_value() for more flexible (but
23239  * slightly less convenient) alternatives.
23240  *
23241  * See also g_menu_item_set_action_and_target_value() for a description of
23242  * the semantics of the action and target attributes.
23243  *
23244  * Since: 2.32
23245  */
23246
23247
23248 /**
23249  * g_menu_item_set_icon:
23250  * @menu_item: a #GMenuItem
23251  * @icon: a #GIcon, or %NULL
23252  *
23253  * Sets (or unsets) the icon on @menu_item.
23254  *
23255  * This call is the same as calling g_icon_serialize() and using the
23256  * result as the value to g_menu_item_set_attribute_value() for
23257  * %G_MENU_ATTRIBUTE_ICON.
23258  *
23259  * This API is only intended for use with "noun" menu items; things like
23260  * bookmarks or applications in an "Open With" menu.  Don't use it on
23261  * menu items corresponding to verbs (eg: stock icons for 'Save' or
23262  * 'Quit').
23263  *
23264  * If @icon is %NULL then the icon is unset.
23265  *
23266  * Since: 2.38
23267  */
23268
23269
23270 /**
23271  * g_menu_item_set_label:
23272  * @menu_item: a #GMenuItem
23273  * @label: (allow-none): the label to set, or %NULL to unset
23274  *
23275  * Sets or unsets the "label" attribute of @menu_item.
23276  *
23277  * If @label is non-%NULL it is used as the label for the menu item.  If
23278  * it is %NULL then the label attribute is unset.
23279  *
23280  * Since: 2.32
23281  */
23282
23283
23284 /**
23285  * g_menu_item_set_link:
23286  * @menu_item: a #GMenuItem
23287  * @link: type of link to establish or unset
23288  * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23289  *
23290  * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23291  *
23292  * Links are used to establish a relationship between a particular menu
23293  * item and another menu.  For example, %G_MENU_LINK_SUBMENU is used to
23294  * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23295  * is used to create a section. Other types of link can be used, but there
23296  * is no guarantee that clients will be able to make sense of them.
23297  * Link types are restricted to lowercase characters, numbers
23298  * and '-'. Furthermore, the names must begin with a lowercase character,
23299  * must not end with a '-', and must not contain consecutive dashes.
23300  *
23301  * Since: 2.32
23302  */
23303
23304
23305 /**
23306  * g_menu_item_set_section:
23307  * @menu_item: a #GMenuItem
23308  * @section: (allow-none): a #GMenuModel, or %NULL
23309  *
23310  * Sets or unsets the "section" link of @menu_item to @section.
23311  *
23312  * The effect of having one menu appear as a section of another is
23313  * exactly as it sounds: the items from @section become a direct part of
23314  * the menu that @menu_item is added to.  See g_menu_item_new_section()
23315  * for more information about what it means for a menu item to be a
23316  * section.
23317  *
23318  * Since: 2.32
23319  */
23320
23321
23322 /**
23323  * g_menu_item_set_submenu:
23324  * @menu_item: a #GMenuItem
23325  * @submenu: (allow-none): a #GMenuModel, or %NULL
23326  *
23327  * Sets or unsets the "submenu" link of @menu_item to @submenu.
23328  *
23329  * If @submenu is non-%NULL, it is linked to.  If it is %NULL then the
23330  * link is unset.
23331  *
23332  * The effect of having one menu appear as a submenu of another is
23333  * exactly as it sounds.
23334  *
23335  * Since: 2.32
23336  */
23337
23338
23339 /**
23340  * g_menu_link_iter_get_name:
23341  * @iter: a #GMenuLinkIter
23342  *
23343  * Gets the name of the link at the current iterator position.
23344  *
23345  * The iterator is not advanced.
23346  *
23347  * Returns: the type of the link
23348  * Since: 2.32
23349  */
23350
23351
23352 /**
23353  * g_menu_link_iter_get_next:
23354  * @iter: a #GMenuLinkIter
23355  * @out_link: (out) (allow-none) (transfer none): the name of the link
23356  * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23357  *
23358  * This function combines g_menu_link_iter_next() with
23359  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23360  *
23361  * First the iterator is advanced to the next (possibly first) link.
23362  * If that fails, then %FALSE is returned and there are no other effects.
23363  *
23364  * If successful, @out_link and @value are set to the name and #GMenuModel
23365  * of the link that has just been advanced to.  At this point,
23366  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23367  * same values again.
23368  *
23369  * The value returned in @out_link remains valid for as long as the iterator
23370  * remains at the current position.  The value returned in @value must
23371  * be unreffed using g_object_unref() when it is no longer in use.
23372  *
23373  * Returns: %TRUE on success, or %FALSE if there is no additional link
23374  * Since: 2.32
23375  */
23376
23377
23378 /**
23379  * g_menu_link_iter_get_value:
23380  * @iter: a #GMenuLinkIter
23381  *
23382  * Gets the linked #GMenuModel at the current iterator position.
23383  *
23384  * The iterator is not advanced.
23385  *
23386  * Returns: (transfer full): the #GMenuModel that is linked to
23387  * Since: 2.32
23388  */
23389
23390
23391 /**
23392  * g_menu_link_iter_next:
23393  * @iter: a #GMenuLinkIter
23394  *
23395  * Attempts to advance the iterator to the next (possibly first)
23396  * link.
23397  *
23398  * %TRUE is returned on success, or %FALSE if there are no more links.
23399  *
23400  * You must call this function when you first acquire the iterator to
23401  * advance it to the first link (and determine if the first link exists
23402  * at all).
23403  *
23404  * Returns: %TRUE on success, or %FALSE when there are no more links
23405  * Since: 2.32
23406  */
23407
23408
23409 /**
23410  * g_menu_model_get_item_attribute:
23411  * @model: a #GMenuModel
23412  * @item_index: the index of the item
23413  * @attribute: the attribute to query
23414  * @format_string: a #GVariant format string
23415  * @...: positional parameters, as per @format_string
23416  *
23417  * Queries item at position @item_index in @model for the attribute
23418  * specified by @attribute.
23419  *
23420  * If the attribute exists and matches the #GVariantType corresponding
23421  * to @format_string then @format_string is used to deconstruct the
23422  * value into the positional parameters and %TRUE is returned.
23423  *
23424  * If the attribute does not exist, or it does exist but has the wrong
23425  * type, then the positional parameters are ignored and %FALSE is
23426  * returned.
23427  *
23428  * This function is a mix of g_menu_model_get_item_attribute_value() and
23429  * g_variant_get(), followed by a g_variant_unref().  As such,
23430  * @format_string must make a complete copy of the data (since the
23431  * #GVariant may go away after the call to g_variant_unref()).  In
23432  * particular, no '&amp;' characters are allowed in @format_string.
23433  *
23434  * Returns: %TRUE if the named attribute was found with the expected type
23435  * Since: 2.32
23436  */
23437
23438
23439 /**
23440  * g_menu_model_get_item_attribute_value:
23441  * @model: a #GMenuModel
23442  * @item_index: the index of the item
23443  * @attribute: the attribute to query
23444  * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23445  *
23446  * Queries the item at position @item_index in @model for the attribute
23447  * specified by @attribute.
23448  *
23449  * If @expected_type is non-%NULL then it specifies the expected type of
23450  * the attribute.  If it is %NULL then any type will be accepted.
23451  *
23452  * If the attribute exists and matches @expected_type (or if the
23453  * expected type is unspecified) then the value is returned.
23454  *
23455  * If the attribute does not exist, or does not match the expected type
23456  * then %NULL is returned.
23457  *
23458  * Returns: (transfer full): the value of the attribute
23459  * Since: 2.32
23460  */
23461
23462
23463 /**
23464  * g_menu_model_get_item_link:
23465  * @model: a #GMenuModel
23466  * @item_index: the index of the item
23467  * @link: the link to query
23468  *
23469  * Queries the item at position @item_index in @model for the link
23470  * specified by @link.
23471  *
23472  * If the link exists, the linked #GMenuModel is returned.  If the link
23473  * does not exist, %NULL is returned.
23474  *
23475  * Returns: (transfer full): the linked #GMenuModel, or %NULL
23476  * Since: 2.32
23477  */
23478
23479
23480 /**
23481  * g_menu_model_get_n_items:
23482  * @model: a #GMenuModel
23483  *
23484  * Query the number of items in @model.
23485  *
23486  * Returns: the number of items
23487  * Since: 2.32
23488  */
23489
23490
23491 /**
23492  * g_menu_model_is_mutable:
23493  * @model: a #GMenuModel
23494  *
23495  * Queries if @model is mutable.
23496  *
23497  * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23498  * signal. Consumers of the model may make optimisations accordingly.
23499  *
23500  * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23501  * Since: 2.32
23502  */
23503
23504
23505 /**
23506  * g_menu_model_items_changed:
23507  * @model: a #GMenuModel
23508  * @position: the position of the change
23509  * @removed: the number of items removed
23510  * @added: the number of items added
23511  *
23512  * Requests emission of the #GMenuModel::items-changed signal on @model.
23513  *
23514  * This function should never be called except by #GMenuModel
23515  * subclasses.  Any other calls to this function will very likely lead
23516  * to a violation of the interface of the model.
23517  *
23518  * The implementation should update its internal representation of the
23519  * menu before emitting the signal.  The implementation should further
23520  * expect to receive queries about the new state of the menu (and
23521  * particularly added menu items) while signal handlers are running.
23522  *
23523  * The implementation must dispatch this call directly from a mainloop
23524  * entry and not in response to calls -- particularly those from the
23525  * #GMenuModel API.  Said another way: the menu must not change while
23526  * user code is running without returning to the mainloop.
23527  *
23528  * Since: 2.32
23529  */
23530
23531
23532 /**
23533  * g_menu_model_iterate_item_attributes:
23534  * @model: a #GMenuModel
23535  * @item_index: the index of the item
23536  *
23537  * Creates a #GMenuAttributeIter to iterate over the attributes of
23538  * the item at position @item_index in @model.
23539  *
23540  * You must free the iterator with g_object_unref() when you are done.
23541  *
23542  * Returns: (transfer full): a new #GMenuAttributeIter
23543  * Since: 2.32
23544  */
23545
23546
23547 /**
23548  * g_menu_model_iterate_item_links:
23549  * @model: a #GMenuModel
23550  * @item_index: the index of the item
23551  *
23552  * Creates a #GMenuLinkIter to iterate over the links of the item at
23553  * position @item_index in @model.
23554  *
23555  * You must free the iterator with g_object_unref() when you are done.
23556  *
23557  * Returns: (transfer full): a new #GMenuLinkIter
23558  * Since: 2.32
23559  */
23560
23561
23562 /**
23563  * g_menu_new:
23564  *
23565  * Creates a new #GMenu.
23566  *
23567  * The new menu has no items.
23568  *
23569  * Returns: a new #GMenu
23570  * Since: 2.32
23571  */
23572
23573
23574 /**
23575  * g_menu_prepend:
23576  * @menu: a #GMenu
23577  * @label: (allow-none): the section label, or %NULL
23578  * @detailed_action: (allow-none): the detailed action string, or %NULL
23579  *
23580  * Convenience function for prepending a normal menu item to the start
23581  * of @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
23582  * flexible alternative.
23583  *
23584  * Since: 2.32
23585  */
23586
23587
23588 /**
23589  * g_menu_prepend_item:
23590  * @menu: a #GMenu
23591  * @item: a #GMenuItem to prepend
23592  *
23593  * Prepends @item to the start of @menu.
23594  *
23595  * See g_menu_insert_item() for more information.
23596  *
23597  * Since: 2.32
23598  */
23599
23600
23601 /**
23602  * g_menu_prepend_section:
23603  * @menu: a #GMenu
23604  * @label: (allow-none): the section label, or %NULL
23605  * @section: a #GMenuModel with the items of the section
23606  *
23607  * Convenience function for prepending a section menu item to the start
23608  * of @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for
23609  * a more flexible alternative.
23610  *
23611  * Since: 2.32
23612  */
23613
23614
23615 /**
23616  * g_menu_prepend_submenu:
23617  * @menu: a #GMenu
23618  * @label: (allow-none): the section label, or %NULL
23619  * @submenu: a #GMenuModel with the items of the submenu
23620  *
23621  * Convenience function for prepending a submenu menu item to the start
23622  * of @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23623  * a more flexible alternative.
23624  *
23625  * Since: 2.32
23626  */
23627
23628
23629 /**
23630  * g_menu_remove:
23631  * @menu: a #GMenu
23632  * @position: the position of the item to remove
23633  *
23634  * Removes an item from the menu.
23635  *
23636  * @position gives the index of the item to remove.
23637  *
23638  * It is an error if position is not in range the range from 0 to one
23639  * less than the number of items in the menu.
23640  *
23641  * It is not possible to remove items by identity since items are added
23642  * to the menu simply by copying their links and attributes (ie:
23643  * identity of the item itself is not preserved).
23644  *
23645  * Since: 2.32
23646  */
23647
23648
23649 /**
23650  * g_menu_remove_all:
23651  * @menu: a #GMenu
23652  *
23653  * Removes all items in the menu.
23654  *
23655  * Since: 2.38
23656  */
23657
23658
23659 /**
23660  * g_mount_can_eject:
23661  * @mount: a #GMount.
23662  *
23663  * Checks if @mount can be eject.
23664  *
23665  * Returns: %TRUE if the @mount can be ejected.
23666  */
23667
23668
23669 /**
23670  * g_mount_can_unmount:
23671  * @mount: a #GMount.
23672  *
23673  * Checks if @mount can be mounted.
23674  *
23675  * Returns: %TRUE if the @mount can be unmounted.
23676  */
23677
23678
23679 /**
23680  * g_mount_eject:
23681  * @mount: a #GMount.
23682  * @flags: flags affecting the unmount if required for eject
23683  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23684  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23685  * @user_data: user data passed to @callback.
23686  *
23687  * Ejects a mount. This is an asynchronous operation, and is
23688  * finished by calling g_mount_eject_finish() with the @mount
23689  * and #GAsyncResult data returned in the @callback.
23690  *
23691  * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23692  */
23693
23694
23695 /**
23696  * g_mount_eject_finish:
23697  * @mount: a #GMount.
23698  * @result: a #GAsyncResult.
23699  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23700  *
23701  * Finishes ejecting a mount. If any errors occurred during the operation,
23702  * @error will be set to contain the errors and %FALSE will be returned.
23703  *
23704  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23705  * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23706  */
23707
23708
23709 /**
23710  * g_mount_eject_with_operation:
23711  * @mount: a #GMount.
23712  * @flags: flags affecting the unmount if required for eject
23713  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23714  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23715  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23716  * @user_data: user data passed to @callback.
23717  *
23718  * Ejects a mount. This is an asynchronous operation, and is
23719  * finished by calling g_mount_eject_with_operation_finish() with the @mount
23720  * and #GAsyncResult data returned in the @callback.
23721  *
23722  * Since: 2.22
23723  */
23724
23725
23726 /**
23727  * g_mount_eject_with_operation_finish:
23728  * @mount: a #GMount.
23729  * @result: a #GAsyncResult.
23730  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23731  *
23732  * Finishes ejecting a mount. If any errors occurred during the operation,
23733  * @error will be set to contain the errors and %FALSE will be returned.
23734  *
23735  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23736  * Since: 2.22
23737  */
23738
23739
23740 /**
23741  * g_mount_get_default_location:
23742  * @mount: a #GMount.
23743  *
23744  * Gets the default location of @mount. The default location of the given
23745  * @mount is a path that reflects the main entry point for the user (e.g.
23746  * the home directory, or the root of the volume).
23747  *
23748  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23749  */
23750
23751
23752 /**
23753  * g_mount_get_drive:
23754  * @mount: a #GMount.
23755  *
23756  * Gets the drive for the @mount.
23757  *
23758  * This is a convenience method for getting the #GVolume and then
23759  * using that object to get the #GDrive.
23760  *
23761  * Returns: (transfer full): a #GDrive or %NULL if @mount is not associated with a volume or a drive. The returned object should be unreffed with g_object_unref() when no longer needed.
23762  */
23763
23764
23765 /**
23766  * g_mount_get_icon:
23767  * @mount: a #GMount.
23768  *
23769  * Gets the icon for @mount.
23770  *
23771  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23772  */
23773
23774
23775 /**
23776  * g_mount_get_name:
23777  * @mount: a #GMount.
23778  *
23779  * Gets the name of @mount.
23780  *
23781  * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23782  */
23783
23784
23785 /**
23786  * g_mount_get_root:
23787  * @mount: a #GMount.
23788  *
23789  * Gets the root directory on @mount.
23790  *
23791  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23792  */
23793
23794
23795 /**
23796  * g_mount_get_sort_key:
23797  * @mount: A #GMount.
23798  *
23799  * Gets the sort key for @mount, if any.
23800  *
23801  * Returns: Sorting key for @mount or %NULL if no such key is available.
23802  * Since: 2.32
23803  */
23804
23805
23806 /**
23807  * g_mount_get_symbolic_icon:
23808  * @mount: a #GMount.
23809  *
23810  * Gets the symbolic icon for @mount.
23811  *
23812  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23813  * Since: 2.34
23814  */
23815
23816
23817 /**
23818  * g_mount_get_uuid:
23819  * @mount: a #GMount.
23820  *
23821  * Gets the UUID for the @mount. The reference is typically based on
23822  * the file system UUID for the mount in question and should be
23823  * considered an opaque string. Returns %NULL if there is no UUID
23824  * available.
23825  *
23826  * Returns: the UUID for @mount or %NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed.
23827  */
23828
23829
23830 /**
23831  * g_mount_get_volume:
23832  * @mount: a #GMount.
23833  *
23834  * Gets the volume for the @mount.
23835  *
23836  * Returns: (transfer full): a #GVolume or %NULL if @mount is not associated with a volume. The returned object should be unreffed with g_object_unref() when no longer needed.
23837  */
23838
23839
23840 /**
23841  * g_mount_guess_content_type:
23842  * @mount: a #GMount
23843  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23844  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23845  * @callback: a #GAsyncReadyCallback
23846  * @user_data: user data passed to @callback
23847  *
23848  * Tries to guess the type of content stored on @mount. Returns one or
23849  * more textual identifiers of well-known content types (typically
23850  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23851  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23852  * specification for more on x-content types.
23853  *
23854  * This is an asynchronous operation (see
23855  * g_mount_guess_content_type_sync() for the synchronous version), and
23856  * is finished by calling g_mount_guess_content_type_finish() with the
23857  * @mount and #GAsyncResult data returned in the @callback.
23858  *
23859  * Since: 2.18
23860  */
23861
23862
23863 /**
23864  * g_mount_guess_content_type_finish:
23865  * @mount: a #GMount
23866  * @result: a #GAsyncResult
23867  * @error: a #GError location to store the error occurring, or %NULL to ignore
23868  *
23869  * Finishes guessing content types of @mount. If any errors occurred
23870  * during the operation, @error will be set to contain the errors and
23871  * %FALSE will be returned. In particular, you may get an
23872  * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23873  * guessing.
23874  *
23875  * Returns: (transfer full) (element-type utf8): a %NULL-terminated array of content types or %NULL on error. Caller should free this array with g_strfreev() when done with it.
23876  * Since: 2.18
23877  */
23878
23879
23880 /**
23881  * g_mount_guess_content_type_sync:
23882  * @mount: a #GMount
23883  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23884  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23885  * @error: a #GError location to store the error occurring, or %NULL to ignore
23886  *
23887  * Tries to guess the type of content stored on @mount. Returns one or
23888  * more textual identifiers of well-known content types (typically
23889  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23890  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23891  * specification for more on x-content types.
23892  *
23893  * This is an synchronous operation and as such may block doing IO;
23894  * see g_mount_guess_content_type() for the asynchronous version.
23895  *
23896  * Returns: (transfer full) (element-type utf8): a %NULL-terminated array of content types or %NULL on error. Caller should free this array with g_strfreev() when done with it.
23897  * Since: 2.18
23898  */
23899
23900
23901 /**
23902  * g_mount_is_shadowed:
23903  * @mount: A #GMount.
23904  *
23905  * Determines if @mount is shadowed. Applications or libraries should
23906  * avoid displaying @mount in the user interface if it is shadowed.
23907  *
23908  * A mount is said to be shadowed if there exists one or more user
23909  * visible objects (currently #GMount objects) with a root that is
23910  * inside the root of @mount.
23911  *
23912  * One application of shadow mounts is when exposing a single file
23913  * system that is used to address several logical volumes. In this
23914  * situation, a #GVolumeMonitor implementation would create two
23915  * #GVolume objects (for example, one for the camera functionality of
23916  * the device and one for a SD card reader on the device) with
23917  * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23918  * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23919  * underlying mount (with root
23920  * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23921  * #GVolumeMonitor implementation would create two #GMount objects
23922  * (each with their root matching the corresponding volume activation
23923  * root) that would shadow the original mount.
23924  *
23925  * The proxy monitor in GVfs 2.26 and later, automatically creates and
23926  * manage shadow mounts (and shadows the underlying mount) if the
23927  * activation root on a #GVolume is set.
23928  *
23929  * Returns: %TRUE if @mount is shadowed.
23930  * Since: 2.20
23931  */
23932
23933
23934 /**
23935  * g_mount_operation_get_anonymous:
23936  * @op: a #GMountOperation.
23937  *
23938  * Check to see whether the mount operation is being used
23939  * for an anonymous user.
23940  *
23941  * Returns: %TRUE if mount operation is anonymous.
23942  */
23943
23944
23945 /**
23946  * g_mount_operation_get_choice:
23947  * @op: a #GMountOperation.
23948  *
23949  * Gets a choice from the mount operation.
23950  *
23951  * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23952  */
23953
23954
23955 /**
23956  * g_mount_operation_get_domain:
23957  * @op: a #GMountOperation.
23958  *
23959  * Gets the domain of the mount operation.
23960  *
23961  * Returns: a string set to the domain.
23962  */
23963
23964
23965 /**
23966  * g_mount_operation_get_password:
23967  * @op: a #GMountOperation.
23968  *
23969  * Gets a password from the mount operation.
23970  *
23971  * Returns: a string containing the password within @op.
23972  */
23973
23974
23975 /**
23976  * g_mount_operation_get_password_save:
23977  * @op: a #GMountOperation.
23978  *
23979  * Gets the state of saving passwords for the mount operation.
23980  *
23981  * Returns: a #GPasswordSave flag.
23982  */
23983
23984
23985 /**
23986  * g_mount_operation_get_username:
23987  * @op: a #GMountOperation.
23988  *
23989  * Get the user name from the mount operation.
23990  *
23991  * Returns: a string containing the user name.
23992  */
23993
23994
23995 /**
23996  * g_mount_operation_new:
23997  *
23998  * Creates a new mount operation.
23999  *
24000  * Returns: a #GMountOperation.
24001  */
24002
24003
24004 /**
24005  * g_mount_operation_reply:
24006  * @op: a #GMountOperation
24007  * @result: a #GMountOperationResult
24008  *
24009  * Emits the #GMountOperation::reply signal.
24010  */
24011
24012
24013 /**
24014  * g_mount_operation_set_anonymous:
24015  * @op: a #GMountOperation.
24016  * @anonymous: boolean value.
24017  *
24018  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
24019  */
24020
24021
24022 /**
24023  * g_mount_operation_set_choice:
24024  * @op: a #GMountOperation.
24025  * @choice: an integer.
24026  *
24027  * Sets a default choice for the mount operation.
24028  */
24029
24030
24031 /**
24032  * g_mount_operation_set_domain:
24033  * @op: a #GMountOperation.
24034  * @domain: the domain to set.
24035  *
24036  * Sets the mount operation's domain.
24037  */
24038
24039
24040 /**
24041  * g_mount_operation_set_password:
24042  * @op: a #GMountOperation.
24043  * @password: password to set.
24044  *
24045  * Sets the mount operation's password to @password.
24046  */
24047
24048
24049 /**
24050  * g_mount_operation_set_password_save:
24051  * @op: a #GMountOperation.
24052  * @save: a set of #GPasswordSave flags.
24053  *
24054  * Sets the state of saving passwords for the mount operation.
24055  */
24056
24057
24058 /**
24059  * g_mount_operation_set_username:
24060  * @op: a #GMountOperation.
24061  * @username: input username.
24062  *
24063  * Sets the user name within @op to @username.
24064  */
24065
24066
24067 /**
24068  * g_mount_remount:
24069  * @mount: a #GMount.
24070  * @flags: flags affecting the operation
24071  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24072  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24073  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24074  * @user_data: user data passed to @callback.
24075  *
24076  * Remounts a mount. This is an asynchronous operation, and is
24077  * finished by calling g_mount_remount_finish() with the @mount
24078  * and #GAsyncResults data returned in the @callback.
24079  *
24080  * Remounting is useful when some setting affecting the operation
24081  * of the volume has been changed, as these may need a remount to
24082  * take affect. While this is semantically equivalent with unmounting
24083  * and then remounting not all backends might need to actually be
24084  * unmounted.
24085  */
24086
24087
24088 /**
24089  * g_mount_remount_finish:
24090  * @mount: a #GMount.
24091  * @result: a #GAsyncResult.
24092  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24093  *
24094  * Finishes remounting a mount. If any errors occurred during the operation,
24095  * @error will be set to contain the errors and %FALSE will be returned.
24096  *
24097  * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
24098  */
24099
24100
24101 /**
24102  * g_mount_shadow:
24103  * @mount: A #GMount.
24104  *
24105  * Increments the shadow count on @mount. Usually used by
24106  * #GVolumeMonitor implementations when creating a shadow mount for
24107  * @mount, see g_mount_is_shadowed() for more information. The caller
24108  * will need to emit the #GMount::changed signal on @mount manually.
24109  *
24110  * Since: 2.20
24111  */
24112
24113
24114 /**
24115  * g_mount_unmount:
24116  * @mount: a #GMount.
24117  * @flags: flags affecting the operation
24118  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24119  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24120  * @user_data: user data passed to @callback.
24121  *
24122  * Unmounts a mount. This is an asynchronous operation, and is
24123  * finished by calling g_mount_unmount_finish() with the @mount
24124  * and #GAsyncResult data returned in the @callback.
24125  *
24126  * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
24127  */
24128
24129
24130 /**
24131  * g_mount_unmount_finish:
24132  * @mount: a #GMount.
24133  * @result: a #GAsyncResult.
24134  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24135  *
24136  * Finishes unmounting a mount. If any errors occurred during the operation,
24137  * @error will be set to contain the errors and %FALSE will be returned.
24138  *
24139  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24140  * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
24141  */
24142
24143
24144 /**
24145  * g_mount_unmount_with_operation:
24146  * @mount: a #GMount.
24147  * @flags: flags affecting the operation
24148  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24149  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24150  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24151  * @user_data: user data passed to @callback.
24152  *
24153  * Unmounts a mount. This is an asynchronous operation, and is
24154  * finished by calling g_mount_unmount_with_operation_finish() with the @mount
24155  * and #GAsyncResult data returned in the @callback.
24156  *
24157  * Since: 2.22
24158  */
24159
24160
24161 /**
24162  * g_mount_unmount_with_operation_finish:
24163  * @mount: a #GMount.
24164  * @result: a #GAsyncResult.
24165  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24166  *
24167  * Finishes unmounting a mount. If any errors occurred during the operation,
24168  * @error will be set to contain the errors and %FALSE will be returned.
24169  *
24170  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24171  * Since: 2.22
24172  */
24173
24174
24175 /**
24176  * g_mount_unshadow:
24177  * @mount: A #GMount.
24178  *
24179  * Decrements the shadow count on @mount. Usually used by
24180  * #GVolumeMonitor implementations when destroying a shadow mount for
24181  * @mount, see g_mount_is_shadowed() for more information. The caller
24182  * will need to emit the #GMount::changed signal on @mount manually.
24183  *
24184  * Since: 2.20
24185  */
24186
24187
24188 /**
24189  * g_network_address_get_hostname:
24190  * @addr: a #GNetworkAddress
24191  *
24192  * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
24193  * depending on what @addr was created with.
24194  *
24195  * Returns: @addr's hostname
24196  * Since: 2.22
24197  */
24198
24199
24200 /**
24201  * g_network_address_get_port:
24202  * @addr: a #GNetworkAddress
24203  *
24204  * Gets @addr's port number
24205  *
24206  * Returns: @addr's port (which may be 0)
24207  * Since: 2.22
24208  */
24209
24210
24211 /**
24212  * g_network_address_get_scheme:
24213  * @addr: a #GNetworkAddress
24214  *
24215  * Gets @addr's scheme
24216  *
24217  * Returns: @addr's scheme (%NULL if not built from URI)
24218  * Since: 2.26
24219  */
24220
24221
24222 /**
24223  * g_network_address_new:
24224  * @hostname: the hostname
24225  * @port: the port
24226  *
24227  * Creates a new #GSocketConnectable for connecting to the given
24228  * @hostname and @port.
24229  *
24230  * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24231  * Since: 2.22
24232  */
24233
24234
24235 /**
24236  * g_network_address_parse:
24237  * @host_and_port: the hostname and optionally a port
24238  * @default_port: the default port if not in @host_and_port
24239  * @error: a pointer to a #GError, or %NULL
24240  *
24241  * Creates a new #GSocketConnectable for connecting to the given
24242  * @hostname and @port. May fail and return %NULL in case
24243  * parsing @host_and_port fails.
24244  *
24245  * @host_and_port may be in any of a number of recognised formats; an IPv6
24246  * address, an IPv4 address, or a domain name (in which case a DNS
24247  * lookup is performed). Quoting with [] is supported for all address
24248  * types. A port override may be specified in the usual way with a
24249  * colon.
24250  *
24251  * If no port is specified in @host_and_port then @default_port will be
24252  * used as the port number to connect to.
24253  *
24254  * In general, @host_and_port is expected to be provided by the user
24255  * (allowing them to give the hostname, and a port overide if necessary)
24256  * and @default_port is expected to be provided by the application.
24257  *
24258  * (The port component of @host_and_port can also be specified as a
24259  * service name rather than as a numeric port, but this functionality
24260  * is deprecated, because it depends on the contents of /etc/services,
24261  * which is generally quite sparse on platforms other than Linux.)
24262  *
24263  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24264  * Since: 2.22
24265  */
24266
24267
24268 /**
24269  * g_network_address_parse_uri:
24270  * @uri: the hostname and optionally a port
24271  * @default_port: The default port if none is found in the URI
24272  * @error: a pointer to a #GError, or %NULL
24273  *
24274  * Creates a new #GSocketConnectable for connecting to the given
24275  * @uri. May fail and return %NULL in case parsing @uri fails.
24276  *
24277  * Using this rather than g_network_address_new() or
24278  * g_network_address_parse() allows #GSocketClient to determine
24279  * when to use application-specific proxy protocols.
24280  *
24281  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24282  * Since: 2.26
24283  */
24284
24285
24286 /**
24287  * g_network_monitor_base_add_network:
24288  * @monitor: the #GNetworkMonitorBase
24289  * @network: a #GInetAddressMask
24290  *
24291  * Adds @network to @monitor's list of available networks.
24292  *
24293  * Since: 2.32
24294  */
24295
24296
24297 /**
24298  * g_network_monitor_base_remove_network:
24299  * @monitor: the #GNetworkMonitorBase
24300  * @network: a #GInetAddressMask
24301  *
24302  * Removes @network from @monitor's list of available networks.
24303  *
24304  * Since: 2.32
24305  */
24306
24307
24308 /**
24309  * g_network_monitor_base_set_networks:
24310  * @monitor: the #GNetworkMonitorBase
24311  * @networks: (array length=length): an array of #GInetAddressMask
24312  * @length: length of @networks
24313  *
24314  * Drops @monitor's current list of available networks and replaces
24315  * it with @networks.
24316  */
24317
24318
24319 /**
24320  * g_network_monitor_can_reach:
24321  * @monitor: a #GNetworkMonitor
24322  * @connectable: a #GSocketConnectable
24323  * @cancellable: (allow-none): a #GCancellable, or %NULL
24324  * @error: return location for a #GError, or %NULL
24325  *
24326  * Attempts to determine whether or not the host pointed to by
24327  * @connectable can be reached, without actually trying to connect to
24328  * it.
24329  *
24330  * This may return %TRUE even when #GNetworkMonitor:network-available
24331  * is %FALSE, if, for example, @monitor can determine that
24332  * @connectable refers to a host on a local network.
24333  *
24334  * If @monitor believes that an attempt to connect to @connectable
24335  * will succeed, it will return %TRUE. Otherwise, it will return
24336  * %FALSE and set @error to an appropriate error (such as
24337  * %G_IO_ERROR_HOST_UNREACHABLE).
24338  *
24339  * Note that although this does not attempt to connect to
24340  * @connectable, it may still block for a brief period of time (eg,
24341  * trying to do multicast DNS on the local network), so if you do not
24342  * want to block, you should use g_network_monitor_can_reach_async().
24343  *
24344  * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24345  * Since: 2.32
24346  */
24347
24348
24349 /**
24350  * g_network_monitor_can_reach_async:
24351  * @monitor: a #GNetworkMonitor
24352  * @connectable: a #GSocketConnectable
24353  * @cancellable: (allow-none): a #GCancellable, or %NULL
24354  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24355  * @user_data: (closure): the data to pass to callback function
24356  *
24357  * Asynchronously attempts to determine whether or not the host
24358  * pointed to by @connectable can be reached, without actually
24359  * trying to connect to it.
24360  *
24361  * For more details, see g_network_monitor_can_reach().
24362  *
24363  * When the operation is finished, @callback will be called.
24364  * You can then call g_network_monitor_can_reach_finish()
24365  * to get the result of the operation.
24366  */
24367
24368
24369 /**
24370  * g_network_monitor_can_reach_finish:
24371  * @monitor: a #GNetworkMonitor
24372  * @result: a #GAsyncResult
24373  * @error: return location for errors, or %NULL
24374  *
24375  * Finishes an async network connectivity test.
24376  * See g_network_monitor_can_reach_async().
24377  *
24378  * Returns: %TRUE if network is reachable, %FALSE if not.
24379  */
24380
24381
24382 /**
24383  * g_network_monitor_get_default:
24384  *
24385  * Gets the default #GNetworkMonitor for the system.
24386  *
24387  * Returns: (transfer none): a #GNetworkMonitor
24388  * Since: 2.32
24389  */
24390
24391
24392 /**
24393  * g_network_monitor_get_network_available:
24394  * @monitor: the #GNetworkMonitor
24395  *
24396  * Checks if the network is available. "Available" here means that the
24397  * system has a default route available for at least one of IPv4 or
24398  * IPv6. It does not necessarily imply that the public Internet is
24399  * reachable. See #GNetworkMonitor:network-available for more details.
24400  *
24401  * Returns: whether the network is available
24402  * Since: 2.32
24403  */
24404
24405
24406 /**
24407  * g_network_service_get_domain:
24408  * @srv: a #GNetworkService
24409  *
24410  * Gets the domain that @srv serves. This might be either UTF-8 or
24411  * ASCII-encoded, depending on what @srv was created with.
24412  *
24413  * Returns: @srv's domain name
24414  * Since: 2.22
24415  */
24416
24417
24418 /**
24419  * g_network_service_get_protocol:
24420  * @srv: a #GNetworkService
24421  *
24422  * Gets @srv's protocol name (eg, "tcp").
24423  *
24424  * Returns: @srv's protocol name
24425  * Since: 2.22
24426  */
24427
24428
24429 /**
24430  * g_network_service_get_scheme:
24431  * @srv: a #GNetworkService
24432  *
24433  * Get's the URI scheme used to resolve proxies. By default, the service name
24434  * is used as scheme.
24435  *
24436  * Returns: @srv's scheme name
24437  * Since: 2.26
24438  */
24439
24440
24441 /**
24442  * g_network_service_get_service:
24443  * @srv: a #GNetworkService
24444  *
24445  * Gets @srv's service name (eg, "ldap").
24446  *
24447  * Returns: @srv's service name
24448  * Since: 2.22
24449  */
24450
24451
24452 /**
24453  * g_network_service_new:
24454  * @service: the service type to look up (eg, "ldap")
24455  * @protocol: the networking protocol to use for @service (eg, "tcp")
24456  * @domain: the DNS domain to look up the service in
24457  *
24458  * Creates a new #GNetworkService representing the given @service,
24459  * @protocol, and @domain. This will initially be unresolved; use the
24460  * #GSocketConnectable interface to resolve it.
24461  *
24462  * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24463  * Since: 2.22
24464  */
24465
24466
24467 /**
24468  * g_network_service_set_scheme:
24469  * @srv: a #GNetworkService
24470  * @scheme: a URI scheme
24471  *
24472  * Set's the URI scheme used to resolve proxies. By default, the service name
24473  * is used as scheme.
24474  *
24475  * Since: 2.26
24476  */
24477
24478
24479 /**
24480  * g_networking_init:
24481  *
24482  * Initializes the platform networking libraries (eg, on Windows, this
24483  * calls WSAStartup()). GLib will call this itself if it is needed, so
24484  * you only need to call it if you directly call system networking
24485  * functions (without calling any GLib networking functions first).
24486  *
24487  * Since: 2.36
24488  */
24489
24490
24491 /**
24492  * g_null_settings_backend_new:
24493  *
24494  * Creates a readonly #GSettingsBackend.
24495  *
24496  * This backend does not allow changes to settings, so all settings
24497  * will always have their default values.
24498  *
24499  * Returns: (transfer full): a newly created #GSettingsBackend
24500  * Since: 2.28
24501  */
24502
24503
24504 /**
24505  * g_output_stream_clear_pending:
24506  * @stream: output stream
24507  *
24508  * Clears the pending flag on @stream.
24509  */
24510
24511
24512 /**
24513  * g_output_stream_close:
24514  * @stream: A #GOutputStream.
24515  * @cancellable: (allow-none): optional cancellable object
24516  * @error: location to store the error occurring, or %NULL to ignore
24517  *
24518  * Closes the stream, releasing resources related to it.
24519  *
24520  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24521  * Closing a stream multiple times will not return an error.
24522  *
24523  * Closing a stream will automatically flush any outstanding buffers in the
24524  * stream.
24525  *
24526  * Streams will be automatically closed when the last reference
24527  * is dropped, but you might want to call this function to make sure
24528  * resources are released as early as possible.
24529  *
24530  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24531  * open after the stream is closed. See the documentation for the individual
24532  * stream for details.
24533  *
24534  * On failure the first error that happened will be reported, but the close
24535  * operation will finish as much as possible. A stream that failed to
24536  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24537  * is important to check and report the error to the user, otherwise
24538  * there might be a loss of data as all data might not be written.
24539  *
24540  * If @cancellable is not %NULL, then the operation can be cancelled by
24541  * triggering the cancellable object from another thread. If the operation
24542  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24543  * Cancelling a close will still leave the stream closed, but there some streams
24544  * can use a faster close that doesn't block to e.g. check errors. On
24545  * cancellation (as with any error) there is no guarantee that all written
24546  * data will reach the target.
24547  *
24548  * Returns: %TRUE on success, %FALSE on failure
24549  */
24550
24551
24552 /**
24553  * g_output_stream_close_async:
24554  * @stream: A #GOutputStream.
24555  * @io_priority: the io priority of the request.
24556  * @cancellable: (allow-none): optional cancellable object
24557  * @callback: (scope async): callback to call when the request is satisfied
24558  * @user_data: (closure): the data to pass to callback function
24559  *
24560  * Requests an asynchronous close of the stream, releasing resources
24561  * related to it. When the operation is finished @callback will be
24562  * called. You can then call g_output_stream_close_finish() to get
24563  * the result of the operation.
24564  *
24565  * For behaviour details see g_output_stream_close().
24566  *
24567  * The asyncronous methods have a default fallback that uses threads
24568  * to implement asynchronicity, so they are optional for inheriting
24569  * classes. However, if you override one you must override all.
24570  */
24571
24572
24573 /**
24574  * g_output_stream_close_finish:
24575  * @stream: a #GOutputStream.
24576  * @result: a #GAsyncResult.
24577  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24578  *
24579  * Closes an output stream.
24580  *
24581  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24582  */
24583
24584
24585 /**
24586  * g_output_stream_flush:
24587  * @stream: a #GOutputStream.
24588  * @cancellable: (allow-none): optional cancellable object
24589  * @error: location to store the error occurring, or %NULL to ignore
24590  *
24591  * Forces a write of all user-space buffered data for the given
24592  * @stream. Will block during the operation. Closing the stream will
24593  * implicitly cause a flush.
24594  *
24595  * This function is optional for inherited classes.
24596  *
24597  * If @cancellable is not %NULL, then the operation can be cancelled by
24598  * triggering the cancellable object from another thread. If the operation
24599  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24600  *
24601  * Returns: %TRUE on success, %FALSE on error
24602  */
24603
24604
24605 /**
24606  * g_output_stream_flush_async:
24607  * @stream: a #GOutputStream.
24608  * @io_priority: the io priority of the request.
24609  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24610  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24611  * @user_data: (closure): the data to pass to callback function
24612  *
24613  * Forces an asynchronous write of all user-space buffered data for
24614  * the given @stream.
24615  * For behaviour details see g_output_stream_flush().
24616  *
24617  * When the operation is finished @callback will be
24618  * called. You can then call g_output_stream_flush_finish() to get the
24619  * result of the operation.
24620  */
24621
24622
24623 /**
24624  * g_output_stream_flush_finish:
24625  * @stream: a #GOutputStream.
24626  * @result: a GAsyncResult.
24627  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24628  *
24629  * Finishes flushing an output stream.
24630  *
24631  * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24632  */
24633
24634
24635 /**
24636  * g_output_stream_has_pending:
24637  * @stream: a #GOutputStream.
24638  *
24639  * Checks if an ouput stream has pending actions.
24640  *
24641  * Returns: %TRUE if @stream has pending actions.
24642  */
24643
24644
24645 /**
24646  * g_output_stream_is_closed:
24647  * @stream: a #GOutputStream.
24648  *
24649  * Checks if an output stream has already been closed.
24650  *
24651  * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24652  */
24653
24654
24655 /**
24656  * g_output_stream_is_closing:
24657  * @stream: a #GOutputStream.
24658  *
24659  * Checks if an output stream is being closed. This can be
24660  * used inside e.g. a flush implementation to see if the
24661  * flush (or other i/o operation) is called from within
24662  * the closing operation.
24663  *
24664  * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24665  * Since: 2.24
24666  */
24667
24668
24669 /**
24670  * g_output_stream_set_pending:
24671  * @stream: a #GOutputStream.
24672  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24673  *
24674  * Sets @stream to have actions pending. If the pending flag is
24675  * already set or @stream is closed, it will return %FALSE and set
24676  * @error.
24677  *
24678  * Returns: %TRUE if pending was previously unset and is now set.
24679  */
24680
24681
24682 /**
24683  * g_output_stream_splice:
24684  * @stream: a #GOutputStream.
24685  * @source: a #GInputStream.
24686  * @flags: a set of #GOutputStreamSpliceFlags.
24687  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24688  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24689  *
24690  * Splices an input stream into an output stream.
24691  *
24692  * Returns: a #gssize containing the size of the data spliced, or -1 if an error occurred. Note that if the number of bytes spliced is greater than %G_MAXSSIZE, then that will be returned, and there is no way to determine the actual number of bytes spliced.
24693  */
24694
24695
24696 /**
24697  * g_output_stream_splice_async:
24698  * @stream: a #GOutputStream.
24699  * @source: a #GInputStream.
24700  * @flags: a set of #GOutputStreamSpliceFlags.
24701  * @io_priority: the io priority of the request.
24702  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24703  * @callback: (scope async): a #GAsyncReadyCallback.
24704  * @user_data: (closure): user data passed to @callback.
24705  *
24706  * Splices a stream asynchronously.
24707  * When the operation is finished @callback will be called.
24708  * You can then call g_output_stream_splice_finish() to get the
24709  * result of the operation.
24710  *
24711  * For the synchronous, blocking version of this function, see
24712  * g_output_stream_splice().
24713  */
24714
24715
24716 /**
24717  * g_output_stream_splice_finish:
24718  * @stream: a #GOutputStream.
24719  * @result: a #GAsyncResult.
24720  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24721  *
24722  * Finishes an asynchronous stream splice operation.
24723  *
24724  * Returns: a #gssize of the number of bytes spliced. Note that if the number of bytes spliced is greater than %G_MAXSSIZE, then that will be returned, and there is no way to determine the actual number of bytes spliced.
24725  */
24726
24727
24728 /**
24729  * g_output_stream_write:
24730  * @stream: a #GOutputStream.
24731  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24732  * @count: the number of bytes to write
24733  * @cancellable: (allow-none): optional cancellable object
24734  * @error: location to store the error occurring, or %NULL to ignore
24735  *
24736  * Tries to write @count bytes from @buffer into the stream. Will block
24737  * during the operation.
24738  *
24739  * If count is 0, returns 0 and does nothing. A value of @count
24740  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24741  *
24742  * On success, the number of bytes written to the stream is returned.
24743  * It is not an error if this is not the same as the requested size, as it
24744  * can happen e.g. on a partial I/O error, or if there is not enough
24745  * storage in the stream. All writes block until at least one byte
24746  * is written or an error occurs; 0 is never returned (unless
24747  * @count is 0).
24748  *
24749  * If @cancellable is not %NULL, then the operation can be cancelled by
24750  * triggering the cancellable object from another thread. If the operation
24751  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24752  * operation was partially finished when the operation was cancelled the
24753  * partial result will be returned, without an error.
24754  *
24755  * On error -1 is returned and @error is set accordingly.
24756  *
24757  * Virtual: write_fn
24758  * Returns: Number of bytes written, or -1 on error
24759  */
24760
24761
24762 /**
24763  * g_output_stream_write_all:
24764  * @stream: a #GOutputStream.
24765  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24766  * @count: the number of bytes to write
24767  * @bytes_written: (out): location to store the number of bytes that was written to the stream
24768  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24769  * @error: location to store the error occurring, or %NULL to ignore
24770  *
24771  * Tries to write @count bytes from @buffer into the stream. Will block
24772  * during the operation.
24773  *
24774  * This function is similar to g_output_stream_write(), except it tries to
24775  * write as many bytes as requested, only stopping on an error.
24776  *
24777  * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24778  * is set to @count.
24779  *
24780  * If there is an error during the operation %FALSE is returned and @error
24781  * is set to indicate the error status, @bytes_written is updated to contain
24782  * the number of bytes written into the stream before the error occurred.
24783  *
24784  * Returns: %TRUE on success, %FALSE if there was an error
24785  */
24786
24787
24788 /**
24789  * g_output_stream_write_async:
24790  * @stream: A #GOutputStream.
24791  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24792  * @count: the number of bytes to write
24793  * @io_priority: the io priority of the request.
24794  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24795  * @callback: (scope async): callback to call when the request is satisfied
24796  * @user_data: (closure): the data to pass to callback function
24797  *
24798  * Request an asynchronous write of @count bytes from @buffer into
24799  * the stream. When the operation is finished @callback will be called.
24800  * You can then call g_output_stream_write_finish() to get the result of the
24801  * operation.
24802  *
24803  * During an async request no other sync and async calls are allowed,
24804  * and will result in %G_IO_ERROR_PENDING errors.
24805  *
24806  * A value of @count larger than %G_MAXSSIZE will cause a
24807  * %G_IO_ERROR_INVALID_ARGUMENT error.
24808  *
24809  * On success, the number of bytes written will be passed to the
24810  * @callback. It is not an error if this is not the same as the
24811  * requested size, as it can happen e.g. on a partial I/O error,
24812  * but generally we try to write as many bytes as requested.
24813  *
24814  * You are guaranteed that this method will never fail with
24815  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24816  * method will just wait until this changes.
24817  *
24818  * Any outstanding I/O request with higher priority (lower numerical
24819  * value) will be executed before an outstanding request with lower
24820  * priority. Default priority is %G_PRIORITY_DEFAULT.
24821  *
24822  * The asyncronous methods have a default fallback that uses threads
24823  * to implement asynchronicity, so they are optional for inheriting
24824  * classes. However, if you override one you must override all.
24825  *
24826  * For the synchronous, blocking version of this function, see
24827  * g_output_stream_write().
24828  */
24829
24830
24831 /**
24832  * g_output_stream_write_bytes:
24833  * @stream: a #GOutputStream.
24834  * @bytes: the #GBytes to write
24835  * @cancellable: (allow-none): optional cancellable object
24836  * @error: location to store the error occurring, or %NULL to ignore
24837  *
24838  * Tries to write the data from @bytes into the stream. Will block
24839  * during the operation.
24840  *
24841  * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24842  * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24843  *
24844  * On success, the number of bytes written to the stream is returned.
24845  * It is not an error if this is not the same as the requested size, as it
24846  * can happen e.g. on a partial I/O error, or if there is not enough
24847  * storage in the stream. All writes block until at least one byte
24848  * is written or an error occurs; 0 is never returned (unless
24849  * the size of @bytes is 0).
24850  *
24851  * If @cancellable is not %NULL, then the operation can be cancelled by
24852  * triggering the cancellable object from another thread. If the operation
24853  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24854  * operation was partially finished when the operation was cancelled the
24855  * partial result will be returned, without an error.
24856  *
24857  * On error -1 is returned and @error is set accordingly.
24858  *
24859  * Returns: Number of bytes written, or -1 on error
24860  */
24861
24862
24863 /**
24864  * g_output_stream_write_bytes_async:
24865  * @stream: A #GOutputStream.
24866  * @bytes: The bytes to write
24867  * @io_priority: the io priority of the request.
24868  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24869  * @callback: (scope async): callback to call when the request is satisfied
24870  * @user_data: (closure): the data to pass to callback function
24871  *
24872  * Request an asynchronous write of the data in @bytes to the stream.
24873  * When the operation is finished @callback will be called. You can
24874  * then call g_output_stream_write_bytes_finish() to get the result of
24875  * the operation.
24876  *
24877  * During an async request no other sync and async calls are allowed,
24878  * and will result in %G_IO_ERROR_PENDING errors.
24879  *
24880  * A #GBytes larger than %G_MAXSSIZE will cause a
24881  * %G_IO_ERROR_INVALID_ARGUMENT error.
24882  *
24883  * On success, the number of bytes written will be passed to the
24884  * @callback. It is not an error if this is not the same as the
24885  * requested size, as it can happen e.g. on a partial I/O error,
24886  * but generally we try to write as many bytes as requested.
24887  *
24888  * You are guaranteed that this method will never fail with
24889  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24890  * method will just wait until this changes.
24891  *
24892  * Any outstanding I/O request with higher priority (lower numerical
24893  * value) will be executed before an outstanding request with lower
24894  * priority. Default priority is %G_PRIORITY_DEFAULT.
24895  *
24896  * For the synchronous, blocking version of this function, see
24897  * g_output_stream_write_bytes().
24898  */
24899
24900
24901 /**
24902  * g_output_stream_write_bytes_finish:
24903  * @stream: a #GOutputStream.
24904  * @result: a #GAsyncResult.
24905  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24906  *
24907  * Finishes a stream write-from-#GBytes operation.
24908  *
24909  * Returns: a #gssize containing the number of bytes written to the stream.
24910  */
24911
24912
24913 /**
24914  * g_output_stream_write_finish:
24915  * @stream: a #GOutputStream.
24916  * @result: a #GAsyncResult.
24917  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24918  *
24919  * Finishes a stream write operation.
24920  *
24921  * Returns: a #gssize containing the number of bytes written to the stream.
24922  */
24923
24924
24925 /**
24926  * g_permission_acquire:
24927  * @permission: a #GPermission instance
24928  * @cancellable: (allow-none): a #GCancellable, or %NULL
24929  * @error: a pointer to a %NULL #GError, or %NULL
24930  *
24931  * Attempts to acquire the permission represented by @permission.
24932  *
24933  * The precise method by which this happens depends on the permission
24934  * and the underlying authentication mechanism.  A simple example is
24935  * that a dialog may appear asking the user to enter their password.
24936  *
24937  * You should check with g_permission_get_can_acquire() before calling
24938  * this function.
24939  *
24940  * If the permission is acquired then %TRUE is returned.  Otherwise,
24941  * %FALSE is returned and @error is set appropriately.
24942  *
24943  * This call is blocking, likely for a very long time (in the case that
24944  * user interaction is required).  See g_permission_acquire_async() for
24945  * the non-blocking version.
24946  *
24947  * Returns: %TRUE if the permission was successfully acquired
24948  * Since: 2.26
24949  */
24950
24951
24952 /**
24953  * g_permission_acquire_async:
24954  * @permission: a #GPermission instance
24955  * @cancellable: (allow-none): a #GCancellable, or %NULL
24956  * @callback: the #GAsyncReadyCallback to call when done
24957  * @user_data: the user data to pass to @callback
24958  *
24959  * Attempts to acquire the permission represented by @permission.
24960  *
24961  * This is the first half of the asynchronous version of
24962  * g_permission_acquire().
24963  *
24964  * Since: 2.26
24965  */
24966
24967
24968 /**
24969  * g_permission_acquire_finish:
24970  * @permission: a #GPermission instance
24971  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24972  * @error: a pointer to a %NULL #GError, or %NULL
24973  *
24974  * Collects the result of attempting to acquire the permission
24975  * represented by @permission.
24976  *
24977  * This is the second half of the asynchronous version of
24978  * g_permission_acquire().
24979  *
24980  * Returns: %TRUE if the permission was successfully acquired
24981  * Since: 2.26
24982  */
24983
24984
24985 /**
24986  * g_permission_get_allowed:
24987  * @permission: a #GPermission instance
24988  *
24989  * Gets the value of the 'allowed' property.  This property is %TRUE if
24990  * the caller currently has permission to perform the action that
24991  * @permission represents the permission to perform.
24992  *
24993  * Returns: the value of the 'allowed' property
24994  * Since: 2.26
24995  */
24996
24997
24998 /**
24999  * g_permission_get_can_acquire:
25000  * @permission: a #GPermission instance
25001  *
25002  * Gets the value of the 'can-acquire' property.  This property is %TRUE
25003  * if it is generally possible to acquire the permission by calling
25004  * g_permission_acquire().
25005  *
25006  * Returns: the value of the 'can-acquire' property
25007  * Since: 2.26
25008  */
25009
25010
25011 /**
25012  * g_permission_get_can_release:
25013  * @permission: a #GPermission instance
25014  *
25015  * Gets the value of the 'can-release' property.  This property is %TRUE
25016  * if it is generally possible to release the permission by calling
25017  * g_permission_release().
25018  *
25019  * Returns: the value of the 'can-release' property
25020  * Since: 2.26
25021  */
25022
25023
25024 /**
25025  * g_permission_impl_update:
25026  * @permission: a #GPermission instance
25027  * @allowed: the new value for the 'allowed' property
25028  * @can_acquire: the new value for the 'can-acquire' property
25029  * @can_release: the new value for the 'can-release' property
25030  *
25031  * This function is called by the #GPermission implementation to update
25032  * the properties of the permission.  You should never call this
25033  * function except from a #GPermission implementation.
25034  *
25035  * GObject notify signals are generated, as appropriate.
25036  *
25037  * Since: 2.26
25038  */
25039
25040
25041 /**
25042  * g_permission_release:
25043  * @permission: a #GPermission instance
25044  * @cancellable: (allow-none): a #GCancellable, or %NULL
25045  * @error: a pointer to a %NULL #GError, or %NULL
25046  *
25047  * Attempts to release the permission represented by @permission.
25048  *
25049  * The precise method by which this happens depends on the permission
25050  * and the underlying authentication mechanism.  In most cases the
25051  * permission will be dropped immediately without further action.
25052  *
25053  * You should check with g_permission_get_can_release() before calling
25054  * this function.
25055  *
25056  * If the permission is released then %TRUE is returned.  Otherwise,
25057  * %FALSE is returned and @error is set appropriately.
25058  *
25059  * This call is blocking, likely for a very long time (in the case that
25060  * user interaction is required).  See g_permission_release_async() for
25061  * the non-blocking version.
25062  *
25063  * Returns: %TRUE if the permission was successfully released
25064  * Since: 2.26
25065  */
25066
25067
25068 /**
25069  * g_permission_release_async:
25070  * @permission: a #GPermission instance
25071  * @cancellable: (allow-none): a #GCancellable, or %NULL
25072  * @callback: the #GAsyncReadyCallback to call when done
25073  * @user_data: the user data to pass to @callback
25074  *
25075  * Attempts to release the permission represented by @permission.
25076  *
25077  * This is the first half of the asynchronous version of
25078  * g_permission_release().
25079  *
25080  * Since: 2.26
25081  */
25082
25083
25084 /**
25085  * g_permission_release_finish:
25086  * @permission: a #GPermission instance
25087  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25088  * @error: a pointer to a %NULL #GError, or %NULL
25089  *
25090  * Collects the result of attempting to release the permission
25091  * represented by @permission.
25092  *
25093  * This is the second half of the asynchronous version of
25094  * g_permission_release().
25095  *
25096  * Returns: %TRUE if the permission was successfully released
25097  * Since: 2.26
25098  */
25099
25100
25101 /**
25102  * g_poll_file_monitor_new:
25103  * @file: a #GFile.
25104  *
25105  * Polls @file for changes.
25106  *
25107  * Returns: a new #GFileMonitor for the given #GFile.
25108  */
25109
25110
25111 /**
25112  * g_pollable_input_stream_can_poll:
25113  * @stream: a #GPollableInputStream.
25114  *
25115  * Checks if @stream is actually pollable. Some classes may implement
25116  * #GPollableInputStream but have only certain instances of that class
25117  * be pollable. If this method returns %FALSE, then the behavior of
25118  * other #GPollableInputStream methods is undefined.
25119  *
25120  * For any given stream, the value returned by this method is constant;
25121  * a stream cannot switch from pollable to non-pollable or vice versa.
25122  *
25123  * Returns: %TRUE if @stream is pollable, %FALSE if not.
25124  * Since: 2.28
25125  */
25126
25127
25128 /**
25129  * g_pollable_input_stream_create_source:
25130  * @stream: a #GPollableInputStream.
25131  * @cancellable: (allow-none): a #GCancellable, or %NULL
25132  *
25133  * Creates a #GSource that triggers when @stream can be read, or
25134  * @cancellable is triggered or an error occurs. The callback on the
25135  * source is of the #GPollableSourceFunc type.
25136  *
25137  * As with g_pollable_input_stream_is_readable(), it is possible that
25138  * the stream may not actually be readable even after the source
25139  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
25140  * rather than g_input_stream_read() from the callback.
25141  *
25142  * Returns: (transfer full): a new #GSource
25143  * Since: 2.28
25144  */
25145
25146
25147 /**
25148  * g_pollable_input_stream_is_readable:
25149  * @stream: a #GPollableInputStream.
25150  *
25151  * Checks if @stream can be read.
25152  *
25153  * Note that some stream types may not be able to implement this 100%
25154  * reliably, and it is possible that a call to g_input_stream_read()
25155  * after this returns %TRUE would still block. To guarantee
25156  * non-blocking behavior, you should always use
25157  * g_pollable_input_stream_read_nonblocking(), which will return a
25158  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25159  *
25160  * Returns: %TRUE if @stream is readable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_input_stream_is_readable() returning %TRUE, and the next attempt to read will return the error.
25161  * Since: 2.28
25162  */
25163
25164
25165 /**
25166  * g_pollable_input_stream_read_nonblocking:
25167  * @stream: a #GPollableInputStream
25168  * @buffer: a buffer to read data into (which should be at least @count bytes long).
25169  * @count: the number of bytes you want to read
25170  * @cancellable: (allow-none): a #GCancellable, or %NULL
25171  * @error: #GError for error reporting, or %NULL to ignore.
25172  *
25173  * Attempts to read up to @count bytes from @stream into @buffer, as
25174  * with g_input_stream_read(). If @stream is not currently readable,
25175  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25176  * use g_pollable_input_stream_create_source() to create a #GSource
25177  * that will be triggered when @stream is readable.
25178  *
25179  * Note that since this method never blocks, you cannot actually
25180  * use @cancellable to cancel it. However, it will return an error
25181  * if @cancellable has already been cancelled when you call, which
25182  * may happen if you call this method after a source triggers due
25183  * to having been cancelled.
25184  *
25185  * Virtual: read_nonblocking
25186  * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25187  */
25188
25189
25190 /**
25191  * g_pollable_output_stream_can_poll:
25192  * @stream: a #GPollableOutputStream.
25193  *
25194  * Checks if @stream is actually pollable. Some classes may implement
25195  * #GPollableOutputStream but have only certain instances of that
25196  * class be pollable. If this method returns %FALSE, then the behavior
25197  * of other #GPollableOutputStream methods is undefined.
25198  *
25199  * For any given stream, the value returned by this method is constant;
25200  * a stream cannot switch from pollable to non-pollable or vice versa.
25201  *
25202  * Returns: %TRUE if @stream is pollable, %FALSE if not.
25203  * Since: 2.28
25204  */
25205
25206
25207 /**
25208  * g_pollable_output_stream_create_source:
25209  * @stream: a #GPollableOutputStream.
25210  * @cancellable: (allow-none): a #GCancellable, or %NULL
25211  *
25212  * Creates a #GSource that triggers when @stream can be written, or
25213  * @cancellable is triggered or an error occurs. The callback on the
25214  * source is of the #GPollableSourceFunc type.
25215  *
25216  * As with g_pollable_output_stream_is_writable(), it is possible that
25217  * the stream may not actually be writable even after the source
25218  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25219  * rather than g_output_stream_write() from the callback.
25220  *
25221  * Returns: (transfer full): a new #GSource
25222  * Since: 2.28
25223  */
25224
25225
25226 /**
25227  * g_pollable_output_stream_is_writable:
25228  * @stream: a #GPollableOutputStream.
25229  *
25230  * Checks if @stream can be written.
25231  *
25232  * Note that some stream types may not be able to implement this 100%
25233  * reliably, and it is possible that a call to g_output_stream_write()
25234  * after this returns %TRUE would still block. To guarantee
25235  * non-blocking behavior, you should always use
25236  * g_pollable_output_stream_write_nonblocking(), which will return a
25237  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25238  *
25239  * Returns: %TRUE if @stream is writable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_output_stream_is_writable() returning %TRUE, and the next attempt to write will return the error.
25240  * Since: 2.28
25241  */
25242
25243
25244 /**
25245  * g_pollable_output_stream_write_nonblocking:
25246  * @stream: a #GPollableOutputStream
25247  * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25248  * @count: the number of bytes you want to write
25249  * @cancellable: (allow-none): a #GCancellable, or %NULL
25250  * @error: #GError for error reporting, or %NULL to ignore.
25251  *
25252  * Attempts to write up to @count bytes from @buffer to @stream, as
25253  * with g_output_stream_write(). If @stream is not currently writable,
25254  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25255  * use g_pollable_output_stream_create_source() to create a #GSource
25256  * that will be triggered when @stream is writable.
25257  *
25258  * Note that since this method never blocks, you cannot actually
25259  * use @cancellable to cancel it. However, it will return an error
25260  * if @cancellable has already been cancelled when you call, which
25261  * may happen if you call this method after a source triggers due
25262  * to having been cancelled.
25263  *
25264  * Virtual: write_nonblocking
25265  * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25266  */
25267
25268
25269 /**
25270  * g_pollable_source_new:
25271  * @pollable_stream: the stream associated with the new source
25272  *
25273  * Utility method for #GPollableInputStream and #GPollableOutputStream
25274  * implementations. Creates a new #GSource that expects a callback of
25275  * type #GPollableSourceFunc. The new source does not actually do
25276  * anything on its own; use g_source_add_child_source() to add other
25277  * sources to it to cause it to trigger.
25278  *
25279  * Returns: (transfer full): the new #GSource.
25280  * Since: 2.28
25281  */
25282
25283
25284 /**
25285  * g_pollable_source_new_full:
25286  * @pollable_stream: (type GObject): the stream associated with the new source
25287  * @child_source: (allow-none): optional child source to attach
25288  * @cancellable: (allow-none): optional #GCancellable to attach
25289  *
25290  * Utility method for #GPollableInputStream and #GPollableOutputStream
25291  * implementations. Creates a new #GSource, as with
25292  * g_pollable_source_new(), but also attaching @child_source (with a
25293  * dummy callback), and @cancellable, if they are non-%NULL.
25294  *
25295  * Returns: (transfer full): the new #GSource.
25296  * Since: 2.34
25297  */
25298
25299
25300 /**
25301  * g_pollable_stream_read:
25302  * @stream: a #GInputStream
25303  * @buffer: a buffer to read data into
25304  * @count: the number of bytes to read
25305  * @blocking: whether to do blocking I/O
25306  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25307  * @error: location to store the error occurring, or %NULL to ignore
25308  *
25309  * Tries to read from @stream, as with g_input_stream_read() (if
25310  * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25311  * (if @blocking is %FALSE). This can be used to more easily share
25312  * code between blocking and non-blocking implementations of a method.
25313  *
25314  * If @blocking is %FALSE, then @stream must be a
25315  * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25316  * returns %TRUE, or else the behavior is undefined. If @blocking is
25317  * %TRUE, then @stream does not need to be a #GPollableInputStream.
25318  *
25319  * Returns: the number of bytes read, or -1 on error.
25320  * Since: 2.34
25321  */
25322
25323
25324 /**
25325  * g_pollable_stream_write:
25326  * @stream: a #GOutputStream.
25327  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25328  * @count: the number of bytes to write
25329  * @blocking: whether to do blocking I/O
25330  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25331  * @error: location to store the error occurring, or %NULL to ignore
25332  *
25333  * Tries to write to @stream, as with g_output_stream_write() (if
25334  * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25335  * (if @blocking is %FALSE). This can be used to more easily share
25336  * code between blocking and non-blocking implementations of a method.
25337  *
25338  * If @blocking is %FALSE, then @stream must be a
25339  * #GPollableOutputStream for which
25340  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25341  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25342  * need to be a #GPollableOutputStream.
25343  *
25344  * Returns: the number of bytes written, or -1 on error.
25345  * Since: 2.34
25346  */
25347
25348
25349 /**
25350  * g_pollable_stream_write_all:
25351  * @stream: a #GOutputStream.
25352  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25353  * @count: the number of bytes to write
25354  * @blocking: whether to do blocking I/O
25355  * @bytes_written: (out): location to store the number of bytes that was written to the stream
25356  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25357  * @error: location to store the error occurring, or %NULL to ignore
25358  *
25359  * Tries to write @count bytes to @stream, as with
25360  * g_output_stream_write_all(), but using g_pollable_stream_write()
25361  * rather than g_output_stream_write().
25362  *
25363  * On a successful write of @count bytes, %TRUE is returned, and
25364  * @bytes_written is set to @count.
25365  *
25366  * If there is an error during the operation (including
25367  * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25368  * returned and @error is set to indicate the error status,
25369  * @bytes_written is updated to contain the number of bytes written
25370  * into the stream before the error occurred.
25371  *
25372  * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25373  * @stream must be a #GPollableOutputStream for which
25374  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25375  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25376  * need to be a #GPollableOutputStream.
25377  *
25378  * Returns: %TRUE on success, %FALSE if there was an error
25379  * Since: 2.34
25380  */
25381
25382
25383 /**
25384  * g_property_action_new:
25385  * @name: the name of the action to create
25386  * @object: the object that has the property to wrap
25387  * @property_name: the name of the property
25388  *
25389  * Creates a #GAction corresponding to the value of property
25390  * @property_name on @object.
25391  *
25392  * The property must be existent and readable and writable (and not
25393  * construct-only).
25394  *
25395  * This function takes a reference on @object and doesn't release it
25396  * until the action is destroyed.
25397  *
25398  * Returns: a new #GPropertyAction
25399  * Since: 2.38
25400  */
25401
25402
25403 /**
25404  * g_proxy_address_get_destination_hostname:
25405  * @proxy: a #GProxyAddress
25406  *
25407  * Gets @proxy's destination hostname; that is, the name of the host
25408  * that will be connected to via the proxy, not the name of the proxy
25409  * itself.
25410  *
25411  * Returns: the @proxy's destination hostname
25412  * Since: 2.26
25413  */
25414
25415
25416 /**
25417  * g_proxy_address_get_destination_port:
25418  * @proxy: a #GProxyAddress
25419  *
25420  * Gets @proxy's destination port; that is, the port on the
25421  * destination host that will be connected to via the proxy, not the
25422  * port number of the proxy itself.
25423  *
25424  * Returns: the @proxy's destination port
25425  * Since: 2.26
25426  */
25427
25428
25429 /**
25430  * g_proxy_address_get_destination_protocol:
25431  * @proxy: a #GProxyAddress
25432  *
25433  * Gets the protocol that is being spoken to the destination
25434  * server; eg, "http" or "ftp".
25435  *
25436  * Returns: the @proxy's destination protocol
25437  * Since: 2.34
25438  */
25439
25440
25441 /**
25442  * g_proxy_address_get_password:
25443  * @proxy: a #GProxyAddress
25444  *
25445  * Gets @proxy's password.
25446  *
25447  * Returns: the @proxy's password
25448  * Since: 2.26
25449  */
25450
25451
25452 /**
25453  * g_proxy_address_get_protocol:
25454  * @proxy: a #GProxyAddress
25455  *
25456  * Gets @proxy's protocol. eg, "socks" or "http"
25457  *
25458  * Returns: the @proxy's protocol
25459  * Since: 2.26
25460  */
25461
25462
25463 /**
25464  * g_proxy_address_get_uri:
25465  * @proxy: a #GProxyAddress
25466  *
25467  * Gets the proxy URI that @proxy was constructed from.
25468  *
25469  * Returns: the @proxy's URI, or %NULL if unknown
25470  * Since: 2.34
25471  */
25472
25473
25474 /**
25475  * g_proxy_address_get_username:
25476  * @proxy: a #GProxyAddress
25477  *
25478  * Gets @proxy's username.
25479  *
25480  * Returns: the @proxy's username
25481  * Since: 2.26
25482  */
25483
25484
25485 /**
25486  * g_proxy_address_new:
25487  * @inetaddr: The proxy server #GInetAddress.
25488  * @port: The proxy server port.
25489  * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25490  * @dest_hostname: The destination hostname the proxy should tunnel to.
25491  * @dest_port: The destination port to tunnel to.
25492  * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25493  * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25494  *
25495  * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25496  * tunnel through @dest_hostname and @dest_port.
25497  *
25498  * (Note that this method doesn't set the #GProxyAddress:uri or
25499  * #GProxyAddress:destination-protocol fields; use g_object_new()
25500  * directly if you want to set those.)
25501  *
25502  * Returns: a new #GProxyAddress
25503  * Since: 2.26
25504  */
25505
25506
25507 /**
25508  * g_proxy_connect:
25509  * @proxy: a #GProxy
25510  * @connection: a #GIOStream
25511  * @proxy_address: a #GProxyAddress
25512  * @cancellable: (allow-none): a #GCancellable
25513  * @error: return #GError
25514  *
25515  * Given @connection to communicate with a proxy (eg, a
25516  * #GSocketConnection that is connected to the proxy server), this
25517  * does the necessary handshake to connect to @proxy_address, and if
25518  * required, wraps the #GIOStream to handle proxy payload.
25519  *
25520  * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25521  * Since: 2.26
25522  */
25523
25524
25525 /**
25526  * g_proxy_connect_async:
25527  * @proxy: a #GProxy
25528  * @connection: a #GIOStream
25529  * @proxy_address: a #GProxyAddress
25530  * @cancellable: (allow-none): a #GCancellable
25531  * @callback: (scope async): a #GAsyncReadyCallback
25532  * @user_data: (closure): callback data
25533  *
25534  * Asynchronous version of g_proxy_connect().
25535  *
25536  * Since: 2.26
25537  */
25538
25539
25540 /**
25541  * g_proxy_connect_finish:
25542  * @proxy: a #GProxy
25543  * @result: a #GAsyncResult
25544  * @error: return #GError
25545  *
25546  * See g_proxy_connect().
25547  *
25548  * Returns: (transfer full): a #GIOStream.
25549  * Since: 2.26
25550  */
25551
25552
25553 /**
25554  * g_proxy_get_default_for_protocol:
25555  * @protocol: the proxy protocol name (e.g. http, socks, etc)
25556  *
25557  * Lookup "gio-proxy" extension point for a proxy implementation that supports
25558  * specified protocol.
25559  *
25560  * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25561  * Since: 2.26
25562  */
25563
25564
25565 /**
25566  * g_proxy_resolver_get_default:
25567  *
25568  * Gets the default #GProxyResolver for the system.
25569  *
25570  * Returns: (transfer none): the default #GProxyResolver.
25571  * Since: 2.26
25572  */
25573
25574
25575 /**
25576  * g_proxy_resolver_is_supported:
25577  * @resolver: a #GProxyResolver
25578  *
25579  * Checks if @resolver can be used on this system. (This is used
25580  * internally; g_proxy_resolver_get_default() will only return a proxy
25581  * resolver that returns %TRUE for this method.)
25582  *
25583  * Returns: %TRUE if @resolver is supported.
25584  * Since: 2.26
25585  */
25586
25587
25588 /**
25589  * g_proxy_resolver_lookup:
25590  * @resolver: a #GProxyResolver
25591  * @uri: a URI representing the destination to connect to
25592  * @cancellable: (allow-none): a #GCancellable, or %NULL
25593  * @error: return location for a #GError, or %NULL
25594  *
25595  * Looks into the system proxy configuration to determine what proxy,
25596  * if any, to use to connect to @uri. The returned proxy URIs are of the
25597  * form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
25598  * or <literal>direct://</literal>, where &lt;protocol&gt; could be
25599  * http, rtsp, socks or other proxying protocol.
25600  *
25601  * If you don't know what network protocol is being used on the
25602  * socket, you should use <literal>none</literal> as the URI protocol.
25603  * In this case, the resolver might still return a generic proxy type
25604  * (such as SOCKS), but would not return protocol-specific proxy types
25605  * (such as http).
25606  *
25607  * <literal>direct://</literal> is used when no proxy is needed.
25608  * Direct connection should not be attempted unless it is part of the
25609  * returned array of proxies.
25610  *
25611  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25612  * Since: 2.26
25613  */
25614
25615
25616 /**
25617  * g_proxy_resolver_lookup_async:
25618  * @resolver: a #GProxyResolver
25619  * @uri: a URI representing the destination to connect to
25620  * @cancellable: (allow-none): a #GCancellable, or %NULL
25621  * @callback: (scope async): callback to call after resolution completes
25622  * @user_data: (closure): data for @callback
25623  *
25624  * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25625  * details.
25626  *
25627  * Since: 2.26
25628  */
25629
25630
25631 /**
25632  * g_proxy_resolver_lookup_finish:
25633  * @resolver: a #GProxyResolver
25634  * @result: the result passed to your #GAsyncReadyCallback
25635  * @error: return location for a #GError, or %NULL
25636  *
25637  * Call this function to obtain the array of proxy URIs when
25638  * g_proxy_resolver_lookup_async() is complete. See
25639  * g_proxy_resolver_lookup() for more details.
25640  *
25641  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25642  * Since: 2.26
25643  */
25644
25645
25646 /**
25647  * g_proxy_supports_hostname:
25648  * @proxy: a #GProxy
25649  *
25650  * Some proxy protocols expect to be passed a hostname, which they
25651  * will resolve to an IP address themselves. Others, like SOCKS4, do
25652  * not allow this. This function will return %FALSE if @proxy is
25653  * implementing such a protocol. When %FALSE is returned, the caller
25654  * should resolve the destination hostname first, and then pass a
25655  * #GProxyAddress containing the stringified IP address to
25656  * g_proxy_connect() or g_proxy_connect_async().
25657  *
25658  * Returns: %TRUE if hostname resolution is supported.
25659  * Since: 2.26
25660  */
25661
25662
25663 /**
25664  * g_remote_action_group_activate_action_full:
25665  * @remote: a #GDBusActionGroup
25666  * @action_name: the name of the action to activate
25667  * @parameter: (allow-none): the optional parameter to the activation
25668  * @platform_data: the platform data to send
25669  *
25670  * Activates the remote action.
25671  *
25672  * This is the same as g_action_group_activate_action() except that it
25673  * allows for provision of "platform data" to be sent along with the
25674  * activation request.  This typically contains details such as the user
25675  * interaction timestamp or startup notification information.
25676  *
25677  * @platform_data must be non-%NULL and must have the type
25678  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25679  *
25680  * Since: 2.32
25681  */
25682
25683
25684 /**
25685  * g_remote_action_group_change_action_state_full:
25686  * @remote: a #GRemoteActionGroup
25687  * @action_name: the name of the action to change the state of
25688  * @value: the new requested value for the state
25689  * @platform_data: the platform data to send
25690  *
25691  * Changes the state of a remote action.
25692  *
25693  * This is the same as g_action_group_change_action_state() except that
25694  * it allows for provision of "platform data" to be sent along with the
25695  * state change request.  This typically contains details such as the
25696  * user interaction timestamp or startup notification information.
25697  *
25698  * @platform_data must be non-%NULL and must have the type
25699  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25700  *
25701  * Since: 2.32
25702  */
25703
25704
25705 /**
25706  * g_resolver_error_quark:
25707  *
25708  * Gets the #GResolver Error Quark.
25709  *
25710  * Returns: a #GQuark.
25711  * Since: 2.22
25712  */
25713
25714
25715 /**
25716  * g_resolver_free_addresses: (skip)
25717  * @addresses: a #GList of #GInetAddress
25718  *
25719  * Frees @addresses (which should be the return value from
25720  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25721  * (This is a convenience method; you can also simply free the results
25722  * by hand.)
25723  *
25724  * Since: 2.22
25725  */
25726
25727
25728 /**
25729  * g_resolver_free_targets: (skip)
25730  * @targets: a #GList of #GSrvTarget
25731  *
25732  * Frees @targets (which should be the return value from
25733  * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25734  * (This is a convenience method; you can also simply free the
25735  * results by hand.)
25736  *
25737  * Since: 2.22
25738  */
25739
25740
25741 /**
25742  * g_resolver_get_default:
25743  *
25744  * Gets the default #GResolver. You should unref it when you are done
25745  * with it. #GResolver may use its reference count as a hint about how
25746  * many threads it should allocate for concurrent DNS resolutions.
25747  *
25748  * Returns: (transfer full): the default #GResolver.
25749  * Since: 2.22
25750  */
25751
25752
25753 /**
25754  * g_resolver_lookup_by_address:
25755  * @resolver: a #GResolver
25756  * @address: the address to reverse-resolve
25757  * @cancellable: (allow-none): a #GCancellable, or %NULL
25758  * @error: return location for a #GError, or %NULL
25759  *
25760  * Synchronously reverse-resolves @address to determine its
25761  * associated hostname.
25762  *
25763  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25764  * a value from #GResolverError.
25765  *
25766  * If @cancellable is non-%NULL, it can be used to cancel the
25767  * operation, in which case @error (if non-%NULL) will be set to
25768  * %G_IO_ERROR_CANCELLED.
25769  *
25770  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25771  * Since: 2.22
25772  */
25773
25774
25775 /**
25776  * g_resolver_lookup_by_address_async:
25777  * @resolver: a #GResolver
25778  * @address: the address to reverse-resolve
25779  * @cancellable: (allow-none): a #GCancellable, or %NULL
25780  * @callback: (scope async): callback to call after resolution completes
25781  * @user_data: (closure): data for @callback
25782  *
25783  * Begins asynchronously reverse-resolving @address to determine its
25784  * associated hostname, and eventually calls @callback, which must
25785  * call g_resolver_lookup_by_address_finish() to get the final result.
25786  *
25787  * Since: 2.22
25788  */
25789
25790
25791 /**
25792  * g_resolver_lookup_by_address_finish:
25793  * @resolver: a #GResolver
25794  * @result: the result passed to your #GAsyncReadyCallback
25795  * @error: return location for a #GError, or %NULL
25796  *
25797  * Retrieves the result of a previous call to
25798  * g_resolver_lookup_by_address_async().
25799  *
25800  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25801  * a value from #GResolverError. If the operation was cancelled,
25802  * @error will be set to %G_IO_ERROR_CANCELLED.
25803  *
25804  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25805  * Since: 2.22
25806  */
25807
25808
25809 /**
25810  * g_resolver_lookup_by_name:
25811  * @resolver: a #GResolver
25812  * @hostname: the hostname to look up
25813  * @cancellable: (allow-none): a #GCancellable, or %NULL
25814  * @error: return location for a #GError, or %NULL
25815  *
25816  * Synchronously resolves @hostname to determine its associated IP
25817  * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25818  * the textual form of an IP address (in which case this just becomes
25819  * a wrapper around g_inet_address_new_from_string()).
25820  *
25821  * On success, g_resolver_lookup_by_name() will return a #GList of
25822  * #GInetAddress, sorted in order of preference and guaranteed to not
25823  * contain duplicates. That is, if using the result to connect to
25824  * @hostname, you should attempt to connect to the first address
25825  * first, then the second if the first fails, etc. If you are using
25826  * the result to listen on a socket, it is appropriate to add each
25827  * result using e.g. g_socket_listener_add_address().
25828  *
25829  * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25830  * value from #GResolverError.
25831  *
25832  * If @cancellable is non-%NULL, it can be used to cancel the
25833  * operation, in which case @error (if non-%NULL) will be set to
25834  * %G_IO_ERROR_CANCELLED.
25835  *
25836  * If you are planning to connect to a socket on the resolved IP
25837  * address, it may be easier to create a #GNetworkAddress and use its
25838  * #GSocketConnectable interface.
25839  *
25840  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. You must unref each of the addresses and free the list when you are done with it. (You can use g_resolver_free_addresses() to do this.)
25841  * Since: 2.22
25842  */
25843
25844
25845 /**
25846  * g_resolver_lookup_by_name_async:
25847  * @resolver: a #GResolver
25848  * @hostname: the hostname to look up the address of
25849  * @cancellable: (allow-none): a #GCancellable, or %NULL
25850  * @callback: (scope async): callback to call after resolution completes
25851  * @user_data: (closure): data for @callback
25852  *
25853  * Begins asynchronously resolving @hostname to determine its
25854  * associated IP address(es), and eventually calls @callback, which
25855  * must call g_resolver_lookup_by_name_finish() to get the result.
25856  * See g_resolver_lookup_by_name() for more details.
25857  *
25858  * Since: 2.22
25859  */
25860
25861
25862 /**
25863  * g_resolver_lookup_by_name_finish:
25864  * @resolver: a #GResolver
25865  * @result: the result passed to your #GAsyncReadyCallback
25866  * @error: return location for a #GError, or %NULL
25867  *
25868  * Retrieves the result of a call to
25869  * g_resolver_lookup_by_name_async().
25870  *
25871  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25872  * a value from #GResolverError. If the operation was cancelled,
25873  * @error will be set to %G_IO_ERROR_CANCELLED.
25874  *
25875  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25876  * Since: 2.22
25877  */
25878
25879
25880 /**
25881  * g_resolver_lookup_records:
25882  * @resolver: a #GResolver
25883  * @rrname: the DNS name to lookup the record for
25884  * @record_type: the type of DNS record to lookup
25885  * @cancellable: (allow-none): a #GCancellable, or %NULL
25886  * @error: return location for a #GError, or %NULL
25887  *
25888  * Synchronously performs a DNS record lookup for the given @rrname and returns
25889  * a list of records as #GVariant tuples. See #GResolverRecordType for
25890  * information on what the records contain for each @record_type.
25891  *
25892  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25893  * a value from #GResolverError.
25894  *
25895  * If @cancellable is non-%NULL, it can be used to cancel the
25896  * operation, in which case @error (if non-%NULL) will be set to
25897  * %G_IO_ERROR_CANCELLED.
25898  *
25899  * Returns: (element-type GVariant) (transfer full): a #GList of #GVariant, or %NULL on error. You must free each of the records and the list when you are done with it. (You can use g_list_free_full() with g_variant_unref() to do this.)
25900  * Since: 2.34
25901  */
25902
25903
25904 /**
25905  * g_resolver_lookup_records_async:
25906  * @resolver: a #GResolver
25907  * @rrname: the DNS name to lookup the record for
25908  * @record_type: the type of DNS record to lookup
25909  * @cancellable: (allow-none): a #GCancellable, or %NULL
25910  * @callback: (scope async): callback to call after resolution completes
25911  * @user_data: (closure): data for @callback
25912  *
25913  * Begins asynchronously performing a DNS lookup for the given
25914  * @rrname, and eventually calls @callback, which must call
25915  * g_resolver_lookup_records_finish() to get the final result. See
25916  * g_resolver_lookup_records() for more details.
25917  *
25918  * Since: 2.34
25919  */
25920
25921
25922 /**
25923  * g_resolver_lookup_records_finish:
25924  * @resolver: a #GResolver
25925  * @result: the result passed to your #GAsyncReadyCallback
25926  * @error: return location for a #GError, or %NULL
25927  *
25928  * Retrieves the result of a previous call to
25929  * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25930  * tuples. See #GResolverRecordType for information on what the records contain.
25931  *
25932  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25933  * a value from #GResolverError. If the operation was cancelled,
25934  * @error will be set to %G_IO_ERROR_CANCELLED.
25935  *
25936  * Returns: (element-type GVariant) (transfer full): a #GList of #GVariant, or %NULL on error. You must free each of the records and the list when you are done with it. (You can use g_list_free_full() with g_variant_unref() to do this.)
25937  * Since: 2.34
25938  */
25939
25940
25941 /**
25942  * g_resolver_lookup_service:
25943  * @resolver: a #GResolver
25944  * @service: the service type to look up (eg, "ldap")
25945  * @protocol: the networking protocol to use for @service (eg, "tcp")
25946  * @domain: the DNS domain to look up the service in
25947  * @cancellable: (allow-none): a #GCancellable, or %NULL
25948  * @error: return location for a #GError, or %NULL
25949  *
25950  * Synchronously performs a DNS SRV lookup for the given @service and
25951  * @protocol in the given @domain and returns an array of #GSrvTarget.
25952  * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25953  * @service and @protocol arguments <emphasis>do not</emphasis>
25954  * include the leading underscore that appears in the actual DNS
25955  * entry.
25956  *
25957  * On success, g_resolver_lookup_service() will return a #GList of
25958  * #GSrvTarget, sorted in order of preference. (That is, you should
25959  * attempt to connect to the first target first, then the second if
25960  * the first fails, etc.)
25961  *
25962  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25963  * a value from #GResolverError.
25964  *
25965  * If @cancellable is non-%NULL, it can be used to cancel the
25966  * operation, in which case @error (if non-%NULL) will be set to
25967  * %G_IO_ERROR_CANCELLED.
25968  *
25969  * If you are planning to connect to the service, it is usually easier
25970  * to create a #GNetworkService and use its #GSocketConnectable
25971  * interface.
25972  *
25973  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. You must free each of the targets and the list when you are done with it. (You can use g_resolver_free_targets() to do this.)
25974  * Since: 2.22
25975  */
25976
25977
25978 /**
25979  * g_resolver_lookup_service_async:
25980  * @resolver: a #GResolver
25981  * @service: the service type to look up (eg, "ldap")
25982  * @protocol: the networking protocol to use for @service (eg, "tcp")
25983  * @domain: the DNS domain to look up the service in
25984  * @cancellable: (allow-none): a #GCancellable, or %NULL
25985  * @callback: (scope async): callback to call after resolution completes
25986  * @user_data: (closure): data for @callback
25987  *
25988  * Begins asynchronously performing a DNS SRV lookup for the given
25989  * @service and @protocol in the given @domain, and eventually calls
25990  * @callback, which must call g_resolver_lookup_service_finish() to
25991  * get the final result. See g_resolver_lookup_service() for more
25992  * details.
25993  *
25994  * Since: 2.22
25995  */
25996
25997
25998 /**
25999  * g_resolver_lookup_service_finish:
26000  * @resolver: a #GResolver
26001  * @result: the result passed to your #GAsyncReadyCallback
26002  * @error: return location for a #GError, or %NULL
26003  *
26004  * Retrieves the result of a previous call to
26005  * g_resolver_lookup_service_async().
26006  *
26007  * If the DNS resolution failed, @error (if non-%NULL) will be set to
26008  * a value from #GResolverError. If the operation was cancelled,
26009  * @error will be set to %G_IO_ERROR_CANCELLED.
26010  *
26011  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
26012  * Since: 2.22
26013  */
26014
26015
26016 /**
26017  * g_resolver_set_default:
26018  * @resolver: the new default #GResolver
26019  *
26020  * Sets @resolver to be the application's default resolver (reffing
26021  * @resolver, and unreffing the previous default resolver, if any).
26022  * Future calls to g_resolver_get_default() will return this resolver.
26023  *
26024  * This can be used if an application wants to perform any sort of DNS
26025  * caching or "pinning"; it can implement its own #GResolver that
26026  * calls the original default resolver for DNS operations, and
26027  * implements its own cache policies on top of that, and then set
26028  * itself as the default resolver for all later code to use.
26029  *
26030  * Since: 2.22
26031  */
26032
26033
26034 /**
26035  * g_resource_enumerate_children:
26036  * @resource: A #GResource
26037  * @path: A pathname inside the resource
26038  * @lookup_flags: A #GResourceLookupFlags
26039  * @error: return location for a #GError, or %NULL
26040  *
26041  * Returns all the names of children at the specified @path in the resource.
26042  * The return result is a %NULL terminated list of strings which should
26043  * be released with g_strfreev().
26044  *
26045  * @lookup_flags controls the behaviour of the lookup.
26046  *
26047  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26048  * Since: 2.32
26049  */
26050
26051
26052 /**
26053  * g_resource_error_quark:
26054  *
26055  * Gets the #GResource Error Quark.
26056  *
26057  * Returns: a #GQuark
26058  * Since: 2.32
26059  */
26060
26061
26062 /**
26063  * g_resource_get_info:
26064  * @resource: A #GResource
26065  * @path: A pathname inside the resource
26066  * @lookup_flags: A #GResourceLookupFlags
26067  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26068  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26069  * @error: return location for a #GError, or %NULL
26070  *
26071  * Looks for a file at the specified @path in the resource and
26072  * if found returns information about it.
26073  *
26074  * @lookup_flags controls the behaviour of the lookup.
26075  *
26076  * Returns: %TRUE if the file was found. %FALSE if there were errors
26077  * Since: 2.32
26078  */
26079
26080
26081 /**
26082  * g_resource_load:
26083  * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
26084  * @error: return location for a #GError, or %NULL
26085  *
26086  * Loads a binary resource bundle and creates a #GResource representation of it, allowing
26087  * you to query it for data.
26088  *
26089  * If you want to use this resource in the global resource namespace you need
26090  * to register it with g_resources_register().
26091  *
26092  * Returns: (transfer full): a new #GResource, or %NULL on error
26093  * Since: 2.32
26094  */
26095
26096
26097 /**
26098  * g_resource_lookup_data:
26099  * @resource: A #GResource
26100  * @path: A pathname inside the resource
26101  * @lookup_flags: A #GResourceLookupFlags
26102  * @error: return location for a #GError, or %NULL
26103  *
26104  * Looks for a file at the specified @path in the resource and
26105  * returns a #GBytes that lets you directly access the data in
26106  * memory.
26107  *
26108  * The data is always followed by a zero byte, so you
26109  * can safely use the data as a C string. However, that byte
26110  * is not included in the size of the GBytes.
26111  *
26112  * For uncompressed resource files this is a pointer directly into
26113  * the resource bundle, which is typically in some readonly data section
26114  * in the program binary. For compressed files we allocate memory on
26115  * the heap and automatically uncompress the data.
26116  *
26117  * @lookup_flags controls the behaviour of the lookup.
26118  *
26119  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26120  * Since: 2.32
26121  */
26122
26123
26124 /**
26125  * g_resource_new_from_data:
26126  * @data: A #GBytes
26127  * @error: return location for a #GError, or %NULL
26128  *
26129  * Creates a GResource from a reference to the binary resource bundle.
26130  * This will keep a reference to @data while the resource lives, so
26131  * the data should not be modified or freed.
26132  *
26133  * If you want to use this resource in the global resource namespace you need
26134  * to register it with g_resources_register().
26135  *
26136  * Returns: (transfer full): a new #GResource, or %NULL on error
26137  * Since: 2.32
26138  */
26139
26140
26141 /**
26142  * g_resource_open_stream:
26143  * @resource: A #GResource
26144  * @path: A pathname inside the resource
26145  * @lookup_flags: A #GResourceLookupFlags
26146  * @error: return location for a #GError, or %NULL
26147  *
26148  * Looks for a file at the specified @path in the resource and
26149  * returns a #GInputStream that lets you read the data.
26150  *
26151  * @lookup_flags controls the behaviour of the lookup.
26152  *
26153  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26154  * Since: 2.32
26155  */
26156
26157
26158 /**
26159  * g_resource_ref:
26160  * @resource: A #GResource
26161  *
26162  * Atomically increments the reference count of @array by one. This
26163  * function is MT-safe and may be called from any thread.
26164  *
26165  * Returns: The passed in #GResource
26166  * Since: 2.32
26167  */
26168
26169
26170 /**
26171  * g_resource_unref:
26172  * @resource: A #GResource
26173  *
26174  * Atomically decrements the reference count of @resource by one. If the
26175  * reference count drops to 0, all memory allocated by the array is
26176  * released. This function is MT-safe and may be called from any
26177  * thread.
26178  *
26179  * Since: 2.32
26180  */
26181
26182
26183 /**
26184  * g_resources_enumerate_children:
26185  * @path: A pathname inside the resource
26186  * @lookup_flags: A #GResourceLookupFlags
26187  * @error: return location for a #GError, or %NULL
26188  *
26189  * Returns all the names of children at the specified @path in the set of
26190  * globally registered resources.
26191  * The return result is a %NULL terminated list of strings which should
26192  * be released with g_strfreev().
26193  *
26194  * @lookup_flags controls the behaviour of the lookup.
26195  *
26196  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26197  * Since: 2.32
26198  */
26199
26200
26201 /**
26202  * g_resources_get_info:
26203  * @path: A pathname inside the resource
26204  * @lookup_flags: A #GResourceLookupFlags
26205  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26206  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26207  * @error: return location for a #GError, or %NULL
26208  *
26209  * Looks for a file at the specified @path in the set of
26210  * globally registered resources and if found returns information about it.
26211  *
26212  * @lookup_flags controls the behaviour of the lookup.
26213  *
26214  * Returns: %TRUE if the file was found. %FALSE if there were errors
26215  * Since: 2.32
26216  */
26217
26218
26219 /**
26220  * g_resources_lookup_data:
26221  * @path: A pathname inside the resource
26222  * @lookup_flags: A #GResourceLookupFlags
26223  * @error: return location for a #GError, or %NULL
26224  *
26225  * Looks for a file at the specified @path in the set of
26226  * globally registered resources and returns a #GBytes that
26227  * lets you directly access the data in memory.
26228  *
26229  * The data is always followed by a zero byte, so you
26230  * can safely use the data as a C string. However, that byte
26231  * is not included in the size of the GBytes.
26232  *
26233  * For uncompressed resource files this is a pointer directly into
26234  * the resource bundle, which is typically in some readonly data section
26235  * in the program binary. For compressed files we allocate memory on
26236  * the heap and automatically uncompress the data.
26237  *
26238  * @lookup_flags controls the behaviour of the lookup.
26239  *
26240  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26241  * Since: 2.32
26242  */
26243
26244
26245 /**
26246  * g_resources_open_stream:
26247  * @path: A pathname inside the resource
26248  * @lookup_flags: A #GResourceLookupFlags
26249  * @error: return location for a #GError, or %NULL
26250  *
26251  * Looks for a file at the specified @path in the set of
26252  * globally registered resources and returns a #GInputStream
26253  * that lets you read the data.
26254  *
26255  * @lookup_flags controls the behaviour of the lookup.
26256  *
26257  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26258  * Since: 2.32
26259  */
26260
26261
26262 /**
26263  * g_resources_register:
26264  * @resource: A #GResource
26265  *
26266  * Registers the resource with the process-global set of resources.
26267  * Once a resource is registered the files in it can be accessed
26268  * with the global resource lookup functions like g_resources_lookup_data().
26269  *
26270  * Since: 2.32
26271  */
26272
26273
26274 /**
26275  * g_resources_unregister:
26276  * @resource: A #GResource
26277  *
26278  * Unregisters the resource from the process-global set of resources.
26279  *
26280  * Since: 2.32
26281  */
26282
26283
26284 /**
26285  * g_seekable_can_seek:
26286  * @seekable: a #GSeekable.
26287  *
26288  * Tests if the stream supports the #GSeekableIface.
26289  *
26290  * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26291  */
26292
26293
26294 /**
26295  * g_seekable_can_truncate:
26296  * @seekable: a #GSeekable.
26297  *
26298  * Tests if the stream can be truncated.
26299  *
26300  * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26301  */
26302
26303
26304 /**
26305  * g_seekable_seek:
26306  * @seekable: a #GSeekable.
26307  * @offset: a #goffset.
26308  * @type: a #GSeekType.
26309  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26310  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26311  *
26312  * Seeks in the stream by the given @offset, modified by @type.
26313  *
26314  * If @cancellable is not %NULL, then the operation can be cancelled by
26315  * triggering the cancellable object from another thread. If the operation
26316  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26317  *
26318  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26319  */
26320
26321
26322 /**
26323  * g_seekable_tell:
26324  * @seekable: a #GSeekable.
26325  *
26326  * Tells the current position within the stream.
26327  *
26328  * Returns: the offset from the beginning of the buffer.
26329  */
26330
26331
26332 /**
26333  * g_seekable_truncate:
26334  * @seekable: a #GSeekable.
26335  * @offset: a #goffset.
26336  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26337  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26338  *
26339  * Truncates a stream with a given #offset.
26340  *
26341  * If @cancellable is not %NULL, then the operation can be cancelled by
26342  * triggering the cancellable object from another thread. If the operation
26343  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26344  * operation was partially finished when the operation was cancelled the
26345  * partial result will be returned, without an error.
26346  *
26347  * Virtual: truncate_fn
26348  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26349  */
26350
26351
26352 /**
26353  * g_settings_apply:
26354  * @settings: a #GSettings instance
26355  *
26356  * Applies any changes that have been made to the settings.  This
26357  * function does nothing unless @settings is in 'delay-apply' mode;
26358  * see g_settings_delay().  In the normal case settings are always
26359  * applied immediately.
26360  */
26361
26362
26363 /**
26364  * g_settings_backend_changed:
26365  * @backend: a #GSettingsBackend implementation
26366  * @key: the name of the key
26367  * @origin_tag: the origin tag
26368  *
26369  * Signals that a single key has possibly changed.  Backend
26370  * implementations should call this if a key has possibly changed its
26371  * value.
26372  *
26373  * @key must be a valid key (ie starting with a slash, not containing
26374  * '//', and not ending with a slash).
26375  *
26376  * The implementation must call this function during any call to
26377  * g_settings_backend_write(), before the call returns (except in the
26378  * case that no keys are actually changed and it cares to detect this
26379  * fact).  It may not rely on the existence of a mainloop for
26380  * dispatching the signal later.
26381  *
26382  * The implementation may call this function at any other time it likes
26383  * in response to other events (such as changes occurring outside of the
26384  * program).  These calls may originate from a mainloop or may originate
26385  * in response to any other action (including from calls to
26386  * g_settings_backend_write()).
26387  *
26388  * In the case that this call is in response to a call to
26389  * g_settings_backend_write() then @origin_tag must be set to the same
26390  * value that was passed to that call.
26391  *
26392  * Since: 2.26
26393  */
26394
26395
26396 /**
26397  * g_settings_backend_changed_tree:
26398  * @backend: a #GSettingsBackend implementation
26399  * @tree: a #GTree containing the changes
26400  * @origin_tag: the origin tag
26401  *
26402  * This call is a convenience wrapper.  It gets the list of changes from
26403  * @tree, computes the longest common prefix and calls
26404  * g_settings_backend_changed().
26405  *
26406  * Since: 2.26
26407  */
26408
26409
26410 /**
26411  * g_settings_backend_flatten_tree:
26412  * @tree: a #GTree containing the changes
26413  * @path: (out): the location to save the path
26414  * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26415  * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26416  *
26417  * Calculate the longest common prefix of all keys in a tree and write
26418  * out an array of the key names relative to that prefix and,
26419  * optionally, the value to store at each of those keys.
26420  *
26421  * You must free the value returned in @path, @keys and @values using
26422  * g_free().  You should not attempt to free or unref the contents of
26423  * @keys or @values.
26424  *
26425  * Since: 2.26
26426  */
26427
26428
26429 /**
26430  * g_settings_backend_get_default:
26431  *
26432  * Returns the default #GSettingsBackend. It is possible to override
26433  * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26434  * environment variable to the name of a settings backend.
26435  *
26436  * The user gets a reference to the backend.
26437  *
26438  * Returns: (transfer full): the default #GSettingsBackend
26439  * Since: 2.28
26440  */
26441
26442
26443 /**
26444  * g_settings_backend_keys_changed:
26445  * @backend: a #GSettingsBackend implementation
26446  * @path: the path containing the changes
26447  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26448  * @origin_tag: the origin tag
26449  *
26450  * Signals that a list of keys have possibly changed.  Backend
26451  * implementations should call this if keys have possibly changed their
26452  * values.
26453  *
26454  * @path must be a valid path (ie starting and ending with a slash and
26455  * not containing '//').  Each string in @items must form a valid key
26456  * name when @path is prefixed to it (ie: each item must not start or
26457  * end with '/' and must not contain '//').
26458  *
26459  * The meaning of this signal is that any of the key names resulting
26460  * from the contatenation of @path with each item in @items may have
26461  * changed.
26462  *
26463  * The same rules for when notifications must occur apply as per
26464  * g_settings_backend_changed().  These two calls can be used
26465  * interchangeably if exactly one item has changed (although in that
26466  * case g_settings_backend_changed() is definitely preferred).
26467  *
26468  * For efficiency reasons, the implementation should strive for @path to
26469  * be as long as possible (ie: the longest common prefix of all of the
26470  * keys that were changed) but this is not strictly required.
26471  *
26472  * Since: 2.26
26473  */
26474
26475
26476 /**
26477  * g_settings_backend_path_changed:
26478  * @backend: a #GSettingsBackend implementation
26479  * @path: the path containing the changes
26480  * @origin_tag: the origin tag
26481  *
26482  * Signals that all keys below a given path may have possibly changed.
26483  * Backend implementations should call this if an entire path of keys
26484  * have possibly changed their values.
26485  *
26486  * @path must be a valid path (ie starting and ending with a slash and
26487  * not containing '//').
26488  *
26489  * The meaning of this signal is that any of the key which has a name
26490  * starting with @path may have changed.
26491  *
26492  * The same rules for when notifications must occur apply as per
26493  * g_settings_backend_changed().  This call might be an appropriate
26494  * reasponse to a 'reset' call but implementations are also free to
26495  * explicitly list the keys that were affected by that call if they can
26496  * easily do so.
26497  *
26498  * For efficiency reasons, the implementation should strive for @path to
26499  * be as long as possible (ie: the longest common prefix of all of the
26500  * keys that were changed) but this is not strictly required.  As an
26501  * example, if this function is called with the path of "/" then every
26502  * single key in the application will be notified of a possible change.
26503  *
26504  * Since: 2.26
26505  */
26506
26507
26508 /**
26509  * g_settings_backend_path_writable_changed:
26510  * @backend: a #GSettingsBackend implementation
26511  * @path: the name of the path
26512  *
26513  * Signals that the writability of all keys below a given path may have
26514  * changed.
26515  *
26516  * Since GSettings performs no locking operations for itself, this call
26517  * will always be made in response to external events.
26518  *
26519  * Since: 2.26
26520  */
26521
26522
26523 /**
26524  * g_settings_backend_writable_changed:
26525  * @backend: a #GSettingsBackend implementation
26526  * @key: the name of the key
26527  *
26528  * Signals that the writability of a single key has possibly changed.
26529  *
26530  * Since GSettings performs no locking operations for itself, this call
26531  * will always be made in response to external events.
26532  *
26533  * Since: 2.26
26534  */
26535
26536
26537 /**
26538  * g_settings_bind:
26539  * @settings: a #GSettings object
26540  * @key: the key to bind
26541  * @object: (type GObject.Object): a #GObject
26542  * @property: the name of the property to bind
26543  * @flags: flags for the binding
26544  *
26545  * Create a binding between the @key in the @settings object
26546  * and the property @property of @object.
26547  *
26548  * The binding uses the default GIO mapping functions to map
26549  * between the settings and property values. These functions
26550  * handle booleans, numeric types and string types in a
26551  * straightforward way. Use g_settings_bind_with_mapping() if
26552  * you need a custom mapping, or map between types that are not
26553  * supported by the default mapping functions.
26554  *
26555  * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26556  * function also establishes a binding between the writability of
26557  * @key and the "sensitive" property of @object (if @object has
26558  * a boolean property by that name). See g_settings_bind_writable()
26559  * for more details about writable bindings.
26560  *
26561  * Note that the lifecycle of the binding is tied to the object,
26562  * and that you can have only one binding per object property.
26563  * If you bind the same property twice on the same object, the second
26564  * binding overrides the first one.
26565  *
26566  * Since: 2.26
26567  */
26568
26569
26570 /**
26571  * g_settings_bind_with_mapping: (skip)
26572  * @settings: a #GSettings object
26573  * @key: the key to bind
26574  * @object: (type GObject.Object): a #GObject
26575  * @property: the name of the property to bind
26576  * @flags: flags for the binding
26577  * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26578  * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26579  * @user_data: data that gets passed to @get_mapping and @set_mapping
26580  * @destroy: #GDestroyNotify function for @user_data
26581  *
26582  * Create a binding between the @key in the @settings object
26583  * and the property @property of @object.
26584  *
26585  * The binding uses the provided mapping functions to map between
26586  * settings and property values.
26587  *
26588  * Note that the lifecycle of the binding is tied to the object,
26589  * and that you can have only one binding per object property.
26590  * If you bind the same property twice on the same object, the second
26591  * binding overrides the first one.
26592  *
26593  * Since: 2.26
26594  */
26595
26596
26597 /**
26598  * g_settings_bind_writable:
26599  * @settings: a #GSettings object
26600  * @key: the key to bind
26601  * @object: (type GObject.Object): a #GObject
26602  * @property: the name of a boolean property to bind
26603  * @inverted: whether to 'invert' the value
26604  *
26605  * Create a binding between the writability of @key in the
26606  * @settings object and the property @property of @object.
26607  * The property must be boolean; "sensitive" or "visible"
26608  * properties of widgets are the most likely candidates.
26609  *
26610  * Writable bindings are always uni-directional; changes of the
26611  * writability of the setting will be propagated to the object
26612  * property, not the other way.
26613  *
26614  * When the @inverted argument is %TRUE, the binding inverts the
26615  * value as it passes from the setting to the object, i.e. @property
26616  * will be set to %TRUE if the key is <emphasis>not</emphasis>
26617  * writable.
26618  *
26619  * Note that the lifecycle of the binding is tied to the object,
26620  * and that you can have only one binding per object property.
26621  * If you bind the same property twice on the same object, the second
26622  * binding overrides the first one.
26623  *
26624  * Since: 2.26
26625  */
26626
26627
26628 /**
26629  * g_settings_create_action:
26630  * @settings: a #GSettings
26631  * @key: the name of a key in @settings
26632  *
26633  * Creates a #GAction corresponding to a given #GSettings key.
26634  *
26635  * The action has the same name as the key.
26636  *
26637  * The value of the key becomes the state of the action and the action
26638  * is enabled when the key is writable.  Changing the state of the
26639  * action results in the key being written to.  Changes to the value or
26640  * writability of the key cause appropriate change notifications to be
26641  * emitted for the action.
26642  *
26643  * For boolean-valued keys, action activations take no parameter and
26644  * result in the toggling of the value.  For all other types,
26645  * activations take the new value for the key (which must have the
26646  * correct type).
26647  *
26648  * Returns: (transfer full): a new #GAction
26649  * Since: 2.32
26650  */
26651
26652
26653 /**
26654  * g_settings_delay:
26655  * @settings: a #GSettings object
26656  *
26657  * Changes the #GSettings object into 'delay-apply' mode. In this
26658  * mode, changes to @settings are not immediately propagated to the
26659  * backend, but kept locally until g_settings_apply() is called.
26660  *
26661  * Since: 2.26
26662  */
26663
26664
26665 /**
26666  * g_settings_get:
26667  * @settings: a #GSettings object
26668  * @key: the key to get the value for
26669  * @format: a #GVariant format string
26670  * @...: arguments as per @format
26671  *
26672  * Gets the value that is stored at @key in @settings.
26673  *
26674  * A convenience function that combines g_settings_get_value() with
26675  * g_variant_get().
26676  *
26677  * It is a programmer error to give a @key that isn't contained in the
26678  * schema for @settings or for the #GVariantType of @format to mismatch
26679  * the type given in the schema.
26680  *
26681  * Since: 2.26
26682  */
26683
26684
26685 /**
26686  * g_settings_get_boolean:
26687  * @settings: a #GSettings object
26688  * @key: the key to get the value for
26689  *
26690  * Gets the value that is stored at @key in @settings.
26691  *
26692  * A convenience variant of g_settings_get() for booleans.
26693  *
26694  * It is a programmer error to give a @key that isn't specified as
26695  * having a boolean type in the schema for @settings.
26696  *
26697  * Returns: a boolean
26698  * Since: 2.26
26699  */
26700
26701
26702 /**
26703  * g_settings_get_child:
26704  * @settings: a #GSettings object
26705  * @name: the name of the 'child' schema
26706  *
26707  * Creates a 'child' settings object which has a base path of
26708  * <replaceable>base-path</replaceable>/@name, where
26709  * <replaceable>base-path</replaceable> is the base path of @settings.
26710  *
26711  * The schema for the child settings object must have been declared
26712  * in the schema of @settings using a <tag class="starttag">child</tag> element.
26713  *
26714  * Returns: (transfer full): a 'child' settings object
26715  * Since: 2.26
26716  */
26717
26718
26719 /**
26720  * g_settings_get_double:
26721  * @settings: a #GSettings object
26722  * @key: the key to get the value for
26723  *
26724  * Gets the value that is stored at @key in @settings.
26725  *
26726  * A convenience variant of g_settings_get() for doubles.
26727  *
26728  * It is a programmer error to give a @key that isn't specified as
26729  * having a 'double' type in the schema for @settings.
26730  *
26731  * Returns: a double
26732  * Since: 2.26
26733  */
26734
26735
26736 /**
26737  * g_settings_get_enum:
26738  * @settings: a #GSettings object
26739  * @key: the key to get the value for
26740  *
26741  * Gets the value that is stored in @settings for @key and converts it
26742  * to the enum value that it represents.
26743  *
26744  * In order to use this function the type of the value must be a string
26745  * and it must be marked in the schema file as an enumerated type.
26746  *
26747  * It is a programmer error to give a @key that isn't contained in the
26748  * schema for @settings or is not marked as an enumerated type.
26749  *
26750  * If the value stored in the configuration database is not a valid
26751  * value for the enumerated type then this function will return the
26752  * default value.
26753  *
26754  * Returns: the enum value
26755  * Since: 2.26
26756  */
26757
26758
26759 /**
26760  * g_settings_get_flags:
26761  * @settings: a #GSettings object
26762  * @key: the key to get the value for
26763  *
26764  * Gets the value that is stored in @settings for @key and converts it
26765  * to the flags value that it represents.
26766  *
26767  * In order to use this function the type of the value must be an array
26768  * of strings and it must be marked in the schema file as an flags type.
26769  *
26770  * It is a programmer error to give a @key that isn't contained in the
26771  * schema for @settings or is not marked as a flags type.
26772  *
26773  * If the value stored in the configuration database is not a valid
26774  * value for the flags type then this function will return the default
26775  * value.
26776  *
26777  * Returns: the flags value
26778  * Since: 2.26
26779  */
26780
26781
26782 /**
26783  * g_settings_get_has_unapplied:
26784  * @settings: a #GSettings object
26785  *
26786  * Returns whether the #GSettings object has any unapplied
26787  * changes.  This can only be the case if it is in 'delayed-apply' mode.
26788  *
26789  * Returns: %TRUE if @settings has unapplied changes
26790  * Since: 2.26
26791  */
26792
26793
26794 /**
26795  * g_settings_get_int:
26796  * @settings: a #GSettings object
26797  * @key: the key to get the value for
26798  *
26799  * Gets the value that is stored at @key in @settings.
26800  *
26801  * A convenience variant of g_settings_get() for 32-bit integers.
26802  *
26803  * It is a programmer error to give a @key that isn't specified as
26804  * having a int32 type in the schema for @settings.
26805  *
26806  * Returns: an integer
26807  * Since: 2.26
26808  */
26809
26810
26811 /**
26812  * g_settings_get_mapped:
26813  * @settings: a #GSettings object
26814  * @key: the key to get the value for
26815  * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26816  * @user_data: user data for @mapping
26817  *
26818  * Gets the value that is stored at @key in @settings, subject to
26819  * application-level validation/mapping.
26820  *
26821  * You should use this function when the application needs to perform
26822  * some processing on the value of the key (for example, parsing).  The
26823  * @mapping function performs that processing.  If the function
26824  * indicates that the processing was unsuccessful (due to a parse error,
26825  * for example) then the mapping is tried again with another value.
26826  *
26827  * This allows a robust 'fall back to defaults' behaviour to be
26828  * implemented somewhat automatically.
26829  *
26830  * The first value that is tried is the user's setting for the key.  If
26831  * the mapping function fails to map this value, other values may be
26832  * tried in an unspecified order (system or site defaults, translated
26833  * schema default values, untranslated schema default values, etc).
26834  *
26835  * If the mapping function fails for all possible values, one additional
26836  * attempt is made: the mapping function is called with a %NULL value.
26837  * If the mapping function still indicates failure at this point then
26838  * the application will be aborted.
26839  *
26840  * The result parameter for the @mapping function is pointed to a
26841  * #gpointer which is initially set to %NULL.  The same pointer is given
26842  * to each invocation of @mapping.  The final value of that #gpointer is
26843  * what is returned by this function.  %NULL is valid; it is returned
26844  * just as any other value would be.
26845  *
26846  * Returns: (transfer full): the result, which may be %NULL
26847  */
26848
26849
26850 /**
26851  * g_settings_get_range:
26852  * @settings: a #GSettings
26853  * @key: the key to query the range of
26854  *
26855  * Queries the range of a key.
26856  *
26857  * This function will return a #GVariant that fully describes the range
26858  * of values that are valid for @key.
26859  *
26860  * The type of #GVariant returned is <literal>(sv)</literal>.  The
26861  * string describes the type of range restriction in effect.  The type
26862  * and meaning of the value contained in the variant depends on the
26863  * string.
26864  *
26865  * If the string is <literal>'type'</literal> then the variant contains
26866  * an empty array.  The element type of that empty array is the expected
26867  * type of value and all values of that type are valid.
26868  *
26869  * If the string is <literal>'enum'</literal> then the variant contains
26870  * an array enumerating the possible values.  Each item in the array is
26871  * a possible valid value and no other values are valid.
26872  *
26873  * If the string is <literal>'flags'</literal> then the variant contains
26874  * an array.  Each item in the array is a value that may appear zero or
26875  * one times in an array to be used as the value for this key.  For
26876  * example, if the variant contained the array <literal>['x',
26877  * 'y']</literal> then the valid values for the key would be
26878  * <literal>[]</literal>, <literal>['x']</literal>,
26879  * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26880  * <literal>['y', 'x']</literal>.
26881  *
26882  * Finally, if the string is <literal>'range'</literal> then the variant
26883  * contains a pair of like-typed values -- the minimum and maximum
26884  * permissible values for this key.
26885  *
26886  * This information should not be used by normal programs.  It is
26887  * considered to be a hint for introspection purposes.  Normal programs
26888  * should already know what is permitted by their own schema.  The
26889  * format may change in any way in the future -- but particularly, new
26890  * forms may be added to the possibilities described above.
26891  *
26892  * It is a programmer error to give a @key that isn't contained in the
26893  * schema for @settings.
26894  *
26895  * You should free the returned value with g_variant_unref() when it is
26896  * no longer needed.
26897  *
26898  * Returns: a #GVariant describing the range
26899  * Since: 2.28
26900  */
26901
26902
26903 /**
26904  * g_settings_get_string:
26905  * @settings: a #GSettings object
26906  * @key: the key to get the value for
26907  *
26908  * Gets the value that is stored at @key in @settings.
26909  *
26910  * A convenience variant of g_settings_get() for strings.
26911  *
26912  * It is a programmer error to give a @key that isn't specified as
26913  * having a string type in the schema for @settings.
26914  *
26915  * Returns: a newly-allocated string
26916  * Since: 2.26
26917  */
26918
26919
26920 /**
26921  * g_settings_get_strv:
26922  * @settings: a #GSettings object
26923  * @key: the key to get the value for
26924  *
26925  * A convenience variant of g_settings_get() for string arrays.
26926  *
26927  * It is a programmer error to give a @key that isn't specified as
26928  * having an array of strings type in the schema for @settings.
26929  *
26930  * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26931  * Since: 2.26
26932  */
26933
26934
26935 /**
26936  * g_settings_get_uint:
26937  * @settings: a #GSettings object
26938  * @key: the key to get the value for
26939  *
26940  * Gets the value that is stored at @key in @settings.
26941  *
26942  * A convenience variant of g_settings_get() for 32-bit unsigned
26943  * integers.
26944  *
26945  * It is a programmer error to give a @key that isn't specified as
26946  * having a uint32 type in the schema for @settings.
26947  *
26948  * Returns: an unsigned integer
26949  * Since: 2.30
26950  */
26951
26952
26953 /**
26954  * g_settings_get_value:
26955  * @settings: a #GSettings object
26956  * @key: the key to get the value for
26957  *
26958  * Gets the value that is stored in @settings for @key.
26959  *
26960  * It is a programmer error to give a @key that isn't contained in the
26961  * schema for @settings.
26962  *
26963  * Returns: a new #GVariant
26964  * Since: 2.26
26965  */
26966
26967
26968 /**
26969  * g_settings_is_writable:
26970  * @settings: a #GSettings object
26971  * @name: the name of a key
26972  *
26973  * Finds out if a key can be written or not
26974  *
26975  * Returns: %TRUE if the key @name is writable
26976  * Since: 2.26
26977  */
26978
26979
26980 /**
26981  * g_settings_list_children:
26982  * @settings: a #GSettings object
26983  *
26984  * Gets the list of children on @settings.
26985  *
26986  * The list is exactly the list of strings for which it is not an error
26987  * to call g_settings_get_child().
26988  *
26989  * For GSettings objects that are lists, this value can change at any
26990  * time and you should connect to the "children-changed" signal to watch
26991  * for those changes.  Note that there is a race condition here: you may
26992  * request a child after listing it only for it to have been destroyed
26993  * in the meantime.  For this reason, g_settings_get_child() may return
26994  * %NULL even for a child that was listed by this function.
26995  *
26996  * For GSettings objects that are not lists, you should probably not be
26997  * calling this function from "normal" code (since you should already
26998  * know what children are in your schema).  This function may still be
26999  * useful there for introspection reasons, however.
27000  *
27001  * You should free the return value with g_strfreev() when you are done
27002  * with it.
27003  *
27004  * Returns: (transfer full) (element-type utf8): a list of the children on @settings
27005  */
27006
27007
27008 /**
27009  * g_settings_list_keys:
27010  * @settings: a #GSettings object
27011  *
27012  * Introspects the list of keys on @settings.
27013  *
27014  * You should probably not be calling this function from "normal" code
27015  * (since you should already know what keys are in your schema).  This
27016  * function is intended for introspection reasons.
27017  *
27018  * You should free the return value with g_strfreev() when you are done
27019  * with it.
27020  *
27021  * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
27022  */
27023
27024
27025 /**
27026  * g_settings_list_relocatable_schemas:
27027  *
27028  * Gets a list of the relocatable #GSettings schemas installed on the
27029  * system.  These are schemas that do not provide their own path.  It is
27030  * usual to instantiate these schemas directly, but if you want to you
27031  * can use g_settings_new_with_path() to specify the path.
27032  *
27033  * The output of this function, taken together with the output of
27034  * g_settings_list_schemas() represents the complete list of all
27035  * installed schemas.
27036  *
27037  * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available.  The list must not be modified or freed.
27038  * Since: 2.28
27039  */
27040
27041
27042 /**
27043  * g_settings_list_schemas:
27044  *
27045  * Gets a list of the #GSettings schemas installed on the system.  The
27046  * returned list is exactly the list of schemas for which you may call
27047  * g_settings_new() without adverse effects.
27048  *
27049  * This function does not list the schemas that do not provide their own
27050  * paths (ie: schemas for which you must use
27051  * g_settings_new_with_path()).  See
27052  * g_settings_list_relocatable_schemas() for that.
27053  *
27054  * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available.  The list must not be modified or freed.
27055  * Since: 2.26
27056  */
27057
27058
27059 /**
27060  * g_settings_new:
27061  * @schema_id: the id of the schema
27062  *
27063  * Creates a new #GSettings object with the schema specified by
27064  * @schema_id.
27065  *
27066  * Signals on the newly created #GSettings object will be dispatched
27067  * via the thread-default #GMainContext in effect at the time of the
27068  * call to g_settings_new().  The new #GSettings will hold a reference
27069  * on the context.  See g_main_context_push_thread_default().
27070  *
27071  * Returns: a new #GSettings object
27072  * Since: 2.26
27073  */
27074
27075
27076 /**
27077  * g_settings_new_full:
27078  * @schema: a #GSettingsSchema
27079  * @backend: (allow-none): a #GSettingsBackend
27080  * @path: (allow-none): the path to use
27081  *
27082  * Creates a new #GSettings object with a given schema, backend and
27083  * path.
27084  *
27085  * It should be extremely rare that you ever want to use this function.
27086  * It is made available for advanced use-cases (such as plugin systems
27087  * that want to provide access to schemas loaded from custom locations,
27088  * etc).
27089  *
27090  * At the most basic level, a #GSettings object is a pure composition of
27091  * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
27092  * backend, and a #GMainContext to which signals are dispatched.
27093  *
27094  * This constructor therefore gives you full control over constructing
27095  * #GSettings instances.  The first 4 parameters are given directly as
27096  * @schema, @backend and @path, and the main context is taken from the
27097  * thread-default (as per g_settings_new()).
27098  *
27099  * If @backend is %NULL then the default backend is used.
27100  *
27101  * If @path is %NULL then the path from the schema is used.  It is an
27102  * error f @path is %NULL and the schema has no path of its own or if
27103  * @path is non-%NULL and not equal to the path that the schema does
27104  * have.
27105  *
27106  * Returns: a new #GSettings object
27107  * Since: 2.32
27108  */
27109
27110
27111 /**
27112  * g_settings_new_with_backend:
27113  * @schema_id: the id of the schema
27114  * @backend: the #GSettingsBackend to use
27115  *
27116  * Creates a new #GSettings object with the schema specified by
27117  * @schema_id and a given #GSettingsBackend.
27118  *
27119  * Creating a #GSettings object with a different backend allows accessing
27120  * settings from a database other than the usual one. For example, it may make
27121  * sense to pass a backend corresponding to the "defaults" settings database on
27122  * the system to get a settings object that modifies the system default
27123  * settings instead of the settings for this user.
27124  *
27125  * Returns: a new #GSettings object
27126  * Since: 2.26
27127  */
27128
27129
27130 /**
27131  * g_settings_new_with_backend_and_path:
27132  * @schema_id: the id of the schema
27133  * @backend: the #GSettingsBackend to use
27134  * @path: the path to use
27135  *
27136  * Creates a new #GSettings object with the schema specified by
27137  * @schema_id and a given #GSettingsBackend and path.
27138  *
27139  * This is a mix of g_settings_new_with_backend() and
27140  * g_settings_new_with_path().
27141  *
27142  * Returns: a new #GSettings object
27143  * Since: 2.26
27144  */
27145
27146
27147 /**
27148  * g_settings_new_with_path:
27149  * @schema_id: the id of the schema
27150  * @path: the path to use
27151  *
27152  * Creates a new #GSettings object with the relocatable schema specified
27153  * by @schema_id and a given path.
27154  *
27155  * You only need to do this if you want to directly create a settings
27156  * object with a schema that doesn't have a specified path of its own.
27157  * That's quite rare.
27158  *
27159  * It is a programmer error to call this function for a schema that
27160  * has an explicitly specified path.
27161  *
27162  * Returns: a new #GSettings object
27163  * Since: 2.26
27164  */
27165
27166
27167 /**
27168  * g_settings_range_check:
27169  * @settings: a #GSettings
27170  * @key: the key to check
27171  * @value: the value to check
27172  *
27173  * Checks if the given @value is of the correct type and within the
27174  * permitted range for @key.
27175  *
27176  * This API is not intended to be used by normal programs -- they should
27177  * already know what is permitted by their own schemas.  This API is
27178  * meant to be used by programs such as editors or commandline tools.
27179  *
27180  * It is a programmer error to give a @key that isn't contained in the
27181  * schema for @settings.
27182  *
27183  * Returns: %TRUE if @value is valid for @key
27184  * Since: 2.28
27185  */
27186
27187
27188 /**
27189  * g_settings_reset:
27190  * @settings: a #GSettings object
27191  * @key: the name of a key
27192  *
27193  * Resets @key to its default value.
27194  *
27195  * This call resets the key, as much as possible, to its default value.
27196  * That might the value specified in the schema or the one set by the
27197  * administrator.
27198  */
27199
27200
27201 /**
27202  * g_settings_revert:
27203  * @settings: a #GSettings instance
27204  *
27205  * Reverts all non-applied changes to the settings.  This function
27206  * does nothing unless @settings is in 'delay-apply' mode; see
27207  * g_settings_delay().  In the normal case settings are always applied
27208  * immediately.
27209  *
27210  * Change notifications will be emitted for affected keys.
27211  */
27212
27213
27214 /**
27215  * g_settings_schema_get_id:
27216  * @schema: a #GSettingsSchema
27217  *
27218  * Get the ID of @schema.
27219  *
27220  * Returns: (transfer none): the ID
27221  */
27222
27223
27224 /**
27225  * g_settings_schema_get_path:
27226  * @schema: a #GSettingsSchema
27227  *
27228  * Gets the path associated with @schema, or %NULL.
27229  *
27230  * Schemas may be single-instance or relocatable.  Single-instance
27231  * schemas correspond to exactly one set of keys in the backend
27232  * database: those located at the path returned by this function.
27233  *
27234  * Relocatable schemas can be referenced by other schemas and can
27235  * threfore describe multiple sets of keys at different locations.  For
27236  * relocatable schemas, this function will return %NULL.
27237  *
27238  * Returns: (transfer none): the path of the schema, or %NULL
27239  * Since: 2.32
27240  */
27241
27242
27243 /**
27244  * g_settings_schema_ref:
27245  * @schema: a #GSettingsSchema
27246  *
27247  * Increase the reference count of @schema, returning a new reference.
27248  *
27249  * Returns: a new reference to @schema
27250  * Since: 2.32
27251  */
27252
27253
27254 /**
27255  * g_settings_schema_source_get_default:
27256  *
27257  * Gets the default system schema source.
27258  *
27259  * This function is not required for normal uses of #GSettings but it
27260  * may be useful to authors of plugin management systems or to those who
27261  * want to introspect the content of schemas.
27262  *
27263  * If no schemas are installed, %NULL will be returned.
27264  *
27265  * The returned source may actually consist of multiple schema sources
27266  * from different directories, depending on which directories were given
27267  * in <envar>XDG_DATA_DIRS</envar> and
27268  * <envar>GSETTINGS_SCHEMA_DIR</envar>.  For this reason, all lookups
27269  * performed against the default source should probably be done
27270  * recursively.
27271  *
27272  * Returns: (transfer none): the default schema source
27273  * Since: 2.32
27274  */
27275
27276
27277 /**
27278  * g_settings_schema_source_lookup:
27279  * @source: a #GSettingsSchemaSource
27280  * @schema_id: a schema ID
27281  * @recursive: %TRUE if the lookup should be recursive
27282  *
27283  * Looks up a schema with the identifier @schema_id in @source.
27284  *
27285  * This function is not required for normal uses of #GSettings but it
27286  * may be useful to authors of plugin management systems or to those who
27287  * want to introspect the content of schemas.
27288  *
27289  * If the schema isn't found directly in @source and @recursive is %TRUE
27290  * then the parent sources will also be checked.
27291  *
27292  * If the schema isn't found, %NULL is returned.
27293  *
27294  * Returns: (transfer full): a new #GSettingsSchema
27295  * Since: 2.32
27296  */
27297
27298
27299 /**
27300  * g_settings_schema_source_new_from_directory:
27301  * @directory: the filename of a directory
27302  * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27303  * @trusted: %TRUE, if the directory is trusted
27304  * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27305  *
27306  * Attempts to create a new schema source corresponding to the contents
27307  * of the given directory.
27308  *
27309  * This function is not required for normal uses of #GSettings but it
27310  * may be useful to authors of plugin management systems.
27311  *
27312  * The directory should contain a file called
27313  * <filename>gschemas.compiled</filename> as produced by
27314  * <command>glib-compile-schemas</command>.
27315  *
27316  * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27317  * trusted not to be corrupted.  This assumption has a performance
27318  * advantage, but can result in crashes or inconsistent behaviour in the
27319  * case of a corrupted file.  Generally, you should set @trusted to
27320  * %TRUE for files installed by the system and to %FALSE for files in
27321  * the home directory.
27322  *
27323  * If @parent is non-%NULL then there are two effects.
27324  *
27325  * First, if g_settings_schema_source_lookup() is called with the
27326  * @recursive flag set to %TRUE and the schema can not be found in the
27327  * source, the lookup will recurse to the parent.
27328  *
27329  * Second, any references to other schemas specified within this
27330  * source (ie: <literal>child</literal> or <literal>extends</literal>)
27331  * references may be resolved from the @parent.
27332  *
27333  * For this second reason, except in very unusual situations, the
27334  * @parent should probably be given as the default schema source, as
27335  * returned by g_settings_schema_source_get_default().
27336  *
27337  * Since: 2.32
27338  */
27339
27340
27341 /**
27342  * g_settings_schema_source_ref:
27343  * @source: a #GSettingsSchemaSource
27344  *
27345  * Increase the reference count of @source, returning a new reference.
27346  *
27347  * Returns: a new reference to @source
27348  * Since: 2.32
27349  */
27350
27351
27352 /**
27353  * g_settings_schema_source_unref:
27354  * @source: a #GSettingsSchemaSource
27355  *
27356  * Decrease the reference count of @source, possibly freeing it.
27357  *
27358  * Since: 2.32
27359  */
27360
27361
27362 /**
27363  * g_settings_schema_unref:
27364  * @schema: a #GSettingsSchema
27365  *
27366  * Decrease the reference count of @schema, possibly freeing it.
27367  *
27368  * Since: 2.32
27369  */
27370
27371
27372 /**
27373  * g_settings_set:
27374  * @settings: a #GSettings object
27375  * @key: the name of the key to set
27376  * @format: a #GVariant format string
27377  * @...: arguments as per @format
27378  *
27379  * Sets @key in @settings to @value.
27380  *
27381  * A convenience function that combines g_settings_set_value() with
27382  * g_variant_new().
27383  *
27384  * It is a programmer error to give a @key that isn't contained in the
27385  * schema for @settings or for the #GVariantType of @format to mismatch
27386  * the type given in the schema.
27387  *
27388  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27389  * Since: 2.26
27390  */
27391
27392
27393 /**
27394  * g_settings_set_boolean:
27395  * @settings: a #GSettings object
27396  * @key: the name of the key to set
27397  * @value: the value to set it to
27398  *
27399  * Sets @key in @settings to @value.
27400  *
27401  * A convenience variant of g_settings_set() for booleans.
27402  *
27403  * It is a programmer error to give a @key that isn't specified as
27404  * having a boolean type in the schema for @settings.
27405  *
27406  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27407  * Since: 2.26
27408  */
27409
27410
27411 /**
27412  * g_settings_set_double:
27413  * @settings: a #GSettings object
27414  * @key: the name of the key to set
27415  * @value: the value to set it to
27416  *
27417  * Sets @key in @settings to @value.
27418  *
27419  * A convenience variant of g_settings_set() for doubles.
27420  *
27421  * It is a programmer error to give a @key that isn't specified as
27422  * having a 'double' type in the schema for @settings.
27423  *
27424  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27425  * Since: 2.26
27426  */
27427
27428
27429 /**
27430  * g_settings_set_enum:
27431  * @settings: a #GSettings object
27432  * @key: a key, within @settings
27433  * @value: an enumerated value
27434  *
27435  * Looks up the enumerated type nick for @value and writes it to @key,
27436  * within @settings.
27437  *
27438  * It is a programmer error to give a @key that isn't contained in the
27439  * schema for @settings or is not marked as an enumerated type, or for
27440  * @value not to be a valid value for the named type.
27441  *
27442  * After performing the write, accessing @key directly with
27443  * g_settings_get_string() will return the 'nick' associated with
27444  * @value.
27445  *
27446  * Returns: %TRUE, if the set succeeds
27447  */
27448
27449
27450 /**
27451  * g_settings_set_flags:
27452  * @settings: a #GSettings object
27453  * @key: a key, within @settings
27454  * @value: a flags value
27455  *
27456  * Looks up the flags type nicks for the bits specified by @value, puts
27457  * them in an array of strings and writes the array to @key, within
27458  * @settings.
27459  *
27460  * It is a programmer error to give a @key that isn't contained in the
27461  * schema for @settings or is not marked as a flags type, or for @value
27462  * to contain any bits that are not value for the named type.
27463  *
27464  * After performing the write, accessing @key directly with
27465  * g_settings_get_strv() will return an array of 'nicks'; one for each
27466  * bit in @value.
27467  *
27468  * Returns: %TRUE, if the set succeeds
27469  */
27470
27471
27472 /**
27473  * g_settings_set_int:
27474  * @settings: a #GSettings object
27475  * @key: the name of the key to set
27476  * @value: the value to set it to
27477  *
27478  * Sets @key in @settings to @value.
27479  *
27480  * A convenience variant of g_settings_set() for 32-bit integers.
27481  *
27482  * It is a programmer error to give a @key that isn't specified as
27483  * having a int32 type in the schema for @settings.
27484  *
27485  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27486  * Since: 2.26
27487  */
27488
27489
27490 /**
27491  * g_settings_set_string:
27492  * @settings: a #GSettings object
27493  * @key: the name of the key to set
27494  * @value: the value to set it to
27495  *
27496  * Sets @key in @settings to @value.
27497  *
27498  * A convenience variant of g_settings_set() for strings.
27499  *
27500  * It is a programmer error to give a @key that isn't specified as
27501  * having a string type in the schema for @settings.
27502  *
27503  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27504  * Since: 2.26
27505  */
27506
27507
27508 /**
27509  * g_settings_set_strv:
27510  * @settings: a #GSettings object
27511  * @key: the name of the key to set
27512  * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27513  *
27514  * Sets @key in @settings to @value.
27515  *
27516  * A convenience variant of g_settings_set() for string arrays.  If
27517  * @value is %NULL, then @key is set to be the empty array.
27518  *
27519  * It is a programmer error to give a @key that isn't specified as
27520  * having an array of strings type in the schema for @settings.
27521  *
27522  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27523  * Since: 2.26
27524  */
27525
27526
27527 /**
27528  * g_settings_set_uint:
27529  * @settings: a #GSettings object
27530  * @key: the name of the key to set
27531  * @value: the value to set it to
27532  *
27533  * Sets @key in @settings to @value.
27534  *
27535  * A convenience variant of g_settings_set() for 32-bit unsigned
27536  * integers.
27537  *
27538  * It is a programmer error to give a @key that isn't specified as
27539  * having a uint32 type in the schema for @settings.
27540  *
27541  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27542  * Since: 2.30
27543  */
27544
27545
27546 /**
27547  * g_settings_set_value:
27548  * @settings: a #GSettings object
27549  * @key: the name of the key to set
27550  * @value: a #GVariant of the correct type
27551  *
27552  * Sets @key in @settings to @value.
27553  *
27554  * It is a programmer error to give a @key that isn't contained in the
27555  * schema for @settings or for @value to have the incorrect type, per
27556  * the schema.
27557  *
27558  * If @value is floating then this function consumes the reference.
27559  *
27560  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27561  * Since: 2.26
27562  */
27563
27564
27565 /**
27566  * g_settings_sync:
27567  *
27568  * Ensures that all pending operations for the given are complete for
27569  * the default backend.
27570  *
27571  * Writes made to a #GSettings are handled asynchronously.  For this
27572  * reason, it is very unlikely that the changes have it to disk by the
27573  * time g_settings_set() returns.
27574  *
27575  * This call will block until all of the writes have made it to the
27576  * backend.  Since the mainloop is not running, no change notifications
27577  * will be dispatched during this call (but some may be queued by the
27578  * time the call is done).
27579  */
27580
27581
27582 /**
27583  * g_settings_unbind:
27584  * @object: the object
27585  * @property: the property whose binding is removed
27586  *
27587  * Removes an existing binding for @property on @object.
27588  *
27589  * Note that bindings are automatically removed when the
27590  * object is finalized, so it is rarely necessary to call this
27591  * function.
27592  *
27593  * Since: 2.26
27594  */
27595
27596
27597 /**
27598  * g_simple_action_group_add_entries:
27599  * @simple: a #GSimpleActionGroup
27600  * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27601  * @n_entries: the length of @entries, or -1
27602  * @user_data: the user data for signal connections
27603  *
27604  * A convenience function for creating multiple #GSimpleAction instances
27605  * and adding them to the action group.
27606  *
27607  * Since: 2.30
27608  * Deprecated: 2.38: Use g_action_map_add_action_entries()
27609  */
27610
27611
27612 /**
27613  * g_simple_action_group_insert:
27614  * @simple: a #GSimpleActionGroup
27615  * @action: a #GAction
27616  *
27617  * Adds an action to the action group.
27618  *
27619  * If the action group already contains an action with the same name as
27620  * @action then the old action is dropped from the group.
27621  *
27622  * The action group takes its own reference on @action.
27623  *
27624  * Since: 2.28
27625  * Deprecated: 2.38: Use g_action_map_add_action()
27626  */
27627
27628
27629 /**
27630  * g_simple_action_group_lookup:
27631  * @simple: a #GSimpleActionGroup
27632  * @action_name: the name of an action
27633  *
27634  * Looks up the action with the name @action_name in the group.
27635  *
27636  * If no such action exists, returns %NULL.
27637  *
27638  * Returns: (transfer none): a #GAction, or %NULL
27639  * Since: 2.28
27640  * Deprecated: 2.38: Use g_action_map_lookup_action()
27641  */
27642
27643
27644 /**
27645  * g_simple_action_group_new:
27646  *
27647  * Creates a new, empty, #GSimpleActionGroup.
27648  *
27649  * Returns: a new #GSimpleActionGroup
27650  * Since: 2.28
27651  */
27652
27653
27654 /**
27655  * g_simple_action_group_remove:
27656  * @simple: a #GSimpleActionGroup
27657  * @action_name: the name of the action
27658  *
27659  * Removes the named action from the action group.
27660  *
27661  * If no action of this name is in the group then nothing happens.
27662  *
27663  * Since: 2.28
27664  * Deprecated: 2.38: Use g_action_map_remove_action()
27665  */
27666
27667
27668 /**
27669  * g_simple_action_new:
27670  * @name: the name of the action
27671  * @parameter_type: (allow-none): the type of parameter to the activate function
27672  *
27673  * Creates a new action.
27674  *
27675  * The created action is stateless.  See g_simple_action_new_stateful().
27676  *
27677  * Returns: a new #GSimpleAction
27678  * Since: 2.28
27679  */
27680
27681
27682 /**
27683  * g_simple_action_new_stateful:
27684  * @name: the name of the action
27685  * @parameter_type: (allow-none): the type of the parameter to the activate function
27686  * @state: the initial state of the action
27687  *
27688  * Creates a new stateful action.
27689  *
27690  * @state is the initial state of the action.  All future state values
27691  * must have the same #GVariantType as the initial state.
27692  *
27693  * If the @state GVariant is floating, it is consumed.
27694  *
27695  * Returns: a new #GSimpleAction
27696  * Since: 2.28
27697  */
27698
27699
27700 /**
27701  * g_simple_action_set_enabled:
27702  * @simple: a #GSimpleAction
27703  * @enabled: whether the action is enabled
27704  *
27705  * Sets the action as enabled or not.
27706  *
27707  * An action must be enabled in order to be activated or in order to
27708  * have its state changed from outside callers.
27709  *
27710  * This should only be called by the implementor of the action.  Users
27711  * of the action should not attempt to modify its enabled flag.
27712  *
27713  * Since: 2.28
27714  */
27715
27716
27717 /**
27718  * g_simple_action_set_state:
27719  * @simple: a #GSimpleAction
27720  * @value: the new #GVariant for the state
27721  *
27722  * Sets the state of the action.
27723  *
27724  * This directly updates the 'state' property to the given value.
27725  *
27726  * This should only be called by the implementor of the action.  Users
27727  * of the action should not attempt to directly modify the 'state'
27728  * property.  Instead, they should call g_action_change_state() to
27729  * request the change.
27730  *
27731  * If the @value GVariant is floating, it is consumed.
27732  *
27733  * Since: 2.30
27734  */
27735
27736
27737 /**
27738  * g_simple_async_report_error_in_idle: (skip)
27739  * @object: (allow-none): a #GObject, or %NULL.
27740  * @callback: a #GAsyncReadyCallback.
27741  * @user_data: user data passed to @callback.
27742  * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27743  * @code: a specific error code.
27744  * @format: a formatted error reporting string.
27745  * @...: a list of variables to fill in @format.
27746  *
27747  * Reports an error in an asynchronous function in an idle function by
27748  * directly setting the contents of the #GAsyncResult with the given error
27749  * information.
27750  */
27751
27752
27753 /**
27754  * g_simple_async_report_gerror_in_idle:
27755  * @object: (allow-none): a #GObject, or %NULL
27756  * @callback: (scope async): a #GAsyncReadyCallback.
27757  * @user_data: (closure): user data passed to @callback.
27758  * @error: the #GError to report
27759  *
27760  * Reports an error in an idle function. Similar to
27761  * g_simple_async_report_error_in_idle(), but takes a #GError rather
27762  * than building a new one.
27763  */
27764
27765
27766 /**
27767  * g_simple_async_report_take_gerror_in_idle: (skip)
27768  * @object: (allow-none): a #GObject, or %NULL
27769  * @callback: a #GAsyncReadyCallback.
27770  * @user_data: user data passed to @callback.
27771  * @error: the #GError to report
27772  *
27773  * Reports an error in an idle function. Similar to
27774  * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27775  * ownership of @error, so the caller does not have to free it any more.
27776  *
27777  * Since: 2.28
27778  */
27779
27780
27781 /**
27782  * g_simple_async_result_complete:
27783  * @simple: a #GSimpleAsyncResult.
27784  *
27785  * Completes an asynchronous I/O job immediately. Must be called in
27786  * the thread where the asynchronous result was to be delivered, as it
27787  * invokes the callback directly. If you are in a different thread use
27788  * g_simple_async_result_complete_in_idle().
27789  *
27790  * Calling this function takes a reference to @simple for as long as
27791  * is needed to complete the call.
27792  */
27793
27794
27795 /**
27796  * g_simple_async_result_complete_in_idle:
27797  * @simple: a #GSimpleAsyncResult.
27798  *
27799  * Completes an asynchronous function in an idle handler in the <link
27800  * linkend="g-main-context-push-thread-default">thread-default main
27801  * loop</link> of the thread that @simple was initially created in
27802  * (and re-pushes that context around the invocation of the callback).
27803  *
27804  * Calling this function takes a reference to @simple for as long as
27805  * is needed to complete the call.
27806  */
27807
27808
27809 /**
27810  * g_simple_async_result_get_op_res_gboolean:
27811  * @simple: a #GSimpleAsyncResult.
27812  *
27813  * Gets the operation result boolean from within the asynchronous result.
27814  *
27815  * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27816  */
27817
27818
27819 /**
27820  * g_simple_async_result_get_op_res_gpointer: (skip)
27821  * @simple: a #GSimpleAsyncResult.
27822  *
27823  * Gets a pointer result as returned by the asynchronous function.
27824  *
27825  * Returns: a pointer from the result.
27826  */
27827
27828
27829 /**
27830  * g_simple_async_result_get_op_res_gssize:
27831  * @simple: a #GSimpleAsyncResult.
27832  *
27833  * Gets a gssize from the asynchronous result.
27834  *
27835  * Returns: a gssize returned from the asynchronous function.
27836  */
27837
27838
27839 /**
27840  * g_simple_async_result_get_source_tag: (skip)
27841  * @simple: a #GSimpleAsyncResult.
27842  *
27843  * Gets the source tag for the #GSimpleAsyncResult.
27844  *
27845  * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27846  */
27847
27848
27849 /**
27850  * g_simple_async_result_is_valid:
27851  * @result: the #GAsyncResult passed to the _finish function.
27852  * @source: the #GObject passed to the _finish function.
27853  * @source_tag: the asynchronous function.
27854  *
27855  * Ensures that the data passed to the _finish function of an async
27856  * operation is consistent.  Three checks are performed.
27857  *
27858  * First, @result is checked to ensure that it is really a
27859  * #GSimpleAsyncResult.  Second, @source is checked to ensure that it
27860  * matches the source object of @result.  Third, @source_tag is
27861  * checked to ensure that it is either %NULL (as it is when the result was
27862  * created by g_simple_async_report_error_in_idle() or
27863  * g_simple_async_report_gerror_in_idle()) or equal to the
27864  * @source_tag argument given to g_simple_async_result_new() (which, by
27865  * convention, is a pointer to the _async function corresponding to the
27866  * _finish function from which this function is called).
27867  *
27868  * Returns: #TRUE if all checks passed or #FALSE if any failed.
27869  * Since: 2.20
27870  */
27871
27872
27873 /**
27874  * g_simple_async_result_new:
27875  * @source_object: (allow-none): a #GObject, or %NULL.
27876  * @callback: (scope async): a #GAsyncReadyCallback.
27877  * @user_data: (closure): user data passed to @callback.
27878  * @source_tag: the asynchronous function.
27879  *
27880  * Creates a #GSimpleAsyncResult.
27881  *
27882  * The common convention is to create the #GSimpleAsyncResult in the
27883  * function that starts the asynchronous operation and use that same
27884  * function as the @source_tag.
27885  *
27886  * If your operation supports cancellation with #GCancellable (which it
27887  * probably should) then you should provide the user's cancellable to
27888  * g_simple_async_result_set_check_cancellable() immediately after
27889  * this function returns.
27890  *
27891  * Returns: a #GSimpleAsyncResult.
27892  */
27893
27894
27895 /**
27896  * g_simple_async_result_new_error:
27897  * @source_object: (allow-none): a #GObject, or %NULL.
27898  * @callback: (scope async): a #GAsyncReadyCallback.
27899  * @user_data: (closure): user data passed to @callback.
27900  * @domain: a #GQuark.
27901  * @code: an error code.
27902  * @format: a string with format characters.
27903  * @...: a list of values to insert into @format.
27904  *
27905  * Creates a new #GSimpleAsyncResult with a set error.
27906  *
27907  * Returns: a #GSimpleAsyncResult.
27908  */
27909
27910
27911 /**
27912  * g_simple_async_result_new_from_error:
27913  * @source_object: (allow-none): a #GObject, or %NULL.
27914  * @callback: (scope async): a #GAsyncReadyCallback.
27915  * @user_data: (closure): user data passed to @callback.
27916  * @error: a #GError
27917  *
27918  * Creates a #GSimpleAsyncResult from an error condition.
27919  *
27920  * Returns: a #GSimpleAsyncResult.
27921  */
27922
27923
27924 /**
27925  * g_simple_async_result_new_take_error: (skip)
27926  * @source_object: (allow-none): a #GObject, or %NULL
27927  * @callback: (scope async): a #GAsyncReadyCallback
27928  * @user_data: (closure): user data passed to @callback
27929  * @error: a #GError
27930  *
27931  * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27932  * caller's ownership of @error, so the caller does not need to free it anymore.
27933  *
27934  * Returns: a #GSimpleAsyncResult
27935  * Since: 2.28
27936  */
27937
27938
27939 /**
27940  * g_simple_async_result_propagate_error:
27941  * @simple: a #GSimpleAsyncResult.
27942  * @dest: (out): a location to propagate the error to.
27943  *
27944  * Propagates an error from within the simple asynchronous result to
27945  * a given destination.
27946  *
27947  * If the #GCancellable given to a prior call to
27948  * g_simple_async_result_set_check_cancellable() is cancelled then this
27949  * function will return %TRUE with @dest set appropriately.
27950  *
27951  * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27952  */
27953
27954
27955 /**
27956  * g_simple_async_result_run_in_thread: (skip)
27957  * @simple: a #GSimpleAsyncResult.
27958  * @func: a #GSimpleAsyncThreadFunc.
27959  * @io_priority: the io priority of the request.
27960  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27961  *
27962  * Runs the asynchronous job in a separate thread and then calls
27963  * g_simple_async_result_complete_in_idle() on @simple to return
27964  * the result to the appropriate main loop.
27965  *
27966  * Calling this function takes a reference to @simple for as long as
27967  * is needed to run the job and report its completion.
27968  */
27969
27970
27971 /**
27972  * g_simple_async_result_set_check_cancellable:
27973  * @simple: a #GSimpleAsyncResult
27974  * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27975  *
27976  * Sets a #GCancellable to check before dispatching results.
27977  *
27978  * This function has one very specific purpose: the provided cancellable
27979  * is checked at the time of g_simple_async_result_propagate_error() If
27980  * it is cancelled, these functions will return an "Operation was
27981  * cancelled" error (%G_IO_ERROR_CANCELLED).
27982  *
27983  * Implementors of cancellable asynchronous functions should use this in
27984  * order to provide a guarantee to their callers that cancelling an
27985  * async operation will reliably result in an error being returned for
27986  * that operation (even if a positive result for the operation has
27987  * already been sent as an idle to the main context to be dispatched).
27988  *
27989  * The checking described above is done regardless of any call to the
27990  * unrelated g_simple_async_result_set_handle_cancellation() function.
27991  *
27992  * Since: 2.32
27993  */
27994
27995
27996 /**
27997  * g_simple_async_result_set_error: (skip)
27998  * @simple: a #GSimpleAsyncResult.
27999  * @domain: a #GQuark (usually #G_IO_ERROR).
28000  * @code: an error code.
28001  * @format: a formatted error reporting string.
28002  * @...: a list of variables to fill in @format.
28003  *
28004  * Sets an error within the asynchronous result without a #GError.
28005  */
28006
28007
28008 /**
28009  * g_simple_async_result_set_error_va: (skip)
28010  * @simple: a #GSimpleAsyncResult.
28011  * @domain: a #GQuark (usually #G_IO_ERROR).
28012  * @code: an error code.
28013  * @format: a formatted error reporting string.
28014  * @args: va_list of arguments.
28015  *
28016  * Sets an error within the asynchronous result without a #GError.
28017  * Unless writing a binding, see g_simple_async_result_set_error().
28018  */
28019
28020
28021 /**
28022  * g_simple_async_result_set_from_error:
28023  * @simple: a #GSimpleAsyncResult.
28024  * @error: #GError.
28025  *
28026  * Sets the result from a #GError.
28027  */
28028
28029
28030 /**
28031  * g_simple_async_result_set_handle_cancellation:
28032  * @simple: a #GSimpleAsyncResult.
28033  * @handle_cancellation: a #gboolean.
28034  *
28035  * Sets whether to handle cancellation within the asynchronous operation.
28036  *
28037  * This function has nothing to do with
28038  * g_simple_async_result_set_check_cancellable().  It only refers to the
28039  * #GCancellable passed to g_simple_async_result_run_in_thread().
28040  */
28041
28042
28043 /**
28044  * g_simple_async_result_set_op_res_gboolean:
28045  * @simple: a #GSimpleAsyncResult.
28046  * @op_res: a #gboolean.
28047  *
28048  * Sets the operation result to a boolean within the asynchronous result.
28049  */
28050
28051
28052 /**
28053  * g_simple_async_result_set_op_res_gpointer: (skip)
28054  * @simple: a #GSimpleAsyncResult.
28055  * @op_res: a pointer result from an asynchronous function.
28056  * @destroy_op_res: a #GDestroyNotify function.
28057  *
28058  * Sets the operation result within the asynchronous result to a pointer.
28059  */
28060
28061
28062 /**
28063  * g_simple_async_result_set_op_res_gssize:
28064  * @simple: a #GSimpleAsyncResult.
28065  * @op_res: a #gssize.
28066  *
28067  * Sets the operation result within the asynchronous result to
28068  * the given @op_res.
28069  */
28070
28071
28072 /**
28073  * g_simple_async_result_take_error: (skip)
28074  * @simple: a #GSimpleAsyncResult
28075  * @error: a #GError
28076  *
28077  * Sets the result from @error, and takes over the caller's ownership
28078  * of @error, so the caller does not need to free it any more.
28079  *
28080  * Since: 2.28
28081  */
28082
28083
28084 /**
28085  * g_simple_permission_new:
28086  * @allowed: %TRUE if the action is allowed
28087  *
28088  * Creates a new #GPermission instance that represents an action that is
28089  * either always or never allowed.
28090  *
28091  * Returns: the #GSimplePermission, as a #GPermission
28092  * Since: 2.26
28093  */
28094
28095
28096 /**
28097  * g_simple_proxy_resolver_new:
28098  * @default_proxy: (allow-none): the default proxy to use, eg "socks://192.168.1.1"
28099  * @ignore_hosts: (allow-none): an optional list of hosts/IP addresses to not use a proxy for.
28100  *
28101  * Creates a new #GSimpleProxyResolver. See
28102  * #GSimpleProxyResolver:default-proxy and
28103  * #GSimpleProxyResolver:ignore-hosts for more details on how the
28104  * arguments are interpreted.
28105  *
28106  * Returns: a new #GSimpleProxyResolver
28107  * Since: 2.36
28108  */
28109
28110
28111 /**
28112  * g_simple_proxy_resolver_set_default_proxy:
28113  * @resolver: a #GSimpleProxyResolver
28114  * @default_proxy: the default proxy to use
28115  *
28116  * Sets the default proxy on @resolver, to be used for any URIs that
28117  * don't match #GSimpleProxyResolver:ignore-hosts or a proxy set
28118  * via g_simple_proxy_resolver_set_uri_proxy().
28119  *
28120  * If @default_proxy starts with "<literal>socks://</literal>",
28121  * #GSimpleProxyResolver will treat it as referring to all three of
28122  * the <literal>socks5</literal>, <literal>socks4a</literal>, and
28123  * <literal>socks4</literal> proxy types.
28124  *
28125  * Since: 2.36
28126  */
28127
28128
28129 /**
28130  * g_simple_proxy_resolver_set_ignore_hosts:
28131  * @resolver: a #GSimpleProxyResolver
28132  * @ignore_hosts: %NULL-terminated list of hosts/IP addresses to not use a proxy for
28133  *
28134  * Sets the list of ignored hosts.
28135  *
28136  * See #GSimpleProxyResolver:ignore-hosts for more details on how the
28137  * @ignore_hosts argument is interpreted.
28138  *
28139  * Since: 2.36
28140  */
28141
28142
28143 /**
28144  * g_simple_proxy_resolver_set_uri_proxy:
28145  * @resolver: a #GSimpleProxyResolver
28146  * @uri_scheme: the URI scheme to add a proxy for
28147  * @proxy: the proxy to use for @uri_scheme
28148  *
28149  * Adds a URI-scheme-specific proxy to @resolver; URIs whose scheme
28150  * matches @uri_scheme (and which don't match
28151  * #GSimpleProxyResolver:ignore-hosts) will be proxied via @proxy.
28152  *
28153  * As with #GSimpleProxyResolver:default-proxy, if @proxy starts with
28154  * "<literal>socks://</literal>", #GSimpleProxyResolver will treat it
28155  * as referring to all three of the <literal>socks5</literal>,
28156  * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
28157  * types.
28158  *
28159  * Since: 2.36
28160  */
28161
28162
28163 /**
28164  * g_socket_accept:
28165  * @socket: a #GSocket.
28166  * @cancellable: (allow-none): a %GCancellable or %NULL
28167  * @error: #GError for error reporting, or %NULL to ignore.
28168  *
28169  * Accept incoming connections on a connection-based socket. This removes
28170  * the first outstanding connection request from the listening socket and
28171  * creates a #GSocket object for it.
28172  *
28173  * The @socket must be bound to a local address with g_socket_bind() and
28174  * must be listening for incoming connections (g_socket_listen()).
28175  *
28176  * If there are no outstanding connections then the operation will block
28177  * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
28178  * To be notified of an incoming connection, wait for the %G_IO_IN condition.
28179  *
28180  * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
28181  * Since: 2.22
28182  */
28183
28184
28185 /**
28186  * g_socket_address_enumerator_next:
28187  * @enumerator: a #GSocketAddressEnumerator
28188  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28189  * @error: a #GError.
28190  *
28191  * Retrieves the next #GSocketAddress from @enumerator. Note that this
28192  * may block for some amount of time. (Eg, a #GNetworkAddress may need
28193  * to do a DNS lookup before it can return an address.) Use
28194  * g_socket_address_enumerator_next_async() if you need to avoid
28195  * blocking.
28196  *
28197  * If @enumerator is expected to yield addresses, but for some reason
28198  * is unable to (eg, because of a DNS error), then the first call to
28199  * g_socket_address_enumerator_next() will return an appropriate error
28200  * in *@error. However, if the first call to
28201  * g_socket_address_enumerator_next() succeeds, then any further
28202  * internal errors (other than @cancellable being triggered) will be
28203  * ignored.
28204  *
28205  * Returns: (transfer full): a #GSocketAddress (owned by the caller), or %NULL on error (in which case *@error will be set) or if there are no more addresses.
28206  */
28207
28208
28209 /**
28210  * g_socket_address_enumerator_next_async:
28211  * @enumerator: a #GSocketAddressEnumerator
28212  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28213  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
28214  * @user_data: (closure): the data to pass to callback function
28215  *
28216  * Asynchronously retrieves the next #GSocketAddress from @enumerator
28217  * and then calls @callback, which must call
28218  * g_socket_address_enumerator_next_finish() to get the result.
28219  */
28220
28221
28222 /**
28223  * g_socket_address_enumerator_next_finish:
28224  * @enumerator: a #GSocketAddressEnumerator
28225  * @result: a #GAsyncResult
28226  * @error: a #GError
28227  *
28228  * Retrieves the result of a completed call to
28229  * g_socket_address_enumerator_next_async(). See
28230  * g_socket_address_enumerator_next() for more information about
28231  * error handling.
28232  *
28233  * Returns: (transfer full): a #GSocketAddress (owned by the caller), or %NULL on error (in which case *@error will be set) or if there are no more addresses.
28234  */
28235
28236
28237 /**
28238  * g_socket_address_get_family:
28239  * @address: a #GSocketAddress
28240  *
28241  * Gets the socket family type of @address.
28242  *
28243  * Returns: the socket family type of @address.
28244  * Since: 2.22
28245  */
28246
28247
28248 /**
28249  * g_socket_address_get_native_size:
28250  * @address: a #GSocketAddress
28251  *
28252  * Gets the size of @address's native <type>struct sockaddr</type>.
28253  * You can use this to allocate memory to pass to
28254  * g_socket_address_to_native().
28255  *
28256  * Returns: the size of the native <type>struct sockaddr</type> that @address represents
28257  * Since: 2.22
28258  */
28259
28260
28261 /**
28262  * g_socket_address_new_from_native:
28263  * @native: a pointer to a <type>struct sockaddr</type>
28264  * @len: the size of the memory location pointed to by @native
28265  *
28266  * Creates a #GSocketAddress subclass corresponding to the native
28267  * <type>struct sockaddr</type> @native.
28268  *
28269  * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
28270  * Since: 2.22
28271  */
28272
28273
28274 /**
28275  * g_socket_address_to_native:
28276  * @address: a #GSocketAddress
28277  * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
28278  * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
28279  * @error: #GError for error reporting, or %NULL to ignore.
28280  *
28281  * Converts a #GSocketAddress to a native <type>struct
28282  * sockaddr</type>, which can be passed to low-level functions like
28283  * connect() or bind().
28284  *
28285  * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
28286  * returned. If the address type is not known on the system
28287  * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
28288  *
28289  * Returns: %TRUE if @dest was filled in, %FALSE on error
28290  * Since: 2.22
28291  */
28292
28293
28294 /**
28295  * g_socket_bind:
28296  * @socket: a #GSocket.
28297  * @address: a #GSocketAddress specifying the local address.
28298  * @allow_reuse: whether to allow reusing this address
28299  * @error: #GError for error reporting, or %NULL to ignore.
28300  *
28301  * When a socket is created it is attached to an address family, but it
28302  * doesn't have an address in this family. g_socket_bind() assigns the
28303  * address (sometimes called name) of the socket.
28304  *
28305  * It is generally required to bind to a local address before you can
28306  * receive connections. (See g_socket_listen() and g_socket_accept() ).
28307  * In certain situations, you may also want to bind a socket that will be
28308  * used to initiate connections, though this is not normally required.
28309  *
28310  * If @socket is a TCP socket, then @allow_reuse controls the setting
28311  * of the <literal>SO_REUSEADDR</literal> socket option; normally it
28312  * should be %TRUE for server sockets (sockets that you will
28313  * eventually call g_socket_accept() on), and %FALSE for client
28314  * sockets. (Failing to set this flag on a server socket may cause
28315  * g_socket_bind() to return %G_IO_ERROR_ADDRESS_IN_USE if the server
28316  * program is stopped and then immediately restarted.)
28317  *
28318  * If @socket is a UDP socket, then @allow_reuse determines whether or
28319  * not other UDP sockets can be bound to the same address at the same
28320  * time. In particular, you can have several UDP sockets bound to the
28321  * same address, and they will all receive all of the multicast and
28322  * broadcast packets sent to that address. (The behavior of unicast
28323  * UDP packets to an address with multiple listeners is not defined.)
28324  *
28325  * Returns: %TRUE on success, %FALSE on error.
28326  * Since: 2.22
28327  */
28328
28329
28330 /**
28331  * g_socket_check_connect_result:
28332  * @socket: a #GSocket
28333  * @error: #GError for error reporting, or %NULL to ignore.
28334  *
28335  * Checks and resets the pending connect error for the socket.
28336  * This is used to check for errors when g_socket_connect() is
28337  * used in non-blocking mode.
28338  *
28339  * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28340  * Since: 2.22
28341  */
28342
28343
28344 /**
28345  * g_socket_client_add_application_proxy:
28346  * @client: a #GSocketClient
28347  * @protocol: The proxy protocol
28348  *
28349  * Enable proxy protocols to be handled by the application. When the
28350  * indicated proxy protocol is returned by the #GProxyResolver,
28351  * #GSocketClient will consider this protocol as supported but will
28352  * not try to find a #GProxy instance to handle handshaking. The
28353  * application must check for this case by calling
28354  * g_socket_connection_get_remote_address() on the returned
28355  * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28356  * appropriate type, to determine whether or not it needs to handle
28357  * the proxy handshaking itself.
28358  *
28359  * This should be used for proxy protocols that are dialects of
28360  * another protocol such as HTTP proxy. It also allows cohabitation of
28361  * proxy protocols that are reused between protocols. A good example
28362  * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28363  * be use as generic socket proxy through the HTTP CONNECT method.
28364  *
28365  * When the proxy is detected as being an application proxy, TLS handshake
28366  * will be skipped. This is required to let the application do the proxy
28367  * specific handshake.
28368  */
28369
28370
28371 /**
28372  * g_socket_client_connect:
28373  * @client: a #GSocketClient.
28374  * @connectable: a #GSocketConnectable specifying the remote address.
28375  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28376  * @error: #GError for error reporting, or %NULL to ignore.
28377  *
28378  * Tries to resolve the @connectable and make a network connection to it.
28379  *
28380  * Upon a successful connection, a new #GSocketConnection is constructed
28381  * and returned.  The caller owns this new object and must drop their
28382  * reference to it when finished with it.
28383  *
28384  * The type of the #GSocketConnection object returned depends on the type of
28385  * the underlying socket that is used. For instance, for a TCP/IP connection
28386  * it will be a #GTcpConnection.
28387  *
28388  * The socket created will be the same family as the address that the
28389  * @connectable resolves to, unless family is set with g_socket_client_set_family()
28390  * or indirectly via g_socket_client_set_local_address(). The socket type
28391  * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28392  * g_socket_client_set_socket_type().
28393  *
28394  * If a local address is specified with g_socket_client_set_local_address() the
28395  * socket will be bound to this address before connecting.
28396  *
28397  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28398  * Since: 2.22
28399  */
28400
28401
28402 /**
28403  * g_socket_client_connect_async:
28404  * @client: a #GSocketClient
28405  * @connectable: a #GSocketConnectable specifying the remote address.
28406  * @cancellable: (allow-none): a #GCancellable, or %NULL
28407  * @callback: (scope async): a #GAsyncReadyCallback
28408  * @user_data: (closure): user data for the callback
28409  *
28410  * This is the asynchronous version of g_socket_client_connect().
28411  *
28412  * When the operation is finished @callback will be
28413  * called. You can then call g_socket_client_connect_finish() to get
28414  * the result of the operation.
28415  *
28416  * Since: 2.22
28417  */
28418
28419
28420 /**
28421  * g_socket_client_connect_finish:
28422  * @client: a #GSocketClient.
28423  * @result: a #GAsyncResult.
28424  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28425  *
28426  * Finishes an async connect operation. See g_socket_client_connect_async()
28427  *
28428  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28429  * Since: 2.22
28430  */
28431
28432
28433 /**
28434  * g_socket_client_connect_to_host:
28435  * @client: a #GSocketClient
28436  * @host_and_port: the name and optionally port of the host to connect to
28437  * @default_port: the default port to connect to
28438  * @cancellable: (allow-none): a #GCancellable, or %NULL
28439  * @error: a pointer to a #GError, or %NULL
28440  *
28441  * This is a helper function for g_socket_client_connect().
28442  *
28443  * Attempts to create a TCP connection to the named host.
28444  *
28445  * @host_and_port may be in any of a number of recognized formats; an IPv6
28446  * address, an IPv4 address, or a domain name (in which case a DNS
28447  * lookup is performed).  Quoting with [] is supported for all address
28448  * types.  A port override may be specified in the usual way with a
28449  * colon.  Ports may be given as decimal numbers or symbolic names (in
28450  * which case an /etc/services lookup is performed).
28451  *
28452  * If no port override is given in @host_and_port then @default_port will be
28453  * used as the port number to connect to.
28454  *
28455  * In general, @host_and_port is expected to be provided by the user (allowing
28456  * them to give the hostname, and a port override if necessary) and
28457  * @default_port is expected to be provided by the application.
28458  *
28459  * In the case that an IP address is given, a single connection
28460  * attempt is made.  In the case that a name is given, multiple
28461  * connection attempts may be made, in turn and according to the
28462  * number of address records in DNS, until a connection succeeds.
28463  *
28464  * Upon a successful connection, a new #GSocketConnection is constructed
28465  * and returned.  The caller owns this new object and must drop their
28466  * reference to it when finished with it.
28467  *
28468  * In the event of any failure (DNS error, service not found, no hosts
28469  * connectable) %NULL is returned and @error (if non-%NULL) is set
28470  * accordingly.
28471  *
28472  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28473  * Since: 2.22
28474  */
28475
28476
28477 /**
28478  * g_socket_client_connect_to_host_async:
28479  * @client: a #GSocketClient
28480  * @host_and_port: the name and optionally the port of the host to connect to
28481  * @default_port: the default port to connect to
28482  * @cancellable: (allow-none): a #GCancellable, or %NULL
28483  * @callback: (scope async): a #GAsyncReadyCallback
28484  * @user_data: (closure): user data for the callback
28485  *
28486  * This is the asynchronous version of g_socket_client_connect_to_host().
28487  *
28488  * When the operation is finished @callback will be
28489  * called. You can then call g_socket_client_connect_to_host_finish() to get
28490  * the result of the operation.
28491  *
28492  * Since: 2.22
28493  */
28494
28495
28496 /**
28497  * g_socket_client_connect_to_host_finish:
28498  * @client: a #GSocketClient.
28499  * @result: a #GAsyncResult.
28500  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28501  *
28502  * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28503  *
28504  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28505  * Since: 2.22
28506  */
28507
28508
28509 /**
28510  * g_socket_client_connect_to_service:
28511  * @client: a #GSocketConnection
28512  * @domain: a domain name
28513  * @service: the name of the service to connect to
28514  * @cancellable: (allow-none): a #GCancellable, or %NULL
28515  * @error: a pointer to a #GError, or %NULL
28516  *
28517  * Attempts to create a TCP connection to a service.
28518  *
28519  * This call looks up the SRV record for @service at @domain for the
28520  * "tcp" protocol.  It then attempts to connect, in turn, to each of
28521  * the hosts providing the service until either a connection succeeds
28522  * or there are no hosts remaining.
28523  *
28524  * Upon a successful connection, a new #GSocketConnection is constructed
28525  * and returned.  The caller owns this new object and must drop their
28526  * reference to it when finished with it.
28527  *
28528  * In the event of any failure (DNS error, service not found, no hosts
28529  * connectable) %NULL is returned and @error (if non-%NULL) is set
28530  * accordingly.
28531  *
28532  * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28533  */
28534
28535
28536 /**
28537  * g_socket_client_connect_to_service_async:
28538  * @client: a #GSocketClient
28539  * @domain: a domain name
28540  * @service: the name of the service to connect to
28541  * @cancellable: (allow-none): a #GCancellable, or %NULL
28542  * @callback: (scope async): a #GAsyncReadyCallback
28543  * @user_data: (closure): user data for the callback
28544  *
28545  * This is the asynchronous version of
28546  * g_socket_client_connect_to_service().
28547  *
28548  * Since: 2.22
28549  */
28550
28551
28552 /**
28553  * g_socket_client_connect_to_service_finish:
28554  * @client: a #GSocketClient.
28555  * @result: a #GAsyncResult.
28556  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28557  *
28558  * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28559  *
28560  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28561  * Since: 2.22
28562  */
28563
28564
28565 /**
28566  * g_socket_client_connect_to_uri:
28567  * @client: a #GSocketClient
28568  * @uri: A network URI
28569  * @default_port: the default port to connect to
28570  * @cancellable: (allow-none): a #GCancellable, or %NULL
28571  * @error: a pointer to a #GError, or %NULL
28572  *
28573  * This is a helper function for g_socket_client_connect().
28574  *
28575  * Attempts to create a TCP connection with a network URI.
28576  *
28577  * @uri may be any valid URI containing an "authority" (hostname/port)
28578  * component. If a port is not specified in the URI, @default_port
28579  * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28580  * (#GSocketClient does not know to automatically assume TLS for
28581  * certain URI schemes.)
28582  *
28583  * Using this rather than g_socket_client_connect() or
28584  * g_socket_client_connect_to_host() allows #GSocketClient to
28585  * determine when to use application-specific proxy protocols.
28586  *
28587  * Upon a successful connection, a new #GSocketConnection is constructed
28588  * and returned.  The caller owns this new object and must drop their
28589  * reference to it when finished with it.
28590  *
28591  * In the event of any failure (DNS error, service not found, no hosts
28592  * connectable) %NULL is returned and @error (if non-%NULL) is set
28593  * accordingly.
28594  *
28595  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28596  * Since: 2.26
28597  */
28598
28599
28600 /**
28601  * g_socket_client_connect_to_uri_async:
28602  * @client: a #GSocketClient
28603  * @uri: a network uri
28604  * @default_port: the default port to connect to
28605  * @cancellable: (allow-none): a #GCancellable, or %NULL
28606  * @callback: (scope async): a #GAsyncReadyCallback
28607  * @user_data: (closure): user data for the callback
28608  *
28609  * This is the asynchronous version of g_socket_client_connect_to_uri().
28610  *
28611  * When the operation is finished @callback will be
28612  * called. You can then call g_socket_client_connect_to_uri_finish() to get
28613  * the result of the operation.
28614  *
28615  * Since: 2.26
28616  */
28617
28618
28619 /**
28620  * g_socket_client_connect_to_uri_finish:
28621  * @client: a #GSocketClient.
28622  * @result: a #GAsyncResult.
28623  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28624  *
28625  * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28626  *
28627  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28628  * Since: 2.26
28629  */
28630
28631
28632 /**
28633  * g_socket_client_get_enable_proxy:
28634  * @client: a #GSocketClient.
28635  *
28636  * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28637  *
28638  * Returns: whether proxying is enabled
28639  * Since: 2.26
28640  */
28641
28642
28643 /**
28644  * g_socket_client_get_family:
28645  * @client: a #GSocketClient.
28646  *
28647  * Gets the socket family of the socket client.
28648  *
28649  * See g_socket_client_set_family() for details.
28650  *
28651  * Returns: a #GSocketFamily
28652  * Since: 2.22
28653  */
28654
28655
28656 /**
28657  * g_socket_client_get_local_address:
28658  * @client: a #GSocketClient.
28659  *
28660  * Gets the local address of the socket client.
28661  *
28662  * See g_socket_client_set_local_address() for details.
28663  *
28664  * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28665  * Since: 2.22
28666  */
28667
28668
28669 /**
28670  * g_socket_client_get_protocol:
28671  * @client: a #GSocketClient
28672  *
28673  * Gets the protocol name type of the socket client.
28674  *
28675  * See g_socket_client_set_protocol() for details.
28676  *
28677  * Returns: a #GSocketProtocol
28678  * Since: 2.22
28679  */
28680
28681
28682 /**
28683  * g_socket_client_get_proxy_resolver:
28684  * @client: a #GSocketClient.
28685  *
28686  * Gets the #GProxyResolver being used by @client. Normally, this will
28687  * be the resolver returned by g_proxy_resolver_get_default(), but you
28688  * can override it with g_socket_client_set_proxy_resolver().
28689  *
28690  * Returns: (transfer none): The #GProxyResolver being used by @client.
28691  * Since: 2.36
28692  */
28693
28694
28695 /**
28696  * g_socket_client_get_socket_type:
28697  * @client: a #GSocketClient.
28698  *
28699  * Gets the socket type of the socket client.
28700  *
28701  * See g_socket_client_set_socket_type() for details.
28702  *
28703  * Returns: a #GSocketFamily
28704  * Since: 2.22
28705  */
28706
28707
28708 /**
28709  * g_socket_client_get_timeout:
28710  * @client: a #GSocketClient
28711  *
28712  * Gets the I/O timeout time for sockets created by @client.
28713  *
28714  * See g_socket_client_set_timeout() for details.
28715  *
28716  * Returns: the timeout in seconds
28717  * Since: 2.26
28718  */
28719
28720
28721 /**
28722  * g_socket_client_get_tls:
28723  * @client: a #GSocketClient.
28724  *
28725  * Gets whether @client creates TLS connections. See
28726  * g_socket_client_set_tls() for details.
28727  *
28728  * Returns: whether @client uses TLS
28729  * Since: 2.28
28730  */
28731
28732
28733 /**
28734  * g_socket_client_get_tls_validation_flags:
28735  * @client: a #GSocketClient.
28736  *
28737  * Gets the TLS validation flags used creating TLS connections via
28738  * @client.
28739  *
28740  * Returns: the TLS validation flags
28741  * Since: 2.28
28742  */
28743
28744
28745 /**
28746  * g_socket_client_new:
28747  *
28748  * Creates a new #GSocketClient with the default options.
28749  *
28750  * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28751  * Since: 2.22
28752  */
28753
28754
28755 /**
28756  * g_socket_client_set_enable_proxy:
28757  * @client: a #GSocketClient.
28758  * @enable: whether to enable proxies
28759  *
28760  * Sets whether or not @client attempts to make connections via a
28761  * proxy server. When enabled (the default), #GSocketClient will use a
28762  * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28763  * needed, and automatically do the necessary proxy negotiation.
28764  *
28765  * See also g_socket_client_set_proxy_resolver().
28766  *
28767  * Since: 2.26
28768  */
28769
28770
28771 /**
28772  * g_socket_client_set_family:
28773  * @client: a #GSocketClient.
28774  * @family: a #GSocketFamily
28775  *
28776  * Sets the socket family of the socket client.
28777  * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28778  * then the sockets created by this object will be of the specified
28779  * family.
28780  *
28781  * This might be useful for instance if you want to force the local
28782  * connection to be an ipv4 socket, even though the address might
28783  * be an ipv6 mapped to ipv4 address.
28784  *
28785  * Since: 2.22
28786  */
28787
28788
28789 /**
28790  * g_socket_client_set_local_address:
28791  * @client: a #GSocketClient.
28792  * @address: (allow-none): a #GSocketAddress, or %NULL
28793  *
28794  * Sets the local address of the socket client.
28795  * The sockets created by this object will bound to the
28796  * specified address (if not %NULL) before connecting.
28797  *
28798  * This is useful if you want to ensure that the local
28799  * side of the connection is on a specific port, or on
28800  * a specific interface.
28801  *
28802  * Since: 2.22
28803  */
28804
28805
28806 /**
28807  * g_socket_client_set_protocol:
28808  * @client: a #GSocketClient.
28809  * @protocol: a #GSocketProtocol
28810  *
28811  * Sets the protocol of the socket client.
28812  * The sockets created by this object will use of the specified
28813  * protocol.
28814  *
28815  * If @protocol is %0 that means to use the default
28816  * protocol for the socket family and type.
28817  *
28818  * Since: 2.22
28819  */
28820
28821
28822 /**
28823  * g_socket_client_set_proxy_resolver:
28824  * @client: a #GSocketClient.
28825  * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL for the default.
28826  *
28827  * Overrides the #GProxyResolver used by @client. You can call this if
28828  * you want to use specific proxies, rather than using the system
28829  * default proxy settings.
28830  *
28831  * Note that whether or not the proxy resolver is actually used
28832  * depends on the setting of #GSocketClient:enable-proxy, which is not
28833  * changed by this function (but which is %TRUE by default)
28834  *
28835  * Since: 2.36
28836  */
28837
28838
28839 /**
28840  * g_socket_client_set_socket_type:
28841  * @client: a #GSocketClient.
28842  * @type: a #GSocketType
28843  *
28844  * Sets the socket type of the socket client.
28845  * The sockets created by this object will be of the specified
28846  * type.
28847  *
28848  * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28849  * as GSocketClient is used for connection oriented services.
28850  *
28851  * Since: 2.22
28852  */
28853
28854
28855 /**
28856  * g_socket_client_set_timeout:
28857  * @client: a #GSocketClient.
28858  * @timeout: the timeout
28859  *
28860  * Sets the I/O timeout for sockets created by @client. @timeout is a
28861  * time in seconds, or 0 for no timeout (the default).
28862  *
28863  * The timeout value affects the initial connection attempt as well,
28864  * so setting this may cause calls to g_socket_client_connect(), etc,
28865  * to fail with %G_IO_ERROR_TIMED_OUT.
28866  *
28867  * Since: 2.26
28868  */
28869
28870
28871 /**
28872  * g_socket_client_set_tls:
28873  * @client: a #GSocketClient.
28874  * @tls: whether to use TLS
28875  *
28876  * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28877  * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28878  * and perform a TLS handshake when connecting.
28879  *
28880  * Note that since #GSocketClient must return a #GSocketConnection,
28881  * but #GTlsClientConnection is not a #GSocketConnection, this
28882  * actually wraps the resulting #GTlsClientConnection in a
28883  * #GTcpWrapperConnection when returning it. You can use
28884  * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28885  * to extract the #GTlsClientConnection.
28886  *
28887  * If you need to modify the behavior of the TLS handshake (eg, by
28888  * setting a client-side certificate to use, or connecting to the
28889  * #GTlsConnection::accept-certificate signal), you can connect to
28890  * @client's #GSocketClient::event signal and wait for it to be
28891  * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28892  * a chance to see the #GTlsClientConnection before the handshake
28893  * starts.
28894  *
28895  * Since: 2.28
28896  */
28897
28898
28899 /**
28900  * g_socket_client_set_tls_validation_flags:
28901  * @client: a #GSocketClient.
28902  * @flags: the validation flags
28903  *
28904  * Sets the TLS validation flags used when creating TLS connections
28905  * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28906  *
28907  * Since: 2.28
28908  */
28909
28910
28911 /**
28912  * g_socket_close:
28913  * @socket: a #GSocket
28914  * @error: #GError for error reporting, or %NULL to ignore.
28915  *
28916  * Closes the socket, shutting down any active connection.
28917  *
28918  * Closing a socket does not wait for all outstanding I/O operations
28919  * to finish, so the caller should not rely on them to be guaranteed
28920  * to complete even if the close returns with no error.
28921  *
28922  * Once the socket is closed, all other operations will return
28923  * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28924  * return an error.
28925  *
28926  * Sockets will be automatically closed when the last reference
28927  * is dropped, but you might want to call this function to make sure
28928  * resources are released as early as possible.
28929  *
28930  * Beware that due to the way that TCP works, it is possible for
28931  * recently-sent data to be lost if either you close a socket while the
28932  * %G_IO_IN condition is set, or else if the remote connection tries to
28933  * send something to you after you close the socket but before it has
28934  * finished reading all of the data you sent. There is no easy generic
28935  * way to avoid this problem; the easiest fix is to design the network
28936  * protocol such that the client will never send data "out of turn".
28937  * Another solution is for the server to half-close the connection by
28938  * calling g_socket_shutdown() with only the @shutdown_write flag set,
28939  * and then wait for the client to notice this and close its side of the
28940  * connection, after which the server can safely call g_socket_close().
28941  * (This is what #GTcpConnection does if you call
28942  * g_tcp_connection_set_graceful_disconnect(). But of course, this
28943  * only works if the client will close its connection after the server
28944  * does.)
28945  *
28946  * Returns: %TRUE on success, %FALSE on error
28947  * Since: 2.22
28948  */
28949
28950
28951 /**
28952  * g_socket_condition_check:
28953  * @socket: a #GSocket
28954  * @condition: a #GIOCondition mask to check
28955  *
28956  * Checks on the readiness of @socket to perform operations.
28957  * The operations specified in @condition are checked for and masked
28958  * against the currently-satisfied conditions on @socket. The result
28959  * is returned.
28960  *
28961  * Note that on Windows, it is possible for an operation to return
28962  * %G_IO_ERROR_WOULD_BLOCK even immediately after
28963  * g_socket_condition_check() has claimed that the socket is ready for
28964  * writing. Rather than calling g_socket_condition_check() and then
28965  * writing to the socket if it succeeds, it is generally better to
28966  * simply try writing to the socket right away, and try again later if
28967  * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28968  *
28969  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28970  * these conditions will always be set in the output if they are true.
28971  *
28972  * This call never blocks.
28973  *
28974  * Returns: the @GIOCondition mask of the current state
28975  * Since: 2.22
28976  */
28977
28978
28979 /**
28980  * g_socket_condition_timed_wait:
28981  * @socket: a #GSocket
28982  * @condition: a #GIOCondition mask to wait for
28983  * @timeout: the maximum time (in microseconds) to wait, or -1
28984  * @cancellable: (allow-none): a #GCancellable, or %NULL
28985  * @error: a #GError pointer, or %NULL
28986  *
28987  * Waits for up to @timeout microseconds for @condition to become true
28988  * on @socket. If the condition is met, %TRUE is returned.
28989  *
28990  * If @cancellable is cancelled before the condition is met, or if
28991  * @timeout (or the socket's #GSocket:timeout) is reached before the
28992  * condition is met, then %FALSE is returned and @error, if non-%NULL,
28993  * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28994  * %G_IO_ERROR_TIMED_OUT).
28995  *
28996  * If you don't want a timeout, use g_socket_condition_wait().
28997  * (Alternatively, you can pass -1 for @timeout.)
28998  *
28999  * Note that although @timeout is in microseconds for consistency with
29000  * other GLib APIs, this function actually only has millisecond
29001  * resolution, and the behavior is undefined if @timeout is not an
29002  * exact number of milliseconds.
29003  *
29004  * Returns: %TRUE if the condition was met, %FALSE otherwise
29005  * Since: 2.32
29006  */
29007
29008
29009 /**
29010  * g_socket_condition_wait:
29011  * @socket: a #GSocket
29012  * @condition: a #GIOCondition mask to wait for
29013  * @cancellable: (allow-none): a #GCancellable, or %NULL
29014  * @error: a #GError pointer, or %NULL
29015  *
29016  * Waits for @condition to become true on @socket. When the condition
29017  * is met, %TRUE is returned.
29018  *
29019  * If @cancellable is cancelled before the condition is met, or if the
29020  * socket has a timeout set and it is reached before the condition is
29021  * met, then %FALSE is returned and @error, if non-%NULL, is set to
29022  * the appropriate value (%G_IO_ERROR_CANCELLED or
29023  * %G_IO_ERROR_TIMED_OUT).
29024  *
29025  * See also g_socket_condition_timed_wait().
29026  *
29027  * Returns: %TRUE if the condition was met, %FALSE otherwise
29028  * Since: 2.22
29029  */
29030
29031
29032 /**
29033  * g_socket_connect:
29034  * @socket: a #GSocket.
29035  * @address: a #GSocketAddress specifying the remote address.
29036  * @cancellable: (allow-none): a %GCancellable or %NULL
29037  * @error: #GError for error reporting, or %NULL to ignore.
29038  *
29039  * Connect the socket to the specified remote address.
29040  *
29041  * For connection oriented socket this generally means we attempt to make
29042  * a connection to the @address. For a connection-less socket it sets
29043  * the default address for g_socket_send() and discards all incoming datagrams
29044  * from other sources.
29045  *
29046  * Generally connection oriented sockets can only connect once, but
29047  * connection-less sockets can connect multiple times to change the
29048  * default address.
29049  *
29050  * If the connect call needs to do network I/O it will block, unless
29051  * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
29052  * and the user can be notified of the connection finishing by waiting
29053  * for the G_IO_OUT condition. The result of the connection must then be
29054  * checked with g_socket_check_connect_result().
29055  *
29056  * Returns: %TRUE if connected, %FALSE on error.
29057  * Since: 2.22
29058  */
29059
29060
29061 /**
29062  * g_socket_connectable_enumerate:
29063  * @connectable: a #GSocketConnectable
29064  *
29065  * Creates a #GSocketAddressEnumerator for @connectable.
29066  *
29067  * Returns: (transfer full): a new #GSocketAddressEnumerator.
29068  * Since: 2.22
29069  */
29070
29071
29072 /**
29073  * g_socket_connectable_proxy_enumerate:
29074  * @connectable: a #GSocketConnectable
29075  *
29076  * Creates a #GSocketAddressEnumerator for @connectable that will
29077  * return #GProxyAddress<!-- -->es for addresses that you must connect
29078  * to via a proxy.
29079  *
29080  * If @connectable does not implement
29081  * g_socket_connectable_proxy_enumerate(), this will fall back to
29082  * calling g_socket_connectable_enumerate().
29083  *
29084  * Returns: (transfer full): a new #GSocketAddressEnumerator.
29085  * Since: 2.26
29086  */
29087
29088
29089 /**
29090  * g_socket_connection_connect:
29091  * @connection: a #GSocketConnection
29092  * @address: a #GSocketAddress specifying the remote address.
29093  * @cancellable: (allow-none): a %GCancellable or %NULL
29094  * @error: #GError for error reporting, or %NULL to ignore.
29095  *
29096  * Connect @connection to the specified remote address.
29097  *
29098  * Returns: %TRUE if the connection succeeded, %FALSE on error
29099  * Since: 2.32
29100  */
29101
29102
29103 /**
29104  * g_socket_connection_connect_async:
29105  * @connection: a #GSocketConnection
29106  * @address: a #GSocketAddress specifying the remote address.
29107  * @cancellable: (allow-none): a %GCancellable or %NULL
29108  * @callback: (scope async): a #GAsyncReadyCallback
29109  * @user_data: (closure): user data for the callback
29110  *
29111  * Asynchronously connect @connection to the specified remote address.
29112  *
29113  * This clears the #GSocket:blocking flag on @connection's underlying
29114  * socket if it is currently set.
29115  *
29116  * Use g_socket_connection_connect_finish() to retrieve the result.
29117  *
29118  * Since: 2.32
29119  */
29120
29121
29122 /**
29123  * g_socket_connection_connect_finish:
29124  * @connection: a #GSocketConnection
29125  * @result: the #GAsyncResult
29126  * @error: #GError for error reporting, or %NULL to ignore.
29127  *
29128  * Gets the result of a g_socket_connection_connect_async() call.
29129  *
29130  * Returns: %TRUE if the connection succeeded, %FALSE on error
29131  * Since: 2.32
29132  */
29133
29134
29135 /**
29136  * g_socket_connection_factory_create_connection:
29137  * @socket: a #GSocket
29138  *
29139  * Creates a #GSocketConnection subclass of the right type for
29140  * @socket.
29141  *
29142  * Returns: (transfer full): a #GSocketConnection
29143  * Since: 2.22
29144  */
29145
29146
29147 /**
29148  * g_socket_connection_factory_lookup_type:
29149  * @family: a #GSocketFamily
29150  * @type: a #GSocketType
29151  * @protocol_id: a protocol id
29152  *
29153  * Looks up the #GType to be used when creating socket connections on
29154  * sockets with the specified @family, @type and @protocol_id.
29155  *
29156  * If no type is registered, the #GSocketConnection base type is returned.
29157  *
29158  * Returns: a #GType
29159  * Since: 2.22
29160  */
29161
29162
29163 /**
29164  * g_socket_connection_factory_register_type:
29165  * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
29166  * @family: a #GSocketFamily
29167  * @type: a #GSocketType
29168  * @protocol: a protocol id
29169  *
29170  * Looks up the #GType to be used when creating socket connections on
29171  * sockets with the specified @family, @type and @protocol.
29172  *
29173  * If no type is registered, the #GSocketConnection base type is returned.
29174  *
29175  * Since: 2.22
29176  */
29177
29178
29179 /**
29180  * g_socket_connection_get_local_address:
29181  * @connection: a #GSocketConnection
29182  * @error: #GError for error reporting, or %NULL to ignore.
29183  *
29184  * Try to get the local address of a socket connection.
29185  *
29186  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29187  * Since: 2.22
29188  */
29189
29190
29191 /**
29192  * g_socket_connection_get_remote_address:
29193  * @connection: a #GSocketConnection
29194  * @error: #GError for error reporting, or %NULL to ignore.
29195  *
29196  * Try to get the remote address of a socket connection.
29197  *
29198  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29199  * Since: 2.22
29200  */
29201
29202
29203 /**
29204  * g_socket_connection_get_socket:
29205  * @connection: a #GSocketConnection
29206  *
29207  * Gets the underlying #GSocket object of the connection.
29208  * This can be useful if you want to do something unusual on it
29209  * not supported by the #GSocketConnection APIs.
29210  *
29211  * Returns: (transfer none): a #GSocketAddress or %NULL on error.
29212  * Since: 2.22
29213  */
29214
29215
29216 /**
29217  * g_socket_connection_is_connected:
29218  * @connection: a #GSocketConnection
29219  *
29220  * Checks if @connection is connected. This is equivalent to calling
29221  * g_socket_is_connected() on @connection's underlying #GSocket.
29222  *
29223  * Returns: whether @connection is connected
29224  * Since: 2.32
29225  */
29226
29227
29228 /**
29229  * g_socket_control_message_deserialize:
29230  * @level: a socket level
29231  * @type: a socket control message type for the given @level
29232  * @size: the size of the data in bytes
29233  * @data: (array length=size) (element-type guint8): pointer to the message data
29234  *
29235  * Tries to deserialize a socket control message of a given
29236  * @level and @type. This will ask all known (to GType) subclasses
29237  * of #GSocketControlMessage if they can understand this kind
29238  * of message and if so deserialize it into a #GSocketControlMessage.
29239  *
29240  * If there is no implementation for this kind of control message, %NULL
29241  * will be returned.
29242  *
29243  * Returns: (transfer full): the deserialized message or %NULL
29244  * Since: 2.22
29245  */
29246
29247
29248 /**
29249  * g_socket_control_message_get_level:
29250  * @message: a #GSocketControlMessage
29251  *
29252  * Returns the "level" (i.e. the originating protocol) of the control message.
29253  * This is often SOL_SOCKET.
29254  *
29255  * Returns: an integer describing the level
29256  * Since: 2.22
29257  */
29258
29259
29260 /**
29261  * g_socket_control_message_get_msg_type:
29262  * @message: a #GSocketControlMessage
29263  *
29264  * Returns the protocol specific type of the control message.
29265  * For instance, for UNIX fd passing this would be SCM_RIGHTS.
29266  *
29267  * Returns: an integer describing the type of control message
29268  * Since: 2.22
29269  */
29270
29271
29272 /**
29273  * g_socket_control_message_get_size:
29274  * @message: a #GSocketControlMessage
29275  *
29276  * Returns the space required for the control message, not including
29277  * headers or alignment.
29278  *
29279  * Returns: The number of bytes required.
29280  * Since: 2.22
29281  */
29282
29283
29284 /**
29285  * g_socket_control_message_serialize:
29286  * @message: a #GSocketControlMessage
29287  * @data: A buffer to write data to
29288  *
29289  * Converts the data in the message to bytes placed in the
29290  * message.
29291  *
29292  * @data is guaranteed to have enough space to fit the size
29293  * returned by g_socket_control_message_get_size() on this
29294  * object.
29295  *
29296  * Since: 2.22
29297  */
29298
29299
29300 /**
29301  * g_socket_create_source: (skip)
29302  * @socket: a #GSocket
29303  * @condition: a #GIOCondition mask to monitor
29304  * @cancellable: (allow-none): a %GCancellable or %NULL
29305  *
29306  * Creates a %GSource that can be attached to a %GMainContext to monitor
29307  * for the availibility of the specified @condition on the socket.
29308  *
29309  * The callback on the source is of the #GSocketSourceFunc type.
29310  *
29311  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
29312  * these conditions will always be reported output if they are true.
29313  *
29314  * @cancellable if not %NULL can be used to cancel the source, which will
29315  * cause the source to trigger, reporting the current condition (which
29316  * is likely 0 unless cancellation happened at the same time as a
29317  * condition change). You can check for this in the callback using
29318  * g_cancellable_is_cancelled().
29319  *
29320  * If @socket has a timeout set, and it is reached before @condition
29321  * occurs, the source will then trigger anyway, reporting %G_IO_IN or
29322  * %G_IO_OUT depending on @condition. However, @socket will have been
29323  * marked as having had a timeout, and so the next #GSocket I/O method
29324  * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
29325  *
29326  * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
29327  * Since: 2.22
29328  */
29329
29330
29331 /**
29332  * g_socket_get_available_bytes:
29333  * @socket: a #GSocket
29334  *
29335  * Get the amount of data pending in the OS input buffer.
29336  *
29337  * If @socket is a UDP or SCTP socket, this will return the size of
29338  * just the next packet, even if additional packets are buffered after
29339  * that one.
29340  *
29341  * Note that on Windows, this function is rather inefficient in the
29342  * UDP case, and so if you know any plausible upper bound on the size
29343  * of the incoming packet, it is better to just do a
29344  * g_socket_receive() with a buffer of that size, rather than calling
29345  * g_socket_get_available_bytes() first and then doing a receive of
29346  * exactly the right size.
29347  *
29348  * Returns: the number of bytes that can be read from the socket without blocking or truncating, or -1 on error.
29349  * Since: 2.32
29350  */
29351
29352
29353 /**
29354  * g_socket_get_blocking:
29355  * @socket: a #GSocket.
29356  *
29357  * Gets the blocking mode of the socket. For details on blocking I/O,
29358  * see g_socket_set_blocking().
29359  *
29360  * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29361  * Since: 2.22
29362  */
29363
29364
29365 /**
29366  * g_socket_get_broadcast:
29367  * @socket: a #GSocket.
29368  *
29369  * Gets the broadcast setting on @socket; if %TRUE,
29370  * it is possible to send packets to broadcast
29371  * addresses.
29372  *
29373  * Returns: the broadcast setting on @socket
29374  * Since: 2.32
29375  */
29376
29377
29378 /**
29379  * g_socket_get_credentials:
29380  * @socket: a #GSocket.
29381  * @error: #GError for error reporting, or %NULL to ignore.
29382  *
29383  * Returns the credentials of the foreign process connected to this
29384  * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29385  * sockets).
29386  *
29387  * If this operation isn't supported on the OS, the method fails with
29388  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29389  * by reading the %SO_PEERCRED option on the underlying socket.
29390  *
29391  * Other ways to obtain credentials from a foreign peer includes the
29392  * #GUnixCredentialsMessage type and
29393  * g_unix_connection_send_credentials() /
29394  * g_unix_connection_receive_credentials() functions.
29395  *
29396  * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29397  * Since: 2.26
29398  */
29399
29400
29401 /**
29402  * g_socket_get_family:
29403  * @socket: a #GSocket.
29404  *
29405  * Gets the socket family of the socket.
29406  *
29407  * Returns: a #GSocketFamily
29408  * Since: 2.22
29409  */
29410
29411
29412 /**
29413  * g_socket_get_fd:
29414  * @socket: a #GSocket.
29415  *
29416  * Returns the underlying OS socket object. On unix this
29417  * is a socket file descriptor, and on Windows this is
29418  * a Winsock2 SOCKET handle. This may be useful for
29419  * doing platform specific or otherwise unusual operations
29420  * on the socket.
29421  *
29422  * Returns: the file descriptor of the socket.
29423  * Since: 2.22
29424  */
29425
29426
29427 /**
29428  * g_socket_get_keepalive:
29429  * @socket: a #GSocket.
29430  *
29431  * Gets the keepalive mode of the socket. For details on this,
29432  * see g_socket_set_keepalive().
29433  *
29434  * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29435  * Since: 2.22
29436  */
29437
29438
29439 /**
29440  * g_socket_get_listen_backlog:
29441  * @socket: a #GSocket.
29442  *
29443  * Gets the listen backlog setting of the socket. For details on this,
29444  * see g_socket_set_listen_backlog().
29445  *
29446  * Returns: the maximum number of pending connections.
29447  * Since: 2.22
29448  */
29449
29450
29451 /**
29452  * g_socket_get_local_address:
29453  * @socket: a #GSocket.
29454  * @error: #GError for error reporting, or %NULL to ignore.
29455  *
29456  * Try to get the local address of a bound socket. This is only
29457  * useful if the socket has been bound to a local address,
29458  * either explicitly or implicitly when connecting.
29459  *
29460  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29461  * Since: 2.22
29462  */
29463
29464
29465 /**
29466  * g_socket_get_multicast_loopback:
29467  * @socket: a #GSocket.
29468  *
29469  * Gets the multicast loopback setting on @socket; if %TRUE (the
29470  * default), outgoing multicast packets will be looped back to
29471  * multicast listeners on the same host.
29472  *
29473  * Returns: the multicast loopback setting on @socket
29474  * Since: 2.32
29475  */
29476
29477
29478 /**
29479  * g_socket_get_multicast_ttl:
29480  * @socket: a #GSocket.
29481  *
29482  * Gets the multicast time-to-live setting on @socket; see
29483  * g_socket_set_multicast_ttl() for more details.
29484  *
29485  * Returns: the multicast time-to-live setting on @socket
29486  * Since: 2.32
29487  */
29488
29489
29490 /**
29491  * g_socket_get_option:
29492  * @socket: a #GSocket
29493  * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
29494  * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
29495  * @value: (out): return location for the option value
29496  * @error: #GError for error reporting, or %NULL to ignore.
29497  *
29498  * Gets the value of an integer-valued option on @socket, as with
29499  * <literal>getsockopt ()</literal>. (If you need to fetch a
29500  * non-integer-valued option, you will need to call
29501  * <literal>getsockopt ()</literal> directly.)
29502  *
29503  * The <link linkend="gio-gnetworking.h"><literal>&lt;gio/gnetworking.h&gt;</literal></link>
29504  * header pulls in system headers that will define most of the
29505  * standard/portable socket options. For unusual socket protocols or
29506  * platform-dependent options, you may need to include additional
29507  * headers.
29508  *
29509  * Note that even for socket options that are a single byte in size,
29510  * @value is still a pointer to a #gint variable, not a #guchar;
29511  * g_socket_get_option() will handle the conversion internally.
29512  *
29513  * Returns: success or failure. On failure, @error will be set, and the system error value (<literal>errno</literal> or <literal>WSAGetLastError ()</literal>) will still be set to the result of the <literal>getsockopt ()</literal> call.
29514  * Since: 2.36
29515  */
29516
29517
29518 /**
29519  * g_socket_get_protocol:
29520  * @socket: a #GSocket.
29521  *
29522  * Gets the socket protocol id the socket was created with.
29523  * In case the protocol is unknown, -1 is returned.
29524  *
29525  * Returns: a protocol id, or -1 if unknown
29526  * Since: 2.22
29527  */
29528
29529
29530 /**
29531  * g_socket_get_remote_address:
29532  * @socket: a #GSocket.
29533  * @error: #GError for error reporting, or %NULL to ignore.
29534  *
29535  * Try to get the remove address of a connected socket. This is only
29536  * useful for connection oriented sockets that have been connected.
29537  *
29538  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29539  * Since: 2.22
29540  */
29541
29542
29543 /**
29544  * g_socket_get_socket_type:
29545  * @socket: a #GSocket.
29546  *
29547  * Gets the socket type of the socket.
29548  *
29549  * Returns: a #GSocketType
29550  * Since: 2.22
29551  */
29552
29553
29554 /**
29555  * g_socket_get_timeout:
29556  * @socket: a #GSocket.
29557  *
29558  * Gets the timeout setting of the socket. For details on this, see
29559  * g_socket_set_timeout().
29560  *
29561  * Returns: the timeout in seconds
29562  * Since: 2.26
29563  */
29564
29565
29566 /**
29567  * g_socket_get_ttl:
29568  * @socket: a #GSocket.
29569  *
29570  * Gets the unicast time-to-live setting on @socket; see
29571  * g_socket_set_ttl() for more details.
29572  *
29573  * Returns: the time-to-live setting on @socket
29574  * Since: 2.32
29575  */
29576
29577
29578 /**
29579  * g_socket_is_closed:
29580  * @socket: a #GSocket
29581  *
29582  * Checks whether a socket is closed.
29583  *
29584  * Returns: %TRUE if socket is closed, %FALSE otherwise
29585  * Since: 2.22
29586  */
29587
29588
29589 /**
29590  * g_socket_is_connected:
29591  * @socket: a #GSocket.
29592  *
29593  * Check whether the socket is connected. This is only useful for
29594  * connection-oriented sockets.
29595  *
29596  * Returns: %TRUE if socket is connected, %FALSE otherwise.
29597  * Since: 2.22
29598  */
29599
29600
29601 /**
29602  * g_socket_join_multicast_group:
29603  * @socket: a #GSocket.
29604  * @group: a #GInetAddress specifying the group address to join.
29605  * @iface: (allow-none): Name of the interface to use, or %NULL
29606  * @source_specific: %TRUE if source-specific multicast should be used
29607  * @error: #GError for error reporting, or %NULL to ignore.
29608  *
29609  * Registers @socket to receive multicast messages sent to @group.
29610  * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29611  * been bound to an appropriate interface and port with
29612  * g_socket_bind().
29613  *
29614  * If @iface is %NULL, the system will automatically pick an interface
29615  * to bind to based on @group.
29616  *
29617  * If @source_specific is %TRUE, source-specific multicast as defined
29618  * in RFC 4604 is used. Note that on older platforms this may fail
29619  * with a %G_IO_ERROR_NOT_SUPPORTED error.
29620  *
29621  * Returns: %TRUE on success, %FALSE on error.
29622  * Since: 2.32
29623  */
29624
29625
29626 /**
29627  * g_socket_leave_multicast_group:
29628  * @socket: a #GSocket.
29629  * @group: a #GInetAddress specifying the group address to leave.
29630  * @iface: (allow-none): Interface used
29631  * @source_specific: %TRUE if source-specific multicast was used
29632  * @error: #GError for error reporting, or %NULL to ignore.
29633  *
29634  * Removes @socket from the multicast group defined by @group, @iface,
29635  * and @source_specific (which must all have the same values they had
29636  * when you joined the group).
29637  *
29638  * @socket remains bound to its address and port, and can still receive
29639  * unicast messages after calling this.
29640  *
29641  * Returns: %TRUE on success, %FALSE on error.
29642  * Since: 2.32
29643  */
29644
29645
29646 /**
29647  * g_socket_listen:
29648  * @socket: a #GSocket.
29649  * @error: #GError for error reporting, or %NULL to ignore.
29650  *
29651  * Marks the socket as a server socket, i.e. a socket that is used
29652  * to accept incoming requests using g_socket_accept().
29653  *
29654  * Before calling this the socket must be bound to a local address using
29655  * g_socket_bind().
29656  *
29657  * To set the maximum amount of outstanding clients, use
29658  * g_socket_set_listen_backlog().
29659  *
29660  * Returns: %TRUE on success, %FALSE on error.
29661  * Since: 2.22
29662  */
29663
29664
29665 /**
29666  * g_socket_listener_accept:
29667  * @listener: a #GSocketListener
29668  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29669  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29670  * @error: #GError for error reporting, or %NULL to ignore.
29671  *
29672  * Blocks waiting for a client to connect to any of the sockets added
29673  * to the listener. Returns a #GSocketConnection for the socket that was
29674  * accepted.
29675  *
29676  * If @source_object is not %NULL it will be filled out with the source
29677  * object specified when the corresponding socket or address was added
29678  * to the listener.
29679  *
29680  * If @cancellable is not %NULL, then the operation can be cancelled by
29681  * triggering the cancellable object from another thread. If the operation
29682  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29683  *
29684  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29685  * Since: 2.22
29686  */
29687
29688
29689 /**
29690  * g_socket_listener_accept_async:
29691  * @listener: a #GSocketListener
29692  * @cancellable: (allow-none): a #GCancellable, or %NULL
29693  * @callback: (scope async): a #GAsyncReadyCallback
29694  * @user_data: (closure): user data for the callback
29695  *
29696  * This is the asynchronous version of g_socket_listener_accept().
29697  *
29698  * When the operation is finished @callback will be
29699  * called. You can then call g_socket_listener_accept_socket()
29700  * to get the result of the operation.
29701  *
29702  * Since: 2.22
29703  */
29704
29705
29706 /**
29707  * g_socket_listener_accept_finish:
29708  * @listener: a #GSocketListener
29709  * @result: a #GAsyncResult.
29710  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29711  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29712  *
29713  * Finishes an async accept operation. See g_socket_listener_accept_async()
29714  *
29715  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29716  * Since: 2.22
29717  */
29718
29719
29720 /**
29721  * g_socket_listener_accept_socket:
29722  * @listener: a #GSocketListener
29723  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29724  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29725  * @error: #GError for error reporting, or %NULL to ignore.
29726  *
29727  * Blocks waiting for a client to connect to any of the sockets added
29728  * to the listener. Returns the #GSocket that was accepted.
29729  *
29730  * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29731  * which is often the case, then you should use g_socket_listener_accept()
29732  * instead.
29733  *
29734  * If @source_object is not %NULL it will be filled out with the source
29735  * object specified when the corresponding socket or address was added
29736  * to the listener.
29737  *
29738  * If @cancellable is not %NULL, then the operation can be cancelled by
29739  * triggering the cancellable object from another thread. If the operation
29740  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29741  *
29742  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29743  * Since: 2.22
29744  */
29745
29746
29747 /**
29748  * g_socket_listener_accept_socket_async:
29749  * @listener: a #GSocketListener
29750  * @cancellable: (allow-none): a #GCancellable, or %NULL
29751  * @callback: (scope async): a #GAsyncReadyCallback
29752  * @user_data: (closure): user data for the callback
29753  *
29754  * This is the asynchronous version of g_socket_listener_accept_socket().
29755  *
29756  * When the operation is finished @callback will be
29757  * called. You can then call g_socket_listener_accept_socket_finish()
29758  * to get the result of the operation.
29759  *
29760  * Since: 2.22
29761  */
29762
29763
29764 /**
29765  * g_socket_listener_accept_socket_finish:
29766  * @listener: a #GSocketListener
29767  * @result: a #GAsyncResult.
29768  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29769  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29770  *
29771  * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29772  *
29773  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29774  * Since: 2.22
29775  */
29776
29777
29778 /**
29779  * g_socket_listener_add_address:
29780  * @listener: a #GSocketListener
29781  * @address: a #GSocketAddress
29782  * @type: a #GSocketType
29783  * @protocol: a #GSocketProtocol
29784  * @source_object: (allow-none): Optional #GObject identifying this source
29785  * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29786  * @error: #GError for error reporting, or %NULL to ignore.
29787  *
29788  * Creates a socket of type @type and protocol @protocol, binds
29789  * it to @address and adds it to the set of sockets we're accepting
29790  * sockets from.
29791  *
29792  * Note that adding an IPv6 address, depending on the platform,
29793  * may or may not result in a listener that also accepts IPv4
29794  * connections.  For more deterministic behavior, see
29795  * g_socket_listener_add_inet_port().
29796  *
29797  * @source_object will be passed out in the various calls
29798  * to accept to identify this particular source, which is
29799  * useful if you're listening on multiple addresses and do
29800  * different things depending on what address is connected to.
29801  *
29802  * If successful and @effective_address is non-%NULL then it will
29803  * be set to the address that the binding actually occurred at.  This
29804  * is helpful for determining the port number that was used for when
29805  * requesting a binding to port 0 (ie: "any port").  This address, if
29806  * requested, belongs to the caller and must be freed.
29807  *
29808  * Returns: %TRUE on success, %FALSE on error.
29809  * Since: 2.22
29810  */
29811
29812
29813 /**
29814  * g_socket_listener_add_any_inet_port:
29815  * @listener: a #GSocketListener
29816  * @source_object: (allow-none): Optional #GObject identifying this source
29817  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29818  *
29819  * Listens for TCP connections on any available port number for both
29820  * IPv6 and IPv4 (if each is available).
29821  *
29822  * This is useful if you need to have a socket for incoming connections
29823  * but don't care about the specific port number.
29824  *
29825  * @source_object will be passed out in the various calls
29826  * to accept to identify this particular source, which is
29827  * useful if you're listening on multiple addresses and do
29828  * different things depending on what address is connected to.
29829  *
29830  * Returns: the port number, or 0 in case of failure.
29831  * Since: 2.24
29832  */
29833
29834
29835 /**
29836  * g_socket_listener_add_inet_port:
29837  * @listener: a #GSocketListener
29838  * @port: an IP port number (non-zero)
29839  * @source_object: (allow-none): Optional #GObject identifying this source
29840  * @error: #GError for error reporting, or %NULL to ignore.
29841  *
29842  * Helper function for g_socket_listener_add_address() that
29843  * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29844  * supported) on the specified port on all interfaces.
29845  *
29846  * @source_object will be passed out in the various calls
29847  * to accept to identify this particular source, which is
29848  * useful if you're listening on multiple addresses and do
29849  * different things depending on what address is connected to.
29850  *
29851  * Returns: %TRUE on success, %FALSE on error.
29852  * Since: 2.22
29853  */
29854
29855
29856 /**
29857  * g_socket_listener_add_socket:
29858  * @listener: a #GSocketListener
29859  * @socket: a listening #GSocket
29860  * @source_object: (allow-none): Optional #GObject identifying this source
29861  * @error: #GError for error reporting, or %NULL to ignore.
29862  *
29863  * Adds @socket to the set of sockets that we try to accept
29864  * new clients from. The socket must be bound to a local
29865  * address and listened to.
29866  *
29867  * @source_object will be passed out in the various calls
29868  * to accept to identify this particular source, which is
29869  * useful if you're listening on multiple addresses and do
29870  * different things depending on what address is connected to.
29871  *
29872  * Returns: %TRUE on success, %FALSE on error.
29873  * Since: 2.22
29874  */
29875
29876
29877 /**
29878  * g_socket_listener_close:
29879  * @listener: a #GSocketListener
29880  *
29881  * Closes all the sockets in the listener.
29882  *
29883  * Since: 2.22
29884  */
29885
29886
29887 /**
29888  * g_socket_listener_new:
29889  *
29890  * Creates a new #GSocketListener with no sockets to listen for.
29891  * New listeners can be added with e.g. g_socket_listener_add_address()
29892  * or g_socket_listener_add_inet_port().
29893  *
29894  * Returns: a new #GSocketListener.
29895  * Since: 2.22
29896  */
29897
29898
29899 /**
29900  * g_socket_listener_set_backlog:
29901  * @listener: a #GSocketListener
29902  * @listen_backlog: an integer
29903  *
29904  * Sets the listen backlog on the sockets in the listener.
29905  *
29906  * See g_socket_set_listen_backlog() for details
29907  *
29908  * Since: 2.22
29909  */
29910
29911
29912 /**
29913  * g_socket_new:
29914  * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29915  * @type: the socket type to use.
29916  * @protocol: the id of the protocol to use, or 0 for default.
29917  * @error: #GError for error reporting, or %NULL to ignore.
29918  *
29919  * Creates a new #GSocket with the defined family, type and protocol.
29920  * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29921  * for the family and type is used.
29922  *
29923  * The @protocol is a family and type specific int that specifies what
29924  * kind of protocol to use. #GSocketProtocol lists several common ones.
29925  * Many families only support one protocol, and use 0 for this, others
29926  * support several and using 0 means to use the default protocol for
29927  * the family and type.
29928  *
29929  * The protocol id is passed directly to the operating
29930  * system, so you can use protocols not listed in #GSocketProtocol if you
29931  * know the protocol number used for it.
29932  *
29933  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29934  * Since: 2.22
29935  */
29936
29937
29938 /**
29939  * g_socket_new_from_fd:
29940  * @fd: a native socket file descriptor.
29941  * @error: #GError for error reporting, or %NULL to ignore.
29942  *
29943  * Creates a new #GSocket from a native file descriptor
29944  * or winsock SOCKET handle.
29945  *
29946  * This reads all the settings from the file descriptor so that
29947  * all properties should work. Note that the file descriptor
29948  * will be set to non-blocking mode, independent on the blocking
29949  * mode of the #GSocket.
29950  *
29951  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29952  * Since: 2.22
29953  */
29954
29955
29956 /**
29957  * g_socket_receive:
29958  * @socket: a #GSocket
29959  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29960  * @size: the number of bytes you want to read from the socket
29961  * @cancellable: (allow-none): a %GCancellable or %NULL
29962  * @error: #GError for error reporting, or %NULL to ignore.
29963  *
29964  * Receive data (up to @size bytes) from a socket. This is mainly used by
29965  * connection-oriented sockets; it is identical to g_socket_receive_from()
29966  * with @address set to %NULL.
29967  *
29968  * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29969  * g_socket_receive() will always read either 0 or 1 complete messages from
29970  * the socket. If the received message is too large to fit in @buffer, then
29971  * the data beyond @size bytes will be discarded, without any explicit
29972  * indication that this has occurred.
29973  *
29974  * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29975  * number of bytes, up to @size. If more than @size bytes have been
29976  * received, the additional data will be returned in future calls to
29977  * g_socket_receive().
29978  *
29979  * If the socket is in blocking mode the call will block until there
29980  * is some data to receive, the connection is closed, or there is an
29981  * error. If there is no data available and the socket is in
29982  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29983  * returned. To be notified when data is available, wait for the
29984  * %G_IO_IN condition.
29985  *
29986  * On error -1 is returned and @error is set accordingly.
29987  *
29988  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29989  * Since: 2.22
29990  */
29991
29992
29993 /**
29994  * g_socket_receive_from:
29995  * @socket: a #GSocket
29996  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29997  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29998  * @size: the number of bytes you want to read from the socket
29999  * @cancellable: (allow-none): a %GCancellable or %NULL
30000  * @error: #GError for error reporting, or %NULL to ignore.
30001  *
30002  * Receive data (up to @size bytes) from a socket.
30003  *
30004  * If @address is non-%NULL then @address will be set equal to the
30005  * source address of the received packet.
30006  * @address is owned by the caller.
30007  *
30008  * See g_socket_receive() for additional information.
30009  *
30010  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30011  * Since: 2.22
30012  */
30013
30014
30015 /**
30016  * g_socket_receive_message:
30017  * @socket: a #GSocket
30018  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30019  * @vectors: (array length=num_vectors): an array of #GInputVector structs
30020  * @num_vectors: the number of elements in @vectors, or -1
30021  * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
30022  * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
30023  * @flags: a pointer to an int containing #GSocketMsgFlags flags
30024  * @cancellable: (allow-none): a %GCancellable or %NULL
30025  * @error: a #GError pointer, or %NULL
30026  *
30027  * Receive data from a socket.  This is the most complicated and
30028  * fully-featured version of this call. For easier use, see
30029  * g_socket_receive() and g_socket_receive_from().
30030  *
30031  * If @address is non-%NULL then @address will be set equal to the
30032  * source address of the received packet.
30033  * @address is owned by the caller.
30034  *
30035  * @vector must point to an array of #GInputVector structs and
30036  * @num_vectors must be the length of this array.  These structs
30037  * describe the buffers that received data will be scattered into.
30038  * If @num_vectors is -1, then @vectors is assumed to be terminated
30039  * by a #GInputVector with a %NULL buffer pointer.
30040  *
30041  * As a special case, if @num_vectors is 0 (in which case, @vectors
30042  * may of course be %NULL), then a single byte is received and
30043  * discarded. This is to facilitate the common practice of sending a
30044  * single '\0' byte for the purposes of transferring ancillary data.
30045  *
30046  * @messages, if non-%NULL, will be set to point to a newly-allocated
30047  * array of #GSocketControlMessage instances or %NULL if no such
30048  * messages was received. These correspond to the control messages
30049  * received from the kernel, one #GSocketControlMessage per message
30050  * from the kernel. This array is %NULL-terminated and must be freed
30051  * by the caller using g_free() after calling g_object_unref() on each
30052  * element. If @messages is %NULL, any control messages received will
30053  * be discarded.
30054  *
30055  * @num_messages, if non-%NULL, will be set to the number of control
30056  * messages received.
30057  *
30058  * If both @messages and @num_messages are non-%NULL, then
30059  * @num_messages gives the number of #GSocketControlMessage instances
30060  * in @messages (ie: not including the %NULL terminator).
30061  *
30062  * @flags is an in/out parameter. The commonly available arguments
30063  * for this are available in the #GSocketMsgFlags enum, but the
30064  * values there are the same as the system values, and the flags
30065  * are passed in as-is, so you can pass in system-specific flags too
30066  * (and g_socket_receive_message() may pass system-specific flags out).
30067  *
30068  * As with g_socket_receive(), data may be discarded if @socket is
30069  * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
30070  * provide enough buffer space to read a complete message. You can pass
30071  * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
30072  * removing it from the receive queue, but there is no portable way to find
30073  * out the length of the message other than by reading it into a
30074  * sufficiently-large buffer.
30075  *
30076  * If the socket is in blocking mode the call will block until there
30077  * is some data to receive, the connection is closed, or there is an
30078  * error. If there is no data available and the socket is in
30079  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30080  * returned. To be notified when data is available, wait for the
30081  * %G_IO_IN condition.
30082  *
30083  * On error -1 is returned and @error is set accordingly.
30084  *
30085  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30086  * Since: 2.22
30087  */
30088
30089
30090 /**
30091  * g_socket_receive_with_blocking:
30092  * @socket: a #GSocket
30093  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
30094  * @size: the number of bytes you want to read from the socket
30095  * @blocking: whether to do blocking or non-blocking I/O
30096  * @cancellable: (allow-none): a %GCancellable or %NULL
30097  * @error: #GError for error reporting, or %NULL to ignore.
30098  *
30099  * This behaves exactly the same as g_socket_receive(), except that
30100  * the choice of blocking or non-blocking behavior is determined by
30101  * the @blocking argument rather than by @socket's properties.
30102  *
30103  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30104  * Since: 2.26
30105  */
30106
30107
30108 /**
30109  * g_socket_send:
30110  * @socket: a #GSocket
30111  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30112  * @size: the number of bytes to send
30113  * @cancellable: (allow-none): a %GCancellable or %NULL
30114  * @error: #GError for error reporting, or %NULL to ignore.
30115  *
30116  * Tries to send @size bytes from @buffer on the socket. This is
30117  * mainly used by connection-oriented sockets; it is identical to
30118  * g_socket_send_to() with @address set to %NULL.
30119  *
30120  * If the socket is in blocking mode the call will block until there is
30121  * space for the data in the socket queue. If there is no space available
30122  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30123  * will be returned. To be notified when space is available, wait for the
30124  * %G_IO_OUT condition. Note though that you may still receive
30125  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30126  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30127  * very common due to the way the underlying APIs work.)
30128  *
30129  * On error -1 is returned and @error is set accordingly.
30130  *
30131  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30132  * Since: 2.22
30133  */
30134
30135
30136 /**
30137  * g_socket_send_message:
30138  * @socket: a #GSocket
30139  * @address: (allow-none): a #GSocketAddress, or %NULL
30140  * @vectors: (array length=num_vectors): an array of #GOutputVector structs
30141  * @num_vectors: the number of elements in @vectors, or -1
30142  * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
30143  * @num_messages: number of elements in @messages, or -1.
30144  * @flags: an int containing #GSocketMsgFlags flags
30145  * @cancellable: (allow-none): a %GCancellable or %NULL
30146  * @error: #GError for error reporting, or %NULL to ignore.
30147  *
30148  * Send data to @address on @socket.  This is the most complicated and
30149  * fully-featured version of this call. For easier use, see
30150  * g_socket_send() and g_socket_send_to().
30151  *
30152  * If @address is %NULL then the message is sent to the default receiver
30153  * (set by g_socket_connect()).
30154  *
30155  * @vectors must point to an array of #GOutputVector structs and
30156  * @num_vectors must be the length of this array. (If @num_vectors is -1,
30157  * then @vectors is assumed to be terminated by a #GOutputVector with a
30158  * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
30159  * that the sent data will be gathered from. Using multiple
30160  * #GOutputVector<!-- -->s is more memory-efficient than manually copying
30161  * data from multiple sources into a single buffer, and more
30162  * network-efficient than making multiple calls to g_socket_send().
30163  *
30164  * @messages, if non-%NULL, is taken to point to an array of @num_messages
30165  * #GSocketControlMessage instances. These correspond to the control
30166  * messages to be sent on the socket.
30167  * If @num_messages is -1 then @messages is treated as a %NULL-terminated
30168  * array.
30169  *
30170  * @flags modify how the message is sent. The commonly available arguments
30171  * for this are available in the #GSocketMsgFlags enum, but the
30172  * values there are the same as the system values, and the flags
30173  * are passed in as-is, so you can pass in system-specific flags too.
30174  *
30175  * If the socket is in blocking mode the call will block until there is
30176  * space for the data in the socket queue. If there is no space available
30177  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30178  * will be returned. To be notified when space is available, wait for the
30179  * %G_IO_OUT condition. Note though that you may still receive
30180  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30181  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30182  * very common due to the way the underlying APIs work.)
30183  *
30184  * On error -1 is returned and @error is set accordingly.
30185  *
30186  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30187  * Since: 2.22
30188  */
30189
30190
30191 /**
30192  * g_socket_send_to:
30193  * @socket: a #GSocket
30194  * @address: (allow-none): a #GSocketAddress, or %NULL
30195  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30196  * @size: the number of bytes to send
30197  * @cancellable: (allow-none): a %GCancellable or %NULL
30198  * @error: #GError for error reporting, or %NULL to ignore.
30199  *
30200  * Tries to send @size bytes from @buffer to @address. If @address is
30201  * %NULL then the message is sent to the default receiver (set by
30202  * g_socket_connect()).
30203  *
30204  * See g_socket_send() for additional information.
30205  *
30206  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30207  * Since: 2.22
30208  */
30209
30210
30211 /**
30212  * g_socket_send_with_blocking:
30213  * @socket: a #GSocket
30214  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30215  * @size: the number of bytes to send
30216  * @blocking: whether to do blocking or non-blocking I/O
30217  * @cancellable: (allow-none): a %GCancellable or %NULL
30218  * @error: #GError for error reporting, or %NULL to ignore.
30219  *
30220  * This behaves exactly the same as g_socket_send(), except that
30221  * the choice of blocking or non-blocking behavior is determined by
30222  * the @blocking argument rather than by @socket's properties.
30223  *
30224  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30225  * Since: 2.26
30226  */
30227
30228
30229 /**
30230  * g_socket_service_is_active:
30231  * @service: a #GSocketService
30232  *
30233  * Check whether the service is active or not. An active
30234  * service will accept new clients that connect, while
30235  * a non-active service will let connecting clients queue
30236  * up until the service is started.
30237  *
30238  * Returns: %TRUE if the service is active, %FALSE otherwise
30239  * Since: 2.22
30240  */
30241
30242
30243 /**
30244  * g_socket_service_new:
30245  *
30246  * Creates a new #GSocketService with no sockets to listen for.
30247  * New listeners can be added with e.g. g_socket_listener_add_address()
30248  * or g_socket_listener_add_inet_port().
30249  *
30250  * Returns: a new #GSocketService.
30251  * Since: 2.22
30252  */
30253
30254
30255 /**
30256  * g_socket_service_start:
30257  * @service: a #GSocketService
30258  *
30259  * Starts the service, i.e. start accepting connections
30260  * from the added sockets when the mainloop runs.
30261  *
30262  * This call is thread-safe, so it may be called from a thread
30263  * handling an incoming client request.
30264  *
30265  * Since: 2.22
30266  */
30267
30268
30269 /**
30270  * g_socket_service_stop:
30271  * @service: a #GSocketService
30272  *
30273  * Stops the service, i.e. stops accepting connections
30274  * from the added sockets when the mainloop runs.
30275  *
30276  * This call is thread-safe, so it may be called from a thread
30277  * handling an incoming client request.
30278  *
30279  * Since: 2.22
30280  */
30281
30282
30283 /**
30284  * g_socket_set_blocking:
30285  * @socket: a #GSocket.
30286  * @blocking: Whether to use blocking I/O or not.
30287  *
30288  * Sets the blocking mode of the socket. In blocking mode
30289  * all operations block until they succeed or there is an error. In
30290  * non-blocking mode all functions return results immediately or
30291  * with a %G_IO_ERROR_WOULD_BLOCK error.
30292  *
30293  * All sockets are created in blocking mode. However, note that the
30294  * platform level socket is always non-blocking, and blocking mode
30295  * is a GSocket level feature.
30296  *
30297  * Since: 2.22
30298  */
30299
30300
30301 /**
30302  * g_socket_set_broadcast:
30303  * @socket: a #GSocket.
30304  * @broadcast: whether @socket should allow sending to broadcast addresses
30305  *
30306  * Sets whether @socket should allow sending to broadcast addresses.
30307  * This is %FALSE by default.
30308  *
30309  * Since: 2.32
30310  */
30311
30312
30313 /**
30314  * g_socket_set_keepalive:
30315  * @socket: a #GSocket.
30316  * @keepalive: Value for the keepalive flag
30317  *
30318  * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
30319  * this flag is set on a socket, the system will attempt to verify that the
30320  * remote socket endpoint is still present if a sufficiently long period of
30321  * time passes with no data being exchanged. If the system is unable to
30322  * verify the presence of the remote endpoint, it will automatically close
30323  * the connection.
30324  *
30325  * This option is only functional on certain kinds of sockets. (Notably,
30326  * %G_SOCKET_PROTOCOL_TCP sockets.)
30327  *
30328  * The exact time between pings is system- and protocol-dependent, but will
30329  * normally be at least two hours. Most commonly, you would set this flag
30330  * on a server socket if you want to allow clients to remain idle for long
30331  * periods of time, but also want to ensure that connections are eventually
30332  * garbage-collected if clients crash or become unreachable.
30333  *
30334  * Since: 2.22
30335  */
30336
30337
30338 /**
30339  * g_socket_set_listen_backlog:
30340  * @socket: a #GSocket.
30341  * @backlog: the maximum number of pending connections.
30342  *
30343  * Sets the maximum number of outstanding connections allowed
30344  * when listening on this socket. If more clients than this are
30345  * connecting to the socket and the application is not handling them
30346  * on time then the new connections will be refused.
30347  *
30348  * Note that this must be called before g_socket_listen() and has no
30349  * effect if called after that.
30350  *
30351  * Since: 2.22
30352  */
30353
30354
30355 /**
30356  * g_socket_set_multicast_loopback:
30357  * @socket: a #GSocket.
30358  * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
30359  *
30360  * Sets whether outgoing multicast packets will be received by sockets
30361  * listening on that multicast address on the same host. This is %TRUE
30362  * by default.
30363  *
30364  * Since: 2.32
30365  */
30366
30367
30368 /**
30369  * g_socket_set_multicast_ttl:
30370  * @socket: a #GSocket.
30371  * @ttl: the time-to-live value for all multicast datagrams on @socket
30372  *
30373  * Sets the time-to-live for outgoing multicast datagrams on @socket.
30374  * By default, this is 1, meaning that multicast packets will not leave
30375  * the local network.
30376  *
30377  * Since: 2.32
30378  */
30379
30380
30381 /**
30382  * g_socket_set_option:
30383  * @socket: a #GSocket
30384  * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
30385  * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
30386  * @value: the value to set the option to
30387  * @error: #GError for error reporting, or %NULL to ignore.
30388  *
30389  * Sets the value of an integer-valued option on @socket, as with
30390  * <literal>setsockopt ()</literal>. (If you need to set a
30391  * non-integer-valued option, you will need to call
30392  * <literal>setsockopt ()</literal> directly.)
30393  *
30394  * The <link linkend="gio-gnetworking.h"><literal>&lt;gio/gnetworking.h&gt;</literal></link>
30395  * header pulls in system headers that will define most of the
30396  * standard/portable socket options. For unusual socket protocols or
30397  * platform-dependent options, you may need to include additional
30398  * headers.
30399  *
30400  * Returns: success or failure. On failure, @error will be set, and the system error value (<literal>errno</literal> or <literal>WSAGetLastError ()</literal>) will still be set to the result of the <literal>setsockopt ()</literal> call.
30401  * Since: 2.36
30402  */
30403
30404
30405 /**
30406  * g_socket_set_timeout:
30407  * @socket: a #GSocket.
30408  * @timeout: the timeout for @socket, in seconds, or 0 for none
30409  *
30410  * Sets the time in seconds after which I/O operations on @socket will
30411  * time out if they have not yet completed.
30412  *
30413  * On a blocking socket, this means that any blocking #GSocket
30414  * operation will time out after @timeout seconds of inactivity,
30415  * returning %G_IO_ERROR_TIMED_OUT.
30416  *
30417  * On a non-blocking socket, calls to g_socket_condition_wait() will
30418  * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30419  * created with g_socket_create_source() will trigger after
30420  * @timeout seconds of inactivity, with the requested condition
30421  * set, at which point calling g_socket_receive(), g_socket_send(),
30422  * g_socket_check_connect_result(), etc, will fail with
30423  * %G_IO_ERROR_TIMED_OUT.
30424  *
30425  * If @timeout is 0 (the default), operations will never time out
30426  * on their own.
30427  *
30428  * Note that if an I/O operation is interrupted by a signal, this may
30429  * cause the timeout to be reset.
30430  *
30431  * Since: 2.26
30432  */
30433
30434
30435 /**
30436  * g_socket_set_ttl:
30437  * @socket: a #GSocket.
30438  * @ttl: the time-to-live value for all unicast packets on @socket
30439  *
30440  * Sets the time-to-live for outgoing unicast packets on @socket.
30441  * By default the platform-specific default value is used.
30442  *
30443  * Since: 2.32
30444  */
30445
30446
30447 /**
30448  * g_socket_shutdown:
30449  * @socket: a #GSocket
30450  * @shutdown_read: whether to shut down the read side
30451  * @shutdown_write: whether to shut down the write side
30452  * @error: #GError for error reporting, or %NULL to ignore.
30453  *
30454  * Shut down part of a full-duplex connection.
30455  *
30456  * If @shutdown_read is %TRUE then the receiving side of the connection
30457  * is shut down, and further reading is disallowed.
30458  *
30459  * If @shutdown_write is %TRUE then the sending side of the connection
30460  * is shut down, and further writing is disallowed.
30461  *
30462  * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30463  *
30464  * One example where this is used is graceful disconnect for TCP connections
30465  * where you close the sending side, then wait for the other side to close
30466  * the connection, thus ensuring that the other side saw all sent data.
30467  *
30468  * Returns: %TRUE on success, %FALSE on error
30469  * Since: 2.22
30470  */
30471
30472
30473 /**
30474  * g_socket_speaks_ipv4:
30475  * @socket: a #GSocket
30476  *
30477  * Checks if a socket is capable of speaking IPv4.
30478  *
30479  * IPv4 sockets are capable of speaking IPv4.  On some operating systems
30480  * and under some combinations of circumstances IPv6 sockets are also
30481  * capable of speaking IPv4.  See RFC 3493 section 3.7 for more
30482  * information.
30483  *
30484  * No other types of sockets are currently considered as being capable
30485  * of speaking IPv4.
30486  *
30487  * Returns: %TRUE if this socket can be used with IPv4.
30488  * Since: 2.22
30489  */
30490
30491
30492 /**
30493  * g_srv_target_copy:
30494  * @target: a #GSrvTarget
30495  *
30496  * Copies @target
30497  *
30498  * Returns: a copy of @target
30499  * Since: 2.22
30500  */
30501
30502
30503 /**
30504  * g_srv_target_free:
30505  * @target: a #GSrvTarget
30506  *
30507  * Frees @target
30508  *
30509  * Since: 2.22
30510  */
30511
30512
30513 /**
30514  * g_srv_target_get_hostname:
30515  * @target: a #GSrvTarget
30516  *
30517  * Gets @target's hostname (in ASCII form; if you are going to present
30518  * this to the user, you should use g_hostname_is_ascii_encoded() to
30519  * check if it contains encoded Unicode segments, and use
30520  * g_hostname_to_unicode() to convert it if it does.)
30521  *
30522  * Returns: @target's hostname
30523  * Since: 2.22
30524  */
30525
30526
30527 /**
30528  * g_srv_target_get_port:
30529  * @target: a #GSrvTarget
30530  *
30531  * Gets @target's port
30532  *
30533  * Returns: @target's port
30534  * Since: 2.22
30535  */
30536
30537
30538 /**
30539  * g_srv_target_get_priority:
30540  * @target: a #GSrvTarget
30541  *
30542  * Gets @target's priority. You should not need to look at this;
30543  * #GResolver already sorts the targets according to the algorithm in
30544  * RFC 2782.
30545  *
30546  * Returns: @target's priority
30547  * Since: 2.22
30548  */
30549
30550
30551 /**
30552  * g_srv_target_get_weight:
30553  * @target: a #GSrvTarget
30554  *
30555  * Gets @target's weight. You should not need to look at this;
30556  * #GResolver already sorts the targets according to the algorithm in
30557  * RFC 2782.
30558  *
30559  * Returns: @target's weight
30560  * Since: 2.22
30561  */
30562
30563
30564 /**
30565  * g_srv_target_list_sort: (skip)
30566  * @targets: a #GList of #GSrvTarget
30567  *
30568  * Sorts @targets in place according to the algorithm in RFC 2782.
30569  *
30570  * Returns: (transfer full): the head of the sorted list.
30571  * Since: 2.22
30572  */
30573
30574
30575 /**
30576  * g_srv_target_new:
30577  * @hostname: the host that the service is running on
30578  * @port: the port that the service is running on
30579  * @priority: the target's priority
30580  * @weight: the target's weight
30581  *
30582  * Creates a new #GSrvTarget with the given parameters.
30583  *
30584  * You should not need to use this; normally #GSrvTarget<!-- -->s are
30585  * created by #GResolver.
30586  *
30587  * Returns: a new #GSrvTarget.
30588  * Since: 2.22
30589  */
30590
30591
30592 /**
30593  * g_static_resource_fini:
30594  * @static_resource: pointer to a static #GStaticResource
30595  *
30596  * Finalized a GResource initialized by g_static_resource_init().
30597  *
30598  * This is normally used by code generated by
30599  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30600  * and is not typically used by other code.
30601  *
30602  * Since: 2.32
30603  */
30604
30605
30606 /**
30607  * g_static_resource_get_resource:
30608  * @static_resource: pointer to a static #GStaticResource
30609  *
30610  * Gets the GResource that was registered by a call to g_static_resource_init().
30611  *
30612  * This is normally used by code generated by
30613  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30614  * and is not typically used by other code.
30615  *
30616  * Returns: (transfer none): a #GResource
30617  * Since: 2.32
30618  */
30619
30620
30621 /**
30622  * g_static_resource_init:
30623  * @static_resource: pointer to a static #GStaticResource
30624  *
30625  * Initializes a GResource from static data using a
30626  * GStaticResource.
30627  *
30628  * This is normally used by code generated by
30629  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30630  * and is not typically used by other code.
30631  *
30632  * Since: 2.32
30633  */
30634
30635
30636 /**
30637  * g_task_attach_source:
30638  * @task: a #GTask
30639  * @source: the source to attach
30640  * @callback: the callback to invoke when @source triggers
30641  *
30642  * A utility function for dealing with async operations where you need
30643  * to wait for a #GSource to trigger. Attaches @source to @task's
30644  * #GMainContext with @task's <link
30645  * linkend="io-priority">priority</link>, and sets @source's callback
30646  * to @callback, with @task as the callback's
30647  * <literal>user_data</literal>.
30648  *
30649  * This takes a reference on @task until @source is destroyed.
30650  *
30651  * Since: 2.36
30652  */
30653
30654
30655 /**
30656  * g_task_get_cancellable:
30657  * @task: a #GTask
30658  *
30659  * Gets @task's #GCancellable
30660  *
30661  * Returns: (transfer none): @task's #GCancellable
30662  * Since: 2.36
30663  */
30664
30665
30666 /**
30667  * g_task_get_check_cancellable:
30668  * @task: the #GTask
30669  *
30670  * Gets @task's check-cancellable flag. See
30671  * g_task_set_check_cancellable() for more details.
30672  *
30673  * Since: 2.36
30674  */
30675
30676
30677 /**
30678  * g_task_get_context:
30679  * @task: a #GTask
30680  *
30681  * Gets the #GMainContext that @task will return its result in (that
30682  * is, the context that was the <link
30683  * linkend="g-main-context-push-thread-default">thread-default main
30684  * context</link> at the point when @task was created).
30685  *
30686  * This will always return a non-%NULL value, even if the task's
30687  * context is the default #GMainContext.
30688  *
30689  * Returns: (transfer none): @task's #GMainContext
30690  * Since: 2.36
30691  */
30692
30693
30694 /**
30695  * g_task_get_priority:
30696  * @task: a #GTask
30697  *
30698  * Gets @task's priority
30699  *
30700  * Returns: @task's priority
30701  * Since: 2.36
30702  */
30703
30704
30705 /**
30706  * g_task_get_return_on_cancel:
30707  * @task: the #GTask
30708  *
30709  * Gets @task's return-on-cancel flag. See
30710  * g_task_set_return_on_cancel() for more details.
30711  *
30712  * Since: 2.36
30713  */
30714
30715
30716 /**
30717  * g_task_get_source_object:
30718  * @task: a #GTask
30719  *
30720  * Gets the source object from @task. Like
30721  * g_async_result_get_source_object(), but does not ref the object.
30722  *
30723  * Returns: (transfer none) (type GObject): @task's source object, or %NULL
30724  * Since: 2.36
30725  */
30726
30727
30728 /**
30729  * g_task_get_source_tag:
30730  * @task: a #GTask
30731  *
30732  * Gets @task's source tag. See g_task_set_source_tag().
30733  *
30734  * Returns: (transfer none): @task's source tag
30735  * Since: 2.36
30736  */
30737
30738
30739 /**
30740  * g_task_get_task_data:
30741  * @task: a #GTask
30742  *
30743  * Gets @task's <literal>task_data</literal>.
30744  *
30745  * Returns: (transfer none): @task's <literal>task_data</literal>.
30746  * Since: 2.36
30747  */
30748
30749
30750 /**
30751  * g_task_had_error:
30752  * @task: a #GTask.
30753  *
30754  * Tests if @task resulted in an error.
30755  *
30756  * Returns: %TRUE if the task resulted in an error, %FALSE otherwise.
30757  * Since: 2.36
30758  */
30759
30760
30761 /**
30762  * g_task_is_valid:
30763  * @result: (type Gio.AsyncResult): A #GAsyncResult
30764  * @source_object: (allow-none) (type GObject): the source object expected to be associated with the task
30765  *
30766  * Checks that @result is a #GTask, and that @source_object is its
30767  * source object (or that @source_object is %NULL and @result has no
30768  * source object). This can be used in g_return_if_fail() checks.
30769  *
30770  * Returns: %TRUE if @result and @source_object are valid, %FALSE if not
30771  * Since: 2.36
30772  */
30773
30774
30775 /**
30776  * g_task_new:
30777  * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30778  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30779  * @callback: (scope async): a #GAsyncReadyCallback.
30780  * @callback_data: (closure): user data passed to @callback.
30781  *
30782  * Creates a #GTask acting on @source_object, which will eventually be
30783  * used to invoke @callback in the current <link
30784  * linkend="g-main-context-push-thread-default">thread-default main
30785  * context</link>.
30786  *
30787  * Call this in the "start" method of your asynchronous method, and
30788  * pass the #GTask around throughout the asynchronous operation. You
30789  * can use g_task_set_task_data() to attach task-specific data to the
30790  * object, which you can retrieve later via g_task_get_task_data().
30791  *
30792  * By default, if @cancellable is cancelled, then the return value of
30793  * the task will always be %G_IO_ERROR_CANCELLED, even if the task had
30794  * already completed before the cancellation. This allows for
30795  * simplified handling in cases where cancellation may imply that
30796  * other objects that the task depends on have been destroyed. If you
30797  * do not want this behavior, you can use
30798  * g_task_set_check_cancellable() to change it.
30799  *
30800  * Returns: a #GTask.
30801  * Since: 2.36
30802  */
30803
30804
30805 /**
30806  * g_task_propagate_boolean:
30807  * @task: a #GTask.
30808  * @error: return location for a #GError
30809  *
30810  * Gets the result of @task as a #gboolean.
30811  *
30812  * If the task resulted in an error, or was cancelled, then this will
30813  * instead return %FALSE and set @error.
30814  *
30815  * Since this method transfers ownership of the return value (or
30816  * error) to the caller, you may only call it once.
30817  *
30818  * Returns: the task result, or %FALSE on error
30819  * Since: 2.36
30820  */
30821
30822
30823 /**
30824  * g_task_propagate_int:
30825  * @task: a #GTask.
30826  * @error: return location for a #GError
30827  *
30828  * Gets the result of @task as an integer (#gssize).
30829  *
30830  * If the task resulted in an error, or was cancelled, then this will
30831  * instead return -1 and set @error.
30832  *
30833  * Since this method transfers ownership of the return value (or
30834  * error) to the caller, you may only call it once.
30835  *
30836  * Returns: the task result, or -1 on error
30837  * Since: 2.36
30838  */
30839
30840
30841 /**
30842  * g_task_propagate_pointer:
30843  * @task: a #GTask
30844  * @error: return location for a #GError
30845  *
30846  * Gets the result of @task as a pointer, and transfers ownership
30847  * of that value to the caller.
30848  *
30849  * If the task resulted in an error, or was cancelled, then this will
30850  * instead return %NULL and set @error.
30851  *
30852  * Since this method transfers ownership of the return value (or
30853  * error) to the caller, you may only call it once.
30854  *
30855  * Returns: (transfer full): the task result, or %NULL on error
30856  * Since: 2.36
30857  */
30858
30859
30860 /**
30861  * g_task_report_error:
30862  * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30863  * @callback: (scope async): a #GAsyncReadyCallback.
30864  * @callback_data: (closure): user data passed to @callback.
30865  * @source_tag: an opaque pointer indicating the source of this task
30866  * @error: (transfer full): error to report
30867  *
30868  * Creates a #GTask and then immediately calls g_task_return_error()
30869  * on it. Use this in the wrapper function of an asynchronous method
30870  * when you want to avoid even calling the virtual method. You can
30871  * then use g_async_result_is_tagged() in the finish method wrapper to
30872  * check if the result there is tagged as having been created by the
30873  * wrapper method, and deal with it appropriately if so.
30874  *
30875  * See also g_task_report_new_error().
30876  *
30877  * Since: 2.36
30878  */
30879
30880
30881 /**
30882  * g_task_report_new_error:
30883  * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30884  * @callback: (scope async): a #GAsyncReadyCallback.
30885  * @callback_data: (closure): user data passed to @callback.
30886  * @source_tag: an opaque pointer indicating the source of this task
30887  * @domain: a #GQuark.
30888  * @code: an error code.
30889  * @format: a string with format characters.
30890  * @...: a list of values to insert into @format.
30891  *
30892  * Creates a #GTask and then immediately calls
30893  * g_task_return_new_error() on it. Use this in the wrapper function
30894  * of an asynchronous method when you want to avoid even calling the
30895  * virtual method. You can then use g_async_result_is_tagged() in the
30896  * finish method wrapper to check if the result there is tagged as
30897  * having been created by the wrapper method, and deal with it
30898  * appropriately if so.
30899  *
30900  * See also g_task_report_error().
30901  *
30902  * Since: 2.36
30903  */
30904
30905
30906 /**
30907  * g_task_return_boolean:
30908  * @task: a #GTask.
30909  * @result: the #gboolean result of a task function.
30910  *
30911  * Sets @task's result to @result and completes the task (see
30912  * g_task_return_pointer() for more discussion of exactly what this
30913  * means).
30914  *
30915  * Since: 2.36
30916  */
30917
30918
30919 /**
30920  * g_task_return_error:
30921  * @task: a #GTask.
30922  * @error: (transfer full): the #GError result of a task function.
30923  *
30924  * Sets @task's result to @error (which @task assumes ownership of)
30925  * and completes the task (see g_task_return_pointer() for more
30926  * discussion of exactly what this means).
30927  *
30928  * Note that since the task takes ownership of @error, and since the
30929  * task may be completed before returning from g_task_return_error(),
30930  * you cannot assume that @error is still valid after calling this.
30931  * Call g_error_copy() on the error if you need to keep a local copy
30932  * as well.
30933  *
30934  * See also g_task_return_new_error().
30935  *
30936  * Since: 2.36
30937  */
30938
30939
30940 /**
30941  * g_task_return_error_if_cancelled:
30942  * @task: a #GTask
30943  *
30944  * Checks if @task's #GCancellable has been cancelled, and if so, sets
30945  * @task's error accordingly and completes the task (see
30946  * g_task_return_pointer() for more discussion of exactly what this
30947  * means).
30948  *
30949  * Returns: %TRUE if @task has been cancelled, %FALSE if not
30950  * Since: 2.36
30951  */
30952
30953
30954 /**
30955  * g_task_return_int:
30956  * @task: a #GTask.
30957  * @result: the integer (#gssize) result of a task function.
30958  *
30959  * Sets @task's result to @result and completes the task (see
30960  * g_task_return_pointer() for more discussion of exactly what this
30961  * means).
30962  *
30963  * Since: 2.36
30964  */
30965
30966
30967 /**
30968  * g_task_return_new_error:
30969  * @task: a #GTask.
30970  * @domain: a #GQuark.
30971  * @code: an error code.
30972  * @format: a string with format characters.
30973  * @...: a list of values to insert into @format.
30974  *
30975  * Sets @task's result to a new #GError created from @domain, @code,
30976  * @format, and the remaining arguments, and completes the task (see
30977  * g_task_return_pointer() for more discussion of exactly what this
30978  * means).
30979  *
30980  * See also g_task_return_error().
30981  *
30982  * Since: 2.36
30983  */
30984
30985
30986 /**
30987  * g_task_return_pointer:
30988  * @task: a #GTask
30989  * @result: (allow-none) (transfer full): the pointer result of a task function
30990  * @result_destroy: (allow-none): a #GDestroyNotify function.
30991  *
30992  * Sets @task's result to @result and completes the task. If @result
30993  * is not %NULL, then @result_destroy will be used to free @result if
30994  * the caller does not take ownership of it with
30995  * g_task_propagate_pointer().
30996  *
30997  * "Completes the task" means that for an ordinary asynchronous task
30998  * it will either invoke the task's callback, or else queue that
30999  * callback to be invoked in the proper #GMainContext, or in the next
31000  * iteration of the current #GMainContext. For a task run via
31001  * g_task_run_in_thread() or g_task_run_in_thread_sync(), calling this
31002  * method will save @result to be returned to the caller later, but
31003  * the task will not actually be completed until the #GTaskThreadFunc
31004  * exits.
31005  *
31006  * Note that since the task may be completed before returning from
31007  * g_task_return_pointer(), you cannot assume that @result is still
31008  * valid after calling this, unless you are still holding another
31009  * reference on it.
31010  *
31011  * Since: 2.36
31012  */
31013
31014
31015 /**
31016  * g_task_run_in_thread:
31017  * @task: a #GTask
31018  * @task_func: a #GTaskThreadFunc
31019  *
31020  * Runs @task_func in another thread. When @task_func returns, @task's
31021  * #GAsyncReadyCallback will be invoked in @task's #GMainContext.
31022  *
31023  * This takes a ref on @task until the task completes.
31024  *
31025  * See #GTaskThreadFunc for more details about how @task_func is handled.
31026  *
31027  * Since: 2.36
31028  */
31029
31030
31031 /**
31032  * g_task_run_in_thread_sync:
31033  * @task: a #GTask
31034  * @task_func: a #GTaskThreadFunc
31035  *
31036  * Runs @task_func in another thread, and waits for it to return or be
31037  * cancelled. You can use g_task_propagate_pointer(), etc, afterward
31038  * to get the result of @task_func.
31039  *
31040  * See #GTaskThreadFunc for more details about how @task_func is handled.
31041  *
31042  * Normally this is used with tasks created with a %NULL
31043  * <literal>callback</literal>, but note that even if the task does
31044  * have a callback, it will not be invoked when @task_func returns.
31045  *
31046  * Since: 2.36
31047  */
31048
31049
31050 /**
31051  * g_task_set_check_cancellable:
31052  * @task: the #GTask
31053  * @check_cancellable: whether #GTask will check the state of its #GCancellable for you.
31054  *
31055  * Sets or clears @task's check-cancellable flag. If this is %TRUE
31056  * (the default), then g_task_propagate_pointer(), etc, and
31057  * g_task_had_error() will check the task's #GCancellable first, and
31058  * if it has been cancelled, then they will consider the task to have
31059  * returned an "Operation was cancelled" error
31060  * (%G_IO_ERROR_CANCELLED), regardless of any other error or return
31061  * value the task may have had.
31062  *
31063  * If @check_cancellable is %FALSE, then the #GTask will not check the
31064  * cancellable itself, and it is up to @task's owner to do this (eg,
31065  * via g_task_return_error_if_cancelled()).
31066  *
31067  * If you are using g_task_set_return_on_cancel() as well, then
31068  * you must leave check-cancellable set %TRUE.
31069  *
31070  * Since: 2.36
31071  */
31072
31073
31074 /**
31075  * g_task_set_priority:
31076  * @task: the #GTask
31077  * @priority: the <link linkend="io-priority">priority</link> of the request.
31078  *
31079  * Sets @task's priority. If you do not call this, it will default to
31080  * %G_PRIORITY_DEFAULT.
31081  *
31082  * This will affect the priority of #GSources created with
31083  * g_task_attach_source() and the scheduling of tasks run in threads,
31084  * and can also be explicitly retrieved later via
31085  * g_task_get_priority().
31086  *
31087  * Since: 2.36
31088  */
31089
31090
31091 /**
31092  * g_task_set_return_on_cancel:
31093  * @task: the #GTask
31094  * @return_on_cancel: whether the task returns automatically when it is cancelled.
31095  *
31096  * Sets or clears @task's return-on-cancel flag. This is only
31097  * meaningful for tasks run via g_task_run_in_thread() or
31098  * g_task_run_in_thread_sync().
31099  *
31100  * If @return_on_cancel is %TRUE, then cancelling @task's
31101  * #GCancellable will immediately cause it to return, as though the
31102  * task's #GTaskThreadFunc had called
31103  * g_task_return_error_if_cancelled() and then returned.
31104  *
31105  * This allows you to create a cancellable wrapper around an
31106  * uninterruptable function. The #GTaskThreadFunc just needs to be
31107  * careful that it does not modify any externally-visible state after
31108  * it has been cancelled. To do that, the thread should call
31109  * g_task_set_return_on_cancel() again to (atomically) set
31110  * return-on-cancel %FALSE before making externally-visible changes;
31111  * if the task gets cancelled before the return-on-cancel flag could
31112  * be changed, g_task_set_return_on_cancel() will indicate this by
31113  * returning %FALSE.
31114  *
31115  * You can disable and re-enable this flag multiple times if you wish.
31116  * If the task's #GCancellable is cancelled while return-on-cancel is
31117  * %FALSE, then calling g_task_set_return_on_cancel() to set it %TRUE
31118  * again will cause the task to be cancelled at that point.
31119  *
31120  * If the task's #GCancellable is already cancelled before you call
31121  * g_task_run_in_thread()/g_task_run_in_thread_sync(), then the
31122  * #GTaskThreadFunc will still be run (for consistency), but the task
31123  * will also be completed right away.
31124  *
31125  * Returns: %TRUE if @task's return-on-cancel flag was changed to match @return_on_cancel. %FALSE if @task has already been cancelled.
31126  * Since: 2.36
31127  */
31128
31129
31130 /**
31131  * g_task_set_source_tag:
31132  * @task: the #GTask
31133  * @source_tag: an opaque pointer indicating the source of this task
31134  *
31135  * Sets @task's source tag. You can use this to tag a task return
31136  * value with a particular pointer (usually a pointer to the function
31137  * doing the tagging) and then later check it using
31138  * g_task_get_source_tag() (or g_async_result_is_tagged()) in the
31139  * task's "finish" function, to figure out if the response came from a
31140  * particular place.
31141  *
31142  * Since: 2.36
31143  */
31144
31145
31146 /**
31147  * g_task_set_task_data:
31148  * @task: the #GTask
31149  * @task_data: (allow-none): task-specific data
31150  * @task_data_destroy: (allow-none): #GDestroyNotify for @task_data
31151  *
31152  * Sets @task's task data (freeing the existing task data, if any).
31153  *
31154  * Since: 2.36
31155  */
31156
31157
31158 /**
31159  * g_tcp_connection_get_graceful_disconnect:
31160  * @connection: a #GTcpConnection
31161  *
31162  * Checks if graceful disconnects are used. See
31163  * g_tcp_connection_set_graceful_disconnect().
31164  *
31165  * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
31166  * Since: 2.22
31167  */
31168
31169
31170 /**
31171  * g_tcp_connection_set_graceful_disconnect:
31172  * @connection: a #GTcpConnection
31173  * @graceful_disconnect: Whether to do graceful disconnects or not
31174  *
31175  * This enabled graceful disconnects on close. A graceful disconnect
31176  * means that we signal the receiving end that the connection is terminated
31177  * and wait for it to close the connection before closing the connection.
31178  *
31179  * A graceful disconnect means that we can be sure that we successfully sent
31180  * all the outstanding data to the other end, or get an error reported.
31181  * However, it also means we have to wait for all the data to reach the
31182  * other side and for it to acknowledge this by closing the socket, which may
31183  * take a while. For this reason it is disabled by default.
31184  *
31185  * Since: 2.22
31186  */
31187
31188
31189 /**
31190  * g_tcp_wrapper_connection_get_base_io_stream:
31191  * @conn: a #GTcpWrapperConnection
31192  *
31193  * Get's @conn's base #GIOStream
31194  *
31195  * Returns: (transfer none): @conn's base #GIOStream
31196  */
31197
31198
31199 /**
31200  * g_tcp_wrapper_connection_new:
31201  * @base_io_stream: the #GIOStream to wrap
31202  * @socket: the #GSocket associated with @base_io_stream
31203  *
31204  * Wraps @base_io_stream and @socket together as a #GSocketConnection.
31205  *
31206  * Returns: the new #GSocketConnection.
31207  * Since: 2.28
31208  */
31209
31210
31211 /**
31212  * g_test_dbus_add_service_dir:
31213  * @self: a #GTestDBus
31214  * @path: path to a directory containing .service files
31215  *
31216  * Add a path where dbus-daemon will lookup for .services files. This can't be
31217  * called after g_test_dbus_up().
31218  */
31219
31220
31221 /**
31222  * g_test_dbus_down:
31223  * @self: a #GTestDBus
31224  *
31225  * Stop the session bus started by g_test_dbus_up().
31226  *
31227  * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
31228  * is destroyed. This is done to ensure that the next unit test won't get a
31229  * leaked singleton from this test.
31230  */
31231
31232
31233 /**
31234  * g_test_dbus_get_bus_address:
31235  * @self: a #GTestDBus
31236  *
31237  * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
31238  * been called yet, %NULL is returned. This can be used with
31239  * g_dbus_connection_new_for_address()
31240  *
31241  * Returns: the address of the bus, or %NULL.
31242  */
31243
31244
31245 /**
31246  * g_test_dbus_get_flags:
31247  * @self: a #GTestDBus
31248  *
31249  * Gets the flags of the #GTestDBus object.
31250  *
31251  * Returns: the value of #GTestDBus:flags property
31252  */
31253
31254
31255 /**
31256  * g_test_dbus_new:
31257  * @flags: a #GTestDBusFlags
31258  *
31259  * Create a new #GTestDBus object.
31260  *
31261  * Returns: (transfer full): a new #GTestDBus.
31262  */
31263
31264
31265 /**
31266  * g_test_dbus_stop:
31267  * @self: a #GTestDBus
31268  *
31269  * Stop the session bus started by g_test_dbus_up().
31270  *
31271  * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
31272  * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
31273  * tests wanting to verify behaviour after the session bus has been stopped
31274  * can use this function but should still call g_test_dbus_down() when done.
31275  */
31276
31277
31278 /**
31279  * g_test_dbus_unset:
31280  *
31281  * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
31282  * won't use user's session bus.
31283  *
31284  * This is useful for unit tests that want to verify behaviour when no session
31285  * bus is running. It is not necessary to call this if unit test already calls
31286  * g_test_dbus_up() before acquiring the session bus.
31287  */
31288
31289
31290 /**
31291  * g_test_dbus_up:
31292  * @self: a #GTestDBus
31293  *
31294  * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
31295  * call, it is safe for unit tests to start sending messages on the session bus.
31296  *
31297  * If this function is called from setup callback of g_test_add(),
31298  * g_test_dbus_down() must be called in its teardown callback.
31299  *
31300  * If this function is called from unit test's main(), then g_test_dbus_down()
31301  * must be called after g_test_run().
31302  */
31303
31304
31305 /**
31306  * g_themed_icon_append_name:
31307  * @icon: a #GThemedIcon
31308  * @iconname: name of icon to append to list of icons from within @icon.
31309  *
31310  * Append a name to the list of icons from within @icon.
31311  *
31312  * <note><para>
31313  * Note that doing so invalidates the hash computed by prior calls
31314  * to g_icon_hash().
31315  * </para></note>
31316  */
31317
31318
31319 /**
31320  * g_themed_icon_get_names:
31321  * @icon: a #GThemedIcon.
31322  *
31323  * Gets the names of icons from within @icon.
31324  *
31325  * Returns: (transfer none): a list of icon names.
31326  */
31327
31328
31329 /**
31330  * g_themed_icon_new:
31331  * @iconname: a string containing an icon name.
31332  *
31333  * Creates a new themed icon for @iconname.
31334  *
31335  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31336  */
31337
31338
31339 /**
31340  * g_themed_icon_new_from_names:
31341  * @iconnames: (array length=len): an array of strings containing icon names.
31342  * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
31343  *
31344  * Creates a new themed icon for @iconnames.
31345  *
31346  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
31347  */
31348
31349
31350 /**
31351  * g_themed_icon_new_with_default_fallbacks:
31352  * @iconname: a string containing an icon name
31353  *
31354  * Creates a new themed icon for @iconname, and all the names
31355  * that can be created by shortening @iconname at '-' characters.
31356  *
31357  * In the following example, @icon1 and @icon2 are equivalent:
31358  * |[
31359  * const char *names[] = {
31360  *   "gnome-dev-cdrom-audio",
31361  *   "gnome-dev-cdrom",
31362  *   "gnome-dev",
31363  *   "gnome"
31364  * };
31365  *
31366  * icon1 = g_themed_icon_new_from_names (names, 4);
31367  * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
31368  * ]|
31369  *
31370  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31371  */
31372
31373
31374 /**
31375  * g_themed_icon_prepend_name:
31376  * @icon: a #GThemedIcon
31377  * @iconname: name of icon to prepend to list of icons from within @icon.
31378  *
31379  * Prepend a name to the list of icons from within @icon.
31380  *
31381  * <note><para>
31382  * Note that doing so invalidates the hash computed by prior calls
31383  * to g_icon_hash().
31384  * </para></note>
31385  *
31386  * Since: 2.18
31387  */
31388
31389
31390 /**
31391  * g_threaded_socket_service_new:
31392  * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
31393  *
31394  * Creates a new #GThreadedSocketService with no listeners. Listeners
31395  * must be added with one of the #GSocketListener "add" methods.
31396  *
31397  * Returns: a new #GSocketService.
31398  * Since: 2.22
31399  */
31400
31401
31402 /**
31403  * g_tls_backend_get_certificate_type:
31404  * @backend: the #GTlsBackend
31405  *
31406  * Gets the #GType of @backend's #GTlsCertificate implementation.
31407  *
31408  * Returns: the #GType of @backend's #GTlsCertificate implementation.
31409  * Since: 2.28
31410  */
31411
31412
31413 /**
31414  * g_tls_backend_get_client_connection_type:
31415  * @backend: the #GTlsBackend
31416  *
31417  * Gets the #GType of @backend's #GTlsClientConnection implementation.
31418  *
31419  * Returns: the #GType of @backend's #GTlsClientConnection implementation.
31420  * Since: 2.28
31421  */
31422
31423
31424 /**
31425  * g_tls_backend_get_default:
31426  *
31427  * Gets the default #GTlsBackend for the system.
31428  *
31429  * Returns: (transfer none): a #GTlsBackend
31430  * Since: 2.28
31431  */
31432
31433
31434 /**
31435  * g_tls_backend_get_default_database:
31436  * @backend: the #GTlsBackend
31437  *
31438  * Gets the default #GTlsDatabase used to verify TLS connections.
31439  *
31440  * Returns: (transfer full): the default database, which should be unreffed when done.
31441  * Since: 2.30
31442  */
31443
31444
31445 /**
31446  * g_tls_backend_get_file_database_type:
31447  * @backend: the #GTlsBackend
31448  *
31449  * Gets the #GType of @backend's #GTlsFileDatabase implementation.
31450  *
31451  * Returns: the #GType of backend's #GTlsFileDatabase implementation.
31452  * Since: 2.30
31453  */
31454
31455
31456 /**
31457  * g_tls_backend_get_server_connection_type:
31458  * @backend: the #GTlsBackend
31459  *
31460  * Gets the #GType of @backend's #GTlsServerConnection implementation.
31461  *
31462  * Returns: the #GType of @backend's #GTlsServerConnection implementation.
31463  * Since: 2.28
31464  */
31465
31466
31467 /**
31468  * g_tls_backend_supports_tls:
31469  * @backend: the #GTlsBackend
31470  *
31471  * Checks if TLS is supported; if this returns %FALSE for the default
31472  * #GTlsBackend, it means no "real" TLS backend is available.
31473  *
31474  * Returns: whether or not TLS is supported
31475  * Since: 2.28
31476  */
31477
31478
31479 /**
31480  * g_tls_certificate_get_issuer:
31481  * @cert: a #GTlsCertificate
31482  *
31483  * Gets the #GTlsCertificate representing @cert's issuer, if known
31484  *
31485  * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
31486  * Since: 2.28
31487  */
31488
31489
31490 /**
31491  * g_tls_certificate_is_same:
31492  * @cert_one: first certificate to compare
31493  * @cert_two: second certificate to compare
31494  *
31495  * Check if two #GTlsCertificate objects represent the same certificate.
31496  * The raw DER byte data of the two certificates are checked for equality.
31497  * This has the effect that two certificates may compare equal even if
31498  * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
31499  * #GTlsCertificate:private-key-pem properties differ.
31500  *
31501  * Returns: whether the same or not
31502  * Since: 2.34
31503  */
31504
31505
31506 /**
31507  * g_tls_certificate_list_new_from_file:
31508  * @file: file containing PEM-encoded certificates to import
31509  * @error: #GError for error reporting, or %NULL to ignore.
31510  *
31511  * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
31512  * data in @file. If @file cannot be read or parsed, the function will
31513  * return %NULL and set @error. If @file does not contain any
31514  * PEM-encoded certificates, this will return an empty list and not
31515  * set @error.
31516  *
31517  * Returns: (element-type Gio.TlsCertificate) (transfer full): a #GList containing #GTlsCertificate objects. You must free the list and its contents when you are done with it.
31518  * Since: 2.28
31519  */
31520
31521
31522 /**
31523  * g_tls_certificate_new_from_file:
31524  * @file: file containing a PEM-encoded certificate to import
31525  * @error: #GError for error reporting, or %NULL to ignore.
31526  *
31527  * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
31528  * @file cannot be read or parsed, the function will return %NULL and
31529  * set @error. Otherwise, this behaves like
31530  * g_tls_certificate_new_from_pem().
31531  *
31532  * Returns: the new certificate, or %NULL on error
31533  * Since: 2.28
31534  */
31535
31536
31537 /**
31538  * g_tls_certificate_new_from_files:
31539  * @cert_file: file containing a PEM-encoded certificate to import
31540  * @key_file: file containing a PEM-encoded private key to import
31541  * @error: #GError for error reporting, or %NULL to ignore.
31542  *
31543  * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
31544  * and @key_file. If either file cannot be read or parsed, the
31545  * function will return %NULL and set @error. Otherwise, this behaves
31546  * like g_tls_certificate_new_from_pem().
31547  *
31548  * Returns: the new certificate, or %NULL on error
31549  * Since: 2.28
31550  */
31551
31552
31553 /**
31554  * g_tls_certificate_new_from_pem:
31555  * @data: PEM-encoded certificate data
31556  * @length: the length of @data, or -1 if it's 0-terminated.
31557  * @error: #GError for error reporting, or %NULL to ignore.
31558  *
31559  * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
31560  * If @data includes both a certificate and a private key, then the
31561  * returned certificate will include the private key data as well. (See
31562  * the #GTlsCertificate:private-key-pem property for information about
31563  * supported formats.)
31564  *
31565  * If @data includes multiple certificates, only the first one will be
31566  * parsed.
31567  *
31568  * Returns: the new certificate, or %NULL if @data is invalid
31569  * Since: 2.28
31570  */
31571
31572
31573 /**
31574  * g_tls_certificate_verify:
31575  * @cert: a #GTlsCertificate
31576  * @identity: (allow-none): the expected peer identity
31577  * @trusted_ca: (allow-none): the certificate of a trusted authority
31578  *
31579  * This verifies @cert and returns a set of #GTlsCertificateFlags
31580  * indicating any problems found with it. This can be used to verify a
31581  * certificate outside the context of making a connection, or to
31582  * check a certificate against a CA that is not part of the system
31583  * CA database.
31584  *
31585  * If @identity is not %NULL, @cert's name(s) will be compared against
31586  * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
31587  * value if it does not match. If @identity is %NULL, that bit will
31588  * never be set in the return value.
31589  *
31590  * If @trusted_ca is not %NULL, then @cert (or one of the certificates
31591  * in its chain) must be signed by it, or else
31592  * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
31593  * @trusted_ca is %NULL, that bit will never be set in the return
31594  * value.
31595  *
31596  * (All other #GTlsCertificateFlags values will always be set or unset
31597  * as appropriate.)
31598  *
31599  * Returns: the appropriate #GTlsCertificateFlags
31600  * Since: 2.28
31601  */
31602
31603
31604 /**
31605  * g_tls_client_connection_get_accepted_cas:
31606  * @conn: the #GTlsClientConnection
31607  *
31608  * Gets the list of distinguished names of the Certificate Authorities
31609  * that the server will accept certificates from. This will be set
31610  * during the TLS handshake if the server requests a certificate.
31611  * Otherwise, it will be %NULL.
31612  *
31613  * Each item in the list is a #GByteArray which contains the complete
31614  * subject DN of the certificate authority.
31615  *
31616  * Returns: (element-type GByteArray) (transfer full): the list of CA DNs. You should unref each element with g_byte_array_unref() and then the free the list with g_list_free().
31617  * Since: 2.28
31618  */
31619
31620
31621 /**
31622  * g_tls_client_connection_get_server_identity:
31623  * @conn: the #GTlsClientConnection
31624  *
31625  * Gets @conn's expected server identity
31626  *
31627  * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
31628  * Since: 2.28
31629  */
31630
31631
31632 /**
31633  * g_tls_client_connection_get_use_ssl3:
31634  * @conn: the #GTlsClientConnection
31635  *
31636  * Gets whether @conn will use SSL 3.0 rather than the
31637  * highest-supported version of TLS; see
31638  * g_tls_client_connection_set_use_ssl3().
31639  *
31640  * Returns: whether @conn will use SSL 3.0
31641  * Since: 2.28
31642  */
31643
31644
31645 /**
31646  * g_tls_client_connection_get_validation_flags:
31647  * @conn: the #GTlsClientConnection
31648  *
31649  * Gets @conn's validation flags
31650  *
31651  * Returns: the validation flags
31652  * Since: 2.28
31653  */
31654
31655
31656 /**
31657  * g_tls_client_connection_new:
31658  * @base_io_stream: the #GIOStream to wrap
31659  * @server_identity: (allow-none): the expected identity of the server
31660  * @error: #GError for error reporting, or %NULL to ignore.
31661  *
31662  * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
31663  * must have pollable input and output streams) which is assumed to
31664  * communicate with the server identified by @server_identity.
31665  *
31666  * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
31667  * Since: 2.28
31668  */
31669
31670
31671 /**
31672  * g_tls_client_connection_set_server_identity:
31673  * @conn: the #GTlsClientConnection
31674  * @identity: a #GSocketConnectable describing the expected server identity
31675  *
31676  * Sets @conn's expected server identity, which is used both to tell
31677  * servers on virtual hosts which certificate to present, and also
31678  * to let @conn know what name to look for in the certificate when
31679  * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
31680  *
31681  * Since: 2.28
31682  */
31683
31684
31685 /**
31686  * g_tls_client_connection_set_use_ssl3:
31687  * @conn: the #GTlsClientConnection
31688  * @use_ssl3: whether to use SSL 3.0
31689  *
31690  * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
31691  * trying to properly negotiate the right version of TLS or SSL to use.
31692  * This can be used when talking to servers that do not implement the
31693  * fallbacks correctly and which will therefore fail to handshake with
31694  * a "modern" TLS handshake attempt.
31695  *
31696  * Since: 2.28
31697  */
31698
31699
31700 /**
31701  * g_tls_client_connection_set_validation_flags:
31702  * @conn: the #GTlsClientConnection
31703  * @flags: the #GTlsCertificateFlags to use
31704  *
31705  * Sets @conn's validation flags, to override the default set of
31706  * checks performed when validating a server certificate. By default,
31707  * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
31708  *
31709  * Since: 2.28
31710  */
31711
31712
31713 /**
31714  * g_tls_connection_emit_accept_certificate:
31715  * @conn: a #GTlsConnection
31716  * @peer_cert: the peer's #GTlsCertificate
31717  * @errors: the problems with @peer_cert
31718  *
31719  * Used by #GTlsConnection implementations to emit the
31720  * #GTlsConnection::accept-certificate signal.
31721  *
31722  * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
31723  * Since: 2.28
31724  */
31725
31726
31727 /**
31728  * g_tls_connection_get_certificate:
31729  * @conn: a #GTlsConnection
31730  *
31731  * Gets @conn's certificate, as set by
31732  * g_tls_connection_set_certificate().
31733  *
31734  * Returns: (transfer none): @conn's certificate, or %NULL
31735  * Since: 2.28
31736  */
31737
31738
31739 /**
31740  * g_tls_connection_get_database:
31741  * @conn: a #GTlsConnection
31742  *
31743  * Gets the certificate database that @conn uses to verify
31744  * peer certificates. See g_tls_connection_set_database().
31745  *
31746  * Returns: (transfer none): the certificate database that @conn uses or %NULL
31747  * Since: 2.30
31748  */
31749
31750
31751 /**
31752  * g_tls_connection_get_interaction:
31753  * @conn: a connection
31754  *
31755  * Get the object that will be used to interact with the user. It will be used
31756  * for things like prompting the user for passwords. If %NULL is returned, then
31757  * no user interaction will occur for this connection.
31758  *
31759  * Returns: (transfer none): The interaction object.
31760  * Since: 2.30
31761  */
31762
31763
31764 /**
31765  * g_tls_connection_get_peer_certificate:
31766  * @conn: a #GTlsConnection
31767  *
31768  * Gets @conn's peer's certificate after the handshake has completed.
31769  * (It is not set during the emission of
31770  * #GTlsConnection::accept-certificate.)
31771  *
31772  * Returns: (transfer none): @conn's peer's certificate, or %NULL
31773  * Since: 2.28
31774  */
31775
31776
31777 /**
31778  * g_tls_connection_get_peer_certificate_errors:
31779  * @conn: a #GTlsConnection
31780  *
31781  * Gets the errors associated with validating @conn's peer's
31782  * certificate, after the handshake has completed. (It is not set
31783  * during the emission of #GTlsConnection::accept-certificate.)
31784  *
31785  * Returns: @conn's peer's certificate errors
31786  * Since: 2.28
31787  */
31788
31789
31790 /**
31791  * g_tls_connection_get_rehandshake_mode:
31792  * @conn: a #GTlsConnection
31793  *
31794  * Gets @conn rehandshaking mode. See
31795  * g_tls_connection_set_rehandshake_mode() for details.
31796  *
31797  * Returns: @conn's rehandshaking mode
31798  * Since: 2.28
31799  */
31800
31801
31802 /**
31803  * g_tls_connection_get_require_close_notify:
31804  * @conn: a #GTlsConnection
31805  *
31806  * Tests whether or not @conn expects a proper TLS close notification
31807  * when the connection is closed. See
31808  * g_tls_connection_set_require_close_notify() for details.
31809  *
31810  * Returns: %TRUE if @conn requires a proper TLS close notification.
31811  * Since: 2.28
31812  */
31813
31814
31815 /**
31816  * g_tls_connection_get_use_system_certdb:
31817  * @conn: a #GTlsConnection
31818  *
31819  * Gets whether @conn uses the system certificate database to verify
31820  * peer certificates. See g_tls_connection_set_use_system_certdb().
31821  *
31822  * Returns: whether @conn uses the system certificate database
31823  * Deprecated: 2.30: Use g_tls_connection_get_database() instead
31824  */
31825
31826
31827 /**
31828  * g_tls_connection_handshake:
31829  * @conn: a #GTlsConnection
31830  * @cancellable: (allow-none): a #GCancellable, or %NULL
31831  * @error: a #GError, or %NULL
31832  *
31833  * Attempts a TLS handshake on @conn.
31834  *
31835  * On the client side, it is never necessary to call this method;
31836  * although the connection needs to perform a handshake after
31837  * connecting (or after sending a "STARTTLS"-type command) and may
31838  * need to rehandshake later if the server requests it,
31839  * #GTlsConnection will handle this for you automatically when you try
31840  * to send or receive data on the connection. However, you can call
31841  * g_tls_connection_handshake() manually if you want to know for sure
31842  * whether the initial handshake succeeded or failed (as opposed to
31843  * just immediately trying to write to @conn's output stream, in which
31844  * case if it fails, it may not be possible to tell if it failed
31845  * before or after completing the handshake).
31846  *
31847  * Likewise, on the server side, although a handshake is necessary at
31848  * the beginning of the communication, you do not need to call this
31849  * function explicitly unless you want clearer error reporting.
31850  * However, you may call g_tls_connection_handshake() later on to
31851  * renegotiate parameters (encryption methods, etc) with the client.
31852  *
31853  * #GTlsConnection::accept_certificate may be emitted during the
31854  * handshake.
31855  *
31856  * Returns: success or failure
31857  * Since: 2.28
31858  */
31859
31860
31861 /**
31862  * g_tls_connection_handshake_async:
31863  * @conn: a #GTlsConnection
31864  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
31865  * @cancellable: (allow-none): a #GCancellable, or %NULL
31866  * @callback: callback to call when the handshake is complete
31867  * @user_data: the data to pass to the callback function
31868  *
31869  * Asynchronously performs a TLS handshake on @conn. See
31870  * g_tls_connection_handshake() for more information.
31871  *
31872  * Since: 2.28
31873  */
31874
31875
31876 /**
31877  * g_tls_connection_handshake_finish:
31878  * @conn: a #GTlsConnection
31879  * @result: a #GAsyncResult.
31880  * @error: a #GError pointer, or %NULL
31881  *
31882  * Finish an asynchronous TLS handshake operation. See
31883  * g_tls_connection_handshake() for more information.
31884  *
31885  * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
31886  * Since: 2.28
31887  */
31888
31889
31890 /**
31891  * g_tls_connection_set_certificate:
31892  * @conn: a #GTlsConnection
31893  * @certificate: the certificate to use for @conn
31894  *
31895  * This sets the certificate that @conn will present to its peer
31896  * during the TLS handshake. For a #GTlsServerConnection, it is
31897  * mandatory to set this, and that will normally be done at construct
31898  * time.
31899  *
31900  * For a #GTlsClientConnection, this is optional. If a handshake fails
31901  * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
31902  * requires a certificate, and if you try connecting again, you should
31903  * call this method first. You can call
31904  * g_tls_client_connection_get_accepted_cas() on the failed connection
31905  * to get a list of Certificate Authorities that the server will
31906  * accept certificates from.
31907  *
31908  * (It is also possible that a server will allow the connection with
31909  * or without a certificate; in that case, if you don't provide a
31910  * certificate, you can tell that the server requested one by the fact
31911  * that g_tls_client_connection_get_accepted_cas() will return
31912  * non-%NULL.)
31913  *
31914  * Since: 2.28
31915  */
31916
31917
31918 /**
31919  * g_tls_connection_set_database:
31920  * @conn: a #GTlsConnection
31921  * @database: a #GTlsDatabase
31922  *
31923  * Sets the certificate database that is used to verify peer certificates.
31924  * This is set to the default database by default. See
31925  * g_tls_backend_get_default_database(). If set to %NULL, then
31926  * peer certificate validation will always set the
31927  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31928  * #GTlsConnection::accept-certificate will always be emitted on
31929  * client-side connections, unless that bit is not set in
31930  * #GTlsClientConnection:validation-flags).
31931  *
31932  * Since: 2.30
31933  */
31934
31935
31936 /**
31937  * g_tls_connection_set_interaction:
31938  * @conn: a connection
31939  * @interaction: (allow-none): an interaction object, or %NULL
31940  *
31941  * Set the object that will be used to interact with the user. It will be used
31942  * for things like prompting the user for passwords.
31943  *
31944  * The @interaction argument will normally be a derived subclass of
31945  * #GTlsInteraction. %NULL can also be provided if no user interaction
31946  * should occur for this connection.
31947  *
31948  * Since: 2.30
31949  */
31950
31951
31952 /**
31953  * g_tls_connection_set_rehandshake_mode:
31954  * @conn: a #GTlsConnection
31955  * @mode: the rehandshaking mode
31956  *
31957  * Sets how @conn behaves with respect to rehandshaking requests.
31958  *
31959  * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31960  * rehandshake after the initial handshake is complete. (For a client,
31961  * this means it will refuse rehandshake requests from the server, and
31962  * for a server, this means it will close the connection with an error
31963  * if the client attempts to rehandshake.)
31964  *
31965  * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31966  * rehandshake only if the other end of the connection supports the
31967  * TLS <literal>renegotiation_info</literal> extension. This is the
31968  * default behavior, but means that rehandshaking will not work
31969  * against older implementations that do not support that extension.
31970  *
31971  * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31972  * rehandshaking even without the
31973  * <literal>renegotiation_info</literal> extension. On the server side
31974  * in particular, this is not recommended, since it leaves the server
31975  * open to certain attacks. However, this mode is necessary if you
31976  * need to allow renegotiation with older client software.
31977  *
31978  * Since: 2.28
31979  */
31980
31981
31982 /**
31983  * g_tls_connection_set_require_close_notify:
31984  * @conn: a #GTlsConnection
31985  * @require_close_notify: whether or not to require close notification
31986  *
31987  * Sets whether or not @conn expects a proper TLS close notification
31988  * before the connection is closed. If this is %TRUE (the default),
31989  * then @conn will expect to receive a TLS close notification from its
31990  * peer before the connection is closed, and will return a
31991  * %G_TLS_ERROR_EOF error if the connection is closed without proper
31992  * notification (since this may indicate a network error, or
31993  * man-in-the-middle attack).
31994  *
31995  * In some protocols, the application will know whether or not the
31996  * connection was closed cleanly based on application-level data
31997  * (because the application-level data includes a length field, or is
31998  * somehow self-delimiting); in this case, the close notify is
31999  * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
32000  * in TLS 1.0 it is technically an error, but often done anyway.) You
32001  * can use g_tls_connection_set_require_close_notify() to tell @conn
32002  * to allow an "unannounced" connection close, in which case the close
32003  * will show up as a 0-length read, as in a non-TLS
32004  * #GSocketConnection, and it is up to the application to check that
32005  * the data has been fully received.
32006  *
32007  * Note that this only affects the behavior when the peer closes the
32008  * connection; when the application calls g_io_stream_close() itself
32009  * on @conn, this will send a close notification regardless of the
32010  * setting of this property. If you explicitly want to do an unclean
32011  * close, you can close @conn's #GTlsConnection:base-io-stream rather
32012  * than closing @conn itself.
32013  *
32014  * Since: 2.28
32015  */
32016
32017
32018 /**
32019  * g_tls_connection_set_use_system_certdb:
32020  * @conn: a #GTlsConnection
32021  * @use_system_certdb: whether to use the system certificate database
32022  *
32023  * Sets whether @conn uses the system certificate database to verify
32024  * peer certificates. This is %TRUE by default. If set to %FALSE, then
32025  * peer certificate validation will always set the
32026  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32027  * #GTlsConnection::accept-certificate will always be emitted on
32028  * client-side connections, unless that bit is not set in
32029  * #GTlsClientConnection:validation-flags).
32030  *
32031  * Deprecated: 2.30: Use g_tls_connection_set_database() instead
32032  */
32033
32034
32035 /**
32036  * g_tls_database_create_certificate_handle:
32037  * @self: a #GTlsDatabase
32038  * @certificate: certificate for which to create a handle.
32039  *
32040  * Create a handle string for the certificate. The database will only be able
32041  * to create a handle for certificates that originate from the database. In
32042  * cases where the database cannot create a handle for a certificate, %NULL
32043  * will be returned.
32044  *
32045  * This handle should be stable across various instances of the application,
32046  * and between applications. If a certificate is modified in the database,
32047  * then it is not guaranteed that this handle will continue to point to it.
32048  *
32049  * Returns: (allow-none): a newly allocated string containing the handle.
32050  * Since: 2.30
32051  */
32052
32053
32054 /**
32055  * g_tls_database_lookup_certificate_for_handle:
32056  * @self: a #GTlsDatabase
32057  * @handle: a certificate handle
32058  * @interaction: (allow-none): used to interact with the user if necessary
32059  * @flags: Flags which affect the lookup.
32060  * @cancellable: (allow-none): a #GCancellable, or %NULL
32061  * @error: (allow-none): a #GError, or %NULL
32062  *
32063  * Lookup a certificate by its handle.
32064  *
32065  * The handle should have been created by calling
32066  * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
32067  * the same TLS backend. The handle is designed to remain valid across
32068  * instantiations of the database.
32069  *
32070  * If the handle is no longer valid, or does not point to a certificate in
32071  * this database, then %NULL will be returned.
32072  *
32073  * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
32074  * the lookup operation asynchronously.
32075  *
32076  * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32077  * Since: 2.30
32078  */
32079
32080
32081 /**
32082  * g_tls_database_lookup_certificate_for_handle_async:
32083  * @self: a #GTlsDatabase
32084  * @handle: a certificate handle
32085  * @interaction: (allow-none): used to interact with the user if necessary
32086  * @flags: Flags which affect the lookup.
32087  * @cancellable: (allow-none): a #GCancellable, or %NULL
32088  * @callback: callback to call when the operation completes
32089  * @user_data: the data to pass to the callback function
32090  *
32091  * Asynchronously lookup a certificate by its handle in the database. See
32092  * g_tls_database_lookup_certificate_for_handle() for more information.
32093  *
32094  * Since: 2.30
32095  */
32096
32097
32098 /**
32099  * g_tls_database_lookup_certificate_for_handle_finish:
32100  * @self: a #GTlsDatabase
32101  * @result: a #GAsyncResult.
32102  * @error: a #GError pointer, or %NULL
32103  *
32104  * Finish an asynchronous lookup of a certificate by its handle. See
32105  * g_tls_database_lookup_certificate_handle() for more information.
32106  *
32107  * If the handle is no longer valid, or does not point to a certificate in
32108  * this database, then %NULL will be returned.
32109  *
32110  * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
32111  * Since: 2.30
32112  */
32113
32114
32115 /**
32116  * g_tls_database_lookup_certificate_issuer:
32117  * @self: a #GTlsDatabase
32118  * @certificate: a #GTlsCertificate
32119  * @interaction: (allow-none): used to interact with the user if necessary
32120  * @flags: flags which affect the lookup operation
32121  * @cancellable: (allow-none): a #GCancellable, or %NULL
32122  * @error: (allow-none): a #GError, or %NULL
32123  *
32124  * Lookup the issuer of @certificate in the database.
32125  *
32126  * The %issuer property
32127  * of @certificate is not modified, and the two certificates are not hooked
32128  * into a chain.
32129  *
32130  * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
32131  * the lookup operation asynchronously.
32132  *
32133  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32134  * Since: 2.30
32135  */
32136
32137
32138 /**
32139  * g_tls_database_lookup_certificate_issuer_async:
32140  * @self: a #GTlsDatabase
32141  * @certificate: a #GTlsCertificate
32142  * @interaction: (allow-none): used to interact with the user if necessary
32143  * @flags: flags which affect the lookup operation
32144  * @cancellable: (allow-none): a #GCancellable, or %NULL
32145  * @callback: callback to call when the operation completes
32146  * @user_data: the data to pass to the callback function
32147  *
32148  * Asynchronously lookup the issuer of @certificate in the database. See
32149  * g_tls_database_lookup_certificate_issuer() for more information.
32150  *
32151  * Since: 2.30
32152  */
32153
32154
32155 /**
32156  * g_tls_database_lookup_certificate_issuer_finish:
32157  * @self: a #GTlsDatabase
32158  * @result: a #GAsyncResult.
32159  * @error: a #GError pointer, or %NULL
32160  *
32161  * Finish an asynchronous lookup issuer operation. See
32162  * g_tls_database_lookup_certificate_issuer() for more information.
32163  *
32164  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32165  * Since: 2.30
32166  */
32167
32168
32169 /**
32170  * g_tls_database_lookup_certificates_issued_by:
32171  * @self: a #GTlsDatabase
32172  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32173  * @interaction: (allow-none): used to interact with the user if necessary
32174  * @flags: Flags which affect the lookup operation.
32175  * @cancellable: (allow-none): a #GCancellable, or %NULL
32176  * @error: (allow-none): a #GError, or %NULL
32177  *
32178  * Lookup certificates issued by this issuer in the database.
32179  *
32180  * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
32181  * the lookup operation asynchronously.
32182  *
32183  * Returns: (transfer full) (element-type GTlsCertificate): a newly allocated list of #GTlsCertificate objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
32184  * Since: 2.30
32185  */
32186
32187
32188 /**
32189  * g_tls_database_lookup_certificates_issued_by_async:
32190  * @self: a #GTlsDatabase
32191  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32192  * @interaction: (allow-none): used to interact with the user if necessary
32193  * @flags: Flags which affect the lookup operation.
32194  * @cancellable: (allow-none): a #GCancellable, or %NULL
32195  * @callback: callback to call when the operation completes
32196  * @user_data: the data to pass to the callback function
32197  *
32198  * Asynchronously lookup certificates issued by this issuer in the database. See
32199  * g_tls_database_lookup_certificates_issued_by() for more information.
32200  *
32201  * The database may choose to hold a reference to the issuer byte array for the duration
32202  * of of this asynchronous operation. The byte array should not be modified during
32203  * this time.
32204  *
32205  * Since: 2.30
32206  */
32207
32208
32209 /**
32210  * g_tls_database_lookup_certificates_issued_by_finish:
32211  * @self: a #GTlsDatabase
32212  * @result: a #GAsyncResult.
32213  * @error: a #GError pointer, or %NULL
32214  *
32215  * Finish an asynchronous lookup of certificates. See
32216  * g_tls_database_lookup_certificates_issued_by() for more information.
32217  *
32218  * Returns: (transfer full) (element-type GTlsCertificate): a newly allocated list of #GTlsCertificate objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
32219  * Since: 2.30
32220  */
32221
32222
32223 /**
32224  * g_tls_database_verify_chain:
32225  * @self: a #GTlsDatabase
32226  * @chain: a #GTlsCertificate chain
32227  * @purpose: the purpose that this certificate chain will be used for.
32228  * @identity: (allow-none): the expected peer identity
32229  * @interaction: (allow-none): used to interact with the user if necessary
32230  * @flags: additional verify flags
32231  * @cancellable: (allow-none): a #GCancellable, or %NULL
32232  * @error: (allow-none): a #GError, or %NULL
32233  *
32234  * Verify's a certificate chain after looking up and adding any missing
32235  * certificates to the chain.
32236  *
32237  * @chain is a chain of #GTlsCertificate objects each pointing to the next
32238  * certificate in the chain by its %issuer property. The chain may initially
32239  * consist of one or more certificates. After the verification process is
32240  * complete, @chain may be modified by adding missing certificates, or removing
32241  * extra certificates. If a certificate anchor was found, then it is added to
32242  * the @chain.
32243  *
32244  * @purpose describes the purpose (or usage) for which the certificate
32245  * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
32246  * which means that the certificate is being used to authenticate a server
32247  * (and we are acting as the client).
32248  *
32249  * The @identity is used to check for pinned certificates (trust exceptions)
32250  * in the database. These will override the normal verification process on a
32251  * host by host basis.
32252  *
32253  * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
32254  * used.
32255  *
32256  * This function can block, use g_tls_database_verify_chain_async() to perform
32257  * the verification operation asynchronously.
32258  *
32259  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32260  * Since: 2.30
32261  */
32262
32263
32264 /**
32265  * g_tls_database_verify_chain_async:
32266  * @self: a #GTlsDatabase
32267  * @chain: a #GTlsCertificate chain
32268  * @purpose: the purpose that this certificate chain will be used for.
32269  * @identity: (allow-none): the expected peer identity
32270  * @interaction: (allow-none): used to interact with the user if necessary
32271  * @flags: additional verify flags
32272  * @cancellable: (allow-none): a #GCancellable, or %NULL
32273  * @callback: callback to call when the operation completes
32274  * @user_data: the data to pass to the callback function
32275  *
32276  * Asynchronously verify's a certificate chain after looking up and adding
32277  * any missing certificates to the chain. See g_tls_database_verify_chain()
32278  * for more information.
32279  *
32280  * Since: 2.30
32281  */
32282
32283
32284 /**
32285  * g_tls_database_verify_chain_finish:
32286  * @self: a #GTlsDatabase
32287  * @result: a #GAsyncResult.
32288  * @error: a #GError pointer, or %NULL
32289  *
32290  * Finish an asynchronous verify chain operation. See
32291  * g_tls_database_verify_chain() for more information. *
32292  *
32293  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32294  * Since: 2.30
32295  */
32296
32297
32298 /**
32299  * g_tls_error_quark:
32300  *
32301  * Gets the TLS error quark.
32302  *
32303  * Returns: a #GQuark.
32304  * Since: 2.28
32305  */
32306
32307
32308 /**
32309  * g_tls_file_database_new:
32310  * @anchors: filename of anchor certificate authorities.
32311  * @error: #GError for error reporting, or %NULL to ignore.
32312  *
32313  * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
32314  * in @anchors to verify certificate chains.
32315  *
32316  * The certificates in @anchors must be PEM encoded.
32317  *
32318  * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
32319  * Since: 2.30
32320  */
32321
32322
32323 /**
32324  * g_tls_interaction_ask_password:
32325  * @interaction: a #GTlsInteraction object
32326  * @password: a #GTlsPassword object
32327  * @cancellable: an optional #GCancellable cancellation object
32328  * @error: an optional location to place an error on failure
32329  *
32330  * Run synchronous interaction to ask the user for a password. In general,
32331  * g_tls_interaction_invoke_ask_password() should be used instead of this
32332  * function.
32333  *
32334  * Derived subclasses usually implement a password prompt, although they may
32335  * also choose to provide a password from elsewhere. The @password value will
32336  * be filled in and then @callback will be called. Alternatively the user may
32337  * abort this password request, which will usually abort the TLS connection.
32338  *
32339  * If the interaction is cancelled by the cancellation object, or by the
32340  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32341  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32342  * not support immediate cancellation.
32343  *
32344  * Returns: The status of the ask password interaction.
32345  * Since: 2.30
32346  */
32347
32348
32349 /**
32350  * g_tls_interaction_ask_password_async:
32351  * @interaction: a #GTlsInteraction object
32352  * @password: a #GTlsPassword object
32353  * @cancellable: an optional #GCancellable cancellation object
32354  * @callback: (allow-none): will be called when the interaction completes
32355  * @user_data: (allow-none): data to pass to the @callback
32356  *
32357  * Run asynchronous interaction to ask the user for a password. In general,
32358  * g_tls_interaction_invoke_ask_password() should be used instead of this
32359  * function.
32360  *
32361  * Derived subclasses usually implement a password prompt, although they may
32362  * also choose to provide a password from elsewhere. The @password value will
32363  * be filled in and then @callback will be called. Alternatively the user may
32364  * abort this password request, which will usually abort the TLS connection.
32365  *
32366  * If the interaction is cancelled by the cancellation object, or by the
32367  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32368  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32369  * not support immediate cancellation.
32370  *
32371  * Certain implementations may not support immediate cancellation.
32372  *
32373  * Since: 2.30
32374  */
32375
32376
32377 /**
32378  * g_tls_interaction_ask_password_finish:
32379  * @interaction: a #GTlsInteraction object
32380  * @result: the result passed to the callback
32381  * @error: an optional location to place an error on failure
32382  *
32383  * Complete an ask password user interaction request. This should be once
32384  * the g_tls_interaction_ask_password_async() completion callback is called.
32385  *
32386  * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
32387  * to g_tls_interaction_ask_password() will have its password filled in.
32388  *
32389  * If the interaction is cancelled by the cancellation object, or by the
32390  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32391  * contains a %G_IO_ERROR_CANCELLED error code.
32392  *
32393  * Returns: The status of the ask password interaction.
32394  * Since: 2.30
32395  */
32396
32397
32398 /**
32399  * g_tls_interaction_invoke_ask_password:
32400  * @interaction: a #GTlsInteraction object
32401  * @password: a #GTlsPassword object
32402  * @cancellable: an optional #GCancellable cancellation object
32403  * @error: an optional location to place an error on failure
32404  *
32405  * Invoke the interaction to ask the user for a password. It invokes this
32406  * interaction in the main loop, specifically the #GMainContext returned by
32407  * g_main_context_get_thread_default() when the interaction is created. This
32408  * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
32409  * for a password.
32410  *
32411  * Derived subclasses usually implement a password prompt, although they may
32412  * also choose to provide a password from elsewhere. The @password value will
32413  * be filled in and then @callback will be called. Alternatively the user may
32414  * abort this password request, which will usually abort the TLS connection.
32415  *
32416  * The implementation can either be a synchronous (eg: modal dialog) or an
32417  * asynchronous one (eg: modeless dialog). This function will take care of
32418  * calling which ever one correctly.
32419  *
32420  * If the interaction is cancelled by the cancellation object, or by the
32421  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32422  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32423  * not support immediate cancellation.
32424  *
32425  * Returns: The status of the ask password interaction.
32426  * Since: 2.30
32427  */
32428
32429
32430 /**
32431  * g_tls_password_get_description:
32432  * @password: a #GTlsPassword object
32433  *
32434  * Get a description string about what the password will be used for.
32435  *
32436  * Returns: The description of the password.
32437  * Since: 2.30
32438  */
32439
32440
32441 /**
32442  * g_tls_password_get_flags:
32443  * @password: a #GTlsPassword object
32444  *
32445  * Get flags about the password.
32446  *
32447  * Returns: The flags about the password.
32448  * Since: 2.30
32449  */
32450
32451
32452 /**
32453  * g_tls_password_get_value:
32454  * @password: a #GTlsPassword object
32455  * @length: (allow-none): location to place the length of the password.
32456  *
32457  * Get the password value. If @length is not %NULL then it will be
32458  * filled in with the length of the password value. (Note that the
32459  * password value is not nul-terminated, so you can only pass %NULL
32460  * for @length in contexts where you know the password will have a
32461  * certain fixed length.)
32462  *
32463  * Returns: The password value (owned by the password object).
32464  * Since: 2.30
32465  */
32466
32467
32468 /**
32469  * g_tls_password_get_warning:
32470  * @password: a #GTlsPassword object
32471  *
32472  * Get a user readable translated warning. Usually this warning is a
32473  * representation of the password flags returned from
32474  * g_tls_password_get_flags().
32475  *
32476  * Returns: The warning.
32477  * Since: 2.30
32478  */
32479
32480
32481 /**
32482  * g_tls_password_new:
32483  * @flags: the password flags
32484  * @description: description of what the password is for
32485  *
32486  * Create a new #GTlsPassword object.
32487  *
32488  * Returns: (transfer full): The newly allocated password object
32489  */
32490
32491
32492 /**
32493  * g_tls_password_set_description:
32494  * @password: a #GTlsPassword object
32495  * @description: The description of the password
32496  *
32497  * Set a description string about what the password will be used for.
32498  *
32499  * Since: 2.30
32500  */
32501
32502
32503 /**
32504  * g_tls_password_set_flags:
32505  * @password: a #GTlsPassword object
32506  * @flags: The flags about the password
32507  *
32508  * Set flags about the password.
32509  *
32510  * Since: 2.30
32511  */
32512
32513
32514 /**
32515  * g_tls_password_set_value:
32516  * @password: a #GTlsPassword object
32517  * @value: the new password value
32518  * @length: the length of the password, or -1
32519  *
32520  * Set the value for this password. The @value will be copied by the password
32521  * object.
32522  *
32523  * Specify the @length, for a non-nul-terminated password. Pass -1 as
32524  * @length if using a nul-terminated password, and @length will be
32525  * calculated automatically. (Note that the terminating nul is not
32526  * considered part of the password in this case.)
32527  *
32528  * Since: 2.30
32529  */
32530
32531
32532 /**
32533  * g_tls_password_set_value_full:
32534  * @password: a #GTlsPassword object
32535  * @value: the value for the password
32536  * @length: the length of the password, or -1
32537  * @destroy: (allow-none): a function to use to free the password.
32538  *
32539  * Provide the value for this password.
32540  *
32541  * The @value will be owned by the password object, and later freed using
32542  * the @destroy function callback.
32543  *
32544  * Specify the @length, for a non-nul-terminated password. Pass -1 as
32545  * @length if using a nul-terminated password, and @length will be
32546  * calculated automatically. (Note that the terminating nul is not
32547  * considered part of the password in this case.)
32548  *
32549  * Virtual: set_value
32550  * Since: 2.30
32551  */
32552
32553
32554 /**
32555  * g_tls_password_set_warning:
32556  * @password: a #GTlsPassword object
32557  * @warning: The user readable warning
32558  *
32559  * Set a user readable translated warning. Usually this warning is a
32560  * representation of the password flags returned from
32561  * g_tls_password_get_flags().
32562  *
32563  * Since: 2.30
32564  */
32565
32566
32567 /**
32568  * g_tls_server_connection_new:
32569  * @base_io_stream: the #GIOStream to wrap
32570  * @certificate: (allow-none): the default server certificate, or %NULL
32571  * @error: #GError for error reporting, or %NULL to ignore.
32572  *
32573  * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
32574  * must have pollable input and output streams).
32575  *
32576  * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
32577  * Since: 2.28
32578  */
32579
32580
32581 /**
32582  * g_unix_connection_receive_credentials:
32583  * @connection: A #GUnixConnection.
32584  * @cancellable: (allow-none): A #GCancellable or %NULL.
32585  * @error: Return location for error or %NULL.
32586  *
32587  * Receives credentials from the sending end of the connection.  The
32588  * sending end has to call g_unix_connection_send_credentials() (or
32589  * similar) for this to work.
32590  *
32591  * As well as reading the credentials this also reads (and discards) a
32592  * single byte from the stream, as this is required for credentials
32593  * passing to work on some implementations.
32594  *
32595  * Other ways to exchange credentials with a foreign peer includes the
32596  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32597  *
32598  * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
32599  * Since: 2.26
32600  */
32601
32602
32603 /**
32604  * g_unix_connection_receive_credentials_async:
32605  * @connection: A #GUnixConnection.
32606  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32607  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32608  * @user_data: (closure): the data to pass to callback function
32609  *
32610  * Asynchronously receive credentials.
32611  *
32612  * For more details, see g_unix_connection_receive_credentials() which is
32613  * the synchronous version of this call.
32614  *
32615  * When the operation is finished, @callback will be called. You can then call
32616  * g_unix_connection_receive_credentials_finish() to get the result of the operation.
32617  *
32618  * Since: 2.32
32619  */
32620
32621
32622 /**
32623  * g_unix_connection_receive_credentials_finish:
32624  * @connection: A #GUnixConnection.
32625  * @result: a #GAsyncResult.
32626  * @error: a #GError, or %NULL
32627  *
32628  * Finishes an asynchronous receive credentials operation started with
32629  * g_unix_connection_receive_credentials_async().
32630  *
32631  * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
32632  * Since: 2.32
32633  */
32634
32635
32636 /**
32637  * g_unix_connection_receive_fd:
32638  * @connection: a #GUnixConnection
32639  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
32640  * @error: (allow-none): #GError for error reporting, or %NULL to ignore
32641  *
32642  * Receives a file descriptor from the sending end of the connection.
32643  * The sending end has to call g_unix_connection_send_fd() for this
32644  * to work.
32645  *
32646  * As well as reading the fd this also reads a single byte from the
32647  * stream, as this is required for fd passing to work on some
32648  * implementations.
32649  *
32650  * Returns: a file descriptor on success, -1 on error.
32651  * Since: 2.22
32652  */
32653
32654
32655 /**
32656  * g_unix_connection_send_credentials:
32657  * @connection: A #GUnixConnection.
32658  * @cancellable: (allow-none): A #GCancellable or %NULL.
32659  * @error: Return location for error or %NULL.
32660  *
32661  * Passes the credentials of the current user the receiving side
32662  * of the connection. The receiving end has to call
32663  * g_unix_connection_receive_credentials() (or similar) to accept the
32664  * credentials.
32665  *
32666  * As well as sending the credentials this also writes a single NUL
32667  * byte to the stream, as this is required for credentials passing to
32668  * work on some implementations.
32669  *
32670  * Other ways to exchange credentials with a foreign peer includes the
32671  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32672  *
32673  * Returns: %TRUE on success, %FALSE if @error is set.
32674  * Since: 2.26
32675  */
32676
32677
32678 /**
32679  * g_unix_connection_send_credentials_async:
32680  * @connection: A #GUnixConnection.
32681  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32682  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32683  * @user_data: (closure): the data to pass to callback function
32684  *
32685  * Asynchronously send credentials.
32686  *
32687  * For more details, see g_unix_connection_send_credentials() which is
32688  * the synchronous version of this call.
32689  *
32690  * When the operation is finished, @callback will be called. You can then call
32691  * g_unix_connection_send_credentials_finish() to get the result of the operation.
32692  *
32693  * Since: 2.32
32694  */
32695
32696
32697 /**
32698  * g_unix_connection_send_credentials_finish:
32699  * @connection: A #GUnixConnection.
32700  * @result: a #GAsyncResult.
32701  * @error: a #GError, or %NULL
32702  *
32703  * Finishes an asynchronous send credentials operation started with
32704  * g_unix_connection_send_credentials_async().
32705  *
32706  * Returns: %TRUE if the operation was successful, otherwise %FALSE.
32707  * Since: 2.32
32708  */
32709
32710
32711 /**
32712  * g_unix_connection_send_fd:
32713  * @connection: a #GUnixConnection
32714  * @fd: a file descriptor
32715  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32716  * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
32717  *
32718  * Passes a file descriptor to the receiving side of the
32719  * connection. The receiving end has to call g_unix_connection_receive_fd()
32720  * to accept the file descriptor.
32721  *
32722  * As well as sending the fd this also writes a single byte to the
32723  * stream, as this is required for fd passing to work on some
32724  * implementations.
32725  *
32726  * Returns: a %TRUE on success, %NULL on error.
32727  * Since: 2.22
32728  */
32729
32730
32731 /**
32732  * g_unix_credentials_message_get_credentials:
32733  * @message: A #GUnixCredentialsMessage.
32734  *
32735  * Gets the credentials stored in @message.
32736  *
32737  * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
32738  * Since: 2.26
32739  */
32740
32741
32742 /**
32743  * g_unix_credentials_message_is_supported:
32744  *
32745  * Checks if passing #GCredentials on a #GSocket is supported on this platform.
32746  *
32747  * Returns: %TRUE if supported, %FALSE otherwise
32748  * Since: 2.26
32749  */
32750
32751
32752 /**
32753  * g_unix_credentials_message_new:
32754  *
32755  * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
32756  *
32757  * Returns: a new #GUnixCredentialsMessage
32758  * Since: 2.26
32759  */
32760
32761
32762 /**
32763  * g_unix_credentials_message_new_with_credentials:
32764  * @credentials: A #GCredentials object.
32765  *
32766  * Creates a new #GUnixCredentialsMessage holding @credentials.
32767  *
32768  * Returns: a new #GUnixCredentialsMessage
32769  * Since: 2.26
32770  */
32771
32772
32773 /**
32774  * g_unix_fd_list_append:
32775  * @list: a #GUnixFDList
32776  * @fd: a valid open file descriptor
32777  * @error: a #GError pointer
32778  *
32779  * Adds a file descriptor to @list.
32780  *
32781  * The file descriptor is duplicated using dup(). You keep your copy
32782  * of the descriptor and the copy contained in @list will be closed
32783  * when @list is finalized.
32784  *
32785  * A possible cause of failure is exceeding the per-process or
32786  * system-wide file descriptor limit.
32787  *
32788  * The index of the file descriptor in the list is returned.  If you use
32789  * this index with g_unix_fd_list_get() then you will receive back a
32790  * duplicated copy of the same file descriptor.
32791  *
32792  * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
32793  * Since: 2.24
32794  */
32795
32796
32797 /**
32798  * g_unix_fd_list_get:
32799  * @list: a #GUnixFDList
32800  * @index_: the index into the list
32801  * @error: a #GError pointer
32802  *
32803  * Gets a file descriptor out of @list.
32804  *
32805  * @index_ specifies the index of the file descriptor to get.  It is a
32806  * programmer error for @index_ to be out of range; see
32807  * g_unix_fd_list_get_length().
32808  *
32809  * The file descriptor is duplicated using dup() and set as
32810  * close-on-exec before being returned.  You must call close() on it
32811  * when you are done.
32812  *
32813  * A possible cause of failure is exceeding the per-process or
32814  * system-wide file descriptor limit.
32815  *
32816  * Returns: the file descriptor, or -1 in case of error
32817  * Since: 2.24
32818  */
32819
32820
32821 /**
32822  * g_unix_fd_list_get_length:
32823  * @list: a #GUnixFDList
32824  *
32825  * Gets the length of @list (ie: the number of file descriptors
32826  * contained within).
32827  *
32828  * Returns: the length of @list
32829  * Since: 2.24
32830  */
32831
32832
32833 /**
32834  * g_unix_fd_list_new:
32835  *
32836  * Creates a new #GUnixFDList containing no file descriptors.
32837  *
32838  * Returns: a new #GUnixFDList
32839  * Since: 2.24
32840  */
32841
32842
32843 /**
32844  * g_unix_fd_list_new_from_array:
32845  * @fds: (array length=n_fds): the initial list of file descriptors
32846  * @n_fds: the length of #fds, or -1
32847  *
32848  * Creates a new #GUnixFDList containing the file descriptors given in
32849  * @fds.  The file descriptors become the property of the new list and
32850  * may no longer be used by the caller.  The array itself is owned by
32851  * the caller.
32852  *
32853  * Each file descriptor in the array should be set to close-on-exec.
32854  *
32855  * If @n_fds is -1 then @fds must be terminated with -1.
32856  *
32857  * Returns: a new #GUnixFDList
32858  * Since: 2.24
32859  */
32860
32861
32862 /**
32863  * g_unix_fd_list_peek_fds:
32864  * @list: a #GUnixFDList
32865  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32866  *
32867  * Returns the array of file descriptors that is contained in this
32868  * object.
32869  *
32870  * After this call, the descriptors remain the property of @list.  The
32871  * caller must not close them and must not free the array.  The array is
32872  * valid only until @list is changed in any way.
32873  *
32874  * If @length is non-%NULL then it is set to the number of file
32875  * descriptors in the returned array. The returned array is also
32876  * terminated with -1.
32877  *
32878  * This function never returns %NULL. In case there are no file
32879  * descriptors contained in @list, an empty array is returned.
32880  *
32881  * Returns: (array length=length) (transfer none): an array of file descriptors
32882  * Since: 2.24
32883  */
32884
32885
32886 /**
32887  * g_unix_fd_list_steal_fds:
32888  * @list: a #GUnixFDList
32889  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32890  *
32891  * Returns the array of file descriptors that is contained in this
32892  * object.
32893  *
32894  * After this call, the descriptors are no longer contained in
32895  * @list. Further calls will return an empty list (unless more
32896  * descriptors have been added).
32897  *
32898  * The return result of this function must be freed with g_free().
32899  * The caller is also responsible for closing all of the file
32900  * descriptors.  The file descriptors in the array are set to
32901  * close-on-exec.
32902  *
32903  * If @length is non-%NULL then it is set to the number of file
32904  * descriptors in the returned array. The returned array is also
32905  * terminated with -1.
32906  *
32907  * This function never returns %NULL. In case there are no file
32908  * descriptors contained in @list, an empty array is returned.
32909  *
32910  * Returns: (array length=length) (transfer full): an array of file descriptors
32911  * Since: 2.24
32912  */
32913
32914
32915 /**
32916  * g_unix_fd_message_append_fd:
32917  * @message: a #GUnixFDMessage
32918  * @fd: a valid open file descriptor
32919  * @error: a #GError pointer
32920  *
32921  * Adds a file descriptor to @message.
32922  *
32923  * The file descriptor is duplicated using dup(). You keep your copy
32924  * of the descriptor and the copy contained in @message will be closed
32925  * when @message is finalized.
32926  *
32927  * A possible cause of failure is exceeding the per-process or
32928  * system-wide file descriptor limit.
32929  *
32930  * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32931  * Since: 2.22
32932  */
32933
32934
32935 /**
32936  * g_unix_fd_message_get_fd_list:
32937  * @message: a #GUnixFDMessage
32938  *
32939  * Gets the #GUnixFDList contained in @message.  This function does not
32940  * return a reference to the caller, but the returned list is valid for
32941  * the lifetime of @message.
32942  *
32943  * Returns: (transfer none): the #GUnixFDList from @message
32944  * Since: 2.24
32945  */
32946
32947
32948 /**
32949  * g_unix_fd_message_new:
32950  *
32951  * Creates a new #GUnixFDMessage containing an empty file descriptor
32952  * list.
32953  *
32954  * Returns: a new #GUnixFDMessage
32955  * Since: 2.22
32956  */
32957
32958
32959 /**
32960  * g_unix_fd_message_new_with_fd_list:
32961  * @fd_list: a #GUnixFDList
32962  *
32963  * Creates a new #GUnixFDMessage containing @list.
32964  *
32965  * Returns: a new #GUnixFDMessage
32966  * Since: 2.24
32967  */
32968
32969
32970 /**
32971  * g_unix_fd_message_steal_fds:
32972  * @message: a #GUnixFDMessage
32973  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32974  *
32975  * Returns the array of file descriptors that is contained in this
32976  * object.
32977  *
32978  * After this call, the descriptors are no longer contained in
32979  * @message. Further calls will return an empty list (unless more
32980  * descriptors have been added).
32981  *
32982  * The return result of this function must be freed with g_free().
32983  * The caller is also responsible for closing all of the file
32984  * descriptors.
32985  *
32986  * If @length is non-%NULL then it is set to the number of file
32987  * descriptors in the returned array. The returned array is also
32988  * terminated with -1.
32989  *
32990  * This function never returns %NULL. In case there are no file
32991  * descriptors contained in @message, an empty array is returned.
32992  *
32993  * Returns: (array length=length) (transfer full): an array of file descriptors
32994  * Since: 2.22
32995  */
32996
32997
32998 /**
32999  * g_unix_input_stream_get_close_fd:
33000  * @stream: a #GUnixInputStream
33001  *
33002  * Returns whether the file descriptor of @stream will be
33003  * closed when the stream is closed.
33004  *
33005  * Returns: %TRUE if the file descriptor is closed when done
33006  * Since: 2.20
33007  */
33008
33009
33010 /**
33011  * g_unix_input_stream_get_fd:
33012  * @stream: a #GUnixInputStream
33013  *
33014  * Return the UNIX file descriptor that the stream reads from.
33015  *
33016  * Returns: The file descriptor of @stream
33017  * Since: 2.20
33018  */
33019
33020
33021 /**
33022  * g_unix_input_stream_new:
33023  * @fd: a UNIX file descriptor
33024  * @close_fd: %TRUE to close the file descriptor when done
33025  *
33026  * Creates a new #GUnixInputStream for the given @fd.
33027  *
33028  * If @close_fd is %TRUE, the file descriptor will be closed
33029  * when the stream is closed.
33030  *
33031  * Returns: a new #GUnixInputStream
33032  */
33033
33034
33035 /**
33036  * g_unix_input_stream_set_close_fd:
33037  * @stream: a #GUnixInputStream
33038  * @close_fd: %TRUE to close the file descriptor when done
33039  *
33040  * Sets whether the file descriptor of @stream shall be closed
33041  * when the stream is closed.
33042  *
33043  * Since: 2.20
33044  */
33045
33046
33047 /**
33048  * g_unix_is_mount_path_system_internal:
33049  * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
33050  *
33051  * Determines if @mount_path is considered an implementation of the
33052  * OS. This is primarily used for hiding mountable and mounted volumes
33053  * that only are used in the OS and has little to no relevance to the
33054  * casual user.
33055  *
33056  * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
33057  */
33058
33059
33060 /**
33061  * g_unix_mount_at: (skip)
33062  * @mount_path: path for a possible unix mount.
33063  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33064  *
33065  * Gets a #GUnixMountEntry for a given mount path. If @time_read
33066  * is set, it will be filled with a unix timestamp for checking
33067  * if the mounts have changed since with g_unix_mounts_changed_since().
33068  *
33069  * Returns: (transfer full): a #GUnixMountEntry.
33070  */
33071
33072
33073 /**
33074  * g_unix_mount_compare:
33075  * @mount1: first #GUnixMountEntry to compare.
33076  * @mount2: second #GUnixMountEntry to compare.
33077  *
33078  * Compares two unix mounts.
33079  *
33080  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33081  */
33082
33083
33084 /**
33085  * g_unix_mount_free:
33086  * @mount_entry: a #GUnixMountEntry.
33087  *
33088  * Frees a unix mount.
33089  */
33090
33091
33092 /**
33093  * g_unix_mount_get_device_path:
33094  * @mount_entry: a #GUnixMount.
33095  *
33096  * Gets the device path for a unix mount.
33097  *
33098  * Returns: a string containing the device path.
33099  */
33100
33101
33102 /**
33103  * g_unix_mount_get_fs_type:
33104  * @mount_entry: a #GUnixMount.
33105  *
33106  * Gets the filesystem type for the unix mount.
33107  *
33108  * Returns: a string containing the file system type.
33109  */
33110
33111
33112 /**
33113  * g_unix_mount_get_mount_path:
33114  * @mount_entry: input #GUnixMountEntry to get the mount path for.
33115  *
33116  * Gets the mount path for a unix mount.
33117  *
33118  * Returns: the mount path for @mount_entry.
33119  */
33120
33121
33122 /**
33123  * g_unix_mount_guess_can_eject:
33124  * @mount_entry: a #GUnixMountEntry
33125  *
33126  * Guesses whether a Unix mount can be ejected.
33127  *
33128  * Returns: %TRUE if @mount_entry is deemed to be ejectable.
33129  */
33130
33131
33132 /**
33133  * g_unix_mount_guess_icon:
33134  * @mount_entry: a #GUnixMountEntry
33135  *
33136  * Guesses the icon of a Unix mount.
33137  *
33138  * Returns: (transfer full): a #GIcon
33139  */
33140
33141
33142 /**
33143  * g_unix_mount_guess_name:
33144  * @mount_entry: a #GUnixMountEntry
33145  *
33146  * Guesses the name of a Unix mount.
33147  * The result is a translated string.
33148  *
33149  * Returns: A newly allocated string that must be freed with g_free()
33150  */
33151
33152
33153 /**
33154  * g_unix_mount_guess_should_display:
33155  * @mount_entry: a #GUnixMountEntry
33156  *
33157  * Guesses whether a Unix mount should be displayed in the UI.
33158  *
33159  * Returns: %TRUE if @mount_entry is deemed to be displayable.
33160  */
33161
33162
33163 /**
33164  * g_unix_mount_guess_symbolic_icon:
33165  * @mount_entry: a #GUnixMountEntry
33166  *
33167  * Guesses the symbolic icon of a Unix mount.
33168  *
33169  * Returns: (transfer full): a #GIcon
33170  * Since: 2.34
33171  */
33172
33173
33174 /**
33175  * g_unix_mount_is_readonly:
33176  * @mount_entry: a #GUnixMount.
33177  *
33178  * Checks if a unix mount is mounted read only.
33179  *
33180  * Returns: %TRUE if @mount_entry is read only.
33181  */
33182
33183
33184 /**
33185  * g_unix_mount_is_system_internal:
33186  * @mount_entry: a #GUnixMount.
33187  *
33188  * Checks if a unix mount is a system path.
33189  *
33190  * Returns: %TRUE if the unix mount is for a system path.
33191  */
33192
33193
33194 /**
33195  * g_unix_mount_monitor_new:
33196  *
33197  * Gets a new #GUnixMountMonitor. The default rate limit for which the
33198  * monitor will report consecutive changes for the mount and mount
33199  * point entry files is the default for a #GFileMonitor. Use
33200  * g_unix_mount_monitor_set_rate_limit() to change this.
33201  *
33202  * Returns: a #GUnixMountMonitor.
33203  */
33204
33205
33206 /**
33207  * g_unix_mount_monitor_set_rate_limit:
33208  * @mount_monitor: a #GUnixMountMonitor
33209  * @limit_msec: a integer with the limit in milliseconds to poll for changes.
33210  *
33211  * Sets the rate limit to which the @mount_monitor will report
33212  * consecutive change events to the mount and mount point entry files.
33213  *
33214  * Since: 2.18
33215  */
33216
33217
33218 /**
33219  * g_unix_mount_point_compare:
33220  * @mount1: a #GUnixMount.
33221  * @mount2: a #GUnixMount.
33222  *
33223  * Compares two unix mount points.
33224  *
33225  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33226  */
33227
33228
33229 /**
33230  * g_unix_mount_point_free:
33231  * @mount_point: unix mount point to free.
33232  *
33233  * Frees a unix mount point.
33234  */
33235
33236
33237 /**
33238  * g_unix_mount_point_get_device_path:
33239  * @mount_point: a #GUnixMountPoint.
33240  *
33241  * Gets the device path for a unix mount point.
33242  *
33243  * Returns: a string containing the device path.
33244  */
33245
33246
33247 /**
33248  * g_unix_mount_point_get_fs_type:
33249  * @mount_point: a #GUnixMountPoint.
33250  *
33251  * Gets the file system type for the mount point.
33252  *
33253  * Returns: a string containing the file system type.
33254  */
33255
33256
33257 /**
33258  * g_unix_mount_point_get_mount_path:
33259  * @mount_point: a #GUnixMountPoint.
33260  *
33261  * Gets the mount path for a unix mount point.
33262  *
33263  * Returns: a string containing the mount path.
33264  */
33265
33266
33267 /**
33268  * g_unix_mount_point_get_options:
33269  * @mount_point: a #GUnixMountPoint.
33270  *
33271  * Gets the options for the mount point.
33272  *
33273  * Returns: a string containing the options.
33274  * Since: 2.32
33275  */
33276
33277
33278 /**
33279  * g_unix_mount_point_guess_can_eject:
33280  * @mount_point: a #GUnixMountPoint
33281  *
33282  * Guesses whether a Unix mount point can be ejected.
33283  *
33284  * Returns: %TRUE if @mount_point is deemed to be ejectable.
33285  */
33286
33287
33288 /**
33289  * g_unix_mount_point_guess_icon:
33290  * @mount_point: a #GUnixMountPoint
33291  *
33292  * Guesses the icon of a Unix mount point.
33293  *
33294  * Returns: (transfer full): a #GIcon
33295  */
33296
33297
33298 /**
33299  * g_unix_mount_point_guess_name:
33300  * @mount_point: a #GUnixMountPoint
33301  *
33302  * Guesses the name of a Unix mount point.
33303  * The result is a translated string.
33304  *
33305  * Returns: A newly allocated string that must be freed with g_free()
33306  */
33307
33308
33309 /**
33310  * g_unix_mount_point_guess_symbolic_icon:
33311  * @mount_point: a #GUnixMountPoint
33312  *
33313  * Guesses the symbolic icon of a Unix mount point.
33314  *
33315  * Returns: (transfer full): a #GIcon
33316  * Since: 2.34
33317  */
33318
33319
33320 /**
33321  * g_unix_mount_point_is_loopback:
33322  * @mount_point: a #GUnixMountPoint.
33323  *
33324  * Checks if a unix mount point is a loopback device.
33325  *
33326  * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
33327  */
33328
33329
33330 /**
33331  * g_unix_mount_point_is_readonly:
33332  * @mount_point: a #GUnixMountPoint.
33333  *
33334  * Checks if a unix mount point is read only.
33335  *
33336  * Returns: %TRUE if a mount point is read only.
33337  */
33338
33339
33340 /**
33341  * g_unix_mount_point_is_user_mountable:
33342  * @mount_point: a #GUnixMountPoint.
33343  *
33344  * Checks if a unix mount point is mountable by the user.
33345  *
33346  * Returns: %TRUE if the mount point is user mountable.
33347  */
33348
33349
33350 /**
33351  * g_unix_mount_points_changed_since:
33352  * @time: guint64 to contain a timestamp.
33353  *
33354  * Checks if the unix mount points have changed since a given unix time.
33355  *
33356  * Returns: %TRUE if the mount points have changed since @time.
33357  */
33358
33359
33360 /**
33361  * g_unix_mount_points_get: (skip)
33362  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33363  *
33364  * Gets a #GList of #GUnixMountPoint containing the unix mount points.
33365  * If @time_read is set, it will be filled with the mount timestamp,
33366  * allowing for checking if the mounts have changed with
33367  * g_unix_mount_points_changed_since().
33368  *
33369  * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
33370  */
33371
33372
33373 /**
33374  * g_unix_mounts_changed_since:
33375  * @time: guint64 to contain a timestamp.
33376  *
33377  * Checks if the unix mounts have changed since a given unix time.
33378  *
33379  * Returns: %TRUE if the mounts have changed since @time.
33380  */
33381
33382
33383 /**
33384  * g_unix_mounts_get: (skip)
33385  * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
33386  *
33387  * Gets a #GList of #GUnixMountEntry containing the unix mounts.
33388  * If @time_read is set, it will be filled with the mount
33389  * timestamp, allowing for checking if the mounts have changed
33390  * with g_unix_mounts_changed_since().
33391  *
33392  * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
33393  */
33394
33395
33396 /**
33397  * g_unix_output_stream_get_close_fd:
33398  * @stream: a #GUnixOutputStream
33399  *
33400  * Returns whether the file descriptor of @stream will be
33401  * closed when the stream is closed.
33402  *
33403  * Returns: %TRUE if the file descriptor is closed when done
33404  * Since: 2.20
33405  */
33406
33407
33408 /**
33409  * g_unix_output_stream_get_fd:
33410  * @stream: a #GUnixOutputStream
33411  *
33412  * Return the UNIX file descriptor that the stream writes to.
33413  *
33414  * Returns: The file descriptor of @stream
33415  * Since: 2.20
33416  */
33417
33418
33419 /**
33420  * g_unix_output_stream_new:
33421  * @fd: a UNIX file descriptor
33422  * @close_fd: %TRUE to close the file descriptor when done
33423  *
33424  * Creates a new #GUnixOutputStream for the given @fd.
33425  *
33426  * If @close_fd, is %TRUE, the file descriptor will be closed when
33427  * the output stream is destroyed.
33428  *
33429  * Returns: a new #GOutputStream
33430  */
33431
33432
33433 /**
33434  * g_unix_output_stream_set_close_fd:
33435  * @stream: a #GUnixOutputStream
33436  * @close_fd: %TRUE to close the file descriptor when done
33437  *
33438  * Sets whether the file descriptor of @stream shall be closed
33439  * when the stream is closed.
33440  *
33441  * Since: 2.20
33442  */
33443
33444
33445 /**
33446  * g_unix_socket_address_abstract_names_supported:
33447  *
33448  * Checks if abstract UNIX domain socket names are supported.
33449  *
33450  * Returns: %TRUE if supported, %FALSE otherwise
33451  * Since: 2.22
33452  */
33453
33454
33455 /**
33456  * g_unix_socket_address_get_address_type:
33457  * @address: a #GInetSocketAddress
33458  *
33459  * Gets @address's type.
33460  *
33461  * Returns: a #GUnixSocketAddressType
33462  * Since: 2.26
33463  */
33464
33465
33466 /**
33467  * g_unix_socket_address_get_is_abstract:
33468  * @address: a #GInetSocketAddress
33469  *
33470  * Tests if @address is abstract.
33471  *
33472  * Returns: %TRUE if the address is abstract, %FALSE otherwise
33473  * Since: 2.22
33474  * Deprecated: Use g_unix_socket_address_get_address_type()
33475  */
33476
33477
33478 /**
33479  * g_unix_socket_address_get_path:
33480  * @address: a #GInetSocketAddress
33481  *
33482  * Gets @address's path, or for abstract sockets the "name".
33483  *
33484  * Guaranteed to be zero-terminated, but an abstract socket
33485  * may contain embedded zeros, and thus you should use
33486  * g_unix_socket_address_get_path_len() to get the true length
33487  * of this string.
33488  *
33489  * Returns: the path for @address
33490  * Since: 2.22
33491  */
33492
33493
33494 /**
33495  * g_unix_socket_address_get_path_len:
33496  * @address: a #GInetSocketAddress
33497  *
33498  * Gets the length of @address's path.
33499  *
33500  * For details, see g_unix_socket_address_get_path().
33501  *
33502  * Returns: the length of the path
33503  * Since: 2.22
33504  */
33505
33506
33507 /**
33508  * g_unix_socket_address_new:
33509  * @path: the socket path
33510  *
33511  * Creates a new #GUnixSocketAddress for @path.
33512  *
33513  * To create abstract socket addresses, on systems that support that,
33514  * use g_unix_socket_address_new_abstract().
33515  *
33516  * Returns: a new #GUnixSocketAddress
33517  * Since: 2.22
33518  */
33519
33520
33521 /**
33522  * g_unix_socket_address_new_abstract:
33523  * @path: (array length=path_len) (element-type gchar): the abstract name
33524  * @path_len: the length of @path, or -1
33525  *
33526  * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
33527  * #GUnixSocketAddress for @path.
33528  *
33529  * Returns: a new #GUnixSocketAddress
33530  * Deprecated: Use g_unix_socket_address_new_with_type().
33531  */
33532
33533
33534 /**
33535  * g_unix_socket_address_new_with_type:
33536  * @path: (array length=path_len) (element-type gchar): the name
33537  * @path_len: the length of @path, or -1
33538  * @type: a #GUnixSocketAddressType
33539  *
33540  * Creates a new #GUnixSocketAddress of type @type with name @path.
33541  *
33542  * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
33543  * calling g_unix_socket_address_new().
33544  *
33545  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
33546  * bytes of @path will be copied to the socket's path, and only those
33547  * bytes will be considered part of the name. (If @path_len is -1,
33548  * then @path is assumed to be NUL-terminated.) For example, if @path
33549  * was "test", then calling g_socket_address_get_native_size() on the
33550  * returned socket would return 7 (2 bytes of overhead, 1 byte for the
33551  * abstract-socket indicator byte, and 4 bytes for the name "test").
33552  *
33553  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
33554  * @path_len bytes of @path will be copied to the socket's path, the
33555  * rest of the path will be padded with 0 bytes, and the entire
33556  * zero-padded buffer will be considered the name. (As above, if
33557  * @path_len is -1, then @path is assumed to be NUL-terminated.) In
33558  * this case, g_socket_address_get_native_size() will always return
33559  * the full size of a <literal>struct sockaddr_un</literal>, although
33560  * g_unix_socket_address_get_path_len() will still return just the
33561  * length of @path.
33562  *
33563  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
33564  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
33565  * when connecting to a server created by another process, you must
33566  * use the appropriate type corresponding to how that process created
33567  * its listening socket.
33568  *
33569  * Returns: a new #GUnixSocketAddress
33570  * Since: 2.26
33571  */
33572
33573
33574 /**
33575  * g_vfs_get_default:
33576  *
33577  * Gets the default #GVfs for the system.
33578  *
33579  * Returns: (transfer none): a #GVfs.
33580  */
33581
33582
33583 /**
33584  * g_vfs_get_file_for_path:
33585  * @vfs: a #GVfs.
33586  * @path: a string containing a VFS path.
33587  *
33588  * Gets a #GFile for @path.
33589  *
33590  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33591  */
33592
33593
33594 /**
33595  * g_vfs_get_file_for_uri:
33596  * @vfs: a#GVfs.
33597  * @uri: a string containing a URI
33598  *
33599  * Gets a #GFile for @uri.
33600  *
33601  * This operation never fails, but the returned object
33602  * might not support any I/O operation if the URI
33603  * is malformed or if the URI scheme is not supported.
33604  *
33605  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33606  */
33607
33608
33609 /**
33610  * g_vfs_get_local:
33611  *
33612  * Gets the local #GVfs for the system.
33613  *
33614  * Returns: (transfer none): a #GVfs.
33615  */
33616
33617
33618 /**
33619  * g_vfs_get_supported_uri_schemes:
33620  * @vfs: a #GVfs.
33621  *
33622  * Gets a list of URI schemes supported by @vfs.
33623  *
33624  * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
33625  */
33626
33627
33628 /**
33629  * g_vfs_is_active:
33630  * @vfs: a #GVfs.
33631  *
33632  * Checks if the VFS is active.
33633  *
33634  * Returns: %TRUE if construction of the @vfs was successful and it is now active.
33635  */
33636
33637
33638 /**
33639  * g_vfs_parse_name:
33640  * @vfs: a #GVfs.
33641  * @parse_name: a string to be parsed by the VFS module.
33642  *
33643  * This operation never fails, but the returned object might
33644  * not support any I/O operations if the @parse_name cannot
33645  * be parsed by the #GVfs module.
33646  *
33647  * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
33648  */
33649
33650
33651 /**
33652  * g_volume_can_eject:
33653  * @volume: a #GVolume.
33654  *
33655  * Checks if a volume can be ejected.
33656  *
33657  * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
33658  */
33659
33660
33661 /**
33662  * g_volume_can_mount:
33663  * @volume: a #GVolume.
33664  *
33665  * Checks if a volume can be mounted.
33666  *
33667  * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
33668  */
33669
33670
33671 /**
33672  * g_volume_eject:
33673  * @volume: a #GVolume.
33674  * @flags: flags affecting the unmount if required for eject
33675  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33676  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33677  * @user_data: user data that gets passed to @callback
33678  *
33679  * Ejects a volume. This is an asynchronous operation, and is
33680  * finished by calling g_volume_eject_finish() with the @volume
33681  * and #GAsyncResult returned in the @callback.
33682  *
33683  * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
33684  */
33685
33686
33687 /**
33688  * g_volume_eject_finish:
33689  * @volume: pointer to a #GVolume.
33690  * @result: a #GAsyncResult.
33691  * @error: a #GError location to store an error, or %NULL to ignore
33692  *
33693  * Finishes ejecting a volume. If any errors occurred during the operation,
33694  * @error will be set to contain the errors and %FALSE will be returned.
33695  *
33696  * Returns: %TRUE, %FALSE if operation failed.
33697  * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
33698  */
33699
33700
33701 /**
33702  * g_volume_eject_with_operation:
33703  * @volume: a #GVolume.
33704  * @flags: flags affecting the unmount if required for eject
33705  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33706  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33707  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33708  * @user_data: user data passed to @callback.
33709  *
33710  * Ejects a volume. This is an asynchronous operation, and is
33711  * finished by calling g_volume_eject_with_operation_finish() with the @volume
33712  * and #GAsyncResult data returned in the @callback.
33713  *
33714  * Since: 2.22
33715  */
33716
33717
33718 /**
33719  * g_volume_eject_with_operation_finish:
33720  * @volume: a #GVolume.
33721  * @result: a #GAsyncResult.
33722  * @error: a #GError location to store the error occurring, or %NULL to ignore.
33723  *
33724  * Finishes ejecting a volume. If any errors occurred during the operation,
33725  * @error will be set to contain the errors and %FALSE will be returned.
33726  *
33727  * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
33728  * Since: 2.22
33729  */
33730
33731
33732 /**
33733  * g_volume_enumerate_identifiers:
33734  * @volume: a #GVolume
33735  *
33736  * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
33737  * that @volume has. Use g_volume_get_identifier() to obtain
33738  * the identifiers themselves.
33739  *
33740  * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
33741  */
33742
33743
33744 /**
33745  * g_volume_get_activation_root:
33746  * @volume: a #GVolume
33747  *
33748  * Gets the activation root for a #GVolume if it is known ahead of
33749  * mount time. Returns %NULL otherwise. If not %NULL and if @volume
33750  * is mounted, then the result of g_mount_get_root() on the
33751  * #GMount object obtained from g_volume_get_mount() will always
33752  * either be equal or a prefix of what this function returns. In
33753  * other words, in code
33754  *
33755  * <programlisting>
33756  *   GMount *mount;
33757  *   GFile *mount_root
33758  *   GFile *volume_activation_root;
33759  *
33760  *   mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
33761  *   mount_root = g_mount_get_root (mount);
33762  *   volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
33763  * </programlisting>
33764  *
33765  * then the expression
33766  *
33767  * <programlisting>
33768  *   (g_file_has_prefix (volume_activation_root, mount_root) ||
33769  *       g_file_equal (volume_activation_root, mount_root))
33770  * </programlisting>
33771  *
33772  * will always be %TRUE.
33773  *
33774  * Activation roots are typically used in #GVolumeMonitor
33775  * implementations to find the underlying mount to shadow, see
33776  * g_mount_is_shadowed() for more details.
33777  *
33778  * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
33779  * Since: 2.18
33780  */
33781
33782
33783 /**
33784  * g_volume_get_drive:
33785  * @volume: a #GVolume.
33786  *
33787  * Gets the drive for the @volume.
33788  *
33789  * Returns: (transfer full): a #GDrive or %NULL if @volume is not associated with a drive. The returned object should be unreffed with g_object_unref() when no longer needed.
33790  */
33791
33792
33793 /**
33794  * g_volume_get_icon:
33795  * @volume: a #GVolume.
33796  *
33797  * Gets the icon for @volume.
33798  *
33799  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33800  */
33801
33802
33803 /**
33804  * g_volume_get_identifier:
33805  * @volume: a #GVolume
33806  * @kind: the kind of identifier to return
33807  *
33808  * Gets the identifier of the given kind for @volume.
33809  * See the <link linkend="volume-identifier">introduction</link>
33810  * for more information about volume identifiers.
33811  *
33812  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
33813  */
33814
33815
33816 /**
33817  * g_volume_get_mount:
33818  * @volume: a #GVolume.
33819  *
33820  * Gets the mount for the @volume.
33821  *
33822  * Returns: (transfer full): a #GMount or %NULL if @volume isn't mounted. The returned object should be unreffed with g_object_unref() when no longer needed.
33823  */
33824
33825
33826 /**
33827  * g_volume_get_name:
33828  * @volume: a #GVolume.
33829  *
33830  * Gets the name of @volume.
33831  *
33832  * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
33833  */
33834
33835
33836 /**
33837  * g_volume_get_sort_key:
33838  * @volume: A #GVolume.
33839  *
33840  * Gets the sort key for @volume, if any.
33841  *
33842  * Returns: Sorting key for @volume or %NULL if no such key is available.
33843  * Since: 2.32
33844  */
33845
33846
33847 /**
33848  * g_volume_get_symbolic_icon:
33849  * @volume: a #GVolume.
33850  *
33851  * Gets the symbolic icon for @volume.
33852  *
33853  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33854  * Since: 2.34
33855  */
33856
33857
33858 /**
33859  * g_volume_get_uuid:
33860  * @volume: a #GVolume.
33861  *
33862  * Gets the UUID for the @volume. The reference is typically based on
33863  * the file system UUID for the volume in question and should be
33864  * considered an opaque string. Returns %NULL if there is no UUID
33865  * available.
33866  *
33867  * Returns: the UUID for @volume or %NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed.
33868  */
33869
33870
33871 /**
33872  * g_volume_monitor_adopt_orphan_mount:
33873  * @mount: a #GMount object to find a parent for
33874  *
33875  * This function should be called by any #GVolumeMonitor
33876  * implementation when a new #GMount object is created that is not
33877  * associated with a #GVolume object. It must be called just before
33878  * emitting the @mount_added signal.
33879  *
33880  * If the return value is not %NULL, the caller must associate the
33881  * returned #GVolume object with the #GMount. This involves returning
33882  * it in its g_mount_get_volume() implementation. The caller must
33883  * also listen for the "removed" signal on the returned object
33884  * and give up its reference when handling that signal
33885  *
33886  * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
33887  * the implementor must take a reference to @mount and return it in
33888  * its g_volume_get_mount() implemented. Also, the implementor must
33889  * listen for the "unmounted" signal on @mount and give up its
33890  * reference upon handling that signal.
33891  *
33892  * There are two main use cases for this function.
33893  *
33894  * One is when implementing a user space file system driver that reads
33895  * blocks of a block device that is already represented by the native
33896  * volume monitor (for example a CD Audio file system driver). Such
33897  * a driver will generate its own #GMount object that needs to be
33898  * associated with the #GVolume object that represents the volume.
33899  *
33900  * The other is for implementing a #GVolumeMonitor whose sole purpose
33901  * is to return #GVolume objects representing entries in the users
33902  * "favorite servers" list or similar.
33903  *
33904  * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
33905  * Deprecated: 2.20: Instead of using this function, #GVolumeMonitor implementations should instead create shadow mounts with the URI of the mount they intend to adopt. See the proxy volume monitor in gvfs for an example of this. Also see g_mount_is_shadowed(), g_mount_shadow() and g_mount_unshadow() functions.
33906  */
33907
33908
33909 /**
33910  * g_volume_monitor_get:
33911  *
33912  * Gets the volume monitor used by gio.
33913  *
33914  * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
33915  */
33916
33917
33918 /**
33919  * g_volume_monitor_get_connected_drives:
33920  * @volume_monitor: a #GVolumeMonitor.
33921  *
33922  * Gets a list of drives connected to the system.
33923  *
33924  * The returned list should be freed with g_list_free(), after
33925  * its elements have been unreffed with g_object_unref().
33926  *
33927  * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33928  */
33929
33930
33931 /**
33932  * g_volume_monitor_get_mount_for_uuid:
33933  * @volume_monitor: a #GVolumeMonitor.
33934  * @uuid: the UUID to look for
33935  *
33936  * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33937  *
33938  * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33939  */
33940
33941
33942 /**
33943  * g_volume_monitor_get_mounts:
33944  * @volume_monitor: a #GVolumeMonitor.
33945  *
33946  * Gets a list of the mounts on the system.
33947  *
33948  * The returned list should be freed with g_list_free(), after
33949  * its elements have been unreffed with g_object_unref().
33950  *
33951  * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33952  */
33953
33954
33955 /**
33956  * g_volume_monitor_get_volume_for_uuid:
33957  * @volume_monitor: a #GVolumeMonitor.
33958  * @uuid: the UUID to look for
33959  *
33960  * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33961  *
33962  * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33963  */
33964
33965
33966 /**
33967  * g_volume_monitor_get_volumes:
33968  * @volume_monitor: a #GVolumeMonitor.
33969  *
33970  * Gets a list of the volumes on the system.
33971  *
33972  * The returned list should be freed with g_list_free(), after
33973  * its elements have been unreffed with g_object_unref().
33974  *
33975  * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33976  */
33977
33978
33979 /**
33980  * g_volume_mount:
33981  * @volume: a #GVolume.
33982  * @flags: flags affecting the operation
33983  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33984  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33985  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33986  * @user_data: user data that gets passed to @callback
33987  *
33988  * Mounts a volume. This is an asynchronous operation, and is
33989  * finished by calling g_volume_mount_finish() with the @volume
33990  * and #GAsyncResult returned in the @callback.
33991  *
33992  * Virtual: mount_fn
33993  */
33994
33995
33996 /**
33997  * g_volume_mount_finish:
33998  * @volume: a #GVolume
33999  * @result: a #GAsyncResult
34000  * @error: a #GError location to store an error, or %NULL to ignore
34001  *
34002  * Finishes mounting a volume. If any errors occurred during the operation,
34003  * @error will be set to contain the errors and %FALSE will be returned.
34004  *
34005  * If the mount operation succeeded, g_volume_get_mount() on @volume
34006  * is guaranteed to return the mount right after calling this
34007  * function; there's no need to listen for the 'mount-added' signal on
34008  * #GVolumeMonitor.
34009  *
34010  * Returns: %TRUE, %FALSE if operation failed.
34011  */
34012
34013
34014 /**
34015  * g_volume_should_automount:
34016  * @volume: a #GVolume
34017  *
34018  * Returns whether the volume should be automatically mounted.
34019  *
34020  * Returns: %TRUE if the volume should be automatically mounted.
34021  */
34022
34023
34024 /**
34025  * g_win32_input_stream_get_close_handle:
34026  * @stream: a #GWin32InputStream
34027  *
34028  * Returns whether the handle of @stream will be
34029  * closed when the stream is closed.
34030  *
34031  * Returns: %TRUE if the handle is closed when done
34032  * Since: 2.26
34033  */
34034
34035
34036 /**
34037  * g_win32_input_stream_get_handle:
34038  * @stream: a #GWin32InputStream
34039  *
34040  * Return the Windows file handle that the stream reads from.
34041  *
34042  * Returns: The file handle of @stream
34043  * Since: 2.26
34044  */
34045
34046
34047 /**
34048  * g_win32_input_stream_new:
34049  * @handle: a Win32 file handle
34050  * @close_handle: %TRUE to close the handle when done
34051  *
34052  * Creates a new #GWin32InputStream for the given @handle.
34053  *
34054  * If @close_handle is %TRUE, the handle will be closed
34055  * when the stream is closed.
34056  *
34057  * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
34058  * as used in the Windows C libraries.
34059  *
34060  * Returns: a new #GWin32InputStream
34061  */
34062
34063
34064 /**
34065  * g_win32_input_stream_set_close_handle:
34066  * @stream: a #GWin32InputStream
34067  * @close_handle: %TRUE to close the handle when done
34068  *
34069  * Sets whether the handle of @stream shall be closed
34070  * when the stream is closed.
34071  *
34072  * Since: 2.26
34073  */
34074
34075
34076 /**
34077  * g_win32_output_stream_get_close_handle:
34078  * @stream: a #GWin32OutputStream
34079  *
34080  * Returns whether the handle of @stream will be closed when the
34081  * stream is closed.
34082  *
34083  * Returns: %TRUE if the handle is closed when done
34084  * Since: 2.26
34085  */
34086
34087
34088 /**
34089  * g_win32_output_stream_get_handle:
34090  * @stream: a #GWin32OutputStream
34091  *
34092  * Return the Windows handle that the stream writes to.
34093  *
34094  * Returns: The handle descriptor of @stream
34095  * Since: 2.26
34096  */
34097
34098
34099 /**
34100  * g_win32_output_stream_new:
34101  * @handle: a Win32 file handle
34102  * @close_handle: %TRUE to close the handle when done
34103  *
34104  * Creates a new #GWin32OutputStream for the given @handle.
34105  *
34106  * If @close_handle, is %TRUE, the handle will be closed when the
34107  * output stream is destroyed.
34108  *
34109  * Returns: a new #GOutputStream
34110  * Since: 2.26
34111  */
34112
34113
34114 /**
34115  * g_win32_output_stream_set_close_handle:
34116  * @stream: a #GWin32OutputStream
34117  * @close_handle: %TRUE to close the handle when done
34118  *
34119  * Sets whether the handle of @stream shall be closed when the stream
34120  * is closed.
34121  *
34122  * Since: 2.26
34123  */
34124
34125
34126 /**
34127  * g_zlib_compressor_get_file_info:
34128  * @compressor: a #GZlibCompressor
34129  *
34130  * Returns the #GZlibCompressor:file-info property.
34131  *
34132  * Returns: (transfer none): a #GFileInfo, or %NULL
34133  * Since: 2.26
34134  */
34135
34136
34137 /**
34138  * g_zlib_compressor_new:
34139  * @format: The format to use for the compressed data
34140  * @level: compression level (0-9), -1 for default
34141  *
34142  * Creates a new #GZlibCompressor.
34143  *
34144  * Returns: a new #GZlibCompressor
34145  * Since: 2.24
34146  */
34147
34148
34149 /**
34150  * g_zlib_compressor_set_file_info:
34151  * @compressor: a #GZlibCompressor
34152  * @file_info: (allow-none): a #GFileInfo
34153  *
34154  * Sets @file_info in @compressor. If non-%NULL, and @compressor's
34155  * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34156  * it will be used to set the file name and modification time in
34157  * the GZIP header of the compressed data.
34158  *
34159  * Note: it is an error to call this function while a compression is in
34160  * progress; it may only be called immediately after creation of @compressor,
34161  * or after resetting it with g_converter_reset().
34162  *
34163  * Since: 2.26
34164  */
34165
34166
34167 /**
34168  * g_zlib_decompressor_get_file_info:
34169  * @decompressor: a #GZlibDecompressor
34170  *
34171  * Retrieves the #GFileInfo constructed from the GZIP header data
34172  * of compressed data processed by @compressor, or %NULL if @decompressor's
34173  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34174  * or the header data was not fully processed yet, or it not present in the
34175  * data stream at all.
34176  *
34177  * Returns: (transfer none): a #GFileInfo, or %NULL
34178  * Since: 2.26
34179  */
34180
34181
34182 /**
34183  * g_zlib_decompressor_new:
34184  * @format: The format to use for the compressed data
34185  *
34186  * Creates a new #GZlibDecompressor.
34187  *
34188  * Returns: a new #GZlibDecompressor
34189  * Since: 2.24
34190  */
34191
34192
34193 /**
34194  * get_all_desktop_entries_for_mime_type:
34195  * @mime_type: a mime type.
34196  * @except: NULL or a strv list
34197  *
34198  * Returns all the desktop ids for @mime_type. The desktop files
34199  * are listed in an order so that default applications are listed before
34200  * non-default ones, and handlers for inherited mimetypes are listed
34201  * after the base ones.
34202  *
34203  * Optionally doesn't list the desktop ids given in the @except
34204  *
34205  * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
34206  */
34207
34208
34209 /**
34210  * mime_info_cache_reload:
34211  * @dir: directory path which needs reloading.
34212  *
34213  * Reload the mime information for the @dir.
34214  */
34215
34216
34217
34218 /************************************************************/
34219 /* THIS FILE IS GENERATED DO NOT EDIT */
34220 /************************************************************/