Update glib annotations from git
[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  * GCancellable::cancelled:
265  * @cancellable: a #GCancellable.
266  *
267  * Emitted when the operation has been cancelled.
268  *
269  * Can be used by implementations of cancellable operations. If the
270  * operation is cancelled from another thread, the signal will be
271  * emitted in the thread that cancelled the operation, not the
272  * thread that is running the operation.
273  *
274  * Note that disconnecting from this signal (or any signal) in a
275  * multi-threaded program is prone to race conditions. For instance
276  * it is possible that a signal handler may be invoked even
277  * <emphasis>after</emphasis> a call to
278  * g_signal_handler_disconnect() for that handler has already
279  * returned.
280  *
281  * There is also a problem when cancellation happen
282  * right before connecting to the signal. If this happens the
283  * signal will unexpectedly not be emitted, and checking before
284  * connecting to the signal leaves a race condition where this is
285  * still happening.
286  *
287  * In order to make it safe and easy to connect handlers there
288  * are two helper functions: g_cancellable_connect() and
289  * g_cancellable_disconnect() which protect against problems
290  * like this.
291  *
292  * An example of how to us this:
293  * |[
294  *     /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
295  *     if (g_cancellable_set_error_if_cancelled (cancellable))
296  *       return;
297  *
298  *     /<!-- -->* Set up all the data needed to be able to
299  *      * handle cancellation of the operation *<!-- -->/
300  *     my_data = my_data_new (...);
301  *
302  *     id = 0;
303  *     if (cancellable)
304  *       id = g_cancellable_connect (cancellable,
305  *                            G_CALLBACK (cancelled_handler)
306  *                            data, NULL);
307  *
308  *     /<!-- -->* cancellable operation here... *<!-- -->/
309  *
310  *     g_cancellable_disconnect (cancellable, id);
311  *
312  *     /<!-- -->* cancelled_handler is never called after this, it
313  *      * is now safe to free the data *<!-- -->/
314  *     my_data_free (my_data);
315  * ]|
316  *
317  * Note that the cancelled signal is emitted in the thread that
318  * the user cancelled from, which may be the main thread. So, the
319  * cancellable signal should not do something that can block.
320  */
321
322
323 /**
324  * GCharsetConverter:
325  *
326  * Conversions between character sets.
327  */
328
329
330 /**
331  * GCredentials:
332  *
333  * The #GCredentials structure contains only private data and
334  * should only be accessed using the provided API.
335  *
336  * Since: 2.26
337  */
338
339
340 /**
341  * GCredentialsClass:
342  *
343  * Class structure for #GCredentials.
344  *
345  * Since: 2.26
346  */
347
348
349 /**
350  * GDBusAuthMechanism:credentials:
351  *
352  * If authenticating as a server, this property contains the
353  * received credentials, if any.
354  *
355  * If authenticating as a client, the property contains the
356  * credentials that were sent, if any.
357  */
358
359
360 /**
361  * GDBusAuthObserver:
362  *
363  * The #GDBusAuthObserver structure contains only private data and
364  * should only be accessed using the provided API.
365  *
366  * Since: 2.26
367  */
368
369
370 /**
371  * GDBusAuthObserver::allow-mechanism:
372  * @observer: The #GDBusAuthObserver emitting the signal.
373  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
374  *
375  * Emitted to check if @mechanism is allowed to be used.
376  *
377  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
378  * Since: 2.34
379  */
380
381
382 /**
383  * GDBusAuthObserver::authorize-authenticated-peer:
384  * @observer: The #GDBusAuthObserver emitting the signal.
385  * @stream: A #GIOStream for the #GDBusConnection.
386  * @credentials: (allow-none): Credentials received from the peer or %NULL.
387  *
388  * Emitted to check if a peer that is successfully authenticated
389  * is authorized.
390  *
391  * Returns: %TRUE if the peer is authorized, %FALSE if not.
392  * Since: 2.26
393  */
394
395
396 /**
397  * GDBusAuthObserverClass:
398  * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
399  *
400  * Class structure for #GDBusAuthObserverClass.
401  *
402  * Since: 2.26
403  */
404
405
406 /**
407  * GDBusConnection:
408  *
409  * The #GDBusConnection structure contains only private data and
410  * should only be accessed using the provided API.
411  *
412  * Since: 2.26
413  */
414
415
416 /**
417  * GDBusConnection::closed:
418  * @connection: The #GDBusConnection emitting the signal.
419  * @remote_peer_vanished: %TRUE if @connection is closed because the remote peer closed its end of the connection.
420  * @error: A #GError with more details about the event or %NULL.
421  *
422  * Emitted when the connection is closed.
423  *
424  * The cause of this event can be
425  * <itemizedlist>
426  * <listitem><para>
427  *    If g_dbus_connection_close() is called. In this case
428  *    @remote_peer_vanished is set to %FALSE and @error is %NULL.
429  * </para></listitem>
430  * <listitem><para>
431  *    If the remote peer closes the connection. In this case
432  *    @remote_peer_vanished is set to %TRUE and @error is set.
433  * </para></listitem>
434  * <listitem><para>
435  *    If the remote peer sends invalid or malformed data. In this
436  *    case @remote_peer_vanished is set to %FALSE and @error
437  *    is set.
438  * </para></listitem>
439  * </itemizedlist>
440  *
441  * Upon receiving this signal, you should give up your reference to
442  * @connection. You are guaranteed that this signal is emitted only
443  * once.
444  *
445  * Since: 2.26
446  */
447
448
449 /**
450  * GDBusConnection:address:
451  *
452  * A D-Bus address specifying potential endpoints that can be used
453  * when establishing the connection.
454  *
455  * Since: 2.26
456  */
457
458
459 /**
460  * GDBusConnection:authentication-observer:
461  *
462  * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
463  *
464  * Since: 2.26
465  */
466
467
468 /**
469  * GDBusConnection:capabilities:
470  *
471  * Flags from the #GDBusCapabilityFlags enumeration
472  * representing connection features negotiated with the other peer.
473  *
474  * Since: 2.26
475  */
476
477
478 /**
479  * GDBusConnection:closed:
480  *
481  * A boolean specifying whether the connection has been closed.
482  *
483  * Since: 2.26
484  */
485
486
487 /**
488  * GDBusConnection:exit-on-close:
489  *
490  * A boolean specifying whether the process will be terminated (by
491  * calling <literal>raise(SIGTERM)</literal>) if the connection
492  * is closed by the remote peer.
493  *
494  * Note that #GDBusConnection objects returned by g_bus_get_finish() and
495  * g_bus_get_sync() will (usually) have this property set to %TRUE.
496  *
497  * Since: 2.26
498  */
499
500
501 /**
502  * GDBusConnection:flags:
503  *
504  * Flags from the #GDBusConnectionFlags enumeration.
505  *
506  * Since: 2.26
507  */
508
509
510 /**
511  * GDBusConnection:guid:
512  *
513  * The GUID of the peer performing the role of server when
514  * authenticating.
515  *
516  * If you are constructing a #GDBusConnection and pass
517  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the
518  * #GDBusConnection:flags property then you MUST also set this
519  * property to a valid guid.
520  *
521  * If you are constructing a #GDBusConnection and pass
522  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the
523  * #GDBusConnection:flags property you will be able to read the GUID
524  * of the other peer here after the connection has been successfully
525  * initialized.
526  *
527  * Since: 2.26
528  */
529
530
531 /**
532  * GDBusConnection:locked:
533  *
534  * A boolean specifying whether the message is locked.
535  *
536  * Since: 2.26
537  */
538
539
540 /**
541  * GDBusConnection:stream:
542  *
543  * The underlying #GIOStream used for I/O.
544  *
545  * If this is passed on construction and is a #GSocketConnection,
546  * then the corresponding #GSocket will be put into non-blocking mode.
547  *
548  * While the #GDBusConnection is active, it will interact with this
549  * stream from a worker thread, so it is not safe to interact with
550  * the stream directly.
551  *
552  * Since: 2.26
553  */
554
555
556 /**
557  * GDBusConnection:unique-name:
558  *
559  * The unique name as assigned by the message bus or %NULL if the
560  * connection is not open or not a message bus connection.
561  *
562  * Since: 2.26
563  */
564
565
566 /**
567  * GDBusConnectionClass:
568  * @closed: Signal class handler for the #GDBusConnection::closed signal.
569  *
570  * Class structure for #GDBusConnection.
571  *
572  * Since: 2.26
573  */
574
575
576 /**
577  * GDBusInterfaceSkeleton::g-authorize-method:
578  * @interface: The #GDBusInterfaceSkeleton emitting the signal.
579  * @invocation: A #GDBusMethodInvocation.
580  *
581  * Emitted when a method is invoked by a remote caller and used to
582  * determine if the method call is authorized.
583  *
584  * Note that this signal is emitted in a thread dedicated to
585  * handling the method call so handlers are allowed to perform
586  * blocking IO. This means that it is appropriate to call
587  * e.g. <ulink
588  * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
589  * with the <ulink
590  * 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.
591  *
592  * If %FALSE is returned then no further handlers are run and the
593  * signal handler must take a reference to @invocation and finish
594  * handling the call (e.g. return an error via
595  * g_dbus_method_invocation_return_error()).
596  *
597  * Otherwise, if %TRUE is returned, signal emission continues. If no
598  * handlers return %FALSE, then the method is dispatched. If
599  * @interface has an enclosing #GDBusObjectSkeleton, then the
600  * #GDBusObjectSkeleton::authorize-method signal handlers run before
601  * the handlers for this signal.
602  *
603  * The default class handler just returns %TRUE.
604  *
605  * Please note that the common case is optimized: if no signals
606  * handlers are connected and the default class handler isn't
607  * overridden (for both @interface and the enclosing
608  * #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
609  * not have the
610  * %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
611  * flags set, no dedicated thread is ever used and the call will be
612  * handled in the same thread as the object that @interface belongs
613  * to was exported in.
614  *
615  * Returns: %TRUE if the call is authorized, %FALSE otherwise.
616  * Since: 2.30
617  */
618
619
620 /**
621  * GDBusInterfaceSkeleton:g-flags:
622  *
623  * Flags from the #GDBusInterfaceSkeletonFlags enumeration.
624  *
625  * Since: 2.30
626  */
627
628
629 /**
630  * GDBusMessage:
631  *
632  * The #GDBusMessage structure contains only private data and should
633  * only be accessed using the provided API.
634  *
635  * Since: 2.26
636  */
637
638
639 /**
640  * GDBusMessageClass:
641  *
642  * Class structure for #GDBusMessage.
643  *
644  * Since: 2.26
645  */
646
647
648 /**
649  * GDBusMethodInvocation:
650  *
651  * The #GDBusMethodInvocation structure contains only private data and
652  * should only be accessed using the provided API.
653  *
654  * Since: 2.26
655  */
656
657
658 /**
659  * GDBusMethodInvocationClass:
660  *
661  * Class structure for #GDBusMethodInvocation.
662  *
663  * Since: 2.26
664  */
665
666
667 /**
668  * GDBusObject::interface-added:
669  * @object: The #GDBusObject emitting the signal.
670  * @interface: The #GDBusInterface that was added.
671  *
672  * Emitted when @interface is added to @object.
673  *
674  * Since: 2.30
675  */
676
677
678 /**
679  * GDBusObject::interface-removed:
680  * @object: The #GDBusObject emitting the signal.
681  * @interface: The #GDBusInterface that was removed.
682  *
683  * Emitted when @interface is removed from @object.
684  *
685  * Since: 2.30
686  */
687
688
689 /**
690  * GDBusObjectManager::interface-added:
691  * @manager: The #GDBusObjectManager emitting the signal.
692  * @object: The #GDBusObject on which an interface was added.
693  * @interface: The #GDBusInterface that was added.
694  *
695  * Emitted when @interface is added to @object.
696  *
697  * This signal exists purely as a convenience to avoid having to
698  * connect signals to all objects managed by @manager.
699  *
700  * Since: 2.30
701  */
702
703
704 /**
705  * GDBusObjectManager::interface-removed:
706  * @manager: The #GDBusObjectManager emitting the signal.
707  * @object: The #GDBusObject on which an interface was removed.
708  * @interface: The #GDBusInterface that was removed.
709  *
710  * Emitted when @interface has been removed from @object.
711  *
712  * This signal exists purely as a convenience to avoid having to
713  * connect signals to all objects managed by @manager.
714  *
715  * Since: 2.30
716  */
717
718
719 /**
720  * GDBusObjectManager::object-added:
721  * @manager: The #GDBusObjectManager emitting the signal.
722  * @object: The #GDBusObject that was added.
723  *
724  * Emitted when @object is added to @manager.
725  *
726  * Since: 2.30
727  */
728
729
730 /**
731  * GDBusObjectManager::object-removed:
732  * @manager: The #GDBusObjectManager emitting the signal.
733  * @object: The #GDBusObject that was removed.
734  *
735  * Emitted when @object is removed from @manager.
736  *
737  * Since: 2.30
738  */
739
740
741 /**
742  * GDBusObjectManagerClient::interface-proxy-properties-changed:
743  * @manager: The #GDBusObjectManagerClient emitting the signal.
744  * @object_proxy: The #GDBusObjectProxy on which an interface has properties that are changing.
745  * @interface_proxy: The #GDBusProxy that has properties that are changing.
746  * @changed_properties: A #GVariant containing the properties that changed.
747  * @invalidated_properties: A %NULL terminated array of properties that was invalidated.
748  *
749  * Emitted when one or more D-Bus properties on proxy changes. The
750  * local cache has already been updated when this signal fires. Note
751  * that both @changed_properties and @invalidated_properties are
752  * guaranteed to never be %NULL (either may be empty though).
753  *
754  * This signal exists purely as a convenience to avoid having to
755  * connect signals to all interface proxies managed by @manager.
756  *
757  * This signal is emitted in the
758  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
759  * that @manager was constructed in.
760  *
761  * Since: 2.30
762  */
763
764
765 /**
766  * GDBusObjectManagerClient::interface-proxy-signal:
767  * @manager: The #GDBusObjectManagerClient emitting the signal.
768  * @object_proxy: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
769  * @interface_proxy: The #GDBusProxy that is emitting a D-Bus signal.
770  * @sender_name: The sender of the signal or NULL if the connection is not a bus connection.
771  * @signal_name: The signal name.
772  * @parameters: A #GVariant tuple with parameters for the signal.
773  *
774  * Emitted when a D-Bus signal is received on @interface_proxy.
775  *
776  * This signal exists purely as a convenience to avoid having to
777  * connect signals to all interface proxies managed by @manager.
778  *
779  * This signal is emitted in the
780  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
781  * that @manager was constructed in.
782  *
783  * Since: 2.30
784  */
785
786
787 /**
788  * GDBusObjectManagerClient:bus-type:
789  *
790  * If this property is not %G_BUS_TYPE_NONE, then
791  * #GDBusObjectManagerClient:connection must be %NULL and will be set to the
792  * #GDBusConnection obtained by calling g_bus_get() with the value
793  * of this property.
794  *
795  * Since: 2.30
796  */
797
798
799 /**
800  * GDBusObjectManagerClient:connection:
801  *
802  * The #GDBusConnection to use.
803  *
804  * Since: 2.30
805  */
806
807
808 /**
809  * GDBusObjectManagerClient:flags:
810  *
811  * Flags from the #GDBusObjectManagerClientFlags enumeration.
812  *
813  * Since: 2.30
814  */
815
816
817 /**
818  * GDBusObjectManagerClient:get-proxy-type-destroy-notify:
819  *
820  * A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data.
821  *
822  * Since: 2.30
823  */
824
825
826 /**
827  * GDBusObjectManagerClient:get-proxy-type-func:
828  *
829  * The #GDBusProxyTypeFunc to use when determining what #GType to
830  * use for interface proxies or %NULL.
831  *
832  * Since: 2.30
833  */
834
835
836 /**
837  * GDBusObjectManagerClient:get-proxy-type-user-data:
838  *
839  * The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func.
840  *
841  * Since: 2.30
842  */
843
844
845 /**
846  * GDBusObjectManagerClient:name:
847  *
848  * The well-known name or unique name that the manager is for.
849  *
850  * Since: 2.30
851  */
852
853
854 /**
855  * GDBusObjectManagerClient:name-owner:
856  *
857  * The unique name that owns #GDBusObjectManagerClient:name or %NULL if
858  * no-one is currently owning the name. Connect to the
859  * #GObject::notify signal to track changes to this property.
860  *
861  * Since: 2.30
862  */
863
864
865 /**
866  * GDBusObjectManagerClient:object-path:
867  *
868  * The object path the manager is for.
869  *
870  * Since: 2.30
871  */
872
873
874 /**
875  * GDBusObjectManagerServer:connection:
876  *
877  * The #GDBusConnection to export objects on.
878  *
879  * Since: 2.30
880  */
881
882
883 /**
884  * GDBusObjectManagerServer:object-path:
885  *
886  * The object path to register the manager object at.
887  *
888  * Since: 2.30
889  */
890
891
892 /**
893  * GDBusObjectProxy:g-connection:
894  *
895  * The connection of the proxy.
896  *
897  * Since: 2.30
898  */
899
900
901 /**
902  * GDBusObjectProxy:g-object-path:
903  *
904  * The object path of the proxy.
905  *
906  * Since: 2.30
907  */
908
909
910 /**
911  * GDBusObjectSkeleton::authorize-method:
912  * @object: The #GDBusObjectSkeleton emitting the signal.
913  * @interface: The #GDBusInterfaceSkeleton that @invocation is for.
914  * @invocation: A #GDBusMethodInvocation.
915  *
916  * Emitted when a method is invoked by a remote caller and used to
917  * determine if the method call is authorized.
918  *
919  * This signal is like #GDBusInterfaceSkeleton<!-- -->'s
920  * #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
921  * for the enclosing object.
922  *
923  * The default class handler just returns %TRUE.
924  *
925  * Returns: %TRUE if the call is authorized, %FALSE otherwise.
926  * Since: 2.30
927  */
928
929
930 /**
931  * GDBusObjectSkeleton:g-object-path:
932  *
933  * The object path where the object is exported.
934  *
935  * Since: 2.30
936  */
937
938
939 /**
940  * GDBusProxy::g-properties-changed:
941  * @proxy: The #GDBusProxy emitting the signal.
942  * @changed_properties: A #GVariant containing the properties that changed
943  * @invalidated_properties: A %NULL terminated array of properties that was invalidated
944  *
945  * Emitted when one or more D-Bus properties on @proxy changes. The
946  * local cache has already been updated when this signal fires. Note
947  * that both @changed_properties and @invalidated_properties are
948  * guaranteed to never be %NULL (either may be empty though).
949  *
950  * If the proxy has the flag
951  * %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
952  * @invalidated_properties will always be empty.
953  *
954  * This signal corresponds to the
955  * <literal>PropertiesChanged</literal> D-Bus signal on the
956  * <literal>org.freedesktop.DBus.Properties</literal> interface.
957  *
958  * Since: 2.26
959  */
960
961
962 /**
963  * GDBusProxy::g-signal:
964  * @proxy: The #GDBusProxy emitting the signal.
965  * @sender_name: (allow-none): The sender of the signal or %NULL if the connection is not a bus connection.
966  * @signal_name: The name of the signal.
967  * @parameters: A #GVariant tuple with parameters for the signal.
968  *
969  * Emitted when a signal from the remote object and interface that @proxy is for, has been received.
970  *
971  * Since: 2.26
972  */
973
974
975 /**
976  * GDBusProxy:g-bus-type:
977  *
978  * If this property is not %G_BUS_TYPE_NONE, then
979  * #GDBusProxy:g-connection must be %NULL and will be set to the
980  * #GDBusConnection obtained by calling g_bus_get() with the value
981  * of this property.
982  *
983  * Since: 2.26
984  */
985
986
987 /**
988  * GDBusProxy:g-connection:
989  *
990  * The #GDBusConnection the proxy is for.
991  *
992  * Since: 2.26
993  */
994
995
996 /**
997  * GDBusProxy:g-default-timeout:
998  *
999  * The timeout to use if -1 (specifying default timeout) is passed
1000  * as @timeout_msec in the g_dbus_proxy_call() and
1001  * g_dbus_proxy_call_sync() functions.
1002  *
1003  * This allows applications to set a proxy-wide timeout for all
1004  * remote method invocations on the proxy. If this property is -1,
1005  * the default timeout (typically 25 seconds) is used. If set to
1006  * %G_MAXINT, then no timeout is used.
1007  *
1008  * Since: 2.26
1009  */
1010
1011
1012 /**
1013  * GDBusProxy:g-flags:
1014  *
1015  * Flags from the #GDBusProxyFlags enumeration.
1016  *
1017  * Since: 2.26
1018  */
1019
1020
1021 /**
1022  * GDBusProxy:g-interface-info:
1023  *
1024  * Ensure that interactions with this proxy conform to the given
1025  * interface. This is mainly to ensure that malformed data received
1026  * from the other peer is ignored. The given #GDBusInterfaceInfo is
1027  * said to be the <emphasis>expected interface</emphasis>.
1028  *
1029  * The checks performed are:
1030  * <itemizedlist>
1031  *   <listitem><para>
1032  *     When completing a method call, if the type signature of
1033  *     the reply message isn't what's expected, the reply is
1034  *     discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
1035  *   </para></listitem>
1036  *   <listitem><para>
1037  *     Received signals that have a type signature mismatch are dropped and
1038  *     a warning is logged via g_warning().
1039  *   </para></listitem>
1040  *   <listitem><para>
1041  *     Properties received via the initial <literal>GetAll()</literal> call
1042  *     or via the <literal>::PropertiesChanged</literal> signal (on the
1043  *     <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.DBus.Properties</ulink> interface) or
1044  *     set using g_dbus_proxy_set_cached_property() with a type signature
1045  *     mismatch are ignored and a warning is logged via g_warning().
1046  *   </para></listitem>
1047  * </itemizedlist>
1048  * Note that these checks are never done on methods, signals and
1049  * properties that are not referenced in the given
1050  * #GDBusInterfaceInfo, since extending a D-Bus interface on the
1051  * service-side is not considered an ABI break.
1052  *
1053  * Since: 2.26
1054  */
1055
1056
1057 /**
1058  * GDBusProxy:g-interface-name:
1059  *
1060  * The D-Bus interface name the proxy is for.
1061  *
1062  * Since: 2.26
1063  */
1064
1065
1066 /**
1067  * GDBusProxy:g-name:
1068  *
1069  * The well-known or unique name that the proxy is for.
1070  *
1071  * Since: 2.26
1072  */
1073
1074
1075 /**
1076  * GDBusProxy:g-name-owner:
1077  *
1078  * The unique name that owns #GDBusProxy:g-name or %NULL if no-one
1079  * currently owns that name. You may connect to #GObject::notify signal to
1080  * track changes to this property.
1081  *
1082  * Since: 2.26
1083  */
1084
1085
1086 /**
1087  * GDBusProxy:g-object-path:
1088  *
1089  * The object path the proxy is for.
1090  *
1091  * Since: 2.26
1092  */
1093
1094
1095 /**
1096  * GDBusServer:
1097  *
1098  * The #GDBusServer structure contains only private data and
1099  * should only be accessed using the provided API.
1100  *
1101  * Since: 2.26
1102  */
1103
1104
1105 /**
1106  * GDBusServer::new-connection:
1107  * @server: The #GDBusServer emitting the signal.
1108  * @connection: A #GDBusConnection for the new connection.
1109  *
1110  * Emitted when a new authenticated connection has been made. Use
1111  * g_dbus_connection_get_peer_credentials() to figure out what
1112  * identity (if any), was authenticated.
1113  *
1114  * If you want to accept the connection, take a reference to the
1115  * @connection object and return %TRUE. When you are done with the
1116  * connection call g_dbus_connection_close() and give up your
1117  * reference. Note that the other peer may disconnect at any time -
1118  * a typical thing to do when accepting a connection is to listen to
1119  * the #GDBusConnection::closed signal.
1120  *
1121  * If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
1122  * then the signal is emitted in a new thread dedicated to the
1123  * connection. Otherwise the signal is emitted in the <link
1124  * linkend="g-main-context-push-thread-default">thread-default main
1125  * loop</link> of the thread that @server was constructed in.
1126  *
1127  * You are guaranteed that signal handlers for this signal runs
1128  * before incoming messages on @connection are processed. This means
1129  * that it's suitable to call g_dbus_connection_register_object() or
1130  * similar from the signal handler.
1131  *
1132  * Returns: %TRUE to claim @connection, %FALSE to let other handlers run.
1133  * Since: 2.26
1134  */
1135
1136
1137 /**
1138  * GDBusServer:active:
1139  *
1140  * Whether the server is currently active.
1141  *
1142  * Since: 2.26
1143  */
1144
1145
1146 /**
1147  * GDBusServer:address:
1148  *
1149  * The D-Bus address to listen on.
1150  *
1151  * Since: 2.26
1152  */
1153
1154
1155 /**
1156  * GDBusServer:authentication-observer:
1157  *
1158  * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
1159  *
1160  * Since: 2.26
1161  */
1162
1163
1164 /**
1165  * GDBusServer:client-address:
1166  *
1167  * The D-Bus address that clients can use.
1168  *
1169  * Since: 2.26
1170  */
1171
1172
1173 /**
1174  * GDBusServer:flags:
1175  *
1176  * Flags from the #GDBusServerFlags enumeration.
1177  *
1178  * Since: 2.26
1179  */
1180
1181
1182 /**
1183  * GDBusServer:guid:
1184  *
1185  * The guid of the server.
1186  *
1187  * Since: 2.26
1188  */
1189
1190
1191 /**
1192  * GDBusServerClass:
1193  * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
1194  *
1195  * Class structure for #GDBusServer.
1196  *
1197  * Since: 2.26
1198  */
1199
1200
1201 /**
1202  * GDataOutputStream:byte-order:
1203  *
1204  * Determines the byte ordering that is used when writing
1205  * multi-byte entities (such as integers) to the stream.
1206  */
1207
1208
1209 /**
1210  * GDataStream:byte-order:
1211  *
1212  * The ::byte-order property determines the byte ordering that
1213  * is used when reading multi-byte entities (such as integers)
1214  * from the stream.
1215  */
1216
1217
1218 /**
1219  * GDataStream:newline-type:
1220  *
1221  * The :newline-type property determines what is considered
1222  * as a line ending when reading complete lines from the stream.
1223  */
1224
1225
1226 /**
1227  * GDesktopAppInfo:
1228  *
1229  * Information about an installed application from a desktop file.
1230  */
1231
1232
1233 /**
1234  * GDesktopAppInfo:filename:
1235  *
1236  * The origin filename of this #GDesktopAppInfo
1237  */
1238
1239
1240 /**
1241  * GDrive::changed:
1242  * @drive: a #GDrive.
1243  *
1244  * Emitted when the drive's state has changed.
1245  */
1246
1247
1248 /**
1249  * GDrive::disconnected:
1250  * @drive: a #GDrive.
1251  *
1252  * This signal is emitted when the #GDrive have been
1253  * disconnected. If the recipient is holding references to the
1254  * object they should release them so the object can be
1255  * finalized.
1256  */
1257
1258
1259 /**
1260  * GDrive::eject-button:
1261  * @drive: a #GDrive.
1262  *
1263  * Emitted when the physical eject button (if any) of a drive has
1264  * been pressed.
1265  */
1266
1267
1268 /**
1269  * GDrive::stop-button:
1270  * @drive: a #GDrive.
1271  *
1272  * Emitted when the physical stop button (if any) of a drive has
1273  * been pressed.
1274  *
1275  * Since: 2.22
1276  */
1277
1278
1279 /**
1280  * GFileIcon:file:
1281  *
1282  * The file containing the icon.
1283  */
1284
1285
1286 /**
1287  * GFileMonitor::changed:
1288  * @monitor: a #GFileMonitor.
1289  * @file: a #GFile.
1290  * @other_file: (allow-none): a #GFile or #NULL.
1291  * @event_type: a #GFileMonitorEvent.
1292  *
1293  * Emitted when @file has been changed.
1294  *
1295  * If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
1296  * #G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the
1297  * old path, and @other_file will be set to a #GFile containing the new path.
1298  *
1299  * In all the other cases, @other_file will be set to #NULL.
1300  */
1301
1302
1303 /**
1304  * GFilenameCompleter::got-completion-data:
1305  *
1306  * Emitted when the file name completion information comes available.
1307  */
1308
1309
1310 /**
1311  * GIOModuleScope:
1312  *
1313  * Represents a scope for loading IO modules. A scope can be used for blocking
1314  * duplicate modules, or blocking a module you don't want to load.
1315  *
1316  * The scope can be used with g_io_modules_load_all_in_directory_with_scope()
1317  * or g_io_modules_scan_all_in_directory_with_scope().
1318  *
1319  * Since: 2.30
1320  */
1321
1322
1323 /**
1324  * GInetAddress:
1325  *
1326  * An IPv4 or IPv6 internet address.
1327  */
1328
1329
1330 /**
1331  * GInetAddress:is-any:
1332  *
1333  * Whether this is the "any" address for its family.
1334  * See g_inet_address_get_is_any().
1335  *
1336  * Since: 2.22
1337  */
1338
1339
1340 /**
1341  * GInetAddress:is-link-local:
1342  *
1343  * Whether this is a link-local address.
1344  * See g_inet_address_get_is_link_local().
1345  *
1346  * Since: 2.22
1347  */
1348
1349
1350 /**
1351  * GInetAddress:is-loopback:
1352  *
1353  * Whether this is the loopback address for its family.
1354  * See g_inet_address_get_is_loopback().
1355  *
1356  * Since: 2.22
1357  */
1358
1359
1360 /**
1361  * GInetAddress:is-mc-global:
1362  *
1363  * Whether this is a global multicast address.
1364  * See g_inet_address_get_is_mc_global().
1365  *
1366  * Since: 2.22
1367  */
1368
1369
1370 /**
1371  * GInetAddress:is-mc-link-local:
1372  *
1373  * Whether this is a link-local multicast address.
1374  * See g_inet_address_get_is_mc_link_local().
1375  *
1376  * Since: 2.22
1377  */
1378
1379
1380 /**
1381  * GInetAddress:is-mc-node-local:
1382  *
1383  * Whether this is a node-local multicast address.
1384  * See g_inet_address_get_is_mc_node_local().
1385  *
1386  * Since: 2.22
1387  */
1388
1389
1390 /**
1391  * GInetAddress:is-mc-org-local:
1392  *
1393  * Whether this is an organization-local multicast address.
1394  * See g_inet_address_get_is_mc_org_local().
1395  *
1396  * Since: 2.22
1397  */
1398
1399
1400 /**
1401  * GInetAddress:is-mc-site-local:
1402  *
1403  * Whether this is a site-local multicast address.
1404  * See g_inet_address_get_is_mc_site_local().
1405  *
1406  * Since: 2.22
1407  */
1408
1409
1410 /**
1411  * GInetAddress:is-multicast:
1412  *
1413  * Whether this is a multicast address.
1414  * See g_inet_address_get_is_multicast().
1415  *
1416  * Since: 2.22
1417  */
1418
1419
1420 /**
1421  * GInetAddress:is-site-local:
1422  *
1423  * Whether this is a site-local address.
1424  * See g_inet_address_get_is_loopback().
1425  *
1426  * Since: 2.22
1427  */
1428
1429
1430 /**
1431  * GInetAddressMask:
1432  *
1433  * A combination of an IPv4 or IPv6 base address and a length,
1434  * representing a range of IP addresses.
1435  *
1436  * Since: 2.32
1437  */
1438
1439
1440 /**
1441  * GInetSocketAddress:
1442  *
1443  * An IPv4 or IPv6 socket address, corresponding to a <type>struct
1444  * sockaddr_in</type> or <type>struct sockaddr_in6</type>.
1445  */
1446
1447
1448 /**
1449  * GInetSocketAddress:flowinfo:
1450  *
1451  * The <literal>sin6_flowinfo</literal> field, for IPv6 addresses.
1452  *
1453  * Since: 2.32
1454  */
1455
1456
1457 /**
1458  * GInetSocketAddress:scope_id:
1459  *
1460  * The <literal>sin6_scope_id</literal> field, for IPv6 addresses.
1461  *
1462  * Since: 2.32
1463  */
1464
1465
1466 /**
1467  * GMemoryOutputStream:data:
1468  *
1469  * Pointer to buffer where data will be written.
1470  *
1471  * Since: 2.24
1472  */
1473
1474
1475 /**
1476  * GMemoryOutputStream:data-size:
1477  *
1478  * Size of data written to the buffer.
1479  *
1480  * Since: 2.24
1481  */
1482
1483
1484 /**
1485  * GMemoryOutputStream:destroy-function: (skip)
1486  *
1487  * Function called with the buffer as argument when the stream is destroyed.
1488  *
1489  * Since: 2.24
1490  */
1491
1492
1493 /**
1494  * GMemoryOutputStream:realloc-function: (skip)
1495  *
1496  * Function with realloc semantics called to enlarge the buffer.
1497  *
1498  * Since: 2.24
1499  */
1500
1501
1502 /**
1503  * GMemoryOutputStream:size:
1504  *
1505  * Current size of the data buffer.
1506  *
1507  * Since: 2.24
1508  */
1509
1510
1511 /**
1512  * GMenu:
1513  *
1514  * #GMenu is an opaque structure type.  You must access it using the
1515  * functions below.
1516  *
1517  * Since: 2.32
1518  */
1519
1520
1521 /**
1522  * GMenuAttributeIter:
1523  *
1524  * #GMenuAttributeIter is an opaque structure type.  You must access it
1525  * using the functions below.
1526  *
1527  * Since: 2.32
1528  */
1529
1530
1531 /**
1532  * GMenuItem:
1533  *
1534  * #GMenuItem is an opaque structure type.  You must access it using the
1535  * functions below.
1536  *
1537  * Since: 2.32
1538  */
1539
1540
1541 /**
1542  * GMenuLinkIter:
1543  *
1544  * #GMenuLinkIter is an opaque structure type.  You must access it using
1545  * the functions below.
1546  *
1547  * Since: 2.32
1548  */
1549
1550
1551 /**
1552  * GMenuModel:
1553  *
1554  * #GMenuModel is an opaque structure type.  You must access it using the
1555  * functions below.
1556  *
1557  * Since: 2.32
1558  */
1559
1560
1561 /**
1562  * GMenuModel::items-changed:
1563  * @model: the #GMenuModel that is changing
1564  * @position: the position of the change
1565  * @removed: the number of items removed
1566  * @added: the number of items added
1567  *
1568  * Emitted when a change has occured to the menu.
1569  *
1570  * The only changes that can occur to a menu is that items are removed
1571  * or added.  Items may not change (except by being removed and added
1572  * back in the same location).  This signal is capable of describing
1573  * both of those changes (at the same time).
1574  *
1575  * The signal means that starting at the index @position, @removed
1576  * items were removed and @added items were added in their place.  If
1577  * @removed is zero then only items were added.  If @added is zero
1578  * then only items were removed.
1579  *
1580  * As an example, if the menu contains items a, b, c, d (in that
1581  * order) and the signal (2, 1, 3) occurs then the new composition of
1582  * the menu will be a, b, _, _, _, d (with each _ representing some
1583  * new item).
1584  *
1585  * Signal handlers may query the model (particularly the added items)
1586  * and expect to see the results of the modification that is being
1587  * reported.  The signal is emitted after the modification.
1588  */
1589
1590
1591 /**
1592  * GMount::changed:
1593  * @mount: the object on which the signal is emitted
1594  *
1595  * Emitted when the mount has been changed.
1596  */
1597
1598
1599 /**
1600  * GMount::pre-unmount:
1601  * @mount: the object on which the signal is emitted
1602  *
1603  * This signal is emitted when the #GMount is about to be
1604  * unmounted.
1605  *
1606  * Since: 2.22
1607  */
1608
1609
1610 /**
1611  * GMount::unmounted:
1612  * @mount: the object on which the signal is emitted
1613  *
1614  * This signal is emitted when the #GMount have been
1615  * unmounted. If the recipient is holding references to the
1616  * object they should release them so the object can be
1617  * finalized.
1618  */
1619
1620
1621 /**
1622  * GMountOperation::aborted:
1623  *
1624  * Emitted by the backend when e.g. a device becomes unavailable
1625  * while a mount operation is in progress.
1626  *
1627  * Implementations of GMountOperation should handle this signal
1628  * by dismissing open password dialogs.
1629  *
1630  * Since: 2.20
1631  */
1632
1633
1634 /**
1635  * GMountOperation::ask-password:
1636  * @op: a #GMountOperation requesting a password.
1637  * @message: string containing a message to display to the user.
1638  * @default_user: string containing the default user name.
1639  * @default_domain: string containing the default domain.
1640  * @flags: a set of #GAskPasswordFlags.
1641  *
1642  * Emitted when a mount operation asks the user for a password.
1643  *
1644  * If the message contains a line break, the first line should be
1645  * presented as a heading. For example, it may be used as the
1646  * primary text in a #GtkMessageDialog.
1647  */
1648
1649
1650 /**
1651  * GMountOperation::ask-question:
1652  * @op: a #GMountOperation asking a question.
1653  * @message: string containing a message to display to the user.
1654  * @choices: an array of strings for each possible choice.
1655  *
1656  * Emitted when asking the user a question and gives a list of
1657  * choices for the user to choose from.
1658  *
1659  * If the message contains a line break, the first line should be
1660  * presented as a heading. For example, it may be used as the
1661  * primary text in a #GtkMessageDialog.
1662  */
1663
1664
1665 /**
1666  * GMountOperation::reply:
1667  * @op: a #GMountOperation.
1668  * @result: a #GMountOperationResult indicating how the request was handled
1669  *
1670  * Emitted when the user has replied to the mount operation.
1671  */
1672
1673
1674 /**
1675  * GMountOperation::show-processes:
1676  * @op: a #GMountOperation.
1677  * @message: string containing a message to display to the user.
1678  * @processes: (element-type GPid): an array of #GPid for processes blocking the operation.
1679  * @choices: an array of strings for each possible choice.
1680  *
1681  * Emitted when one or more processes are blocking an operation
1682  * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
1683  *
1684  * Note that this signal may be emitted several times to update the
1685  * list of blocking processes as processes close files. The
1686  * application should only respond with g_mount_operation_reply() to
1687  * the latest signal (setting #GMountOperation:choice to the choice
1688  * the user made).
1689  *
1690  * If the message contains a line break, the first line should be
1691  * presented as a heading. For example, it may be used as the
1692  * primary text in a #GtkMessageDialog.
1693  *
1694  * Since: 2.22
1695  */
1696
1697
1698 /**
1699  * GMountOperation:anonymous:
1700  *
1701  * Whether to use an anonymous user when authenticating.
1702  */
1703
1704
1705 /**
1706  * GMountOperation:choice:
1707  *
1708  * The index of the user's choice when a question is asked during the
1709  * mount operation. See the #GMountOperation::ask-question signal.
1710  */
1711
1712
1713 /**
1714  * GMountOperation:domain:
1715  *
1716  * The domain to use for the mount operation.
1717  */
1718
1719
1720 /**
1721  * GMountOperation:password:
1722  *
1723  * The password that is used for authentication when carrying out
1724  * the mount operation.
1725  */
1726
1727
1728 /**
1729  * GMountOperation:password-save:
1730  *
1731  * Determines if and how the password information should be saved.
1732  */
1733
1734
1735 /**
1736  * GMountOperation:username:
1737  *
1738  * The user name that is used for authentication when carrying out
1739  * the mount operation.
1740  */
1741
1742
1743 /**
1744  * GNetworkAddress:
1745  *
1746  * A #GSocketConnectable for resolving a hostname and connecting to
1747  * that host.
1748  */
1749
1750
1751 /**
1752  * GNetworkMonitor:
1753  *
1754  * #GNetworkMonitor monitors the status of network connections and
1755  * indicates when a possibly-user-visible change has occurred.
1756  *
1757  * Since: 2.32
1758  */
1759
1760
1761 /**
1762  * GNetworkMonitor::network-changed:
1763  * @monitor: a #GNetworkMonitor
1764  * @available: the current value of #GNetworkMonitor:network-available
1765  *
1766  * Emitted when the network configuration changes. If @available is
1767  * %TRUE, then some hosts may be reachable that were not reachable
1768  * before, while others that were reachable before may no longer be
1769  * reachable. If @available is %FALSE, then no remote hosts are
1770  * reachable.
1771  *
1772  * Since: 2.32
1773  */
1774
1775
1776 /**
1777  * GNetworkMonitor:network-available:
1778  *
1779  * Whether the network is considered available. That is, whether the
1780  * system has a default route for at least one of IPv4 or IPv6.
1781  *
1782  * Real-world networks are of course much more complicated than
1783  * this; the machine may be connected to a wifi hotspot that
1784  * requires payment before allowing traffic through, or may be
1785  * connected to a functioning router that has lost its own upstream
1786  * connectivity. Some hosts might only be accessible when a VPN is
1787  * active. Other hosts might only be accessible when the VPN is
1788  * <emphasis>not</emphasis> active. Thus, it is best to use
1789  * g_network_monitor_can_reach() or
1790  * g_network_monitor_can_reach_async() to test for reachability on a
1791  * host-by-host basis. (On the other hand, when the property is
1792  * %FALSE, the application can reasonably expect that no remote
1793  * hosts at all are reachable, and should indicate this to the user
1794  * in its UI.)
1795  *
1796  * See also #GNetworkMonitor::network-changed.
1797  *
1798  * Since: 2.32
1799  */
1800
1801
1802 /**
1803  * GNetworkService:
1804  *
1805  * A #GSocketConnectable for resolving a SRV record and connecting to
1806  * that service.
1807  */
1808
1809
1810 /**
1811  * GPermission:
1812  *
1813  * #GPermission is an opaque data structure and can only be accessed
1814  * using the following functions.
1815  */
1816
1817
1818 /**
1819  * GPermission:allowed:
1820  *
1821  * %TRUE if the caller currently has permission to perform the action that
1822  * @permission represents the permission to perform.
1823  */
1824
1825
1826 /**
1827  * GPermission:can-acquire:
1828  *
1829  * %TRUE if it is generally possible to acquire the permission by calling
1830  * g_permission_acquire().
1831  */
1832
1833
1834 /**
1835  * GPermission:can-release:
1836  *
1837  * %TRUE if it is generally possible to release the permission by calling
1838  * g_permission_release().
1839  */
1840
1841
1842 /**
1843  * GProxyAddress:
1844  *
1845  * A #GInetSocketAddress representing a connection via a proxy server
1846  *
1847  * Since: 2.26
1848  */
1849
1850
1851 /**
1852  * GProxyAddress:destination-protocol:
1853  *
1854  * The protocol being spoke to the destination host, or %NULL if
1855  * the #GProxyAddress doesn't know.
1856  *
1857  * Since: 2.34
1858  */
1859
1860
1861 /**
1862  * GProxyAddress:uri:
1863  *
1864  * The URI string that the proxy was constructed from (or %NULL
1865  * if the creator didn't specify this).
1866  *
1867  * Since: 2.34
1868  */
1869
1870
1871 /**
1872  * GRemoteActionGroupInterface:
1873  * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1874  * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1875  *
1876  * The virtual function table for #GRemoteActionGroup.
1877  *
1878  * Since: 2.32
1879  */
1880
1881
1882 /**
1883  * GResolver:
1884  *
1885  * The object that handles DNS resolution. Use g_resolver_get_default()
1886  * to get the default resolver.
1887  */
1888
1889
1890 /**
1891  * GResolver::reload:
1892  * @resolver: a #GResolver
1893  *
1894  * Emitted when the resolver notices that the system resolver
1895  * configuration has changed.
1896  */
1897
1898
1899 /**
1900  * GSettings::change-event:
1901  * @settings: the object on which the signal was emitted
1902  * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1903  * @n_keys: the length of the @keys array, or 0
1904  *
1905  * The "change-event" signal is emitted once per change event that
1906  * affects this settings object.  You should connect to this signal
1907  * only if you are interested in viewing groups of changes before they
1908  * are split out into multiple emissions of the "changed" signal.
1909  * For most use cases it is more appropriate to use the "changed" signal.
1910  *
1911  * In the event that the change event applies to one or more specified
1912  * keys, @keys will be an array of #GQuark of length @n_keys.  In the
1913  * event that the change event applies to the #GSettings object as a
1914  * whole (ie: potentially every key has been changed) then @keys will
1915  * be %NULL and @n_keys will be 0.
1916  *
1917  * The default handler for this signal invokes the "changed" signal
1918  * for each affected key.  If any other connected handler returns
1919  * %TRUE then this default functionality will be suppressed.
1920  *
1921  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1922  */
1923
1924
1925 /**
1926  * GSettings::changed:
1927  * @settings: the object on which the signal was emitted
1928  * @key: the name of the key that changed
1929  *
1930  * The "changed" signal is emitted when a key has potentially changed.
1931  * You should call one of the g_settings_get() calls to check the new
1932  * value.
1933  *
1934  * This signal supports detailed connections.  You can connect to the
1935  * detailed signal "changed::x" in order to only receive callbacks
1936  * when key "x" changes.
1937  */
1938
1939
1940 /**
1941  * GSettings::writable-change-event:
1942  * @settings: the object on which the signal was emitted
1943  * @key: the quark of the key, or 0
1944  *
1945  * The "writable-change-event" signal is emitted once per writability
1946  * change event that affects this settings object.  You should connect
1947  * to this signal if you are interested in viewing groups of changes
1948  * before they are split out into multiple emissions of the
1949  * "writable-changed" signal.  For most use cases it is more
1950  * appropriate to use the "writable-changed" signal.
1951  *
1952  * In the event that the writability change applies only to a single
1953  * key, @key will be set to the #GQuark for that key.  In the event
1954  * that the writability change affects the entire settings object,
1955  * @key will be 0.
1956  *
1957  * The default handler for this signal invokes the "writable-changed"
1958  * and "changed" signals for each affected key.  This is done because
1959  * changes in writability might also imply changes in value (if for
1960  * example, a new mandatory setting is introduced).  If any other
1961  * connected handler returns %TRUE then this default functionality
1962  * will be suppressed.
1963  *
1964  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1965  */
1966
1967
1968 /**
1969  * GSettings::writable-changed:
1970  * @settings: the object on which the signal was emitted
1971  * @key: the key
1972  *
1973  * The "writable-changed" signal is emitted when the writability of a
1974  * key has potentially changed.  You should call
1975  * g_settings_is_writable() in order to determine the new status.
1976  *
1977  * This signal supports detailed connections.  You can connect to the
1978  * detailed signal "writable-changed::x" in order to only receive
1979  * callbacks when the writability of "x" changes.
1980  */
1981
1982
1983 /**
1984  * GSettings:context:
1985  *
1986  * The name of the context that the settings are stored in.
1987  */
1988
1989
1990 /**
1991  * GSettings:delay-apply:
1992  *
1993  * Whether the #GSettings object is in 'delay-apply' mode. See
1994  * g_settings_delay() for details.
1995  *
1996  * Since: 2.28
1997  */
1998
1999
2000 /**
2001  * GSettings:has-unapplied:
2002  *
2003  * If this property is %TRUE, the #GSettings object has outstanding
2004  * changes that will be applied when g_settings_apply() is called.
2005  */
2006
2007
2008 /**
2009  * GSettings:path:
2010  *
2011  * The path within the backend where the settings are stored.
2012  */
2013
2014
2015 /**
2016  * GSettings:schema:
2017  *
2018  * The name of the schema that describes the types of keys
2019  * for this #GSettings object.
2020  *
2021  * The type of this property is *not* #GSettingsSchema.
2022  * #GSettingsSchema has only existed since version 2.32 and
2023  * unfortunately this name was used in previous versions to refer to
2024  * the schema ID rather than the schema itself.  Take care to use the
2025  * 'settings-schema' property if you wish to pass in a
2026  * #GSettingsSchema.
2027  *
2028  * Deprecated: 2.32:Use the 'schema-id' property instead.  In a future version, this property may instead refer to a #GSettingsSchema.
2029  */
2030
2031
2032 /**
2033  * GSettings:schema-id:
2034  *
2035  * The name of the schema that describes the types of keys
2036  * for this #GSettings object.
2037  */
2038
2039
2040 /**
2041  * GSettings:settings-schema:
2042  *
2043  * The #GSettingsSchema describing the types of keys for this
2044  * #GSettings object.
2045  *
2046  * Ideally, this property would be called 'schema'.  #GSettingsSchema
2047  * has only existed since version 2.32, however, and before then the
2048  * 'schema' property was used to refer to the ID of the schema rather
2049  * than the schema itself.  Take care.
2050  */
2051
2052
2053 /**
2054  * GSettingsSchema:
2055  *
2056  * This is an opaque structure type.  You may not access it directly.
2057  *
2058  * Since: 2.32
2059  */
2060
2061
2062 /**
2063  * GSettingsSchemaSource:
2064  *
2065  * This is an opaque structure type.  You may not access it directly.
2066  *
2067  * Since: 2.32
2068  */
2069
2070
2071 /**
2072  * GSimpleAction::activate:
2073  * @simple: the #GSimpleAction
2074  * @parameter: (allow-none): the parameter to the activation
2075  *
2076  * Indicates that the action was just activated.
2077  *
2078  * @parameter will always be of the expected type.  In the event that
2079  * an incorrect type was given, no signal will be emitted.
2080  *
2081  * Since: 2.28
2082  */
2083
2084
2085 /**
2086  * GSimpleAction::change-state:
2087  * @simple: the #GSimpleAction
2088  * @value: (allow-none): the requested value for the state
2089  *
2090  * Indicates that the action just received a request to change its
2091  * state.
2092  *
2093  * @value will always be of the correct state type.  In the event that
2094  * an incorrect type was given, no signal will be emitted.
2095  *
2096  * If no handler is connected to this signal then the default
2097  * behaviour is to call g_simple_action_set_state() to set the state
2098  * to the requested value.  If you connect a signal handler then no
2099  * default action is taken.  If the state should change then you must
2100  * call g_simple_action_set_state() from the handler.
2101  *
2102  * <example>
2103  * <title>Example 'change-state' handler</title>
2104  * <programlisting>
2105  * static void
2106  * change_volume_state (GSimpleAction *action,
2107  *                      GVariant      *value,
2108  *                      gpointer       user_data)
2109  * {
2110  *   gint requested;
2111  *
2112  *   requested = g_variant_get_int32 (value);
2113  *
2114  *   // Volume only goes from 0 to 10
2115  *   if (0 <= requested && requested <= 10)
2116  *     g_simple_action_set_state (action, value);
2117  * }
2118  * </programlisting>
2119  * </example>
2120  *
2121  * The handler need not set the state to the requested value.  It
2122  * could set it to any value at all, or take some other action.
2123  *
2124  * Since: 2.30
2125  */
2126
2127
2128 /**
2129  * GSimpleAction:enabled:
2130  *
2131  * If @action is currently enabled.
2132  *
2133  * If the action is disabled then calls to g_action_activate() and
2134  * g_action_change_state() have no effect.
2135  *
2136  * Since: 2.28
2137  */
2138
2139
2140 /**
2141  * GSimpleAction:name:
2142  *
2143  * The name of the action.  This is mostly meaningful for identifying
2144  * the action once it has been added to a #GSimpleActionGroup.
2145  *
2146  * Since: 2.28
2147  */
2148
2149
2150 /**
2151  * GSimpleAction:parameter-type:
2152  *
2153  * The type of the parameter that must be given when activating the
2154  * action.
2155  *
2156  * Since: 2.28
2157  */
2158
2159
2160 /**
2161  * GSimpleAction:state:
2162  *
2163  * The state of the action, or %NULL if the action is stateless.
2164  *
2165  * Since: 2.28
2166  */
2167
2168
2169 /**
2170  * GSimpleAction:state-type:
2171  *
2172  * The #GVariantType of the state that the action has, or %NULL if the
2173  * action is stateless.
2174  *
2175  * Since: 2.28
2176  */
2177
2178
2179 /**
2180  * GSimplePermission:
2181  *
2182  * #GSimplePermission is an opaque data structure.  There are no methods
2183  * except for those defined by #GPermission.
2184  */
2185
2186
2187 /**
2188  * GSocket:broadcast:
2189  *
2190  * Whether the socket should allow sending to and receiving from broadcast addresses.
2191  *
2192  * Since: 2.32
2193  */
2194
2195
2196 /**
2197  * GSocket:multicast-loopback:
2198  *
2199  * Whether outgoing multicast packets loop back to the local host.
2200  *
2201  * Since: 2.32
2202  */
2203
2204
2205 /**
2206  * GSocket:multicast-ttl:
2207  *
2208  * Time-to-live out outgoing multicast packets
2209  *
2210  * Since: 2.32
2211  */
2212
2213
2214 /**
2215  * GSocket:timeout:
2216  *
2217  * The timeout in seconds on socket I/O
2218  *
2219  * Since: 2.26
2220  */
2221
2222
2223 /**
2224  * GSocket:ttl:
2225  *
2226  * Time-to-live for outgoing unicast packets
2227  *
2228  * Since: 2.32
2229  */
2230
2231
2232 /**
2233  * GSocketAddress:
2234  *
2235  * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2236  * or one of its subtypes.
2237  */
2238
2239
2240 /**
2241  * GSocketClient::event:
2242  * @client: the #GSocketClient
2243  * @event: the event that is occurring
2244  * @connectable: the #GSocketConnectable that @event is occurring on
2245  * @connection: the current representation of the connection
2246  *
2247  * Emitted when @client's activity on @connectable changes state.
2248  * Among other things, this can be used to provide progress
2249  * information about a network connection in the UI. The meanings of
2250  * the different @event values are as follows:
2251  *
2252  * <variablelist>
2253  *   <varlistentry>
2254  *     <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2255  *     <listitem><para>
2256  *       @client is about to look up @connectable in DNS.
2257  *       @connection will be %NULL.
2258  *     </para></listitem>
2259  *   </varlistentry>
2260  *   <varlistentry>
2261  *     <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2262  *     <listitem><para>
2263  *       @client has successfully resolved @connectable in DNS.
2264  *       @connection will be %NULL.
2265  *     </para></listitem>
2266  *   </varlistentry>
2267  *   <varlistentry>
2268  *     <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2269  *     <listitem><para>
2270  *       @client is about to make a connection to a remote host;
2271  *       either a proxy server or the destination server itself.
2272  *       @connection is the #GSocketConnection, which is not yet
2273  *       connected.
2274  *     </para></listitem>
2275  *   </varlistentry>
2276  *   <varlistentry>
2277  *     <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2278  *     <listitem><para>
2279  *       @client has successfully connected to a remote host.
2280  *       @connection is the connected #GSocketConnection.
2281  *     </para></listitem>
2282  *   </varlistentry>
2283  *   <varlistentry>
2284  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2285  *     <listitem><para>
2286  *       @client is about to negotiate with a proxy to get it to
2287  *       connect to @connectable. @connection is the
2288  *       #GSocketConnection to the proxy server.
2289  *     </para></listitem>
2290  *   </varlistentry>
2291  *   <varlistentry>
2292  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2293  *     <listitem><para>
2294  *       @client has negotiated a connection to @connectable through
2295  *       a proxy server. @connection is the stream returned from
2296  *       g_proxy_connect(), which may or may not be a
2297  *       #GSocketConnection.
2298  *     </para></listitem>
2299  *   </varlistentry>
2300  *   <varlistentry>
2301  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2302  *     <listitem><para>
2303  *       @client is about to begin a TLS handshake. @connection is a
2304  *       #GTlsClientConnection.
2305  *     </para></listitem>
2306  *   </varlistentry>
2307  *   <varlistentry>
2308  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2309  *     <listitem><para>
2310  *       @client has successfully completed the TLS handshake.
2311  *       @connection is a #GTlsClientConnection.
2312  *     </para></listitem>
2313  *   </varlistentry>
2314  *   <varlistentry>
2315  *     <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2316  *     <listitem><para>
2317  *       @client has either successfully connected to @connectable
2318  *       (in which case @connection is the #GSocketConnection that
2319  *       it will be returning to the caller) or has failed (in which
2320  *       case @connection is %NULL and the client is about to return
2321  *       an error).
2322  *     </para></listitem>
2323  *   </varlistentry>
2324  * </variablelist>
2325  *
2326  * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2327  * multiple times (or not at all) for a given connectable (in
2328  * particular, if @client ends up attempting to connect to more than
2329  * one address). However, if @client emits the #GSocketClient::event
2330  * signal at all for a given connectable, that it will always emit
2331  * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2332  *
2333  * Note that there may be additional #GSocketClientEvent values in
2334  * the future; unrecognized @event values should be ignored.
2335  *
2336  * Since: 2.32
2337  */
2338
2339
2340 /**
2341  * GSocketService::incoming:
2342  * @service: the #GSocketService
2343  * @connection: a new #GSocketConnection object
2344  * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2345  *
2346  * The ::incoming signal is emitted when a new incoming connection
2347  * to @service needs to be handled. The handler must initiate the
2348  * handling of @connection, but may not block; in essence,
2349  * asynchronous operations must be used.
2350  *
2351  * @connection will be unreffed once the signal handler returns,
2352  * so you need to ref it yourself if you are planning to use it.
2353  *
2354  * Returns: %TRUE to stop other handlers from being called
2355  * Since: 2.22
2356  */
2357
2358
2359 /**
2360  * GSrvTarget:
2361  *
2362  * A single target host/port that a network service is running on.
2363  */
2364
2365
2366 /**
2367  * GTestDBus:
2368  *
2369  * The #GTestDBus structure contains only private data and
2370  * should only be accessed using the provided API.
2371  *
2372  * Since: 2.34
2373  */
2374
2375
2376 /**
2377  * GTestDBus:flags:
2378  *
2379  * #GTestDBusFlags specifying the behaviour of the dbus session
2380  *
2381  * Since: 2.34
2382  */
2383
2384
2385 /**
2386  * GThemedIcon:name:
2387  *
2388  * The icon name.
2389  */
2390
2391
2392 /**
2393  * GThemedIcon:names:
2394  *
2395  * A %NULL-terminated array of icon names.
2396  */
2397
2398
2399 /**
2400  * GThemedIcon:use-default-fallbacks:
2401  *
2402  * Whether to use the default fallbacks found by shortening the icon name
2403  * at '-' characters. If the "names" array has more than one element,
2404  * ignores any past the first.
2405  *
2406  * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2407  * would become
2408  * |[
2409  * {
2410  *   "gnome-dev-cdrom-audio",
2411  *   "gnome-dev-cdrom",
2412  *   "gnome-dev",
2413  *   "gnome",
2414  *   NULL
2415  * };
2416  * ]|
2417  */
2418
2419
2420 /**
2421  * GThreadedSocketService::run:
2422  * @service: the #GThreadedSocketService.
2423  * @connection: a new #GSocketConnection object.
2424  * @source_object: the source_object passed to g_socket_listener_add_address().
2425  *
2426  * The ::run signal is emitted in a worker thread in response to an
2427  * incoming connection. This thread is dedicated to handling
2428  * @connection and may perform blocking IO. The signal handler need
2429  * not return until the connection is closed.
2430  *
2431  * Returns: %TRUE to stop further signal handlers from being called
2432  */
2433
2434
2435 /**
2436  * GTlsBackend:
2437  *
2438  * TLS (Transport Layer Security, aka SSL) backend. This is an
2439  * internal type used to coordinate the different classes implemented
2440  * by a TLS backend.
2441  *
2442  * Since: 2.28
2443  */
2444
2445
2446 /**
2447  * GTlsCertificate:
2448  *
2449  * Abstract base class for TLS certificate types.
2450  *
2451  * Since: 2.28
2452  */
2453
2454
2455 /**
2456  * GTlsCertificate:certificate:
2457  *
2458  * The DER (binary) encoded representation of the certificate's
2459  * public key. This property and the
2460  * #GTlsCertificate:certificate-pem property represent the same
2461  * data, just in different forms.
2462  *
2463  * Since: 2.28
2464  */
2465
2466
2467 /**
2468  * GTlsCertificate:certificate-pem:
2469  *
2470  * The PEM (ASCII) encoded representation of the certificate's
2471  * public key. This property and the #GTlsCertificate:certificate
2472  * property represent the same data, just in different forms.
2473  *
2474  * Since: 2.28
2475  */
2476
2477
2478 /**
2479  * GTlsCertificate:issuer:
2480  *
2481  * A #GTlsCertificate representing the entity that issued this
2482  * certificate. If %NULL, this means that the certificate is either
2483  * self-signed, or else the certificate of the issuer is not
2484  * available.
2485  *
2486  * Since: 2.28
2487  */
2488
2489
2490 /**
2491  * GTlsCertificate:private-key:
2492  *
2493  * The DER (binary) encoded representation of the certificate's
2494  * private key, in either PKCS#1 format or unencrypted PKCS#8
2495  * format. This property (or the #GTlsCertificate:private-key-pem
2496  * property) can be set when constructing a key (eg, from a file),
2497  * but cannot be read.
2498  *
2499  * PKCS#8 format is supported since 2.32; earlier releases only
2500  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2501  * tool to convert PKCS#8 keys to PKCS#1.
2502  *
2503  * Since: 2.28
2504  */
2505
2506
2507 /**
2508  * GTlsCertificate:private-key-pem:
2509  *
2510  * The PEM (ASCII) encoded representation of the certificate's
2511  * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2512  * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2513  * PRIVATE KEY</literal>"). This property (or the
2514  * #GTlsCertificate:private-key property) can be set when
2515  * constructing a key (eg, from a file), but cannot be read.
2516  *
2517  * PKCS#8 format is supported since 2.32; earlier releases only
2518  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2519  * tool to convert PKCS#8 keys to PKCS#1.
2520  *
2521  * Since: 2.28
2522  */
2523
2524
2525 /**
2526  * GTlsClientConnection:
2527  *
2528  * Abstract base class for the backend-specific client connection
2529  * type.
2530  *
2531  * Since: 2.28
2532  */
2533
2534
2535 /**
2536  * GTlsClientConnection:accepted-cas:
2537  *
2538  * A list of the distinguished names of the Certificate Authorities
2539  * that the server will accept client certificates signed by. If the
2540  * server requests a client certificate during the handshake, then
2541  * this property will be set after the handshake completes.
2542  *
2543  * Each item in the list is a #GByteArray which contains the complete
2544  * subject DN of the certificate authority.
2545  *
2546  * Since: 2.28
2547  */
2548
2549
2550 /**
2551  * GTlsClientConnection:server-identity:
2552  *
2553  * A #GSocketConnectable describing the identity of the server that
2554  * is expected on the other end of the connection.
2555  *
2556  * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2557  * #GTlsClientConnection:validation-flags, this object will be used
2558  * to determine the expected identify of the remote end of the
2559  * connection; if #GTlsClientConnection:server-identity is not set,
2560  * or does not match the identity presented by the server, then the
2561  * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2562  *
2563  * In addition to its use in verifying the server certificate,
2564  * this is also used to give a hint to the server about what
2565  * certificate we expect, which is useful for servers that serve
2566  * virtual hosts.
2567  *
2568  * Since: 2.28
2569  */
2570
2571
2572 /**
2573  * GTlsClientConnection:use-ssl3:
2574  *
2575  * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2576  * to negotiate the best version of TLS or SSL to use. This can be
2577  * used when talking to servers that don't implement version
2578  * negotiation correctly and therefore refuse to handshake at all with
2579  * a "modern" TLS handshake.
2580  *
2581  * Since: 2.28
2582  */
2583
2584
2585 /**
2586  * GTlsClientConnection:validation-flags:
2587  *
2588  * What steps to perform when validating a certificate received from
2589  * a server. Server certificates that fail to validate in all of the
2590  * ways indicated here will be rejected unless the application
2591  * overrides the default via #GTlsConnection::accept-certificate.
2592  *
2593  * Since: 2.28
2594  */
2595
2596
2597 /**
2598  * GTlsConnection:
2599  *
2600  * Abstract base class for the backend-specific #GTlsClientConnection
2601  * and #GTlsServerConnection types.
2602  *
2603  * Since: 2.28
2604  */
2605
2606
2607 /**
2608  * GTlsConnection::accept-certificate:
2609  * @conn: a #GTlsConnection
2610  * @peer_cert: the peer's #GTlsCertificate
2611  * @errors: the problems with @peer_cert.
2612  *
2613  * Emitted during the TLS handshake after the peer certificate has
2614  * been received. You can examine @peer_cert's certification path by
2615  * calling g_tls_certificate_get_issuer() on it.
2616  *
2617  * For a client-side connection, @peer_cert is the server's
2618  * certificate, and the signal will only be emitted if the
2619  * certificate was not acceptable according to @conn's
2620  * #GTlsClientConnection:validation_flags. If you would like the
2621  * certificate to be accepted despite @errors, return %TRUE from the
2622  * signal handler. Otherwise, if no handler accepts the certificate,
2623  * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2624  *
2625  * For a server-side connection, @peer_cert is the certificate
2626  * presented by the client, if this was requested via the server's
2627  * #GTlsServerConnection:authentication_mode. On the server side,
2628  * the signal is always emitted when the client presents a
2629  * certificate, and the certificate will only be accepted if a
2630  * handler returns %TRUE.
2631  *
2632  * Note that if this signal is emitted as part of asynchronous I/O
2633  * in the main thread, then you should not attempt to interact with
2634  * the user before returning from the signal handler. If you want to
2635  * let the user decide whether or not to accept the certificate, you
2636  * would have to return %FALSE from the signal handler on the first
2637  * attempt, and then after the connection attempt returns a
2638  * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2639  * the user decides to accept the certificate, remember that fact,
2640  * create a new connection, and return %TRUE from the signal handler
2641  * the next time.
2642  *
2643  * If you are doing I/O in another thread, you do not
2644  * need to worry about this, and can simply block in the signal
2645  * handler until the UI thread returns an answer.
2646  *
2647  * 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.
2648  * Since: 2.28
2649  */
2650
2651
2652 /**
2653  * GTlsConnection:base-io-stream:
2654  *
2655  * The #GIOStream that the connection wraps
2656  *
2657  * Since: 2.28
2658  */
2659
2660
2661 /**
2662  * GTlsConnection:certificate:
2663  *
2664  * The connection's certificate; see
2665  * g_tls_connection_set_certificate().
2666  *
2667  * Since: 2.28
2668  */
2669
2670
2671 /**
2672  * GTlsConnection:database:
2673  *
2674  * The certificate database to use when verifying this TLS connection.
2675  * If no cerificate database is set, then the default database will be
2676  * used. See g_tls_backend_get_default_database().
2677  *
2678  * Since: 2.30
2679  */
2680
2681
2682 /**
2683  * GTlsConnection:interaction:
2684  *
2685  * A #GTlsInteraction object to be used when the connection or certificate
2686  * database need to interact with the user. This will be used to prompt the
2687  * user for passwords where necessary.
2688  *
2689  * Since: 2.30
2690  */
2691
2692
2693 /**
2694  * GTlsConnection:peer-certificate:
2695  *
2696  * The connection's peer's certificate, after the TLS handshake has
2697  * completed and the certificate has been accepted. Note in
2698  * particular that this is not yet set during the emission of
2699  * #GTlsConnection::accept-certificate.
2700  *
2701  * (You can watch for a #GObject::notify signal on this property to
2702  * detect when a handshake has occurred.)
2703  *
2704  * Since: 2.28
2705  */
2706
2707
2708 /**
2709  * GTlsConnection:peer-certificate-errors:
2710  *
2711  * The errors noticed-and-ignored while verifying
2712  * #GTlsConnection:peer-certificate. Normally this should be 0, but
2713  * it may not be if #GTlsClientConnection:validation-flags is not
2714  * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2715  * #GTlsConnection::accept-certificate overrode the default
2716  * behavior.
2717  *
2718  * Since: 2.28
2719  */
2720
2721
2722 /**
2723  * GTlsConnection:rehandshake-mode:
2724  *
2725  * The rehandshaking mode. See
2726  * g_tls_connection_set_rehandshake_mode().
2727  *
2728  * Since: 2.28
2729  */
2730
2731
2732 /**
2733  * GTlsConnection:require-close-notify:
2734  *
2735  * Whether or not proper TLS close notification is required.
2736  * See g_tls_connection_set_require_close_notify().
2737  *
2738  * Since: 2.28
2739  */
2740
2741
2742 /**
2743  * GTlsConnection:use-system-certdb:
2744  *
2745  * Whether or not the system certificate database will be used to
2746  * verify peer certificates. See
2747  * g_tls_connection_set_use_system_certdb().
2748  *
2749  * Deprecated: 2.30: Use GTlsConnection:database instead
2750  */
2751
2752
2753 /**
2754  * GTlsDatabase:
2755  *
2756  * Abstract base class for the backend-specific database types.
2757  *
2758  * Since: 2.30
2759  */
2760
2761
2762 /**
2763  * GTlsFileDatabase:
2764  *
2765  * Implemented by a #GTlsDatabase which allows you to load certificates
2766  * from a file.
2767  *
2768  * Since: 2.30
2769  */
2770
2771
2772 /**
2773  * GTlsFileDatabase:anchors:
2774  *
2775  * The path to a file containing PEM encoded certificate authority
2776  * root anchors. The certificates in this file will be treated as
2777  * root authorities for the purpose of verifying other certificates
2778  * via the g_tls_database_verify_chain() operation.
2779  *
2780  * Since: 2.30
2781  */
2782
2783
2784 /**
2785  * GTlsInteraction:
2786  *
2787  * An object representing interaction that the TLS connection and database
2788  * might have with the user.
2789  *
2790  * Since: 2.30
2791  */
2792
2793
2794 /**
2795  * GTlsInteractionClass:
2796  * @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.
2797  * @ask_password_async: ask for a password asynchronously.
2798  * @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.
2799  *
2800  * The class for #GTlsInteraction. Derived classes implement the various
2801  * virtual interaction methods to handle TLS interactions.
2802  *
2803  * Derived classes can choose to implement whichever interactions methods they'd
2804  * like to support by overriding those virtual methods in their class
2805  * initialization function. If a derived class implements an async method,
2806  * it must also implement the corresponding finish method.
2807  *
2808  * The synchronous interaction methods should implement to display modal dialogs,
2809  * and the asynchronous methods to display modeless dialogs.
2810  *
2811  * If the user cancels an interaction, then the result should be
2812  * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2813  * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2814  *
2815  * Since: 2.30
2816  */
2817
2818
2819 /**
2820  * GTlsPassword:
2821  *
2822  * An abstract interface representing a password used in TLS. Often used in
2823  * user interaction such as unlocking a key storage token.
2824  *
2825  * Since: 2.30
2826  */
2827
2828
2829 /**
2830  * GTlsServerConnection:authentication-mode:
2831  *
2832  * The #GTlsAuthenticationMode for the server. This can be changed
2833  * before calling g_tls_connection_handshake() if you want to
2834  * rehandshake with a different mode from the initial handshake.
2835  *
2836  * Since: 2.28
2837  */
2838
2839
2840 /**
2841  * GUnixCredentialsMessage:credentials:
2842  *
2843  * The credentials stored in the message.
2844  *
2845  * Since: 2.26
2846  */
2847
2848
2849 /**
2850  * GUnixInputStream:close-fd:
2851  *
2852  * Whether to close the file descriptor when the stream is closed.
2853  *
2854  * Since: 2.20
2855  */
2856
2857
2858 /**
2859  * GUnixInputStream:fd:
2860  *
2861  * The file descriptor that the stream reads from.
2862  *
2863  * Since: 2.20
2864  */
2865
2866
2867 /**
2868  * GUnixMountMonitor::mountpoints-changed:
2869  * @monitor: the object on which the signal is emitted
2870  *
2871  * Emitted when the unix mount points have changed.
2872  */
2873
2874
2875 /**
2876  * GUnixMountMonitor::mounts-changed:
2877  * @monitor: the object on which the signal is emitted
2878  *
2879  * Emitted when the unix mounts have changed.
2880  */
2881
2882
2883 /**
2884  * GUnixOutputStream:close-fd:
2885  *
2886  * Whether to close the file descriptor when the stream is closed.
2887  *
2888  * Since: 2.20
2889  */
2890
2891
2892 /**
2893  * GUnixOutputStream:fd:
2894  *
2895  * The file descriptor that the stream writes to.
2896  *
2897  * Since: 2.20
2898  */
2899
2900
2901 /**
2902  * GUnixSocketAddress:
2903  *
2904  * A UNIX-domain (local) socket address, corresponding to a
2905  * <type>struct sockaddr_un</type>.
2906  */
2907
2908
2909 /**
2910  * GUnixSocketAddress:abstract:
2911  *
2912  * Whether or not this is an abstract address
2913  *
2914  * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
2915  */
2916
2917
2918 /**
2919  * GVolume::changed:
2920  *
2921  * Emitted when the volume has been changed.
2922  */
2923
2924
2925 /**
2926  * GVolume::removed:
2927  *
2928  * This signal is emitted when the #GVolume have been removed. If
2929  * the recipient is holding references to the object they should
2930  * release them so the object can be finalized.
2931  */
2932
2933
2934 /**
2935  * GVolumeMonitor::drive-changed:
2936  * @volume_monitor: The volume monitor emitting the signal.
2937  * @drive: the drive that changed
2938  *
2939  * Emitted when a drive changes.
2940  */
2941
2942
2943 /**
2944  * GVolumeMonitor::drive-connected:
2945  * @volume_monitor: The volume monitor emitting the signal.
2946  * @drive: a #GDrive that was connected.
2947  *
2948  * Emitted when a drive is connected to the system.
2949  */
2950
2951
2952 /**
2953  * GVolumeMonitor::drive-disconnected:
2954  * @volume_monitor: The volume monitor emitting the signal.
2955  * @drive: a #GDrive that was disconnected.
2956  *
2957  * Emitted when a drive is disconnected from the system.
2958  */
2959
2960
2961 /**
2962  * GVolumeMonitor::drive-eject-button:
2963  * @volume_monitor: The volume monitor emitting the signal.
2964  * @drive: the drive where the eject button was pressed
2965  *
2966  * Emitted when the eject button is pressed on @drive.
2967  *
2968  * Since: 2.18
2969  */
2970
2971
2972 /**
2973  * GVolumeMonitor::drive-stop-button:
2974  * @volume_monitor: The volume monitor emitting the signal.
2975  * @drive: the drive where the stop button was pressed
2976  *
2977  * Emitted when the stop button is pressed on @drive.
2978  *
2979  * Since: 2.22
2980  */
2981
2982
2983 /**
2984  * GVolumeMonitor::mount-added:
2985  * @volume_monitor: The volume monitor emitting the signal.
2986  * @mount: a #GMount that was added.
2987  *
2988  * Emitted when a mount is added.
2989  */
2990
2991
2992 /**
2993  * GVolumeMonitor::mount-changed:
2994  * @volume_monitor: The volume monitor emitting the signal.
2995  * @mount: a #GMount that changed.
2996  *
2997  * Emitted when a mount changes.
2998  */
2999
3000
3001 /**
3002  * GVolumeMonitor::mount-pre-unmount:
3003  * @volume_monitor: The volume monitor emitting the signal.
3004  * @mount: a #GMount that is being unmounted.
3005  *
3006  * Emitted when a mount is about to be removed.
3007  */
3008
3009
3010 /**
3011  * GVolumeMonitor::mount-removed:
3012  * @volume_monitor: The volume monitor emitting the signal.
3013  * @mount: a #GMount that was removed.
3014  *
3015  * Emitted when a mount is removed.
3016  */
3017
3018
3019 /**
3020  * GVolumeMonitor::volume-added:
3021  * @volume_monitor: The volume monitor emitting the signal.
3022  * @volume: a #GVolume that was added.
3023  *
3024  * Emitted when a mountable volume is added to the system.
3025  */
3026
3027
3028 /**
3029  * GVolumeMonitor::volume-changed:
3030  * @volume_monitor: The volume monitor emitting the signal.
3031  * @volume: a #GVolume that changed.
3032  *
3033  * Emitted when mountable volume is changed.
3034  */
3035
3036
3037 /**
3038  * GVolumeMonitor::volume-removed:
3039  * @volume_monitor: The volume monitor emitting the signal.
3040  * @volume: a #GVolume that was removed.
3041  *
3042  * Emitted when a mountable volume is removed from the system.
3043  */
3044
3045
3046 /**
3047  * GWin32InputStream:close-handle:
3048  *
3049  * Whether to close the file handle when the stream is closed.
3050  *
3051  * Since: 2.26
3052  */
3053
3054
3055 /**
3056  * GWin32InputStream:handle:
3057  *
3058  * The handle that the stream reads from.
3059  *
3060  * Since: 2.26
3061  */
3062
3063
3064 /**
3065  * GWin32OutputStream:close-handle:
3066  *
3067  * Whether to close the file handle when the stream is closed.
3068  *
3069  * Since: 2.26
3070  */
3071
3072
3073 /**
3074  * GWin32OutputStream:handle:
3075  *
3076  * The file handle that the stream writes to.
3077  *
3078  * Since: 2.26
3079  */
3080
3081
3082 /**
3083  * GZlibCompressor:
3084  *
3085  * Zlib decompression
3086  */
3087
3088
3089 /**
3090  * GZlibCompressor:file-info:
3091  *
3092  * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3093  * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3094  * and modification time from the file info to the the GZIP header.
3095  *
3096  * Since: 2.26
3097  */
3098
3099
3100 /**
3101  * GZlibDecompressor:
3102  *
3103  * Zlib decompression
3104  */
3105
3106
3107 /**
3108  * GZlibDecompressor:file-info:
3109  *
3110  * A #GFileInfo containing the information found in the GZIP header
3111  * of the data stream processed, or %NULL if the header was not yet
3112  * fully processed, is not present at all, or the compressor's
3113  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3114  *
3115  * Since: 2.26
3116  */
3117
3118
3119 /**
3120  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3121  *
3122  * The purpose used to verify the client certificate in a TLS connection.
3123  * Used by TLS servers.
3124  */
3125
3126
3127 /**
3128  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3129  *
3130  * The purpose used to verify the server certificate in a TLS connection. This
3131  * is the most common purpose in use. Used by TLS clients.
3132  */
3133
3134
3135 /**
3136  * G_TYPE_SETTINGS_SCHEMA:
3137  *
3138  * A boxed #GType corresponding to #GSettingsSchema.
3139  *
3140  * Since: 2.32
3141  */
3142
3143
3144 /**
3145  * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3146  *
3147  * A boxed #GType corresponding to #GSettingsSchemaSource.
3148  *
3149  * Since: 2.32
3150  */
3151
3152
3153 /**
3154  * SECTION:_GFreedesktopDBus
3155  * @title: _GFreedesktopDBus
3156  * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface
3157  *
3158  * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface in C.
3159  */
3160
3161
3162 /**
3163  * SECTION:extensionpoints
3164  * @short_description: Extension Points
3165  * @include: gio.h
3166  * @see_also: <link linkend="extending-gio">Extending GIO</link>
3167  *
3168  * #GIOExtensionPoint provides a mechanism for modules to extend the
3169  * functionality of the library or application that loaded it in an
3170  * organized fashion.
3171  *
3172  * An extension point is identified by a name, and it may optionally
3173  * require that any implementation must by of a certain type (or derived
3174  * thereof). Use g_io_extension_point_register() to register an
3175  * extension point, and g_io_extension_point_set_required_type() to
3176  * set a required type.
3177  *
3178  * A module can implement an extension point by specifying the #GType
3179  * that implements the functionality. Additionally, each implementation
3180  * of an extension point has a name, and a priority. Use
3181  * g_io_extension_point_implement() to implement an extension point.
3182  *
3183  *  |[
3184  *  GIOExtensionPoint *ep;
3185  *
3186  *  /&ast; Register an extension point &ast;/
3187  *  ep = g_io_extension_point_register ("my-extension-point");
3188  *  g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3189  *  ]|
3190  *
3191  *  |[
3192  *  /&ast; Implement an extension point &ast;/
3193  *  G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3194  *  g_io_extension_point_implement ("my-extension-point",
3195  *                                  my_example_impl_get_type (),
3196  *                                  "my-example",
3197  *                                  10);
3198  *  ]|
3199  *
3200  *  It is up to the code that registered the extension point how
3201  *  it uses the implementations that have been associated with it.
3202  *  Depending on the use case, it may use all implementations, or
3203  *  only the one with the highest priority, or pick a specific
3204  *  one by name.
3205  *
3206  *  To avoid opening all modules just to find out what extension
3207  *  points they implement, GIO makes use of a caching mechanism,
3208  *  see <link linkend="gio-querymodules">gio-querymodules</link>.
3209  *  You are expected to run this command after installing a
3210  *  GIO module.
3211  *
3212  *  The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3213  *  used to specify additional directories to automatically load modules
3214  *  from. This environment variable has the same syntax as the
3215  *  <envar>PATH</envar>. If two modules have the same base name in different
3216  *  directories, then the latter one will be ignored. If additional
3217  *  directories are specified GIO will load modules from the built-in
3218  *  directory last.
3219  */
3220
3221
3222 /**
3223  * SECTION:gaction
3224  * @title: GAction
3225  * @short_description: An action interface
3226  *
3227  * #GAction represents a single named action.
3228  *
3229  * The main interface to an action is that it can be activated with
3230  * g_action_activate().  This results in the 'activate' signal being
3231  * emitted.  An activation has a #GVariant parameter (which may be
3232  * %NULL).  The correct type for the parameter is determined by a static
3233  * parameter type (which is given at construction time).
3234  *
3235  * An action may optionally have a state, in which case the state may be
3236  * set with g_action_change_state().  This call takes a #GVariant.  The
3237  * correct type for the state is determined by a static state type
3238  * (which is given at construction time).
3239  *
3240  * The state may have a hint associated with it, specifying its valid
3241  * range.
3242  *
3243  * #GAction is merely the interface to the concept of an action, as
3244  * described above.  Various implementations of actions exist, including
3245  * #GSimpleAction and #GtkAction.
3246  *
3247  * In all cases, the implementing class is responsible for storing the
3248  * name of the action, the parameter type, the enabled state, the
3249  * optional state type and the state and emitting the appropriate
3250  * signals when these change.  The implementor responsible for filtering
3251  * calls to g_action_activate() and g_action_change_state() for type
3252  * safety and for the state being enabled.
3253  *
3254  * Probably the only useful thing to do with a #GAction is to put it
3255  * inside of a #GSimpleActionGroup.
3256  */
3257
3258
3259 /**
3260  * SECTION:gactiongroup
3261  * @title: GActionGroup
3262  * @short_description: A group of actions
3263  * @see_also: #GAction
3264  *
3265  * #GActionGroup represents a group of actions. Actions can be used to
3266  * expose functionality in a structured way, either from one part of a
3267  * program to another, or to the outside world. Action groups are often
3268  * used together with a #GMenuModel that provides additional
3269  * representation data for displaying the actions to the user, e.g. in
3270  * a menu.
3271  *
3272  * The main way to interact with the actions in a GActionGroup is to
3273  * activate them with g_action_group_activate_action(). Activating an
3274  * action may require a #GVariant parameter. The required type of the
3275  * parameter can be inquired with g_action_group_get_action_parameter_type().
3276  * Actions may be disabled, see g_action_group_get_action_enabled().
3277  * Activating a disabled action has no effect.
3278  *
3279  * Actions may optionally have a state in the form of a #GVariant. The
3280  * current state of an action can be inquired with
3281  * g_action_group_get_action_state(). Activating a stateful action may
3282  * change its state, but it is also possible to set the state by calling
3283  * g_action_group_change_action_state().
3284  *
3285  * As typical example, consider a text editing application which has an
3286  * option to change the current font to 'bold'. A good way to represent
3287  * this would be a stateful action, with a boolean state. Activating the
3288  * action would toggle the state.
3289  *
3290  * Each action in the group has a unique name (which is a string).  All
3291  * method calls, except g_action_group_list_actions() take the name of
3292  * an action as an argument.
3293  *
3294  * The #GActionGroup API is meant to be the 'public' API to the action
3295  * group.  The calls here are exactly the interaction that 'external
3296  * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3297  * with actions.  'Internal' APIs (ie: ones meant only to be accessed by
3298  * the action group implementation) are found on subclasses.  This is
3299  * why you will find - for example - g_action_group_get_action_enabled()
3300  * but not an equivalent <function>set()</function> call.
3301  *
3302  * Signals are emitted on the action group in response to state changes
3303  * on individual actions.
3304  *
3305  * Implementations of #GActionGroup should provide implementations for
3306  * the virtual functions g_action_group_list_actions() and
3307  * g_action_group_query_action().  The other virtual functions should
3308  * not be implemented - their "wrappers" are actually implemented with
3309  * calls to g_action_group_query_action().
3310  */
3311
3312
3313 /**
3314  * SECTION:gactiongroupexporter
3315  * @title: GActionGroup exporter
3316  * @short_description: Export GActionGroups on D-Bus
3317  * @see_also: #GActionGroup, #GDBusActionGroup
3318  *
3319  * These functions support exporting a #GActionGroup on D-Bus.
3320  * The D-Bus interface that is used is a private implementation
3321  * detail.
3322  *
3323  * To access an exported #GActionGroup remotely, use
3324  * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3325  */
3326
3327
3328 /**
3329  * SECTION:gactionmap
3330  * @title: GActionMap
3331  * @short_description: Interface for action containers
3332  *
3333  * The GActionMap interface is implemented by #GActionGroup
3334  * implementations that operate by containing a number of
3335  * named #GAction instances, such as #GSimpleActionGroup.
3336  *
3337  * One useful application of this interface is to map the
3338  * names of actions from various action groups to unique,
3339  * prefixed names (e.g. by prepending "app." or "win.").
3340  * This is the motivation for the 'Map' part of the interface
3341  * name.
3342  *
3343  * Since: 2.32
3344  */
3345
3346
3347 /**
3348  * SECTION:gappinfo
3349  * @short_description: Application information and launch contexts
3350  * @include: gio/gio.h
3351  *
3352  * #GAppInfo and #GAppLaunchContext are used for describing and launching
3353  * applications installed on the system.
3354  *
3355  * As of GLib 2.20, URIs will always be converted to POSIX paths
3356  * (using g_file_get_path()) when using g_app_info_launch() even if
3357  * the application requested an URI and not a POSIX path. For example
3358  * for an desktop-file based application with Exec key <literal>totem
3359  * &percnt;U</literal> and a single URI,
3360  * <literal>sftp://foo/file.avi</literal>, then
3361  * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3362  * passed. This will only work if a set of suitable GIO extensions
3363  * (such as gvfs 2.26 compiled with FUSE support), is available and
3364  * operational; if this is not the case, the URI will be passed
3365  * unmodified to the application. Some URIs, such as
3366  * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3367  * path (in gvfs there's no FUSE mount for it); such URIs will be
3368  * passed unmodified to the application.
3369  *
3370  * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3371  * back to the GIO URI in the #GFile constructors (since gvfs
3372  * implements the #GVfs extension point). As such, if the application
3373  * needs to examine the URI, it needs to use g_file_get_uri() or
3374  * similar on #GFile. In other words, an application cannot assume
3375  * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3376  * equal to the result of g_file_get_uri(). The following snippet
3377  * illustrates this:
3378  *
3379  * <programlisting>
3380  * GFile *f;
3381  * char *uri;
3382  *
3383  * file = g_file_new_for_commandline_arg (uri_from_commandline);
3384  *
3385  * uri = g_file_get_uri (file);
3386  * strcmp (uri, uri_from_commandline) == 0; // FALSE
3387  * g_free (uri);
3388  *
3389  * if (g_file_has_uri_scheme (file, "cdda"))
3390  *   {
3391  *     // do something special with uri
3392  *   }
3393  * g_object_unref (file);
3394  * </programlisting>
3395  *
3396  * This code will work when both <literal>cdda://sr0/Track
3397  * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3398  * 1.wav</literal> is passed to the application. It should be noted
3399  * that it's generally not safe for applications to rely on the format
3400  * of a particular URIs. Different launcher applications (e.g. file
3401  * managers) may have different ideas of what a given URI means.
3402  */
3403
3404
3405 /**
3406  * SECTION:gapplication
3407  * @title: GApplication
3408  * @short_description: Core application class
3409  *
3410  * A #GApplication is the foundation of an application.  It wraps some
3411  * low-level platform-specific services and is intended to act as the
3412  * foundation for higher-level application classes such as
3413  * #GtkApplication or #MxApplication.  In general, you should not use
3414  * this class outside of a higher level framework.
3415  *
3416  * GApplication provides convenient life cycle management by maintaining
3417  * a <firstterm>use count</firstterm> for the primary application instance.
3418  * The use count can be changed using g_application_hold() and
3419  * g_application_release(). If it drops to zero, the application exits.
3420  * Higher-level classes such as #GtkApplication employ the use count to
3421  * ensure that the application stays alive as long as it has any opened
3422  * windows.
3423  *
3424  * Another feature that GApplication (optionally) provides is process
3425  * uniqueness.  Applications can make use of this functionality by
3426  * providing a unique application ID.  If given, only one application
3427  * with this ID can be running at a time per session.  The session
3428  * concept is platform-dependent, but corresponds roughly to a graphical
3429  * desktop login.  When your application is launched again, its
3430  * arguments are passed through platform communication to the already
3431  * running program.  The already running instance of the program is
3432  * called the <firstterm>primary instance</firstterm>; for non-unique
3433  * applications this is the always the current instance.
3434  * On Linux, the D-Bus session bus is used for communication.
3435  *
3436  * If used, the expected form of an application identifier is very close
3437  * to that of of a
3438  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3439  * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3440  * For details on valid application identifiers, see g_application_id_is_valid().
3441  *
3442  * On Linux, the application identifier is claimed as a well-known bus name
3443  * on the user's session bus.  This means that the uniqueness of your
3444  * application is scoped to the current session.  It also means that your
3445  * application may provide additional services (through registration of other
3446  * object paths) at that bus name.  The registration of these object paths
3447  * should be done with the shared GDBus session bus.  Note that due to the
3448  * internal architecture of GDBus, method calls can be dispatched at any time
3449  * (even if a main loop is not running).  For this reason, you must ensure that
3450  * any object paths that you wish to register are registered before #GApplication
3451  * attempts to acquire the bus name of your application (which happens in
3452  * g_application_register()).  Unfortunately, this means that you cannot use
3453  * g_application_get_is_remote() to decide if you want to register object paths.
3454  *
3455  * GApplication also implements the #GActionGroup and #GActionMap
3456  * interfaces and lets you easily export actions by adding them with
3457  * g_action_map_add_action(). When invoking an action by calling
3458  * g_action_group_activate_action() on the application, it is always
3459  * invoked in the primary instance. The actions are also exported on
3460  * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3461  * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3462  * for remote access to exported #GMenuModels.
3463  *
3464  * There is a number of different entry points into a GApplication:
3465  * <itemizedlist>
3466  * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3467  * <listitem>via 'Open' (i.e. opening some files)</listitem>
3468  * <listitem>by handling a command-line</listitem>
3469  * <listitem>via activating an action</listitem>
3470  * </itemizedlist>
3471  * The #GApplication::startup signal lets you handle the application
3472  * initialization for all of these in a single place.
3473  *
3474  * Regardless of which of these entry points is used to start the application,
3475  * GApplication passes some <firstterm id="platform-data">platform
3476  * data</firstterm> from the launching instance to the primary instance,
3477  * in the form of a #GVariant dictionary mapping strings to variants.
3478  * To use platform data, override the @before_emit or @after_emit virtual
3479  * functions in your #GApplication subclass. When dealing with
3480  * #GApplicationCommandLine objects, the platform data is directly
3481  * available via g_application_command_line_get_cwd(),
3482  * g_application_command_line_get_environ() and
3483  * g_application_command_line_get_platform_data().
3484  *
3485  * As the name indicates, the platform data may vary depending on the
3486  * operating system, but it always includes the current directory (key
3487  * "cwd"), and optionally the environment (ie the set of environment
3488  * variables and their values) of the calling process (key "environ").
3489  * The environment is only added to the platform data if the
3490  * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3491  * can add their own platform data by overriding the @add_platform_data
3492  * virtual function. For instance, #GtkApplication adds startup notification
3493  * data in this way.
3494  *
3495  * To parse commandline arguments you may handle the
3496  * #GApplication::command-line signal or override the local_command_line()
3497  * vfunc, to parse them in either the primary instance or the local instance,
3498  * respectively.
3499  *
3500  * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3501  * <programlisting>
3502  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3503  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3504  * </xi:include>
3505  * </programlisting>
3506  * </example>
3507  *
3508  * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3509  * <programlisting>
3510  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3511  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3512  * </xi:include>
3513  * </programlisting>
3514  * </example>
3515  *
3516  * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3517  * <programlisting>
3518  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3519  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3520  * </xi:include>
3521  * </programlisting>
3522  * </example>
3523  *
3524  * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3525  * <programlisting>
3526  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3527  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3528  * </xi:include>
3529  * </programlisting>
3530  * </example>
3531  */
3532
3533
3534 /**
3535  * SECTION:gapplicationcommandline
3536  * @title: GApplicationCommandLine
3537  * @short_description: A command-line invocation of an application
3538  * @see_also: #GApplication
3539  *
3540  * #GApplicationCommandLine represents a command-line invocation of
3541  * an application.  It is created by #GApplication and emitted
3542  * in the #GApplication::command-line signal and virtual function.
3543  *
3544  * The class contains the list of arguments that the program was invoked
3545  * with.  It is also possible to query if the commandline invocation was
3546  * local (ie: the current process is running in direct response to the
3547  * invocation) or remote (ie: some other process forwarded the
3548  * commandline to this process).
3549  *
3550  * The GApplicationCommandLine object can provide the @argc and @argv
3551  * parameters for use with the #GOptionContext command-line parsing API,
3552  * with the g_application_command_line_get_arguments() function. See
3553  * <xref linkend="gapplication-example-cmdline3"/> for an example.
3554  *
3555  * The exit status of the originally-invoked process may be set and
3556  * messages can be printed to stdout or stderr of that process.  The
3557  * lifecycle of the originally-invoked process is tied to the lifecycle
3558  * of this object (ie: the process exits when the last reference is
3559  * dropped).
3560  *
3561  * The main use for #GApplicationCommandLine (and the
3562  * #GApplication::command-line signal) is 'Emacs server' like use cases:
3563  * You can set the <envar>EDITOR</envar> environment variable to have
3564  * e.g. git use your favourite editor to edit commit messages, and if you
3565  * already have an instance of the editor running, the editing will happen
3566  * in the running instance, instead of opening a new one. An important
3567  * aspect of this use case is that the process that gets started by git
3568  * does not return until the editing is done.
3569  *
3570  * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3571  * <para>
3572  * A simple example where the commandline is completely handled
3573  * in the #GApplication::command-line handler. The launching instance exits
3574  * once the signal handler in the primary instance has returned, and the
3575  * return value of the signal handler becomes the exit status of the launching
3576  * instance.
3577  * </para>
3578  * <programlisting>
3579  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3580  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3581  * </xi:include>
3582  * </programlisting>
3583  * </example>
3584  *
3585  * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3586  * <para>
3587  * An example of split commandline handling. Options that start with
3588  * <literal>--local-</literal> are handled locally, all other options are
3589  * passed to the #GApplication::command-line handler which runs in the primary
3590  * instance.
3591  * </para>
3592  * <programlisting>
3593  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3594  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3595  * </xi:include>
3596  * </programlisting>
3597  * </example>
3598  *
3599  * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3600  * <para>
3601  * An example of deferred commandline handling. Here, the commandline is
3602  * not completely handled before the #GApplication::command-line handler
3603  * returns. Instead, we keep a reference to the GApplicationCommandLine
3604  * object and handle it later(in this example, in an idle). Note that it
3605  * is necessary to hold the application until you are done with the
3606  * commandline.
3607  * </para>
3608  * <para>
3609  * This example also shows how to use #GOptionContext for parsing the
3610  * commandline arguments. Note that it is necessary to disable the
3611  * built-in help-handling of #GOptionContext, since it calls exit()
3612  * after printing help, which is not what you want to happen in
3613  * the primary instance.
3614  * </para>
3615  * <programlisting>
3616  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3617  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3618  * </xi:include>
3619  * </programlisting>
3620  * </example>
3621  */
3622
3623
3624 /**
3625  * SECTION:gasyncinitable
3626  * @short_description: Asynchronously failable object initialization interface
3627  * @include: gio/gio.h
3628  * @see_also: #GInitable
3629  *
3630  * This is the asynchronous version of #GInitable; it behaves the same
3631  * in all ways except that initialization is asynchronous. For more details
3632  * see the descriptions on #GInitable.
3633  *
3634  * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3635  *
3636  * Users of objects implementing this are not intended to use the interface
3637  * method directly; instead it will be used automatically in various ways.
3638  * For C applications you generally just call g_async_initable_new_async()
3639  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3640  * g_async_initable_init_async() under the cover, calling back with %NULL and
3641  * a set %GError on failure.
3642  *
3643  * A typical implementation might look something like this:
3644  *
3645  * |[
3646  * enum {
3647  *    NOT_INITIALIZED,
3648  *    INITIALIZING,
3649  *    INITIALIZED
3650  * };
3651  *
3652  * static void
3653  * _foo_ready_cb (Foo *self)
3654  * {
3655  *   GList *l;
3656  *
3657  *   self->priv->state = INITIALIZED;
3658  *
3659  *   for (l = self->priv->init_results; l != NULL; l = l->next)
3660  *     {
3661  *       GSimpleAsyncResult *simple = l->data;
3662  *
3663  *       if (!self->priv->success)
3664  *         g_simple_async_result_set_error (simple, ...);
3665  *
3666  *       g_simple_async_result_complete (simple);
3667  *       g_object_unref (simple);
3668  *     }
3669  *
3670  *   g_list_free (self->priv->init_results);
3671  *   self->priv->init_results = NULL;
3672  * }
3673  *
3674  * static void
3675  * foo_init_async (GAsyncInitable       *initable,
3676  *                 int                   io_priority,
3677  *                 GCancellable         *cancellable,
3678  *                 GAsyncReadyCallback   callback,
3679  *                 gpointer              user_data)
3680  * {
3681  *   Foo *self = FOO (initable);
3682  *   GSimpleAsyncResult *simple;
3683  *
3684  *   simple = g_simple_async_result_new (G_OBJECT (initable)
3685  *                                       callback,
3686  *                                       user_data,
3687  *                                       foo_init_async);
3688  *
3689  *   switch (self->priv->state)
3690  *     {
3691  *       case NOT_INITIALIZED:
3692  *         _foo_get_ready (self);
3693  *         self->priv->init_results = g_list_append (self->priv->init_results,
3694  *                                                   simple);
3695  *         self->priv->state = INITIALIZING;
3696  *         break;
3697  *       case INITIALIZING:
3698  *         self->priv->init_results = g_list_append (self->priv->init_results,
3699  *                                                   simple);
3700  *         break;
3701  *       case INITIALIZED:
3702  *         if (!self->priv->success)
3703  *           g_simple_async_result_set_error (simple, ...);
3704  *
3705  *         g_simple_async_result_complete_in_idle (simple);
3706  *         g_object_unref (simple);
3707  *         break;
3708  *     }
3709  * }
3710  *
3711  * static gboolean
3712  * foo_init_finish (GAsyncInitable       *initable,
3713  *                  GAsyncResult         *result,
3714  *                  GError              **error)
3715  * {
3716  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
3717  *       G_OBJECT (initable), foo_init_async), FALSE);
3718  *
3719  *   if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
3720  *           error))
3721  *     return FALSE;
3722  *
3723  *   return TRUE;
3724  * }
3725  *
3726  * static void
3727  * foo_async_initable_iface_init (gpointer g_iface,
3728  *                                gpointer data)
3729  * {
3730  *   GAsyncInitableIface *iface = g_iface;
3731  *
3732  *   iface->init_async = foo_init_async;
3733  *   iface->init_finish = foo_init_finish;
3734  * }
3735  * ]|
3736  */
3737
3738
3739 /**
3740  * SECTION:gasyncresult
3741  * @short_description: Asynchronous Function Results
3742  * @include: gio/gio.h
3743  * @see_also: #GSimpleAsyncResult
3744  *
3745  * Provides a base class for implementing asynchronous function results.
3746  *
3747  * Asynchronous operations are broken up into two separate operations
3748  * which are chained together by a #GAsyncReadyCallback. To begin
3749  * an asynchronous operation, provide a #GAsyncReadyCallback to the
3750  * asynchronous function. This callback will be triggered when the
3751  * operation has completed, and will be passed a #GAsyncResult instance
3752  * filled with the details of the operation's success or failure, the
3753  * object the asynchronous function was started for and any error codes
3754  * returned. The asynchronous callback function is then expected to call
3755  * the corresponding "_finish()" function, passing the object the
3756  * function was called for, the #GAsyncResult instance, and (optionally)
3757  * an @error to grab any error conditions that may have occurred.
3758  *
3759  * The "_finish()" function for an operation takes the generic result
3760  * (of type #GAsyncResult) and returns the specific result that the
3761  * operation in question yields (e.g. a #GFileEnumerator for a
3762  * "enumerate children" operation). If the result or error status of the
3763  * operation is not needed, there is no need to call the "_finish()"
3764  * function; GIO will take care of cleaning up the result and error
3765  * information after the #GAsyncReadyCallback returns. You can pass
3766  * %NULL for the #GAsyncReadyCallback if you don't need to take any
3767  * action at all after the operation completes. Applications may also
3768  * take a reference to the #GAsyncResult and call "_finish()" later;
3769  * however, the "_finish()" function may be called at most once.
3770  *
3771  * Example of a typical asynchronous operation flow:
3772  * |[
3773  * void _theoretical_frobnitz_async (Theoretical         *t,
3774  *                                   GCancellable        *c,
3775  *                                   GAsyncReadyCallback *cb,
3776  *                                   gpointer             u);
3777  *
3778  * gboolean _theoretical_frobnitz_finish (Theoretical   *t,
3779  *                                        GAsyncResult  *res,
3780  *                                        GError       **e);
3781  *
3782  * static void
3783  * frobnitz_result_func (GObject      *source_object,
3784  *               GAsyncResult *res,
3785  *               gpointer      user_data)
3786  * {
3787  *   gboolean success = FALSE;
3788  *
3789  *   success = _theoretical_frobnitz_finish (source_object, res, NULL);
3790  *
3791  *   if (success)
3792  *     g_printf ("Hurray!\n");
3793  *   else
3794  *     g_printf ("Uh oh!\n");
3795  *
3796  *   /<!-- -->* ... *<!-- -->/
3797  *
3798  * }
3799  *
3800  * int main (int argc, void *argv[])
3801  * {
3802  *    /<!-- -->* ... *<!-- -->/
3803  *
3804  *    _theoretical_frobnitz_async (theoretical_data,
3805  *                                 NULL,
3806  *                                 frobnitz_result_func,
3807  *                                 NULL);
3808  *
3809  *    /<!-- -->* ... *<!-- -->/
3810  * }
3811  * ]|
3812  *
3813  * The callback for an asynchronous operation is called only once, and is
3814  * always called, even in the case of a cancelled operation. On cancellation
3815  * the result is a %G_IO_ERROR_CANCELLED error.
3816  */
3817
3818
3819 /**
3820  * SECTION:gbufferedinputstream
3821  * @short_description: Buffered Input Stream
3822  * @include: gio/gio.h
3823  * @see_also: #GFilterInputStream, #GInputStream
3824  *
3825  * Buffered input stream implements #GFilterInputStream and provides
3826  * for buffered reads.
3827  *
3828  * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3829  *
3830  * To create a buffered input stream, use g_buffered_input_stream_new(),
3831  * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3832  * construction.
3833  *
3834  * To get the size of a buffer within a buffered input stream, use
3835  * g_buffered_input_stream_get_buffer_size(). To change the size of a
3836  * buffered input stream's buffer, use
3837  * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3838  * cannot be reduced below the size of the data within the buffer.
3839  */
3840
3841
3842 /**
3843  * SECTION:gbufferedoutputstream
3844  * @short_description: Buffered Output Stream
3845  * @include: gio/gio.h
3846  * @see_also: #GFilterOutputStream, #GOutputStream
3847  *
3848  * Buffered output stream implements #GFilterOutputStream and provides
3849  * for buffered writes.
3850  *
3851  * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
3852  *
3853  * To create a buffered output stream, use g_buffered_output_stream_new(),
3854  * or g_buffered_output_stream_new_sized() to specify the buffer's size
3855  * at construction.
3856  *
3857  * To get the size of a buffer within a buffered input stream, use
3858  * g_buffered_output_stream_get_buffer_size(). To change the size of a
3859  * buffered output stream's buffer, use
3860  * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
3861  * size cannot be reduced below the size of the data within the buffer.
3862  */
3863
3864
3865 /**
3866  * SECTION:gcancellable
3867  * @short_description: Thread-safe Operation Cancellation Stack
3868  * @include: gio/gio.h
3869  *
3870  * GCancellable is a thread-safe operation cancellation stack used
3871  * throughout GIO to allow for cancellation of synchronous and
3872  * asynchronous operations.
3873  */
3874
3875
3876 /**
3877  * SECTION:gcharsetconverter
3878  * @short_description: Convert between charsets
3879  * @include: gio/gio.h
3880  *
3881  * #GCharsetConverter is an implementation of #GConverter based on
3882  * GIConv.
3883  */
3884
3885
3886 /**
3887  * SECTION:gcontenttype
3888  * @short_description: Platform-specific content typing
3889  * @include: gio/gio.h
3890  *
3891  * A content type is a platform specific string that defines the type
3892  * 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".
3893  * On Win32 it is an extension string like ".doc", ".txt" or a perceived
3894  * string like "audio". Such strings can be looked up in the registry at
3895  * HKEY_CLASSES_ROOT.
3896  */
3897
3898
3899 /**
3900  * SECTION:gconverter
3901  * @short_description: Data conversion interface
3902  * @include: gio/gio.h
3903  * @see_also: #GInputStream, #GOutputStream
3904  *
3905  * #GConverter is implemented by objects that convert
3906  * binary data in various ways. The conversion can be
3907  * stateful and may fail at any place.
3908  *
3909  * Some example conversions are: character set conversion,
3910  * compression, decompression and regular expression
3911  * replace.
3912  *
3913  * Since: 2.24
3914  */
3915
3916
3917 /**
3918  * SECTION:gconverterinputstream
3919  * @short_description: Converter Input Stream
3920  * @include: gio/gio.h
3921  * @see_also: #GInputStream, #GConverter
3922  *
3923  * Converter input stream implements #GInputStream and allows
3924  * conversion of data of various types during reading.
3925  *
3926  * As of GLib 2.34, #GConverterInputStream implements
3927  * #GPollableInputStream.
3928  */
3929
3930
3931 /**
3932  * SECTION:gconverteroutputstream
3933  * @short_description: Converter Output Stream
3934  * @include: gio/gio.h
3935  * @see_also: #GOutputStream, #GConverter
3936  *
3937  * Converter output stream implements #GOutputStream and allows
3938  * conversion of data of various types during reading.
3939  *
3940  * As of GLib 2.34, #GConverterOutputStream implements
3941  * #GPollableOutputStream.
3942  */
3943
3944
3945 /**
3946  * SECTION:gcredentials
3947  * @short_description: An object containing credentials
3948  * @include: gio/gio.h
3949  *
3950  * The #GCredentials type is a reference-counted wrapper for native
3951  * credentials. This information is typically used for identifying,
3952  * authenticating and authorizing other processes.
3953  *
3954  * Some operating systems supports looking up the credentials of the
3955  * remote peer of a communication endpoint - see e.g.
3956  * g_socket_get_credentials().
3957  *
3958  * Some operating systems supports securely sending and receiving
3959  * credentials over a Unix Domain Socket, see
3960  * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3961  * g_unix_connection_receive_credentials() for details.
3962  *
3963  * On Linux, the native credential type is a <type>struct ucred</type>
3964  * - see the
3965  * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3966  * man page for details. This corresponds to
3967  * %G_CREDENTIALS_TYPE_LINUX_UCRED.
3968  *
3969  * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3970  * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3971  *
3972  * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
3973  * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
3974  */
3975
3976
3977 /**
3978  * SECTION:gdatainputstream
3979  * @short_description: Data Input Stream
3980  * @include: gio/gio.h
3981  * @see_also: #GInputStream
3982  *
3983  * Data input stream implements #GInputStream and includes functions for
3984  * reading structured data directly from a binary input stream.
3985  */
3986
3987
3988 /**
3989  * SECTION:gdataoutputstream
3990  * @short_description: Data Output Stream
3991  * @include: gio/gio.h
3992  * @see_also: #GOutputStream
3993  *
3994  * Data output stream implements #GOutputStream and includes functions for
3995  * writing data directly to an output stream.
3996  */
3997
3998
3999 /**
4000  * SECTION:gdbusactiongroup
4001  * @title: GDBusActionGroup
4002  * @short_description: A D-Bus GActionGroup implementation
4003  * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4004  *
4005  * #GDBusActionGroup is an implementation of the #GActionGroup
4006  * interface that can be used as a proxy for an action group
4007  * that is exported over D-Bus with g_dbus_connection_export_action_group().
4008  */
4009
4010
4011 /**
4012  * SECTION:gdbusaddress
4013  * @title: D-Bus Addresses
4014  * @short_description: D-Bus connection endpoints
4015  * @include: gio/gio.h
4016  *
4017  * Routines for working with D-Bus addresses. A D-Bus address is a string
4018  * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4019  * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html&num;addresses">D-Bus specification</link>.
4020  */
4021
4022
4023 /**
4024  * SECTION:gdbusauthobserver
4025  * @short_description: Object used for authenticating connections
4026  * @include: gio/gio.h
4027  *
4028  * The #GDBusAuthObserver type provides a mechanism for participating
4029  * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4030  * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4031  * signals you are interested in. Note that new signals may be added
4032  * in the future
4033  *
4034  * For example, if you only want to allow D-Bus connections from
4035  * processes owned by the same uid as the server, you would use a
4036  * signal handler like the following:
4037  * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4038  * static gboolean
4039  * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4040  *                                  GIOStream         *stream,
4041  *                                  GCredentials      *credentials,
4042  *                                  gpointer           user_data)
4043  * {
4044  *   gboolean authorized;
4045  *
4046  *   authorized = FALSE;
4047  *   if (credentials != NULL)
4048  *     {
4049  *       GCredentials *own_credentials;
4050  *       own_credentials = g_credentials_new ();
4051  *       if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4052  *         authorized = TRUE;
4053  *       g_object_unref (own_credentials);
4054  *     }
4055  *
4056  *   return authorized;
4057  * }
4058  * </programlisting></example>
4059  */
4060
4061
4062 /**
4063  * SECTION:gdbusconnection
4064  * @short_description: D-Bus Connections
4065  * @include: gio/gio.h
4066  *
4067  * The #GDBusConnection type is used for D-Bus connections to remote
4068  * peers such as a message buses. It is a low-level API that offers a
4069  * lot of flexibility. For instance, it lets you establish a connection
4070  * over any transport that can by represented as an #GIOStream.
4071  *
4072  * This class is rarely used directly in D-Bus clients. If you are writing
4073  * an D-Bus client, it is often easier to use the g_bus_own_name(),
4074  * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4075  *
4076  * As an exception to the usual GLib rule that a particular object must not be
4077  * used by two threads at the same time, #GDBusConnection's methods may be
4078  * called from any thread<footnote>
4079  * <para>
4080  *   This is so that g_bus_get() and g_bus_get_sync() can safely return the
4081  *   same #GDBusConnection when called from any thread.
4082  * </para>
4083  * </footnote>.
4084  *
4085  * Most of the ways to obtain a #GDBusConnection automatically initialize it
4086  * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4087  * g_bus_get(), and the synchronous versions of those methods, give you an
4088  * initialized connection. Language bindings for GIO should use
4089  * g_initable_new() or g_async_initable_new_async(), which also initialize the
4090  * connection.
4091  *
4092  * If you construct an uninitialized #GDBusConnection, such as via
4093  * g_object_new(), you must initialize it via g_initable_init() or
4094  * g_async_initable_init_async() before using its methods or properties.
4095  * Calling methods or accessing properties on a #GDBusConnection that has not
4096  * completed initialization successfully is considered to be invalid, and leads
4097  * to undefined behaviour. In particular, if initialization fails with a
4098  * #GError, the only valid thing you can do with that #GDBusConnection is to
4099  * free it with g_object_unref().
4100  *
4101  * <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>
4102  *
4103  * <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>
4104  *
4105  * <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>
4106  *
4107  * <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>
4108  */
4109
4110
4111 /**
4112  * SECTION:gdbuserror
4113  * @title: GDBusError
4114  * @short_description: Mapping D-Bus errors to and from GError
4115  * @include: gio/gio.h
4116  *
4117  * All facilities that return errors from remote methods (such as
4118  * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4119  * errors (e.g. errors returned from the other peer) and locally
4120  * in-process generated errors.
4121  *
4122  * To check if a returned #GError is an error from a remote peer, use
4123  * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4124  * use g_dbus_error_get_remote_error(). Before presenting an error,
4125  * always use g_dbus_error_strip_remote_error().
4126  *
4127  * In addition, facilities used to return errors to a remote peer also
4128  * use #GError. See g_dbus_method_invocation_return_error() for
4129  * discussion about how the D-Bus error name is set.
4130  *
4131  * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4132  * automatically map from D-Bus errors to #GError and back. This
4133  * is typically done in the function returning the #GQuark for the
4134  * error domain:
4135  * <example id="error-registration"><title>Error Registration</title><programlisting>
4136  * /<!-- -->* foo-bar-error.h: *<!-- -->/
4137  *
4138  * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4139  * GQuark foo_bar_error_quark (void);
4140  *
4141  * typedef enum
4142  * {
4143  *   FOO_BAR_ERROR_FAILED,
4144  *   FOO_BAR_ERROR_ANOTHER_ERROR,
4145  *   FOO_BAR_ERROR_SOME_THIRD_ERROR,
4146  * } FooBarError;
4147  *
4148  * /<!-- -->* foo-bar-error.c: *<!-- -->/
4149  *
4150  * static const GDBusErrorEntry foo_bar_error_entries[] =
4151  * {
4152  *   {FOO_BAR_ERROR_FAILED,           "org.project.Foo.Bar.Error.Failed"},
4153  *   {FOO_BAR_ERROR_ANOTHER_ERROR,    "org.project.Foo.Bar.Error.AnotherError"},
4154  *   {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4155  * };
4156  *
4157  * GQuark
4158  * foo_bar_error_quark (void)
4159  * {
4160  *   static volatile gsize quark_volatile = 0;
4161  *   g_dbus_error_register_error_domain ("foo-bar-error-quark",
4162  *                                       &quark_volatile,
4163  *                                       foo_bar_error_entries,
4164  *                                       G_N_ELEMENTS (foo_bar_error_entries));
4165  *   G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) - 1 == FOO_BAR_ERROR_SOME_THIRD_ERROR);
4166  *   return (GQuark) quark_volatile;
4167  * }
4168  * </programlisting></example>
4169  * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4170  * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4171  * If the other peer is using GDBus, the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4172  * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4173  * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4174  *
4175  * Note that errors in the %G_DBUS_ERROR error domain is intended only
4176  * for returning errors from a remote message bus process. Errors
4177  * generated locally in-process by e.g. #GDBusConnection is from the
4178  * %G_IO_ERROR domain.
4179  */
4180
4181
4182 /**
4183  * SECTION:gdbusinterface
4184  * @short_description: Base type for D-Bus interfaces
4185  * @include: gio/gio.h
4186  *
4187  * The #GDBusInterface type is the base type for D-Bus interfaces both
4188  * on the service side (see #GDBusInterfaceSkeleton) and client side
4189  * (see #GDBusProxy).
4190  */
4191
4192
4193 /**
4194  * SECTION:gdbusinterfaceskeleton
4195  * @short_description: Service-side D-Bus interface
4196  * @include: gio/gio.h
4197  *
4198  * Abstract base class for D-Bus interfaces on the service side.
4199  */
4200
4201
4202 /**
4203  * SECTION:gdbusintrospection
4204  * @title: D-Bus Introspection Data
4205  * @short_description: Node and interface description data structures
4206  * @include: gio/gio.h
4207  *
4208  * Various data structures and convenience routines to parse and
4209  * generate D-Bus introspection XML. Introspection information is
4210  * used when registering objects with g_dbus_connection_register_object().
4211  *
4212  * The format of D-Bus introspection XML is specified in the
4213  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4214  */
4215
4216
4217 /**
4218  * SECTION:gdbusmenumodel
4219  * @title: GDBusMenuModel
4220  * @short_description: A D-Bus GMenuModel implementation
4221  * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4222  *
4223  * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4224  * as a proxy for a menu model that is exported over D-Bus with
4225  * g_dbus_connection_export_menu_model().
4226  */
4227
4228
4229 /**
4230  * SECTION:gdbusmessage
4231  * @short_description: D-Bus Message
4232  * @include: gio/gio.h
4233  *
4234  * A type for representing D-Bus messages that can be sent or received
4235  * on a #GDBusConnection.
4236  */
4237
4238
4239 /**
4240  * SECTION:gdbusmethodinvocation
4241  * @short_description: Object for handling remote calls
4242  * @include: gio/gio.h
4243  *
4244  * Instances of the #GDBusMethodInvocation class are used when
4245  * handling D-Bus method calls. It provides a way to asynchronously
4246  * return results and errors.
4247  *
4248  * The normal way to obtain a #GDBusMethodInvocation object is to receive
4249  * it as an argument to the handle_method_call() function in a
4250  * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4251  */
4252
4253
4254 /**
4255  * SECTION:gdbusnameowning
4256  * @title: Owning Bus Names
4257  * @short_description: Simple API for owning bus names
4258  * @include: gio/gio.h
4259  *
4260  * Convenience API for owning bus names.
4261  *
4262  * <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>
4263  */
4264
4265
4266 /**
4267  * SECTION:gdbusnamewatching
4268  * @title: Watching Bus Names
4269  * @short_description: Simple API for watching bus names
4270  * @include: gio/gio.h
4271  *
4272  * Convenience API for watching bus names.
4273  *
4274  * <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>
4275  */
4276
4277
4278 /**
4279  * SECTION:gdbusobject
4280  * @short_description: Base type for D-Bus objects
4281  * @include: gio/gio.h
4282  *
4283  * The #GDBusObject type is the base type for D-Bus objects on both
4284  * the service side (see #GDBusObjectSkeleton) and the client side
4285  * (see #GDBusObjectProxy). It is essentially just a container of
4286  * interfaces.
4287  */
4288
4289
4290 /**
4291  * SECTION:gdbusobjectmanager
4292  * @short_description: Base type for D-Bus object managers
4293  * @include: gio/gio.h
4294  *
4295  * The #GDBusObjectManager type is the base type for service- and
4296  * client-side implementations of the standardized <ulink
4297  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4298  * interface.
4299  *
4300  * See #GDBusObjectManagerClient for the client-side implementation
4301  * and #GDBusObjectManagerServer for the service-side implementation.
4302  */
4303
4304
4305 /**
4306  * SECTION:gdbusobjectmanagerclient
4307  * @short_description: Client-side object manager
4308  * @include: gio/gio.h
4309  *
4310  * #GDBusObjectManagerClient is used to create, monitor and delete object
4311  * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4312  * code implementing the <ulink
4313  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4314  * interface).
4315  *
4316  * Once an instance of this type has been created, you can connect to
4317  * the #GDBusObjectManager::object-added and
4318  * #GDBusObjectManager::object-removed signals and inspect the
4319  * #GDBusObjectProxy objects returned by
4320  * g_dbus_object_manager_get_objects().
4321  *
4322  * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4323  * object construction time, the default behavior is to request the
4324  * message bus to launch an owner for the name. This behavior can be
4325  * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4326  * flag. It's also worth noting that this only works if the name of
4327  * interest is activatable in the first place. E.g. in some cases it
4328  * is not possible to launch an owner for the requested name. In this
4329  * case, #GDBusObjectManagerClient object construction still succeeds but
4330  * there will be no object proxies
4331  * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4332  * the #GDBusObjectManagerClient:name-owner property is %NULL.
4333  *
4334  * The owner of the requested name can come and go (for example
4335  * consider a system service being restarted) â€“ #GDBusObjectManagerClient
4336  * handles this case too; simply connect to the #GObject::notify
4337  * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4338  * property. When the name owner vanishes, the behavior is that
4339  * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4340  * emission of the #GObject::notify signal) and then
4341  * #GDBusObjectManager::object-removed signals are synthesized
4342  * for all currently existing object proxies. Since
4343  * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4344  * use this information to disambiguate a synthesized signal from a
4345  * genuine signal caused by object removal on the remote
4346  * #GDBusObjectManager. Similarly, when a new name owner appears,
4347  * #GDBusObjectManager::object-added signals are synthesized
4348  * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4349  * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4350  * is set to the new name owner (this includes emission of the
4351  * #GObject::notify signal).  Furthermore, you are guaranteed that
4352  * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4353  * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4354  * the name of interest is atomically replaced
4355  *
4356  * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4357  * instances. All signals (including the
4358  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4359  * signal) delivered to #GDBusProxy instances are guaranteed to
4360  * originate from the name owner. This guarantee along with the
4361  * behavior described above, means that certain race conditions
4362  * including the <emphasis><quote>half the proxy is from the old owner
4363  * and the other half is from the new owner</quote></emphasis> problem
4364  * cannot happen.
4365  *
4366  * To avoid having the application connect to signals on the returned
4367  * #GDBusObjectProxy and #GDBusProxy objects, the
4368  * #GDBusObject::interface-added,
4369  * #GDBusObject::interface-removed,
4370  * #GDBusProxy::g-properties-changed and
4371  * #GDBusProxy::g-signal signals
4372  * are also emitted on the #GDBusObjectManagerClient instance managing these
4373  * objects. The signals emitted are
4374  * #GDBusObjectManager::interface-added,
4375  * #GDBusObjectManager::interface-removed,
4376  * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4377  * #GDBusObjectManagerClient::interface-proxy-signal.
4378  *
4379  * Note that all callbacks and signals are emitted in the
4380  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4381  * that the #GDBusObjectManagerClient object was constructed
4382  * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4383  * originating from the #GDBusObjectManagerClient object will be created in
4384  * the same context and, consequently, will deliver signals in the
4385  * same main loop.
4386  */
4387
4388
4389 /**
4390  * SECTION:gdbusobjectmanagerserver
4391  * @short_description: Service-side object manager
4392  * @include: gio/gio.h
4393  *
4394  * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4395  * the standardized <ulink
4396  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4397  * interface. For example, remote D-Bus clients can get all objects
4398  * and properties in a single call. Additionally, any change in the
4399  * object hierarchy is broadcast using signals. This means that D-Bus
4400  * clients can keep caches up to date by only listening to D-Bus
4401  * signals.
4402  *
4403  * See #GDBusObjectManagerClient for the client-side code that is
4404  * intended to be used with #GDBusObjectManagerServer or any D-Bus
4405  * object implementing the org.freedesktop.DBus.ObjectManager
4406  * interface.
4407  */
4408
4409
4410 /**
4411  * SECTION:gdbusobjectproxy
4412  * @short_description: Client-side D-Bus object
4413  * @include: gio/gio.h
4414  *
4415  * A #GDBusObjectProxy is an object used to represent a remote object
4416  * with one or more D-Bus interfaces. Normally, you don't instantiate
4417  * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4418  * is used to obtain it.
4419  *
4420  * Since: 2.30
4421  */
4422
4423
4424 /**
4425  * SECTION:gdbusobjectskeleton
4426  * @short_description: Service-side D-Bus object
4427  * @include: gio/gio.h
4428  *
4429  * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4430  * interfaces. The set of exported interfaces on the object may be
4431  * dynamic and change at runtime.
4432  *
4433  * This type is intended to be used with #GDBusObjectManager.
4434  */
4435
4436
4437 /**
4438  * SECTION:gdbusproxy
4439  * @short_description: Client-side D-Bus interface proxy
4440  * @include: gio/gio.h
4441  *
4442  * #GDBusProxy is a base class used for proxies to access a D-Bus
4443  * interface on a remote object. A #GDBusProxy can be constructed for
4444  * both well-known and unique names.
4445  *
4446  * By default, #GDBusProxy will cache all properties (and listen to
4447  * changes) of the remote object, and proxy all signals that gets
4448  * emitted. This behaviour can be changed by passing suitable
4449  * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4450  * well-known name, the property cache is flushed when the name owner
4451  * vanishes and reloaded when a name owner appears.
4452  *
4453  * If a #GDBusProxy is used for a well-known name, the owner of the
4454  * name is tracked and can be read from
4455  * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4456  * get notified of changes. Additionally, only signals and property
4457  * changes emitted from the current name owner are considered and
4458  * calls are always sent to the current name owner. This avoids a
4459  * number of race conditions when the name is lost by one owner and
4460  * claimed by another. However, if no name owner currently exists,
4461  * then calls will be sent to the well-known name which may result in
4462  * the message bus launching an owner (unless
4463  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4464  *
4465  * The generic #GDBusProxy::g-properties-changed and
4466  * #GDBusProxy::g-signal signals are not very convenient to work
4467  * with. Therefore, the recommended way of working with proxies is to
4468  * subclass #GDBusProxy, and have more natural properties and signals
4469  * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4470  * for how this can easily be done using the
4471  * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4472  * tool.
4473  *
4474  * A #GDBusProxy instance can be used from multiple threads but note
4475  * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4476  * and #GObject::notify) are emitted in the
4477  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4478  * of the thread where the instance was constructed.
4479  *
4480  * <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>
4481  */
4482
4483
4484 /**
4485  * SECTION:gdbusserver
4486  * @short_description: Helper for accepting connections
4487  * @include: gio/gio.h
4488  *
4489  * #GDBusServer is a helper for listening to and accepting D-Bus
4490  * connections. This can be used to create a new D-Bus server, allowing two
4491  * peers to use the D-Bus protocol for their own specialized communication.
4492  * A server instance provided in this way will not perform message routing or
4493  * implement the org.freedesktop.DBus interface.
4494  *
4495  * To just export an object on a well-known name on a message bus, such as the
4496  * session or system bus, you should instead use g_bus_own_name().
4497  *
4498  * <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>
4499  */
4500
4501
4502 /**
4503  * SECTION:gdbusutils
4504  * @title: D-Bus Utilities
4505  * @short_description: Various utilities related to D-Bus.
4506  * @include: gio/gio.h
4507  *
4508  * Various utility routines related to D-Bus.
4509  */
4510
4511
4512 /**
4513  * SECTION:gdesktopappinfo
4514  * @title: GDesktopAppInfo
4515  * @short_description: Application information from desktop files
4516  * @include: gio/gdesktopappinfo.h
4517  *
4518  * #GDesktopAppInfo is an implementation of #GAppInfo based on
4519  * desktop files.
4520  *
4521  * Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
4522  * the UNIX-specific GIO interfaces, thus you have to use the
4523  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4524  */
4525
4526
4527 /**
4528  * SECTION:gdrive
4529  * @short_description: Drive management
4530  * @include: gio/gio.h
4531  *
4532  * #GDrive - this represent a piece of hardware connected to the machine.
4533  * It's generally only created for removable hardware or hardware with
4534  * removable media.
4535  *
4536  * #GDrive is a container class for #GVolume objects that stem from
4537  * the same piece of media. As such, #GDrive abstracts a drive with
4538  * (or without) removable media and provides operations for querying
4539  * whether media is available, determing whether media change is
4540  * automatically detected and ejecting the media.
4541  *
4542  * If the #GDrive reports that media isn't automatically detected, one
4543  * can poll for media; typically one should not do this periodically
4544  * as a poll for media operation is potententially expensive and may
4545  * spin up the drive creating noise.
4546  *
4547  * #GDrive supports starting and stopping drives with authentication
4548  * support for the former. This can be used to support a diverse set
4549  * of use cases including connecting/disconnecting iSCSI devices,
4550  * powering down external disk enclosures and starting/stopping
4551  * multi-disk devices such as RAID devices. Note that the actual
4552  * semantics and side-effects of starting/stopping a #GDrive may vary
4553  * according to implementation. To choose the correct verbs in e.g. a
4554  * file manager, use g_drive_get_start_stop_type().
4555  *
4556  * For porting from GnomeVFS note that there is no equivalent of
4557  * #GDrive in that API.
4558  */
4559
4560
4561 /**
4562  * SECTION:gemblem
4563  * @short_description: An object for emblems
4564  * @include: gio/gio.h
4565  * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4566  *
4567  * #GEmblem is an implementation of #GIcon that supports
4568  * having an emblem, which is an icon with additional properties.
4569  * It can than be added to a #GEmblemedIcon.
4570  *
4571  * Currently, only metainformation about the emblem's origin is
4572  * supported. More may be added in the future.
4573  */
4574
4575
4576 /**
4577  * SECTION:gemblemedicon
4578  * @short_description: Icon with emblems
4579  * @include: gio/gio.h
4580  * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4581  *
4582  * #GEmblemedIcon is an implementation of #GIcon that supports
4583  * adding an emblem to an icon. Adding multiple emblems to an
4584  * icon is ensured via g_emblemed_icon_add_emblem().
4585  *
4586  * Note that #GEmblemedIcon allows no control over the position
4587  * of the emblems. See also #GEmblem for more information.
4588  */
4589
4590
4591 /**
4592  * SECTION:gfile
4593  * @short_description: File and Directory Handling
4594  * @include: gio/gio.h
4595  * @see_also: #GFileInfo, #GFileEnumerator
4596  *
4597  * #GFile is a high level abstraction for manipulating files on a
4598  * virtual file system. #GFile<!-- -->s are lightweight, immutable
4599  * objects that do no I/O upon creation. It is necessary to understand that
4600  * #GFile objects do not represent files, merely an identifier for a file. All
4601  * file content I/O is implemented as streaming operations (see #GInputStream and
4602  * #GOutputStream).
4603  *
4604  * To construct a #GFile, you can use:
4605  * g_file_new_for_path() if you have a path.
4606  * g_file_new_for_uri() if you have a URI.
4607  * g_file_new_for_commandline_arg() for a command line argument.
4608  * g_file_new_tmp() to create a temporary file from a template.
4609  * g_file_parse_name() from a utf8 string gotten from g_file_get_parse_name().
4610  *
4611  * One way to think of a #GFile is as an abstraction of a pathname. For normal
4612  * files the system pathname is what is stored internally, but as #GFile<!-- -->s
4613  * are extensible it could also be something else that corresponds to a pathname
4614  * in a userspace implementation of a filesystem.
4615  *
4616  * #GFile<!-- -->s make up hierarchies of directories and files that correspond to the
4617  * files on a filesystem. You can move through the file system with #GFile using
4618  * g_file_get_parent() to get an identifier for the parent directory, g_file_get_child()
4619  * to get a child within a directory, g_file_resolve_relative_path() to resolve a relative
4620  * path between two #GFile<!-- -->s. There can be multiple hierarchies, so you may not
4621  * end up at the same root if you repeatedly call g_file_get_parent() on two different
4622  * files.
4623  *
4624  * All #GFile<!-- -->s have a basename (get with g_file_get_basename()). These names
4625  * are byte strings that are used to identify the file on the filesystem (relative to
4626  * its parent directory) and there is no guarantees that they have any particular charset
4627  * encoding or even make any sense at all. If you want to use filenames in a user
4628  * interface you should use the display name that you can get by requesting the
4629  * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4630  * This is guaranteed to be in utf8 and can be used in a user interface. But always
4631  * store the real basename or the #GFile to use to actually access the file, because
4632  * there is no way to go from a display name to the actual name.
4633  *
4634  * Using #GFile as an identifier has the same weaknesses as using a path in that
4635  * there may be multiple aliases for the same file. For instance, hard or
4636  * soft links may cause two different #GFile<!-- -->s to refer to the same file.
4637  * Other possible causes for aliases are: case insensitive filesystems, short
4638  * and long names on Fat/NTFS, or bind mounts in Linux. If you want to check if
4639  * two #GFile<!-- -->s point to the same file you can query for the
4640  * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4641  * canonicalization of pathnames passed in, so that trivial differences in the
4642  * path string used at creation (duplicated slashes, slash at end of path, "."
4643  * or ".." path segments, etc) does not create different #GFile<!-- -->s.
4644  *
4645  * Many #GFile operations have both synchronous and asynchronous versions
4646  * to suit your application. Asynchronous versions of synchronous functions
4647  * simply have _async() appended to their function names. The asynchronous
4648  * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4649  * the operation, producing a GAsyncResult which is then passed to the
4650  * function's matching _finish() operation.
4651  *
4652  * Some #GFile operations do not have synchronous analogs, as they may
4653  * take a very long time to finish, and blocking may leave an application
4654  * unusable. Notable cases include:
4655  * g_file_mount_mountable() to mount a mountable file.
4656  * g_file_unmount_mountable_with_operation() to unmount a mountable file.
4657  * g_file_eject_mountable_with_operation() to eject a mountable file.
4658  *
4659  * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4660  * One notable feature of #GFile<!-- -->s are entity tags, or "etags" for
4661  * short. Entity tags are somewhat like a more abstract version of the
4662  * traditional mtime, and can be used to quickly determine if the file has
4663  * been modified from the version on the file system. See the HTTP 1.1
4664  * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4665  * for HTTP Etag headers, which are a very similar concept.
4666  * </para>
4667  */
4668
4669
4670 /**
4671  * SECTION:gfileattribute
4672  * @short_description: Key-Value Paired File Attributes
4673  * @include: gio/gio.h
4674  * @see_also: #GFile, #GFileInfo
4675  *
4676  * File attributes in GIO consist of a list of key-value pairs.
4677  *
4678  * Keys are strings that contain a key namespace and a key name, separated
4679  * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4680  * key-value pairs by namespaces for relevance. Keys can be retrived
4681  * using wildcards, e.g. "standard::*" will return all of the keys in the
4682  * "standard" namespace.
4683  *
4684  * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4685  * available as a #GFileAttributeInfoList. This list is queryable by key names
4686  * as indicated earlier.
4687  *
4688  * Information is stored within the list in #GFileAttributeInfo structures.
4689  * The info structure can store different types, listed in the enum
4690  * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4691  * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4692  *
4693  * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4694  * install default keys and values for their given file system, architecture,
4695  * and other possible implementation details (e.g., on a UNIX system, a file
4696  * attribute key will be registered for the user id for a given file).
4697  *
4698  * <para>
4699  * <table>
4700  * <title>GFileAttributes Default Namespaces</title>
4701  * <tgroup cols='2' align='left'><thead>
4702  * <row><entry>Namspace</entry><entry>Description</entry></row>
4703  * </thead>
4704  * <tbody>
4705  * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4706  * information that any application may need should be put in this namespace.
4707  * Examples include the file's name, type, and size.</entry></row>
4708  * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4709  * namespace. Currently, the only key in this namespace is "value", which contains
4710  * the value of the current entity tag.</entry></row>
4711  * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4712  * namespace is used by file managers and applications that list directories
4713  * to check for loops and to uniquely identify files.</entry></row>
4714  * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4715  * if a user has the proper privilidges to access files and perform
4716  * file operations. Keys in this namespace are made to be generic
4717  * and easily understood, e.g. the "can_read" key is %TRUE if
4718  * the current user has permission to read the file. UNIX permissions and
4719  * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4720  * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4721  * simple boolean keys for checking if a file or path supports mount operations, e.g.
4722  * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4723  * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4724  * access, changed, created times. </entry></row>
4725  * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4726  * information and may not be available for all files. Examples include
4727  * the UNIX "UID", "GID", etc.</entry></row>
4728  * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4729  * information and may not be available for all files. Examples include
4730  * "is_system" for checking if a file is marked as a system file, and "is_archive"
4731  * for checking if a file is marked as an archive file.</entry></row>
4732  * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4733  * about who owns a file. May not be available for all file systems. Examples include
4734  * "user" for getting the user name of the file owner. This information is often mapped from
4735  * some backend specific data such as a unix UID.</entry></row>
4736  * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4737  * information about file thumbnails and their location within the file system. Examples of
4738  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4739  * to check if thumbnailing of the file failed.</entry></row>
4740  * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4741  * about the file system where a file is located, such as its type, how much
4742  * space is left available, and the overall size of the file system.</entry></row>
4743  * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4744  * contain information about the current GVFS backend in use. </entry></row>
4745  * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4746  * about extended user attributes. See attr(5). The "user." prefix of the
4747  * extended user attribute name is stripped away when constructing keys in
4748  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4749  * the name "user.mime_type". Note that this information is only available
4750  * if GLib has been built with extended attribute support.</entry></row>
4751  * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4752  * Gets information about extended attributes which are not user-specific.
4753  * See attr(5). Note that this information is only available if GLib
4754  * has been built with extended attribute support.</entry></row>
4755  * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4756  * information about the SELinux context of files. Note that this information
4757  * is only available if GLib has been built with SELinux support.</entry></row>
4758  * </tbody>
4759  * </tgroup>
4760  * </table>
4761  * </para>
4762  *
4763  * Please note that these are not all of the possible namespaces.
4764  * More namespaces can be added from GIO modules or by individual applications.
4765  * For more information about writing GIO modules, see #GIOModule.
4766  *
4767  * <!-- TODO: Implementation note about using extended attributes on supported
4768  * file systems -->
4769  *
4770  * <para><table>
4771  * <title>GFileAttributes Built-in Keys and Value Types</title>
4772  * <tgroup cols='3' align='left'><thead>
4773  * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4774  * </thead><tbody>
4775  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4776  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4777  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4778  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4779  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4780  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4781  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4782  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4783  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4784  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4785  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4786  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4787  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4788  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4789  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4790  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4791  * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4792  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4793  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4794  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4795  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4796  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4797  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4798  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4799  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4800  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4801  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4802  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4803  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4804  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4805  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4806  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4807  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4808  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4809  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4810  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4811  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4812  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4813  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4814  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4815  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4816  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4817  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4818  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4819  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4820  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4821  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4822  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4823  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4824  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4825  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4826  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4827  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4828  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4829  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4830  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4831  * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4832  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4833  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4834  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4835  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4836  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4837  * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4838  * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4839  * </tbody></tgroup></table></para>
4840  *
4841  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4842  * namespaces. Keys for the "xattr" namespace are constructed by stripping
4843  * away the "user." prefix from the extended user attribute, and prepending
4844  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4845  * concatenating "xattr-sys::" with the extended attribute name. All extended
4846  * attribute values are returned as hex-encoded strings in which bytes outside
4847  * the ASCII range are encoded as hexadecimal escape sequences of the form
4848  * \x<replaceable>nn</replaceable>.
4849  */
4850
4851
4852 /**
4853  * SECTION:gfiledescriptorbased
4854  * @short_description: Interface for file descriptor based IO
4855  * @include: gio/gfiledescriptorbased.h
4856  * @see_also: #GInputStream, #GOutputStream
4857  *
4858  * #GFileDescriptorBased is implemented by streams (implementations of
4859  * #GInputStream or #GOutputStream) that are based on file descriptors.
4860  *
4861  * Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
4862  * the UNIX-specific GIO interfaces, thus you have to use the
4863  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4864  *
4865  * Since: 2.24
4866  */
4867
4868
4869 /**
4870  * SECTION:gfileenumerator
4871  * @short_description: Enumerated Files Routines
4872  * @include: gio/gio.h
4873  *
4874  * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4875  * returning a #GFileInfo structure for each file enumerated (e.g.
4876  * g_file_enumerate_children() will return a #GFileEnumerator for each
4877  * of the children within a directory).
4878  *
4879  * To get the next file's information from a #GFileEnumerator, use
4880  * g_file_enumerator_next_file() or its asynchronous version,
4881  * g_file_enumerator_next_files_async(). Note that the asynchronous
4882  * version will return a list of #GFileInfo<!---->s, whereas the
4883  * synchronous will only return the next file in the enumerator.
4884  *
4885  * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4886  * its asynchronous version, g_file_enumerator_close_async(). Once
4887  * a #GFileEnumerator is closed, no further actions may be performed
4888  * on it, and it should be freed with g_object_unref().
4889  */
4890
4891
4892 /**
4893  * SECTION:gfileicon
4894  * @short_description: Icons pointing to an image file
4895  * @include: gio/gio.h
4896  * @see_also: #GIcon, #GLoadableIcon
4897  *
4898  * #GFileIcon specifies an icon by pointing to an image file
4899  * to be used as icon.
4900  */
4901
4902
4903 /**
4904  * SECTION:gfileinfo
4905  * @short_description: File Information and Attributes
4906  * @include: gio/gio.h
4907  * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4908  *
4909  * Functionality for manipulating basic metadata for files. #GFileInfo
4910  * implements methods for getting information that all files should
4911  * contain, and allows for manipulation of extended attributes.
4912  *
4913  * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
4914  * information on how GIO handles file attributes.
4915  *
4916  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
4917  * async variant). To obtain a #GFileInfo for a file input or output
4918  * stream, use g_file_input_stream_query_info() or
4919  * g_file_output_stream_query_info() (or their async variants).
4920  *
4921  * To change the actual attributes of a file, you should then set the
4922  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
4923  * or g_file_set_attributes_async() on a GFile.
4924  *
4925  * However, not all attributes can be changed in the file. For instance,
4926  * the actual size of a file cannot be changed via g_file_info_set_size().
4927  * You may call g_file_query_settable_attributes() and
4928  * g_file_query_writable_namespaces() to discover the settable attributes
4929  * of a particular file at runtime.
4930  *
4931  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
4932  * attributes.
4933  */
4934
4935
4936 /**
4937  * SECTION:gfileinputstream
4938  * @short_description: File input streaming operations
4939  * @include: gio/gio.h
4940  * @see_also: #GInputStream, #GDataInputStream, #GSeekable
4941  *
4942  * GFileInputStream provides input streams that take their
4943  * content from a file.
4944  *
4945  * GFileInputStream implements #GSeekable, which allows the input
4946  * stream to jump to arbitrary positions in the file, provided the
4947  * filesystem of the file allows it. To find the position of a file
4948  * input stream, use g_seekable_tell(). To find out if a file input
4949  * stream supports seeking, use g_seekable_can_seek().
4950  * To position a file input stream, use g_seekable_seek().
4951  */
4952
4953
4954 /**
4955  * SECTION:gfileiostream
4956  * @short_description: File read and write streaming operations
4957  * @include: gio/gio.h
4958  * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
4959  *
4960  * GFileIOStream provides io streams that both read and write to the same
4961  * file handle.
4962  *
4963  * GFileIOStream implements #GSeekable, which allows the io
4964  * stream to jump to arbitrary positions in the file and to truncate
4965  * the file, provided the filesystem of the file supports these
4966  * operations.
4967  *
4968  * To find the position of a file io stream, use
4969  * g_seekable_tell().
4970  *
4971  * To find out if a file io stream supports seeking, use g_seekable_can_seek().
4972  * To position a file io stream, use g_seekable_seek().
4973  * To find out if a file io stream supports truncating, use
4974  * g_seekable_can_truncate(). To truncate a file io
4975  * stream, use g_seekable_truncate().
4976  *
4977  * The default implementation of all the #GFileIOStream operations
4978  * and the implementation of #GSeekable just call into the same operations
4979  * on the output stream.
4980  *
4981  * Since: 2.22
4982  */
4983
4984
4985 /**
4986  * SECTION:gfilemonitor
4987  * @short_description: File Monitor
4988  * @include: gio/gio.h
4989  *
4990  * Monitors a file or directory for changes.
4991  *
4992  * To obtain a #GFileMonitor for a file or directory, use
4993  * g_file_monitor(), g_file_monitor_file(), or
4994  * g_file_monitor_directory().
4995  *
4996  * To get informed about changes to the file or directory you are
4997  * monitoring, connect to the #GFileMonitor::changed signal. The
4998  * signal will be emitted in the <link
4999  * linkend="g-main-context-push-thread-default">thread-default main
5000  * context</link> of the thread that the monitor was created in
5001  * (though if the global default main context is blocked, this may
5002  * cause notifications to be blocked even if the thread-default
5003  * context is still running).
5004  */
5005
5006
5007 /**
5008  * SECTION:gfilenamecompleter
5009  * @short_description: Filename Completer
5010  * @include: gio/gio.h
5011  *
5012  * Completes partial file and directory names given a partial string by
5013  * looking in the file system for clues. Can return a list of possible
5014  * completion strings for widget implementations.
5015  */
5016
5017
5018 /**
5019  * SECTION:gfileoutputstream
5020  * @short_description: File output streaming operations
5021  * @include: gio/gio.h
5022  * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5023  *
5024  * GFileOutputStream provides output streams that write their
5025  * content to a file.
5026  *
5027  * GFileOutputStream implements #GSeekable, which allows the output
5028  * stream to jump to arbitrary positions in the file and to truncate
5029  * the file, provided the filesystem of the file supports these
5030  * operations.
5031  *
5032  * To find the position of a file output stream, use g_seekable_tell().
5033  * To find out if a file output stream supports seeking, use
5034  * g_seekable_can_seek().To position a file output stream, use
5035  * g_seekable_seek(). To find out if a file output stream supports
5036  * truncating, use g_seekable_can_truncate(). To truncate a file output
5037  * stream, use g_seekable_truncate().
5038  */
5039
5040
5041 /**
5042  * SECTION:gfilterinputstream
5043  * @short_description: Filter Input Stream
5044  * @include: gio/gio.h
5045  *
5046  * Base class for input stream implementations that perform some
5047  * kind of filtering operation on a base stream. Typical examples
5048  * of filtering operations are character set conversion, compression
5049  * and byte order flipping.
5050  */
5051
5052
5053 /**
5054  * SECTION:gfilteroutputstream
5055  * @short_description: Filter Output Stream
5056  * @include: gio/gio.h
5057  *
5058  * Base class for output stream implementations that perform some
5059  * kind of filtering operation on a base stream. Typical examples
5060  * of filtering operations are character set conversion, compression
5061  * and byte order flipping.
5062  */
5063
5064
5065 /**
5066  * SECTION:gicon
5067  * @short_description: Interface for icons
5068  * @include: gio/gio.h
5069  *
5070  * #GIcon is a very minimal interface for icons. It provides functions
5071  * for checking the equality of two icons, hashing of icons and
5072  * serializing an icon to and from strings.
5073  *
5074  * #GIcon does not provide the actual pixmap for the icon as this is out
5075  * of GIO's scope, however implementations of #GIcon may contain the name
5076  * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5077  *
5078  * To obtain a hash of a #GIcon, see g_icon_hash().
5079  *
5080  * To check if two #GIcons are equal, see g_icon_equal().
5081  *
5082  * For serializing a #GIcon, use g_icon_to_string() and
5083  * g_icon_new_for_string().
5084  *
5085  * If your application or library provides one or more #GIcon
5086  * implementations you need to ensure that each #GType is registered
5087  * with the type system prior to calling g_icon_new_for_string().
5088  */
5089
5090
5091 /**
5092  * SECTION:ginetaddress
5093  * @short_description: An IPv4/IPv6 address
5094  *
5095  * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5096  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5097  * look up the #GInetAddress for a hostname. Use
5098  * g_resolver_lookup_by_address() or
5099  * g_resolver_lookup_by_address_async() to look up the hostname for a
5100  * #GInetAddress.
5101  *
5102  * To actually connect to a remote host, you will need a
5103  * #GInetSocketAddress (which includes a #GInetAddress as well as a
5104  * port number).
5105  */
5106
5107
5108 /**
5109  * SECTION:ginetaddressmask
5110  * @short_description: An IPv4/IPv6 address mask
5111  *
5112  * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5113  * described by a base address and a length indicating how many bits
5114  * of the base address are relevant for matching purposes. These are
5115  * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5116  */
5117
5118
5119 /**
5120  * SECTION:ginetsocketaddress
5121  * @short_description: Internet GSocketAddress
5122  *
5123  * An IPv4 or IPv6 socket address; that is, the combination of a
5124  * #GInetAddress and a port number.
5125  */
5126
5127
5128 /**
5129  * SECTION:ginitable
5130  * @short_description: Failable object initialization interface
5131  * @include: gio/gio.h
5132  * @see_also: #GAsyncInitable
5133  *
5134  * #GInitable is implemented by objects that can fail during
5135  * initialization. If an object implements this interface then
5136  * it must be initialized as the first thing after construction,
5137  * either via g_initable_init() or g_async_initable_init_async()
5138  * (the latter is only available if it also implements #GAsyncInitable).
5139  *
5140  * If the object is not initialized, or initialization returns with an
5141  * error, then all operations on the object except g_object_ref() and
5142  * g_object_unref() are considered to be invalid, and have undefined
5143  * behaviour. They will often fail with g_critical() or g_warning(), but
5144  * this must not be relied on.
5145  *
5146  * Users of objects implementing this are not intended to use
5147  * the interface method directly, instead it will be used automatically
5148  * in various ways. For C applications you generally just call
5149  * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5150  * This will call g_initable_init() under the cover, returning %NULL and
5151  * setting a #GError on failure (at which point the instance is
5152  * unreferenced).
5153  *
5154  * For bindings in languages where the native constructor supports
5155  * exceptions the binding could check for objects implemention %GInitable
5156  * during normal construction and automatically initialize them, throwing
5157  * an exception on failure.
5158  */
5159
5160
5161 /**
5162  * SECTION:ginputstream
5163  * @short_description: Base class for implementing streaming input
5164  * @include: gio/gio.h
5165  *
5166  * #GInputStream has functions to read from a stream (g_input_stream_read()),
5167  * to close a stream (g_input_stream_close()) and to skip some content
5168  * (g_input_stream_skip()).
5169  *
5170  * To copy the content of an input stream to an output stream without
5171  * manually handling the reads and writes, use g_output_stream_splice().
5172  *
5173  * All of these functions have async variants too.
5174  */
5175
5176
5177 /**
5178  * SECTION:gioerror
5179  * @short_description: Error helper functions
5180  * @include: gio/gio.h
5181  *
5182  * Contains helper functions for reporting errors to the user.
5183  */
5184
5185
5186 /**
5187  * SECTION:giomodule
5188  * @short_description: Loadable GIO Modules
5189  * @include: gio/gio.h
5190  *
5191  * Provides an interface and default functions for loading and unloading
5192  * modules. This is used internally to make GIO extensible, but can also
5193  * be used by others to implement module loading.
5194  */
5195
5196
5197 /**
5198  * SECTION:gioscheduler
5199  * @short_description: I/O Scheduler
5200  * @include: gio/gio.h
5201  *
5202  * Schedules asynchronous I/O operations. #GIOScheduler integrates
5203  * into the main event loop (#GMainLoop) and uses threads.
5204  *
5205  * <para id="io-priority"><indexterm><primary>I/O priority</primary></indexterm>
5206  * Each I/O operation has a priority, and the scheduler uses the priorities
5207  * to determine the order in which operations are executed. They are
5208  * <emphasis>not</emphasis> used to determine system-wide I/O scheduling.
5209  * Priorities are integers, with lower numbers indicating higher priority.
5210  * It is recommended to choose priorities between %G_PRIORITY_LOW and
5211  * %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a default.
5212  * </para>
5213  */
5214
5215
5216 /**
5217  * SECTION:giostream
5218  * @short_description: Base class for implementing read/write streams
5219  * @include: gio/gio.h
5220  * @see_also: #GInputStream, #GOutputStream
5221  *
5222  * GIOStream represents an object that has both read and write streams.
5223  * Generally the two streams acts as separate input and output streams,
5224  * but they share some common resources and state. For instance, for
5225  * seekable streams they may use the same position in both streams.
5226  *
5227  * Examples of #GIOStream objects are #GSocketConnection which represents
5228  * a two-way network connection, and #GFileIOStream which represent a
5229  * file handle opened in read-write mode.
5230  *
5231  * To do the actual reading and writing you need to get the substreams
5232  * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5233  *
5234  * The #GIOStream object owns the input and the output streams, not the other
5235  * way around, so keeping the substreams alive will not keep the #GIOStream
5236  * object alive. If the #GIOStream object is freed it will be closed, thus
5237  * closing the substream, so even if the substreams stay alive they will
5238  * always just return a %G_IO_ERROR_CLOSED for all operations.
5239  *
5240  * To close a stream use g_io_stream_close() which will close the common
5241  * stream object and also the individual substreams. You can also close
5242  * the substreams themselves. In most cases this only marks the
5243  * substream as closed, so further I/O on it fails. However, some streams
5244  * may support "half-closed" states where one direction of the stream
5245  * is actually shut down.
5246  *
5247  * Since: 2.22
5248  */
5249
5250
5251 /**
5252  * SECTION:gloadableicon
5253  * @short_description: Loadable Icons
5254  * @include: gio/gio.h
5255  * @see_also: #GIcon, #GThemedIcon
5256  *
5257  * Extends the #GIcon interface and adds the ability to
5258  * load icons from streams.
5259  */
5260
5261
5262 /**
5263  * SECTION:gmemoryinputstream
5264  * @short_description: Streaming input operations on memory chunks
5265  * @include: gio/gio.h
5266  * @see_also: #GMemoryOutputStream
5267  *
5268  * #GMemoryInputStream is a class for using arbitrary
5269  * memory chunks as input for GIO streaming input operations.
5270  *
5271  * As of GLib 2.34, #GMemoryInputStream implements
5272  * #GPollableInputStream.
5273  */
5274
5275
5276 /**
5277  * SECTION:gmemoryoutputstream
5278  * @short_description: Streaming output operations on memory chunks
5279  * @include: gio/gio.h
5280  * @see_also: #GMemoryInputStream
5281  *
5282  * #GMemoryOutputStream is a class for using arbitrary
5283  * memory chunks as output for GIO streaming output operations.
5284  *
5285  * As of GLib 2.34, #GMemoryOutputStream implements
5286  * #GPollableOutputStream.
5287  */
5288
5289
5290 /**
5291  * SECTION:gmenu
5292  * @title: GMenu
5293  * @short_description: A simple implementation of GMenuModel
5294  *
5295  * #GMenu is a simple implementation of #GMenuModel.
5296  * You populate a #GMenu by adding #GMenuItem instances to it.
5297  *
5298  * There are some convenience functions to allow you to directly
5299  * add items (avoiding #GMenuItem) for the common cases. To add
5300  * a regular item, use g_menu_insert(). To add a section, use
5301  * g_menu_insert_section(). To add a submenu, use
5302  * g_menu_insert_submenu().
5303  */
5304
5305
5306 /**
5307  * SECTION:gmenuexporter
5308  * @title: GMenuModel exporter
5309  * @short_description: Export GMenuModels on D-Bus
5310  * @see_also: #GMenuModel, #GDBusMenuModel
5311  *
5312  * These functions support exporting a #GMenuModel on D-Bus.
5313  * The D-Bus interface that is used is a private implementation
5314  * detail.
5315  *
5316  * To access an exported #GMenuModel remotely, use
5317  * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5318  */
5319
5320
5321 /**
5322  * SECTION:gmenumodel
5323  * @title: GMenuModel
5324  * @short_description: An abstract class representing the contents of a menu
5325  * @see_also: #GActionGroup
5326  *
5327  * #GMenuModel represents the contents of a menu -- an ordered list of
5328  * menu items. The items are associated with actions, which can be
5329  * activated through them. Items can be grouped in sections, and may
5330  * have submenus associated with them. Both items and sections usually
5331  * have some representation data, such as labels or icons. The type of
5332  * the associated action (ie whether it is stateful, and what kind of
5333  * state it has) can influence the representation of the item.
5334  *
5335  * The conceptual model of menus in #GMenuModel is hierarchical:
5336  * sections and submenus are again represented by #GMenuModels.
5337  * Menus themselves do not define their own roles. Rather, the role
5338  * of a particular #GMenuModel is defined by the item that references
5339  * it (or, in the case of the 'root' menu, is defined by the context
5340  * in which it is used).
5341  *
5342  * As an example, consider the visible portions of the menu in
5343  * <xref linkend="menu-example"/>.
5344  *
5345  * <figure id="menu-example">
5346  *   <title>An example menu</title>
5347  *   <graphic fileref="menu-example.png" format="PNG"></graphic>
5348  * </figure>
5349  *
5350  * There are 8 "menus" visible in the screenshot: one menubar, two
5351  * submenus and 5 sections:
5352  * <itemizedlist>
5353  * <listitem>the toplevel menubar (containing 4 items)</listitem>
5354  * <listitem>the View submenu (containing 3 sections)</listitem>
5355  * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5356  * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5357  * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5358  * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5359  * <listitem>the Sources section (containing 2 items)</listitem>
5360  * <listitem>the Markup section (containing 2 items)</listitem>
5361  * </itemizedlist>
5362  *
5363  * <xref linkend="menu-model"/> illustrates the conceptual connection between
5364  * these 8 menus. Each large block in the figure represents a menu and the
5365  * smaller blocks within the large block represent items in that menu. Some
5366  * items contain references to other menus.
5367  *
5368  * <figure id="menu-model">
5369  *   <title>A menu model</title>
5370  *   <graphic fileref="menu-model.png" format="PNG"></graphic>
5371  * </figure>
5372  *
5373  * Notice that the separators visible in <xref linkend="menu-example"/>
5374  * appear nowhere in <xref linkend="menu-model"/>. This is because
5375  * separators are not explicitly represented in the menu model. Instead,
5376  * a separator is inserted between any two non-empty sections of a menu.
5377  * Section items can have labels just like any other item. In that case,
5378  * a display system may show a section header instead of a separator.
5379  *
5380  * The motivation for this abstract model of application controls is
5381  * that modern user interfaces tend to make these controls available
5382  * outside the application. Examples include global menus, jumplists,
5383  * dash boards, etc. To support such uses, it is necessary to 'export'
5384  * information about actions and their representation in menus, which
5385  * is exactly what the
5386  * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5387  * and the
5388  * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5389  * do for #GActionGroup and #GMenuModel. The client-side counterparts
5390  * to make use of the exported information are #GDBusActionGroup and
5391  * #GDBusMenuModel.
5392  *
5393  * The API of #GMenuModel is very generic, with iterators for the
5394  * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5395  * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5396  * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5397  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5398  * and %G_MENU_LINK_SUBMENU.
5399  *
5400  * Items in a #GMenuModel represent active controls if they refer to
5401  * an action that can get activated when the user interacts with the
5402  * menu item. The reference to the action is encoded by the string id
5403  * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5404  * identifies an action in an action group. Which action group(s) provide
5405  * actions depends on the context in which the menu model is used.
5406  * E.g. when the model is exported as the application menu of a
5407  * #GtkApplication, actions can be application-wide or window-specific
5408  * (and thus come from two different action groups). By convention, the
5409  * application-wide actions have names that start with "app.", while the
5410  * names of window-specific actions start with "win.".
5411  *
5412  * While a wide variety of stateful actions is possible, the following
5413  * is the minimum that is expected to be supported by all users of exported
5414  * menu information:
5415  * <itemizedlist>
5416  * <listitem>an action with no parameter type and no state</listitem>
5417  * <listitem>an action with no parameter type and boolean state</listitem>
5418  * <listitem>an action with string parameter type and string state</listitem>
5419  * </itemizedlist>
5420  *
5421  * <formalpara><title>Stateless</title>
5422  * <para>
5423  * A stateless action typically corresponds to an ordinary menu item.
5424  * </para>
5425  * <para>
5426  * Selecting such a menu item will activate the action (with no parameter).
5427  * </para>
5428  * </formalpara>
5429  *
5430  * <formalpara><title>Boolean State</title>
5431  * <para>
5432  * An action with a boolean state will most typically be used with a "toggle"
5433  * or "switch" menu item. The state can be set directly, but activating the
5434  * action (with no parameter) results in the state being toggled.
5435  * </para>
5436  * <para>
5437  * Selecting a toggle menu item will activate the action. The menu item should
5438  * be rendered as "checked" when the state is true.
5439  * </para>
5440  * </formalpara>
5441  *
5442  * <formalpara><title>String Parameter and State</title>
5443  * <para>
5444  * Actions with string parameters and state will most typically be used to
5445  * represent an enumerated choice over the items available for a group of
5446  * radio menu items. Activating the action with a string parameter is
5447  * equivalent to setting that parameter as the state.
5448  * </para>
5449  * <para>
5450  * Radio menu items, in addition to being associated with the action, will
5451  * have a target value. Selecting that menu item will result in activation
5452  * of the action with the target value as the parameter. The menu item should
5453  * be rendered as "selected" when the state of the action is equal to the
5454  * target value of the menu item.
5455  * </para>
5456  * </formalpara>
5457  */
5458
5459
5460 /**
5461  * SECTION:gmount
5462  * @short_description: Mount management
5463  * @include: gio/gio.h
5464  * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5465  *
5466  * The #GMount interface represents user-visible mounts. Note, when
5467  * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5468  *
5469  * #GMount is a "mounted" filesystem that you can access. Mounted is in
5470  * quotes because it's not the same as a unix mount, it might be a gvfs
5471  * mount, but you can still access the files on it if you use GIO. Might or
5472  * might not be related to a volume object.
5473  *
5474  * Unmounting a #GMount instance is an asynchronous operation. For
5475  * more information about asynchronous operations, see #GAsyncResult
5476  * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5477  * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5478  * #GAsyncReadyCallback.  The callback will be fired when the
5479  * operation has resolved (either with success or failure), and a
5480  * #GAsyncReady structure will be passed to the callback.  That
5481  * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5482  * and the #GAsyncReady data to see if the operation was completed
5483  * successfully.  If an @error is present when g_mount_unmount_with_operation_finish()
5484  * is called, then it will be filled with any error information.
5485  */
5486
5487
5488 /**
5489  * SECTION:gmountoperation
5490  * @short_description: Object used for authentication and user interaction
5491  * @include: gio/gio.h
5492  *
5493  * #GMountOperation provides a mechanism for interacting with the user.
5494  * It can be used for authenticating mountable operations, such as loop
5495  * mounting files, hard drive partitions or server locations. It can
5496  * also be used to ask the user questions or show a list of applications
5497  * preventing unmount or eject operations from completing.
5498  *
5499  * Note that #GMountOperation is used for more than just #GMount
5500  * objects â€“ for example it is also used in g_drive_start() and
5501  * g_drive_stop().
5502  *
5503  * Users should instantiate a subclass of this that implements all the
5504  * various callbacks to show the required dialogs, such as
5505  * #GtkMountOperation. If no user interaction is desired (for example
5506  * when automounting filesystems at login time), usually %NULL can be
5507  * passed, see each method taking a #GMountOperation for details.
5508  */
5509
5510
5511 /**
5512  * SECTION:gnetworkaddress
5513  * @short_description: A GSocketConnectable for resolving hostnames
5514  * @include: gio/gio.h
5515  *
5516  * #GNetworkAddress provides an easy way to resolve a hostname and
5517  * then attempt to connect to that host, handling the possibility of
5518  * multiple IP addresses and multiple address families.
5519  *
5520  * See #GSocketConnectable for and example of using the connectable
5521  * interface.
5522  */
5523
5524
5525 /**
5526  * SECTION:gnetworkmonitor
5527  * @title: GNetworkMonitor
5528  * @short_description: Network status monitor
5529  * @include: gio/gio.h
5530  *
5531  * #GNetworkMonitor provides an easy-to-use cross-platform API
5532  * for monitoring network connectivity. On Linux, the implementation
5533  * is based on the kernels netlink interface.
5534  */
5535
5536
5537 /**
5538  * SECTION:gnetworkservice
5539  * @short_description: A GSocketConnectable for resolving SRV records
5540  * @include: gio/gio.h
5541  *
5542  * Like #GNetworkAddress does with hostnames, #GNetworkService
5543  * provides an easy way to resolve a SRV record, and then attempt to
5544  * connect to one of the hosts that implements that service, handling
5545  * service priority/weighting, multiple IP addresses, and multiple
5546  * address families.
5547  *
5548  * See #GSrvTarget for more information about SRV records, and see
5549  * #GSocketConnectable for and example of using the connectable
5550  * interface.
5551  */
5552
5553
5554 /**
5555  * SECTION:goutputstream
5556  * @short_description: Base class for implementing streaming output
5557  * @include: gio/gio.h
5558  *
5559  * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5560  * to close a stream (g_output_stream_close()) and to flush pending writes
5561  * (g_output_stream_flush()).
5562  *
5563  * To copy the content of an input stream to an output stream without
5564  * manually handling the reads and writes, use g_output_stream_splice().
5565  *
5566  * All of these functions have async variants too.
5567  */
5568
5569
5570 /**
5571  * SECTION:gpermission
5572  * @title: GPermission
5573  * @short_description: An object representing the permission to perform a certain action
5574  *
5575  * A #GPermission represents the status of the caller's permission to
5576  * perform a certain action.
5577  *
5578  * You can query if the action is currently allowed and if it is
5579  * possible to acquire the permission so that the action will be allowed
5580  * in the future.
5581  *
5582  * There is also an API to actually acquire the permission and one to
5583  * release it.
5584  *
5585  * As an example, a #GPermission might represent the ability for the
5586  * user to write to a #GSettings object.  This #GPermission object could
5587  * then be used to decide if it is appropriate to show a "Click here to
5588  * unlock" button in a dialog and to provide the mechanism to invoke
5589  * when that button is clicked.
5590  */
5591
5592
5593 /**
5594  * SECTION:gpollableinputstream
5595  * @short_description: Interface for pollable input streams
5596  * @include: gio/gio.h
5597  * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5598  *
5599  * #GPollableInputStream is implemented by #GInputStream<!-- -->s that
5600  * can be polled for readiness to read. This can be used when
5601  * interfacing with a non-GIO API that expects
5602  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5603  *
5604  * Since: 2.28
5605  */
5606
5607
5608 /**
5609  * SECTION:gpollableoutputstream
5610  * @short_description: Interface for pollable output streams
5611  * @include: gio/gio.h
5612  * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5613  *
5614  * #GPollableOutputStream is implemented by #GOutputStream<!-- -->s that
5615  * can be polled for readiness to write. This can be used when
5616  * interfacing with a non-GIO API that expects
5617  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5618  *
5619  * Since: 2.28
5620  */
5621
5622
5623 /**
5624  * SECTION:gpollableutils
5625  * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5626  * @include: gio/gio.h
5627  *
5628  * Utility functions for #GPollableInputStream and
5629  * #GPollableOutputStream implementations.
5630  */
5631
5632
5633 /**
5634  * SECTION:gproxy
5635  * @short_description: Interface for proxy handling
5636  *
5637  * A #GProxy handles connecting to a remote host via a given type of
5638  * proxy server. It is implemented by the 'gio-proxy' extension point.
5639  * The extensions are named after their proxy protocol name. As an
5640  * example, a SOCKS5 proxy implementation can be retrieved with the
5641  * name 'socks5' using the function
5642  * g_io_extension_point_get_extension_by_name().
5643  *
5644  * Since: 2.26
5645  */
5646
5647
5648 /**
5649  * SECTION:gproxyaddress
5650  * @short_description: An internet address with proxy information
5651  *
5652  * Support for proxied #GInetSocketAddress.
5653  */
5654
5655
5656 /**
5657  * SECTION:gproxyresolver
5658  * @short_description: Asynchronous and cancellable network proxy resolver
5659  * @include: gio/gio.h
5660  *
5661  * #GProxyResolver provides synchronous and asynchronous network proxy
5662  * resolution. #GProxyResolver is used within #GSocketClient through
5663  * the method g_socket_connectable_proxy_enumerate().
5664  */
5665
5666
5667 /**
5668  * SECTION:gremoteactiongroup
5669  * @title: GRemoteActionGroup
5670  * @short_description: a #GActionGroup that interacts with other processes
5671  *
5672  * The GRemoteActionGroup interface is implemented by #GActionGroup
5673  * instances that either transmit action invocations to other processes
5674  * or receive action invocations in the local process from other
5675  * processes.
5676  *
5677  * The interface has <literal>_full</literal> variants of the two
5678  * methods on #GActionGroup used to activate actions:
5679  * g_action_group_activate_action() and
5680  * g_action_group_change_action_state().  These variants allow a
5681  * "platform data" #GVariant to be specified: a dictionary providing
5682  * context for the action invocation (for example: timestamps, startup
5683  * notification IDs, etc).
5684  *
5685  * #GDBusActionGroup implements #GRemoteActionGroup.  This provides a
5686  * mechanism to send platform data for action invocations over D-Bus.
5687  *
5688  * Additionally, g_dbus_connection_export_action_group() will check if
5689  * the exported #GActionGroup implements #GRemoteActionGroup and use the
5690  * <literal>_full</literal> variants of the calls if available.  This
5691  * provides a mechanism by which to receive platform data for action
5692  * invocations that arrive by way of D-Bus.
5693  *
5694  * Since: 2.32
5695  */
5696
5697
5698 /**
5699  * SECTION:gresolver
5700  * @short_description: Asynchronous and cancellable DNS resolver
5701  * @include: gio/gio.h
5702  *
5703  * #GResolver provides cancellable synchronous and asynchronous DNS
5704  * resolution, for hostnames (g_resolver_lookup_by_address(),
5705  * g_resolver_lookup_by_name() and their async variants) and SRV
5706  * (service) records (g_resolver_lookup_service()).
5707  *
5708  * #GNetworkAddress and #GNetworkService provide wrappers around
5709  * #GResolver functionality that also implement #GSocketConnectable,
5710  * making it easy to connect to a remote host/service.
5711  */
5712
5713
5714 /**
5715  * SECTION:gresource
5716  * @short_description: Resource framework
5717  * @include: gio/gio.h
5718  *
5719  * Applications and libraries often contain binary or textual data that is really part of the
5720  * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5721  * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5722  * manually included as literal strings in the code.
5723  *
5724  * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5725  * provide a convenient and efficient alternative to this which has some nice properties. You
5726  * maintain the files as normal files, so its easy to edit them, but during the build the files
5727  * are combined into a binary bundle that is linked into the executable. This means that loading
5728  * the resource files are efficient (as they are already in memory, shared with other instances) and
5729  * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5730  * also makes it easier to create relocatable applications.
5731  *
5732  * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5733  * in a compressed form, but will be automatically uncompressed when the resource is used. This
5734  * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5735  *
5736  * Resource files can also be marked to be preprocessed, by setting the value of the
5737  * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5738  * The only options currently supported are:
5739  *
5740  * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5741  * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5742  * environment variable must be set to the full path to the xmllint executable, or xmllint
5743  * must be in the PATH; otherwise the preprocessing step is skipped.
5744  *
5745  * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5746  * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5747  * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5748  * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5749  * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5750  * abort.
5751  *
5752  * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5753  * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5754  * are combined into a binary resource bundle.
5755  *
5756  * <example id="resource-example"><title>Example resource description</title>
5757  * <programlisting><![CDATA[
5758  * <?xml version="1.0" encoding="UTF-8"?>
5759  * <gresources>
5760  *   <gresource prefix="/org/gtk/Example">
5761  *     <file>data/splashscreen.png</file>
5762  *     <file compressed="true">dialog.ui</file>
5763  *     <file preprocess="xml-stripblanks">menumarkup.xml</file>
5764  *   </gresource>
5765  * </gresources>
5766  * ]]></programlisting></example>
5767  *
5768  * This will create a resource bundle with the following files:
5769  * <programlisting><![CDATA[
5770  * /org/gtk/Example/data/splashscreen.png
5771  * /org/gtk/Example/dialog.ui
5772  * /org/gtk/Example/menumarkup.xml
5773  * ]]></programlisting>
5774  *
5775  * Note that all resources in the process share the same namespace, so use java-style
5776  * path prefixes (like in the above example) to avoid conflicts.
5777  *
5778  * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5779  * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5780  * --generate-header arguments to create a source file and header to link directly into your application.
5781  *
5782  * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5783  * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5784  * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5785  * the resource data.
5786  *
5787  * There are two forms of the generated source, the default version uses the compiler support for constructor
5788  * and destructor functions (where available) to automatically create and register the #GResource on startup
5789  * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5790  * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5791  * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5792  *
5793  * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5794  * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5795  * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5796  * is for your own resources, and resource data is often used once, during parsing, and then released.
5797  *
5798  * Since: 2.32
5799  */
5800
5801
5802 /**
5803  * SECTION:gseekable
5804  * @short_description: Stream seeking interface
5805  * @include: gio/gio.h
5806  * @see_also: #GInputStream, #GOutputStream
5807  *
5808  * #GSeekable is implemented by streams (implementations of
5809  * #GInputStream or #GOutputStream) that support seeking.
5810  */
5811
5812
5813 /**
5814  * SECTION:gsettings
5815  * @short_description: High-level API for application settings
5816  *
5817  * The #GSettings class provides a convenient API for storing and retrieving
5818  * application settings.
5819  *
5820  * Reads and writes can be considered to be non-blocking.  Reading
5821  * settings with #GSettings is typically extremely fast: on
5822  * approximately the same order of magnitude (but slower than) a
5823  * #GHashTable lookup.  Writing settings is also extremely fast in terms
5824  * of time to return to your application, but can be extremely expensive
5825  * for other threads and other processes.  Many settings backends
5826  * (including dconf) have lazy initialisation which means in the common
5827  * case of the user using their computer without modifying any settings
5828  * a lot of work can be avoided.  For dconf, the D-Bus service doesn't
5829  * even need to be started in this case.  For this reason, you should
5830  * only ever modify #GSettings keys in response to explicit user action.
5831  * Particular care should be paid to ensure that modifications are not
5832  * made during startup -- for example, when setting the initial value
5833  * of preferences widgets.  The built-in g_settings_bind() functionality
5834  * is careful not to write settings in response to notify signals as a
5835  * result of modifications that it makes to widgets.
5836  *
5837  * When creating a GSettings instance, you have to specify a schema
5838  * that describes the keys in your settings and their types and default
5839  * values, as well as some other information.
5840  *
5841  * Normally, a schema has as fixed path that determines where the settings
5842  * are stored in the conceptual global tree of settings. However, schemas
5843  * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5844  * useful e.g. when the schema describes an 'account', and you want to be
5845  * able to store a arbitrary number of accounts.
5846  *
5847  * Paths must start with and end with a forward slash character ('/')
5848  * and must not contain two sequential slash characters.  Paths should
5849  * be chosen based on a domain name associated with the program or
5850  * library to which the settings belong.  Examples of paths are
5851  * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5852  * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5853  * they often did in GConf.
5854  *
5855  * Unlike other configuration systems (like GConf), GSettings does not
5856  * restrict keys to basic types like strings and numbers. GSettings stores
5857  * values as #GVariant, and allows any #GVariantType for keys. Key names
5858  * are restricted to lowercase characters, numbers and '-'. Furthermore,
5859  * the names must begin with a lowercase character, must not end
5860  * with a '-', and must not contain consecutive dashes.
5861  *
5862  * Similar to GConf, the default values in GSettings schemas can be
5863  * localized, but the localized values are stored in gettext catalogs
5864  * and looked up with the domain that is specified in the
5865  * <tag class="attribute">gettext-domain</tag> attribute of the
5866  * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5867  * elements and the category that is specified in the l10n attribute of the
5868  * <tag class="starttag">key</tag> element.
5869  *
5870  * GSettings uses schemas in a compact binary form that is created
5871  * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5872  * utility. The input is a schema description in an XML format that can be
5873  * described by the following DTD:
5874  * |[<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>]|
5875  *
5876  * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5877  *
5878  * At runtime, schemas are identified by their id (as specified
5879  * in the <tag class="attribute">id</tag> attribute of the
5880  * <tag class="starttag">schema</tag> element). The
5881  * convention for schema ids is to use a dotted name, similar in
5882  * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5883  * if the settings are for a specific service that owns a D-Bus bus name,
5884  * the D-Bus bus name and schema id should match. For schemas which deal
5885  * with settings not associated with one named application, the id should
5886  * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5887  *
5888  * In addition to #GVariant types, keys can have types that have enumerated
5889  * types. These can be described by a <tag class="starttag">choice</tag>,
5890  * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5891  * <xref linkend="schema-enumerated"/>. The underlying type of
5892  * such a key is string, but you can use g_settings_get_enum(),
5893  * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5894  * access the numeric values corresponding to the string value of enum
5895  * and flags keys.
5896  *
5897  * <example id="schema-default-values"><title>Default values</title>
5898  * <programlisting><![CDATA[
5899  * <schemalist>
5900  *   <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5901  *
5902  *     <key name="greeting" type="s">
5903  *       <default l10n="messages">"Hello, earthlings"</default>
5904  *       <summary>A greeting</summary>
5905  *       <description>
5906  *         Greeting of the invading martians
5907  *       </description>
5908  *     </key>
5909  *
5910  *     <key name="box" type="(ii)">
5911  *       <default>(20,30)</default>
5912  *     </key>
5913  *
5914  *   </schema>
5915  * </schemalist>
5916  * ]]></programlisting></example>
5917  *
5918  * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
5919  * <programlisting><![CDATA[
5920  * <schemalist>
5921  *
5922  *   <enum id="org.gtk.Test.myenum">
5923  *     <value nick="first" value="1"/>
5924  *     <value nick="second" value="2"/>
5925  *   </enum>
5926  *
5927  *   <flags id="org.gtk.Test.myflags">
5928  *     <value nick="flag1" value="1"/>
5929  *     <value nick="flag2" value="2"/>
5930  *     <value nick="flag3" value="4"/>
5931  *   </flags>
5932  *
5933  *   <schema id="org.gtk.Test">
5934  *
5935  *     <key name="key-with-range" type="i">
5936  *       <range min="1" max="100"/>
5937  *       <default>10</default>
5938  *     </key>
5939  *
5940  *     <key name="key-with-choices" type="s">
5941  *       <choices>
5942  *         <choice value='Elisabeth'/>
5943  *         <choice value='Annabeth'/>
5944  *         <choice value='Joe'/>
5945  *       </choices>
5946  *       <aliases>
5947  *         <alias value='Anna' target='Annabeth'/>
5948  *         <alias value='Beth' target='Elisabeth'/>
5949  *       </aliases>
5950  *       <default>'Joe'</default>
5951  *     </key>
5952  *
5953  *     <key name='enumerated-key' enum='org.gtk.Test.myenum'>
5954  *       <default>'first'</default>
5955  *     </key>
5956  *
5957  *     <key name='flags-key' flags='org.gtk.Test.myflags'>
5958  *       <default>["flag1",flag2"]</default>
5959  *     </key>
5960  *   </schema>
5961  * </schemalist>
5962  * ]]></programlisting></example>
5963  *
5964  * <refsect2>
5965  *   <title>Vendor overrides</title>
5966  *   <para>
5967  *     Default values are defined in the schemas that get installed by
5968  *     an application. Sometimes, it is necessary for a vendor or distributor
5969  *     to adjust these defaults. Since patching the XML source for the schema
5970  *     is inconvenient and error-prone,
5971  *     <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
5972  *     so-called 'vendor override' files. These are keyfiles in the same
5973  *     directory as the XML schema sources which can override default values.
5974  *     The schema id serves as the group name in the key file, and the values
5975  *     are expected in serialized GVariant form, as in the following example:
5976  *     <informalexample><programlisting>
5977  *     [org.gtk.Example]
5978  *     key1='string'
5979  *     key2=1.5
5980  *     </programlisting></informalexample>
5981  *   </para>
5982  *   <para>
5983  *     glib-compile-schemas expects schema files to have the extension
5984  *     <filename>.gschema.override</filename>
5985  *   </para>
5986  * </refsect2>
5987  *
5988  * <refsect2>
5989  *   <title>Binding</title>
5990  *   <para>
5991  *     A very convenient feature of GSettings lets you bind #GObject properties
5992  *     directly to settings, using g_settings_bind(). Once a GObject property
5993  *     has been bound to a setting, changes on either side are automatically
5994  *     propagated to the other side. GSettings handles details like
5995  *     mapping between GObject and GVariant types, and preventing infinite
5996  *     cycles.
5997  *   </para>
5998  *   <para>
5999  *     This makes it very easy to hook up a preferences dialog to the
6000  *     underlying settings. To make this even more convenient, GSettings
6001  *     looks for a boolean property with the name "sensitivity" and
6002  *     automatically binds it to the writability of the bound setting.
6003  *     If this 'magic' gets in the way, it can be suppressed with the
6004  *     #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6005  *   </para>
6006  * </refsect2>
6007  */
6008
6009
6010 /**
6011  * SECTION:gsettingsbackend
6012  * @title: GSettingsBackend
6013  * @short_description: Interface for settings backend implementations
6014  * @include: gio/gsettingsbackend.h
6015  * @see_also: #GSettings, #GIOExtensionPoint
6016  *
6017  * The #GSettingsBackend interface defines a generic interface for
6018  * non-strictly-typed data that is stored in a hierarchy. To implement
6019  * an alternative storage backend for #GSettings, you need to implement
6020  * the #GSettingsBackend interface and then make it implement the
6021  * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6022  *
6023  * The interface defines methods for reading and writing values, a
6024  * method for determining if writing of certain values will fail
6025  * (lockdown) and a change notification mechanism.
6026  *
6027  * The semantics of the interface are very precisely defined and
6028  * implementations must carefully adhere to the expectations of
6029  * callers that are documented on each of the interface methods.
6030  *
6031  * Some of the GSettingsBackend functions accept or return a #GTree.
6032  * These trees always have strings as keys and #GVariant as values.
6033  * g_settings_backend_create_tree() is a convenience function to create
6034  * suitable trees.
6035  *
6036  * <note><para>
6037  * The #GSettingsBackend API is exported to allow third-party
6038  * implementations, but does not carry the same stability guarantees
6039  * as the public GIO API. For this reason, you have to define the
6040  * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6041  * <filename>gio/gsettingsbackend.h</filename>
6042  * </para></note>
6043  */
6044
6045
6046 /**
6047  * SECTION:gsettingsschema
6048  * @short_description: introspecting and controlling the loading of #GSettings schemas
6049  *
6050  * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6051  * mechanism for advanced control over the loading of schemas and a
6052  * mechanism for introspecting their content.
6053  *
6054  * Plugin loading systems that wish to provide plugins a way to access
6055  * settings face the problem of how to make the schemas for these
6056  * settings visible to GSettings.  Typically, a plugin will want to ship
6057  * the schema along with itself and it won't be installed into the
6058  * standard system directories for schemas.
6059  *
6060  * #GSettingsSchemaSource provides a mechanism for dealing with this by
6061  * allowing the creation of a new 'schema source' from which schemas can
6062  * be acquired.  This schema source can then become part of the metadata
6063  * associated with the plugin and queried whenever the plugin requires
6064  * access to some settings.
6065  *
6066  * Consider the following example:
6067  *
6068  * |[
6069  * typedef struct
6070  * {
6071  *    ...
6072  *    GSettingsSchemaSource *schema_source;
6073  *    ...
6074  * } Plugin;
6075  *
6076  * Plugin *
6077  * initialise_plugin (const gchar *dir)
6078  * {
6079  *   Plugin *plugin;
6080  *
6081  *   ...
6082  *
6083  *   plugin->schema_source =
6084  *     g_settings_new_schema_source_from_directory (dir,
6085  *       g_settings_schema_source_get_default (), FALSE, NULL);
6086  *
6087  *   ...
6088  *
6089  *   return plugin;
6090  * }
6091  *
6092  * ...
6093  *
6094  * GSettings *
6095  * plugin_get_settings (Plugin      *plugin,
6096  *                      const gchar *schema_id)
6097  * {
6098  *   GSettingsSchema *schema;
6099  *
6100  *   if (schema_id == NULL)
6101  *     schema_id = plugin->identifier;
6102  *
6103  *   schema = g_settings_schema_source_lookup (plugin->schema_source,
6104  *                                             schema_id, FALSE);
6105  *
6106  *   if (schema == NULL)
6107  *     {
6108  *       ... disable the plugin or abort, etc ...
6109  *     }
6110  *
6111  *   return g_settings_new_full (schema, NULL, NULL);
6112  * }
6113  * ]|
6114  *
6115  * The code above shows how hooks should be added to the code that
6116  * initialises (or enables) the plugin to create the schema source and
6117  * how an API can be added to the plugin system to provide a convenient
6118  * way for the plugin to access its settings, using the schemas that it
6119  * ships.
6120  *
6121  * From the standpoint of the plugin, it would need to ensure that it
6122  * ships a gschemas.compiled file as part of itself, and then simply do
6123  * the following:
6124  *
6125  * |[
6126  * {
6127  *   GSettings *settings;
6128  *   gint some_value;
6129  *
6130  *   settings = plugin_get_settings (self, NULL);
6131  *   some_value = g_settings_get_int (settings, "some-value");
6132  *   ...
6133  * }
6134  * ]|
6135  *
6136  * It's also possible that the plugin system expects the schema source
6137  * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6138  * In that case, the plugin loading system must compile the schemas for
6139  * itself before attempting to create the settings source.
6140  *
6141  * Since: 2.32
6142  */
6143
6144
6145 /**
6146  * SECTION:gsimpleaction
6147  * @title: GSimpleAction
6148  * @short_description: A simple GAction implementation
6149  *
6150  * A #GSimpleAction is the obvious simple implementation of the #GAction
6151  * interface. This is the easiest way to create an action for purposes of
6152  * adding it to a #GSimpleActionGroup.
6153  *
6154  * See also #GtkAction.
6155  */
6156
6157
6158 /**
6159  * SECTION:gsimpleactiongroup
6160  * @title: GSimpleActionGroup
6161  * @short_description: A simple GActionGroup implementation
6162  *
6163  * #GSimpleActionGroup is a hash table filled with #GAction objects,
6164  * implementing the #GActionGroup and #GActionMap interfaces.
6165  */
6166
6167
6168 /**
6169  * SECTION:gsimpleasyncresult
6170  * @short_description: Simple asynchronous results implementation
6171  * @include: gio/gio.h
6172  * @see_also: #GAsyncResult
6173  *
6174  * Implements #GAsyncResult for simple cases. Most of the time, this
6175  * will be all an application needs, and will be used transparently.
6176  * Because of this, #GSimpleAsyncResult is used throughout GIO for
6177  * handling asynchronous functions.
6178  *
6179  * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6180  * reporting, operation cancellation and the final state of an operation,
6181  * completely transparent to the application. Results can be returned
6182  * as a pointer e.g. for functions that return data that is collected
6183  * asynchronously, a boolean value for checking the success or failure
6184  * of an operation, or a #gssize for operations which return the number
6185  * of bytes modified by the operation; all of the simple return cases
6186  * are covered.
6187  *
6188  * Most of the time, an application will not need to know of the details
6189  * of this API; it is handled transparently, and any necessary operations
6190  * are handled by #GAsyncResult's interface. However, if implementing a
6191  * new GIO module, for writing language bindings, or for complex
6192  * applications that need better control of how asynchronous operations
6193  * are completed, it is important to understand this functionality.
6194  *
6195  * GSimpleAsyncResults are tagged with the calling function to ensure
6196  * that asynchronous functions and their finishing functions are used
6197  * together correctly.
6198  *
6199  * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6200  * If the result needs to be created for a #GError, use
6201  * g_simple_async_result_new_from_error() or
6202  * g_simple_async_result_new_take_error(). If a #GError is not available
6203  * (e.g. the asynchronous operation's doesn't take a #GError argument),
6204  * but the result still needs to be created for an error condition, use
6205  * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6206  * if your application or binding requires passing a variable argument list
6207  * directly), and the error can then be propagated through the use of
6208  * g_simple_async_result_propagate_error().
6209  *
6210  * An asynchronous operation can be made to ignore a cancellation event by
6211  * calling g_simple_async_result_set_handle_cancellation() with a
6212  * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6213  * operations that are dangerous to cancel, such as close (which would
6214  * cause a leak if cancelled before being run).
6215  *
6216  * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6217  * or it can use #GThread<!-- -->s.
6218  * g_simple_async_result_complete() will finish an I/O task directly
6219  * from the point where it is called. g_simple_async_result_complete_in_idle()
6220  * will finish it from an idle handler in the <link
6221  * linkend="g-main-context-push-thread-default">thread-default main
6222  * context</link>. g_simple_async_result_run_in_thread() will run the
6223  * job in a separate thread and then deliver the result to the
6224  * thread-default main context.
6225  *
6226  * To set the results of an asynchronous function,
6227  * g_simple_async_result_set_op_res_gpointer(),
6228  * g_simple_async_result_set_op_res_gboolean(), and
6229  * g_simple_async_result_set_op_res_gssize()
6230  * are provided, setting the operation's result to a gpointer, gboolean, or
6231  * gssize, respectively.
6232  *
6233  * Likewise, to get the result of an asynchronous function,
6234  * g_simple_async_result_get_op_res_gpointer(),
6235  * g_simple_async_result_get_op_res_gboolean(), and
6236  * g_simple_async_result_get_op_res_gssize() are
6237  * provided, getting the operation's result as a gpointer, gboolean, and
6238  * gssize, respectively.
6239  *
6240  * For the details of the requirements implementations must respect, see
6241  * #GAsyncResult.  A typical implementation of an asynchronous operation
6242  * using GSimpleAsyncResult looks something like this:
6243  *
6244  * |[
6245  * static void
6246  * baked_cb (Cake    *cake,
6247  *           gpointer user_data)
6248  * {
6249  *   /&ast; In this example, this callback is not given a reference to the cake, so
6250  *    &ast; the GSimpleAsyncResult has to take a reference to it.
6251  *    &ast;/
6252  *   GSimpleAsyncResult *result = user_data;
6253  *
6254  *   if (cake == NULL)
6255  *     g_simple_async_result_set_error (result,
6256  *                                      BAKER_ERRORS,
6257  *                                      BAKER_ERROR_NO_FLOUR,
6258  *                                      "Go to the supermarket");
6259  *   else
6260  *     g_simple_async_result_set_op_res_gpointer (result,
6261  *                                                g_object_ref (cake),
6262  *                                                g_object_unref);
6263  *
6264  *
6265  *   /&ast; In this example, we assume that baked_cb is called as a callback from
6266  *    &ast; the mainloop, so it's safe to complete the operation synchronously here.
6267  *    &ast; If, however, _baker_prepare_cake () might call its callback without
6268  *    &ast; first returning to the mainloop â€” inadvisable, but some APIs do so â€”
6269  *    &ast; we would need to use g_simple_async_result_complete_in_idle().
6270  *    &ast;/
6271  *   g_simple_async_result_complete (result);
6272  *   g_object_unref (result);
6273  * }
6274  *
6275  * void
6276  * baker_bake_cake_async (Baker              *self,
6277  *                        guint               radius,
6278  *                        GAsyncReadyCallback callback,
6279  *                        gpointer            user_data)
6280  * {
6281  *   GSimpleAsyncResult *simple;
6282  *   Cake               *cake;
6283  *
6284  *   if (radius < 3)
6285  *     {
6286  *       g_simple_async_report_error_in_idle (G_OBJECT (self),
6287  *                                            callback,
6288  *                                            user_data,
6289  *                                            BAKER_ERRORS,
6290  *                                            BAKER_ERROR_TOO_SMALL,
6291  *                                            "%ucm radius cakes are silly",
6292  *                                            radius);
6293  *       return;
6294  *     }
6295  *
6296  *   simple = g_simple_async_result_new (G_OBJECT (self),
6297  *                                       callback,
6298  *                                       user_data,
6299  *                                       baker_bake_cake_async);
6300  *   cake = _baker_get_cached_cake (self, radius);
6301  *
6302  *   if (cake != NULL)
6303  *     {
6304  *       g_simple_async_result_set_op_res_gpointer (simple,
6305  *                                                  g_object_ref (cake),
6306  *                                                  g_object_unref);
6307  *       g_simple_async_result_complete_in_idle (simple);
6308  *       g_object_unref (simple);
6309  *       /&ast; Drop the reference returned by _baker_get_cached_cake(); the
6310  *        &ast; GSimpleAsyncResult has taken its own reference.
6311  *        &ast;/
6312  *       g_object_unref (cake);
6313  *       return;
6314  *     }
6315  *
6316  *   _baker_prepare_cake (self, radius, baked_cb, simple);
6317  * }
6318  *
6319  * Cake *
6320  * baker_bake_cake_finish (Baker        *self,
6321  *                         GAsyncResult *result,
6322  *                         GError      **error)
6323  * {
6324  *   GSimpleAsyncResult *simple;
6325  *   Cake               *cake;
6326  *
6327  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
6328  *                                                         G_OBJECT (self),
6329  *                                                         baker_bake_cake_async),
6330  *                         NULL);
6331  *
6332  *   simple = (GSimpleAsyncResult *) result;
6333  *
6334  *   if (g_simple_async_result_propagate_error (simple, error))
6335  *     return NULL;
6336  *
6337  *   cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6338  *   return g_object_ref (cake);
6339  * }
6340  * ]|
6341  */
6342
6343
6344 /**
6345  * SECTION:gsimplepermission
6346  * @title: GSimplePermission
6347  * @short_description: A GPermission that doesn't change value
6348  *
6349  * #GSimplePermission is a trivial implementation of #GPermission that
6350  * represents a permission that is either always or never allowed.  The
6351  * value is given at construction and doesn't change.
6352  *
6353  * Calling request or release will result in errors.
6354  */
6355
6356
6357 /**
6358  * SECTION:gsocket
6359  * @short_description: Low-level socket object
6360  * @include: gio/gio.h
6361  * @see_also: #GInitable
6362  *
6363  * A #GSocket is a low-level networking primitive. It is a more or less
6364  * direct mapping of the BSD socket API in a portable GObject based API.
6365  * It supports both the UNIX socket implementations and winsock2 on Windows.
6366  *
6367  * #GSocket is the platform independent base upon which the higher level
6368  * network primitives are based. Applications are not typically meant to
6369  * use it directly, but rather through classes like #GSocketClient,
6370  * #GSocketService and #GSocketConnection. However there may be cases where
6371  * direct use of #GSocket is useful.
6372  *
6373  * #GSocket implements the #GInitable interface, so if it is manually constructed
6374  * by e.g. g_object_new() you must call g_initable_init() and check the
6375  * results before using the object. This is done automatically in
6376  * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6377  * %NULL.
6378  *
6379  * Sockets operate in two general modes, blocking or non-blocking. When
6380  * in blocking mode all operations block until the requested operation
6381  * is finished or there is an error. In non-blocking mode all calls that
6382  * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6383  * To know when a call would successfully run you can call g_socket_condition_check(),
6384  * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6385  * attach it to a #GMainContext to get callbacks when I/O is possible.
6386  * Note that all sockets are always set to non blocking mode in the system, and
6387  * blocking mode is emulated in GSocket.
6388  *
6389  * When working in non-blocking mode applications should always be able to
6390  * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6391  * function said that I/O was possible. This can easily happen in case
6392  * of a race condition in the application, but it can also happen for other
6393  * reasons. For instance, on Windows a socket is always seen as writable
6394  * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6395  *
6396  * #GSocket<!-- -->s can be either connection oriented or datagram based.
6397  * For connection oriented types you must first establish a connection by
6398  * either connecting to an address or accepting a connection from another
6399  * address. For connectionless socket types the target/source address is
6400  * specified or received in each I/O operation.
6401  *
6402  * All socket file descriptors are set to be close-on-exec.
6403  *
6404  * Note that creating a #GSocket causes the signal %SIGPIPE to be
6405  * ignored for the remainder of the program. If you are writing a
6406  * command-line utility that uses #GSocket, you may need to take into
6407  * account the fact that your program will not automatically be killed
6408  * if it tries to write to %stdout after it has been closed.
6409  *
6410  * Since: 2.22
6411  */
6412
6413
6414 /**
6415  * SECTION:gsocketaddress
6416  * @short_description: Abstract base class representing endpoints for socket communication
6417  *
6418  * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6419  * in the BSD sockets API. This is an abstract class; use
6420  * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6421  * for UNIX domain sockets.
6422  */
6423
6424
6425 /**
6426  * SECTION:gsocketclient
6427  * @short_description: Helper for connecting to a network service
6428  * @include: gio/gio.h
6429  * @see_also: #GSocketConnection, #GSocketListener
6430  *
6431  * #GSocketClient is a lightweight high-level utility class for connecting to
6432  * a network host using a connection oriented socket type.
6433  *
6434  * You create a #GSocketClient object, set any options you want, and then
6435  * call a sync or async connect operation, which returns a #GSocketConnection
6436  * subclass on success.
6437  *
6438  * The type of the #GSocketConnection object returned depends on the type of
6439  * the underlying socket that is in use. For instance, for a TCP/IP connection
6440  * it will be a #GTcpConnection.
6441  *
6442  * As #GSocketClient is a lightweight object, you don't need to cache it. You
6443  * can just create a new one any time you need one.
6444  *
6445  * Since: 2.22
6446  */
6447
6448
6449 /**
6450  * SECTION:gsocketconnectable
6451  * @short_description: Interface for potential socket endpoints
6452  *
6453  * Objects that describe one or more potential socket endpoints
6454  * implement #GSocketConnectable. Callers can then use
6455  * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6456  * to try out each socket address in turn until one succeeds, as shown
6457  * in the sample code below.
6458  *
6459  * |[
6460  * MyConnectionType *
6461  * connect_to_host (const char    *hostname,
6462  *                  guint16        port,
6463  *                  GCancellable  *cancellable,
6464  *                  GError       **error)
6465  * {
6466  *   MyConnection *conn = NULL;
6467  *   GSocketConnectable *addr;
6468  *   GSocketAddressEnumerator *enumerator;
6469  *   GSocketAddress *sockaddr;
6470  *   GError *conn_error = NULL;
6471  *
6472  *   addr = g_network_address_new ("www.gnome.org", 80);
6473  *   enumerator = g_socket_connectable_enumerate (addr);
6474  *   g_object_unref (addr);
6475  *
6476  *   /<!-- -->* Try each sockaddr until we succeed. Record the first
6477  *    * connection error, but not any further ones (since they'll probably
6478  *    * be basically the same as the first).
6479  *    *<!-- -->/
6480  *   while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6481  *     {
6482  *       conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6483  *       g_object_unref (sockaddr);
6484  *     }
6485  *   g_object_unref (enumerator);
6486  *
6487  *   if (conn)
6488  *     {
6489  *       if (conn_error)
6490  *         {
6491  *           /<!-- -->* We couldn't connect to the first address, but we succeeded
6492  *            * in connecting to a later address.
6493  *            *<!-- -->/
6494  *           g_error_free (conn_error);
6495  *         }
6496  *       return conn;
6497  *     }
6498  *   else if (error)
6499  *     {
6500  *       /<!-- -->* Either the initial lookup failed, or else the caller
6501  *        * cancelled us.
6502  *        *<!-- -->/
6503  *       if (conn_error)
6504  *         g_error_free (conn_error);
6505  *       return NULL;
6506  *     }
6507  *   else
6508  *     {
6509  *       g_error_propagate (error, conn_error);
6510  *       return NULL;
6511  *     }
6512  * }
6513  * ]|
6514  */
6515
6516
6517 /**
6518  * SECTION:gsocketconnection
6519  * @short_description: A socket connection
6520  * @include: gio/gio.h
6521  * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6522  *
6523  * #GSocketConnection is a #GIOStream for a connected socket. They
6524  * can be created either by #GSocketClient when connecting to a host,
6525  * or by #GSocketListener when accepting a new client.
6526  *
6527  * The type of the #GSocketConnection object returned from these calls
6528  * depends on the type of the underlying socket that is in use. For
6529  * instance, for a TCP/IP connection it will be a #GTcpConnection.
6530  *
6531  * Choosing what type of object to construct is done with the socket
6532  * connection factory, and it is possible for 3rd parties to register
6533  * custom socket connection types for specific combination of socket
6534  * family/type/protocol using g_socket_connection_factory_register_type().
6535  *
6536  * Since: 2.22
6537  */
6538
6539
6540 /**
6541  * SECTION:gsocketcontrolmessage
6542  * @title: GSocketControlMessage
6543  * @short_description: A GSocket control message
6544  * @see_also: #GSocket.
6545  *
6546  * A #GSocketControlMessage is a special-purpose utility message that
6547  * can be sent to or received from a #GSocket. These types of
6548  * messages are often called "ancillary data".
6549  *
6550  * The message can represent some sort of special instruction to or
6551  * information from the socket or can represent a special kind of
6552  * transfer to the peer (for example, sending a file description over
6553  * a UNIX socket).
6554  *
6555  * These messages are sent with g_socket_send_message() and received
6556  * with g_socket_receive_message().
6557  *
6558  * To extend the set of control message that can be sent, subclass this
6559  * class and override the get_size, get_level, get_type and serialize
6560  * methods.
6561  *
6562  * To extend the set of control messages that can be received, subclass
6563  * this class and implement the deserialize method. Also, make sure your
6564  * class is registered with the GType typesystem before calling
6565  * g_socket_receive_message() to read such a message.
6566  *
6567  * Since: 2.22
6568  */
6569
6570
6571 /**
6572  * SECTION:gsocketlistener
6573  * @title: GSocketListener
6574  * @short_description: Helper for accepting network client connections
6575  * @see_also: #GThreadedSocketService, #GSocketService.
6576  *
6577  * A #GSocketListener is an object that keeps track of a set
6578  * of server sockets and helps you accept sockets from any of the
6579  * socket, either sync or async.
6580  *
6581  * If you want to implement a network server, also look at #GSocketService
6582  * and #GThreadedSocketService which are subclass of #GSocketListener
6583  * that makes this even easier.
6584  *
6585  * Since: 2.22
6586  */
6587
6588
6589 /**
6590  * SECTION:gsocketservice
6591  * @title: GSocketService
6592  * @short_description: Make it easy to implement a network service
6593  * @see_also: #GThreadedSocketService, #GSocketListener.
6594  *
6595  * A #GSocketService is an object that represents a service that
6596  * is provided to the network or over local sockets.  When a new
6597  * connection is made to the service the #GSocketService::incoming
6598  * signal is emitted.
6599  *
6600  * A #GSocketService is a subclass of #GSocketListener and you need
6601  * to add the addresses you want to accept connections on with the
6602  * #GSocketListener APIs.
6603  *
6604  * There are two options for implementing a network service based on
6605  * #GSocketService. The first is to create the service using
6606  * g_socket_service_new() and to connect to the #GSocketService::incoming
6607  * signal. The second is to subclass #GSocketService and override the
6608  * default signal handler implementation.
6609  *
6610  * In either case, the handler must immediately return, or else it
6611  * will block additional incoming connections from being serviced.
6612  * If you are interested in writing connection handlers that contain
6613  * blocking code then see #GThreadedSocketService.
6614  *
6615  * The socket service runs on the main loop of the <link
6616  * linkend="g-main-context-push-thread-default-context">thread-default
6617  * context</link> of the thread it is created in, and is not
6618  * threadsafe in general. However, the calls to start and stop the
6619  * service are thread-safe so these can be used from threads that
6620  * handle incoming clients.
6621  *
6622  * Since: 2.22
6623  */
6624
6625
6626 /**
6627  * SECTION:gsrvtarget
6628  * @short_description: DNS SRV record target
6629  * @include: gio/gio.h
6630  *
6631  * SRV (service) records are used by some network protocols to provide
6632  * service-specific aliasing and load-balancing. For example, XMPP
6633  * (Jabber) uses SRV records to locate the XMPP server for a domain;
6634  * rather than connecting directly to "example.com" or assuming a
6635  * specific server hostname like "xmpp.example.com", an XMPP client
6636  * would look up the "xmpp-client" SRV record for "example.com", and
6637  * then connect to whatever host was pointed to by that record.
6638  *
6639  * You can use g_resolver_lookup_service() or
6640  * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6641  * for a given service. However, if you are simply planning to connect
6642  * to the remote service, you can use #GNetworkService's
6643  * #GSocketConnectable interface and not need to worry about
6644  * #GSrvTarget at all.
6645  */
6646
6647
6648 /**
6649  * SECTION:gtcpconnection
6650  * @title: GTcpConnection
6651  * @short_description: A TCP GSocketConnection
6652  * @see_also: #GSocketConnection.
6653  *
6654  * This is the subclass of #GSocketConnection that is created
6655  * for TCP/IP sockets.
6656  *
6657  * Since: 2.22
6658  */
6659
6660
6661 /**
6662  * SECTION:gtcpwrapperconnection
6663  * @title: GTcpWrapperConnection
6664  * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
6665  * @see_also: #GSocketConnection.
6666  *
6667  * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
6668  * based on a #GSocket, but which is not actually a
6669  * #GSocketConnection. This is used by #GSocketClient so that it can
6670  * always return a #GSocketConnection, even when the connection it has
6671  * actually created is not directly a #GSocketConnection.
6672  *
6673  * Since: 2.28
6674  */
6675
6676
6677 /**
6678  * SECTION:gtestdbus
6679  * @short_description: D-Bus testing helper
6680  * @include: gio/gio.h
6681  *
6682  * Helper to test D-Bus code wihtout messing up with user' session bus.
6683  */
6684
6685
6686 /**
6687  * SECTION:gthemedicon
6688  * @short_description: Icon theming support
6689  * @include: gio/gio.h
6690  * @see_also: #GIcon, #GLoadableIcon
6691  *
6692  * #GThemedIcon is an implementation of #GIcon that supports icon themes.
6693  * #GThemedIcon contains a list of all of the icons present in an icon
6694  * theme, so that icons can be looked up quickly. #GThemedIcon does
6695  * not provide actual pixmaps for icons, just the icon names.
6696  * Ideally something like gtk_icon_theme_choose_icon() should be used to
6697  * resolve the list of names so that fallback icons work nicely with
6698  * themes that inherit other themes.
6699  */
6700
6701
6702 /**
6703  * SECTION:gthreadedsocketservice
6704  * @title: GThreadedSocketService
6705  * @short_description: A threaded GSocketService
6706  * @see_also: #GSocketService.
6707  *
6708  * A #GThreadedSocketService is a simple subclass of #GSocketService
6709  * that handles incoming connections by creating a worker thread and
6710  * dispatching the connection to it by emitting the
6711  * #GThreadedSocketService::run signal in the new thread.
6712  *
6713  * The signal handler may perform blocking IO and need not return
6714  * until the connection is closed.
6715  *
6716  * The service is implemented using a thread pool, so there is a
6717  * limited amount of threads available to serve incoming requests.
6718  * The service automatically stops the #GSocketService from accepting
6719  * new connections when all threads are busy.
6720  *
6721  * As with #GSocketService, you may connect to #GThreadedSocketService::run,
6722  * or subclass and override the default handler.
6723  */
6724
6725
6726 /**
6727  * SECTION:gtls
6728  * @title: TLS Overview
6729  * @short_description: TLS (aka SSL) support for GSocketConnection
6730  * @include: gio/gio.h
6731  *
6732  * #GTlsConnection and related classes provide TLS (Transport Layer
6733  * Security, previously known as SSL, Secure Sockets Layer) support for
6734  * gio-based network streams.
6735  *
6736  * In the simplest case, for a client connection, you can just set the
6737  * #GSocketClient:tls flag on a #GSocketClient, and then any
6738  * connections created by that client will have TLS negotiated
6739  * automatically, using appropriate default settings, and rejecting
6740  * any invalid or self-signed certificates (unless you change that
6741  * default by setting the #GSocketClient:tls-validation-flags
6742  * property). The returned object will be a #GTcpWrapperConnection,
6743  * which wraps the underlying #GTlsClientConnection.
6744  *
6745  * For greater control, you can create your own #GTlsClientConnection,
6746  * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
6747  * pollable input and output streams) and then connect to its signals,
6748  * such as #GTlsConnection::accept-certificate, before starting the
6749  * handshake.
6750  *
6751  * Server-side TLS is similar, using #GTlsServerConnection. At the
6752  * moment, there is no support for automatically wrapping server-side
6753  * connections in the way #GSocketClient does for client-side
6754  * connections.
6755  */
6756
6757
6758 /**
6759  * SECTION:gtlsbackend
6760  * @title: GTlsBackend
6761  * @short_description: TLS backend implementation
6762  * @include: gio/gio.h
6763  *
6764  *
6765  */
6766
6767
6768 /**
6769  * SECTION:gtlscertificate
6770  * @title: GTlsCertificate
6771  * @short_description: TLS certificate
6772  * @see_also: #GTlsConnection
6773  *
6774  * A certificate used for TLS authentication and encryption.
6775  * This can represent either a public key only (eg, the certificate
6776  * received by a client from a server), or the combination of
6777  * a public key and a private key (which is needed when acting as a
6778  * #GTlsServerConnection).
6779  *
6780  * Since: 2.28
6781  */
6782
6783
6784 /**
6785  * SECTION:gtlsclientconnection
6786  * @short_description: TLS client-side connection
6787  * @include: gio/gio.h
6788  *
6789  * #GTlsClientConnection is the client-side subclass of
6790  * #GTlsConnection, representing a client-side TLS connection.
6791  */
6792
6793
6794 /**
6795  * SECTION:gtlsconnection
6796  * @short_description: TLS connection type
6797  * @include: gio/gio.h
6798  *
6799  * #GTlsConnection is the base TLS connection class type, which wraps
6800  * a #GIOStream and provides TLS encryption on top of it. Its
6801  * subclasses, #GTlsClientConnection and #GTlsServerConnection,
6802  * implement client-side and server-side TLS, respectively.
6803  *
6804  * Since: 2.28
6805  */
6806
6807
6808 /**
6809  * SECTION:gtlsdatabase
6810  * @short_description: TLS database type
6811  * @include: gio/gio.h
6812  *
6813  * #GTlsDatabase is used to lookup certificates and other information
6814  * from a certificate or key store. It is an abstract base class which
6815  * TLS library specific subtypes override.
6816  *
6817  * Most common client applications will not directly interact with
6818  * #GTlsDatabase. It is used internally by #GTlsConnection.
6819  *
6820  * Since: 2.30
6821  */
6822
6823
6824 /**
6825  * SECTION:gtlsfiledatabase
6826  * @short_description: TLS file based database type
6827  * @include: gio/gio.h
6828  *
6829  * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
6830  * their certificate information from a file. It is in interface which
6831  * TLS library specific subtypes implement.
6832  *
6833  * Since: 2.30
6834  */
6835
6836
6837 /**
6838  * SECTION:gtlsinteraction
6839  * @short_description: Interaction with the user during TLS operations.
6840  * @include: gio/gio.h
6841  *
6842  * #GTlsInteraction provides a mechanism for the TLS connection and database
6843  * code to interact with the user. It can be used to ask the user for passwords.
6844  *
6845  * To use a #GTlsInteraction with a TLS connection use
6846  * g_tls_connection_set_interaction().
6847  *
6848  * Callers should instantiate a derived class that implements the various
6849  * interaction methods to show the required dialogs.
6850  *
6851  * Callers should use the 'invoke' functions like
6852  * g_tls_interaction_invoke_ask_password() to run interaction methods. These
6853  * functions make sure that the interaction is invoked in the main loop
6854  * and not in the current thread, if the current thread is not running the
6855  * main loop.
6856  *
6857  * Derived classes can choose to implement whichever interactions methods they'd
6858  * like to support by overriding those virtual methods in their class
6859  * initialization function. Any interactions not implemented will return
6860  * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
6861  * it must also implement the corresponding finish method.
6862  */
6863
6864
6865 /**
6866  * SECTION:gtlspassword
6867  * @title: GTlsPassword
6868  * @short_description: TLS Passwords for prompting
6869  * @include: gio/gio.h
6870  *
6871  * Holds a password used in TLS.
6872  */
6873
6874
6875 /**
6876  * SECTION:gtlsserverconnection
6877  * @short_description: TLS server-side connection
6878  * @include: gio/gio.h
6879  *
6880  * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
6881  * representing a server-side TLS connection.
6882  *
6883  * Since: 2.28
6884  */
6885
6886
6887 /**
6888  * SECTION:gunixconnection
6889  * @title: GUnixConnection
6890  * @short_description: A UNIX domain GSocketConnection
6891  * @include: gio/gunixconnection.h
6892  * @see_also: #GSocketConnection.
6893  *
6894  * This is the subclass of #GSocketConnection that is created
6895  * for UNIX domain sockets.
6896  *
6897  * It contains functions to do some of the UNIX socket specific
6898  * functionality like passing file descriptors.
6899  *
6900  * Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
6901  * the UNIX-specific GIO interfaces, thus you have to use the
6902  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6903  *
6904  * Since: 2.22
6905  */
6906
6907
6908 /**
6909  * SECTION:gunixcredentialsmessage
6910  * @title: GUnixCredentialsMessage
6911  * @short_description: A GSocketControlMessage containing credentials
6912  * @include: gio/gunixcredentialsmessage.h
6913  * @see_also: #GUnixConnection, #GSocketControlMessage
6914  *
6915  * This #GSocketControlMessage contains a #GCredentials instance.  It
6916  * may be sent using g_socket_send_message() and received using
6917  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6918  * %G_SOCKET_FAMILY_UNIX family).
6919  *
6920  * For an easier way to send and receive credentials over
6921  * stream-oriented UNIX sockets, see
6922  * g_unix_connection_send_credentials() and
6923  * g_unix_connection_receive_credentials(). To receive credentials of
6924  * a foreign process connected to a socket, use
6925  * g_socket_get_credentials().
6926  */
6927
6928
6929 /**
6930  * SECTION:gunixfdlist
6931  * @title: GUnixFDList
6932  * @short_description: An object containing a set of UNIX file descriptors
6933  * @include: gio/gunixfdlist.h
6934  * @see_also: #GUnixFDMessage
6935  *
6936  * A #GUnixFDList contains a list of file descriptors.  It owns the file
6937  * descriptors that it contains, closing them when finalized.
6938  *
6939  * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
6940  * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
6941  * and received using g_socket_receive_message().
6942  *
6943  * Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
6944  * the UNIX-specific GIO interfaces, thus you have to use the
6945  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6946  */
6947
6948
6949 /**
6950  * SECTION:gunixfdmessage
6951  * @title: GUnixFDMessage
6952  * @short_description: A GSocketControlMessage containing a GUnixFDList
6953  * @include: gio/gunixfdmessage.h
6954  * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
6955  *
6956  * This #GSocketControlMessage contains a #GUnixFDList.
6957  * It may be sent using g_socket_send_message() and received using
6958  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6959  * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
6960  * between processes by the kernel.
6961  *
6962  * For an easier way to send and receive file descriptors over
6963  * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
6964  * g_unix_connection_receive_fd().
6965  *
6966  * Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
6967  * the UNIX-specific GIO interfaces, thus you have to use the
6968  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6969  */
6970
6971
6972 /**
6973  * SECTION:gunixinputstream
6974  * @short_description: Streaming input operations for UNIX file descriptors
6975  * @include: gio/gunixinputstream.h
6976  * @see_also: #GInputStream
6977  *
6978  * #GUnixInputStream implements #GInputStream for reading from a UNIX
6979  * file descriptor, including asynchronous operations. (If the file
6980  * descriptor refers to a socket or pipe, this will use poll() to do
6981  * asynchronous I/O. If it refers to a regular file, it will fall back
6982  * to doing asynchronous I/O in another thread.)
6983  *
6984  * Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
6985  * to the UNIX-specific GIO interfaces, thus you have to use the
6986  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6987  */
6988
6989
6990 /**
6991  * SECTION:gunixmounts
6992  * @include: gio/gunixmounts.h
6993  * @short_description: UNIX mounts
6994  *
6995  * Routines for managing mounted UNIX mount points and paths.
6996  *
6997  * Note that <filename>&lt;gio/gunixmounts.h&gt;</filename> belongs to the
6998  * UNIX-specific GIO interfaces, thus you have to use the
6999  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7000  */
7001
7002
7003 /**
7004  * SECTION:gunixoutputstream
7005  * @short_description: Streaming output operations for UNIX file descriptors
7006  * @include: gio/gunixoutputstream.h
7007  * @see_also: #GOutputStream
7008  *
7009  * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7010  * file descriptor, including asynchronous operations. (If the file
7011  * descriptor refers to a socket or pipe, this will use poll() to do
7012  * asynchronous I/O. If it refers to a regular file, it will fall back
7013  * to doing asynchronous I/O in another thread.)
7014  *
7015  * Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
7016  * to the UNIX-specific GIO interfaces, thus you have to use the
7017  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7018  */
7019
7020
7021 /**
7022  * SECTION:gunixsocketaddress
7023  * @short_description: UNIX GSocketAddress
7024  * @include: gio/gunixsocketaddress.h
7025  *
7026  * Support for UNIX-domain (also known as local) sockets.
7027  *
7028  * UNIX domain sockets are generally visible in the filesystem.
7029  * However, some systems support abstract socket names which are not
7030  * visible in the filesystem and not affected by the filesystem
7031  * permissions, visibility, etc. Currently this is only supported
7032  * under Linux. If you attempt to use abstract sockets on other
7033  * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7034  * errors. You can use g_unix_socket_address_abstract_names_supported()
7035  * to see if abstract names are supported.
7036  *
7037  * Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
7038  * the UNIX-specific GIO interfaces, thus you have to use the
7039  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7040  */
7041
7042
7043 /**
7044  * SECTION:gvfs
7045  * @short_description: Virtual File System
7046  * @include: gio/gio.h
7047  *
7048  * Entry point for using GIO functionality.
7049  */
7050
7051
7052 /**
7053  * SECTION:gvolume
7054  * @short_description: Volume management
7055  * @include: gio/gio.h
7056  *
7057  * The #GVolume interface represents user-visible objects that can be
7058  * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7059  * equivalent of #GnomeVFSDrive.
7060  *
7061  * Mounting a #GVolume instance is an asynchronous operation. For more
7062  * information about asynchronous operations, see #GAsyncResult and
7063  * #GSimpleAsyncResult. To mount a #GVolume, first call
7064  * g_volume_mount() with (at least) the #GVolume instance, optionally
7065  * a #GMountOperation object and a #GAsyncReadyCallback.
7066  *
7067  * Typically, one will only want to pass %NULL for the
7068  * #GMountOperation if automounting all volumes when a desktop session
7069  * starts since it's not desirable to put up a lot of dialogs asking
7070  * for credentials.
7071  *
7072  * The callback will be fired when the operation has resolved (either
7073  * with success or failure), and a #GAsyncReady structure will be
7074  * passed to the callback.  That callback should then call
7075  * g_volume_mount_finish() with the #GVolume instance and the
7076  * #GAsyncReady data to see if the operation was completed
7077  * successfully.  If an @error is present when g_volume_mount_finish()
7078  * is called, then it will be filled with any error information.
7079  *
7080  * <para id="volume-identifier">
7081  * It is sometimes necessary to directly access the underlying
7082  * operating system object behind a volume (e.g. for passing a volume
7083  * to an application via the commandline). For this purpose, GIO
7084  * allows to obtain an 'identifier' for the volume. There can be
7085  * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7086  * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7087  * uuids. GIO uses predefind strings as names for the different kinds
7088  * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7089  * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7090  * to obtain an identifier for a volume.
7091  * </para>
7092  *
7093  * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7094  * when the gvfs hal volume monitor is in use. Other volume monitors
7095  * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7096  * identifier, which can be used to obtain a hal device by means of
7097  * libhal_manager_find_device_string_match().
7098  */
7099
7100
7101 /**
7102  * SECTION:gvolumemonitor
7103  * @short_description: Volume Monitor
7104  * @include: gio/gio.h
7105  * @see_also: #GFileMonitor
7106  *
7107  * #GVolumeMonitor is for listing the user interesting devices and volumes
7108  * on the computer. In other words, what a file selector or file manager
7109  * would show in a sidebar.
7110  *
7111  * #GVolumeMonitor is not <link
7112  * linkend="g-main-context-push-thread-default">thread-default-context
7113  * aware</link>, and so should not be used other than from the main
7114  * thread, with no thread-default-context active.
7115  */
7116
7117
7118 /**
7119  * SECTION:gwin32inputstream
7120  * @short_description: Streaming input operations for Windows file handles
7121  * @include: gio/gwin32inputstream.h
7122  * @see_also: #GInputStream
7123  *
7124  * #GWin32InputStream implements #GInputStream for reading from a
7125  * Windows file handle.
7126  *
7127  * Note that <filename>&lt;gio/gwin32inputstream.h&gt;</filename> belongs
7128  * to the Windows-specific GIO interfaces, thus you have to use the
7129  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7130  */
7131
7132
7133 /**
7134  * SECTION:gwin32outputstream
7135  * @short_description: Streaming output operations for Windows file handles
7136  * @include: gio/gwin32outputstream.h
7137  * @see_also: #GOutputStream
7138  *
7139  * #GWin32OutputStream implements #GOutputStream for writing to a
7140  * Windows file handle.
7141  *
7142  * Note that <filename>&lt;gio/gwin32outputstream.h&gt;</filename> belongs
7143  * to the Windows-specific GIO interfaces, thus you have to use the
7144  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7145  */
7146
7147
7148 /**
7149  * SECTION:gzcompressor
7150  * @short_description: Zlib compressor
7151  * @include: gio/gio.h
7152  *
7153  * #GZlibCompressor is an implementation of #GConverter that
7154  * compresses data using zlib.
7155  */
7156
7157
7158 /**
7159  * SECTION:gzdecompressor
7160  * @short_description: Zlib decompressor
7161  * @include: gio/gio.h
7162  *
7163  * #GZlibDecompressor is an implementation of #GConverter that
7164  * decompresses data compressed with zlib.
7165  */
7166
7167
7168 /**
7169  * _GFreedesktopDBus:
7170  *
7171  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7172  */
7173
7174
7175 /**
7176  * _GFreedesktopDBus::handle-add-match:
7177  * @object: A #_GFreedesktopDBus.
7178  * @invocation: A #GDBusMethodInvocation.
7179  * @arg_rule: Argument passed by remote caller.
7180  *
7181  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method.
7182  *
7183  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_add_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7184  *
7185  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7186  */
7187
7188
7189 /**
7190  * _GFreedesktopDBus::handle-get-connection-selinux-security-context:
7191  * @object: A #_GFreedesktopDBus.
7192  * @invocation: A #GDBusMethodInvocation.
7193  * @arg_name: Argument passed by remote caller.
7194  *
7195  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method.
7196  *
7197  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_selinux_security_context() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7198  *
7199  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7200  */
7201
7202
7203 /**
7204  * _GFreedesktopDBus::handle-get-connection-unix-process-id:
7205  * @object: A #_GFreedesktopDBus.
7206  * @invocation: A #GDBusMethodInvocation.
7207  * @arg_name: Argument passed by remote caller.
7208  *
7209  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method.
7210  *
7211  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_process_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7212  *
7213  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7214  */
7215
7216
7217 /**
7218  * _GFreedesktopDBus::handle-get-connection-unix-user:
7219  * @object: A #_GFreedesktopDBus.
7220  * @invocation: A #GDBusMethodInvocation.
7221  * @arg_name: Argument passed by remote caller.
7222  *
7223  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method.
7224  *
7225  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7226  *
7227  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7228  */
7229
7230
7231 /**
7232  * _GFreedesktopDBus::handle-get-id:
7233  * @object: A #_GFreedesktopDBus.
7234  * @invocation: A #GDBusMethodInvocation.
7235  *
7236  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method.
7237  *
7238  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7239  *
7240  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7241  */
7242
7243
7244 /**
7245  * _GFreedesktopDBus::handle-get-name-owner:
7246  * @object: A #_GFreedesktopDBus.
7247  * @invocation: A #GDBusMethodInvocation.
7248  * @arg_name: Argument passed by remote caller.
7249  *
7250  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method.
7251  *
7252  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_name_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7253  *
7254  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7255  */
7256
7257
7258 /**
7259  * _GFreedesktopDBus::handle-hello:
7260  * @object: A #_GFreedesktopDBus.
7261  * @invocation: A #GDBusMethodInvocation.
7262  *
7263  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method.
7264  *
7265  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_hello() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7266  *
7267  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7268  */
7269
7270
7271 /**
7272  * _GFreedesktopDBus::handle-list-activatable-names:
7273  * @object: A #_GFreedesktopDBus.
7274  * @invocation: A #GDBusMethodInvocation.
7275  *
7276  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method.
7277  *
7278  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_activatable_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7279  *
7280  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7281  */
7282
7283
7284 /**
7285  * _GFreedesktopDBus::handle-list-names:
7286  * @object: A #_GFreedesktopDBus.
7287  * @invocation: A #GDBusMethodInvocation.
7288  *
7289  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method.
7290  *
7291  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7292  *
7293  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7294  */
7295
7296
7297 /**
7298  * _GFreedesktopDBus::handle-list-queued-owners:
7299  * @object: A #_GFreedesktopDBus.
7300  * @invocation: A #GDBusMethodInvocation.
7301  * @arg_name: Argument passed by remote caller.
7302  *
7303  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method.
7304  *
7305  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_queued_owners() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7306  *
7307  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7308  */
7309
7310
7311 /**
7312  * _GFreedesktopDBus::handle-name-has-owner:
7313  * @object: A #_GFreedesktopDBus.
7314  * @invocation: A #GDBusMethodInvocation.
7315  * @arg_name: Argument passed by remote caller.
7316  *
7317  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method.
7318  *
7319  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_name_has_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7320  *
7321  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7322  */
7323
7324
7325 /**
7326  * _GFreedesktopDBus::handle-release-name:
7327  * @object: A #_GFreedesktopDBus.
7328  * @invocation: A #GDBusMethodInvocation.
7329  * @arg_name: Argument passed by remote caller.
7330  *
7331  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method.
7332  *
7333  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_release_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7334  *
7335  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7336  */
7337
7338
7339 /**
7340  * _GFreedesktopDBus::handle-reload-config:
7341  * @object: A #_GFreedesktopDBus.
7342  * @invocation: A #GDBusMethodInvocation.
7343  *
7344  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method.
7345  *
7346  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_reload_config() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7347  *
7348  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7349  */
7350
7351
7352 /**
7353  * _GFreedesktopDBus::handle-remove-match:
7354  * @object: A #_GFreedesktopDBus.
7355  * @invocation: A #GDBusMethodInvocation.
7356  * @arg_rule: Argument passed by remote caller.
7357  *
7358  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method.
7359  *
7360  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_remove_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7361  *
7362  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7363  */
7364
7365
7366 /**
7367  * _GFreedesktopDBus::handle-request-name:
7368  * @object: A #_GFreedesktopDBus.
7369  * @invocation: A #GDBusMethodInvocation.
7370  * @arg_name: Argument passed by remote caller.
7371  * @arg_flags: Argument passed by remote caller.
7372  *
7373  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method.
7374  *
7375  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_request_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7376  *
7377  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7378  */
7379
7380
7381 /**
7382  * _GFreedesktopDBus::handle-start-service-by-name:
7383  * @object: A #_GFreedesktopDBus.
7384  * @invocation: A #GDBusMethodInvocation.
7385  * @arg_name: Argument passed by remote caller.
7386  * @arg_flags: Argument passed by remote caller.
7387  *
7388  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method.
7389  *
7390  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_start_service_by_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7391  *
7392  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7393  */
7394
7395
7396 /**
7397  * _GFreedesktopDBus::handle-update-activation-environment:
7398  * @object: A #_GFreedesktopDBus.
7399  * @invocation: A #GDBusMethodInvocation.
7400  * @arg_environment: Argument passed by remote caller.
7401  *
7402  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method.
7403  *
7404  * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_update_activation_environment() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7405  *
7406  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7407  */
7408
7409
7410 /**
7411  * _GFreedesktopDBus::name-acquired:
7412  * @object: A #_GFreedesktopDBus.
7413  * @arg_name: Argument.
7414  *
7415  * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> is received.
7416  *
7417  * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7418  */
7419
7420
7421 /**
7422  * _GFreedesktopDBus::name-lost:
7423  * @object: A #_GFreedesktopDBus.
7424  * @arg_name: Argument.
7425  *
7426  * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> is received.
7427  *
7428  * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7429  */
7430
7431
7432 /**
7433  * _GFreedesktopDBus::name-owner-changed:
7434  * @object: A #_GFreedesktopDBus.
7435  * @arg_name: Argument.
7436  * @arg_old_owner: Argument.
7437  * @arg_new_owner: Argument.
7438  *
7439  * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> is received.
7440  *
7441  * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7442  */
7443
7444
7445 /**
7446  * _GFreedesktopDBusIface:
7447  * @parent_iface: The parent interface.
7448  * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal.
7449  * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal.
7450  * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal.
7451  * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal.
7452  * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal.
7453  * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal.
7454  * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal.
7455  * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal.
7456  * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal.
7457  * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal.
7458  * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal.
7459  * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal.
7460  * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal.
7461  * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal.
7462  * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal.
7463  * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal.
7464  * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal.
7465  * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal.
7466  * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal.
7467  * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal.
7468  *
7469  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7470  */
7471
7472
7473 /**
7474  * _GFreedesktopDBusProxy:
7475  *
7476  * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API.
7477  */
7478
7479
7480 /**
7481  * _GFreedesktopDBusProxyClass:
7482  * @parent_class: The parent class.
7483  *
7484  * Class structure for #_GFreedesktopDBusProxy.
7485  */
7486
7487
7488 /**
7489  * _GFreedesktopDBusSkeleton:
7490  *
7491  * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API.
7492  */
7493
7494
7495 /**
7496  * _GFreedesktopDBusSkeletonClass:
7497  * @parent_class: The parent class.
7498  *
7499  * Class structure for #_GFreedesktopDBusSkeleton.
7500  */
7501
7502
7503 /**
7504  * _g_freedesktop_dbus_call_add_match:
7505  * @proxy: A #_GFreedesktopDBusProxy.
7506  * @arg_rule: Argument to pass with the method invocation.
7507  * @cancellable: (allow-none): A #GCancellable or %NULL.
7508  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7509  * @user_data: User data to pass to @callback.
7510  *
7511  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy.
7512  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7513  * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation.
7514  *
7515  * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method.
7516  */
7517
7518
7519 /**
7520  * _g_freedesktop_dbus_call_add_match_finish:
7521  * @proxy: A #_GFreedesktopDBusProxy.
7522  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match().
7523  * @error: Return location for error or %NULL.
7524  *
7525  * Finishes an operation started with _g_freedesktop_dbus_call_add_match().
7526  *
7527  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7528  */
7529
7530
7531 /**
7532  * _g_freedesktop_dbus_call_add_match_sync:
7533  * @proxy: A #_GFreedesktopDBusProxy.
7534  * @arg_rule: Argument to pass with the method invocation.
7535  * @cancellable: (allow-none): A #GCancellable or %NULL.
7536  * @error: Return location for error or %NULL.
7537  *
7538  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7539  *
7540  * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method.
7541  *
7542  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7543  */
7544
7545
7546 /**
7547  * _g_freedesktop_dbus_call_get_connection_selinux_security_context:
7548  * @proxy: A #_GFreedesktopDBusProxy.
7549  * @arg_name: Argument to pass with the method invocation.
7550  * @cancellable: (allow-none): A #GCancellable or %NULL.
7551  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7552  * @user_data: User data to pass to @callback.
7553  *
7554  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy.
7555  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7556  * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation.
7557  *
7558  * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method.
7559  */
7560
7561
7562 /**
7563  * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish:
7564  * @proxy: A #_GFreedesktopDBusProxy.
7565  * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7566  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7567  * @error: Return location for error or %NULL.
7568  *
7569  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7570  *
7571  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7572  */
7573
7574
7575 /**
7576  * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync:
7577  * @proxy: A #_GFreedesktopDBusProxy.
7578  * @arg_name: Argument to pass with the method invocation.
7579  * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7580  * @cancellable: (allow-none): A #GCancellable or %NULL.
7581  * @error: Return location for error or %NULL.
7582  *
7583  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7584  *
7585  * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method.
7586  *
7587  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7588  */
7589
7590
7591 /**
7592  * _g_freedesktop_dbus_call_get_connection_unix_process_id:
7593  * @proxy: A #_GFreedesktopDBusProxy.
7594  * @arg_name: Argument to pass with the method invocation.
7595  * @cancellable: (allow-none): A #GCancellable or %NULL.
7596  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7597  * @user_data: User data to pass to @callback.
7598  *
7599  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy.
7600  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7601  * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation.
7602  *
7603  * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method.
7604  */
7605
7606
7607 /**
7608  * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish:
7609  * @proxy: A #_GFreedesktopDBusProxy.
7610  * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7611  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id().
7612  * @error: Return location for error or %NULL.
7613  *
7614  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id().
7615  *
7616  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7617  */
7618
7619
7620 /**
7621  * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync:
7622  * @proxy: A #_GFreedesktopDBusProxy.
7623  * @arg_name: Argument to pass with the method invocation.
7624  * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7625  * @cancellable: (allow-none): A #GCancellable or %NULL.
7626  * @error: Return location for error or %NULL.
7627  *
7628  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7629  *
7630  * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method.
7631  *
7632  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7633  */
7634
7635
7636 /**
7637  * _g_freedesktop_dbus_call_get_connection_unix_user:
7638  * @proxy: A #_GFreedesktopDBusProxy.
7639  * @arg_name: Argument to pass with the method invocation.
7640  * @cancellable: (allow-none): A #GCancellable or %NULL.
7641  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7642  * @user_data: User data to pass to @callback.
7643  *
7644  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy.
7645  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7646  * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation.
7647  *
7648  * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method.
7649  */
7650
7651
7652 /**
7653  * _g_freedesktop_dbus_call_get_connection_unix_user_finish:
7654  * @proxy: A #_GFreedesktopDBusProxy.
7655  * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7656  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user().
7657  * @error: Return location for error or %NULL.
7658  *
7659  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user().
7660  *
7661  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7662  */
7663
7664
7665 /**
7666  * _g_freedesktop_dbus_call_get_connection_unix_user_sync:
7667  * @proxy: A #_GFreedesktopDBusProxy.
7668  * @arg_name: Argument to pass with the method invocation.
7669  * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7670  * @cancellable: (allow-none): A #GCancellable or %NULL.
7671  * @error: Return location for error or %NULL.
7672  *
7673  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7674  *
7675  * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method.
7676  *
7677  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7678  */
7679
7680
7681 /**
7682  * _g_freedesktop_dbus_call_get_id:
7683  * @proxy: A #_GFreedesktopDBusProxy.
7684  * @cancellable: (allow-none): A #GCancellable or %NULL.
7685  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7686  * @user_data: User data to pass to @callback.
7687  *
7688  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy.
7689  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7690  * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation.
7691  *
7692  * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method.
7693  */
7694
7695
7696 /**
7697  * _g_freedesktop_dbus_call_get_id_finish:
7698  * @proxy: A #_GFreedesktopDBusProxy.
7699  * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7700  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id().
7701  * @error: Return location for error or %NULL.
7702  *
7703  * Finishes an operation started with _g_freedesktop_dbus_call_get_id().
7704  *
7705  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7706  */
7707
7708
7709 /**
7710  * _g_freedesktop_dbus_call_get_id_sync:
7711  * @proxy: A #_GFreedesktopDBusProxy.
7712  * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7713  * @cancellable: (allow-none): A #GCancellable or %NULL.
7714  * @error: Return location for error or %NULL.
7715  *
7716  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7717  *
7718  * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method.
7719  *
7720  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7721  */
7722
7723
7724 /**
7725  * _g_freedesktop_dbus_call_get_name_owner:
7726  * @proxy: A #_GFreedesktopDBusProxy.
7727  * @arg_name: Argument to pass with the method invocation.
7728  * @cancellable: (allow-none): A #GCancellable or %NULL.
7729  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7730  * @user_data: User data to pass to @callback.
7731  *
7732  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy.
7733  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7734  * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation.
7735  *
7736  * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method.
7737  */
7738
7739
7740 /**
7741  * _g_freedesktop_dbus_call_get_name_owner_finish:
7742  * @proxy: A #_GFreedesktopDBusProxy.
7743  * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7744  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner().
7745  * @error: Return location for error or %NULL.
7746  *
7747  * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner().
7748  *
7749  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7750  */
7751
7752
7753 /**
7754  * _g_freedesktop_dbus_call_get_name_owner_sync:
7755  * @proxy: A #_GFreedesktopDBusProxy.
7756  * @arg_name: Argument to pass with the method invocation.
7757  * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7758  * @cancellable: (allow-none): A #GCancellable or %NULL.
7759  * @error: Return location for error or %NULL.
7760  *
7761  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7762  *
7763  * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method.
7764  *
7765  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7766  */
7767
7768
7769 /**
7770  * _g_freedesktop_dbus_call_hello:
7771  * @proxy: A #_GFreedesktopDBusProxy.
7772  * @cancellable: (allow-none): A #GCancellable or %NULL.
7773  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7774  * @user_data: User data to pass to @callback.
7775  *
7776  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy.
7777  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7778  * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation.
7779  *
7780  * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method.
7781  */
7782
7783
7784 /**
7785  * _g_freedesktop_dbus_call_hello_finish:
7786  * @proxy: A #_GFreedesktopDBusProxy.
7787  * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7788  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello().
7789  * @error: Return location for error or %NULL.
7790  *
7791  * Finishes an operation started with _g_freedesktop_dbus_call_hello().
7792  *
7793  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7794  */
7795
7796
7797 /**
7798  * _g_freedesktop_dbus_call_hello_sync:
7799  * @proxy: A #_GFreedesktopDBusProxy.
7800  * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7801  * @cancellable: (allow-none): A #GCancellable or %NULL.
7802  * @error: Return location for error or %NULL.
7803  *
7804  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7805  *
7806  * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method.
7807  *
7808  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7809  */
7810
7811
7812 /**
7813  * _g_freedesktop_dbus_call_list_activatable_names:
7814  * @proxy: A #_GFreedesktopDBusProxy.
7815  * @cancellable: (allow-none): A #GCancellable or %NULL.
7816  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7817  * @user_data: User data to pass to @callback.
7818  *
7819  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy.
7820  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7821  * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation.
7822  *
7823  * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method.
7824  */
7825
7826
7827 /**
7828  * _g_freedesktop_dbus_call_list_activatable_names_finish:
7829  * @proxy: A #_GFreedesktopDBusProxy.
7830  * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7831  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names().
7832  * @error: Return location for error or %NULL.
7833  *
7834  * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names().
7835  *
7836  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7837  */
7838
7839
7840 /**
7841  * _g_freedesktop_dbus_call_list_activatable_names_sync:
7842  * @proxy: A #_GFreedesktopDBusProxy.
7843  * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7844  * @cancellable: (allow-none): A #GCancellable or %NULL.
7845  * @error: Return location for error or %NULL.
7846  *
7847  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7848  *
7849  * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method.
7850  *
7851  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7852  */
7853
7854
7855 /**
7856  * _g_freedesktop_dbus_call_list_names:
7857  * @proxy: A #_GFreedesktopDBusProxy.
7858  * @cancellable: (allow-none): A #GCancellable or %NULL.
7859  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7860  * @user_data: User data to pass to @callback.
7861  *
7862  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy.
7863  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7864  * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation.
7865  *
7866  * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method.
7867  */
7868
7869
7870 /**
7871  * _g_freedesktop_dbus_call_list_names_finish:
7872  * @proxy: A #_GFreedesktopDBusProxy.
7873  * @out_names: (out): Return location for return parameter or %NULL to ignore.
7874  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names().
7875  * @error: Return location for error or %NULL.
7876  *
7877  * Finishes an operation started with _g_freedesktop_dbus_call_list_names().
7878  *
7879  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7880  */
7881
7882
7883 /**
7884  * _g_freedesktop_dbus_call_list_names_sync:
7885  * @proxy: A #_GFreedesktopDBusProxy.
7886  * @out_names: (out): Return location for return parameter or %NULL to ignore.
7887  * @cancellable: (allow-none): A #GCancellable or %NULL.
7888  * @error: Return location for error or %NULL.
7889  *
7890  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7891  *
7892  * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method.
7893  *
7894  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7895  */
7896
7897
7898 /**
7899  * _g_freedesktop_dbus_call_list_queued_owners:
7900  * @proxy: A #_GFreedesktopDBusProxy.
7901  * @arg_name: Argument to pass with the method invocation.
7902  * @cancellable: (allow-none): A #GCancellable or %NULL.
7903  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7904  * @user_data: User data to pass to @callback.
7905  *
7906  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy.
7907  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7908  * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation.
7909  *
7910  * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method.
7911  */
7912
7913
7914 /**
7915  * _g_freedesktop_dbus_call_list_queued_owners_finish:
7916  * @proxy: A #_GFreedesktopDBusProxy.
7917  * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7918  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners().
7919  * @error: Return location for error or %NULL.
7920  *
7921  * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners().
7922  *
7923  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7924  */
7925
7926
7927 /**
7928  * _g_freedesktop_dbus_call_list_queued_owners_sync:
7929  * @proxy: A #_GFreedesktopDBusProxy.
7930  * @arg_name: Argument to pass with the method invocation.
7931  * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7932  * @cancellable: (allow-none): A #GCancellable or %NULL.
7933  * @error: Return location for error or %NULL.
7934  *
7935  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7936  *
7937  * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method.
7938  *
7939  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7940  */
7941
7942
7943 /**
7944  * _g_freedesktop_dbus_call_name_has_owner:
7945  * @proxy: A #_GFreedesktopDBusProxy.
7946  * @arg_name: Argument to pass with the method invocation.
7947  * @cancellable: (allow-none): A #GCancellable or %NULL.
7948  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7949  * @user_data: User data to pass to @callback.
7950  *
7951  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy.
7952  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7953  * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation.
7954  *
7955  * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method.
7956  */
7957
7958
7959 /**
7960  * _g_freedesktop_dbus_call_name_has_owner_finish:
7961  * @proxy: A #_GFreedesktopDBusProxy.
7962  * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
7963  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner().
7964  * @error: Return location for error or %NULL.
7965  *
7966  * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner().
7967  *
7968  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7969  */
7970
7971
7972 /**
7973  * _g_freedesktop_dbus_call_name_has_owner_sync:
7974  * @proxy: A #_GFreedesktopDBusProxy.
7975  * @arg_name: Argument to pass with the method invocation.
7976  * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
7977  * @cancellable: (allow-none): A #GCancellable or %NULL.
7978  * @error: Return location for error or %NULL.
7979  *
7980  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7981  *
7982  * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method.
7983  *
7984  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7985  */
7986
7987
7988 /**
7989  * _g_freedesktop_dbus_call_release_name:
7990  * @proxy: A #_GFreedesktopDBusProxy.
7991  * @arg_name: Argument to pass with the method invocation.
7992  * @cancellable: (allow-none): A #GCancellable or %NULL.
7993  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7994  * @user_data: User data to pass to @callback.
7995  *
7996  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy.
7997  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7998  * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation.
7999  *
8000  * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method.
8001  */
8002
8003
8004 /**
8005  * _g_freedesktop_dbus_call_release_name_finish:
8006  * @proxy: A #_GFreedesktopDBusProxy.
8007  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8008  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name().
8009  * @error: Return location for error or %NULL.
8010  *
8011  * Finishes an operation started with _g_freedesktop_dbus_call_release_name().
8012  *
8013  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8014  */
8015
8016
8017 /**
8018  * _g_freedesktop_dbus_call_release_name_sync:
8019  * @proxy: A #_GFreedesktopDBusProxy.
8020  * @arg_name: Argument to pass with the method invocation.
8021  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8022  * @cancellable: (allow-none): A #GCancellable or %NULL.
8023  * @error: Return location for error or %NULL.
8024  *
8025  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8026  *
8027  * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method.
8028  *
8029  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8030  */
8031
8032
8033 /**
8034  * _g_freedesktop_dbus_call_reload_config:
8035  * @proxy: A #_GFreedesktopDBusProxy.
8036  * @cancellable: (allow-none): A #GCancellable or %NULL.
8037  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8038  * @user_data: User data to pass to @callback.
8039  *
8040  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy.
8041  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8042  * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation.
8043  *
8044  * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method.
8045  */
8046
8047
8048 /**
8049  * _g_freedesktop_dbus_call_reload_config_finish:
8050  * @proxy: A #_GFreedesktopDBusProxy.
8051  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config().
8052  * @error: Return location for error or %NULL.
8053  *
8054  * Finishes an operation started with _g_freedesktop_dbus_call_reload_config().
8055  *
8056  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8057  */
8058
8059
8060 /**
8061  * _g_freedesktop_dbus_call_reload_config_sync:
8062  * @proxy: A #_GFreedesktopDBusProxy.
8063  * @cancellable: (allow-none): A #GCancellable or %NULL.
8064  * @error: Return location for error or %NULL.
8065  *
8066  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8067  *
8068  * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method.
8069  *
8070  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8071  */
8072
8073
8074 /**
8075  * _g_freedesktop_dbus_call_remove_match:
8076  * @proxy: A #_GFreedesktopDBusProxy.
8077  * @arg_rule: Argument to pass with the method invocation.
8078  * @cancellable: (allow-none): A #GCancellable or %NULL.
8079  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8080  * @user_data: User data to pass to @callback.
8081  *
8082  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy.
8083  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8084  * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation.
8085  *
8086  * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method.
8087  */
8088
8089
8090 /**
8091  * _g_freedesktop_dbus_call_remove_match_finish:
8092  * @proxy: A #_GFreedesktopDBusProxy.
8093  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match().
8094  * @error: Return location for error or %NULL.
8095  *
8096  * Finishes an operation started with _g_freedesktop_dbus_call_remove_match().
8097  *
8098  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8099  */
8100
8101
8102 /**
8103  * _g_freedesktop_dbus_call_remove_match_sync:
8104  * @proxy: A #_GFreedesktopDBusProxy.
8105  * @arg_rule: Argument to pass with the method invocation.
8106  * @cancellable: (allow-none): A #GCancellable or %NULL.
8107  * @error: Return location for error or %NULL.
8108  *
8109  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8110  *
8111  * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method.
8112  *
8113  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8114  */
8115
8116
8117 /**
8118  * _g_freedesktop_dbus_call_request_name:
8119  * @proxy: A #_GFreedesktopDBusProxy.
8120  * @arg_name: Argument to pass with the method invocation.
8121  * @arg_flags: Argument to pass with the method invocation.
8122  * @cancellable: (allow-none): A #GCancellable or %NULL.
8123  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8124  * @user_data: User data to pass to @callback.
8125  *
8126  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy.
8127  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8128  * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation.
8129  *
8130  * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method.
8131  */
8132
8133
8134 /**
8135  * _g_freedesktop_dbus_call_request_name_finish:
8136  * @proxy: A #_GFreedesktopDBusProxy.
8137  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8138  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name().
8139  * @error: Return location for error or %NULL.
8140  *
8141  * Finishes an operation started with _g_freedesktop_dbus_call_request_name().
8142  *
8143  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8144  */
8145
8146
8147 /**
8148  * _g_freedesktop_dbus_call_request_name_sync:
8149  * @proxy: A #_GFreedesktopDBusProxy.
8150  * @arg_name: Argument to pass with the method invocation.
8151  * @arg_flags: Argument to pass with the method invocation.
8152  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8153  * @cancellable: (allow-none): A #GCancellable or %NULL.
8154  * @error: Return location for error or %NULL.
8155  *
8156  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8157  *
8158  * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method.
8159  *
8160  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8161  */
8162
8163
8164 /**
8165  * _g_freedesktop_dbus_call_start_service_by_name:
8166  * @proxy: A #_GFreedesktopDBusProxy.
8167  * @arg_name: Argument to pass with the method invocation.
8168  * @arg_flags: Argument to pass with the method invocation.
8169  * @cancellable: (allow-none): A #GCancellable or %NULL.
8170  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8171  * @user_data: User data to pass to @callback.
8172  *
8173  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy.
8174  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8175  * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation.
8176  *
8177  * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method.
8178  */
8179
8180
8181 /**
8182  * _g_freedesktop_dbus_call_start_service_by_name_finish:
8183  * @proxy: A #_GFreedesktopDBusProxy.
8184  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8185  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name().
8186  * @error: Return location for error or %NULL.
8187  *
8188  * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name().
8189  *
8190  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8191  */
8192
8193
8194 /**
8195  * _g_freedesktop_dbus_call_start_service_by_name_sync:
8196  * @proxy: A #_GFreedesktopDBusProxy.
8197  * @arg_name: Argument to pass with the method invocation.
8198  * @arg_flags: Argument to pass with the method invocation.
8199  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8200  * @cancellable: (allow-none): A #GCancellable or %NULL.
8201  * @error: Return location for error or %NULL.
8202  *
8203  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8204  *
8205  * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method.
8206  *
8207  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8208  */
8209
8210
8211 /**
8212  * _g_freedesktop_dbus_call_update_activation_environment:
8213  * @proxy: A #_GFreedesktopDBusProxy.
8214  * @arg_environment: Argument to pass with the method invocation.
8215  * @cancellable: (allow-none): A #GCancellable or %NULL.
8216  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8217  * @user_data: User data to pass to @callback.
8218  *
8219  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy.
8220  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8221  * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation.
8222  *
8223  * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method.
8224  */
8225
8226
8227 /**
8228  * _g_freedesktop_dbus_call_update_activation_environment_finish:
8229  * @proxy: A #_GFreedesktopDBusProxy.
8230  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment().
8231  * @error: Return location for error or %NULL.
8232  *
8233  * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment().
8234  *
8235  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8236  */
8237
8238
8239 /**
8240  * _g_freedesktop_dbus_call_update_activation_environment_sync:
8241  * @proxy: A #_GFreedesktopDBusProxy.
8242  * @arg_environment: Argument to pass with the method invocation.
8243  * @cancellable: (allow-none): A #GCancellable or %NULL.
8244  * @error: Return location for error or %NULL.
8245  *
8246  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8247  *
8248  * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method.
8249  *
8250  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8251  */
8252
8253
8254 /**
8255  * _g_freedesktop_dbus_complete_add_match:
8256  * @object: A #_GFreedesktopDBus.
8257  * @invocation: (transfer full): A #GDBusMethodInvocation.
8258  *
8259  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8260  *
8261  * This method will free @invocation, you cannot use it afterwards.
8262  */
8263
8264
8265 /**
8266  * _g_freedesktop_dbus_complete_get_connection_selinux_security_context:
8267  * @object: A #_GFreedesktopDBus.
8268  * @invocation: (transfer full): A #GDBusMethodInvocation.
8269  * @security_context: Parameter to return.
8270  *
8271  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8272  *
8273  * This method will free @invocation, you cannot use it afterwards.
8274  */
8275
8276
8277 /**
8278  * _g_freedesktop_dbus_complete_get_connection_unix_process_id:
8279  * @object: A #_GFreedesktopDBus.
8280  * @invocation: (transfer full): A #GDBusMethodInvocation.
8281  * @pid: Parameter to return.
8282  *
8283  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8284  *
8285  * This method will free @invocation, you cannot use it afterwards.
8286  */
8287
8288
8289 /**
8290  * _g_freedesktop_dbus_complete_get_connection_unix_user:
8291  * @object: A #_GFreedesktopDBus.
8292  * @invocation: (transfer full): A #GDBusMethodInvocation.
8293  * @uid: Parameter to return.
8294  *
8295  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8296  *
8297  * This method will free @invocation, you cannot use it afterwards.
8298  */
8299
8300
8301 /**
8302  * _g_freedesktop_dbus_complete_get_id:
8303  * @object: A #_GFreedesktopDBus.
8304  * @invocation: (transfer full): A #GDBusMethodInvocation.
8305  * @unique_id: Parameter to return.
8306  *
8307  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8308  *
8309  * This method will free @invocation, you cannot use it afterwards.
8310  */
8311
8312
8313 /**
8314  * _g_freedesktop_dbus_complete_get_name_owner:
8315  * @object: A #_GFreedesktopDBus.
8316  * @invocation: (transfer full): A #GDBusMethodInvocation.
8317  * @unique_name: Parameter to return.
8318  *
8319  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8320  *
8321  * This method will free @invocation, you cannot use it afterwards.
8322  */
8323
8324
8325 /**
8326  * _g_freedesktop_dbus_complete_hello:
8327  * @object: A #_GFreedesktopDBus.
8328  * @invocation: (transfer full): A #GDBusMethodInvocation.
8329  * @assigned_name: Parameter to return.
8330  *
8331  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8332  *
8333  * This method will free @invocation, you cannot use it afterwards.
8334  */
8335
8336
8337 /**
8338  * _g_freedesktop_dbus_complete_list_activatable_names:
8339  * @object: A #_GFreedesktopDBus.
8340  * @invocation: (transfer full): A #GDBusMethodInvocation.
8341  * @activatable_names: Parameter to return.
8342  *
8343  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8344  *
8345  * This method will free @invocation, you cannot use it afterwards.
8346  */
8347
8348
8349 /**
8350  * _g_freedesktop_dbus_complete_list_names:
8351  * @object: A #_GFreedesktopDBus.
8352  * @invocation: (transfer full): A #GDBusMethodInvocation.
8353  * @names: Parameter to return.
8354  *
8355  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8356  *
8357  * This method will free @invocation, you cannot use it afterwards.
8358  */
8359
8360
8361 /**
8362  * _g_freedesktop_dbus_complete_list_queued_owners:
8363  * @object: A #_GFreedesktopDBus.
8364  * @invocation: (transfer full): A #GDBusMethodInvocation.
8365  * @queued_owners: Parameter to return.
8366  *
8367  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8368  *
8369  * This method will free @invocation, you cannot use it afterwards.
8370  */
8371
8372
8373 /**
8374  * _g_freedesktop_dbus_complete_name_has_owner:
8375  * @object: A #_GFreedesktopDBus.
8376  * @invocation: (transfer full): A #GDBusMethodInvocation.
8377  * @has_owner: Parameter to return.
8378  *
8379  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8380  *
8381  * This method will free @invocation, you cannot use it afterwards.
8382  */
8383
8384
8385 /**
8386  * _g_freedesktop_dbus_complete_release_name:
8387  * @object: A #_GFreedesktopDBus.
8388  * @invocation: (transfer full): A #GDBusMethodInvocation.
8389  * @value: Parameter to return.
8390  *
8391  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8392  *
8393  * This method will free @invocation, you cannot use it afterwards.
8394  */
8395
8396
8397 /**
8398  * _g_freedesktop_dbus_complete_reload_config:
8399  * @object: A #_GFreedesktopDBus.
8400  * @invocation: (transfer full): A #GDBusMethodInvocation.
8401  *
8402  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8403  *
8404  * This method will free @invocation, you cannot use it afterwards.
8405  */
8406
8407
8408 /**
8409  * _g_freedesktop_dbus_complete_remove_match:
8410  * @object: A #_GFreedesktopDBus.
8411  * @invocation: (transfer full): A #GDBusMethodInvocation.
8412  *
8413  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8414  *
8415  * This method will free @invocation, you cannot use it afterwards.
8416  */
8417
8418
8419 /**
8420  * _g_freedesktop_dbus_complete_request_name:
8421  * @object: A #_GFreedesktopDBus.
8422  * @invocation: (transfer full): A #GDBusMethodInvocation.
8423  * @value: Parameter to return.
8424  *
8425  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8426  *
8427  * This method will free @invocation, you cannot use it afterwards.
8428  */
8429
8430
8431 /**
8432  * _g_freedesktop_dbus_complete_start_service_by_name:
8433  * @object: A #_GFreedesktopDBus.
8434  * @invocation: (transfer full): A #GDBusMethodInvocation.
8435  * @value: Parameter to return.
8436  *
8437  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8438  *
8439  * This method will free @invocation, you cannot use it afterwards.
8440  */
8441
8442
8443 /**
8444  * _g_freedesktop_dbus_complete_update_activation_environment:
8445  * @object: A #_GFreedesktopDBus.
8446  * @invocation: (transfer full): A #GDBusMethodInvocation.
8447  *
8448  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8449  *
8450  * This method will free @invocation, you cannot use it afterwards.
8451  */
8452
8453
8454 /**
8455  * _g_freedesktop_dbus_emit_name_acquired:
8456  * @object: A #_GFreedesktopDBus.
8457  * @arg_name: Argument to pass with the signal.
8458  *
8459  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> D-Bus signal.
8460  */
8461
8462
8463 /**
8464  * _g_freedesktop_dbus_emit_name_lost:
8465  * @object: A #_GFreedesktopDBus.
8466  * @arg_name: Argument to pass with the signal.
8467  *
8468  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> D-Bus signal.
8469  */
8470
8471
8472 /**
8473  * _g_freedesktop_dbus_emit_name_owner_changed:
8474  * @object: A #_GFreedesktopDBus.
8475  * @arg_name: Argument to pass with the signal.
8476  * @arg_old_owner: Argument to pass with the signal.
8477  * @arg_new_owner: Argument to pass with the signal.
8478  *
8479  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> D-Bus signal.
8480  */
8481
8482
8483 /**
8484  * _g_freedesktop_dbus_interface_info:
8485  *
8486  * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface.
8487  *
8488  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
8489  */
8490
8491
8492 /**
8493  * _g_freedesktop_dbus_override_properties:
8494  * @klass: The class structure for a #GObject<!-- -->-derived class.
8495  * @property_id_begin: The property id to assign to the first overridden property.
8496  *
8497  * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class.
8498  * The properties are overridden in the order they are defined.
8499  *
8500  * Returns: The last property id.
8501  */
8502
8503
8504 /**
8505  * _g_freedesktop_dbus_proxy_new:
8506  * @connection: A #GDBusConnection.
8507  * @flags: Flags from the #GDBusProxyFlags enumeration.
8508  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8509  * @object_path: An object path.
8510  * @cancellable: (allow-none): A #GCancellable or %NULL.
8511  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8512  * @user_data: User data to pass to @callback.
8513  *
8514  * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>. See g_dbus_proxy_new() for more details.
8515  *
8516  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8517  * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation.
8518  *
8519  * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
8520  */
8521
8522
8523 /**
8524  * _g_freedesktop_dbus_proxy_new_finish:
8525  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new().
8526  * @error: Return location for error or %NULL
8527  *
8528  * Finishes an operation started with _g_freedesktop_dbus_proxy_new().
8529  *
8530  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8531  */
8532
8533
8534 /**
8535  * _g_freedesktop_dbus_proxy_new_for_bus:
8536  * @bus_type: A #GBusType.
8537  * @flags: Flags from the #GDBusProxyFlags enumeration.
8538  * @name: A bus name (well-known or unique).
8539  * @object_path: An object path.
8540  * @cancellable: (allow-none): A #GCancellable or %NULL.
8541  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8542  * @user_data: User data to pass to @callback.
8543  *
8544  * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
8545  *
8546  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8547  * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation.
8548  *
8549  * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
8550  */
8551
8552
8553 /**
8554  * _g_freedesktop_dbus_proxy_new_for_bus_finish:
8555  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus().
8556  * @error: Return location for error or %NULL
8557  *
8558  * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus().
8559  *
8560  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8561  */
8562
8563
8564 /**
8565  * _g_freedesktop_dbus_proxy_new_for_bus_sync:
8566  * @bus_type: A #GBusType.
8567  * @flags: Flags from the #GDBusProxyFlags enumeration.
8568  * @name: A bus name (well-known or unique).
8569  * @object_path: An object path.
8570  * @cancellable: (allow-none): A #GCancellable or %NULL.
8571  * @error: Return location for error or %NULL
8572  *
8573  * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
8574  *
8575  * The calling thread is blocked until a reply is received.
8576  *
8577  * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
8578  *
8579  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8580  */
8581
8582
8583 /**
8584  * _g_freedesktop_dbus_proxy_new_sync:
8585  * @connection: A #GDBusConnection.
8586  * @flags: Flags from the #GDBusProxyFlags enumeration.
8587  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8588  * @object_path: An object path.
8589  * @cancellable: (allow-none): A #GCancellable or %NULL.
8590  * @error: Return location for error or %NULL
8591  *
8592  * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>. See g_dbus_proxy_new_sync() for more details.
8593  *
8594  * The calling thread is blocked until a reply is received.
8595  *
8596  * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor.
8597  *
8598  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8599  */
8600
8601
8602 /**
8603  * _g_freedesktop_dbus_skeleton_new:
8604  *
8605  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
8606  *
8607  * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object.
8608  */
8609
8610
8611 /**
8612  * _g_io_module_get_default:
8613  * @extension_point: the name of an extension point
8614  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8615  * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
8616  *
8617  * Retrieves the default object implementing @extension_point.
8618  *
8619  * If @envvar is not %NULL, and the environment variable with that
8620  * name is set, then the implementation it specifies will be tried
8621  * first. After that, or if @envvar is not set, all other
8622  * implementations will be tried in order of decreasing priority.
8623  *
8624  * If an extension point implementation implements #GInitable, then
8625  * that implementation will only be used if it initializes
8626  * successfully. Otherwise, if @verify_func is not %NULL, then it will
8627  * be called on each candidate implementation after construction, to
8628  * check if it is actually usable or not.
8629  *
8630  * The result is cached after it is generated the first time, and
8631  * the function is thread-safe.
8632  *
8633  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8634  */
8635
8636
8637 /**
8638  * g_action_activate:
8639  * @action: a #GAction
8640  * @parameter: (allow-none): the parameter to the activation
8641  *
8642  * Activates the action.
8643  *
8644  * @parameter must be the correct type of parameter for the action (ie:
8645  * the parameter type given at construction time).  If the parameter
8646  * type was %NULL then @parameter must also be %NULL.
8647  *
8648  * Since: 2.28
8649  */
8650
8651
8652 /**
8653  * g_action_change_state:
8654  * @action: a #GAction
8655  * @value: the new state
8656  *
8657  * Request for the state of @action to be changed to @value.
8658  *
8659  * The action must be stateful and @value must be of the correct type.
8660  * See g_action_get_state_type().
8661  *
8662  * This call merely requests a change.  The action may refuse to change
8663  * its state or may change its state to something other than @value.
8664  * See g_action_get_state_hint().
8665  *
8666  * If the @value GVariant is floating, it is consumed.
8667  *
8668  * Since: 2.30
8669  */
8670
8671
8672 /**
8673  * g_action_get_enabled:
8674  * @action: a #GAction
8675  *
8676  * Checks if @action is currently enabled.
8677  *
8678  * An action must be enabled in order to be activated or in order to
8679  * have its state changed from outside callers.
8680  *
8681  * Returns: whether the action is enabled
8682  * Since: 2.28
8683  */
8684
8685
8686 /**
8687  * g_action_get_name:
8688  * @action: a #GAction
8689  *
8690  * Queries the name of @action.
8691  *
8692  * Returns: the name of the action
8693  * Since: 2.28
8694  */
8695
8696
8697 /**
8698  * g_action_get_parameter_type:
8699  * @action: a #GAction
8700  *
8701  * Queries the type of the parameter that must be given when activating
8702  * @action.
8703  *
8704  * When activating the action using g_action_activate(), the #GVariant
8705  * given to that function must be of the type returned by this function.
8706  *
8707  * In the case that this function returns %NULL, you must not give any
8708  * #GVariant, but %NULL instead.
8709  *
8710  * Returns: (allow-none): the parameter type
8711  * Since: 2.28
8712  */
8713
8714
8715 /**
8716  * g_action_get_state:
8717  * @action: a #GAction
8718  *
8719  * Queries the current state of @action.
8720  *
8721  * If the action is not stateful then %NULL will be returned.  If the
8722  * action is stateful then the type of the return value is the type
8723  * given by g_action_get_state_type().
8724  *
8725  * The return value (if non-%NULL) should be freed with
8726  * g_variant_unref() when it is no longer required.
8727  *
8728  * Returns: (transfer full): the current state of the action
8729  * Since: 2.28
8730  */
8731
8732
8733 /**
8734  * g_action_get_state_hint:
8735  * @action: a #GAction
8736  *
8737  * Requests a hint about the valid range of values for the state of
8738  * @action.
8739  *
8740  * If %NULL is returned it either means that the action is not stateful
8741  * or that there is no hint about the valid range of values for the
8742  * state of the action.
8743  *
8744  * If a #GVariant array is returned then each item in the array is a
8745  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8746  * returned then the tuple specifies the inclusive lower and upper bound
8747  * of valid values for the state.
8748  *
8749  * In any case, the information is merely a hint.  It may be possible to
8750  * have a state value outside of the hinted range and setting a value
8751  * within the range may fail.
8752  *
8753  * The return value (if non-%NULL) should be freed with
8754  * g_variant_unref() when it is no longer required.
8755  *
8756  * Returns: (transfer full): the state range hint
8757  * Since: 2.28
8758  */
8759
8760
8761 /**
8762  * g_action_get_state_type:
8763  * @action: a #GAction
8764  *
8765  * Queries the type of the state of @action.
8766  *
8767  * If the action is stateful (e.g. created with
8768  * g_simple_action_new_stateful()) then this function returns the
8769  * #GVariantType of the state.  This is the type of the initial value
8770  * given as the state. All calls to g_action_change_state() must give a
8771  * #GVariant of this type and g_action_get_state() will return a
8772  * #GVariant of the same type.
8773  *
8774  * If the action is not stateful (e.g. created with g_simple_action_new())
8775  * then this function will return %NULL. In that case, g_action_get_state()
8776  * will return %NULL and you must not call g_action_change_state().
8777  *
8778  * Returns: (allow-none): the state type, if the action is stateful
8779  * Since: 2.28
8780  */
8781
8782
8783 /**
8784  * g_action_group_action_added:
8785  * @action_group: a #GActionGroup
8786  * @action_name: the name of an action in the group
8787  *
8788  * Emits the #GActionGroup::action-added signal on @action_group.
8789  *
8790  * This function should only be called by #GActionGroup implementations.
8791  *
8792  * Since: 2.28
8793  */
8794
8795
8796 /**
8797  * g_action_group_action_enabled_changed:
8798  * @action_group: a #GActionGroup
8799  * @action_name: the name of an action in the group
8800  * @enabled: whether or not the action is now enabled
8801  *
8802  * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8803  *
8804  * This function should only be called by #GActionGroup implementations.
8805  *
8806  * Since: 2.28
8807  */
8808
8809
8810 /**
8811  * g_action_group_action_removed:
8812  * @action_group: a #GActionGroup
8813  * @action_name: the name of an action in the group
8814  *
8815  * Emits the #GActionGroup::action-removed signal on @action_group.
8816  *
8817  * This function should only be called by #GActionGroup implementations.
8818  *
8819  * Since: 2.28
8820  */
8821
8822
8823 /**
8824  * g_action_group_action_state_changed:
8825  * @action_group: a #GActionGroup
8826  * @action_name: the name of an action in the group
8827  * @state: the new state of the named action
8828  *
8829  * Emits the #GActionGroup::action-state-changed signal on @action_group.
8830  *
8831  * This function should only be called by #GActionGroup implementations.
8832  *
8833  * Since: 2.28
8834  */
8835
8836
8837 /**
8838  * g_action_group_activate_action:
8839  * @action_group: a #GActionGroup
8840  * @action_name: the name of the action to activate
8841  * @parameter: (allow-none): parameters to the activation
8842  *
8843  * Activate the named action within @action_group.
8844  *
8845  * If the action is expecting a parameter, then the correct type of
8846  * parameter must be given as @parameter.  If the action is expecting no
8847  * parameters then @parameter must be %NULL.  See
8848  * g_action_group_get_action_parameter_type().
8849  *
8850  * Since: 2.28
8851  */
8852
8853
8854 /**
8855  * g_action_group_change_action_state:
8856  * @action_group: a #GActionGroup
8857  * @action_name: the name of the action to request the change on
8858  * @value: the new state
8859  *
8860  * Request for the state of the named action within @action_group to be
8861  * changed to @value.
8862  *
8863  * The action must be stateful and @value must be of the correct type.
8864  * See g_action_group_get_action_state_type().
8865  *
8866  * This call merely requests a change.  The action may refuse to change
8867  * its state or may change its state to something other than @value.
8868  * See g_action_group_get_action_state_hint().
8869  *
8870  * If the @value GVariant is floating, it is consumed.
8871  *
8872  * Since: 2.28
8873  */
8874
8875
8876 /**
8877  * g_action_group_get_action_enabled:
8878  * @action_group: a #GActionGroup
8879  * @action_name: the name of the action to query
8880  *
8881  * Checks if the named action within @action_group is currently enabled.
8882  *
8883  * An action must be enabled in order to be activated or in order to
8884  * have its state changed from outside callers.
8885  *
8886  * Returns: whether or not the action is currently enabled
8887  * Since: 2.28
8888  */
8889
8890
8891 /**
8892  * g_action_group_get_action_parameter_type:
8893  * @action_group: a #GActionGroup
8894  * @action_name: the name of the action to query
8895  *
8896  * Queries the type of the parameter that must be given when activating
8897  * the named action within @action_group.
8898  *
8899  * When activating the action using g_action_group_activate_action(),
8900  * the #GVariant given to that function must be of the type returned
8901  * by this function.
8902  *
8903  * In the case that this function returns %NULL, you must not give any
8904  * #GVariant, but %NULL instead.
8905  *
8906  * The parameter type of a particular action will never change but it is
8907  * possible for an action to be removed and for a new action to be added
8908  * with the same name but a different parameter type.
8909  *
8910  * Returns: the parameter type
8911  * Since: 2.28
8912  */
8913
8914
8915 /**
8916  * g_action_group_get_action_state:
8917  * @action_group: a #GActionGroup
8918  * @action_name: the name of the action to query
8919  *
8920  * Queries the current state of the named action within @action_group.
8921  *
8922  * If the action is not stateful then %NULL will be returned.  If the
8923  * action is stateful then the type of the return value is the type
8924  * given by g_action_group_get_action_state_type().
8925  *
8926  * The return value (if non-%NULL) should be freed with
8927  * g_variant_unref() when it is no longer required.
8928  *
8929  * Returns: (allow-none): the current state of the action
8930  * Since: 2.28
8931  */
8932
8933
8934 /**
8935  * g_action_group_get_action_state_hint:
8936  * @action_group: a #GActionGroup
8937  * @action_name: the name of the action to query
8938  *
8939  * Requests a hint about the valid range of values for the state of the
8940  * named action within @action_group.
8941  *
8942  * If %NULL is returned it either means that the action is not stateful
8943  * or that there is no hint about the valid range of values for the
8944  * state of the action.
8945  *
8946  * If a #GVariant array is returned then each item in the array is a
8947  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8948  * returned then the tuple specifies the inclusive lower and upper bound
8949  * of valid values for the state.
8950  *
8951  * In any case, the information is merely a hint.  It may be possible to
8952  * have a state value outside of the hinted range and setting a value
8953  * within the range may fail.
8954  *
8955  * The return value (if non-%NULL) should be freed with
8956  * g_variant_unref() when it is no longer required.
8957  *
8958  * Returns: (transfer full): the state range hint
8959  * Since: 2.28
8960  */
8961
8962
8963 /**
8964  * g_action_group_get_action_state_type:
8965  * @action_group: a #GActionGroup
8966  * @action_name: the name of the action to query
8967  *
8968  * Queries the type of the state of the named action within
8969  * @action_group.
8970  *
8971  * If the action is stateful then this function returns the
8972  * #GVariantType of the state.  All calls to
8973  * g_action_group_change_action_state() must give a #GVariant of this
8974  * type and g_action_group_get_action_state() will return a #GVariant
8975  * of the same type.
8976  *
8977  * If the action is not stateful then this function will return %NULL.
8978  * In that case, g_action_group_get_action_state() will return %NULL
8979  * and you must not call g_action_group_change_action_state().
8980  *
8981  * The state type of a particular action will never change but it is
8982  * possible for an action to be removed and for a new action to be added
8983  * with the same name but a different state type.
8984  *
8985  * Returns: (transfer full): the state type, if the action is stateful
8986  * Since: 2.28
8987  */
8988
8989
8990 /**
8991  * g_action_group_has_action:
8992  * @action_group: a #GActionGroup
8993  * @action_name: the name of the action to check for
8994  *
8995  * Checks if the named action exists within @action_group.
8996  *
8997  * Returns: whether the named action exists
8998  * Since: 2.28
8999  */
9000
9001
9002 /**
9003  * g_action_group_list_actions:
9004  * @action_group: a #GActionGroup
9005  *
9006  * Lists the actions contained within @action_group.
9007  *
9008  * The caller is responsible for freeing the list with g_strfreev() when
9009  * it is no longer required.
9010  *
9011  * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
9012  * Since: 2.28
9013  */
9014
9015
9016 /**
9017  * g_action_group_query_action:
9018  * @action_group: a #GActionGroup
9019  * @action_name: the name of an action in the group
9020  * @enabled: (out): if the action is presently enabled
9021  * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
9022  * @state_type: (out) (allow-none): the state type, or %NULL if stateless
9023  * @state_hint: (out) (allow-none): the state hint, or %NULL if none
9024  * @state: (out) (allow-none): the current state, or %NULL if stateless
9025  *
9026  * Queries all aspects of the named action within an @action_group.
9027  *
9028  * This function acquires the information available from
9029  * g_action_group_has_action(), g_action_group_get_action_enabled(),
9030  * g_action_group_get_action_parameter_type(),
9031  * g_action_group_get_action_state_type(),
9032  * g_action_group_get_action_state_hint() and
9033  * g_action_group_get_action_state() with a single function call.
9034  *
9035  * This provides two main benefits.
9036  *
9037  * The first is the improvement in efficiency that comes with not having
9038  * to perform repeated lookups of the action in order to discover
9039  * different things about it.  The second is that implementing
9040  * #GActionGroup can now be done by only overriding this one virtual
9041  * function.
9042  *
9043  * The interface provides a default implementation of this function that
9044  * calls the individual functions, as required, to fetch the
9045  * information.  The interface also provides default implementations of
9046  * those functions that call this function.  All implementations,
9047  * therefore, must override either this function or all of the others.
9048  *
9049  * If the action exists, %TRUE is returned and any of the requested
9050  * fields (as indicated by having a non-%NULL reference passed in) are
9051  * filled.  If the action doesn't exist, %FALSE is returned and the
9052  * fields may or may not have been modified.
9053  *
9054  * Returns: %TRUE if the action exists, else %FALSE
9055  * Since: 2.32
9056  */
9057
9058
9059 /**
9060  * g_action_map_add_action:
9061  * @action_map: a #GActionMap
9062  * @action: a #GAction
9063  *
9064  * Adds an action to the @action_map.
9065  *
9066  * If the action map already contains an action with the same name
9067  * as @action then the old action is dropped from the action map.
9068  *
9069  * The action map takes its own reference on @action.
9070  *
9071  * Since: 2.32
9072  */
9073
9074
9075 /**
9076  * g_action_map_add_action_entries:
9077  * @action_map: a #GActionMap
9078  * @entries: a pointer to the first item in an array of #GActionEntry structs
9079  * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
9080  * @user_data: the user data for signal connections
9081  *
9082  * A convenience function for creating multiple #GSimpleAction instances
9083  * and adding them to a #GActionMap.
9084  *
9085  * Each action is constructed as per one #GActionEntry.
9086  *
9087  * <example>
9088  * <title>Using g_action_map_add_action_entries()</title>
9089  * <programlisting>
9090  * static void
9091  * activate_quit (GSimpleAction *simple,
9092  *                GVariant      *parameter,
9093  *                gpointer       user_data)
9094  * {
9095  *   exit (0);
9096  * }
9097  *
9098  * static void
9099  * activate_print_string (GSimpleAction *simple,
9100  *                        GVariant      *parameter,
9101  *                        gpointer       user_data)
9102  * {
9103  *   g_print ("%s\n", g_variant_get_string (parameter, NULL));
9104  * }
9105  *
9106  * static GActionGroup *
9107  * create_action_group (void)
9108  * {
9109  *   const GActionEntry entries[] = {
9110  *     { "quit",         activate_quit              },
9111  *     { "print-string", activate_print_string, "s" }
9112  *   };
9113  *   GSimpleActionGroup *group;
9114  *
9115  *   group = g_simple_action_group_new ();
9116  *   g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
9117  *
9118  *   return G_ACTION_GROUP (group);
9119  * }
9120  * </programlisting>
9121  * </example>
9122  *
9123  * Since: 2.32
9124  */
9125
9126
9127 /**
9128  * g_action_map_lookup_action:
9129  * @action_map: a #GActionMap
9130  * @action_name: the name of an action
9131  *
9132  * Looks up the action with the name @action_name in @action_map.
9133  *
9134  * If no such action exists, returns %NULL.
9135  *
9136  * Returns: (transfer none): a #GAction, or %NULL
9137  * Since: 2.32
9138  */
9139
9140
9141 /**
9142  * g_action_map_remove_action:
9143  * @action_map: a #GActionMap
9144  * @action_name: the name of the action
9145  *
9146  * Removes the named action from the action map.
9147  *
9148  * If no action of this name is in the map then nothing happens.
9149  *
9150  * Since: 2.32
9151  */
9152
9153
9154 /**
9155  * g_app_info_add_supports_type:
9156  * @appinfo: a #GAppInfo.
9157  * @content_type: a string.
9158  * @error: a #GError.
9159  *
9160  * Adds a content type to the application information to indicate the
9161  * application is capable of opening files with the given content type.
9162  *
9163  * Returns: %TRUE on success, %FALSE on error.
9164  */
9165
9166
9167 /**
9168  * g_app_info_can_delete:
9169  * @appinfo: a #GAppInfo
9170  *
9171  * Obtains the information whether the #GAppInfo can be deleted.
9172  * See g_app_info_delete().
9173  *
9174  * Returns: %TRUE if @appinfo can be deleted
9175  * Since: 2.20
9176  */
9177
9178
9179 /**
9180  * g_app_info_can_remove_supports_type:
9181  * @appinfo: a #GAppInfo.
9182  *
9183  * Checks if a supported content type can be removed from an application.
9184  *
9185  * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
9186  */
9187
9188
9189 /**
9190  * g_app_info_create_from_commandline:
9191  * @commandline: the commandline to use
9192  * @application_name: (allow-none): the application name, or %NULL to use @commandline
9193  * @flags: flags that can specify details of the created #GAppInfo
9194  * @error: a #GError location to store the error occurring, %NULL to ignore.
9195  *
9196  * Creates a new #GAppInfo from the given information.
9197  *
9198  * Note that for @commandline, the quoting rules of the Exec key of the
9199  * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
9200  * Entry Specification</ulink> are applied. For example, if the @commandline contains
9201  * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
9202  * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
9203  *
9204  * Returns: (transfer full): new #GAppInfo for given command.
9205  */
9206
9207
9208 /**
9209  * g_app_info_delete:
9210  * @appinfo: a #GAppInfo
9211  *
9212  * Tries to delete a #GAppInfo.
9213  *
9214  * On some platforms, there may be a difference between user-defined
9215  * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
9216  * cannot. See g_app_info_can_delete().
9217  *
9218  * Virtual: do_delete
9219  * Returns: %TRUE if @appinfo has been deleted
9220  * Since: 2.20
9221  */
9222
9223
9224 /**
9225  * g_app_info_dup:
9226  * @appinfo: a #GAppInfo.
9227  *
9228  * Creates a duplicate of a #GAppInfo.
9229  *
9230  * Returns: (transfer full): a duplicate of @appinfo.
9231  */
9232
9233
9234 /**
9235  * g_app_info_equal:
9236  * @appinfo1: the first #GAppInfo.
9237  * @appinfo2: the second #GAppInfo.
9238  *
9239  * Checks if two #GAppInfo<!-- -->s are equal.
9240  *
9241  * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
9242  */
9243
9244
9245 /**
9246  * g_app_info_get_all:
9247  *
9248  * Gets a list of all of the applications currently registered
9249  * on this system.
9250  *
9251  * For desktop files, this includes applications that have
9252  * <literal>NoDisplay=true</literal> set or are excluded from
9253  * display by means of <literal>OnlyShowIn</literal> or
9254  * <literal>NotShowIn</literal>. See g_app_info_should_show().
9255  * The returned list does not include applications which have
9256  * the <literal>Hidden</literal> key set.
9257  *
9258  * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
9259  */
9260
9261
9262 /**
9263  * g_app_info_get_all_for_type:
9264  * @content_type: the content type to find a #GAppInfo for
9265  *
9266  * Gets a list of all #GAppInfos for a given content type,
9267  * including the recommended and fallback #GAppInfos. See
9268  * g_app_info_get_recommended_for_type() and
9269  * g_app_info_get_fallback_for_type().
9270  *
9271  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9272  */
9273
9274
9275 /**
9276  * g_app_info_get_commandline:
9277  * @appinfo: a #GAppInfo
9278  *
9279  * Gets the commandline with which the application will be
9280  * started.
9281  *
9282  * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
9283  * Since: 2.20
9284  */
9285
9286
9287 /**
9288  * g_app_info_get_default_for_type:
9289  * @content_type: the content type to find a #GAppInfo for
9290  * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
9291  *
9292  * Gets the default #GAppInfo for a given content type.
9293  *
9294  * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
9295  */
9296
9297
9298 /**
9299  * g_app_info_get_default_for_uri_scheme:
9300  * @uri_scheme: a string containing a URI scheme.
9301  *
9302  * Gets the default application for handling URIs with
9303  * the given URI scheme. A URI scheme is the initial part
9304  * of the URI, up to but not including the ':', e.g. "http",
9305  * "ftp" or "sip".
9306  *
9307  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
9308  */
9309
9310
9311 /**
9312  * g_app_info_get_description:
9313  * @appinfo: a #GAppInfo.
9314  *
9315  * Gets a human-readable description of an installed application.
9316  *
9317  * Returns: a string containing a description of the application @appinfo, or %NULL if none.
9318  */
9319
9320
9321 /**
9322  * g_app_info_get_display_name:
9323  * @appinfo: a #GAppInfo.
9324  *
9325  * Gets the display name of the application. The display name is often more
9326  * descriptive to the user than the name itself.
9327  *
9328  * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9329  * Since: 2.24
9330  */
9331
9332
9333 /**
9334  * g_app_info_get_executable:
9335  * @appinfo: a #GAppInfo
9336  *
9337  * Gets the executable's name for the installed application.
9338  *
9339  * Returns: a string containing the @appinfo's application binaries name
9340  */
9341
9342
9343 /**
9344  * g_app_info_get_fallback_for_type:
9345  * @content_type: the content type to find a #GAppInfo for
9346  *
9347  * Gets a list of fallback #GAppInfos for a given content type, i.e.
9348  * those applications which claim to support the given content type
9349  * by MIME type subclassing and not directly.
9350  *
9351  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9352  * Since: 2.28
9353  */
9354
9355
9356 /**
9357  * g_app_info_get_icon:
9358  * @appinfo: a #GAppInfo.
9359  *
9360  * Gets the icon for the application.
9361  *
9362  * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9363  */
9364
9365
9366 /**
9367  * g_app_info_get_id:
9368  * @appinfo: a #GAppInfo.
9369  *
9370  * Gets the ID of an application. An id is a string that
9371  * identifies the application. The exact format of the id is
9372  * platform dependent. For instance, on Unix this is the
9373  * desktop file id from the xdg menu specification.
9374  *
9375  * Note that the returned ID may be %NULL, depending on how
9376  * the @appinfo has been constructed.
9377  *
9378  * Returns: a string containing the application's ID.
9379  */
9380
9381
9382 /**
9383  * g_app_info_get_name:
9384  * @appinfo: a #GAppInfo.
9385  *
9386  * Gets the installed name of the application.
9387  *
9388  * Returns: the name of the application for @appinfo.
9389  */
9390
9391
9392 /**
9393  * g_app_info_get_recommended_for_type:
9394  * @content_type: the content type to find a #GAppInfo for
9395  *
9396  * Gets a list of recommended #GAppInfos for a given content type, i.e.
9397  * those applications which claim to support the given content type exactly,
9398  * and not by MIME type subclassing.
9399  * Note that the first application of the list is the last used one, i.e.
9400  * the last one for which g_app_info_set_as_last_used_for_type() has been
9401  * called.
9402  *
9403  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9404  * Since: 2.28
9405  */
9406
9407
9408 /**
9409  * g_app_info_get_supported_types:
9410  * @info: a #GAppInfo that can handle files
9411  *
9412  * Retrieves the list of content types that @app_info claims to support.
9413  * If this information is not provided by the environment, this function
9414  * will return %NULL.
9415  * This function does not take in consideration associations added with
9416  * g_app_info_add_supports_type(), but only those exported directly by
9417  * the application.
9418  *
9419  * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
9420  * Since: 2.34
9421  */
9422
9423
9424 /**
9425  * g_app_info_launch:
9426  * @appinfo: a #GAppInfo
9427  * @files: (element-type GFile): a #GList of #GFile objects
9428  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9429  * @error: a #GError
9430  *
9431  * Launches the application. Passes @files to the launched application
9432  * as arguments, using the optional @launch_context to get information
9433  * about the details of the launcher (like what screen it is on).
9434  * On error, @error will be set accordingly.
9435  *
9436  * To launch the application without arguments pass a %NULL @files list.
9437  *
9438  * Note that even if the launch is successful the application launched
9439  * can fail to start if it runs into problems during startup. There is
9440  * no way to detect this.
9441  *
9442  * Some URIs can be changed when passed through a GFile (for instance
9443  * unsupported URIs with strange formats like mailto:), so if you have
9444  * a textual URI you want to pass in as argument, consider using
9445  * g_app_info_launch_uris() instead.
9446  *
9447  * The launched application inherits the environment of the launching
9448  * process, but it can be modified with g_app_launch_context_setenv() and
9449  * g_app_launch_context_unsetenv().
9450  *
9451  * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
9452  * environment variable with the path of the launched desktop file and
9453  * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
9454  * id of the launched process. This can be used to ignore
9455  * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
9456  * by further processes. The <envar>DISPLAY</envar> and
9457  * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
9458  * set, based on information provided in @launch_context.
9459  *
9460  * Returns: %TRUE on successful launch, %FALSE otherwise.
9461  */
9462
9463
9464 /**
9465  * g_app_info_launch_default_for_uri:
9466  * @uri: the uri to show
9467  * @launch_context: (allow-none): an optional #GAppLaunchContext.
9468  * @error: a #GError.
9469  *
9470  * Utility function that launches the default application
9471  * registered to handle the specified uri. Synchronous I/O
9472  * is done on the uri to detect the type of the file if
9473  * required.
9474  *
9475  * Returns: %TRUE on success, %FALSE on error.
9476  */
9477
9478
9479 /**
9480  * g_app_info_launch_uris:
9481  * @appinfo: a #GAppInfo
9482  * @uris: (element-type utf8): a #GList containing URIs to launch.
9483  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9484  * @error: a #GError
9485  *
9486  * Launches the application. This passes the @uris to the launched application
9487  * as arguments, using the optional @launch_context to get information
9488  * about the details of the launcher (like what screen it is on).
9489  * On error, @error will be set accordingly.
9490  *
9491  * To launch the application without arguments pass a %NULL @uris list.
9492  *
9493  * Note that even if the launch is successful the application launched
9494  * can fail to start if it runs into problems during startup. There is
9495  * no way to detect this.
9496  *
9497  * Returns: %TRUE on successful launch, %FALSE otherwise.
9498  */
9499
9500
9501 /**
9502  * g_app_info_remove_supports_type:
9503  * @appinfo: a #GAppInfo.
9504  * @content_type: a string.
9505  * @error: a #GError.
9506  *
9507  * Removes a supported type from an application, if possible.
9508  *
9509  * Returns: %TRUE on success, %FALSE on error.
9510  */
9511
9512
9513 /**
9514  * g_app_info_reset_type_associations:
9515  * @content_type: a content type
9516  *
9517  * Removes all changes to the type associations done by
9518  * g_app_info_set_as_default_for_type(),
9519  * g_app_info_set_as_default_for_extension(),
9520  * g_app_info_add_supports_type() or
9521  * g_app_info_remove_supports_type().
9522  *
9523  * Since: 2.20
9524  */
9525
9526
9527 /**
9528  * g_app_info_set_as_default_for_extension:
9529  * @appinfo: a #GAppInfo.
9530  * @extension: a string containing the file extension (without the dot).
9531  * @error: a #GError.
9532  *
9533  * Sets the application as the default handler for the given file extension.
9534  *
9535  * Returns: %TRUE on success, %FALSE on error.
9536  */
9537
9538
9539 /**
9540  * g_app_info_set_as_default_for_type:
9541  * @appinfo: a #GAppInfo.
9542  * @content_type: the content type.
9543  * @error: a #GError.
9544  *
9545  * Sets the application as the default handler for a given type.
9546  *
9547  * Returns: %TRUE on success, %FALSE on error.
9548  */
9549
9550
9551 /**
9552  * g_app_info_set_as_last_used_for_type:
9553  * @appinfo: a #GAppInfo.
9554  * @content_type: the content type.
9555  * @error: a #GError.
9556  *
9557  * Sets the application as the last used application for a given type.
9558  * This will make the application appear as first in the list returned
9559  * by g_app_info_get_recommended_for_type(), regardless of the default
9560  * application for that content type.
9561  *
9562  * Returns: %TRUE on success, %FALSE on error.
9563  */
9564
9565
9566 /**
9567  * g_app_info_should_show:
9568  * @appinfo: a #GAppInfo.
9569  *
9570  * Checks if the application info should be shown in menus that
9571  * list available applications.
9572  *
9573  * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
9574  */
9575
9576
9577 /**
9578  * g_app_info_supports_files:
9579  * @appinfo: a #GAppInfo.
9580  *
9581  * Checks if the application accepts files as arguments.
9582  *
9583  * Returns: %TRUE if the @appinfo supports files.
9584  */
9585
9586
9587 /**
9588  * g_app_info_supports_uris:
9589  * @appinfo: a #GAppInfo.
9590  *
9591  * Checks if the application supports reading files and directories from URIs.
9592  *
9593  * Returns: %TRUE if the @appinfo supports URIs.
9594  */
9595
9596
9597 /**
9598  * g_app_launch_context_get_display:
9599  * @context: a #GAppLaunchContext
9600  * @info: a #GAppInfo
9601  * @files: (element-type GFile): a #GList of #GFile objects
9602  *
9603  * Gets the display string for the @context. This is used to ensure new
9604  * applications are started on the same display as the launching
9605  * application, by setting the <envar>DISPLAY</envar> environment variable.
9606  *
9607  * Returns: a display string for the display.
9608  */
9609
9610
9611 /**
9612  * g_app_launch_context_get_environment:
9613  * @context: a #GAppLaunchContext
9614  *
9615  * Gets the complete environment variable list to be passed to
9616  * the child process when @context is used to launch an application.
9617  * This is a %NULL-terminated array of strings, where each string has
9618  * the form <literal>KEY=VALUE</literal>.
9619  *
9620  * Returns: (array zero-terminated=1) (transfer full): the child's environment
9621  * Since: 2.32
9622  */
9623
9624
9625 /**
9626  * g_app_launch_context_get_startup_notify_id:
9627  * @context: a #GAppLaunchContext
9628  * @info: a #GAppInfo
9629  * @files: (element-type GFile): a #GList of of #GFile objects
9630  *
9631  * Initiates startup notification for the application and returns the
9632  * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
9633  * if supported.
9634  *
9635  * Startup notification IDs are defined in the <ulink
9636  * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
9637  * FreeDesktop.Org Startup Notifications standard</ulink>.
9638  *
9639  * Returns: a startup notification ID for the application, or %NULL if not supported.
9640  */
9641
9642
9643 /**
9644  * g_app_launch_context_launch_failed:
9645  * @context: a #GAppLaunchContext.
9646  * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
9647  *
9648  * Called when an application has failed to launch, so that it can cancel
9649  * the application startup notification started in g_app_launch_context_get_startup_notify_id().
9650  */
9651
9652
9653 /**
9654  * g_app_launch_context_new:
9655  *
9656  * Creates a new application launch context. This is not normally used,
9657  * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
9658  *
9659  * Returns: a #GAppLaunchContext.
9660  */
9661
9662
9663 /**
9664  * g_app_launch_context_setenv:
9665  * @context: a #GAppLaunchContext
9666  * @variable: the environment variable to set
9667  * @value: the value for to set the variable to.
9668  *
9669  * Arranges for @variable to be set to @value in the child's
9670  * environment when @context is used to launch an application.
9671  *
9672  * Since: 2.32
9673  */
9674
9675
9676 /**
9677  * g_app_launch_context_unsetenv:
9678  * @context: a #GAppLaunchContext
9679  * @variable: the environment variable to remove
9680  *
9681  * Arranges for @variable to be unset in the child's environment
9682  * when @context is used to launch an application.
9683  *
9684  * Since: 2.32
9685  */
9686
9687
9688 /**
9689  * g_application_activate:
9690  * @application: a #GApplication
9691  *
9692  * Activates the application.
9693  *
9694  * In essence, this results in the #GApplication::activate signal being
9695  * emitted in the primary instance.
9696  *
9697  * The application must be registered before calling this function.
9698  *
9699  * Since: 2.28
9700  */
9701
9702
9703 /**
9704  * g_application_command_line_get_arguments:
9705  * @cmdline: a #GApplicationCommandLine
9706  * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9707  *
9708  * Gets the list of arguments that was passed on the command line.
9709  *
9710  * The strings in the array may contain non-utf8 data.
9711  *
9712  * The return value is %NULL-terminated and should be freed using
9713  * g_strfreev().
9714  *
9715  * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9716  * Since: 2.28
9717  */
9718
9719
9720 /**
9721  * g_application_command_line_get_cwd:
9722  * @cmdline: a #GApplicationCommandLine
9723  *
9724  * Gets the working directory of the command line invocation.
9725  * The string may contain non-utf8 data.
9726  *
9727  * It is possible that the remote application did not send a working
9728  * directory, so this may be %NULL.
9729  *
9730  * The return value should not be modified or freed and is valid for as
9731  * long as @cmdline exists.
9732  *
9733  * Returns: the current directory, or %NULL
9734  * Since: 2.28
9735  */
9736
9737
9738 /**
9739  * g_application_command_line_get_environ:
9740  * @cmdline: a #GApplicationCommandLine
9741  *
9742  * Gets the contents of the 'environ' variable of the command line
9743  * invocation, as would be returned by g_get_environ(), ie as a
9744  * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9745  * The strings may contain non-utf8 data.
9746  *
9747  * The remote application usually does not send an environment.  Use
9748  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9749  * set it is possible that the environment is still not available (due
9750  * to invocation messages from other applications).
9751  *
9752  * The return value should not be modified or freed and is valid for as
9753  * long as @cmdline exists.
9754  *
9755  * See g_application_command_line_getenv() if you are only interested
9756  * in the value of a single environment variable.
9757  *
9758  * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9759  * Since: 2.28
9760  */
9761
9762
9763 /**
9764  * g_application_command_line_get_exit_status:
9765  * @cmdline: a #GApplicationCommandLine
9766  *
9767  * Gets the exit status of @cmdline.  See
9768  * g_application_command_line_set_exit_status() for more information.
9769  *
9770  * Returns: the exit status
9771  * Since: 2.28
9772  */
9773
9774
9775 /**
9776  * g_application_command_line_get_is_remote:
9777  * @cmdline: a #GApplicationCommandLine
9778  *
9779  * Determines if @cmdline represents a remote invocation.
9780  *
9781  * Returns: %TRUE if the invocation was remote
9782  * Since: 2.28
9783  */
9784
9785
9786 /**
9787  * g_application_command_line_get_platform_data:
9788  * @cmdline: #GApplicationCommandLine
9789  *
9790  * Gets the platform data associated with the invocation of @cmdline.
9791  *
9792  * This is a #GVariant dictionary containing information about the
9793  * context in which the invocation occurred.  It typically contains
9794  * information like the current working directory and the startup
9795  * notification ID.
9796  *
9797  * For local invocation, it will be %NULL.
9798  *
9799  * Returns: (allow-none): the platform data, or %NULL
9800  * Since: 2.28
9801  */
9802
9803
9804 /**
9805  * g_application_command_line_getenv:
9806  * @cmdline: a #GApplicationCommandLine
9807  * @name: the environment variable to get
9808  *
9809  * Gets the value of a particular environment variable of the command
9810  * line invocation, as would be returned by g_getenv().  The strings may
9811  * contain non-utf8 data.
9812  *
9813  * The remote application usually does not send an environment.  Use
9814  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9815  * set it is possible that the environment is still not available (due
9816  * to invocation messages from other applications).
9817  *
9818  * The return value should not be modified or freed and is valid for as
9819  * long as @cmdline exists.
9820  *
9821  * Returns: the value of the variable, or %NULL if unset or unsent
9822  * Since: 2.28
9823  */
9824
9825
9826 /**
9827  * g_application_command_line_print:
9828  * @cmdline: a #GApplicationCommandLine
9829  * @format: a printf-style format string
9830  * @...: arguments, as per @format
9831  *
9832  * Formats a message and prints it using the stdout print handler in the
9833  * invoking process.
9834  *
9835  * If @cmdline is a local invocation then this is exactly equivalent to
9836  * g_print().  If @cmdline is remote then this is equivalent to calling
9837  * g_print() in the invoking process.
9838  *
9839  * Since: 2.28
9840  */
9841
9842
9843 /**
9844  * g_application_command_line_printerr:
9845  * @cmdline: a #GApplicationCommandLine
9846  * @format: a printf-style format string
9847  * @...: arguments, as per @format
9848  *
9849  * Formats a message and prints it using the stderr print handler in the
9850  * invoking process.
9851  *
9852  * If @cmdline is a local invocation then this is exactly equivalent to
9853  * g_printerr().  If @cmdline is remote then this is equivalent to
9854  * calling g_printerr() in the invoking process.
9855  *
9856  * Since: 2.28
9857  */
9858
9859
9860 /**
9861  * g_application_command_line_set_exit_status:
9862  * @cmdline: a #GApplicationCommandLine
9863  * @exit_status: the exit status
9864  *
9865  * Sets the exit status that will be used when the invoking process
9866  * exits.
9867  *
9868  * The return value of the #GApplication::command-line signal is
9869  * passed to this function when the handler returns.  This is the usual
9870  * way of setting the exit status.
9871  *
9872  * In the event that you want the remote invocation to continue running
9873  * and want to decide on the exit status in the future, you can use this
9874  * call.  For the case of a remote invocation, the remote process will
9875  * typically exit when the last reference is dropped on @cmdline.  The
9876  * exit status of the remote process will be equal to the last value
9877  * that was set with this function.
9878  *
9879  * In the case that the commandline invocation is local, the situation
9880  * is slightly more complicated.  If the commandline invocation results
9881  * in the mainloop running (ie: because the use-count of the application
9882  * increased to a non-zero value) then the application is considered to
9883  * have been 'successful' in a certain sense, and the exit status is
9884  * always zero.  If the application use count is zero, though, the exit
9885  * status of the local #GApplicationCommandLine is used.
9886  *
9887  * Since: 2.28
9888  */
9889
9890
9891 /**
9892  * g_application_get_application_id:
9893  * @application: a #GApplication
9894  *
9895  * Gets the unique identifier for @application.
9896  *
9897  * Returns: the identifier for @application, owned by @application
9898  * Since: 2.28
9899  */
9900
9901
9902 /**
9903  * g_application_get_dbus_connection:
9904  * @application: a #GApplication
9905  *
9906  * Gets the #GDBusConnection being used by the application, or %NULL.
9907  *
9908  * If #GApplication is using its D-Bus backend then this function will
9909  * return the #GDBusConnection being used for uniqueness and
9910  * communication with the desktop environment and other instances of the
9911  * application.
9912  *
9913  * If #GApplication is not using D-Bus then this function will return
9914  * %NULL.  This includes the situation where the D-Bus backend would
9915  * normally be in use but we were unable to connect to the bus.
9916  *
9917  * This function must not be called before the application has been
9918  * registered.  See g_application_get_is_registered().
9919  *
9920  * Returns: (transfer none): a #GDBusConnection, or %NULL
9921  * Since: 2.34
9922  */
9923
9924
9925 /**
9926  * g_application_get_dbus_object_path:
9927  * @application: a #GApplication
9928  *
9929  * Gets the D-Bus object path being used by the application, or %NULL.
9930  *
9931  * If #GApplication is using its D-Bus backend then this function will
9932  * return the D-Bus object path that #GApplication is using.  If the
9933  * application is the primary instance then there is an object published
9934  * at this path.  If the application is not the primary instance then
9935  * the result of this function is undefined.
9936  *
9937  * If #GApplication is not using D-Bus then this function will return
9938  * %NULL.  This includes the situation where the D-Bus backend would
9939  * normally be in use but we were unable to connect to the bus.
9940  *
9941  * This function must not be called before the application has been
9942  * registered.  See g_application_get_is_registered().
9943  *
9944  * Returns: the object path, or %NULL
9945  * Since: 2.34
9946  */
9947
9948
9949 /**
9950  * g_application_get_default:
9951  *
9952  * Returns the default #GApplication instance for this process.
9953  *
9954  * Normally there is only one #GApplication per process and it becomes
9955  * the default when it is created.  You can exercise more control over
9956  * this by using g_application_set_default().
9957  *
9958  * If there is no default application then %NULL is returned.
9959  *
9960  * Returns: (transfer none): the default application for this process, or %NULL
9961  * Since: 2.32
9962  */
9963
9964
9965 /**
9966  * g_application_get_flags:
9967  * @application: a #GApplication
9968  *
9969  * Gets the flags for @application.
9970  *
9971  * See #GApplicationFlags.
9972  *
9973  * Returns: the flags for @application
9974  * Since: 2.28
9975  */
9976
9977
9978 /**
9979  * g_application_get_inactivity_timeout:
9980  * @application: a #GApplication
9981  *
9982  * Gets the current inactivity timeout for the application.
9983  *
9984  * This is the amount of time (in milliseconds) after the last call to
9985  * g_application_release() before the application stops running.
9986  *
9987  * Returns: the timeout, in milliseconds
9988  * Since: 2.28
9989  */
9990
9991
9992 /**
9993  * g_application_get_is_registered:
9994  * @application: a #GApplication
9995  *
9996  * Checks if @application is registered.
9997  *
9998  * An application is registered if g_application_register() has been
9999  * successfully called.
10000  *
10001  * Returns: %TRUE if @application is registered
10002  * Since: 2.28
10003  */
10004
10005
10006 /**
10007  * g_application_get_is_remote:
10008  * @application: a #GApplication
10009  *
10010  * Checks if @application is remote.
10011  *
10012  * If @application is remote then it means that another instance of
10013  * application already exists (the 'primary' instance).  Calls to
10014  * perform actions on @application will result in the actions being
10015  * performed by the primary instance.
10016  *
10017  * The value of this property cannot be accessed before
10018  * g_application_register() has been called.  See
10019  * g_application_get_is_registered().
10020  *
10021  * Returns: %TRUE if @application is remote
10022  * Since: 2.28
10023  */
10024
10025
10026 /**
10027  * g_application_hold:
10028  * @application: a #GApplication
10029  *
10030  * Increases the use count of @application.
10031  *
10032  * Use this function to indicate that the application has a reason to
10033  * continue to run.  For example, g_application_hold() is called by GTK+
10034  * when a toplevel window is on the screen.
10035  *
10036  * To cancel the hold, call g_application_release().
10037  */
10038
10039
10040 /**
10041  * g_application_id_is_valid:
10042  * @application_id: a potential application identifier
10043  *
10044  * Checks if @application_id is a valid application identifier.
10045  *
10046  * A valid ID is required for calls to g_application_new() and
10047  * g_application_set_application_id().
10048  *
10049  * For convenience, the restrictions on application identifiers are
10050  * reproduced here:
10051  * <itemizedlist>
10052  *   <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
10053  *   <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
10054  *   <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
10055  *   <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
10056  *   <listitem>Application identifiers must not exceed 255 characters.</listitem>
10057  * </itemizedlist>
10058  *
10059  * Returns: %TRUE if @application_id is valid
10060  */
10061
10062
10063 /**
10064  * g_application_new:
10065  * @application_id: (allow-none): the application id
10066  * @flags: the application flags
10067  *
10068  * Creates a new #GApplication instance.
10069  *
10070  * This function calls g_type_init() for you.
10071  *
10072  * If non-%NULL, the application id must be valid.  See
10073  * g_application_id_is_valid().
10074  *
10075  * If no application ID is given then some features of #GApplication
10076  * (most notably application uniqueness) will be disabled.
10077  *
10078  * Returns: a new #GApplication instance
10079  */
10080
10081
10082 /**
10083  * g_application_open:
10084  * @application: a #GApplication
10085  * @files: (array length=n_files): an array of #GFiles to open
10086  * @n_files: the length of the @files array
10087  * @hint: a hint (or ""), but never %NULL
10088  *
10089  * Opens the given files.
10090  *
10091  * In essence, this results in the #GApplication::open signal being emitted
10092  * in the primary instance.
10093  *
10094  * @n_files must be greater than zero.
10095  *
10096  * @hint is simply passed through to the ::open signal.  It is
10097  * intended to be used by applications that have multiple modes for
10098  * opening files (eg: "view" vs "edit", etc).  Unless you have a need
10099  * for this functionality, you should use "".
10100  *
10101  * The application must be registered before calling this function
10102  * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
10103  *
10104  * Since: 2.28
10105  */
10106
10107
10108 /**
10109  * g_application_quit:
10110  * @application: a #GApplication
10111  *
10112  * Immediately quits the application.
10113  *
10114  * Upon return to the mainloop, g_application_run() will return,
10115  * calling only the 'shutdown' function before doing so.
10116  *
10117  * The hold count is ignored.
10118  *
10119  * The result of calling g_application_run() again after it returns is
10120  * unspecified.
10121  *
10122  * Since: 2.32
10123  */
10124
10125
10126 /**
10127  * g_application_register:
10128  * @application: a #GApplication
10129  * @cancellable: (allow-none): a #GCancellable, or %NULL
10130  * @error: a pointer to a NULL #GError, or %NULL
10131  *
10132  * Attempts registration of the application.
10133  *
10134  * This is the point at which the application discovers if it is the
10135  * primary instance or merely acting as a remote for an already-existing
10136  * primary instance.  This is implemented by attempting to acquire the
10137  * application identifier as a unique bus name on the session bus using
10138  * GDBus.
10139  *
10140  * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
10141  * given, then this process will always become the primary instance.
10142  *
10143  * Due to the internal architecture of GDBus, method calls can be
10144  * dispatched at any time (even if a main loop is not running).  For
10145  * this reason, you must ensure that any object paths that you wish to
10146  * register are registered before calling this function.
10147  *
10148  * If the application has already been registered then %TRUE is
10149  * returned with no work performed.
10150  *
10151  * The #GApplication::startup signal is emitted if registration succeeds
10152  * and @application is the primary instance (including the non-unique
10153  * case).
10154  *
10155  * In the event of an error (such as @cancellable being cancelled, or a
10156  * failure to connect to the session bus), %FALSE is returned and @error
10157  * is set appropriately.
10158  *
10159  * Note: the return value of this function is not an indicator that this
10160  * instance is or is not the primary instance of the application.  See
10161  * g_application_get_is_remote() for that.
10162  *
10163  * Returns: %TRUE if registration succeeded
10164  * Since: 2.28
10165  */
10166
10167
10168 /**
10169  * g_application_release:
10170  * @application: a #GApplication
10171  *
10172  * Decrease the use count of @application.
10173  *
10174  * When the use count reaches zero, the application will stop running.
10175  *
10176  * Never call this function except to cancel the effect of a previous
10177  * call to g_application_hold().
10178  */
10179
10180
10181 /**
10182  * g_application_run:
10183  * @application: a #GApplication
10184  * @argc: the argc from main() (or 0 if @argv is %NULL)
10185  * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
10186  *
10187  * Runs the application.
10188  *
10189  * This function is intended to be run from main() and its return value
10190  * is intended to be returned by main(). Although you are expected to pass
10191  * the @argc, @argv parameters from main() to this function, it is possible
10192  * to pass %NULL if @argv is not available or commandline handling is not
10193  * required.
10194  *
10195  * First, the local_command_line() virtual function is invoked.
10196  * This function always runs on the local instance. It gets passed a pointer
10197  * to a %NULL-terminated copy of @argv and is expected to remove the arguments
10198  * that it handled (shifting up remaining arguments). See
10199  * <xref linkend="gapplication-example-cmdline2"/> for an example of
10200  * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
10201  * after setting <literal>argc = g_strv_length (argv);</literal>.
10202  *
10203  * The last argument to local_command_line() is a pointer to the @status
10204  * variable which can used to set the exit status that is returned from
10205  * g_application_run().
10206  *
10207  * If local_command_line() returns %TRUE, the command line is expected
10208  * to be completely handled, including possibly registering as the primary
10209  * instance, calling g_application_activate() or g_application_open(), etc.
10210  *
10211  * If local_command_line() returns %FALSE then the application is registered
10212  * and the #GApplication::command-line signal is emitted in the primary
10213  * instance (which may or may not be this instance). The signal handler
10214  * gets passed a #GApplicationCommandLine object that (among other things)
10215  * contains the remaining commandline arguments that have not been handled
10216  * by local_command_line().
10217  *
10218  * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
10219  * flag set then the default implementation of local_command_line()
10220  * always returns %FALSE immediately, resulting in the commandline
10221  * always being handled in the primary instance.
10222  *
10223  * Otherwise, the default implementation of local_command_line() tries
10224  * to do a couple of things that are probably reasonable for most
10225  * applications.  First, g_application_register() is called to attempt
10226  * to register the application.  If that works, then the command line
10227  * arguments are inspected.  If no commandline arguments are given, then
10228  * g_application_activate() is called.  If commandline arguments are
10229  * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
10230  * are assumed to be filenames and g_application_open() is called.
10231  *
10232  * If you need to handle commandline arguments that are not filenames,
10233  * and you don't mind commandline handling to happen in the primary
10234  * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
10235  * process the commandline arguments in your #GApplication::command-line
10236  * signal handler, either manually or using the #GOptionContext API.
10237  *
10238  * If you are interested in doing more complicated local handling of the
10239  * commandline then you should implement your own #GApplication subclass
10240  * and override local_command_line(). In this case, you most likely want
10241  * to return %TRUE from your local_command_line() implementation to
10242  * suppress the default handling. See
10243  * <xref linkend="gapplication-example-cmdline2"/> for an example.
10244  *
10245  * If, after the above is done, the use count of the application is zero
10246  * then the exit status is returned immediately.  If the use count is
10247  * non-zero then the default main context is iterated until the use count
10248  * falls to zero, at which point 0 is returned.
10249  *
10250  * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
10251  * use count of zero is delayed for a while (ie: the instance stays
10252  * around to provide its <emphasis>service</emphasis> to others).
10253  *
10254  * Returns: the exit status
10255  * Since: 2.28
10256  */
10257
10258
10259 /**
10260  * g_application_set_action_group:
10261  * @application: a #GApplication
10262  * @action_group: (allow-none): a #GActionGroup, or %NULL
10263  *
10264  * This used to be how actions were associated with a #GApplication.
10265  * Now there is #GActionMap for that.
10266  *
10267  * Since: 2.28
10268  * 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.
10269  */
10270
10271
10272 /**
10273  * g_application_set_application_id:
10274  * @application: a #GApplication
10275  * @application_id: (allow-none): the identifier for @application
10276  *
10277  * Sets the unique identifier for @application.
10278  *
10279  * The application id can only be modified if @application has not yet
10280  * been registered.
10281  *
10282  * If non-%NULL, the application id must be valid.  See
10283  * g_application_id_is_valid().
10284  *
10285  * Since: 2.28
10286  */
10287
10288
10289 /**
10290  * g_application_set_default:
10291  * @application: (allow-none): the application to set as default, or %NULL
10292  *
10293  * Sets or unsets the default application for the process, as returned
10294  * by g_application_get_default().
10295  *
10296  * This function does not take its own reference on @application.  If
10297  * @application is destroyed then the default application will revert
10298  * back to %NULL.
10299  *
10300  * Since: 2.32
10301  */
10302
10303
10304 /**
10305  * g_application_set_flags:
10306  * @application: a #GApplication
10307  * @flags: the flags for @application
10308  *
10309  * Sets the flags for @application.
10310  *
10311  * The flags can only be modified if @application has not yet been
10312  * registered.
10313  *
10314  * See #GApplicationFlags.
10315  *
10316  * Since: 2.28
10317  */
10318
10319
10320 /**
10321  * g_application_set_inactivity_timeout:
10322  * @application: a #GApplication
10323  * @inactivity_timeout: the timeout, in milliseconds
10324  *
10325  * Sets the current inactivity timeout for the application.
10326  *
10327  * This is the amount of time (in milliseconds) after the last call to
10328  * g_application_release() before the application stops running.
10329  *
10330  * This call has no side effects of its own.  The value set here is only
10331  * used for next time g_application_release() drops the use count to
10332  * zero.  Any timeouts currently in progress are not impacted.
10333  *
10334  * Since: 2.28
10335  */
10336
10337
10338 /**
10339  * g_async_initable_init_async:
10340  * @initable: a #GAsyncInitable.
10341  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10342  * @cancellable: optional #GCancellable object, %NULL to ignore.
10343  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10344  * @user_data: the data to pass to callback function
10345  *
10346  * Starts asynchronous initialization of the object implementing the
10347  * interface. This must be done before any real use of the object after
10348  * initial construction. If the object also implements #GInitable you can
10349  * optionally call g_initable_init() instead.
10350  *
10351  * When the initialization is finished, @callback will be called. You can
10352  * then call g_async_initable_init_finish() to get the result of the
10353  * initialization.
10354  *
10355  * Implementations may also support cancellation. If @cancellable is not
10356  * %NULL, then initialization can be cancelled by triggering the cancellable
10357  * object from another thread. If the operation was cancelled, the error
10358  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10359  * the object doesn't support cancellable initialization, the error
10360  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10361  *
10362  * As with #GInitable, if the object is not initialized, or initialization
10363  * returns with an error, then all operations on the object except
10364  * g_object_ref() and g_object_unref() are considered to be invalid, and
10365  * have undefined behaviour. They will often fail with g_critical() or
10366  * g_warning(), but this must not be relied on.
10367  *
10368  * Implementations of this method must be idempotent: i.e. multiple calls
10369  * to this function with the same argument should return the same results.
10370  * Only the first call initializes the object; further calls return the result
10371  * of the first call. This is so that it's safe to implement the singleton
10372  * pattern in the GObject constructor function.
10373  *
10374  * For classes that also support the #GInitable interface, the default
10375  * implementation of this method will run the g_initable_init() function
10376  * in a thread, so if you want to support asynchronous initialization via
10377  * threads, just implement the #GAsyncInitable interface without overriding
10378  * any interface methods.
10379  *
10380  * Since: 2.22
10381  */
10382
10383
10384 /**
10385  * g_async_initable_init_finish:
10386  * @initable: a #GAsyncInitable.
10387  * @res: a #GAsyncResult.
10388  * @error: a #GError location to store the error occurring, or %NULL to ignore.
10389  *
10390  * Finishes asynchronous initialization and returns the result.
10391  * See g_async_initable_init_async().
10392  *
10393  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
10394  * Since: 2.22
10395  */
10396
10397
10398 /**
10399  * g_async_initable_new_async:
10400  * @object_type: a #GType supporting #GAsyncInitable.
10401  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10402  * @cancellable: optional #GCancellable object, %NULL to ignore.
10403  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10404  * @user_data: the data to pass to callback function
10405  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
10406  * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
10407  *
10408  * Helper function for constructing #GAsyncInitable object. This is
10409  * similar to g_object_new() but also initializes the object asynchronously.
10410  *
10411  * When the initialization is finished, @callback will be called. You can
10412  * then call g_async_initable_new_finish() to get the new object and check
10413  * for any errors.
10414  *
10415  * Since: 2.22
10416  */
10417
10418
10419 /**
10420  * g_async_initable_new_finish:
10421  * @initable: the #GAsyncInitable from the callback
10422  * @res: the #GAsyncResult from the callback
10423  * @error: return location for errors, or %NULL to ignore
10424  *
10425  * Finishes the async construction for the various g_async_initable_new
10426  * calls, returning the created object or %NULL on error.
10427  *
10428  * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
10429  * Since: 2.22
10430  */
10431
10432
10433 /**
10434  * g_async_initable_new_valist_async:
10435  * @object_type: a #GType supporting #GAsyncInitable.
10436  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
10437  * @var_args: The var args list generated from @first_property_name.
10438  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10439  * @cancellable: optional #GCancellable object, %NULL to ignore.
10440  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10441  * @user_data: the data to pass to callback function
10442  *
10443  * Helper function for constructing #GAsyncInitable object. This is
10444  * similar to g_object_new_valist() but also initializes the object
10445  * asynchronously.
10446  *
10447  * When the initialization is finished, @callback will be called. You can
10448  * then call g_async_initable_new_finish() to get the new object and check
10449  * for any errors.
10450  *
10451  * Since: 2.22
10452  */
10453
10454
10455 /**
10456  * g_async_initable_newv_async:
10457  * @object_type: a #GType supporting #GAsyncInitable.
10458  * @n_parameters: the number of parameters in @parameters
10459  * @parameters: the parameters to use to construct the object
10460  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10461  * @cancellable: optional #GCancellable object, %NULL to ignore.
10462  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10463  * @user_data: the data to pass to callback function
10464  *
10465  * Helper function for constructing #GAsyncInitable object. This is
10466  * similar to g_object_newv() but also initializes the object asynchronously.
10467  *
10468  * When the initialization is finished, @callback will be called. You can
10469  * then call g_async_initable_new_finish() to get the new object and check
10470  * for any errors.
10471  *
10472  * Since: 2.22
10473  */
10474
10475
10476 /**
10477  * g_async_result_get_source_object:
10478  * @res: a #GAsyncResult
10479  *
10480  * Gets the source object from a #GAsyncResult.
10481  *
10482  * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
10483  */
10484
10485
10486 /**
10487  * g_async_result_get_user_data:
10488  * @res: a #GAsyncResult.
10489  *
10490  * Gets the user data from a #GAsyncResult.
10491  *
10492  * Returns: (transfer full): the user data for @res.
10493  */
10494
10495
10496 /**
10497  * g_buffered_input_stream_fill:
10498  * @stream: a #GBufferedInputStream
10499  * @count: the number of bytes that will be read from the stream
10500  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10501  * @error: location to store the error occurring, or %NULL to ignore
10502  *
10503  * Tries to read @count bytes from the stream into the buffer.
10504  * Will block during this read.
10505  *
10506  * If @count is zero, returns zero and does nothing. A value of @count
10507  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
10508  *
10509  * On success, the number of bytes read into the buffer is returned.
10510  * It is not an error if this is not the same as the requested size, as it
10511  * can happen e.g. near the end of a file. Zero is returned on end of file
10512  * (or if @count is zero),  but never otherwise.
10513  *
10514  * If @count is -1 then the attempted read size is equal to the number of
10515  * bytes that are required to fill the buffer.
10516  *
10517  * If @cancellable is not %NULL, then the operation can be cancelled by
10518  * triggering the cancellable object from another thread. If the operation
10519  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10520  * operation was partially finished when the operation was cancelled the
10521  * partial result will be returned, without an error.
10522  *
10523  * On error -1 is returned and @error is set accordingly.
10524  *
10525  * For the asynchronous, non-blocking, version of this function, see
10526  * g_buffered_input_stream_fill_async().
10527  *
10528  * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
10529  */
10530
10531
10532 /**
10533  * g_buffered_input_stream_fill_async:
10534  * @stream: a #GBufferedInputStream
10535  * @count: the number of bytes that will be read from the stream
10536  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
10537  * @cancellable: (allow-none): optional #GCancellable object
10538  * @callback: (scope async): a #GAsyncReadyCallback
10539  * @user_data: (closure): a #gpointer
10540  *
10541  * Reads data into @stream's buffer asynchronously, up to @count size.
10542  * @io_priority can be used to prioritize reads. For the synchronous
10543  * version of this function, see g_buffered_input_stream_fill().
10544  *
10545  * If @count is -1 then the attempted read size is equal to the number
10546  * of bytes that are required to fill the buffer.
10547  */
10548
10549
10550 /**
10551  * g_buffered_input_stream_fill_finish:
10552  * @stream: a #GBufferedInputStream
10553  * @result: a #GAsyncResult
10554  * @error: a #GError
10555  *
10556  * Finishes an asynchronous read.
10557  *
10558  * Returns: a #gssize of the read stream, or %-1 on an error.
10559  */
10560
10561
10562 /**
10563  * g_buffered_input_stream_get_available:
10564  * @stream: #GBufferedInputStream
10565  *
10566  * Gets the size of the available data within the stream.
10567  *
10568  * Returns: size of the available stream.
10569  */
10570
10571
10572 /**
10573  * g_buffered_input_stream_get_buffer_size:
10574  * @stream: a #GBufferedInputStream
10575  *
10576  * Gets the size of the input buffer.
10577  *
10578  * Returns: the current buffer size.
10579  */
10580
10581
10582 /**
10583  * g_buffered_input_stream_new:
10584  * @base_stream: a #GInputStream
10585  *
10586  * Creates a new #GInputStream from the given @base_stream, with
10587  * a buffer set to the default size (4 kilobytes).
10588  *
10589  * Returns: a #GInputStream for the given @base_stream.
10590  */
10591
10592
10593 /**
10594  * g_buffered_input_stream_new_sized:
10595  * @base_stream: a #GInputStream
10596  * @size: a #gsize
10597  *
10598  * Creates a new #GBufferedInputStream from the given @base_stream,
10599  * with a buffer set to @size.
10600  *
10601  * Returns: a #GInputStream.
10602  */
10603
10604
10605 /**
10606  * g_buffered_input_stream_peek:
10607  * @stream: a #GBufferedInputStream
10608  * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10609  * @offset: a #gsize
10610  * @count: a #gsize
10611  *
10612  * Peeks in the buffer, copying data of size @count into @buffer,
10613  * offset @offset bytes.
10614  *
10615  * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10616  */
10617
10618
10619 /**
10620  * g_buffered_input_stream_peek_buffer:
10621  * @stream: a #GBufferedInputStream
10622  * @count: (out): a #gsize to get the number of bytes available in the buffer
10623  *
10624  * Returns the buffer with the currently available bytes. The returned
10625  * buffer must not be modified and will become invalid when reading from
10626  * the stream or filling the buffer.
10627  *
10628  * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10629  */
10630
10631
10632 /**
10633  * g_buffered_input_stream_read_byte:
10634  * @stream: a #GBufferedInputStream
10635  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10636  * @error: location to store the error occurring, or %NULL to ignore
10637  *
10638  * Tries to read a single byte from the stream or the buffer. Will block
10639  * during this read.
10640  *
10641  * On success, the byte read from the stream is returned. On end of stream
10642  * -1 is returned but it's not an exceptional error and @error is not set.
10643  *
10644  * If @cancellable is not %NULL, then the operation can be cancelled by
10645  * triggering the cancellable object from another thread. If the operation
10646  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10647  * operation was partially finished when the operation was cancelled the
10648  * partial result will be returned, without an error.
10649  *
10650  * On error -1 is returned and @error is set accordingly.
10651  *
10652  * Returns: the byte read from the @stream, or -1 on end of stream or error.
10653  */
10654
10655
10656 /**
10657  * g_buffered_input_stream_set_buffer_size:
10658  * @stream: a #GBufferedInputStream
10659  * @size: a #gsize
10660  *
10661  * Sets the size of the internal buffer of @stream to @size, or to the
10662  * size of the contents of the buffer. The buffer can never be resized
10663  * smaller than its current contents.
10664  */
10665
10666
10667 /**
10668  * g_buffered_output_stream_get_auto_grow:
10669  * @stream: a #GBufferedOutputStream.
10670  *
10671  * Checks if the buffer automatically grows as data is added.
10672  *
10673  * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10674  */
10675
10676
10677 /**
10678  * g_buffered_output_stream_get_buffer_size:
10679  * @stream: a #GBufferedOutputStream.
10680  *
10681  * Gets the size of the buffer in the @stream.
10682  *
10683  * Returns: the current size of the buffer.
10684  */
10685
10686
10687 /**
10688  * g_buffered_output_stream_new:
10689  * @base_stream: a #GOutputStream.
10690  *
10691  * Creates a new buffered output stream for a base stream.
10692  *
10693  * Returns: a #GOutputStream for the given @base_stream.
10694  */
10695
10696
10697 /**
10698  * g_buffered_output_stream_new_sized:
10699  * @base_stream: a #GOutputStream.
10700  * @size: a #gsize.
10701  *
10702  * Creates a new buffered output stream with a given buffer size.
10703  *
10704  * Returns: a #GOutputStream with an internal buffer set to @size.
10705  */
10706
10707
10708 /**
10709  * g_buffered_output_stream_set_auto_grow:
10710  * @stream: a #GBufferedOutputStream.
10711  * @auto_grow: a #gboolean.
10712  *
10713  * Sets whether or not the @stream's buffer should automatically grow.
10714  * If @auto_grow is true, then each write will just make the buffer
10715  * larger, and you must manually flush the buffer to actually write out
10716  * the data to the underlying stream.
10717  */
10718
10719
10720 /**
10721  * g_buffered_output_stream_set_buffer_size:
10722  * @stream: a #GBufferedOutputStream.
10723  * @size: a #gsize.
10724  *
10725  * Sets the size of the internal buffer to @size.
10726  */
10727
10728
10729 /**
10730  * g_bus_get:
10731  * @bus_type: A #GBusType.
10732  * @cancellable: (allow-none): A #GCancellable or %NULL.
10733  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10734  * @user_data: The data to pass to @callback.
10735  *
10736  * Asynchronously connects to the message bus specified by @bus_type.
10737  *
10738  * When the operation is finished, @callback will be invoked. You can
10739  * then call g_bus_get_finish() to get the result of the operation.
10740  *
10741  * This is a asynchronous failable function. See g_bus_get_sync() for
10742  * the synchronous version.
10743  *
10744  * Since: 2.26
10745  */
10746
10747
10748 /**
10749  * g_bus_get_finish:
10750  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10751  * @error: Return location for error or %NULL.
10752  *
10753  * Finishes an operation started with g_bus_get().
10754  *
10755  * The returned object is a singleton, that is, shared with other
10756  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10757  * event that you need a private message bus connection, use
10758  * g_dbus_address_get_for_bus_sync() and
10759  * g_dbus_connection_new_for_address().
10760  *
10761  * Note that the returned #GDBusConnection object will (usually) have
10762  * the #GDBusConnection:exit-on-close property set to %TRUE.
10763  *
10764  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10765  * Since: 2.26
10766  */
10767
10768
10769 /**
10770  * g_bus_get_sync:
10771  * @bus_type: A #GBusType.
10772  * @cancellable: (allow-none): A #GCancellable or %NULL.
10773  * @error: Return location for error or %NULL.
10774  *
10775  * Synchronously connects to the message bus specified by @bus_type.
10776  * Note that the returned object may shared with other callers,
10777  * e.g. if two separate parts of a process calls this function with
10778  * the same @bus_type, they will share the same object.
10779  *
10780  * This is a synchronous failable function. See g_bus_get() and
10781  * g_bus_get_finish() for the asynchronous version.
10782  *
10783  * The returned object is a singleton, that is, shared with other
10784  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10785  * event that you need a private message bus connection, use
10786  * g_dbus_address_get_for_bus_sync() and
10787  * g_dbus_connection_new_for_address().
10788  *
10789  * Note that the returned #GDBusConnection object will (usually) have
10790  * the #GDBusConnection:exit-on-close property set to %TRUE.
10791  *
10792  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10793  * Since: 2.26
10794  */
10795
10796
10797 /**
10798  * g_bus_own_name:
10799  * @bus_type: The type of bus to own a name on.
10800  * @name: The well-known name to own.
10801  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10802  * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10803  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10804  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10805  * @user_data: User data to pass to handlers.
10806  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10807  *
10808  * Starts acquiring @name on the bus specified by @bus_type and calls
10809  * @name_acquired_handler and @name_lost_handler when the name is
10810  * acquired respectively lost. Callbacks will be invoked in the <link
10811  * linkend="g-main-context-push-thread-default">thread-default main
10812  * loop</link> of the thread you are calling this function from.
10813  *
10814  * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10815  * callbacks will be invoked after calling this function - there are three
10816  * possible cases:
10817  * <itemizedlist>
10818  *   <listitem><para>
10819  *     @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10820  *   </para></listitem>
10821  *   <listitem><para>
10822  *     @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10823  *   </para></listitem>
10824  *   <listitem><para>
10825  *     @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10826  *   </para></listitem>
10827  * </itemizedlist>
10828  * When you are done owning the name, just call g_bus_unown_name()
10829  * with the owner id this function returns.
10830  *
10831  * If the name is acquired or lost (for example another application
10832  * could acquire the name if you allow replacement or the application
10833  * currently owning the name exits), the handlers are also invoked. If the
10834  * #GDBusConnection that is used for attempting to own the name
10835  * closes, then @name_lost_handler is invoked since it is no
10836  * longer possible for other processes to access the process.
10837  *
10838  * You cannot use g_bus_own_name() several times for the same name (unless
10839  * interleaved with calls to g_bus_unown_name()) - only the first call
10840  * will work.
10841  *
10842  * Another guarantee is that invocations of @name_acquired_handler
10843  * and @name_lost_handler are guaranteed to alternate; that
10844  * is, if @name_acquired_handler is invoked then you are
10845  * guaranteed that the next time one of the handlers is invoked, it
10846  * will be @name_lost_handler. The reverse is also true.
10847  *
10848  * If you plan on exporting objects (using e.g.
10849  * g_dbus_connection_register_object()), note that it is generally too late
10850  * to export the objects in @name_acquired_handler. Instead, you can do this
10851  * in @bus_acquired_handler since you are guaranteed that this will run
10852  * before @name is requested from the bus.
10853  *
10854  * This behavior makes it very simple to write applications that wants
10855  * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10856  * Simply register objects to be exported in @bus_acquired_handler and
10857  * unregister the objects (if any) in @name_lost_handler.
10858  *
10859  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10860  * Since: 2.26
10861  */
10862
10863
10864 /**
10865  * g_bus_own_name_on_connection:
10866  * @connection: A #GDBusConnection.
10867  * @name: The well-known name to own.
10868  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10869  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10870  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10871  * @user_data: User data to pass to handlers.
10872  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10873  *
10874  * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10875  * #GBusType.
10876  *
10877  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10878  * Since: 2.26
10879  */
10880
10881
10882 /**
10883  * g_bus_own_name_on_connection_with_closures:
10884  * @connection: A #GDBusConnection.
10885  * @name: The well-known name to own.
10886  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10887  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10888  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10889  *
10890  * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10891  * easier binding in other languages.
10892  *
10893  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10894  * Rename to: g_bus_own_name_on_connection
10895  * Since: 2.26
10896  */
10897
10898
10899 /**
10900  * g_bus_own_name_with_closures:
10901  * @bus_type: The type of bus to own a name on.
10902  * @name: The well-known name to own.
10903  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10904  * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10905  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10906  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10907  *
10908  * Version of g_bus_own_name() using closures instead of callbacks for
10909  * easier binding in other languages.
10910  *
10911  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10912  * Rename to: g_bus_own_name
10913  * Since: 2.26
10914  */
10915
10916
10917 /**
10918  * g_bus_unown_name:
10919  * @owner_id: An identifier obtained from g_bus_own_name()
10920  *
10921  * Stops owning a name.
10922  *
10923  * Since: 2.26
10924  */
10925
10926
10927 /**
10928  * g_bus_unwatch_name:
10929  * @watcher_id: An identifier obtained from g_bus_watch_name()
10930  *
10931  * Stops watching a name.
10932  *
10933  * Since: 2.26
10934  */
10935
10936
10937 /**
10938  * g_bus_watch_name:
10939  * @bus_type: The type of bus to watch a name on.
10940  * @name: The name (well-known or unique) to watch.
10941  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10942  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10943  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10944  * @user_data: User data to pass to handlers.
10945  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10946  *
10947  * Starts watching @name on the bus specified by @bus_type and calls
10948  * @name_appeared_handler and @name_vanished_handler when the name is
10949  * known to have a owner respectively known to lose its
10950  * owner. Callbacks will be invoked in the <link
10951  * linkend="g-main-context-push-thread-default">thread-default main
10952  * loop</link> of the thread you are calling this function from.
10953  *
10954  * You are guaranteed that one of the handlers will be invoked after
10955  * calling this function. When you are done watching the name, just
10956  * call g_bus_unwatch_name() with the watcher id this function
10957  * returns.
10958  *
10959  * If the name vanishes or appears (for example the application owning
10960  * the name could restart), the handlers are also invoked. If the
10961  * #GDBusConnection that is used for watching the name disconnects, then
10962  * @name_vanished_handler is invoked since it is no longer
10963  * possible to access the name.
10964  *
10965  * Another guarantee is that invocations of @name_appeared_handler
10966  * and @name_vanished_handler are guaranteed to alternate; that
10967  * is, if @name_appeared_handler is invoked then you are
10968  * guaranteed that the next time one of the handlers is invoked, it
10969  * will be @name_vanished_handler. The reverse is also true.
10970  *
10971  * This behavior makes it very simple to write applications that wants
10972  * to take action when a certain name exists, see <xref
10973  * linkend="gdbus-watching-names"/>. Basically, the application
10974  * should create object proxies in @name_appeared_handler and destroy
10975  * them again (if any) in @name_vanished_handler.
10976  *
10977  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10978  * Since: 2.26
10979  */
10980
10981
10982 /**
10983  * g_bus_watch_name_on_connection:
10984  * @connection: A #GDBusConnection.
10985  * @name: The name (well-known or unique) to watch.
10986  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10987  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10988  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10989  * @user_data: User data to pass to handlers.
10990  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10991  *
10992  * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
10993  * #GBusType.
10994  *
10995  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10996  * Since: 2.26
10997  */
10998
10999
11000 /**
11001  * g_bus_watch_name_on_connection_with_closures:
11002  * @connection: A #GDBusConnection.
11003  * @name: The name (well-known or unique) to watch.
11004  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11005  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11006  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11007  *
11008  * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
11009  * easier binding in other languages.
11010  *
11011  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11012  * Rename to: g_bus_watch_name_on_connection
11013  * Since: 2.26
11014  */
11015
11016
11017 /**
11018  * g_bus_watch_name_with_closures:
11019  * @bus_type: The type of bus to watch a name on.
11020  * @name: The name (well-known or unique) to watch.
11021  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11022  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11023  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11024  *
11025  * Version of g_bus_watch_name() using closures instead of callbacks for
11026  * easier binding in other languages.
11027  *
11028  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11029  * Rename to: g_bus_watch_name
11030  * Since: 2.26
11031  */
11032
11033
11034 /**
11035  * g_cancellable_cancel:
11036  * @cancellable: a #GCancellable object.
11037  *
11038  * Will set @cancellable to cancelled, and will emit the
11039  * #GCancellable::cancelled signal. (However, see the warning about
11040  * race conditions in the documentation for that signal if you are
11041  * planning to connect to it.)
11042  *
11043  * This function is thread-safe. In other words, you can safely call
11044  * it from a thread other than the one running the operation that was
11045  * passed the @cancellable.
11046  *
11047  * The convention within gio is that cancelling an asynchronous
11048  * operation causes it to complete asynchronously. That is, if you
11049  * cancel the operation from the same thread in which it is running,
11050  * then the operation's #GAsyncReadyCallback will not be invoked until
11051  * the application returns to the main loop.
11052  */
11053
11054
11055 /**
11056  * g_cancellable_connect:
11057  * @cancellable: A #GCancellable.
11058  * @callback: The #GCallback to connect.
11059  * @data: Data to pass to @callback.
11060  * @data_destroy_func: (allow-none): Free function for @data or %NULL.
11061  *
11062  * Convenience function to connect to the #GCancellable::cancelled
11063  * signal. Also handles the race condition that may happen
11064  * if the cancellable is cancelled right before connecting.
11065  *
11066  * @callback is called at most once, either directly at the
11067  * time of the connect if @cancellable is already cancelled,
11068  * or when @cancellable is cancelled in some thread.
11069  *
11070  * @data_destroy_func will be called when the handler is
11071  * disconnected, or immediately if the cancellable is already
11072  * cancelled.
11073  *
11074  * See #GCancellable::cancelled for details on how to use this.
11075  *
11076  * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
11077  * Since: 2.22
11078  */
11079
11080
11081 /**
11082  * g_cancellable_disconnect:
11083  * @cancellable: (allow-none): A #GCancellable or %NULL.
11084  * @handler_id: Handler id of the handler to be disconnected, or %0.
11085  *
11086  * Disconnects a handler from a cancellable instance similar to
11087  * g_signal_handler_disconnect().  Additionally, in the event that a
11088  * signal handler is currently running, this call will block until the
11089  * handler has finished.  Calling this function from a
11090  * #GCancellable::cancelled signal handler will therefore result in a
11091  * deadlock.
11092  *
11093  * This avoids a race condition where a thread cancels at the
11094  * same time as the cancellable operation is finished and the
11095  * signal handler is removed. See #GCancellable::cancelled for
11096  * details on how to use this.
11097  *
11098  * If @cancellable is %NULL or @handler_id is %0 this function does
11099  * nothing.
11100  *
11101  * Since: 2.22
11102  */
11103
11104
11105 /**
11106  * g_cancellable_get_current:
11107  *
11108  * Gets the top cancellable from the stack.
11109  *
11110  * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
11111  */
11112
11113
11114 /**
11115  * g_cancellable_get_fd:
11116  * @cancellable: a #GCancellable.
11117  *
11118  * Gets the file descriptor for a cancellable job. This can be used to
11119  * implement cancellable operations on Unix systems. The returned fd will
11120  * turn readable when @cancellable is cancelled.
11121  *
11122  * You are not supposed to read from the fd yourself, just check for
11123  * readable status. Reading to unset the readable status is done
11124  * with g_cancellable_reset().
11125  *
11126  * After a successful return from this function, you should use
11127  * g_cancellable_release_fd() to free up resources allocated for
11128  * the returned file descriptor.
11129  *
11130  * See also g_cancellable_make_pollfd().
11131  *
11132  * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
11133  */
11134
11135
11136 /**
11137  * g_cancellable_is_cancelled:
11138  * @cancellable: (allow-none): a #GCancellable or %NULL
11139  *
11140  * Checks if a cancellable job has been cancelled.
11141  *
11142  * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
11143  */
11144
11145
11146 /**
11147  * g_cancellable_make_pollfd:
11148  * @cancellable: (allow-none): a #GCancellable or %NULL
11149  * @pollfd: a pointer to a #GPollFD
11150  *
11151  * Creates a #GPollFD corresponding to @cancellable; this can be passed
11152  * to g_poll() and used to poll for cancellation. This is useful both
11153  * for unix systems without a native poll and for portability to
11154  * windows.
11155  *
11156  * When this function returns %TRUE, you should use
11157  * g_cancellable_release_fd() to free up resources allocated for the
11158  * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
11159  *
11160  * If this function returns %FALSE, either no @cancellable was given or
11161  * resource limits prevent this function from allocating the necessary
11162  * structures for polling. (On Linux, you will likely have reached
11163  * the maximum number of file descriptors.) The suggested way to handle
11164  * these cases is to ignore the @cancellable.
11165  *
11166  * You are not supposed to read from the fd yourself, just check for
11167  * readable status. Reading to unset the readable status is done
11168  * with g_cancellable_reset().
11169  *
11170  * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
11171  * Since: 2.22
11172  */
11173
11174
11175 /**
11176  * g_cancellable_new:
11177  *
11178  * Creates a new #GCancellable object.
11179  *
11180  * Applications that want to start one or more operations
11181  * that should be cancellable should create a #GCancellable
11182  * and pass it to the operations.
11183  *
11184  * One #GCancellable can be used in multiple consecutive
11185  * operations or in multiple concurrent operations.
11186  *
11187  * Returns: a #GCancellable.
11188  */
11189
11190
11191 /**
11192  * g_cancellable_pop_current:
11193  * @cancellable: a #GCancellable object
11194  *
11195  * Pops @cancellable off the cancellable stack (verifying that @cancellable
11196  * is on the top of the stack).
11197  */
11198
11199
11200 /**
11201  * g_cancellable_push_current:
11202  * @cancellable: a #GCancellable object
11203  *
11204  * Pushes @cancellable onto the cancellable stack. The current
11205  * cancellable can then be received using g_cancellable_get_current().
11206  *
11207  * This is useful when implementing cancellable operations in
11208  * code that does not allow you to pass down the cancellable object.
11209  *
11210  * This is typically called automatically by e.g. #GFile operations,
11211  * so you rarely have to call this yourself.
11212  */
11213
11214
11215 /**
11216  * g_cancellable_release_fd:
11217  * @cancellable: a #GCancellable
11218  *
11219  * Releases a resources previously allocated by g_cancellable_get_fd()
11220  * or g_cancellable_make_pollfd().
11221  *
11222  * For compatibility reasons with older releases, calling this function
11223  * is not strictly required, the resources will be automatically freed
11224  * when the @cancellable is finalized. However, the @cancellable will
11225  * block scarce file descriptors until it is finalized if this function
11226  * is not called. This can cause the application to run out of file
11227  * descriptors when many #GCancellables are used at the same time.
11228  *
11229  * Since: 2.22
11230  */
11231
11232
11233 /**
11234  * g_cancellable_reset:
11235  * @cancellable: a #GCancellable object.
11236  *
11237  * Resets @cancellable to its uncancelled state.
11238  *
11239  * If cancellable is currently in use by any cancellable operation
11240  * then the behavior of this function is undefined.
11241  */
11242
11243
11244 /**
11245  * g_cancellable_set_error_if_cancelled:
11246  * @cancellable: (allow-none): a #GCancellable or %NULL
11247  * @error: #GError to append error state to
11248  *
11249  * If the @cancellable is cancelled, sets the error to notify
11250  * that the operation was cancelled.
11251  *
11252  * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11253  */
11254
11255
11256 /**
11257  * g_cancellable_source_new: (skip)
11258  * @cancellable: (allow-none): a #GCancellable, or %NULL
11259  *
11260  * Creates a source that triggers if @cancellable is cancelled and
11261  * calls its callback of type #GCancellableSourceFunc. This is
11262  * primarily useful for attaching to another (non-cancellable) source
11263  * with g_source_add_child_source() to add cancellability to it.
11264  *
11265  * For convenience, you can call this with a %NULL #GCancellable,
11266  * in which case the source will never trigger.
11267  *
11268  * Returns: (transfer full): the new #GSource.
11269  * Since: 2.28
11270  */
11271
11272
11273 /**
11274  * g_charset_converter_get_num_fallbacks:
11275  * @converter: a #GCharsetConverter
11276  *
11277  * Gets the number of fallbacks that @converter has applied so far.
11278  *
11279  * Returns: the number of fallbacks that @converter has applied
11280  * Since: 2.24
11281  */
11282
11283
11284 /**
11285  * g_charset_converter_get_use_fallback:
11286  * @converter: a #GCharsetConverter
11287  *
11288  * Gets the #GCharsetConverter:use-fallback property.
11289  *
11290  * Returns: %TRUE if fallbacks are used by @converter
11291  * Since: 2.24
11292  */
11293
11294
11295 /**
11296  * g_charset_converter_new:
11297  * @to_charset: destination charset
11298  * @from_charset: source charset
11299  * @error: #GError for error reporting, or %NULL to ignore.
11300  *
11301  * Creates a new #GCharsetConverter.
11302  *
11303  * Returns: a new #GCharsetConverter or %NULL on error.
11304  * Since: 2.24
11305  */
11306
11307
11308 /**
11309  * g_charset_converter_set_use_fallback:
11310  * @converter: a #GCharsetConverter
11311  * @use_fallback: %TRUE to use fallbacks
11312  *
11313  * Sets the #GCharsetConverter:use-fallback property.
11314  *
11315  * Since: 2.24
11316  */
11317
11318
11319 /**
11320  * g_content_type_can_be_executable:
11321  * @type: a content type string
11322  *
11323  * Checks if a content type can be executable. Note that for instance
11324  * things like text files can be executables (i.e. scripts and batch files).
11325  *
11326  * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11327  */
11328
11329
11330 /**
11331  * g_content_type_equals:
11332  * @type1: a content type string
11333  * @type2: a content type string
11334  *
11335  * Compares two content types for equality.
11336  *
11337  * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11338  */
11339
11340
11341 /**
11342  * g_content_type_from_mime_type:
11343  * @mime_type: a mime type string
11344  *
11345  * Tries to find a content type based on the mime type name.
11346  *
11347  * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
11348  * Since: 2.18
11349  */
11350
11351
11352 /**
11353  * g_content_type_get_description:
11354  * @type: a content type string
11355  *
11356  * Gets the human readable description of the content type.
11357  *
11358  * Returns: a short description of the content type @type. Free the returned string with g_free()
11359  */
11360
11361
11362 /**
11363  * g_content_type_get_icon:
11364  * @type: a content type string
11365  *
11366  * Gets the icon for a content type.
11367  *
11368  * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11369  */
11370
11371
11372 /**
11373  * g_content_type_get_mime_type:
11374  * @type: a content type string
11375  *
11376  * Gets the mime type for the content type, if one is registered.
11377  *
11378  * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11379  */
11380
11381
11382 /**
11383  * g_content_type_guess:
11384  * @filename: (allow-none): a string, or %NULL
11385  * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11386  * @data_size: the size of @data
11387  * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11388  *
11389  * Guesses the content type based on example data. If the function is
11390  * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11391  * or @data may be %NULL, in which case the guess will be based solely
11392  * on the other argument.
11393  *
11394  * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11395  */
11396
11397
11398 /**
11399  * g_content_type_guess_for_tree:
11400  * @root: the root of the tree to guess a type for
11401  *
11402  * Tries to guess the type of the tree with root @root, by
11403  * looking at the files it contains. The result is an array
11404  * of content types, with the best guess coming first.
11405  *
11406  * The types returned all have the form x-content/foo, e.g.
11407  * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11408  * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11409  * specification for more on x-content types.
11410  *
11411  * This function is useful in the implementation of
11412  * g_mount_guess_content_type().
11413  *
11414  * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11415  * Since: 2.18
11416  */
11417
11418
11419 /**
11420  * g_content_type_is_a:
11421  * @type: a content type string
11422  * @supertype: a content type string
11423  *
11424  * Determines if @type is a subset of @supertype.
11425  *
11426  * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11427  */
11428
11429
11430 /**
11431  * g_content_type_is_unknown:
11432  * @type: a content type string
11433  *
11434  * Checks if the content type is the generic "unknown" type.
11435  * On UNIX this is the "application/octet-stream" mimetype,
11436  * while on win32 it is "*".
11437  *
11438  * Returns: %TRUE if the type is the unknown type.
11439  */
11440
11441
11442 /**
11443  * g_content_types_get_registered:
11444  *
11445  * Gets a list of strings containing all the registered content types
11446  * known to the system. The list and its data should be freed using
11447  * <programlisting>
11448  * g_list_free_full (list, g_free);
11449  * </programlisting>
11450  *
11451  * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11452  */
11453
11454
11455 /**
11456  * g_converter_convert:
11457  * @converter: a #GConverter.
11458  * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11459  * @inbuf_size: the number of bytes in @inbuf
11460  * @outbuf: a buffer to write converted data in.
11461  * @outbuf_size: the number of bytes in @outbuf, must be at least one
11462  * @flags: a #GConverterFlags controlling the conversion details
11463  * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11464  * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11465  * @error: location to store the error occurring, or %NULL to ignore
11466  *
11467  * This is the main operation used when converting data. It is to be called
11468  * multiple times in a loop, and each time it will do some work, i.e.
11469  * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11470  * both. If its not possible to do any work an error is returned.
11471  *
11472  * Note that a single call may not consume all input (or any input at all).
11473  * Also a call may produce output even if given no input, due to state stored
11474  * in the converter producing output.
11475  *
11476  * If any data was either produced or consumed, and then an error happens, then
11477  * only the successful conversion is reported and the error is returned on the
11478  * next call.
11479  *
11480  * A full conversion loop involves calling this method repeatedly, each time
11481  * giving it new input and space output space. When there is no more input
11482  * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11483  * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11484  * each time until all data is consumed and all output is produced, then
11485  * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11486  * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11487  * in a decompression converter where the end of data is detectable from the
11488  * data (and there might even be other data after the end of the compressed data).
11489  *
11490  * When some data has successfully been converted @bytes_read and is set to
11491  * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11492  * how many bytes was written to @outbuf. If there are more data to output
11493  * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11494  * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11495  * then %G_CONVERTER_FINISHED is returned.
11496  *
11497  * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11498  * Some errors need special handling:
11499  *
11500  * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11501  * to write the resulting converted data, the application should
11502  * call the function again with a larger @outbuf to continue.
11503  *
11504  * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11505  * input to fully determine what the conversion should produce,
11506  * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11507  * example with an incomplete multibyte sequence when converting text,
11508  * or when a regexp matches up to the end of the input (and may match
11509  * further input). It may also happen when @inbuf_size is zero and
11510  * there is no more data to produce.
11511  *
11512  * When this happens the application should read more input and then
11513  * call the function again. If further input shows that there is no
11514  * more data call the function again with the same data but with
11515  * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11516  * to finish as e.g. in the regexp match case (or, to fail again with
11517  * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11518  * input is actually partial).
11519  *
11520  * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11521  * converter object is in an invalid state where its not allowed
11522  * to call g_converter_convert() anymore. At this time you can only
11523  * free the object or call g_converter_reset() to reset it to the
11524  * initial state.
11525  *
11526  * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11527  * to try to write out all internal state to the output. The application
11528  * has to call the function multiple times with the flag set, and when
11529  * the available input has been consumed and all internal state has
11530  * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11531  * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11532  * This is somewhat similar to what happens at the end of the input stream,
11533  * but done in the middle of the data.
11534  *
11535  * This has different meanings for different conversions. For instance
11536  * in a compression converter it would mean that we flush all the
11537  * compression state into output such that if you uncompress the
11538  * compressed data you get back all the input data. Doing this may
11539  * make the final file larger due to padding though. Another example
11540  * is a regexp conversion, where if you at the end of the flushed data
11541  * have a match, but there is also a potential longer match. In the
11542  * non-flushed case we would ask for more input, but when flushing we
11543  * treat this as the end of input and do the match.
11544  *
11545  * Flushing is not always possible (like if a charset converter flushes
11546  * at a partial multibyte sequence). Converters are supposed to try
11547  * to produce as much output as possible and then return an error
11548  * (typically %G_IO_ERROR_PARTIAL_INPUT).
11549  *
11550  * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11551  * Since: 2.24
11552  */
11553
11554
11555 /**
11556  * g_converter_input_stream_get_converter:
11557  * @converter_stream: a #GConverterInputStream
11558  *
11559  * Gets the #GConverter that is used by @converter_stream.
11560  *
11561  * Returns: (transfer none): the converter of the converter input stream
11562  * Since: 2.24
11563  */
11564
11565
11566 /**
11567  * g_converter_input_stream_new:
11568  * @base_stream: a #GInputStream
11569  * @converter: a #GConverter
11570  *
11571  * Creates a new converter input stream for the @base_stream.
11572  *
11573  * Returns: a new #GInputStream.
11574  */
11575
11576
11577 /**
11578  * g_converter_output_stream_get_converter:
11579  * @converter_stream: a #GConverterOutputStream
11580  *
11581  * Gets the #GConverter that is used by @converter_stream.
11582  *
11583  * Returns: (transfer none): the converter of the converter output stream
11584  * Since: 2.24
11585  */
11586
11587
11588 /**
11589  * g_converter_output_stream_new:
11590  * @base_stream: a #GOutputStream
11591  * @converter: a #GConverter
11592  *
11593  * Creates a new converter output stream for the @base_stream.
11594  *
11595  * Returns: a new #GOutputStream.
11596  */
11597
11598
11599 /**
11600  * g_converter_reset:
11601  * @converter: a #GConverter.
11602  *
11603  * Resets all internal state in the converter, making it behave
11604  * as if it was just created. If the converter has any internal
11605  * state that would produce output then that output is lost.
11606  *
11607  * Since: 2.24
11608  */
11609
11610
11611 /**
11612  * g_credentials_get_native: (skip)
11613  * @credentials: A #GCredentials.
11614  * @native_type: The type of native credentials to get.
11615  *
11616  * Gets a pointer to native credentials of type @native_type from
11617  * @credentials.
11618  *
11619  * It is a programming error (which will cause an warning to be
11620  * logged) to use this method if there is no #GCredentials support for
11621  * the OS or if @native_type isn't supported by the OS.
11622  *
11623  * 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.
11624  * Since: 2.26
11625  */
11626
11627
11628 /**
11629  * g_credentials_get_unix_user:
11630  * @credentials: A #GCredentials
11631  * @error: Return location for error or %NULL.
11632  *
11633  * Tries to get the UNIX user identifier from @credentials. This
11634  * method is only available on UNIX platforms.
11635  *
11636  * This operation can fail if #GCredentials is not supported on the
11637  * OS or if the native credentials type does not contain information
11638  * about the UNIX user.
11639  *
11640  * Returns: The UNIX user identifier or -1 if @error is set.
11641  * Since: 2.26
11642  */
11643
11644
11645 /**
11646  * g_credentials_is_same_user:
11647  * @credentials: A #GCredentials.
11648  * @other_credentials: A #GCredentials.
11649  * @error: Return location for error or %NULL.
11650  *
11651  * Checks if @credentials and @other_credentials is the same user.
11652  *
11653  * This operation can fail if #GCredentials is not supported on the
11654  * the OS.
11655  *
11656  * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11657  * Since: 2.26
11658  */
11659
11660
11661 /**
11662  * g_credentials_new:
11663  *
11664  * Creates a new #GCredentials object with credentials matching the
11665  * the current process.
11666  *
11667  * Returns: A #GCredentials. Free with g_object_unref().
11668  * Since: 2.26
11669  */
11670
11671
11672 /**
11673  * g_credentials_set_native:
11674  * @credentials: A #GCredentials.
11675  * @native_type: The type of native credentials to set.
11676  * @native: A pointer to native credentials.
11677  *
11678  * Copies the native credentials of type @native_type from @native
11679  * into @credentials.
11680  *
11681  * It is a programming error (which will cause an warning to be
11682  * logged) to use this method if there is no #GCredentials support for
11683  * the OS or if @native_type isn't supported by the OS.
11684  *
11685  * Since: 2.26
11686  */
11687
11688
11689 /**
11690  * g_credentials_set_unix_user:
11691  * @credentials: A #GCredentials.
11692  * @uid: The UNIX user identifier to set.
11693  * @error: Return location for error or %NULL.
11694  *
11695  * Tries to set the UNIX user identifier on @credentials. This method
11696  * is only available on UNIX platforms.
11697  *
11698  * This operation can fail if #GCredentials is not supported on the
11699  * OS or if the native credentials type does not contain information
11700  * about the UNIX user.
11701  *
11702  * Returns: %TRUE if @uid was set, %FALSE if error is set.
11703  * Since: 2.26
11704  */
11705
11706
11707 /**
11708  * g_credentials_to_string:
11709  * @credentials: A #GCredentials object.
11710  *
11711  * Creates a human-readable textual representation of @credentials
11712  * that can be used in logging and debug messages. The format of the
11713  * returned string may change in future GLib release.
11714  *
11715  * Returns: A string that should be freed with g_free().
11716  * Since: 2.26
11717  */
11718
11719
11720 /**
11721  * g_data_input_stream_get_byte_order:
11722  * @stream: a given #GDataInputStream.
11723  *
11724  * Gets the byte order for the data input stream.
11725  *
11726  * Returns: the @stream's current #GDataStreamByteOrder.
11727  */
11728
11729
11730 /**
11731  * g_data_input_stream_get_newline_type:
11732  * @stream: a given #GDataInputStream.
11733  *
11734  * Gets the current newline type for the @stream.
11735  *
11736  * Returns: #GDataStreamNewlineType for the given @stream.
11737  */
11738
11739
11740 /**
11741  * g_data_input_stream_new:
11742  * @base_stream: a #GInputStream.
11743  *
11744  * Creates a new data input stream for the @base_stream.
11745  *
11746  * Returns: a new #GDataInputStream.
11747  */
11748
11749
11750 /**
11751  * g_data_input_stream_read_byte:
11752  * @stream: a given #GDataInputStream.
11753  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11754  * @error: #GError for error reporting.
11755  *
11756  * Reads an unsigned 8-bit/1-byte value from @stream.
11757  *
11758  * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11759  */
11760
11761
11762 /**
11763  * g_data_input_stream_read_int16:
11764  * @stream: a given #GDataInputStream.
11765  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11766  * @error: #GError for error reporting.
11767  *
11768  * Reads a 16-bit/2-byte value from @stream.
11769  *
11770  * In order to get the correct byte order for this read operation,
11771  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11772  *
11773  * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11774  */
11775
11776
11777 /**
11778  * g_data_input_stream_read_int32:
11779  * @stream: a given #GDataInputStream.
11780  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11781  * @error: #GError for error reporting.
11782  *
11783  * Reads a signed 32-bit/4-byte value from @stream.
11784  *
11785  * In order to get the correct byte order for this read operation,
11786  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11787  *
11788  * If @cancellable is not %NULL, then the operation can be cancelled by
11789  * triggering the cancellable object from another thread. If the operation
11790  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11791  *
11792  * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11793  */
11794
11795
11796 /**
11797  * g_data_input_stream_read_int64:
11798  * @stream: a given #GDataInputStream.
11799  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11800  * @error: #GError for error reporting.
11801  *
11802  * Reads a 64-bit/8-byte value from @stream.
11803  *
11804  * In order to get the correct byte order for this read operation,
11805  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11806  *
11807  * If @cancellable is not %NULL, then the operation can be cancelled by
11808  * triggering the cancellable object from another thread. If the operation
11809  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11810  *
11811  * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11812  */
11813
11814
11815 /**
11816  * g_data_input_stream_read_line:
11817  * @stream: a given #GDataInputStream.
11818  * @length: (out): a #gsize to get the length of the data read in.
11819  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11820  * @error: #GError for error reporting.
11821  *
11822  * Reads a line from the data input stream.  Note that no encoding
11823  * checks or conversion is performed; the input is not guaranteed to
11824  * be UTF-8, and may in fact have embedded NUL characters.
11825  *
11826  * If @cancellable is not %NULL, then the operation can be cancelled by
11827  * triggering the cancellable object from another thread. If the operation
11828  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11829  *
11830  * 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.
11831  */
11832
11833
11834 /**
11835  * g_data_input_stream_read_line_async:
11836  * @stream: a given #GDataInputStream.
11837  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11838  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11839  * @callback: (scope async): callback to call when the request is satisfied.
11840  * @user_data: (closure): the data to pass to callback function.
11841  *
11842  * The asynchronous version of g_data_input_stream_read_line().  It is
11843  * an error to have two outstanding calls to this function.
11844  *
11845  * When the operation is finished, @callback will be called. You
11846  * can then call g_data_input_stream_read_line_finish() to get
11847  * the result of the operation.
11848  *
11849  * Since: 2.20
11850  */
11851
11852
11853 /**
11854  * g_data_input_stream_read_line_finish:
11855  * @stream: a given #GDataInputStream.
11856  * @result: the #GAsyncResult that was provided to the callback.
11857  * @length: (out): a #gsize to get the length of the data read in.
11858  * @error: #GError for error reporting.
11859  *
11860  * Finish an asynchronous call started by
11861  * g_data_input_stream_read_line_async().  Note the warning about
11862  * string encoding in g_data_input_stream_read_line() applies here as
11863  * well.
11864  *
11865  * 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.
11866  * Since: 2.20
11867  */
11868
11869
11870 /**
11871  * g_data_input_stream_read_line_finish_utf8:
11872  * @stream: a given #GDataInputStream.
11873  * @result: the #GAsyncResult that was provided to the callback.
11874  * @length: (out): a #gsize to get the length of the data read in.
11875  * @error: #GError for error reporting.
11876  *
11877  * Finish an asynchronous call started by
11878  * g_data_input_stream_read_line_async().
11879  *
11880  * 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.
11881  * Since: 2.30
11882  */
11883
11884
11885 /**
11886  * g_data_input_stream_read_line_utf8:
11887  * @stream: a given #GDataInputStream.
11888  * @length: (out): a #gsize to get the length of the data read in.
11889  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11890  * @error: #GError for error reporting.
11891  *
11892  * Reads a UTF-8 encoded line from the data input stream.
11893  *
11894  * If @cancellable is not %NULL, then the operation can be cancelled by
11895  * triggering the cancellable object from another thread. If the operation
11896  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11897  *
11898  * 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.
11899  * Since: 2.30
11900  */
11901
11902
11903 /**
11904  * g_data_input_stream_read_uint16:
11905  * @stream: a given #GDataInputStream.
11906  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11907  * @error: #GError for error reporting.
11908  *
11909  * Reads an unsigned 16-bit/2-byte value from @stream.
11910  *
11911  * In order to get the correct byte order for this read operation,
11912  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11913  *
11914  * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
11915  */
11916
11917
11918 /**
11919  * g_data_input_stream_read_uint32:
11920  * @stream: a given #GDataInputStream.
11921  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11922  * @error: #GError for error reporting.
11923  *
11924  * Reads an unsigned 32-bit/4-byte value from @stream.
11925  *
11926  * In order to get the correct byte order for this read operation,
11927  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11928  *
11929  * If @cancellable is not %NULL, then the operation can be cancelled by
11930  * triggering the cancellable object from another thread. If the operation
11931  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11932  *
11933  * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11934  */
11935
11936
11937 /**
11938  * g_data_input_stream_read_uint64:
11939  * @stream: a given #GDataInputStream.
11940  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11941  * @error: #GError for error reporting.
11942  *
11943  * Reads an unsigned 64-bit/8-byte value from @stream.
11944  *
11945  * In order to get the correct byte order for this read operation,
11946  * see g_data_input_stream_get_byte_order().
11947  *
11948  * If @cancellable is not %NULL, then the operation can be cancelled by
11949  * triggering the cancellable object from another thread. If the operation
11950  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11951  *
11952  * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
11953  */
11954
11955
11956 /**
11957  * g_data_input_stream_read_until:
11958  * @stream: a given #GDataInputStream.
11959  * @stop_chars: characters to terminate the read.
11960  * @length: (out): a #gsize to get the length of the data read in.
11961  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11962  * @error: #GError for error reporting.
11963  *
11964  * Reads a string from the data input stream, up to the first
11965  * occurrence of any of the stop characters.
11966  *
11967  * Note that, in contrast to g_data_input_stream_read_until_async(),
11968  * this function consumes the stop character that it finds.
11969  *
11970  * Don't use this function in new code.  Its functionality is
11971  * inconsistent with g_data_input_stream_read_until_async().  Both
11972  * functions will be marked as deprecated in a future release.  Use
11973  * g_data_input_stream_read_upto() instead, but note that that function
11974  * does not consume the stop character.
11975  *
11976  * 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.
11977  */
11978
11979
11980 /**
11981  * g_data_input_stream_read_until_async:
11982  * @stream: a given #GDataInputStream.
11983  * @stop_chars: characters to terminate the read.
11984  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11985  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11986  * @callback: (scope async): callback to call when the request is satisfied.
11987  * @user_data: (closure): the data to pass to callback function.
11988  *
11989  * The asynchronous version of g_data_input_stream_read_until().
11990  * It is an error to have two outstanding calls to this function.
11991  *
11992  * Note that, in contrast to g_data_input_stream_read_until(),
11993  * this function does not consume the stop character that it finds.  You
11994  * must read it for yourself.
11995  *
11996  * When the operation is finished, @callback will be called. You
11997  * can then call g_data_input_stream_read_until_finish() to get
11998  * the result of the operation.
11999  *
12000  * Don't use this function in new code.  Its functionality is
12001  * inconsistent with g_data_input_stream_read_until().  Both functions
12002  * will be marked as deprecated in a future release.  Use
12003  * g_data_input_stream_read_upto_async() instead.
12004  *
12005  * Since: 2.20
12006  */
12007
12008
12009 /**
12010  * g_data_input_stream_read_until_finish:
12011  * @stream: a given #GDataInputStream.
12012  * @result: the #GAsyncResult that was provided to the callback.
12013  * @length: (out): a #gsize to get the length of the data read in.
12014  * @error: #GError for error reporting.
12015  *
12016  * Finish an asynchronous call started by
12017  * g_data_input_stream_read_until_async().
12018  *
12019  * Since: 2.20
12020  * 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.
12021  */
12022
12023
12024 /**
12025  * g_data_input_stream_read_upto:
12026  * @stream: a #GDataInputStream
12027  * @stop_chars: characters to terminate the read
12028  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12029  * @length: (out): a #gsize to get the length of the data read in
12030  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12031  * @error: #GError for error reporting
12032  *
12033  * Reads a string from the data input stream, up to the first
12034  * occurrence of any of the stop characters.
12035  *
12036  * In contrast to g_data_input_stream_read_until(), this function
12037  * does <emphasis>not</emphasis> consume the stop character. You have
12038  * to use g_data_input_stream_read_byte() to get it before calling
12039  * g_data_input_stream_read_upto() again.
12040  *
12041  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12042  * specified.
12043  *
12044  * 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
12045  * Since: 2.26
12046  */
12047
12048
12049 /**
12050  * g_data_input_stream_read_upto_async:
12051  * @stream: a #GDataInputStream
12052  * @stop_chars: characters to terminate the read
12053  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12054  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12055  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12056  * @callback: (scope async): callback to call when the request is satisfied
12057  * @user_data: (closure): the data to pass to callback function
12058  *
12059  * The asynchronous version of g_data_input_stream_read_upto().
12060  * It is an error to have two outstanding calls to this function.
12061  *
12062  * In contrast to g_data_input_stream_read_until(), this function
12063  * does <emphasis>not</emphasis> consume the stop character. You have
12064  * to use g_data_input_stream_read_byte() to get it before calling
12065  * g_data_input_stream_read_upto() again.
12066  *
12067  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12068  * specified.
12069  *
12070  * When the operation is finished, @callback will be called. You
12071  * can then call g_data_input_stream_read_upto_finish() to get
12072  * the result of the operation.
12073  *
12074  * Since: 2.26
12075  */
12076
12077
12078 /**
12079  * g_data_input_stream_read_upto_finish:
12080  * @stream: a #GDataInputStream
12081  * @result: the #GAsyncResult that was provided to the callback
12082  * @length: (out): a #gsize to get the length of the data read in
12083  * @error: #GError for error reporting
12084  *
12085  * Finish an asynchronous call started by
12086  * g_data_input_stream_read_upto_async().
12087  *
12088  * Note that this function does <emphasis>not</emphasis> consume the
12089  * stop character. You have to use g_data_input_stream_read_byte() to
12090  * get it before calling g_data_input_stream_read_upto_async() again.
12091  *
12092  * 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.
12093  * Since: 2.24
12094  */
12095
12096
12097 /**
12098  * g_data_input_stream_set_byte_order:
12099  * @stream: a given #GDataInputStream.
12100  * @order: a #GDataStreamByteOrder to set.
12101  *
12102  * This function sets the byte order for the given @stream. All subsequent
12103  * reads from the @stream will be read in the given @order.
12104  */
12105
12106
12107 /**
12108  * g_data_input_stream_set_newline_type:
12109  * @stream: a #GDataInputStream.
12110  * @type: the type of new line return as #GDataStreamNewlineType.
12111  *
12112  * Sets the newline type for the @stream.
12113  *
12114  * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12115  * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12116  * "CR LF", and this might block if there is no more data available.
12117  */
12118
12119
12120 /**
12121  * g_data_output_stream_get_byte_order:
12122  * @stream: a #GDataOutputStream.
12123  *
12124  * Gets the byte order for the stream.
12125  *
12126  * Returns: the #GDataStreamByteOrder for the @stream.
12127  */
12128
12129
12130 /**
12131  * g_data_output_stream_new:
12132  * @base_stream: a #GOutputStream.
12133  *
12134  * Creates a new data output stream for @base_stream.
12135  *
12136  * Returns: #GDataOutputStream.
12137  */
12138
12139
12140 /**
12141  * g_data_output_stream_put_byte:
12142  * @stream: a #GDataOutputStream.
12143  * @data: a #guchar.
12144  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12145  * @error: a #GError, %NULL to ignore.
12146  *
12147  * Puts a byte into the output stream.
12148  *
12149  * Returns: %TRUE if @data was successfully added to the @stream.
12150  */
12151
12152
12153 /**
12154  * g_data_output_stream_put_int16:
12155  * @stream: a #GDataOutputStream.
12156  * @data: a #gint16.
12157  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12158  * @error: a #GError, %NULL to ignore.
12159  *
12160  * Puts a signed 16-bit integer into the output stream.
12161  *
12162  * Returns: %TRUE if @data was successfully added to the @stream.
12163  */
12164
12165
12166 /**
12167  * g_data_output_stream_put_int32:
12168  * @stream: a #GDataOutputStream.
12169  * @data: a #gint32.
12170  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12171  * @error: a #GError, %NULL to ignore.
12172  *
12173  * Puts a signed 32-bit integer into the output stream.
12174  *
12175  * Returns: %TRUE if @data was successfully added to the @stream.
12176  */
12177
12178
12179 /**
12180  * g_data_output_stream_put_int64:
12181  * @stream: a #GDataOutputStream.
12182  * @data: a #gint64.
12183  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12184  * @error: a #GError, %NULL to ignore.
12185  *
12186  * Puts a signed 64-bit integer into the stream.
12187  *
12188  * Returns: %TRUE if @data was successfully added to the @stream.
12189  */
12190
12191
12192 /**
12193  * g_data_output_stream_put_string:
12194  * @stream: a #GDataOutputStream.
12195  * @str: a string.
12196  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12197  * @error: a #GError, %NULL to ignore.
12198  *
12199  * Puts a string into the output stream.
12200  *
12201  * Returns: %TRUE if @string was successfully added to the @stream.
12202  */
12203
12204
12205 /**
12206  * g_data_output_stream_put_uint16:
12207  * @stream: a #GDataOutputStream.
12208  * @data: a #guint16.
12209  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12210  * @error: a #GError, %NULL to ignore.
12211  *
12212  * Puts an unsigned 16-bit integer into the output stream.
12213  *
12214  * Returns: %TRUE if @data was successfully added to the @stream.
12215  */
12216
12217
12218 /**
12219  * g_data_output_stream_put_uint32:
12220  * @stream: a #GDataOutputStream.
12221  * @data: a #guint32.
12222  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12223  * @error: a #GError, %NULL to ignore.
12224  *
12225  * Puts an unsigned 32-bit integer into the stream.
12226  *
12227  * Returns: %TRUE if @data was successfully added to the @stream.
12228  */
12229
12230
12231 /**
12232  * g_data_output_stream_put_uint64:
12233  * @stream: a #GDataOutputStream.
12234  * @data: a #guint64.
12235  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12236  * @error: a #GError, %NULL to ignore.
12237  *
12238  * Puts an unsigned 64-bit integer into the stream.
12239  *
12240  * Returns: %TRUE if @data was successfully added to the @stream.
12241  */
12242
12243
12244 /**
12245  * g_data_output_stream_set_byte_order:
12246  * @stream: a #GDataOutputStream.
12247  * @order: a %GDataStreamByteOrder.
12248  *
12249  * Sets the byte order of the data output stream to @order.
12250  */
12251
12252
12253 /**
12254  * g_dbus_action_group_get:
12255  * @connection: A #GDBusConnection
12256  * @bus_name: the bus name which exports the action group
12257  * @object_path: the object path at which the action group is exported
12258  *
12259  * Obtains a #GDBusActionGroup for the action group which is exported at
12260  * the given @bus_name and @object_path.
12261  *
12262  * The thread default main context is taken at the time of this call.
12263  * All signals on the menu model (and any linked models) are reported
12264  * with respect to this context.  All calls on the returned menu model
12265  * (and linked models) must also originate from this same context, with
12266  * the thread default main context unchanged.
12267  *
12268  * This call is non-blocking.  The returned action group may or may not
12269  * already be filled in.  The correct thing to do is connect the signals
12270  * for the action group to monitor for changes and then to call
12271  * g_action_group_list_actions() to get the initial list.
12272  *
12273  * Returns: (transfer full): a #GDBusActionGroup
12274  * Since: 2.32
12275  */
12276
12277
12278 /**
12279  * g_dbus_address_get_for_bus_sync:
12280  * @bus_type: A #GBusType.
12281  * @cancellable: (allow-none): A #GCancellable or %NULL.
12282  * @error: Return location for error or %NULL.
12283  *
12284  * Synchronously looks up the D-Bus address for the well-known message
12285  * bus instance specified by @bus_type. This may involve using various
12286  * platform specific mechanisms.
12287  *
12288  * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12289  * Since: 2.26
12290  */
12291
12292
12293 /**
12294  * g_dbus_address_get_stream:
12295  * @address: A valid D-Bus address.
12296  * @cancellable: (allow-none): A #GCancellable or %NULL.
12297  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12298  * @user_data: Data to pass to @callback.
12299  *
12300  * Asynchronously connects to an endpoint specified by @address and
12301  * sets up the connection so it is in a state to run the client-side
12302  * of the D-Bus authentication conversation.
12303  *
12304  * When the operation is finished, @callback will be invoked. You can
12305  * then call g_dbus_address_get_stream_finish() to get the result of
12306  * the operation.
12307  *
12308  * This is an asynchronous failable function. See
12309  * g_dbus_address_get_stream_sync() for the synchronous version.
12310  *
12311  * Since: 2.26
12312  */
12313
12314
12315 /**
12316  * g_dbus_address_get_stream_finish:
12317  * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12318  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12319  * @error: Return location for error or %NULL.
12320  *
12321  * Finishes an operation started with g_dbus_address_get_stream().
12322  *
12323  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12324  * Since: 2.26
12325  */
12326
12327
12328 /**
12329  * g_dbus_address_get_stream_sync:
12330  * @address: A valid D-Bus address.
12331  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12332  * @cancellable: (allow-none): A #GCancellable or %NULL.
12333  * @error: Return location for error or %NULL.
12334  *
12335  * Synchronously connects to an endpoint specified by @address and
12336  * sets up the connection so it is in a state to run the client-side
12337  * of the D-Bus authentication conversation.
12338  *
12339  * This is a synchronous failable function. See
12340  * g_dbus_address_get_stream() for the asynchronous version.
12341  *
12342  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12343  * Since: 2.26
12344  */
12345
12346
12347 /**
12348  * g_dbus_annotation_info_lookup:
12349  * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12350  * @name: The name of the annotation to look up.
12351  *
12352  * Looks up the value of an annotation.
12353  *
12354  * This cost of this function is O(n) in number of annotations.
12355  *
12356  * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12357  * Since: 2.26
12358  */
12359
12360
12361 /**
12362  * g_dbus_annotation_info_ref:
12363  * @info: A #GDBusNodeInfo
12364  *
12365  * If @info is statically allocated does nothing. Otherwise increases
12366  * the reference count.
12367  *
12368  * Returns: The same @info.
12369  * Since: 2.26
12370  */
12371
12372
12373 /**
12374  * g_dbus_annotation_info_unref:
12375  * @info: A #GDBusAnnotationInfo.
12376  *
12377  * If @info is statically allocated, does nothing. Otherwise decreases
12378  * the reference count of @info. When its reference count drops to 0,
12379  * the memory used is freed.
12380  *
12381  * Since: 2.26
12382  */
12383
12384
12385 /**
12386  * g_dbus_arg_info_ref:
12387  * @info: A #GDBusArgInfo
12388  *
12389  * If @info is statically allocated does nothing. Otherwise increases
12390  * the reference count.
12391  *
12392  * Returns: The same @info.
12393  * Since: 2.26
12394  */
12395
12396
12397 /**
12398  * g_dbus_arg_info_unref:
12399  * @info: A #GDBusArgInfo.
12400  *
12401  * If @info is statically allocated, does nothing. Otherwise decreases
12402  * the reference count of @info. When its reference count drops to 0,
12403  * the memory used is freed.
12404  *
12405  * Since: 2.26
12406  */
12407
12408
12409 /**
12410  * g_dbus_auth_observer_allow_mechanism:
12411  * @observer: A #GDBusAuthObserver.
12412  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12413  *
12414  * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12415  *
12416  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12417  * Since: 2.34
12418  */
12419
12420
12421 /**
12422  * g_dbus_auth_observer_authorize_authenticated_peer:
12423  * @observer: A #GDBusAuthObserver.
12424  * @stream: A #GIOStream for the #GDBusConnection.
12425  * @credentials: (allow-none): Credentials received from the peer or %NULL.
12426  *
12427  * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12428  *
12429  * Returns: %TRUE if the peer is authorized, %FALSE if not.
12430  * Since: 2.26
12431  */
12432
12433
12434 /**
12435  * g_dbus_auth_observer_new:
12436  *
12437  * Creates a new #GDBusAuthObserver object.
12438  *
12439  * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12440  * Since: 2.26
12441  */
12442
12443
12444 /**
12445  * g_dbus_connection_add_filter:
12446  * @connection: A #GDBusConnection.
12447  * @filter_function: A filter function.
12448  * @user_data: User data to pass to @filter_function.
12449  * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12450  *
12451  * Adds a message filter. Filters are handlers that are run on all
12452  * incoming and outgoing messages, prior to standard dispatch. Filters
12453  * are run in the order that they were added.  The same handler can be
12454  * added as a filter more than once, in which case it will be run more
12455  * than once.  Filters added during a filter callback won't be run on
12456  * the message being processed. Filter functions are allowed to modify
12457  * and even drop messages.
12458  *
12459  * Note that filters are run in a dedicated message handling thread so
12460  * they can't block and, generally, can't do anything but signal a
12461  * worker thread. Also note that filters are rarely needed - use API
12462  * such as g_dbus_connection_send_message_with_reply(),
12463  * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12464  *
12465  * If a filter consumes an incoming message the message is not
12466  * dispatched anywhere else - not even the standard dispatch machinery
12467  * (that API such as g_dbus_connection_signal_subscribe() and
12468  * g_dbus_connection_send_message_with_reply() relies on) will see the
12469  * message. Similary, if a filter consumes an outgoing message, the
12470  * message will not be sent to the other peer.
12471  *
12472  * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12473  * Since: 2.26
12474  */
12475
12476
12477 /**
12478  * g_dbus_connection_call:
12479  * @connection: A #GDBusConnection.
12480  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12481  * @object_path: Path of remote object.
12482  * @interface_name: D-Bus interface to invoke method on.
12483  * @method_name: The name of the method to invoke.
12484  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12485  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12486  * @flags: Flags from the #GDBusCallFlags enumeration.
12487  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12488  * @cancellable: (allow-none): A #GCancellable or %NULL.
12489  * @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.
12490  * @user_data: The data to pass to @callback.
12491  *
12492  * Asynchronously invokes the @method_name method on the
12493  * @interface_name D-Bus interface on the remote object at
12494  * @object_path owned by @bus_name.
12495  *
12496  * If @connection is closed then the operation will fail with
12497  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12498  * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12499  * not compatible with the D-Bus protocol, the operation fails with
12500  * %G_IO_ERROR_INVALID_ARGUMENT.
12501  *
12502  * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12503  * error will be raised if it does not match.  Said another way, if you give a @reply_type
12504  * then any non-%NULL return value will be of this type.
12505  *
12506  * If the @parameters #GVariant is floating, it is consumed. This allows
12507  * convenient 'inline' use of g_variant_new(), e.g.:
12508  * |[
12509  *  g_dbus_connection_call (connection,
12510  *                          "org.freedesktop.StringThings",
12511  *                          "/org/freedesktop/StringThings",
12512  *                          "org.freedesktop.StringThings",
12513  *                          "TwoStrings",
12514  *                          g_variant_new ("(ss)",
12515  *                                         "Thing One",
12516  *                                         "Thing Two"),
12517  *                          NULL,
12518  *                          G_DBUS_CALL_FLAGS_NONE,
12519  *                          -1,
12520  *                          NULL,
12521  *                          (GAsyncReadyCallback) two_strings_done,
12522  *                          NULL);
12523  * ]|
12524  *
12525  * This is an asynchronous method. When the operation is finished, @callback will be invoked
12526  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12527  * of the thread you are calling this method from. You can then call
12528  * g_dbus_connection_call_finish() to get the result of the operation.
12529  * See g_dbus_connection_call_sync() for the synchronous version of this
12530  * function.
12531  *
12532  * If @callback is %NULL then the D-Bus method call message will be sent with
12533  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12534  *
12535  * Since: 2.26
12536  */
12537
12538
12539 /**
12540  * g_dbus_connection_call_finish:
12541  * @connection: A #GDBusConnection.
12542  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12543  * @error: Return location for error or %NULL.
12544  *
12545  * Finishes an operation started with g_dbus_connection_call().
12546  *
12547  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12548  * Since: 2.26
12549  */
12550
12551
12552 /**
12553  * g_dbus_connection_call_sync:
12554  * @connection: A #GDBusConnection.
12555  * @bus_name: A unique or well-known bus name.
12556  * @object_path: Path of remote object.
12557  * @interface_name: D-Bus interface to invoke method on.
12558  * @method_name: The name of the method to invoke.
12559  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12560  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12561  * @flags: Flags from the #GDBusCallFlags enumeration.
12562  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12563  * @cancellable: (allow-none): A #GCancellable or %NULL.
12564  * @error: Return location for error or %NULL.
12565  *
12566  * Synchronously invokes the @method_name method on the
12567  * @interface_name D-Bus interface on the remote object at
12568  * @object_path owned by @bus_name.
12569  *
12570  * If @connection is closed then the operation will fail with
12571  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12572  * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12573  * contains a value not compatible with the D-Bus protocol, the operation
12574  * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12575  *
12576  * If @reply_type is non-%NULL then the reply will be checked for having
12577  * this type and an error will be raised if it does not match.  Said
12578  * another way, if you give a @reply_type then any non-%NULL return
12579  * value will be of this type.
12580  *
12581  * If the @parameters #GVariant is floating, it is consumed.
12582  * This allows convenient 'inline' use of g_variant_new(), e.g.:
12583  * |[
12584  *  g_dbus_connection_call_sync (connection,
12585  *                               "org.freedesktop.StringThings",
12586  *                               "/org/freedesktop/StringThings",
12587  *                               "org.freedesktop.StringThings",
12588  *                               "TwoStrings",
12589  *                               g_variant_new ("(ss)",
12590  *                                              "Thing One",
12591  *                                              "Thing Two"),
12592  *                               NULL,
12593  *                               G_DBUS_CALL_FLAGS_NONE,
12594  *                               -1,
12595  *                               NULL,
12596  *                               &amp;error);
12597  * ]|
12598  *
12599  * The calling thread is blocked until a reply is received. See
12600  * g_dbus_connection_call() for the asynchronous version of
12601  * this method.
12602  *
12603  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12604  * Since: 2.26
12605  */
12606
12607
12608 /**
12609  * g_dbus_connection_call_with_unix_fd_list:
12610  * @connection: A #GDBusConnection.
12611  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12612  * @object_path: Path of remote object.
12613  * @interface_name: D-Bus interface to invoke method on.
12614  * @method_name: The name of the method to invoke.
12615  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12616  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12617  * @flags: Flags from the #GDBusCallFlags enumeration.
12618  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12619  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12620  * @cancellable: (allow-none): A #GCancellable or %NULL.
12621  * @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.
12622  * @user_data: The data to pass to @callback.
12623  *
12624  * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12625  *
12626  * This method is only available on UNIX.
12627  *
12628  * Since: 2.30
12629  */
12630
12631
12632 /**
12633  * g_dbus_connection_call_with_unix_fd_list_finish:
12634  * @connection: A #GDBusConnection.
12635  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12636  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12637  * @error: Return location for error or %NULL.
12638  *
12639  * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12640  *
12641  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12642  * Since: 2.30
12643  */
12644
12645
12646 /**
12647  * g_dbus_connection_call_with_unix_fd_list_sync:
12648  * @connection: A #GDBusConnection.
12649  * @bus_name: A unique or well-known bus name.
12650  * @object_path: Path of remote object.
12651  * @interface_name: D-Bus interface to invoke method on.
12652  * @method_name: The name of the method to invoke.
12653  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12654  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12655  * @flags: Flags from the #GDBusCallFlags enumeration.
12656  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12657  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12658  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12659  * @cancellable: (allow-none): A #GCancellable or %NULL.
12660  * @error: Return location for error or %NULL.
12661  *
12662  * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12663  *
12664  * This method is only available on UNIX.
12665  *
12666  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12667  * Since: 2.30
12668  */
12669
12670
12671 /**
12672  * g_dbus_connection_close:
12673  * @connection: A #GDBusConnection.
12674  * @cancellable: (allow-none): A #GCancellable or %NULL.
12675  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12676  * @user_data: The data to pass to @callback.
12677  *
12678  * Closes @connection. Note that this never causes the process to
12679  * exit (this might only happen if the other end of a shared message
12680  * bus connection disconnects, see #GDBusConnection:exit-on-close).
12681  *
12682  * Once the connection is closed, operations such as sending a message
12683  * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12684  * will not automatically flush the connection so queued messages may
12685  * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12686  *
12687  * If @connection is already closed, this method fails with
12688  * %G_IO_ERROR_CLOSED.
12689  *
12690  * When @connection has been closed, the #GDBusConnection::closed
12691  * signal is emitted in the <link
12692  * linkend="g-main-context-push-thread-default">thread-default main
12693  * loop</link> of the thread that @connection was constructed in.
12694  *
12695  * This is an asynchronous method. When the operation is finished,
12696  * @callback will be invoked in the <link
12697  * linkend="g-main-context-push-thread-default">thread-default main
12698  * loop</link> of the thread you are calling this method from. You can
12699  * then call g_dbus_connection_close_finish() to get the result of the
12700  * operation.  See g_dbus_connection_close_sync() for the synchronous
12701  * version.
12702  *
12703  * Since: 2.26
12704  */
12705
12706
12707 /**
12708  * g_dbus_connection_close_finish:
12709  * @connection: A #GDBusConnection.
12710  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12711  * @error: Return location for error or %NULL.
12712  *
12713  * Finishes an operation started with g_dbus_connection_close().
12714  *
12715  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12716  * Since: 2.26
12717  */
12718
12719
12720 /**
12721  * g_dbus_connection_close_sync:
12722  * @connection: A #GDBusConnection.
12723  * @cancellable: (allow-none): A #GCancellable or %NULL.
12724  * @error: Return location for error or %NULL.
12725  *
12726  * Synchronously closees @connection. The calling thread is blocked
12727  * until this is done. See g_dbus_connection_close() for the
12728  * asynchronous version of this method and more details about what it
12729  * does.
12730  *
12731  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12732  * Since: 2.26
12733  */
12734
12735
12736 /**
12737  * g_dbus_connection_emit_signal:
12738  * @connection: A #GDBusConnection.
12739  * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12740  * @object_path: Path of remote object.
12741  * @interface_name: D-Bus interface to emit a signal on.
12742  * @signal_name: The name of the signal to emit.
12743  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12744  * @error: Return location for error or %NULL.
12745  *
12746  * Emits a signal.
12747  *
12748  * If the parameters GVariant is floating, it is consumed.
12749  *
12750  * This can only fail if @parameters is not compatible with the D-Bus protocol.
12751  *
12752  * Returns: %TRUE unless @error is set.
12753  * Since: 2.26
12754  */
12755
12756
12757 /**
12758  * g_dbus_connection_export_action_group:
12759  * @connection: a #GDBusConnection
12760  * @object_path: a D-Bus object path
12761  * @action_group: a #GActionGroup
12762  * @error: a pointer to a %NULL #GError, or %NULL
12763  *
12764  * Exports @action_group on @connection at @object_path.
12765  *
12766  * The implemented D-Bus API should be considered private.  It is
12767  * subject to change in the future.
12768  *
12769  * A given object path can only have one action group exported on it.
12770  * If this constraint is violated, the export will fail and 0 will be
12771  * returned (with @error set accordingly).
12772  *
12773  * You can unexport the action group using
12774  * g_dbus_connection_unexport_action_group() with the return value of
12775  * this function.
12776  *
12777  * The thread default main context is taken at the time of this call.
12778  * All incoming action activations and state change requests are
12779  * reported from this context.  Any changes on the action group that
12780  * cause it to emit signals must also come from this same context.
12781  * Since incoming action activations and state change requests are
12782  * rather likely to cause changes on the action group, this effectively
12783  * limits a given action group to being exported from only one main
12784  * context.
12785  *
12786  * Returns: the ID of the export (never zero), or 0 in case of failure
12787  * Since: 2.32
12788  */
12789
12790
12791 /**
12792  * g_dbus_connection_export_menu_model:
12793  * @connection: a #GDBusConnection
12794  * @object_path: a D-Bus object path
12795  * @menu: a #GMenuModel
12796  * @error: return location for an error, or %NULL
12797  *
12798  * Exports @menu on @connection at @object_path.
12799  *
12800  * The implemented D-Bus API should be considered private.
12801  * It is subject to change in the future.
12802  *
12803  * An object path can only have one action group exported on it. If this
12804  * constraint is violated, the export will fail and 0 will be
12805  * returned (with @error set accordingly).
12806  *
12807  * You can unexport the menu model using
12808  * g_dbus_connection_unexport_menu_model() with the return value of
12809  * this function.
12810  *
12811  * Returns: the ID of the export (never zero), or 0 in case of failure
12812  * Since: 2.32
12813  */
12814
12815
12816 /**
12817  * g_dbus_connection_flush:
12818  * @connection: A #GDBusConnection.
12819  * @cancellable: (allow-none): A #GCancellable or %NULL.
12820  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12821  * @user_data: The data to pass to @callback.
12822  *
12823  * Asynchronously flushes @connection, that is, writes all queued
12824  * outgoing message to the transport and then flushes the transport
12825  * (using g_output_stream_flush_async()). This is useful in programs
12826  * that wants to emit a D-Bus signal and then exit
12827  * immediately. Without flushing the connection, there is no guarantee
12828  * that the message has been sent to the networking buffers in the OS
12829  * kernel.
12830  *
12831  * This is an asynchronous method. When the operation is finished,
12832  * @callback will be invoked in the <link
12833  * linkend="g-main-context-push-thread-default">thread-default main
12834  * loop</link> of the thread you are calling this method from. You can
12835  * then call g_dbus_connection_flush_finish() to get the result of the
12836  * operation.  See g_dbus_connection_flush_sync() for the synchronous
12837  * version.
12838  *
12839  * Since: 2.26
12840  */
12841
12842
12843 /**
12844  * g_dbus_connection_flush_finish:
12845  * @connection: A #GDBusConnection.
12846  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12847  * @error: Return location for error or %NULL.
12848  *
12849  * Finishes an operation started with g_dbus_connection_flush().
12850  *
12851  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12852  * Since: 2.26
12853  */
12854
12855
12856 /**
12857  * g_dbus_connection_flush_sync:
12858  * @connection: A #GDBusConnection.
12859  * @cancellable: (allow-none): A #GCancellable or %NULL.
12860  * @error: Return location for error or %NULL.
12861  *
12862  * Synchronously flushes @connection. The calling thread is blocked
12863  * until this is done. See g_dbus_connection_flush() for the
12864  * asynchronous version of this method and more details about what it
12865  * does.
12866  *
12867  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12868  * Since: 2.26
12869  */
12870
12871
12872 /**
12873  * g_dbus_connection_get_capabilities:
12874  * @connection: A #GDBusConnection.
12875  *
12876  * Gets the capabilities negotiated with the remote peer
12877  *
12878  * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12879  * Since: 2.26
12880  */
12881
12882
12883 /**
12884  * g_dbus_connection_get_exit_on_close:
12885  * @connection: A #GDBusConnection.
12886  *
12887  * Gets whether the process is terminated when @connection is
12888  * closed by the remote peer. See
12889  * #GDBusConnection:exit-on-close for more details.
12890  *
12891  * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12892  * Since: 2.26
12893  */
12894
12895
12896 /**
12897  * g_dbus_connection_get_guid:
12898  * @connection: A #GDBusConnection.
12899  *
12900  * The GUID of the peer performing the role of server when
12901  * authenticating. See #GDBusConnection:guid for more details.
12902  *
12903  * Returns: The GUID. Do not free this string, it is owned by @connection.
12904  * Since: 2.26
12905  */
12906
12907
12908 /**
12909  * g_dbus_connection_get_last_serial:
12910  * @connection: A #GDBusConnection.
12911  *
12912  * Retrieves the last serial number assigned to a #GDBusMessage on
12913  * the current thread. This includes messages sent via both low-level
12914  * API such as g_dbus_connection_send_message() as well as
12915  * high-level API such as g_dbus_connection_emit_signal(),
12916  * g_dbus_connection_call() or g_dbus_proxy_call().
12917  *
12918  * Returns: the last used serial or zero when no message has been sent within the current thread.
12919  * Since: 2.34
12920  */
12921
12922
12923 /**
12924  * g_dbus_connection_get_peer_credentials:
12925  * @connection: A #GDBusConnection.
12926  *
12927  * Gets the credentials of the authenticated peer. This will always
12928  * return %NULL unless @connection acted as a server
12929  * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
12930  * when set up and the client passed credentials as part of the
12931  * authentication process.
12932  *
12933  * In a message bus setup, the message bus is always the server and
12934  * each application is a client. So this method will always return
12935  * %NULL for message bus clients.
12936  *
12937  * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
12938  * Since: 2.26
12939  */
12940
12941
12942 /**
12943  * g_dbus_connection_get_stream:
12944  * @connection: a #GDBusConnection
12945  *
12946  * Gets the underlying stream used for IO.
12947  *
12948  * While the #GDBusConnection is active, it will interact with this
12949  * stream from a worker thread, so it is not safe to interact with
12950  * the stream directly.
12951  *
12952  * Returns: (transfer none): the stream used for IO
12953  * Since: 2.26
12954  */
12955
12956
12957 /**
12958  * g_dbus_connection_get_unique_name:
12959  * @connection: A #GDBusConnection.
12960  *
12961  * Gets the unique name of @connection as assigned by the message
12962  * bus. This can also be used to figure out if @connection is a
12963  * message bus connection.
12964  *
12965  * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
12966  * Since: 2.26
12967  */
12968
12969
12970 /**
12971  * g_dbus_connection_is_closed:
12972  * @connection: A #GDBusConnection.
12973  *
12974  * Gets whether @connection is closed.
12975  *
12976  * Returns: %TRUE if the connection is closed, %FALSE otherwise.
12977  * Since: 2.26
12978  */
12979
12980
12981 /**
12982  * g_dbus_connection_new:
12983  * @stream: A #GIOStream.
12984  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12985  * @flags: Flags describing how to make the connection.
12986  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12987  * @cancellable: (allow-none): A #GCancellable or %NULL.
12988  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12989  * @user_data: The data to pass to @callback.
12990  *
12991  * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
12992  * with the end represented by @stream.
12993  *
12994  * If @stream is a #GSocketConnection, then the corresponding #GSocket
12995  * will be put into non-blocking mode.
12996  *
12997  * The D-Bus connection will interact with @stream from a worker thread.
12998  * As a result, the caller should not interact with @stream after this
12999  * method has been called, except by calling g_object_unref() on it.
13000  *
13001  * If @observer is not %NULL it may be used to control the
13002  * authentication process.
13003  *
13004  * When the operation is finished, @callback will be invoked. You can
13005  * then call g_dbus_connection_new_finish() to get the result of the
13006  * operation.
13007  *
13008  * This is a asynchronous failable constructor. See
13009  * g_dbus_connection_new_sync() for the synchronous
13010  * version.
13011  *
13012  * Since: 2.26
13013  */
13014
13015
13016 /**
13017  * g_dbus_connection_new_finish:
13018  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13019  * @error: Return location for error or %NULL.
13020  *
13021  * Finishes an operation started with g_dbus_connection_new().
13022  *
13023  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13024  * Since: 2.26
13025  */
13026
13027
13028 /**
13029  * g_dbus_connection_new_for_address:
13030  * @address: A D-Bus address.
13031  * @flags: Flags describing how to make the connection.
13032  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13033  * @cancellable: (allow-none): A #GCancellable or %NULL.
13034  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13035  * @user_data: The data to pass to @callback.
13036  *
13037  * Asynchronously connects and sets up a D-Bus client connection for
13038  * exchanging D-Bus messages with an endpoint specified by @address
13039  * which must be in the D-Bus address format.
13040  *
13041  * This constructor can only be used to initiate client-side
13042  * connections - use g_dbus_connection_new() if you need to act as the
13043  * server. In particular, @flags cannot contain the
13044  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13045  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13046  *
13047  * When the operation is finished, @callback will be invoked. You can
13048  * then call g_dbus_connection_new_finish() to get the result of the
13049  * operation.
13050  *
13051  * If @observer is not %NULL it may be used to control the
13052  * authentication process.
13053  *
13054  * This is a asynchronous failable constructor. See
13055  * g_dbus_connection_new_for_address_sync() for the synchronous
13056  * version.
13057  *
13058  * Since: 2.26
13059  */
13060
13061
13062 /**
13063  * g_dbus_connection_new_for_address_finish:
13064  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13065  * @error: Return location for error or %NULL.
13066  *
13067  * Finishes an operation started with g_dbus_connection_new_for_address().
13068  *
13069  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13070  * Since: 2.26
13071  */
13072
13073
13074 /**
13075  * g_dbus_connection_new_for_address_sync:
13076  * @address: A D-Bus address.
13077  * @flags: Flags describing how to make the connection.
13078  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13079  * @cancellable: (allow-none): A #GCancellable or %NULL.
13080  * @error: Return location for error or %NULL.
13081  *
13082  * Synchronously connects and sets up a D-Bus client connection for
13083  * exchanging D-Bus messages with an endpoint specified by @address
13084  * which must be in the D-Bus address format.
13085  *
13086  * This constructor can only be used to initiate client-side
13087  * connections - use g_dbus_connection_new_sync() if you need to act
13088  * as the server. In particular, @flags cannot contain the
13089  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13090  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13091  *
13092  * This is a synchronous failable constructor. See
13093  * g_dbus_connection_new_for_address() for the asynchronous version.
13094  *
13095  * If @observer is not %NULL it may be used to control the
13096  * authentication process.
13097  *
13098  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13099  * Since: 2.26
13100  */
13101
13102
13103 /**
13104  * g_dbus_connection_new_sync:
13105  * @stream: A #GIOStream.
13106  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13107  * @flags: Flags describing how to make the connection.
13108  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13109  * @cancellable: (allow-none): A #GCancellable or %NULL.
13110  * @error: Return location for error or %NULL.
13111  *
13112  * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13113  * with the end represented by @stream.
13114  *
13115  * If @stream is a #GSocketConnection, then the corresponding #GSocket
13116  * will be put into non-blocking mode.
13117  *
13118  * The D-Bus connection will interact with @stream from a worker thread.
13119  * As a result, the caller should not interact with @stream after this
13120  * method has been called, except by calling g_object_unref() on it.
13121  *
13122  * If @observer is not %NULL it may be used to control the
13123  * authentication process.
13124  *
13125  * This is a synchronous failable constructor. See
13126  * g_dbus_connection_new() for the asynchronous version.
13127  *
13128  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13129  * Since: 2.26
13130  */
13131
13132
13133 /**
13134  * g_dbus_connection_register_object:
13135  * @connection: A #GDBusConnection.
13136  * @object_path: The object path to register at.
13137  * @interface_info: Introspection data for the interface.
13138  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13139  * @user_data: (allow-none): Data to pass to functions in @vtable.
13140  * @user_data_free_func: Function to call when the object path is unregistered.
13141  * @error: Return location for error or %NULL.
13142  *
13143  * Registers callbacks for exported objects at @object_path with the
13144  * D-Bus interface that is described in @interface_info.
13145  *
13146  * Calls to functions in @vtable (and @user_data_free_func) will
13147  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13148  * loop</link> of the thread you are calling this method from.
13149  *
13150  * Note that all #GVariant values passed to functions in @vtable will match
13151  * the signature given in @interface_info - if a remote caller passes
13152  * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13153  * is returned to the remote caller.
13154  *
13155  * Additionally, if the remote caller attempts to invoke methods or
13156  * access properties not mentioned in @interface_info the
13157  * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13158  * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13159  * are returned to the caller.
13160  *
13161  * It is considered a programming error if the
13162  * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13163  * #GVariant of incorrect type.
13164  *
13165  * If an existing callback is already registered at @object_path and
13166  * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13167  *
13168  * GDBus automatically implements the standard D-Bus interfaces
13169  * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13170  * and org.freedesktop.Peer, so you don't have to implement those for
13171  * the objects you export. You <emphasis>can</emphasis> implement
13172  * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13173  * and setting of properties asynchronously.
13174  *
13175  * Note that the reference count on @interface_info will be
13176  * incremented by 1 (unless allocated statically, e.g. if the
13177  * reference count is -1, see g_dbus_interface_info_ref()) for as long
13178  * as the object is exported. Also note that @vtable will be copied.
13179  *
13180  * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13181  *
13182  * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13183  * Since: 2.26
13184  */
13185
13186
13187 /**
13188  * g_dbus_connection_register_subtree:
13189  * @connection: A #GDBusConnection.
13190  * @object_path: The object path to register the subtree at.
13191  * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13192  * @flags: Flags used to fine tune the behavior of the subtree.
13193  * @user_data: Data to pass to functions in @vtable.
13194  * @user_data_free_func: Function to call when the subtree is unregistered.
13195  * @error: Return location for error or %NULL.
13196  *
13197  * Registers a whole subtree of <quote>dynamic</quote> objects.
13198  *
13199  * The @enumerate and @introspection functions in @vtable are used to
13200  * convey, to remote callers, what nodes exist in the subtree rooted
13201  * by @object_path.
13202  *
13203  * When handling remote calls into any node in the subtree, first the
13204  * @enumerate function is used to check if the node exists. If the node exists
13205  * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13206  * the @introspection function is used to check if the node supports the
13207  * requested method. If so, the @dispatch function is used to determine
13208  * where to dispatch the call. The collected #GDBusInterfaceVTable and
13209  * #gpointer will be used to call into the interface vtable for processing
13210  * the request.
13211  *
13212  * All calls into user-provided code will be invoked in the <link
13213  * linkend="g-main-context-push-thread-default">thread-default main
13214  * loop</link> of the thread you are calling this method from.
13215  *
13216  * If an existing subtree is already registered at @object_path or
13217  * then @error is set to #G_IO_ERROR_EXISTS.
13218  *
13219  * Note that it is valid to register regular objects (using
13220  * g_dbus_connection_register_object()) in a subtree registered with
13221  * g_dbus_connection_register_subtree() - if so, the subtree handler
13222  * is tried as the last resort. One way to think about a subtree
13223  * handler is to consider it a <quote>fallback handler</quote>
13224  * for object paths not registered via g_dbus_connection_register_object()
13225  * or other bindings.
13226  *
13227  * Note that @vtable will be copied so you cannot change it after
13228  * registration.
13229  *
13230  * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13231  *
13232  * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13233  * Since: 2.26
13234  */
13235
13236
13237 /**
13238  * g_dbus_connection_remove_filter:
13239  * @connection: a #GDBusConnection
13240  * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13241  *
13242  * Removes a filter.
13243  *
13244  * Since: 2.26
13245  */
13246
13247
13248 /**
13249  * g_dbus_connection_send_message:
13250  * @connection: A #GDBusConnection.
13251  * @message: A #GDBusMessage
13252  * @flags: Flags affecting how the message is sent.
13253  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13254  * @error: Return location for error or %NULL.
13255  *
13256  * Asynchronously sends @message to the peer represented by @connection.
13257  *
13258  * Unless @flags contain the
13259  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13260  * will be assigned by @connection and set on @message via
13261  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13262  * serial number used will be written to this location prior to
13263  * submitting the message to the underlying transport.
13264  *
13265  * If @connection is closed then the operation will fail with
13266  * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13267  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13268  *
13269  * See <xref linkend="gdbus-server"/> and <xref
13270  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13271  * low-level API to send and receive UNIX file descriptors.
13272  *
13273  * Note that @message must be unlocked, unless @flags contain the
13274  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13275  *
13276  * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13277  * Since: 2.26
13278  */
13279
13280
13281 /**
13282  * g_dbus_connection_send_message_with_reply:
13283  * @connection: A #GDBusConnection.
13284  * @message: A #GDBusMessage.
13285  * @flags: Flags affecting how the message is sent.
13286  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13287  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13288  * @cancellable: (allow-none): A #GCancellable or %NULL.
13289  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13290  * @user_data: The data to pass to @callback.
13291  *
13292  * Asynchronously sends @message to the peer represented by @connection.
13293  *
13294  * Unless @flags contain the
13295  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13296  * will be assigned by @connection and set on @message via
13297  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13298  * serial number used will be written to this location prior to
13299  * submitting the message to the underlying transport.
13300  *
13301  * If @connection is closed then the operation will fail with
13302  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13303  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13304  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13305  *
13306  * This is an asynchronous method. When the operation is finished, @callback will be invoked
13307  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13308  * of the thread you are calling this method from. You can then call
13309  * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13310  * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13311  *
13312  * Note that @message must be unlocked, unless @flags contain the
13313  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13314  *
13315  * See <xref linkend="gdbus-server"/> and <xref
13316  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13317  * low-level API to send and receive UNIX file descriptors.
13318  *
13319  * Since: 2.26
13320  */
13321
13322
13323 /**
13324  * g_dbus_connection_send_message_with_reply_finish:
13325  * @connection: a #GDBusConnection
13326  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13327  * @error: Return location for error or %NULL.
13328  *
13329  * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13330  *
13331  * Note that @error is only set if a local in-process error
13332  * occurred. That is to say that the returned #GDBusMessage object may
13333  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13334  * g_dbus_message_to_gerror() to transcode this to a #GError.
13335  *
13336  * See <xref linkend="gdbus-server"/> and <xref
13337  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13338  * low-level API to send and receive UNIX file descriptors.
13339  *
13340  * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13341  * Since: 2.26
13342  */
13343
13344
13345 /**
13346  * g_dbus_connection_send_message_with_reply_sync:
13347  * @connection: A #GDBusConnection.
13348  * @message: A #GDBusMessage.
13349  * @flags: Flags affecting how the message is sent.
13350  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13351  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13352  * @cancellable: (allow-none): A #GCancellable or %NULL.
13353  * @error: Return location for error or %NULL.
13354  *
13355  * Synchronously sends @message to the peer represented by @connection
13356  * and blocks the calling thread until a reply is received or the
13357  * timeout is reached. See g_dbus_connection_send_message_with_reply()
13358  * for the asynchronous version of this method.
13359  *
13360  * Unless @flags contain the
13361  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13362  * will be assigned by @connection and set on @message via
13363  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13364  * serial number used will be written to this location prior to
13365  * submitting the message to the underlying transport.
13366  *
13367  * If @connection is closed then the operation will fail with
13368  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13369  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13370  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13371  *
13372  * Note that @error is only set if a local in-process error
13373  * occurred. That is to say that the returned #GDBusMessage object may
13374  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13375  * g_dbus_message_to_gerror() to transcode this to a #GError.
13376  *
13377  * See <xref linkend="gdbus-server"/> and <xref
13378  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13379  * low-level API to send and receive UNIX file descriptors.
13380  *
13381  * Note that @message must be unlocked, unless @flags contain the
13382  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13383  *
13384  * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13385  * Since: 2.26
13386  */
13387
13388
13389 /**
13390  * g_dbus_connection_set_exit_on_close:
13391  * @connection: A #GDBusConnection.
13392  * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13393  *
13394  * Sets whether the process should be terminated when @connection is
13395  * closed by the remote peer. See #GDBusConnection:exit-on-close for
13396  * more details.
13397  *
13398  * Note that this function should be used with care. Most modern UNIX
13399  * desktops tie the notion of a user session the session bus, and expect
13400  * all of a users applications to quit when their bus connection goes away.
13401  * If you are setting @exit_on_close to %FALSE for the shared session
13402  * bus connection, you should make sure that your application exits
13403  * when the user session ends.
13404  *
13405  * Since: 2.26
13406  */
13407
13408
13409 /**
13410  * g_dbus_connection_signal_subscribe:
13411  * @connection: A #GDBusConnection.
13412  * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13413  * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13414  * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13415  * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13416  * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13417  * @flags: Flags describing how to subscribe to the signal (currently unused).
13418  * @callback: Callback to invoke when there is a signal matching the requested data.
13419  * @user_data: User data to pass to @callback.
13420  * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13421  *
13422  * Subscribes to signals on @connection and invokes @callback with a
13423  * whenever the signal is received. Note that @callback
13424  * will be invoked in the <link
13425  * linkend="g-main-context-push-thread-default">thread-default main
13426  * loop</link> of the thread you are calling this method from.
13427  *
13428  * If @connection is not a message bus connection, @sender must be
13429  * %NULL.
13430  *
13431  * If @sender is a well-known name note that @callback is invoked with
13432  * the unique name for the owner of @sender, not the well-known name
13433  * as one would expect. This is because the message bus rewrites the
13434  * name. As such, to avoid certain race conditions, users should be
13435  * tracking the name owner of the well-known name and use that when
13436  * processing the received signal.
13437  *
13438  * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13439  * Since: 2.26
13440  */
13441
13442
13443 /**
13444  * g_dbus_connection_signal_unsubscribe:
13445  * @connection: A #GDBusConnection.
13446  * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13447  *
13448  * Unsubscribes from signals.
13449  *
13450  * Since: 2.26
13451  */
13452
13453
13454 /**
13455  * g_dbus_connection_start_message_processing:
13456  * @connection: A #GDBusConnection.
13457  *
13458  * If @connection was created with
13459  * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13460  * starts processing messages. Does nothing on if @connection wasn't
13461  * created with this flag or if the method has already been called.
13462  *
13463  * Since: 2.26
13464  */
13465
13466
13467 /**
13468  * g_dbus_connection_unexport_action_group:
13469  * @connection: a #GDBusConnection
13470  * @export_id: the ID from g_dbus_connection_export_action_group()
13471  *
13472  * Reverses the effect of a previous call to
13473  * g_dbus_connection_export_action_group().
13474  *
13475  * It is an error to call this function with an ID that wasn't returned
13476  * from g_dbus_connection_export_action_group() or to call it with the
13477  * same ID more than once.
13478  *
13479  * Since: 2.32
13480  */
13481
13482
13483 /**
13484  * g_dbus_connection_unexport_menu_model:
13485  * @connection: a #GDBusConnection
13486  * @export_id: the ID from g_dbus_connection_export_menu_model()
13487  *
13488  * Reverses the effect of a previous call to
13489  * g_dbus_connection_export_menu_model().
13490  *
13491  * It is an error to call this function with an ID that wasn't returned
13492  * from g_dbus_connection_export_menu_model() or to call it with the
13493  * same ID more than once.
13494  *
13495  * Since: 2.32
13496  */
13497
13498
13499 /**
13500  * g_dbus_connection_unregister_object:
13501  * @connection: A #GDBusConnection.
13502  * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13503  *
13504  * Unregisters an object.
13505  *
13506  * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13507  * Since: 2.26
13508  */
13509
13510
13511 /**
13512  * g_dbus_connection_unregister_subtree:
13513  * @connection: A #GDBusConnection.
13514  * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13515  *
13516  * Unregisters a subtree.
13517  *
13518  * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13519  * Since: 2.26
13520  */
13521
13522
13523 /**
13524  * g_dbus_error_encode_gerror:
13525  * @error: A #GError.
13526  *
13527  * Creates a D-Bus error name to use for @error. If @error matches
13528  * a registered error (cf. g_dbus_error_register_error()), the corresponding
13529  * D-Bus error name will be returned.
13530  *
13531  * Otherwise the a name of the form
13532  * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13533  * will be used. This allows other GDBus applications to map the error
13534  * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13535  *
13536  * This function is typically only used in object mappings to put a
13537  * #GError on the wire. Regular applications should not use it.
13538  *
13539  * Returns: A D-Bus error name (never %NULL). Free with g_free().
13540  * Since: 2.26
13541  */
13542
13543
13544 /**
13545  * g_dbus_error_get_remote_error:
13546  * @error: A #GError.
13547  *
13548  * Gets the D-Bus error name used for @error, if any.
13549  *
13550  * This function is guaranteed to return a D-Bus error name for all
13551  * #GError<!-- -->s returned from functions handling remote method
13552  * calls (e.g. g_dbus_connection_call_finish()) unless
13553  * g_dbus_error_strip_remote_error() has been used on @error.
13554  *
13555  * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13556  * Since: 2.26
13557  */
13558
13559
13560 /**
13561  * g_dbus_error_is_remote_error:
13562  * @error: A #GError.
13563  *
13564  * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13565  * use g_dbus_error_get_remote_error() to get the name of the error.
13566  *
13567  * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13568  * Since: 2.26
13569  */
13570
13571
13572 /**
13573  * g_dbus_error_new_for_dbus_error:
13574  * @dbus_error_name: D-Bus error name.
13575  * @dbus_error_message: D-Bus error message.
13576  *
13577  * Creates a #GError based on the contents of @dbus_error_name and
13578  * @dbus_error_message.
13579  *
13580  * Errors registered with g_dbus_error_register_error() will be looked
13581  * up using @dbus_error_name and if a match is found, the error domain
13582  * and code is used. Applications can use g_dbus_error_get_remote_error()
13583  * to recover @dbus_error_name.
13584  *
13585  * If a match against a registered error is not found and the D-Bus
13586  * error name is in a form as returned by g_dbus_error_encode_gerror()
13587  * the error domain and code encoded in the name is used to
13588  * create the #GError. Also, @dbus_error_name is added to the error message
13589  * such that it can be recovered with g_dbus_error_get_remote_error().
13590  *
13591  * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13592  * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13593  * added to the error message such that it can be recovered with
13594  * g_dbus_error_get_remote_error().
13595  *
13596  * In all three cases, @dbus_error_name can always be recovered from the
13597  * returned #GError using the g_dbus_error_get_remote_error() function
13598  * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13599  *
13600  * This function is typically only used in object mappings to prepare
13601  * #GError instances for applications. Regular applications should not use
13602  * it.
13603  *
13604  * Returns: An allocated #GError. Free with g_error_free().
13605  * Since: 2.26
13606  */
13607
13608
13609 /**
13610  * g_dbus_error_register_error:
13611  * @error_domain: A #GQuark for a error domain.
13612  * @error_code: An error code.
13613  * @dbus_error_name: A D-Bus error name.
13614  *
13615  * Creates an association to map between @dbus_error_name and
13616  * #GError<!-- -->s specified by @error_domain and @error_code.
13617  *
13618  * This is typically done in the routine that returns the #GQuark for
13619  * an error domain.
13620  *
13621  * Returns: %TRUE if the association was created, %FALSE if it already exists.
13622  * Since: 2.26
13623  */
13624
13625
13626 /**
13627  * g_dbus_error_register_error_domain:
13628  * @error_domain_quark_name: The error domain name.
13629  * @quark_volatile: A pointer where to store the #GQuark.
13630  * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13631  * @num_entries: Number of items to register.
13632  *
13633  * Helper function for associating a #GError error domain with D-Bus error names.
13634  *
13635  * Since: 2.26
13636  */
13637
13638
13639 /**
13640  * g_dbus_error_set_dbus_error:
13641  * @error: A pointer to a #GError or %NULL.
13642  * @dbus_error_name: D-Bus error name.
13643  * @dbus_error_message: D-Bus error message.
13644  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13645  * @...: Arguments for @format.
13646  *
13647  * Does nothing if @error is %NULL. Otherwise sets *@error to
13648  * a new #GError created with g_dbus_error_new_for_dbus_error()
13649  * with @dbus_error_message prepend with @format (unless %NULL).
13650  *
13651  * Since: 2.26
13652  */
13653
13654
13655 /**
13656  * g_dbus_error_set_dbus_error_valist:
13657  * @error: A pointer to a #GError or %NULL.
13658  * @dbus_error_name: D-Bus error name.
13659  * @dbus_error_message: D-Bus error message.
13660  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13661  * @var_args: Arguments for @format.
13662  *
13663  * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13664  *
13665  * Since: 2.26
13666  */
13667
13668
13669 /**
13670  * g_dbus_error_strip_remote_error:
13671  * @error: A #GError.
13672  *
13673  * Looks for extra information in the error message used to recover
13674  * the D-Bus error name and strips it if found. If stripped, the
13675  * message field in @error will correspond exactly to what was
13676  * received on the wire.
13677  *
13678  * This is typically used when presenting errors to the end user.
13679  *
13680  * Returns: %TRUE if information was stripped, %FALSE otherwise.
13681  * Since: 2.26
13682  */
13683
13684
13685 /**
13686  * g_dbus_error_unregister_error:
13687  * @error_domain: A #GQuark for a error domain.
13688  * @error_code: An error code.
13689  * @dbus_error_name: A D-Bus error name.
13690  *
13691  * Destroys an association previously set up with g_dbus_error_register_error().
13692  *
13693  * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13694  * Since: 2.26
13695  */
13696
13697
13698 /**
13699  * g_dbus_generate_guid:
13700  *
13701  * Generate a D-Bus GUID that can be used with
13702  * e.g. g_dbus_connection_new().
13703  *
13704  * See the D-Bus specification regarding what strings are valid D-Bus
13705  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13706  *
13707  * Returns: A valid D-Bus GUID. Free with g_free().
13708  * Since: 2.26
13709  */
13710
13711
13712 /**
13713  * g_dbus_gvalue_to_gvariant:
13714  * @gvalue: A #GValue to convert to a #GVariant.
13715  * @type: A #GVariantType.
13716  *
13717  * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13718  *
13719  * The conversion is using the following rules:
13720  * <table frame='all'>
13721  *   <title>#GValue / #GVariant conversion rules</title>
13722  *   <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13723  *     <thead>
13724  *       <row>
13725  *         <entry>If the #GType for @gvalue is...</entry>
13726  *         <entry>... then @type must be</entry>
13727  *       </row>
13728  *     </thead>
13729  *     <tbody>
13730  *       <row>
13731  *         <entry>#G_TYPE_STRING</entry>
13732  *         <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>
13733  *       </row>
13734  *       <row>
13735  *         <entry>#G_TYPE_STRV</entry>
13736  *         <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>
13737  *       </row>
13738  *       <row>
13739  *         <entry>#G_TYPE_BOOLEAN</entry>
13740  *         <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13741  *       </row>
13742  *       <row>
13743  *         <entry>#G_TYPE_UCHAR</entry>
13744  *         <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13745  *       </row>
13746  *       <row>
13747  *         <entry>#G_TYPE_INT</entry>
13748  *         <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13749  *       </row>
13750  *       <row>
13751  *         <entry>#G_TYPE_UINT</entry>
13752  *         <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13753  *       </row>
13754  *       <row>
13755  *         <entry>#G_TYPE_INT64</entry>
13756  *         <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13757  *       </row>
13758  *       <row>
13759  *         <entry>#G_TYPE_UINT64</entry>
13760  *         <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13761  *       </row>
13762  *       <row>
13763  *         <entry>#G_TYPE_DOUBLE</entry>
13764  *         <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13765  *       </row>
13766  *       <row>
13767  *         <entry>#G_TYPE_VARIANT</entry>
13768  *         <entry>Any #GVariantType</entry>
13769  *       </row>
13770  *     </tbody>
13771  *   </tgroup>
13772  * </table>
13773  * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13774  * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13775  * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13776  * #G_TYPE_BOXED derived-types) not in the table above.
13777  *
13778  * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13779  * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13780  * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13781  * string for string types, <literal>'/'</literal> for object path
13782  * types, the empty array for any array type and so on).
13783  *
13784  * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13785  * #GVariant to a #GValue.
13786  *
13787  * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13788  * Since: 2.30
13789  */
13790
13791
13792 /**
13793  * g_dbus_gvariant_to_gvalue:
13794  * @value: A #GVariant.
13795  * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13796  *
13797  * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13798  *
13799  * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13800  * used - this function is essentially its reverse form.
13801  *
13802  * The conversion never fails - a valid #GValue is always returned in
13803  * @out_gvalue.
13804  *
13805  * Since: 2.30
13806  */
13807
13808
13809 /**
13810  * g_dbus_interface_dup_object:
13811  * @interface_: An exported D-Bus interface.
13812  *
13813  * Gets the #GDBusObject that @interface_ belongs to, if any.
13814  *
13815  * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13816  * Since: 2.32
13817  * Rename to: g_dbus_interface_get_object
13818  */
13819
13820
13821 /**
13822  * g_dbus_interface_get_info:
13823  * @interface_: An exported D-Bus interface.
13824  *
13825  * Gets D-Bus introspection information for the D-Bus interface
13826  * implemented by @interface_.
13827  *
13828  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13829  * Since: 2.30
13830  */
13831
13832
13833 /**
13834  * g_dbus_interface_get_object: (skip)
13835  * @interface_: An exported D-Bus interface.
13836  *
13837  * Gets the #GDBusObject that @interface_ belongs to, if any.
13838  *
13839  * <warning>It is not safe to use the returned object if @interface_
13840  * or the returned object is being used from other threads. See
13841  * g_dbus_interface_dup_object() for a thread-safe
13842  * alternative.</warning>
13843  *
13844  * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13845  * Since: 2.30
13846  */
13847
13848
13849 /**
13850  * g_dbus_interface_info_cache_build:
13851  * @info: A #GDBusInterfaceInfo.
13852  *
13853  * Builds a lookup-cache to speed up
13854  * g_dbus_interface_info_lookup_method(),
13855  * g_dbus_interface_info_lookup_signal() and
13856  * g_dbus_interface_info_lookup_property().
13857  *
13858  * If this has already been called with @info, the existing cache is
13859  * used and its use count is increased.
13860  *
13861  * Note that @info cannot be modified until
13862  * g_dbus_interface_info_cache_release() is called.
13863  *
13864  * Since: 2.30
13865  */
13866
13867
13868 /**
13869  * g_dbus_interface_info_cache_release:
13870  * @info: A GDBusInterfaceInfo
13871  *
13872  * Decrements the usage count for the cache for @info built by
13873  * g_dbus_interface_info_cache_build() (if any) and frees the
13874  * resources used by the cache if the usage count drops to zero.
13875  *
13876  * Since: 2.30
13877  */
13878
13879
13880 /**
13881  * g_dbus_interface_info_generate_xml:
13882  * @info: A #GDBusNodeInfo
13883  * @indent: Indentation level.
13884  * @string_builder: (out): A #GString to to append XML data to.
13885  *
13886  * Appends an XML representation of @info (and its children) to @string_builder.
13887  *
13888  * This function is typically used for generating introspection XML
13889  * documents at run-time for handling the
13890  * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13891  * method.
13892  *
13893  * Since: 2.26
13894  */
13895
13896
13897 /**
13898  * g_dbus_interface_info_lookup_method:
13899  * @info: A #GDBusInterfaceInfo.
13900  * @name: A D-Bus method name (typically in CamelCase)
13901  *
13902  * Looks up information about a method.
13903  *
13904  * This cost of this function is O(n) in number of methods unless
13905  * g_dbus_interface_info_cache_build() has been used on @info.
13906  *
13907  * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13908  * Since: 2.26
13909  */
13910
13911
13912 /**
13913  * g_dbus_interface_info_lookup_property:
13914  * @info: A #GDBusInterfaceInfo.
13915  * @name: A D-Bus property name (typically in CamelCase).
13916  *
13917  * Looks up information about a property.
13918  *
13919  * This cost of this function is O(n) in number of properties unless
13920  * g_dbus_interface_info_cache_build() has been used on @info.
13921  *
13922  * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
13923  * Since: 2.26
13924  */
13925
13926
13927 /**
13928  * g_dbus_interface_info_lookup_signal:
13929  * @info: A #GDBusInterfaceInfo.
13930  * @name: A D-Bus signal name (typically in CamelCase)
13931  *
13932  * Looks up information about a signal.
13933  *
13934  * This cost of this function is O(n) in number of signals unless
13935  * g_dbus_interface_info_cache_build() has been used on @info.
13936  *
13937  * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
13938  * Since: 2.26
13939  */
13940
13941
13942 /**
13943  * g_dbus_interface_info_ref:
13944  * @info: A #GDBusInterfaceInfo
13945  *
13946  * If @info is statically allocated does nothing. Otherwise increases
13947  * the reference count.
13948  *
13949  * Returns: The same @info.
13950  * Since: 2.26
13951  */
13952
13953
13954 /**
13955  * g_dbus_interface_info_unref:
13956  * @info: A #GDBusInterfaceInfo.
13957  *
13958  * If @info is statically allocated, does nothing. Otherwise decreases
13959  * the reference count of @info. When its reference count drops to 0,
13960  * the memory used is freed.
13961  *
13962  * Since: 2.26
13963  */
13964
13965
13966 /**
13967  * g_dbus_interface_set_object:
13968  * @interface_: An exported D-Bus interface.
13969  * @object: (allow-none): A #GDBusObject or %NULL.
13970  *
13971  * Sets the #GDBusObject for @interface_ to @object.
13972  *
13973  * Note that @interface_ will hold a weak reference to @object.
13974  *
13975  * Since: 2.30
13976  */
13977
13978
13979 /**
13980  * g_dbus_interface_skeleton_export:
13981  * @interface_: The D-Bus interface to export.
13982  * @connection: A #GDBusConnection to export @interface_ on.
13983  * @object_path: The path to export the interface at.
13984  * @error: Return location for error or %NULL.
13985  *
13986  * Exports @interface_ at @object_path on @connection.
13987  *
13988  * This can be called multiple times to export the same @interface_
13989  * onto multiple connections however the @object_path provided must be
13990  * the same for all connections.
13991  *
13992  * Use g_dbus_interface_skeleton_unexport() to unexport the object.
13993  *
13994  * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
13995  * Since: 2.30
13996  */
13997
13998
13999 /**
14000  * g_dbus_interface_skeleton_flush:
14001  * @interface_: A #GDBusInterfaceSkeleton.
14002  *
14003  * If @interface_ has outstanding changes, request for these changes to be
14004  * emitted immediately.
14005  *
14006  * For example, an exported D-Bus interface may queue up property
14007  * changes and emit the
14008  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14009  * signal later (e.g. in an idle handler). This technique is useful
14010  * for collapsing multiple property changes into one.
14011  *
14012  * Since: 2.30
14013  */
14014
14015
14016 /**
14017  * g_dbus_interface_skeleton_get_connection:
14018  * @interface_: A #GDBusInterfaceSkeleton.
14019  *
14020  * Gets the first connection that @interface_ is exported on, if any.
14021  *
14022  * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14023  * Since: 2.30
14024  */
14025
14026
14027 /**
14028  * g_dbus_interface_skeleton_get_connections:
14029  * @interface_: A #GDBusInterfaceSkeleton.
14030  *
14031  * Gets a list of the connections that @interface_ is exported on.
14032  *
14033  * 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().
14034  * Since: 2.32
14035  */
14036
14037
14038 /**
14039  * g_dbus_interface_skeleton_get_flags:
14040  * @interface_: A #GDBusInterfaceSkeleton.
14041  *
14042  * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14043  * of @interface_
14044  *
14045  * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14046  * Since: 2.30
14047  */
14048
14049
14050 /**
14051  * g_dbus_interface_skeleton_get_info:
14052  * @interface_: A #GDBusInterfaceSkeleton.
14053  *
14054  * Gets D-Bus introspection information for the D-Bus interface
14055  * implemented by @interface_.
14056  *
14057  * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14058  * Since: 2.30
14059  */
14060
14061
14062 /**
14063  * g_dbus_interface_skeleton_get_object_path:
14064  * @interface_: A #GDBusInterfaceSkeleton.
14065  *
14066  * Gets the object path that @interface_ is exported on, if any.
14067  *
14068  * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14069  * Since: 2.30
14070  */
14071
14072
14073 /**
14074  * g_dbus_interface_skeleton_get_properties:
14075  * @interface_: A #GDBusInterfaceSkeleton.
14076  *
14077  * Gets all D-Bus properties for @interface_.
14078  *
14079  * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14080  * Since: 2.30
14081  */
14082
14083
14084 /**
14085  * g_dbus_interface_skeleton_get_vtable: (skip)
14086  * @interface_: A #GDBusInterfaceSkeleton.
14087  *
14088  * Gets the interface vtable for the D-Bus interface implemented by
14089  * @interface_. The returned function pointers should expect @interface_
14090  * itself to be passed as @user_data.
14091  *
14092  * Returns: A #GDBusInterfaceVTable (never %NULL).
14093  * Since: 2.30
14094  */
14095
14096
14097 /**
14098  * g_dbus_interface_skeleton_has_connection:
14099  * @interface_: A #GDBusInterfaceSkeleton.
14100  * @connection: A #GDBusConnection.
14101  *
14102  * Checks if @interface_ is export on @connection.
14103  *
14104  * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14105  * Since: 2.32
14106  */
14107
14108
14109 /**
14110  * g_dbus_interface_skeleton_set_flags:
14111  * @interface_: A #GDBusInterfaceSkeleton.
14112  * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14113  *
14114  * Sets flags describing what the behavior of @skeleton should be.
14115  *
14116  * Since: 2.30
14117  */
14118
14119
14120 /**
14121  * g_dbus_interface_skeleton_unexport:
14122  * @interface_: A #GDBusInterfaceSkeleton.
14123  *
14124  * Stops exporting @interface_ on all connections it is exported on.
14125  *
14126  * To unexport @interface_ from only a single connection, use
14127  * g_dbus_interface_skeleton_unexport_from_connection()
14128  *
14129  * Since: 2.30
14130  */
14131
14132
14133 /**
14134  * g_dbus_interface_skeleton_unexport_from_connection:
14135  * @interface_: A #GDBusInterfaceSkeleton.
14136  * @connection: A #GDBusConnection.
14137  *
14138  * Stops exporting @interface_ on @connection.
14139  *
14140  * To stop exporting on all connections the interface is exported on,
14141  * use g_dbus_interface_skeleton_unexport().
14142  *
14143  * Since: 2.32
14144  */
14145
14146
14147 /**
14148  * g_dbus_is_address:
14149  * @string: A string.
14150  *
14151  * Checks if @string is a D-Bus address.
14152  *
14153  * This doesn't check if @string is actually supported by #GDBusServer
14154  * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14155  * checks.
14156  *
14157  * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14158  * Since: 2.26
14159  */
14160
14161
14162 /**
14163  * g_dbus_is_guid:
14164  * @string: The string to check.
14165  *
14166  * Checks if @string is a D-Bus GUID.
14167  *
14168  * See the D-Bus specification regarding what strings are valid D-Bus
14169  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14170  *
14171  * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14172  * Since: 2.26
14173  */
14174
14175
14176 /**
14177  * g_dbus_is_interface_name:
14178  * @string: The string to check.
14179  *
14180  * Checks if @string is a valid D-Bus interface name.
14181  *
14182  * Returns: %TRUE if valid, %FALSE otherwise.
14183  * Since: 2.26
14184  */
14185
14186
14187 /**
14188  * g_dbus_is_member_name:
14189  * @string: The string to check.
14190  *
14191  * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14192  *
14193  * Returns: %TRUE if valid, %FALSE otherwise.
14194  * Since: 2.26
14195  */
14196
14197
14198 /**
14199  * g_dbus_is_name:
14200  * @string: The string to check.
14201  *
14202  * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14203  *
14204  * Returns: %TRUE if valid, %FALSE otherwise.
14205  * Since: 2.26
14206  */
14207
14208
14209 /**
14210  * g_dbus_is_supported_address:
14211  * @string: A string.
14212  * @error: Return location for error or %NULL.
14213  *
14214  * Like g_dbus_is_address() but also checks if the library suppors the
14215  * transports in @string and that key/value pairs for each transport
14216  * are valid.
14217  *
14218  * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14219  * Since: 2.26
14220  */
14221
14222
14223 /**
14224  * g_dbus_is_unique_name:
14225  * @string: The string to check.
14226  *
14227  * Checks if @string is a valid D-Bus unique bus name.
14228  *
14229  * Returns: %TRUE if valid, %FALSE otherwise.
14230  * Since: 2.26
14231  */
14232
14233
14234 /**
14235  * g_dbus_menu_model_get:
14236  * @connection: a #GDBusConnection
14237  * @bus_name: the bus name which exports the menu model
14238  * @object_path: the object path at which the menu model is exported
14239  *
14240  * Obtains a #GDBusMenuModel for the menu model which is exported
14241  * at the given @bus_name and @object_path.
14242  *
14243  * The thread default main context is taken at the time of this call.
14244  * All signals on the menu model (and any linked models) are reported
14245  * with respect to this context.  All calls on the returned menu model
14246  * (and linked models) must also originate from this same context, with
14247  * the thread default main context unchanged.
14248  *
14249  * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14250  * Since: 2.32
14251  */
14252
14253
14254 /**
14255  * g_dbus_message_bytes_needed:
14256  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14257  * @blob_len: The length of @blob (must be at least 16).
14258  * @error: Return location for error or %NULL.
14259  *
14260  * Utility function to calculate how many bytes are needed to
14261  * completely deserialize the D-Bus message stored at @blob.
14262  *
14263  * 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).
14264  * Since: 2.26
14265  */
14266
14267
14268 /**
14269  * g_dbus_message_copy:
14270  * @message: A #GDBusMessage.
14271  * @error: Return location for error or %NULL.
14272  *
14273  * Copies @message. The copy is a deep copy and the returned
14274  * #GDBusMessage is completely identical except that it is guaranteed
14275  * to not be locked.
14276  *
14277  * This operation can fail if e.g. @message contains file descriptors
14278  * and the per-process or system-wide open files limit is reached.
14279  *
14280  * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14281  * Since: 2.26
14282  */
14283
14284
14285 /**
14286  * g_dbus_message_get_arg0:
14287  * @message: A #GDBusMessage.
14288  *
14289  * Convenience to get the first item in the body of @message.
14290  *
14291  * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14292  * Since: 2.26
14293  */
14294
14295
14296 /**
14297  * g_dbus_message_get_body:
14298  * @message: A #GDBusMessage.
14299  *
14300  * Gets the body of a message.
14301  *
14302  * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14303  * Since: 2.26
14304  */
14305
14306
14307 /**
14308  * g_dbus_message_get_byte_order:
14309  * @message: A #GDBusMessage.
14310  *
14311  * Gets the byte order of @message.
14312  *
14313  * Returns: The byte order.
14314  */
14315
14316
14317 /**
14318  * g_dbus_message_get_destination:
14319  * @message: A #GDBusMessage.
14320  *
14321  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14322  *
14323  * Returns: The value.
14324  * Since: 2.26
14325  */
14326
14327
14328 /**
14329  * g_dbus_message_get_error_name:
14330  * @message: A #GDBusMessage.
14331  *
14332  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14333  *
14334  * Returns: The value.
14335  * Since: 2.26
14336  */
14337
14338
14339 /**
14340  * g_dbus_message_get_flags:
14341  * @message: A #GDBusMessage.
14342  *
14343  * Gets the flags for @message.
14344  *
14345  * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14346  * Since: 2.26
14347  */
14348
14349
14350 /**
14351  * g_dbus_message_get_header:
14352  * @message: A #GDBusMessage.
14353  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14354  *
14355  * Gets a header field on @message.
14356  *
14357  * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14358  * Since: 2.26
14359  */
14360
14361
14362 /**
14363  * g_dbus_message_get_header_fields:
14364  * @message: A #GDBusMessage.
14365  *
14366  * Gets an array of all header fields on @message that are set.
14367  *
14368  * 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().
14369  * Since: 2.26
14370  */
14371
14372
14373 /**
14374  * g_dbus_message_get_interface:
14375  * @message: A #GDBusMessage.
14376  *
14377  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14378  *
14379  * Returns: The value.
14380  * Since: 2.26
14381  */
14382
14383
14384 /**
14385  * g_dbus_message_get_locked:
14386  * @message: A #GDBusMessage.
14387  *
14388  * Checks whether @message is locked. To monitor changes to this
14389  * value, conncet to the #GObject::notify signal to listen for changes
14390  * on the #GDBusMessage:locked property.
14391  *
14392  * Returns: %TRUE if @message is locked, %FALSE otherwise.
14393  * Since: 2.26
14394  */
14395
14396
14397 /**
14398  * g_dbus_message_get_member:
14399  * @message: A #GDBusMessage.
14400  *
14401  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14402  *
14403  * Returns: The value.
14404  * Since: 2.26
14405  */
14406
14407
14408 /**
14409  * g_dbus_message_get_message_type:
14410  * @message: A #GDBusMessage.
14411  *
14412  * Gets the type of @message.
14413  *
14414  * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14415  * Since: 2.26
14416  */
14417
14418
14419 /**
14420  * g_dbus_message_get_num_unix_fds:
14421  * @message: A #GDBusMessage.
14422  *
14423  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14424  *
14425  * Returns: The value.
14426  * Since: 2.26
14427  */
14428
14429
14430 /**
14431  * g_dbus_message_get_path:
14432  * @message: A #GDBusMessage.
14433  *
14434  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14435  *
14436  * Returns: The value.
14437  * Since: 2.26
14438  */
14439
14440
14441 /**
14442  * g_dbus_message_get_reply_serial:
14443  * @message: A #GDBusMessage.
14444  *
14445  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14446  *
14447  * Returns: The value.
14448  * Since: 2.26
14449  */
14450
14451
14452 /**
14453  * g_dbus_message_get_sender:
14454  * @message: A #GDBusMessage.
14455  *
14456  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14457  *
14458  * Returns: The value.
14459  * Since: 2.26
14460  */
14461
14462
14463 /**
14464  * g_dbus_message_get_serial:
14465  * @message: A #GDBusMessage.
14466  *
14467  * Gets the serial for @message.
14468  *
14469  * Returns: A #guint32.
14470  * Since: 2.26
14471  */
14472
14473
14474 /**
14475  * g_dbus_message_get_signature:
14476  * @message: A #GDBusMessage.
14477  *
14478  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14479  *
14480  * Returns: The value.
14481  * Since: 2.26
14482  */
14483
14484
14485 /**
14486  * g_dbus_message_get_unix_fd_list:
14487  * @message: A #GDBusMessage.
14488  *
14489  * Gets the UNIX file descriptors associated with @message, if any.
14490  *
14491  * This method is only available on UNIX.
14492  *
14493  * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14494  * Since: 2.26
14495  */
14496
14497
14498 /**
14499  * g_dbus_message_lock:
14500  * @message: A #GDBusMessage.
14501  *
14502  * If @message is locked, does nothing. Otherwise locks the message.
14503  *
14504  * Since: 2.26
14505  */
14506
14507
14508 /**
14509  * g_dbus_message_new:
14510  *
14511  * Creates a new empty #GDBusMessage.
14512  *
14513  * Returns: A #GDBusMessage. Free with g_object_unref().
14514  * Since: 2.26
14515  */
14516
14517
14518 /**
14519  * g_dbus_message_new_from_blob:
14520  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14521  * @blob_len: The length of @blob.
14522  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14523  * @error: Return location for error or %NULL.
14524  *
14525  * Creates a new #GDBusMessage from the data stored at @blob. The byte
14526  * order that the message was in can be retrieved using
14527  * g_dbus_message_get_byte_order().
14528  *
14529  * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14530  * Since: 2.26
14531  */
14532
14533
14534 /**
14535  * g_dbus_message_new_method_call:
14536  * @name: (allow-none): A valid D-Bus name or %NULL.
14537  * @path: A valid object path.
14538  * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14539  * @method: A valid method name.
14540  *
14541  * Creates a new #GDBusMessage for a method call.
14542  *
14543  * Returns: A #GDBusMessage. Free with g_object_unref().
14544  * Since: 2.26
14545  */
14546
14547
14548 /**
14549  * g_dbus_message_new_method_error:
14550  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14551  * @error_name: A valid D-Bus error name.
14552  * @error_message_format: The D-Bus error message in a printf() format.
14553  * @...: Arguments for @error_message_format.
14554  *
14555  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14556  *
14557  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14558  * Since: 2.26
14559  */
14560
14561
14562 /**
14563  * g_dbus_message_new_method_error_literal:
14564  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14565  * @error_name: A valid D-Bus error name.
14566  * @error_message: The D-Bus error message.
14567  *
14568  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14569  *
14570  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14571  * Since: 2.26
14572  */
14573
14574
14575 /**
14576  * g_dbus_message_new_method_error_valist:
14577  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14578  * @error_name: A valid D-Bus error name.
14579  * @error_message_format: The D-Bus error message in a printf() format.
14580  * @var_args: Arguments for @error_message_format.
14581  *
14582  * Like g_dbus_message_new_method_error() but intended for language bindings.
14583  *
14584  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14585  * Since: 2.26
14586  */
14587
14588
14589 /**
14590  * g_dbus_message_new_method_reply:
14591  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14592  *
14593  * Creates a new #GDBusMessage that is a reply to @method_call_message.
14594  *
14595  * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14596  * Since: 2.26
14597  */
14598
14599
14600 /**
14601  * g_dbus_message_new_signal:
14602  * @path: A valid object path.
14603  * @interface_: A valid D-Bus interface name.
14604  * @signal: A valid signal name.
14605  *
14606  * Creates a new #GDBusMessage for a signal emission.
14607  *
14608  * Returns: A #GDBusMessage. Free with g_object_unref().
14609  * Since: 2.26
14610  */
14611
14612
14613 /**
14614  * g_dbus_message_print:
14615  * @message: A #GDBusMessage.
14616  * @indent: Indentation level.
14617  *
14618  * Produces a human-readable multi-line description of @message.
14619  *
14620  * The contents of the description has no ABI guarantees, the contents
14621  * and formatting is subject to change at any time. Typical output
14622  * looks something like this:
14623  * <programlisting>
14624  * Type&colon;    method-call
14625  * Flags&colon;   none
14626  * Version&colon; 0
14627  * Serial&colon;  4
14628  * Headers&colon;
14629  *   path -> objectpath '/org/gtk/GDBus/TestObject'
14630  *   interface -> 'org.gtk.GDBus.TestInterface'
14631  *   member -> 'GimmeStdout'
14632  *   destination -> ':1.146'
14633  * Body&colon; ()
14634  * UNIX File Descriptors:
14635  *   (none)
14636  * </programlisting>
14637  * or
14638  * <programlisting>
14639  * Type&colon;    method-return
14640  * Flags&colon;   no-reply-expected
14641  * Version&colon; 0
14642  * Serial&colon;  477
14643  * Headers&colon;
14644  *   reply-serial -> uint32 4
14645  *   destination -> ':1.159'
14646  *   sender -> ':1.146'
14647  *   num-unix-fds -> uint32 1
14648  * Body&colon; ()
14649  * UNIX File Descriptors&colon;
14650  *   fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14651  * </programlisting>
14652  *
14653  * Returns: A string that should be freed with g_free().
14654  * Since: 2.26
14655  */
14656
14657
14658 /**
14659  * g_dbus_message_set_body:
14660  * @message: A #GDBusMessage.
14661  * @body: Either %NULL or a #GVariant that is a tuple.
14662  *
14663  * Sets the body @message. As a side-effect the
14664  * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14665  * type string of @body (or cleared if @body is %NULL).
14666  *
14667  * If @body is floating, @message assumes ownership of @body.
14668  *
14669  * Since: 2.26
14670  */
14671
14672
14673 /**
14674  * g_dbus_message_set_byte_order:
14675  * @message: A #GDBusMessage.
14676  * @byte_order: The byte order.
14677  *
14678  * Sets the byte order of @message.
14679  */
14680
14681
14682 /**
14683  * g_dbus_message_set_destination:
14684  * @message: A #GDBusMessage.
14685  * @value: The value to set.
14686  *
14687  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14688  *
14689  * Since: 2.26
14690  */
14691
14692
14693 /**
14694  * g_dbus_message_set_error_name:
14695  * @message: A #GDBusMessage.
14696  * @value: The value to set.
14697  *
14698  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14699  *
14700  * Since: 2.26
14701  */
14702
14703
14704 /**
14705  * g_dbus_message_set_flags:
14706  * @message: A #GDBusMessage.
14707  * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14708  *
14709  * Sets the flags to set on @message.
14710  *
14711  * Since: 2.26
14712  */
14713
14714
14715 /**
14716  * g_dbus_message_set_header:
14717  * @message: A #GDBusMessage.
14718  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14719  * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14720  *
14721  * Sets a header field on @message.
14722  *
14723  * If @value is floating, @message assumes ownership of @value.
14724  *
14725  * Since: 2.26
14726  */
14727
14728
14729 /**
14730  * g_dbus_message_set_interface:
14731  * @message: A #GDBusMessage.
14732  * @value: The value to set.
14733  *
14734  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14735  *
14736  * Since: 2.26
14737  */
14738
14739
14740 /**
14741  * g_dbus_message_set_member:
14742  * @message: A #GDBusMessage.
14743  * @value: The value to set.
14744  *
14745  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14746  *
14747  * Since: 2.26
14748  */
14749
14750
14751 /**
14752  * g_dbus_message_set_message_type:
14753  * @message: A #GDBusMessage.
14754  * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14755  *
14756  * Sets @message to be of @type.
14757  *
14758  * Since: 2.26
14759  */
14760
14761
14762 /**
14763  * g_dbus_message_set_num_unix_fds:
14764  * @message: A #GDBusMessage.
14765  * @value: The value to set.
14766  *
14767  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14768  *
14769  * Since: 2.26
14770  */
14771
14772
14773 /**
14774  * g_dbus_message_set_path:
14775  * @message: A #GDBusMessage.
14776  * @value: The value to set.
14777  *
14778  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14779  *
14780  * Since: 2.26
14781  */
14782
14783
14784 /**
14785  * g_dbus_message_set_reply_serial:
14786  * @message: A #GDBusMessage.
14787  * @value: The value to set.
14788  *
14789  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14790  *
14791  * Since: 2.26
14792  */
14793
14794
14795 /**
14796  * g_dbus_message_set_sender:
14797  * @message: A #GDBusMessage.
14798  * @value: The value to set.
14799  *
14800  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14801  *
14802  * Since: 2.26
14803  */
14804
14805
14806 /**
14807  * g_dbus_message_set_serial:
14808  * @message: A #GDBusMessage.
14809  * @serial: A #guint32.
14810  *
14811  * Sets the serial for @message.
14812  *
14813  * Since: 2.26
14814  */
14815
14816
14817 /**
14818  * g_dbus_message_set_signature:
14819  * @message: A #GDBusMessage.
14820  * @value: The value to set.
14821  *
14822  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14823  *
14824  * Since: 2.26
14825  */
14826
14827
14828 /**
14829  * g_dbus_message_set_unix_fd_list:
14830  * @message: A #GDBusMessage.
14831  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14832  *
14833  * Sets the UNIX file descriptors associated with @message. As a
14834  * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14835  * field is set to the number of fds in @fd_list (or cleared if
14836  * @fd_list is %NULL).
14837  *
14838  * This method is only available on UNIX.
14839  *
14840  * Since: 2.26
14841  */
14842
14843
14844 /**
14845  * g_dbus_message_to_blob:
14846  * @message: A #GDBusMessage.
14847  * @out_size: Return location for size of generated blob.
14848  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14849  * @error: Return location for error.
14850  *
14851  * Serializes @message to a blob. The byte order returned by
14852  * g_dbus_message_get_byte_order() will be used.
14853  *
14854  * 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().
14855  * Since: 2.26
14856  */
14857
14858
14859 /**
14860  * g_dbus_message_to_gerror:
14861  * @message: A #GDBusMessage.
14862  * @error: The #GError to set.
14863  *
14864  * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14865  * nothing and returns %FALSE.
14866  *
14867  * Otherwise this method encodes the error in @message as a #GError
14868  * using g_dbus_error_set_dbus_error() using the information in the
14869  * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14870  * well as the first string item in @message's body.
14871  *
14872  * Returns: %TRUE if @error was set, %FALSE otherwise.
14873  * Since: 2.26
14874  */
14875
14876
14877 /**
14878  * g_dbus_method_info_ref:
14879  * @info: A #GDBusMethodInfo
14880  *
14881  * If @info is statically allocated does nothing. Otherwise increases
14882  * the reference count.
14883  *
14884  * Returns: The same @info.
14885  * Since: 2.26
14886  */
14887
14888
14889 /**
14890  * g_dbus_method_info_unref:
14891  * @info: A #GDBusMethodInfo.
14892  *
14893  * If @info is statically allocated, does nothing. Otherwise decreases
14894  * the reference count of @info. When its reference count drops to 0,
14895  * the memory used is freed.
14896  *
14897  * Since: 2.26
14898  */
14899
14900
14901 /**
14902  * g_dbus_method_invocation_get_connection:
14903  * @invocation: A #GDBusMethodInvocation.
14904  *
14905  * Gets the #GDBusConnection the method was invoked on.
14906  *
14907  * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14908  * Since: 2.26
14909  */
14910
14911
14912 /**
14913  * g_dbus_method_invocation_get_interface_name:
14914  * @invocation: A #GDBusMethodInvocation.
14915  *
14916  * Gets the name of the D-Bus interface the method was invoked on.
14917  *
14918  * Returns: A string. Do not free, it is owned by @invocation.
14919  * Since: 2.26
14920  */
14921
14922
14923 /**
14924  * g_dbus_method_invocation_get_message:
14925  * @invocation: A #GDBusMethodInvocation.
14926  *
14927  * Gets the #GDBusMessage for the method invocation. This is useful if
14928  * you need to use low-level protocol features, such as UNIX file
14929  * descriptor passing, that cannot be properly expressed in the
14930  * #GVariant API.
14931  *
14932  * See <xref linkend="gdbus-server"/> and <xref
14933  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14934  * low-level API to send and receive UNIX file descriptors.
14935  *
14936  * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
14937  * Since: 2.26
14938  */
14939
14940
14941 /**
14942  * g_dbus_method_invocation_get_method_info:
14943  * @invocation: A #GDBusMethodInvocation.
14944  *
14945  * Gets information about the method call, if any.
14946  *
14947  * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
14948  * Since: 2.26
14949  */
14950
14951
14952 /**
14953  * g_dbus_method_invocation_get_method_name:
14954  * @invocation: A #GDBusMethodInvocation.
14955  *
14956  * Gets the name of the method that was invoked.
14957  *
14958  * Returns: A string. Do not free, it is owned by @invocation.
14959  * Since: 2.26
14960  */
14961
14962
14963 /**
14964  * g_dbus_method_invocation_get_object_path:
14965  * @invocation: A #GDBusMethodInvocation.
14966  *
14967  * Gets the object path the method was invoked on.
14968  *
14969  * Returns: A string. Do not free, it is owned by @invocation.
14970  * Since: 2.26
14971  */
14972
14973
14974 /**
14975  * g_dbus_method_invocation_get_parameters:
14976  * @invocation: A #GDBusMethodInvocation.
14977  *
14978  * Gets the parameters of the method invocation. If there are no input
14979  * parameters then this will return a GVariant with 0 children rather than NULL.
14980  *
14981  * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
14982  * Since: 2.26
14983  */
14984
14985
14986 /**
14987  * g_dbus_method_invocation_get_sender:
14988  * @invocation: A #GDBusMethodInvocation.
14989  *
14990  * Gets the bus name that invoked the method.
14991  *
14992  * Returns: A string. Do not free, it is owned by @invocation.
14993  * Since: 2.26
14994  */
14995
14996
14997 /**
14998  * g_dbus_method_invocation_get_user_data: (skip)
14999  * @invocation: A #GDBusMethodInvocation.
15000  *
15001  * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15002  *
15003  * Returns: A #gpointer.
15004  * Since: 2.26
15005  */
15006
15007
15008 /**
15009  * g_dbus_method_invocation_return_dbus_error:
15010  * @invocation: (transfer full): A #GDBusMethodInvocation.
15011  * @error_name: A valid D-Bus error name.
15012  * @error_message: A valid D-Bus error message.
15013  *
15014  * Finishes handling a D-Bus method call by returning an error.
15015  *
15016  * This method will free @invocation, you cannot use it afterwards.
15017  *
15018  * Since: 2.26
15019  */
15020
15021
15022 /**
15023  * g_dbus_method_invocation_return_error:
15024  * @invocation: (transfer full): A #GDBusMethodInvocation.
15025  * @domain: A #GQuark for the #GError error domain.
15026  * @code: The error code.
15027  * @format: printf()-style format.
15028  * @...: Parameters for @format.
15029  *
15030  * Finishes handling a D-Bus method call by returning an error.
15031  *
15032  * See g_dbus_error_encode_gerror() for details about what error name
15033  * will be returned on the wire. In a nutshell, if the given error is
15034  * registered using g_dbus_error_register_error() the name given
15035  * during registration is used. Otherwise, a name of the form
15036  * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15037  * used. This provides transparent mapping of #GError between
15038  * applications using GDBus.
15039  *
15040  * If you are writing an application intended to be portable,
15041  * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15042  * or use g_dbus_method_invocation_return_dbus_error().
15043  *
15044  * This method will free @invocation, you cannot use it afterwards.
15045  *
15046  * Since: 2.26
15047  */
15048
15049
15050 /**
15051  * g_dbus_method_invocation_return_error_literal:
15052  * @invocation: (transfer full): A #GDBusMethodInvocation.
15053  * @domain: A #GQuark for the #GError error domain.
15054  * @code: The error code.
15055  * @message: The error message.
15056  *
15057  * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15058  *
15059  * This method will free @invocation, you cannot use it afterwards.
15060  *
15061  * Since: 2.26
15062  */
15063
15064
15065 /**
15066  * g_dbus_method_invocation_return_error_valist:
15067  * @invocation: (transfer full): A #GDBusMethodInvocation.
15068  * @domain: A #GQuark for the #GError error domain.
15069  * @code: The error code.
15070  * @format: printf()-style format.
15071  * @var_args: #va_list of parameters for @format.
15072  *
15073  * Like g_dbus_method_invocation_return_error() but intended for
15074  * language bindings.
15075  *
15076  * This method will free @invocation, you cannot use it afterwards.
15077  *
15078  * Since: 2.26
15079  */
15080
15081
15082 /**
15083  * g_dbus_method_invocation_return_gerror:
15084  * @invocation: (transfer full): A #GDBusMethodInvocation.
15085  * @error: A #GError.
15086  *
15087  * Like g_dbus_method_invocation_return_error() but takes a #GError
15088  * instead of the error domain, error code and message.
15089  *
15090  * This method will free @invocation, you cannot use it afterwards.
15091  *
15092  * Since: 2.26
15093  */
15094
15095
15096 /**
15097  * g_dbus_method_invocation_return_value:
15098  * @invocation: (transfer full): A #GDBusMethodInvocation.
15099  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15100  *
15101  * Finishes handling a D-Bus method call by returning @parameters.
15102  * If the @parameters GVariant is floating, it is consumed.
15103  *
15104  * It is an error if @parameters is not of the right format.
15105  *
15106  * This method will free @invocation, you cannot use it afterwards.
15107  *
15108  * Since: 2.26
15109  */
15110
15111
15112 /**
15113  * g_dbus_method_invocation_return_value_with_unix_fd_list:
15114  * @invocation: (transfer full): A #GDBusMethodInvocation.
15115  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15116  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15117  *
15118  * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15119  *
15120  * This method is only available on UNIX.
15121  *
15122  * This method will free @invocation, you cannot use it afterwards.
15123  *
15124  * Since: 2.30
15125  */
15126
15127
15128 /**
15129  * g_dbus_method_invocation_take_error: (skip)
15130  * @invocation: (transfer full): A #GDBusMethodInvocation.
15131  * @error: (transfer full): A #GError.
15132  *
15133  * Like g_dbus_method_invocation_return_gerror() but takes ownership
15134  * of @error so the caller does not need to free it.
15135  *
15136  * This method will free @invocation, you cannot use it afterwards.
15137  *
15138  * Since: 2.30
15139  */
15140
15141
15142 /**
15143  * g_dbus_node_info_generate_xml:
15144  * @info: A #GDBusNodeInfo.
15145  * @indent: Indentation level.
15146  * @string_builder: (out): A #GString to to append XML data to.
15147  *
15148  * Appends an XML representation of @info (and its children) to @string_builder.
15149  *
15150  * This function is typically used for generating introspection XML documents at run-time for
15151  * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15152  *
15153  * Since: 2.26
15154  */
15155
15156
15157 /**
15158  * g_dbus_node_info_lookup_interface:
15159  * @info: A #GDBusNodeInfo.
15160  * @name: A D-Bus interface name.
15161  *
15162  * Looks up information about an interface.
15163  *
15164  * This cost of this function is O(n) in number of interfaces.
15165  *
15166  * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15167  * Since: 2.26
15168  */
15169
15170
15171 /**
15172  * g_dbus_node_info_new_for_xml:
15173  * @xml_data: Valid D-Bus introspection XML.
15174  * @error: Return location for error.
15175  *
15176  * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15177  *
15178  * Note that this routine is using a
15179  * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15180  * parser that only accepts a subset of valid XML documents.
15181  *
15182  * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15183  * Since: 2.26
15184  */
15185
15186
15187 /**
15188  * g_dbus_node_info_ref:
15189  * @info: A #GDBusNodeInfo
15190  *
15191  * If @info is statically allocated does nothing. Otherwise increases
15192  * the reference count.
15193  *
15194  * Returns: The same @info.
15195  * Since: 2.26
15196  */
15197
15198
15199 /**
15200  * g_dbus_node_info_unref:
15201  * @info: A #GDBusNodeInfo.
15202  *
15203  * If @info is statically allocated, does nothing. Otherwise decreases
15204  * the reference count of @info. When its reference count drops to 0,
15205  * the memory used is freed.
15206  *
15207  * Since: 2.26
15208  */
15209
15210
15211 /**
15212  * g_dbus_object_get_interface:
15213  * @object: A #GDBusObject.
15214  * @interface_name: A D-Bus interface name.
15215  *
15216  * Gets the D-Bus interface with name @interface_name associated with
15217  * @object, if any.
15218  *
15219  * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15220  * Since: 2.30
15221  */
15222
15223
15224 /**
15225  * g_dbus_object_get_interfaces:
15226  * @object: A #GDBusObject.
15227  *
15228  * Gets the D-Bus interfaces associated with @object.
15229  *
15230  * 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().
15231  * Since: 2.30
15232  */
15233
15234
15235 /**
15236  * g_dbus_object_get_object_path:
15237  * @object: A #GDBusObject.
15238  *
15239  * Gets the object path for @object.
15240  *
15241  * Returns: A string owned by @object. Do not free.
15242  * Since: 2.30
15243  */
15244
15245
15246 /**
15247  * g_dbus_object_manager_client_get_connection:
15248  * @manager: A #GDBusObjectManagerClient
15249  *
15250  * Gets the #GDBusConnection used by @manager.
15251  *
15252  * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15253  * Since: 2.30
15254  */
15255
15256
15257 /**
15258  * g_dbus_object_manager_client_get_flags:
15259  * @manager: A #GDBusObjectManagerClient
15260  *
15261  * Gets the flags that @manager was constructed with.
15262  *
15263  * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15264  * Since: 2.30
15265  */
15266
15267
15268 /**
15269  * g_dbus_object_manager_client_get_name:
15270  * @manager: A #GDBusObjectManagerClient
15271  *
15272  * Gets the name that @manager is for.
15273  *
15274  * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15275  * Since: 2.30
15276  */
15277
15278
15279 /**
15280  * g_dbus_object_manager_client_get_name_owner:
15281  * @manager: A #GDBusObjectManagerClient.
15282  *
15283  * The unique name that owns the name that @manager is for or %NULL if
15284  * no-one currently owns that name. You can connect to the
15285  * #GObject::notify signal to track changes to the
15286  * #GDBusObjectManagerClient:name-owner property.
15287  *
15288  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15289  * Since: 2.30
15290  */
15291
15292
15293 /**
15294  * g_dbus_object_manager_client_new:
15295  * @connection: A #GDBusConnection.
15296  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15297  * @name: The owner of the control object (unique or well-known name).
15298  * @object_path: The object path of the control object.
15299  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15300  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15301  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15302  * @cancellable: (allow-none): A #GCancellable or %NULL
15303  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15304  * @user_data: The data to pass to @callback.
15305  *
15306  * Asynchronously creates a new #GDBusObjectManagerClient object.
15307  *
15308  * This is an asynchronous failable constructor. When the result is
15309  * ready, @callback will be invoked in the
15310  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15311  * of the thread you are calling this method from. You can
15312  * then call g_dbus_object_manager_client_new_finish() to get the result. See
15313  * g_dbus_object_manager_client_new_sync() for the synchronous version.
15314  *
15315  * Since: 2.30
15316  */
15317
15318
15319 /**
15320  * g_dbus_object_manager_client_new_finish:
15321  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15322  * @error: Return location for error or %NULL.
15323  *
15324  * Finishes an operation started with g_dbus_object_manager_client_new().
15325  *
15326  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15327  * Since: 2.30
15328  */
15329
15330
15331 /**
15332  * g_dbus_object_manager_client_new_for_bus:
15333  * @bus_type: A #GBusType.
15334  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15335  * @name: The owner of the control object (unique or well-known name).
15336  * @object_path: The object path of the control object.
15337  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15338  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15339  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15340  * @cancellable: (allow-none): A #GCancellable or %NULL
15341  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15342  * @user_data: The data to pass to @callback.
15343  *
15344  * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15345  * #GDBusConnection.
15346  *
15347  * This is an asynchronous failable constructor. When the result is
15348  * ready, @callback will be invoked in the
15349  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15350  * of the thread you are calling this method from. You can
15351  * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15352  * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15353  *
15354  * Since: 2.30
15355  */
15356
15357
15358 /**
15359  * g_dbus_object_manager_client_new_for_bus_finish:
15360  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15361  * @error: Return location for error or %NULL.
15362  *
15363  * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15364  *
15365  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15366  * Since: 2.30
15367  */
15368
15369
15370 /**
15371  * g_dbus_object_manager_client_new_for_bus_sync:
15372  * @bus_type: A #GBusType.
15373  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15374  * @name: The owner of the control object (unique or well-known name).
15375  * @object_path: The object path of the control object.
15376  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15377  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15378  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15379  * @cancellable: (allow-none): A #GCancellable or %NULL
15380  * @error: Return location for error or %NULL.
15381  *
15382  * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15383  * of a #GDBusConnection.
15384  *
15385  * This is a synchronous failable constructor - the calling thread is
15386  * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15387  * for the asynchronous version.
15388  *
15389  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15390  * Since: 2.30
15391  */
15392
15393
15394 /**
15395  * g_dbus_object_manager_client_new_sync:
15396  * @connection: A #GDBusConnection.
15397  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15398  * @name: The owner of the control object (unique or well-known name).
15399  * @object_path: The object path of the control object.
15400  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15401  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15402  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15403  * @cancellable: (allow-none): A #GCancellable or %NULL
15404  * @error: Return location for error or %NULL.
15405  *
15406  * Creates a new #GDBusObjectManagerClient object.
15407  *
15408  * This is a synchronous failable constructor - the calling thread is
15409  * blocked until a reply is received. See g_dbus_object_manager_client_new()
15410  * for the asynchronous version.
15411  *
15412  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15413  * Since: 2.30
15414  */
15415
15416
15417 /**
15418  * g_dbus_object_manager_get_interface:
15419  * @manager: A #GDBusObjectManager.
15420  * @object_path: Object path to lookup.
15421  * @interface_name: D-Bus interface name to lookup.
15422  *
15423  * Gets the interface proxy for @interface_name at @object_path, if
15424  * any.
15425  *
15426  * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15427  * Since: 2.30
15428  */
15429
15430
15431 /**
15432  * g_dbus_object_manager_get_object:
15433  * @manager: A #GDBusObjectManager.
15434  * @object_path: Object path to lookup.
15435  *
15436  * Gets the #GDBusObjectProxy at @object_path, if any.
15437  *
15438  * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15439  * Since: 2.30
15440  */
15441
15442
15443 /**
15444  * g_dbus_object_manager_get_object_path:
15445  * @manager: A #GDBusObjectManager.
15446  *
15447  * Gets the object path that @manager is for.
15448  *
15449  * Returns: A string owned by @manager. Do not free.
15450  * Since: 2.30
15451  */
15452
15453
15454 /**
15455  * g_dbus_object_manager_get_objects:
15456  * @manager: A #GDBusObjectManager.
15457  *
15458  * Gets all #GDBusObject objects known to @manager.
15459  *
15460  * 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().
15461  * Since: 2.30
15462  */
15463
15464
15465 /**
15466  * g_dbus_object_manager_server_export:
15467  * @manager: A #GDBusObjectManagerServer.
15468  * @object: A #GDBusObjectSkeleton.
15469  *
15470  * Exports @object on @manager.
15471  *
15472  * If there is already a #GDBusObject exported at the object path,
15473  * then the old object is removed.
15474  *
15475  * The object path for @object must be in the hierarchy rooted by the
15476  * object path for @manager.
15477  *
15478  * Note that @manager will take a reference on @object for as long as
15479  * it is exported.
15480  *
15481  * Since: 2.30
15482  */
15483
15484
15485 /**
15486  * g_dbus_object_manager_server_export_uniquely:
15487  * @manager: A #GDBusObjectManagerServer.
15488  * @object: An object.
15489  *
15490  * Like g_dbus_object_manager_server_export() but appends a string of
15491  * the form <literal>_N</literal> (with N being a natural number) to
15492  * @object<!-- -->'s object path if an object with the given path
15493  * already exists. As such, the #GDBusObjectProxy:g-object-path property
15494  * of @object may be modified.
15495  *
15496  * Since: 2.30
15497  */
15498
15499
15500 /**
15501  * g_dbus_object_manager_server_get_connection:
15502  * @manager: A #GDBusObjectManagerServer
15503  *
15504  * Gets the #GDBusConnection used by @manager.
15505  *
15506  * 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().
15507  * Since: 2.30
15508  */
15509
15510
15511 /**
15512  * g_dbus_object_manager_server_is_exported:
15513  * @manager: A #GDBusObjectManagerServer.
15514  * @object: An object.
15515  *
15516  * Returns whether @object is currently exported on @manager.
15517  *
15518  * Returns: %TRUE if @object is exported
15519  * Since: 2.34
15520  */
15521
15522
15523 /**
15524  * g_dbus_object_manager_server_new:
15525  * @object_path: The object path to export the manager object at.
15526  *
15527  * Creates a new #GDBusObjectManagerServer object.
15528  *
15529  * The returned server isn't yet exported on any connection. To do so,
15530  * use g_dbus_object_manager_server_set_connection(). Normally you
15531  * want to export all of your objects before doing so to avoid <ulink
15532  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15533  * signals being emitted.
15534  *
15535  * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15536  * Since: 2.30
15537  */
15538
15539
15540 /**
15541  * g_dbus_object_manager_server_set_connection:
15542  * @manager: A #GDBusObjectManagerServer.
15543  * @connection: (allow-none): A #GDBusConnection or %NULL.
15544  *
15545  * Exports all objects managed by @manager on @connection. If
15546  * @connection is %NULL, stops exporting objects.
15547  */
15548
15549
15550 /**
15551  * g_dbus_object_manager_server_unexport:
15552  * @manager: A #GDBusObjectManagerServer.
15553  * @object_path: An object path.
15554  *
15555  * If @manager has an object at @path, removes the object. Otherwise
15556  * does nothing.
15557  *
15558  * Note that @object_path must be in the hierarchy rooted by the
15559  * object path for @manager.
15560  *
15561  * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15562  * Since: 2.30
15563  */
15564
15565
15566 /**
15567  * g_dbus_object_proxy_get_connection:
15568  * @proxy: a #GDBusObjectProxy
15569  *
15570  * Gets the connection that @proxy is for.
15571  *
15572  * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15573  * Since: 2.30
15574  */
15575
15576
15577 /**
15578  * g_dbus_object_proxy_new:
15579  * @connection: a #GDBusConnection
15580  * @object_path: the object path
15581  *
15582  * Creates a new #GDBusObjectProxy for the given connection and
15583  * object path.
15584  *
15585  * Returns: a new #GDBusObjectProxy
15586  * Since: 2.30
15587  */
15588
15589
15590 /**
15591  * g_dbus_object_skeleton_add_interface:
15592  * @object: A #GDBusObjectSkeleton.
15593  * @interface_: A #GDBusInterfaceSkeleton.
15594  *
15595  * Adds @interface_ to @object.
15596  *
15597  * If @object already contains a #GDBusInterfaceSkeleton with the same
15598  * interface name, it is removed before @interface_ is added.
15599  *
15600  * Note that @object takes its own reference on @interface_ and holds
15601  * it until removed.
15602  *
15603  * Since: 2.30
15604  */
15605
15606
15607 /**
15608  * g_dbus_object_skeleton_flush:
15609  * @object: A #GDBusObjectSkeleton.
15610  *
15611  * This method simply calls g_dbus_interface_skeleton_flush() on all
15612  * interfaces belonging to @object. See that method for when flushing
15613  * is useful.
15614  *
15615  * Since: 2.30
15616  */
15617
15618
15619 /**
15620  * g_dbus_object_skeleton_new:
15621  * @object_path: An object path.
15622  *
15623  * Creates a new #GDBusObjectSkeleton.
15624  *
15625  * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15626  * Since: 2.30
15627  */
15628
15629
15630 /**
15631  * g_dbus_object_skeleton_remove_interface:
15632  * @object: A #GDBusObjectSkeleton.
15633  * @interface_: A #GDBusInterfaceSkeleton.
15634  *
15635  * Removes @interface_ from @object.
15636  *
15637  * Since: 2.30
15638  */
15639
15640
15641 /**
15642  * g_dbus_object_skeleton_remove_interface_by_name:
15643  * @object: A #GDBusObjectSkeleton.
15644  * @interface_name: A D-Bus interface name.
15645  *
15646  * Removes the #GDBusInterface with @interface_name from @object.
15647  *
15648  * If no D-Bus interface of the given interface exists, this function
15649  * does nothing.
15650  *
15651  * Since: 2.30
15652  */
15653
15654
15655 /**
15656  * g_dbus_object_skeleton_set_object_path:
15657  * @object: A #GDBusObjectSkeleton.
15658  * @object_path: A valid D-Bus object path.
15659  *
15660  * Sets the object path for @object.
15661  *
15662  * Since: 2.30
15663  */
15664
15665
15666 /**
15667  * g_dbus_property_info_ref:
15668  * @info: A #GDBusPropertyInfo
15669  *
15670  * If @info is statically allocated does nothing. Otherwise increases
15671  * the reference count.
15672  *
15673  * Returns: The same @info.
15674  * Since: 2.26
15675  */
15676
15677
15678 /**
15679  * g_dbus_property_info_unref:
15680  * @info: A #GDBusPropertyInfo.
15681  *
15682  * If @info is statically allocated, does nothing. Otherwise decreases
15683  * the reference count of @info. When its reference count drops to 0,
15684  * the memory used is freed.
15685  *
15686  * Since: 2.26
15687  */
15688
15689
15690 /**
15691  * g_dbus_proxy_call:
15692  * @proxy: A #GDBusProxy.
15693  * @method_name: Name of method to invoke.
15694  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15695  * @flags: Flags from the #GDBusCallFlags enumeration.
15696  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15697  * @cancellable: (allow-none): A #GCancellable or %NULL.
15698  * @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.
15699  * @user_data: The data to pass to @callback.
15700  *
15701  * Asynchronously invokes the @method_name method on @proxy.
15702  *
15703  * If @method_name contains any dots, then @name is split into interface and
15704  * method name parts. This allows using @proxy for invoking methods on
15705  * other interfaces.
15706  *
15707  * If the #GDBusConnection associated with @proxy is closed then
15708  * the operation will fail with %G_IO_ERROR_CLOSED. If
15709  * @cancellable is canceled, the operation will fail with
15710  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15711  * compatible with the D-Bus protocol, the operation fails with
15712  * %G_IO_ERROR_INVALID_ARGUMENT.
15713  *
15714  * If the @parameters #GVariant is floating, it is consumed. This allows
15715  * convenient 'inline' use of g_variant_new(), e.g.:
15716  * |[
15717  *  g_dbus_proxy_call (proxy,
15718  *                     "TwoStrings",
15719  *                     g_variant_new ("(ss)",
15720  *                                    "Thing One",
15721  *                                    "Thing Two"),
15722  *                     G_DBUS_CALL_FLAGS_NONE,
15723  *                     -1,
15724  *                     NULL,
15725  *                     (GAsyncReadyCallback) two_strings_done,
15726  *                     &amp;data);
15727  * ]|
15728  *
15729  * If @proxy has an expected interface (see
15730  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15731  * then the return value is checked against the return type.
15732  *
15733  * This is an asynchronous method. When the operation is finished,
15734  * @callback will be invoked in the
15735  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15736  * of the thread you are calling this method from.
15737  * You can then call g_dbus_proxy_call_finish() to get the result of
15738  * the operation. See g_dbus_proxy_call_sync() for the synchronous
15739  * version of this method.
15740  *
15741  * If @callback is %NULL then the D-Bus method call message will be sent with
15742  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15743  *
15744  * Since: 2.26
15745  */
15746
15747
15748 /**
15749  * g_dbus_proxy_call_finish:
15750  * @proxy: A #GDBusProxy.
15751  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15752  * @error: Return location for error or %NULL.
15753  *
15754  * Finishes an operation started with g_dbus_proxy_call().
15755  *
15756  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15757  * Since: 2.26
15758  */
15759
15760
15761 /**
15762  * g_dbus_proxy_call_sync:
15763  * @proxy: A #GDBusProxy.
15764  * @method_name: Name of method to invoke.
15765  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15766  * @flags: Flags from the #GDBusCallFlags enumeration.
15767  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15768  * @cancellable: (allow-none): A #GCancellable or %NULL.
15769  * @error: Return location for error or %NULL.
15770  *
15771  * Synchronously invokes the @method_name method on @proxy.
15772  *
15773  * If @method_name contains any dots, then @name is split into interface and
15774  * method name parts. This allows using @proxy for invoking methods on
15775  * other interfaces.
15776  *
15777  * If the #GDBusConnection associated with @proxy is disconnected then
15778  * the operation will fail with %G_IO_ERROR_CLOSED. If
15779  * @cancellable is canceled, the operation will fail with
15780  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15781  * compatible with the D-Bus protocol, the operation fails with
15782  * %G_IO_ERROR_INVALID_ARGUMENT.
15783  *
15784  * If the @parameters #GVariant is floating, it is consumed. This allows
15785  * convenient 'inline' use of g_variant_new(), e.g.:
15786  * |[
15787  *  g_dbus_proxy_call_sync (proxy,
15788  *                          "TwoStrings",
15789  *                          g_variant_new ("(ss)",
15790  *                                         "Thing One",
15791  *                                         "Thing Two"),
15792  *                          G_DBUS_CALL_FLAGS_NONE,
15793  *                          -1,
15794  *                          NULL,
15795  *                          &amp;error);
15796  * ]|
15797  *
15798  * The calling thread is blocked until a reply is received. See
15799  * g_dbus_proxy_call() for the asynchronous version of this
15800  * method.
15801  *
15802  * If @proxy has an expected interface (see
15803  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15804  * then the return value is checked against the return type.
15805  *
15806  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15807  * Since: 2.26
15808  */
15809
15810
15811 /**
15812  * g_dbus_proxy_call_with_unix_fd_list:
15813  * @proxy: A #GDBusProxy.
15814  * @method_name: Name of method to invoke.
15815  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15816  * @flags: Flags from the #GDBusCallFlags enumeration.
15817  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15818  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15819  * @cancellable: (allow-none): A #GCancellable or %NULL.
15820  * @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.
15821  * @user_data: The data to pass to @callback.
15822  *
15823  * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15824  *
15825  * This method is only available on UNIX.
15826  *
15827  * Since: 2.30
15828  */
15829
15830
15831 /**
15832  * g_dbus_proxy_call_with_unix_fd_list_finish:
15833  * @proxy: A #GDBusProxy.
15834  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15835  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15836  * @error: Return location for error or %NULL.
15837  *
15838  * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15839  *
15840  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15841  * Since: 2.30
15842  */
15843
15844
15845 /**
15846  * g_dbus_proxy_call_with_unix_fd_list_sync:
15847  * @proxy: A #GDBusProxy.
15848  * @method_name: Name of method to invoke.
15849  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15850  * @flags: Flags from the #GDBusCallFlags enumeration.
15851  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15852  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15853  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15854  * @cancellable: (allow-none): A #GCancellable or %NULL.
15855  * @error: Return location for error or %NULL.
15856  *
15857  * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15858  *
15859  * This method is only available on UNIX.
15860  *
15861  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15862  * Since: 2.30
15863  */
15864
15865
15866 /**
15867  * g_dbus_proxy_get_cached_property:
15868  * @proxy: A #GDBusProxy.
15869  * @property_name: Property name.
15870  *
15871  * Looks up the value for a property from the cache. This call does no
15872  * blocking IO.
15873  *
15874  * If @proxy has an expected interface (see
15875  * #GDBusProxy:g-interface-info) and @property_name is referenced by
15876  * it, then @value is checked against the type of the property.
15877  *
15878  * 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().
15879  * Since: 2.26
15880  */
15881
15882
15883 /**
15884  * g_dbus_proxy_get_cached_property_names:
15885  * @proxy: A #GDBusProxy.
15886  *
15887  * Gets the names of all cached properties on @proxy.
15888  *
15889  * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15890  * Since: 2.26
15891  */
15892
15893
15894 /**
15895  * g_dbus_proxy_get_connection:
15896  * @proxy: A #GDBusProxy.
15897  *
15898  * Gets the connection @proxy is for.
15899  *
15900  * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15901  * Since: 2.26
15902  */
15903
15904
15905 /**
15906  * g_dbus_proxy_get_default_timeout:
15907  * @proxy: A #GDBusProxy.
15908  *
15909  * Gets the timeout to use if -1 (specifying default timeout) is
15910  * passed as @timeout_msec in the g_dbus_proxy_call() and
15911  * g_dbus_proxy_call_sync() functions.
15912  *
15913  * See the #GDBusProxy:g-default-timeout property for more details.
15914  *
15915  * Returns: Timeout to use for @proxy.
15916  * Since: 2.26
15917  */
15918
15919
15920 /**
15921  * g_dbus_proxy_get_flags:
15922  * @proxy: A #GDBusProxy.
15923  *
15924  * Gets the flags that @proxy was constructed with.
15925  *
15926  * Returns: Flags from the #GDBusProxyFlags enumeration.
15927  * Since: 2.26
15928  */
15929
15930
15931 /**
15932  * g_dbus_proxy_get_interface_info:
15933  * @proxy: A #GDBusProxy
15934  *
15935  * Returns the #GDBusInterfaceInfo, if any, specifying the interface
15936  * that @proxy conforms to. See the #GDBusProxy:g-interface-info
15937  * property for more details.
15938  *
15939  * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
15940  * Since: 2.26
15941  */
15942
15943
15944 /**
15945  * g_dbus_proxy_get_interface_name:
15946  * @proxy: A #GDBusProxy.
15947  *
15948  * Gets the D-Bus interface name @proxy is for.
15949  *
15950  * Returns: A string owned by @proxy. Do not free.
15951  * Since: 2.26
15952  */
15953
15954
15955 /**
15956  * g_dbus_proxy_get_name:
15957  * @proxy: A #GDBusProxy.
15958  *
15959  * Gets the name that @proxy was constructed for.
15960  *
15961  * Returns: A string owned by @proxy. Do not free.
15962  * Since: 2.26
15963  */
15964
15965
15966 /**
15967  * g_dbus_proxy_get_name_owner:
15968  * @proxy: A #GDBusProxy.
15969  *
15970  * The unique name that owns the name that @proxy is for or %NULL if
15971  * no-one currently owns that name. You may connect to the
15972  * #GObject::notify signal to track changes to the
15973  * #GDBusProxy:g-name-owner property.
15974  *
15975  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15976  * Since: 2.26
15977  */
15978
15979
15980 /**
15981  * g_dbus_proxy_get_object_path:
15982  * @proxy: A #GDBusProxy.
15983  *
15984  * Gets the object path @proxy is for.
15985  *
15986  * Returns: A string owned by @proxy. Do not free.
15987  * Since: 2.26
15988  */
15989
15990
15991 /**
15992  * g_dbus_proxy_new:
15993  * @connection: A #GDBusConnection.
15994  * @flags: Flags used when constructing the proxy.
15995  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15996  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15997  * @object_path: An object path.
15998  * @interface_name: A D-Bus interface name.
15999  * @cancellable: (allow-none): A #GCancellable or %NULL.
16000  * @callback: Callback function to invoke when the proxy is ready.
16001  * @user_data: User data to pass to @callback.
16002  *
16003  * Creates a proxy for accessing @interface_name on the remote object
16004  * at @object_path owned by @name at @connection and asynchronously
16005  * loads D-Bus properties unless the
16006  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16007  * the #GDBusProxy::g-properties-changed signal to get notified about
16008  * property changes.
16009  *
16010  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16011  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16012  * to handle signals from the remote object.
16013  *
16014  * If @name is a well-known name and the
16015  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16016  * owner currently exists, the message bus will be requested to launch
16017  * a name owner for the name.
16018  *
16019  * This is a failable asynchronous constructor - when the proxy is
16020  * ready, @callback will be invoked and you can use
16021  * g_dbus_proxy_new_finish() to get the result.
16022  *
16023  * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16024  *
16025  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16026  *
16027  * Since: 2.26
16028  */
16029
16030
16031 /**
16032  * g_dbus_proxy_new_finish:
16033  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16034  * @error: Return location for error or %NULL.
16035  *
16036  * Finishes creating a #GDBusProxy.
16037  *
16038  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16039  * Since: 2.26
16040  */
16041
16042
16043 /**
16044  * g_dbus_proxy_new_for_bus:
16045  * @bus_type: A #GBusType.
16046  * @flags: Flags used when constructing the proxy.
16047  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16048  * @name: A bus name (well-known or unique).
16049  * @object_path: An object path.
16050  * @interface_name: A D-Bus interface name.
16051  * @cancellable: (allow-none): A #GCancellable or %NULL.
16052  * @callback: Callback function to invoke when the proxy is ready.
16053  * @user_data: User data to pass to @callback.
16054  *
16055  * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16056  *
16057  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16058  *
16059  * Since: 2.26
16060  */
16061
16062
16063 /**
16064  * g_dbus_proxy_new_for_bus_finish:
16065  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16066  * @error: Return location for error or %NULL.
16067  *
16068  * Finishes creating a #GDBusProxy.
16069  *
16070  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16071  * Since: 2.26
16072  */
16073
16074
16075 /**
16076  * g_dbus_proxy_new_for_bus_sync:
16077  * @bus_type: A #GBusType.
16078  * @flags: Flags used when constructing the proxy.
16079  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16080  * @name: A bus name (well-known or unique).
16081  * @object_path: An object path.
16082  * @interface_name: A D-Bus interface name.
16083  * @cancellable: (allow-none): A #GCancellable or %NULL.
16084  * @error: Return location for error or %NULL.
16085  *
16086  * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16087  *
16088  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16089  *
16090  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16091  * Since: 2.26
16092  */
16093
16094
16095 /**
16096  * g_dbus_proxy_new_sync:
16097  * @connection: A #GDBusConnection.
16098  * @flags: Flags used when constructing the proxy.
16099  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16100  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16101  * @object_path: An object path.
16102  * @interface_name: A D-Bus interface name.
16103  * @cancellable: (allow-none): A #GCancellable or %NULL.
16104  * @error: (allow-none): Return location for error or %NULL.
16105  *
16106  * Creates a proxy for accessing @interface_name on the remote object
16107  * at @object_path owned by @name at @connection and synchronously
16108  * loads D-Bus properties unless the
16109  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16110  *
16111  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16112  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16113  * to handle signals from the remote object.
16114  *
16115  * If @name is a well-known name and the
16116  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16117  * owner currently exists, the message bus will be requested to launch
16118  * a name owner for the name.
16119  *
16120  * This is a synchronous failable constructor. See g_dbus_proxy_new()
16121  * and g_dbus_proxy_new_finish() for the asynchronous version.
16122  *
16123  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16124  *
16125  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16126  * Since: 2.26
16127  */
16128
16129
16130 /**
16131  * g_dbus_proxy_set_cached_property:
16132  * @proxy: A #GDBusProxy
16133  * @property_name: Property name.
16134  * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16135  *
16136  * If @value is not %NULL, sets the cached value for the property with
16137  * name @property_name to the value in @value.
16138  *
16139  * If @value is %NULL, then the cached value is removed from the
16140  * property cache.
16141  *
16142  * If @proxy has an expected interface (see
16143  * #GDBusProxy:g-interface-info) and @property_name is referenced by
16144  * it, then @value is checked against the type of the property.
16145  *
16146  * If the @value #GVariant is floating, it is consumed. This allows
16147  * convenient 'inline' use of g_variant_new(), e.g.
16148  * |[
16149  *  g_dbus_proxy_set_cached_property (proxy,
16150  *                                    "SomeProperty",
16151  *                                    g_variant_new ("(si)",
16152  *                                                  "A String",
16153  *                                                  42));
16154  * ]|
16155  *
16156  * Normally you will not need to use this method since @proxy is
16157  * tracking changes using the
16158  * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16159  * D-Bus signal. However, for performance reasons an object may decide
16160  * to not use this signal for some properties and instead use a
16161  * proprietary out-of-band mechanism to transmit changes.
16162  *
16163  * As a concrete example, consider an object with a property
16164  * <literal>ChatroomParticipants</literal> which is an array of
16165  * strings. Instead of transmitting the same (long) array every time
16166  * the property changes, it is more efficient to only transmit the
16167  * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16168  * name)</literal> and <literal>ChatroomParticipantParted(String
16169  * name)</literal>.
16170  *
16171  * Since: 2.26
16172  */
16173
16174
16175 /**
16176  * g_dbus_proxy_set_default_timeout:
16177  * @proxy: A #GDBusProxy.
16178  * @timeout_msec: Timeout in milliseconds.
16179  *
16180  * Sets the timeout to use if -1 (specifying default timeout) is
16181  * passed as @timeout_msec in the g_dbus_proxy_call() and
16182  * g_dbus_proxy_call_sync() functions.
16183  *
16184  * See the #GDBusProxy:g-default-timeout property for more details.
16185  *
16186  * Since: 2.26
16187  */
16188
16189
16190 /**
16191  * g_dbus_proxy_set_interface_info:
16192  * @proxy: A #GDBusProxy
16193  * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16194  *
16195  * Ensure that interactions with @proxy conform to the given
16196  * interface. See the #GDBusProxy:g-interface-info property for more
16197  * details.
16198  *
16199  * Since: 2.26
16200  */
16201
16202
16203 /**
16204  * g_dbus_server_get_client_address:
16205  * @server: A #GDBusServer.
16206  *
16207  * Gets a D-Bus address string that can be used by clients to connect
16208  * to @server.
16209  *
16210  * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16211  * Since: 2.26
16212  */
16213
16214
16215 /**
16216  * g_dbus_server_get_flags:
16217  * @server: A #GDBusServer.
16218  *
16219  * Gets the flags for @server.
16220  *
16221  * Returns: A set of flags from the #GDBusServerFlags enumeration.
16222  * Since: 2.26
16223  */
16224
16225
16226 /**
16227  * g_dbus_server_get_guid:
16228  * @server: A #GDBusServer.
16229  *
16230  * Gets the GUID for @server.
16231  *
16232  * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16233  * Since: 2.26
16234  */
16235
16236
16237 /**
16238  * g_dbus_server_is_active:
16239  * @server: A #GDBusServer.
16240  *
16241  * Gets whether @server is active.
16242  *
16243  * Returns: %TRUE if server is active, %FALSE otherwise.
16244  * Since: 2.26
16245  */
16246
16247
16248 /**
16249  * g_dbus_server_new_sync:
16250  * @address: A D-Bus address.
16251  * @flags: Flags from the #GDBusServerFlags enumeration.
16252  * @guid: A D-Bus GUID.
16253  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16254  * @cancellable: (allow-none): A #GCancellable or %NULL.
16255  * @error: Return location for server or %NULL.
16256  *
16257  * Creates a new D-Bus server that listens on the first address in
16258  * @address that works.
16259  *
16260  * Once constructed, you can use g_dbus_server_get_client_address() to
16261  * get a D-Bus address string that clients can use to connect.
16262  *
16263  * Connect to the #GDBusServer::new-connection signal to handle
16264  * incoming connections.
16265  *
16266  * The returned #GDBusServer isn't active - you have to start it with
16267  * g_dbus_server_start().
16268  *
16269  * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16270  * be used.
16271  *
16272  * This is a synchronous failable constructor. See
16273  * g_dbus_server_new() for the asynchronous version.
16274  *
16275  * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16276  * Since: 2.26
16277  */
16278
16279
16280 /**
16281  * g_dbus_server_start:
16282  * @server: A #GDBusServer.
16283  *
16284  * Starts @server.
16285  *
16286  * Since: 2.26
16287  */
16288
16289
16290 /**
16291  * g_dbus_server_stop:
16292  * @server: A #GDBusServer.
16293  *
16294  * Stops @server.
16295  *
16296  * Since: 2.26
16297  */
16298
16299
16300 /**
16301  * g_dbus_signal_info_ref:
16302  * @info: A #GDBusSignalInfo
16303  *
16304  * If @info is statically allocated does nothing. Otherwise increases
16305  * the reference count.
16306  *
16307  * Returns: The same @info.
16308  * Since: 2.26
16309  */
16310
16311
16312 /**
16313  * g_dbus_signal_info_unref:
16314  * @info: A #GDBusSignalInfo.
16315  *
16316  * If @info is statically allocated, does nothing. Otherwise decreases
16317  * the reference count of @info. When its reference count drops to 0,
16318  * the memory used is freed.
16319  *
16320  * Since: 2.26
16321  */
16322
16323
16324 /**
16325  * g_desktop_app_info_get_categories:
16326  * @info: a #GDesktopAppInfo
16327  *
16328  * Gets the categories from the desktop file.
16329  *
16330  * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16331  */
16332
16333
16334 /**
16335  * g_desktop_app_info_get_filename:
16336  * @info: a #GDesktopAppInfo
16337  *
16338  * When @info was created from a known filename, return it.  In some
16339  * situations such as the #GDesktopAppInfo returned from
16340  * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16341  *
16342  * Returns: The full path to the file for @info, or %NULL if not known.
16343  * Since: 2.24
16344  */
16345
16346
16347 /**
16348  * g_desktop_app_info_get_generic_name:
16349  * @info: a #GDesktopAppInfo
16350  *
16351  * Gets the generic name from the destkop file.
16352  *
16353  * Returns: The value of the GenericName key
16354  */
16355
16356
16357 /**
16358  * g_desktop_app_info_get_is_hidden:
16359  * @info: a #GDesktopAppInfo.
16360  *
16361  * A desktop file is hidden if the Hidden key in it is
16362  * set to True.
16363  *
16364  * Returns: %TRUE if hidden, %FALSE otherwise.
16365  */
16366
16367
16368 /**
16369  * g_desktop_app_info_get_keywords:
16370  * @info: a #GDesktopAppInfo
16371  *
16372  * Gets the keywords from the desktop file.
16373  *
16374  * Returns: (transfer none): The value of the Keywords key
16375  * Since: 2.32
16376  */
16377
16378
16379 /**
16380  * g_desktop_app_info_get_nodisplay:
16381  * @info: a #GDesktopAppInfo
16382  *
16383  * Gets the value of the NoDisplay key, which helps determine if the
16384  * application info should be shown in menus. See
16385  * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16386  *
16387  * Returns: The value of the NoDisplay key
16388  * Since: 2.30
16389  */
16390
16391
16392 /**
16393  * g_desktop_app_info_get_show_in:
16394  * @info: a #GDesktopAppInfo
16395  * @desktop_env: a string specifying a desktop name
16396  *
16397  * Checks if the application info should be shown in menus that list available
16398  * applications for a specific name of the desktop, based on the
16399  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16400  *
16401  * If @desktop_env is %NULL, then the name of the desktop set with
16402  * g_desktop_app_info_set_desktop_env() is used.
16403  *
16404  * Note that g_app_info_should_show() for @info will include this check (with
16405  * %NULL for @desktop_env) as well as additional checks.
16406  *
16407  * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16408  * Since: 2.30
16409  */
16410
16411
16412 /**
16413  * g_desktop_app_info_get_startup_wm_class:
16414  * @app_info: a #GDesktopAppInfo that supports startup notify
16415  *
16416  * Retrieves the StartupWMClass field from @app_info. This represents the
16417  * WM_CLASS property of the main window of the application, if launched through
16418  * @app_info.
16419  *
16420  * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16421  * Since: 2.34
16422  */
16423
16424
16425 /**
16426  * g_desktop_app_info_launch_uris_as_manager:
16427  * @appinfo: a #GDesktopAppInfo
16428  * @uris: (element-type utf8): List of URIs
16429  * @launch_context: a #GAppLaunchContext
16430  * @spawn_flags: #GSpawnFlags, used for each process
16431  * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16432  * @user_setup_data: (closure user_setup): User data for @user_setup
16433  * @pid_callback: (scope call): Callback for child processes
16434  * @pid_callback_data: (closure pid_callback): User data for @callback
16435  * @error: return location for a #GError, or %NULL
16436  *
16437  * This function performs the equivalent of g_app_info_launch_uris(),
16438  * but is intended primarily for operating system components that
16439  * launch applications.  Ordinary applications should use
16440  * g_app_info_launch_uris().
16441  *
16442  * In contrast to g_app_info_launch_uris(), all processes created will
16443  * always be run directly as children as if by the UNIX fork()/exec()
16444  * calls.
16445  *
16446  * This guarantee allows additional control over the exact environment
16447  * of the child processes, which is provided via a setup function
16448  * @user_setup, as well as the process identifier of each child process
16449  * via @pid_callback. See g_spawn_async() for more information about the
16450  * semantics of the @user_setup function.
16451  *
16452  * Returns: %TRUE on successful launch, %FALSE otherwise.
16453  */
16454
16455
16456 /**
16457  * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16458  * @lookup: a #GDesktopAppInfoLookup
16459  * @uri_scheme: a string containing a URI scheme.
16460  *
16461  * Gets the default application for launching applications
16462  * using this URI scheme for a particular GDesktopAppInfoLookup
16463  * implementation.
16464  *
16465  * The GDesktopAppInfoLookup interface and this function is used
16466  * to implement g_app_info_get_default_for_uri_scheme() backends
16467  * in a GIO module. There is no reason for applications to use it
16468  * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16469  *
16470  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16471  * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16472  */
16473
16474
16475 /**
16476  * g_desktop_app_info_new:
16477  * @desktop_id: the desktop file id
16478  *
16479  * Creates a new #GDesktopAppInfo based on a desktop file id.
16480  *
16481  * A desktop file id is the basename of the desktop file, including the
16482  * .desktop extension. GIO is looking for a desktop file with this name
16483  * in the <filename>applications</filename> subdirectories of the XDG data
16484  * directories (i.e. the directories specified in the
16485  * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16486  * variables). GIO also supports the prefix-to-subdirectory mapping that is
16487  * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16488  * (i.e. a desktop id of kde-foo.desktop will match
16489  * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16490  *
16491  * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16492  */
16493
16494
16495 /**
16496  * g_desktop_app_info_new_from_filename:
16497  * @filename: the path of a desktop file, in the GLib filename encoding
16498  *
16499  * Creates a new #GDesktopAppInfo.
16500  *
16501  * Returns: a new #GDesktopAppInfo or %NULL on error.
16502  */
16503
16504
16505 /**
16506  * g_desktop_app_info_new_from_keyfile:
16507  * @key_file: an opened #GKeyFile
16508  *
16509  * Creates a new #GDesktopAppInfo.
16510  *
16511  * Returns: a new #GDesktopAppInfo or %NULL on error.
16512  * Since: 2.18
16513  */
16514
16515
16516 /**
16517  * g_desktop_app_info_set_desktop_env:
16518  * @desktop_env: a string specifying what desktop this is
16519  *
16520  * Sets the name of the desktop that the application is running in.
16521  * This is used by g_app_info_should_show() and
16522  * g_desktop_app_info_get_show_in() to evaluate the
16523  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16524  * desktop entry fields.
16525  *
16526  * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16527  * Menu specification</ulink> recognizes the following:
16528  * <simplelist>
16529  *   <member>GNOME</member>
16530  *   <member>KDE</member>
16531  *   <member>ROX</member>
16532  *   <member>XFCE</member>
16533  *   <member>LXDE</member>
16534  *   <member>Unity</member>
16535  *   <member>Old</member>
16536  * </simplelist>
16537  *
16538  * Should be called only once; subsequent calls are ignored.
16539  */
16540
16541
16542 /**
16543  * g_drive_can_eject:
16544  * @drive: a #GDrive.
16545  *
16546  * Checks if a drive can be ejected.
16547  *
16548  * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16549  */
16550
16551
16552 /**
16553  * g_drive_can_poll_for_media:
16554  * @drive: a #GDrive.
16555  *
16556  * Checks if a drive can be polled for media changes.
16557  *
16558  * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16559  */
16560
16561
16562 /**
16563  * g_drive_can_start:
16564  * @drive: a #GDrive.
16565  *
16566  * Checks if a drive can be started.
16567  *
16568  * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16569  * Since: 2.22
16570  */
16571
16572
16573 /**
16574  * g_drive_can_start_degraded:
16575  * @drive: a #GDrive.
16576  *
16577  * Checks if a drive can be started degraded.
16578  *
16579  * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16580  * Since: 2.22
16581  */
16582
16583
16584 /**
16585  * g_drive_can_stop:
16586  * @drive: a #GDrive.
16587  *
16588  * Checks if a drive can be stopped.
16589  *
16590  * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16591  * Since: 2.22
16592  */
16593
16594
16595 /**
16596  * g_drive_eject:
16597  * @drive: a #GDrive.
16598  * @flags: flags affecting the unmount if required for eject
16599  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16600  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16601  * @user_data: user data to pass to @callback
16602  *
16603  * Asynchronously ejects a drive.
16604  *
16605  * When the operation is finished, @callback will be called.
16606  * You can then call g_drive_eject_finish() to obtain the
16607  * result of the operation.
16608  *
16609  * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16610  */
16611
16612
16613 /**
16614  * g_drive_eject_finish:
16615  * @drive: a #GDrive.
16616  * @result: a #GAsyncResult.
16617  * @error: a #GError, or %NULL
16618  *
16619  * Finishes ejecting a drive.
16620  *
16621  * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16622  * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16623  */
16624
16625
16626 /**
16627  * g_drive_eject_with_operation:
16628  * @drive: a #GDrive.
16629  * @flags: flags affecting the unmount if required for eject
16630  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16631  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16632  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16633  * @user_data: user data passed to @callback.
16634  *
16635  * Ejects a drive. This is an asynchronous operation, and is
16636  * finished by calling g_drive_eject_with_operation_finish() with the @drive
16637  * and #GAsyncResult data returned in the @callback.
16638  *
16639  * Since: 2.22
16640  */
16641
16642
16643 /**
16644  * g_drive_eject_with_operation_finish:
16645  * @drive: a #GDrive.
16646  * @result: a #GAsyncResult.
16647  * @error: a #GError location to store the error occurring, or %NULL to ignore.
16648  *
16649  * Finishes ejecting a drive. If any errors occurred during the operation,
16650  * @error will be set to contain the errors and %FALSE will be returned.
16651  *
16652  * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16653  * Since: 2.22
16654  */
16655
16656
16657 /**
16658  * g_drive_enumerate_identifiers:
16659  * @drive: a #GDrive
16660  *
16661  * Gets the kinds of identifiers that @drive has.
16662  * Use g_drive_get_identifier() to obtain the identifiers
16663  * themselves.
16664  *
16665  * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16666  */
16667
16668
16669 /**
16670  * g_drive_get_icon:
16671  * @drive: a #GDrive.
16672  *
16673  * Gets the icon for @drive.
16674  *
16675  * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16676  */
16677
16678
16679 /**
16680  * g_drive_get_identifier:
16681  * @drive: a #GDrive
16682  * @kind: the kind of identifier to return
16683  *
16684  * Gets the identifier of the given kind for @drive.
16685  *
16686  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16687  */
16688
16689
16690 /**
16691  * g_drive_get_name:
16692  * @drive: a #GDrive.
16693  *
16694  * Gets the name of @drive.
16695  *
16696  * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16697  */
16698
16699
16700 /**
16701  * g_drive_get_sort_key:
16702  * @drive: A #GDrive.
16703  *
16704  * Gets the sort key for @drive, if any.
16705  *
16706  * Returns: Sorting key for @drive or %NULL if no such key is available.
16707  * Since: 2.32
16708  */
16709
16710
16711 /**
16712  * g_drive_get_start_stop_type:
16713  * @drive: a #GDrive.
16714  *
16715  * Gets a hint about how a drive can be started/stopped.
16716  *
16717  * Returns: A value from the #GDriveStartStopType enumeration.
16718  * Since: 2.22
16719  */
16720
16721
16722 /**
16723  * g_drive_get_volumes:
16724  * @drive: a #GDrive.
16725  *
16726  * Get a list of mountable volumes for @drive.
16727  *
16728  * The returned list should be freed with g_list_free(), after
16729  * its elements have been unreffed with g_object_unref().
16730  *
16731  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16732  */
16733
16734
16735 /**
16736  * g_drive_has_media:
16737  * @drive: a #GDrive.
16738  *
16739  * Checks if the @drive has media. Note that the OS may not be polling
16740  * the drive for media changes; see g_drive_is_media_check_automatic()
16741  * for more details.
16742  *
16743  * Returns: %TRUE if @drive has media, %FALSE otherwise.
16744  */
16745
16746
16747 /**
16748  * g_drive_has_volumes:
16749  * @drive: a #GDrive.
16750  *
16751  * Check if @drive has any mountable volumes.
16752  *
16753  * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16754  */
16755
16756
16757 /**
16758  * g_drive_is_media_check_automatic:
16759  * @drive: a #GDrive.
16760  *
16761  * Checks if @drive is capabable of automatically detecting media changes.
16762  *
16763  * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16764  */
16765
16766
16767 /**
16768  * g_drive_is_media_removable:
16769  * @drive: a #GDrive.
16770  *
16771  * Checks if the @drive supports removable media.
16772  *
16773  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16774  */
16775
16776
16777 /**
16778  * g_drive_poll_for_media:
16779  * @drive: a #GDrive.
16780  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16781  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16782  * @user_data: user data to pass to @callback
16783  *
16784  * Asynchronously polls @drive to see if media has been inserted or removed.
16785  *
16786  * When the operation is finished, @callback will be called.
16787  * You can then call g_drive_poll_for_media_finish() to obtain the
16788  * result of the operation.
16789  */
16790
16791
16792 /**
16793  * g_drive_poll_for_media_finish:
16794  * @drive: a #GDrive.
16795  * @result: a #GAsyncResult.
16796  * @error: a #GError, or %NULL
16797  *
16798  * Finishes an operation started with g_drive_poll_for_media() on a drive.
16799  *
16800  * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16801  */
16802
16803
16804 /**
16805  * g_drive_start:
16806  * @drive: a #GDrive.
16807  * @flags: flags affecting the start operation.
16808  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16809  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16810  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16811  * @user_data: user data to pass to @callback
16812  *
16813  * Asynchronously starts a drive.
16814  *
16815  * When the operation is finished, @callback will be called.
16816  * You can then call g_drive_start_finish() to obtain the
16817  * result of the operation.
16818  *
16819  * Since: 2.22
16820  */
16821
16822
16823 /**
16824  * g_drive_start_finish:
16825  * @drive: a #GDrive.
16826  * @result: a #GAsyncResult.
16827  * @error: a #GError, or %NULL
16828  *
16829  * Finishes starting a drive.
16830  *
16831  * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16832  * Since: 2.22
16833  */
16834
16835
16836 /**
16837  * g_drive_stop:
16838  * @drive: a #GDrive.
16839  * @flags: flags affecting the unmount if required for stopping.
16840  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16841  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16842  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16843  * @user_data: user data to pass to @callback
16844  *
16845  * Asynchronously stops a drive.
16846  *
16847  * When the operation is finished, @callback will be called.
16848  * You can then call g_drive_stop_finish() to obtain the
16849  * result of the operation.
16850  *
16851  * Since: 2.22
16852  */
16853
16854
16855 /**
16856  * g_drive_stop_finish:
16857  * @drive: a #GDrive.
16858  * @result: a #GAsyncResult.
16859  * @error: a #GError, or %NULL
16860  *
16861  * Finishes stopping a drive.
16862  *
16863  * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16864  * Since: 2.22
16865  */
16866
16867
16868 /**
16869  * g_emblem_get_icon:
16870  * @emblem: a #GEmblem from which the icon should be extracted.
16871  *
16872  * Gives back the icon from @emblem.
16873  *
16874  * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16875  * Since: 2.18
16876  */
16877
16878
16879 /**
16880  * g_emblem_get_origin:
16881  * @emblem: a #GEmblem
16882  *
16883  * Gets the origin of the emblem.
16884  *
16885  * Returns: (transfer none): the origin of the emblem
16886  * Since: 2.18
16887  */
16888
16889
16890 /**
16891  * g_emblem_new:
16892  * @icon: a GIcon containing the icon.
16893  *
16894  * Creates a new emblem for @icon.
16895  *
16896  * Returns: a new #GEmblem.
16897  * Since: 2.18
16898  */
16899
16900
16901 /**
16902  * g_emblem_new_with_origin:
16903  * @icon: a GIcon containing the icon.
16904  * @origin: a GEmblemOrigin enum defining the emblem's origin
16905  *
16906  * Creates a new emblem for @icon.
16907  *
16908  * Returns: a new #GEmblem.
16909  * Since: 2.18
16910  */
16911
16912
16913 /**
16914  * g_emblemed_icon_add_emblem:
16915  * @emblemed: a #GEmblemedIcon
16916  * @emblem: a #GEmblem
16917  *
16918  * Adds @emblem to the #GList of #GEmblem <!-- -->s.
16919  *
16920  * Since: 2.18
16921  */
16922
16923
16924 /**
16925  * g_emblemed_icon_clear_emblems:
16926  * @emblemed: a #GEmblemedIcon
16927  *
16928  * Removes all the emblems from @icon.
16929  *
16930  * Since: 2.28
16931  */
16932
16933
16934 /**
16935  * g_emblemed_icon_get_emblems:
16936  * @emblemed: a #GEmblemedIcon
16937  *
16938  * Gets the list of emblems for the @icon.
16939  *
16940  * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
16941  * Since: 2.18
16942  */
16943
16944
16945 /**
16946  * g_emblemed_icon_get_icon:
16947  * @emblemed: a #GEmblemedIcon
16948  *
16949  * Gets the main icon for @emblemed.
16950  *
16951  * Returns: (transfer none): a #GIcon that is owned by @emblemed
16952  * Since: 2.18
16953  */
16954
16955
16956 /**
16957  * g_emblemed_icon_new:
16958  * @icon: a #GIcon
16959  * @emblem: (allow-none): a #GEmblem, or %NULL
16960  *
16961  * Creates a new emblemed icon for @icon with the emblem @emblem.
16962  *
16963  * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
16964  * Since: 2.18
16965  */
16966
16967
16968 /**
16969  * g_file_append_to:
16970  * @file: input #GFile.
16971  * @flags: a set of #GFileCreateFlags.
16972  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16973  * @error: a #GError, or %NULL
16974  *
16975  * Gets an output stream for appending data to the file. If
16976  * the file doesn't already exist it is created.
16977  *
16978  * By default files created are generally readable by everyone,
16979  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16980  * will be made readable only to the current user, to the level that
16981  * is supported on the target filesystem.
16982  *
16983  * If @cancellable is not %NULL, then the operation can be cancelled by
16984  * triggering the cancellable object from another thread. If the operation
16985  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16986  *
16987  * Some file systems don't allow all file names, and may
16988  * return an %G_IO_ERROR_INVALID_FILENAME error.
16989  * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will be
16990  * returned. Other errors are possible too, and depend on what kind of
16991  * filesystem the file is on.
16992  *
16993  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
16994  */
16995
16996
16997 /**
16998  * g_file_append_to_async:
16999  * @file: input #GFile.
17000  * @flags: a set of #GFileCreateFlags.
17001  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17002  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17003  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17004  * @user_data: (closure): the data to pass to callback function
17005  *
17006  * Asynchronously opens @file for appending.
17007  *
17008  * For more details, see g_file_append_to() which is
17009  * the synchronous version of this call.
17010  *
17011  * When the operation is finished, @callback will be called. You can then call
17012  * g_file_append_to_finish() to get the result of the operation.
17013  */
17014
17015
17016 /**
17017  * g_file_append_to_finish:
17018  * @file: input #GFile.
17019  * @res: #GAsyncResult
17020  * @error: a #GError, or %NULL
17021  *
17022  * Finishes an asynchronous file append operation started with
17023  * g_file_append_to_async().
17024  *
17025  * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17026  */
17027
17028
17029 /**
17030  * g_file_attribute_info_list_add:
17031  * @list: a #GFileAttributeInfoList.
17032  * @name: the name of the attribute to add.
17033  * @type: the #GFileAttributeType for the attribute.
17034  * @flags: #GFileAttributeInfoFlags for the attribute.
17035  *
17036  * Adds a new attribute with @name to the @list, setting
17037  * its @type and @flags.
17038  */
17039
17040
17041 /**
17042  * g_file_attribute_info_list_dup:
17043  * @list: a #GFileAttributeInfoList to duplicate.
17044  *
17045  * Makes a duplicate of a file attribute info list.
17046  *
17047  * Returns: a copy of the given @list.
17048  */
17049
17050
17051 /**
17052  * g_file_attribute_info_list_lookup:
17053  * @list: a #GFileAttributeInfoList.
17054  * @name: the name of the attribute to lookup.
17055  *
17056  * Gets the file attribute with the name @name from @list.
17057  *
17058  * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17059  */
17060
17061
17062 /**
17063  * g_file_attribute_info_list_new:
17064  *
17065  * Creates a new file attribute info list.
17066  *
17067  * Returns: a #GFileAttributeInfoList.
17068  */
17069
17070
17071 /**
17072  * g_file_attribute_info_list_ref:
17073  * @list: a #GFileAttributeInfoList to reference.
17074  *
17075  * References a file attribute info list.
17076  *
17077  * Returns: #GFileAttributeInfoList or %NULL on error.
17078  */
17079
17080
17081 /**
17082  * g_file_attribute_info_list_unref:
17083  * @list: The #GFileAttributeInfoList to unreference.
17084  *
17085  * Removes a reference from the given @list. If the reference count
17086  * falls to zero, the @list is deleted.
17087  */
17088
17089
17090 /**
17091  * g_file_attribute_matcher_enumerate_namespace:
17092  * @matcher: a #GFileAttributeMatcher.
17093  * @ns: a string containing a file attribute namespace.
17094  *
17095  * Checks if the matcher will match all of the keys in a given namespace.
17096  * This will always return %TRUE if a wildcard character is in use (e.g. if
17097  * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17098  * using "*" and namespace is anything.)
17099  *
17100  * TODO: this is awkwardly worded.
17101  *
17102  * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17103  */
17104
17105
17106 /**
17107  * g_file_attribute_matcher_enumerate_next:
17108  * @matcher: a #GFileAttributeMatcher.
17109  *
17110  * Gets the next matched attribute from a #GFileAttributeMatcher.
17111  *
17112  * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17113  */
17114
17115
17116 /**
17117  * g_file_attribute_matcher_matches:
17118  * @matcher: a #GFileAttributeMatcher.
17119  * @attribute: a file attribute key.
17120  *
17121  * Checks if an attribute will be matched by an attribute matcher. If
17122  * the matcher was created with the "*" matching string, this function
17123  * will always return %TRUE.
17124  *
17125  * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17126  */
17127
17128
17129 /**
17130  * g_file_attribute_matcher_matches_only:
17131  * @matcher: a #GFileAttributeMatcher.
17132  * @attribute: a file attribute key.
17133  *
17134  * Checks if a attribute matcher only matches a given attribute. Always
17135  * returns %FALSE if "*" was used when creating the matcher.
17136  *
17137  * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17138  */
17139
17140
17141 /**
17142  * g_file_attribute_matcher_new:
17143  * @attributes: an attribute string to match.
17144  *
17145  * Creates a new file attribute matcher, which matches attributes
17146  * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17147  * counted structures, and are created with a reference count of 1. If
17148  * the number of references falls to 0, the #GFileAttributeMatcher is
17149  * automatically destroyed.
17150  *
17151  * The @attribute string should be formatted with specific keys separated
17152  * from namespaces with a double colon. Several "namespace::key" strings may be
17153  * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17154  * The wildcard "*" may be used to match all keys and namespaces, or
17155  * "namespace::*" will match all keys in a given namespace.
17156  *
17157  * Examples of strings to use:
17158  * <table>
17159  * <title>File Attribute Matcher strings and results</title>
17160  * <tgroup cols='2' align='left'><thead>
17161  * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17162  * <tbody>
17163  * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17164  * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17165  * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17166  * all keys in the unix namespace.</entry></row>
17167  * </tbody></tgroup>
17168  * </table>
17169  *
17170  * Returns: a #GFileAttributeMatcher.
17171  */
17172
17173
17174 /**
17175  * g_file_attribute_matcher_ref:
17176  * @matcher: a #GFileAttributeMatcher.
17177  *
17178  * References a file attribute matcher.
17179  *
17180  * Returns: a #GFileAttributeMatcher.
17181  */
17182
17183
17184 /**
17185  * g_file_attribute_matcher_subtract:
17186  * @matcher: Matcher to subtract from
17187  * @subtract: The matcher to subtract
17188  *
17189  * Subtracts all attributes of @subtract from @matcher and returns
17190  * a matcher that supports those attributes.
17191  *
17192  * Note that currently it is not possible to remove a single
17193  * attribute when the @matcher matches the whole namespace - or remove
17194  * a namespace or attribute when the matcher matches everything. This
17195  * is a limitation of the current implementation, but may be fixed
17196  * in the future.
17197  *
17198  * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17199  */
17200
17201
17202 /**
17203  * g_file_attribute_matcher_to_string:
17204  * @matcher: (allow-none): a #GFileAttributeMatcher.
17205  *
17206  * Prints what the matcher is matching against. The format will be
17207  * equal to the format passed to g_file_attribute_matcher_new().
17208  * The output however, might not be identical, as the matcher may
17209  * decide to use a different order or omit needless parts.
17210  *
17211  * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17212  * Since: 2.32
17213  */
17214
17215
17216 /**
17217  * g_file_attribute_matcher_unref:
17218  * @matcher: a #GFileAttributeMatcher.
17219  *
17220  * Unreferences @matcher. If the reference count falls below 1,
17221  * the @matcher is automatically freed.
17222  */
17223
17224
17225 /**
17226  * g_file_copy:
17227  * @source: input #GFile.
17228  * @destination: destination #GFile
17229  * @flags: set of #GFileCopyFlags
17230  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17231  * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17232  * @progress_callback_data: (closure): user data to pass to @progress_callback
17233  * @error: #GError to set on error, or %NULL
17234  *
17235  * Copies the file @source to the location specified by @destination.
17236  * Can not handle recursive copies of directories.
17237  *
17238  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17239  * existing @destination file is overwritten.
17240  *
17241  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17242  * will be copied as symlinks, otherwise the target of the
17243  * @source symlink will be copied.
17244  *
17245  * If @cancellable is not %NULL, then the operation can be cancelled by
17246  * triggering the cancellable object from another thread. If the operation
17247  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17248  *
17249  * If @progress_callback is not %NULL, then the operation can be monitored by
17250  * setting this to a #GFileProgressCallback function. @progress_callback_data
17251  * will be passed to this function. It is guaranteed that this callback will
17252  * be called after all data has been transferred with the total number of bytes
17253  * copied during the operation.
17254  *
17255  * If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
17256  * error is returned, independent on the status of the @destination.
17257  *
17258  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
17259  * error G_IO_ERROR_EXISTS is returned.
17260  *
17261  * If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
17262  * error is returned. If trying to overwrite a directory with a directory the
17263  * G_IO_ERROR_WOULD_MERGE error is returned.
17264  *
17265  * If the source is a directory and the target does not exist, or
17266  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17267  * G_IO_ERROR_WOULD_RECURSE error is returned.
17268  *
17269  * If you are interested in copying the #GFile object itself (not the on-disk
17270  * file), see g_file_dup().
17271  *
17272  * Returns: %TRUE on success, %FALSE otherwise.
17273  */
17274
17275
17276 /**
17277  * g_file_copy_async: (skip)
17278  * @source: input #GFile.
17279  * @destination: destination #GFile
17280  * @flags: set of #GFileCopyFlags
17281  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17282  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17283  * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17284  * @progress_callback_data: (closure): user data to pass to @progress_callback
17285  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17286  * @user_data: the data to pass to callback function
17287  *
17288  * Copies the file @source to the location specified by @destination
17289  * asynchronously. For details of the behaviour, see g_file_copy().
17290  *
17291  * If @progress_callback is not %NULL, then that function that will be called
17292  * just like in g_file_copy(), however the callback will run in the main loop,
17293  * not in the thread that is doing the I/O operation.
17294  *
17295  * When the operation is finished, @callback will be called. You can then call
17296  * g_file_copy_finish() to get the result of the operation.
17297  */
17298
17299
17300 /**
17301  * g_file_copy_attributes:
17302  * @source: a #GFile with attributes.
17303  * @destination: a #GFile to copy attributes to.
17304  * @flags: a set of #GFileCopyFlags.
17305  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17306  * @error: a #GError, %NULL to ignore.
17307  *
17308  * Copies the file attributes from @source to @destination.
17309  *
17310  * Normally only a subset of the file attributes are copied,
17311  * those that are copies in a normal file copy operation
17312  * (which for instance does not include e.g. owner). However
17313  * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17314  * all the metadata that is possible to copy is copied. This
17315  * is useful when implementing move by copy + delete source.
17316  *
17317  * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17318  */
17319
17320
17321 /**
17322  * g_file_copy_finish:
17323  * @file: input #GFile.
17324  * @res: a #GAsyncResult.
17325  * @error: a #GError, or %NULL
17326  *
17327  * Finishes copying the file started with
17328  * g_file_copy_async().
17329  *
17330  * Returns: a %TRUE on success, %FALSE on error.
17331  */
17332
17333
17334 /**
17335  * g_file_create:
17336  * @file: input #GFile.
17337  * @flags: a set of #GFileCreateFlags.
17338  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17339  * @error: a #GError, or %NULL
17340  *
17341  * Creates a new file and returns an output stream for writing to it.
17342  * The file must not already exist.
17343  *
17344  * By default files created are generally readable by everyone,
17345  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17346  * will be made readable only to the current user, to the level that
17347  * is supported on the target filesystem.
17348  *
17349  * If @cancellable is not %NULL, then the operation can be cancelled by
17350  * triggering the cancellable object from another thread. If the operation
17351  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17352  *
17353  * If a file or directory with this name already exists the G_IO_ERROR_EXISTS
17354  * error will be returned.
17355  * Some file systems don't allow all file names, and may
17356  * return an G_IO_ERROR_INVALID_FILENAME error, and if the name
17357  * is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
17358  * Other errors are possible too, and depend on what kind of
17359  * filesystem the file is on.
17360  *
17361  * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17362  */
17363
17364
17365 /**
17366  * g_file_create_async:
17367  * @file: input #GFile.
17368  * @flags: a set of #GFileCreateFlags.
17369  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17370  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17371  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17372  * @user_data: (closure): the data to pass to callback function
17373  *
17374  * Asynchronously creates a new file and returns an output stream for writing to it.
17375  * The file must not already exist.
17376  *
17377  * For more details, see g_file_create() which is
17378  * the synchronous version of this call.
17379  *
17380  * When the operation is finished, @callback will be called. You can then call
17381  * g_file_create_finish() to get the result of the operation.
17382  */
17383
17384
17385 /**
17386  * g_file_create_finish:
17387  * @file: input #GFile.
17388  * @res: a #GAsyncResult.
17389  * @error: a #GError, or %NULL
17390  *
17391  * Finishes an asynchronous file create operation started with
17392  * g_file_create_async().
17393  *
17394  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17395  */
17396
17397
17398 /**
17399  * g_file_create_readwrite:
17400  * @file: a #GFile
17401  * @flags: a set of #GFileCreateFlags
17402  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17403  * @error: return location for a #GError, or %NULL
17404  *
17405  * Creates a new file and returns a stream for reading and writing to it.
17406  * The file must not already exist.
17407  *
17408  * By default files created are generally readable by everyone,
17409  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17410  * will be made readable only to the current user, to the level that
17411  * is supported on the target filesystem.
17412  *
17413  * If @cancellable is not %NULL, then the operation can be cancelled by
17414  * triggering the cancellable object from another thread. If the operation
17415  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17416  *
17417  * If a file or directory with this name already exists the %G_IO_ERROR_EXISTS
17418  * error will be returned. Some file systems don't allow all file names,
17419  * and may return an %G_IO_ERROR_INVALID_FILENAME error, and if the name
17420  * is too long, %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors
17421  * are possible too, and depend on what kind of filesystem the file is on.
17422  *
17423  * Note that in many non-local file cases read and write streams are not
17424  * supported, so make sure you really need to do read and write streaming,
17425  * rather than just opening for reading or writing.
17426  *
17427  * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17428  * Since: 2.22
17429  */
17430
17431
17432 /**
17433  * g_file_create_readwrite_async:
17434  * @file: input #GFile
17435  * @flags: a set of #GFileCreateFlags
17436  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17437  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17438  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17439  * @user_data: (closure): the data to pass to callback function
17440  *
17441  * Asynchronously creates a new file and returns a stream for reading and
17442  * writing to it. The file must not already exist.
17443  *
17444  * For more details, see g_file_create_readwrite() which is
17445  * the synchronous version of this call.
17446  *
17447  * When the operation is finished, @callback will be called. You can then
17448  * call g_file_create_readwrite_finish() to get the result of the operation.
17449  *
17450  * Since: 2.22
17451  */
17452
17453
17454 /**
17455  * g_file_create_readwrite_finish:
17456  * @file: input #GFile
17457  * @res: a #GAsyncResult
17458  * @error: a #GError, or %NULL
17459  *
17460  * Finishes an asynchronous file create operation started with
17461  * g_file_create_readwrite_async().
17462  *
17463  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17464  * Since: 2.22
17465  */
17466
17467
17468 /**
17469  * g_file_delete:
17470  * @file: input #GFile.
17471  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17472  * @error: a #GError, or %NULL
17473  *
17474  * Deletes a file. If the @file is a directory, it will only be deleted if it
17475  * is empty.
17476  *
17477  * If @cancellable is not %NULL, then the operation can be cancelled by
17478  * triggering the cancellable object from another thread. If the operation
17479  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17480  *
17481  * Virtual: delete_file
17482  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17483  */
17484
17485
17486 /**
17487  * g_file_descriptor_based_get_fd:
17488  * @fd_based: a #GFileDescriptorBased.
17489  *
17490  * Gets the underlying file descriptor.
17491  *
17492  * Returns: The file descriptor
17493  * Since: 2.24
17494  */
17495
17496
17497 /**
17498  * g_file_dup:
17499  * @file: input #GFile.
17500  *
17501  * Duplicates a #GFile handle. This operation does not duplicate
17502  * the actual file or directory represented by the #GFile; see
17503  * g_file_copy() if attempting to copy a file.
17504  *
17505  * This call does no blocking i/o.
17506  *
17507  * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17508  */
17509
17510
17511 /**
17512  * g_file_eject_mountable:
17513  * @file: input #GFile.
17514  * @flags: flags affecting the operation
17515  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17516  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
17517  * @user_data: (closure): the data to pass to callback function
17518  *
17519  * Starts an asynchronous eject on a mountable.
17520  * When this operation has completed, @callback will be called with
17521  * @user_user data, and the operation can be finalized with
17522  * g_file_eject_mountable_finish().
17523  *
17524  * If @cancellable is not %NULL, then the operation can be cancelled by
17525  * triggering the cancellable object from another thread. If the operation
17526  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17527  *
17528  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17529  */
17530
17531
17532 /**
17533  * g_file_eject_mountable_finish:
17534  * @file: input #GFile.
17535  * @result: a #GAsyncResult.
17536  * @error: a #GError, or %NULL
17537  *
17538  * Finishes an asynchronous eject operation started by
17539  * g_file_eject_mountable().
17540  *
17541  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17542  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17543  */
17544
17545
17546 /**
17547  * g_file_eject_mountable_with_operation:
17548  * @file: input #GFile.
17549  * @flags: flags affecting the operation
17550  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
17551  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17552  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
17553  * @user_data: (closure): the data to pass to callback function
17554  *
17555  * Starts an asynchronous eject on a mountable.
17556  * When this operation has completed, @callback will be called with
17557  * @user_user data, and the operation can be finalized with
17558  * g_file_eject_mountable_with_operation_finish().
17559  *
17560  * If @cancellable is not %NULL, then the operation can be cancelled by
17561  * triggering the cancellable object from another thread. If the operation
17562  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17563  *
17564  * Since: 2.22
17565  */
17566
17567
17568 /**
17569  * g_file_eject_mountable_with_operation_finish:
17570  * @file: input #GFile.
17571  * @result: a #GAsyncResult.
17572  * @error: a #GError, or %NULL
17573  *
17574  * Finishes an asynchronous eject operation started by
17575  * g_file_eject_mountable_with_operation().
17576  *
17577  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17578  * Since: 2.22
17579  */
17580
17581
17582 /**
17583  * g_file_enumerate_children:
17584  * @file: input #GFile.
17585  * @attributes: an attribute query string.
17586  * @flags: a set of #GFileQueryInfoFlags.
17587  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17588  * @error: #GError for error reporting.
17589  *
17590  * Gets the requested information about the files in a directory. The result
17591  * is a #GFileEnumerator object that will give out #GFileInfo objects for
17592  * all the files in the directory.
17593  *
17594  * The @attributes value is a string that specifies the file attributes that
17595  * should be gathered. It is not an error if it's not possible to read a particular
17596  * requested attribute from a file - it just won't be set. @attributes should
17597  * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
17598  * means all attributes, and a wildcard like "standard::*" means all attributes in the standard
17599  * namespace. An example attribute query be "standard::*,owner::user".
17600  * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
17601  *
17602  * If @cancellable is not %NULL, then the operation can be cancelled by
17603  * triggering the cancellable object from another thread. If the operation
17604  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17605  *
17606  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
17607  * If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned.
17608  * Other errors are possible too.
17609  *
17610  * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17611  */
17612
17613
17614 /**
17615  * g_file_enumerate_children_async:
17616  * @file: input #GFile.
17617  * @attributes: an attribute query string.
17618  * @flags: a set of #GFileQueryInfoFlags.
17619  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17620  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17621  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17622  * @user_data: (closure): the data to pass to callback function
17623  *
17624  * Asynchronously gets the requested information about the files in a directory. The result
17625  * is a #GFileEnumerator object that will give out #GFileInfo objects for
17626  * all the files in the directory.
17627  *
17628  * For more details, see g_file_enumerate_children() which is
17629  * the synchronous version of this call.
17630  *
17631  * When the operation is finished, @callback will be called. You can then call
17632  * g_file_enumerate_children_finish() to get the result of the operation.
17633  */
17634
17635
17636 /**
17637  * g_file_enumerate_children_finish:
17638  * @file: input #GFile.
17639  * @res: a #GAsyncResult.
17640  * @error: a #GError.
17641  *
17642  * Finishes an async enumerate children operation.
17643  * See g_file_enumerate_children_async().
17644  *
17645  * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17646  */
17647
17648
17649 /**
17650  * g_file_enumerator_close:
17651  * @enumerator: a #GFileEnumerator.
17652  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17653  * @error: location to store the error occurring, or %NULL to ignore
17654  *
17655  * Releases all resources used by this enumerator, making the
17656  * enumerator return %G_IO_ERROR_CLOSED on all calls.
17657  *
17658  * This will be automatically called when the last reference
17659  * is dropped, but you might want to call this function to make
17660  * sure resources are released as early as possible.
17661  *
17662  * Returns: #TRUE on success or #FALSE on error.
17663  */
17664
17665
17666 /**
17667  * g_file_enumerator_close_async:
17668  * @enumerator: a #GFileEnumerator.
17669  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17670  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17671  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17672  * @user_data: (closure): the data to pass to callback function
17673  *
17674  * Asynchronously closes the file enumerator.
17675  *
17676  * If @cancellable is not %NULL, then the operation can be cancelled by
17677  * triggering the cancellable object from another thread. If the operation
17678  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17679  * g_file_enumerator_close_finish().
17680  */
17681
17682
17683 /**
17684  * g_file_enumerator_close_finish:
17685  * @enumerator: a #GFileEnumerator.
17686  * @result: a #GAsyncResult.
17687  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17688  *
17689  * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17690  *
17691  * If the file enumerator was already closed when g_file_enumerator_close_async()
17692  * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17693  * return %FALSE. If the file enumerator had pending operation when the close
17694  * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17695  * return %FALSE.  If @cancellable was not %NULL, then the operation may have been
17696  * cancelled by triggering the cancellable object from another thread. If the operation
17697  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17698  * returned.
17699  *
17700  * Returns: %TRUE if the close operation has finished successfully.
17701  */
17702
17703
17704 /**
17705  * g_file_enumerator_get_container:
17706  * @enumerator: a #GFileEnumerator
17707  *
17708  * Get the #GFile container which is being enumerated.
17709  *
17710  * Returns: (transfer none): the #GFile which is being enumerated.
17711  * Since: 2.18
17712  */
17713
17714
17715 /**
17716  * g_file_enumerator_has_pending:
17717  * @enumerator: a #GFileEnumerator.
17718  *
17719  * Checks if the file enumerator has pending operations.
17720  *
17721  * Returns: %TRUE if the @enumerator has pending operations.
17722  */
17723
17724
17725 /**
17726  * g_file_enumerator_is_closed:
17727  * @enumerator: a #GFileEnumerator.
17728  *
17729  * Checks if the file enumerator has been closed.
17730  *
17731  * Returns: %TRUE if the @enumerator is closed.
17732  */
17733
17734
17735 /**
17736  * g_file_enumerator_next_file:
17737  * @enumerator: a #GFileEnumerator.
17738  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17739  * @error: location to store the error occurring, or %NULL to ignore
17740  *
17741  * Returns information for the next file in the enumerated object.
17742  * Will block until the information is available. The #GFileInfo
17743  * returned from this function will contain attributes that match the
17744  * attribute string that was passed when the #GFileEnumerator was created.
17745  *
17746  * On error, returns %NULL and sets @error to the error. If the
17747  * enumerator is at the end, %NULL will be returned and @error will
17748  * be unset.
17749  *
17750  * 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.
17751  */
17752
17753
17754 /**
17755  * g_file_enumerator_next_files_async:
17756  * @enumerator: a #GFileEnumerator.
17757  * @num_files: the number of file info objects to request
17758  * @io_priority: the <link linkend="gioscheduler">io priority</link> of the request.
17759  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17760  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17761  * @user_data: (closure): the data to pass to callback function
17762  *
17763  * Request information for a number of files from the enumerator asynchronously.
17764  * When all i/o for the operation is finished the @callback will be called with
17765  * the requested information.
17766  *
17767  * The callback can be called with less than @num_files files in case of error
17768  * or at the end of the enumerator. In case of a partial error the callback will
17769  * be called with any succeeding items and no error, and on the next request the
17770  * error will be reported. If a request is cancelled the callback will be called
17771  * with %G_IO_ERROR_CANCELLED.
17772  *
17773  * During an async request no other sync and async calls are allowed, and will
17774  * result in %G_IO_ERROR_PENDING errors.
17775  *
17776  * Any outstanding i/o request with higher priority (lower numerical value) will
17777  * be executed before an outstanding request with lower priority. Default
17778  * priority is %G_PRIORITY_DEFAULT.
17779  */
17780
17781
17782 /**
17783  * g_file_enumerator_next_files_finish:
17784  * @enumerator: a #GFileEnumerator.
17785  * @result: a #GAsyncResult.
17786  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17787  *
17788  * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17789  *
17790  * 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.
17791  */
17792
17793
17794 /**
17795  * g_file_enumerator_set_pending:
17796  * @enumerator: a #GFileEnumerator.
17797  * @pending: a boolean value.
17798  *
17799  * Sets the file enumerator as having pending operations.
17800  */
17801
17802
17803 /**
17804  * g_file_equal:
17805  * @file1: the first #GFile.
17806  * @file2: the second #GFile.
17807  *
17808  * Checks equality of two given #GFile<!-- -->s. Note that two
17809  * #GFile<!-- -->s that differ can still refer to the same
17810  * file on the filesystem due to various forms of filename
17811  * aliasing.
17812  *
17813  * This call does no blocking i/o.
17814  *
17815  * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17816  */
17817
17818
17819 /**
17820  * g_file_find_enclosing_mount:
17821  * @file: input #GFile.
17822  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17823  * @error: a #GError.
17824  *
17825  * Gets a #GMount for the #GFile.
17826  *
17827  * If the #GFileIface for @file does not have a mount (e.g. possibly a
17828  * remote share), @error will be set to %G_IO_ERROR_NOT_FOUND and %NULL
17829  * will be returned.
17830  *
17831  * If @cancellable is not %NULL, then the operation can be cancelled by
17832  * triggering the cancellable object from another thread. If the operation
17833  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17834  *
17835  * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17836  */
17837
17838
17839 /**
17840  * g_file_find_enclosing_mount_async:
17841  * @file: a #GFile
17842  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17843  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17844  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17845  * @user_data: (closure): the data to pass to callback function
17846  *
17847  * Asynchronously gets the mount for the file.
17848  *
17849  * For more details, see g_file_find_enclosing_mount() which is
17850  * the synchronous version of this call.
17851  *
17852  * When the operation is finished, @callback will be called. You can then call
17853  * g_file_find_enclosing_mount_finish() to get the result of the operation.
17854  */
17855
17856
17857 /**
17858  * g_file_find_enclosing_mount_finish:
17859  * @file: a #GFile
17860  * @res: a #GAsyncResult
17861  * @error: a #GError
17862  *
17863  * Finishes an asynchronous find mount request.
17864  * See g_file_find_enclosing_mount_async().
17865  *
17866  * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
17867  */
17868
17869
17870 /**
17871  * g_file_get_basename:
17872  * @file: input #GFile.
17873  *
17874  * Gets the base name (the last component of the path) for a given #GFile.
17875  *
17876  * If called for the top level of a system (such as the filesystem root
17877  * or a uri like sftp://host/) it will return a single directory separator
17878  * (and on Windows, possibly a drive letter).
17879  *
17880  * The base name is a byte string (*not* UTF-8). It has no defined encoding
17881  * or rules other than it may not contain zero bytes.  If you want to use
17882  * filenames in a user interface you should use the display name that you
17883  * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
17884  * attribute with g_file_query_info().
17885  *
17886  * This call does no blocking i/o.
17887  *
17888  * 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.
17889  */
17890
17891
17892 /**
17893  * g_file_get_child:
17894  * @file: input #GFile.
17895  * @name: string containing the child's basename.
17896  *
17897  * Gets a child of @file with basename equal to @name.
17898  *
17899  * Note that the file with that specific name might not exist, but
17900  * you can still have a #GFile that points to it. You can use this
17901  * for instance to create that file.
17902  *
17903  * This call does no blocking i/o.
17904  *
17905  * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
17906  */
17907
17908
17909 /**
17910  * g_file_get_child_for_display_name:
17911  * @file: input #GFile.
17912  * @display_name: string to a possible child.
17913  * @error: #GError.
17914  *
17915  * Gets the child of @file for a given @display_name (i.e. a UTF8
17916  * version of the name). If this function fails, it returns %NULL and @error will be
17917  * set. This is very useful when constructing a GFile for a new file
17918  * and the user entered the filename in the user interface, for instance
17919  * when you select a directory and type a filename in the file selector.
17920  *
17921  * This call does no blocking i/o.
17922  *
17923  * 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().
17924  */
17925
17926
17927 /**
17928  * g_file_get_parent:
17929  * @file: input #GFile.
17930  *
17931  * Gets the parent directory for the @file.
17932  * If the @file represents the root directory of the
17933  * file system, then %NULL will be returned.
17934  *
17935  * This call does no blocking i/o.
17936  *
17937  * 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().
17938  */
17939
17940
17941 /**
17942  * g_file_get_parse_name:
17943  * @file: input #GFile.
17944  *
17945  * Gets the parse name of the @file.
17946  * A parse name is a UTF-8 string that describes the
17947  * file such that one can get the #GFile back using
17948  * g_file_parse_name().
17949  *
17950  * This is generally used to show the #GFile as a nice
17951  * full-pathname kind of string in a user interface,
17952  * like in a location entry.
17953  *
17954  * For local files with names that can safely be converted
17955  * to UTF8 the pathname is used, otherwise the IRI is used
17956  * (a form of URI that allows UTF8 characters unescaped).
17957  *
17958  * This call does no blocking i/o.
17959  *
17960  * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
17961  */
17962
17963
17964 /**
17965  * g_file_get_path:
17966  * @file: input #GFile.
17967  *
17968  * Gets the local pathname for #GFile, if one exists.
17969  *
17970  * This call does no blocking i/o.
17971  *
17972  * 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.
17973  */
17974
17975
17976 /**
17977  * g_file_get_relative_path:
17978  * @parent: input #GFile.
17979  * @descendant: input #GFile.
17980  *
17981  * Gets the path for @descendant relative to @parent.
17982  *
17983  * This call does no blocking i/o.
17984  *
17985  * 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.
17986  */
17987
17988
17989 /**
17990  * g_file_get_uri:
17991  * @file: input #GFile.
17992  *
17993  * Gets the URI for the @file.
17994  *
17995  * This call does no blocking i/o.
17996  *
17997  * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
17998  */
17999
18000
18001 /**
18002  * g_file_get_uri_scheme:
18003  * @file: input #GFile.
18004  *
18005  * Gets the URI scheme for a #GFile.
18006  * RFC 3986 decodes the scheme as:
18007  * <programlisting>
18008  * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18009  * </programlisting>
18010  * Common schemes include "file", "http", "ftp", etc.
18011  *
18012  * This call does no blocking i/o.
18013  *
18014  * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18015  */
18016
18017
18018 /**
18019  * g_file_has_parent:
18020  * @file: input #GFile
18021  * @parent: (allow-none): the parent to check for, or %NULL
18022  *
18023  * Checks if @file has a parent, and optionally, if it is @parent.
18024  *
18025  * If @parent is %NULL then this function returns %TRUE if @file has any
18026  * parent at all.  If @parent is non-%NULL then %TRUE is only returned
18027  * if @file is a child of @parent.
18028  *
18029  * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18030  * Since: 2.24
18031  */
18032
18033
18034 /**
18035  * g_file_has_prefix:
18036  * @file: input #GFile.
18037  * @prefix: input #GFile.
18038  *
18039  * Checks whether @file has the prefix specified by @prefix. In other word,
18040  * if the names of initial elements of @file<!-- -->s pathname match @prefix.
18041  * Only full pathname elements are matched, so a path like /foo is not
18042  * considered a prefix of /foobar, only of /foo/bar.
18043  *
18044  * This call does no i/o, as it works purely on names. As such it can
18045  * sometimes return %FALSE even if @file is inside a @prefix (from a
18046  * filesystem point of view), because the prefix of @file is an alias
18047  * of @prefix.
18048  *
18049  * Virtual: prefix_matches
18050  * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix. %FALSE otherwise.
18051  */
18052
18053
18054 /**
18055  * g_file_has_uri_scheme:
18056  * @file: input #GFile.
18057  * @uri_scheme: a string containing a URI scheme.
18058  *
18059  * Checks to see if a #GFile has a given URI scheme.
18060  *
18061  * This call does no blocking i/o.
18062  *
18063  * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18064  */
18065
18066
18067 /**
18068  * g_file_hash:
18069  * @file: (type GFile): #gconstpointer to a #GFile.
18070  *
18071  * Creates a hash value for a #GFile.
18072  *
18073  * This call does no blocking i/o.
18074  *
18075  * Virtual: hash
18076  * 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.
18077  */
18078
18079
18080 /**
18081  * g_file_icon_get_file:
18082  * @icon: a #GIcon.
18083  *
18084  * Gets the #GFile associated with the given @icon.
18085  *
18086  * Returns: (transfer none): a #GFile, or %NULL.
18087  */
18088
18089
18090 /**
18091  * g_file_icon_new:
18092  * @file: a #GFile.
18093  *
18094  * Creates a new icon for a file.
18095  *
18096  * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18097  */
18098
18099
18100 /**
18101  * g_file_info_clear_status:
18102  * @info: a #GFileInfo.
18103  *
18104  * Clears the status information from @info.
18105  */
18106
18107
18108 /**
18109  * g_file_info_copy_into:
18110  * @src_info: source to copy attributes from.
18111  * @dest_info: destination to copy attributes to.
18112  *
18113  * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18114  * from @src_info to @dest_info.
18115  */
18116
18117
18118 /**
18119  * g_file_info_dup:
18120  * @other: a #GFileInfo.
18121  *
18122  * Duplicates a file info structure.
18123  *
18124  * Returns: (transfer full): a duplicate #GFileInfo of @other.
18125  */
18126
18127
18128 /**
18129  * g_file_info_get_attribute_as_string:
18130  * @info: a #GFileInfo.
18131  * @attribute: a file attribute key.
18132  *
18133  * Gets the value of a attribute, formated as a string.
18134  * This escapes things as needed to make the string valid
18135  * utf8.
18136  *
18137  * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18138  */
18139
18140
18141 /**
18142  * g_file_info_get_attribute_boolean:
18143  * @info: a #GFileInfo.
18144  * @attribute: a file attribute key.
18145  *
18146  * Gets the value of a boolean attribute. If the attribute does not
18147  * contain a boolean value, %FALSE will be returned.
18148  *
18149  * Returns: the boolean value contained within the attribute.
18150  */
18151
18152
18153 /**
18154  * g_file_info_get_attribute_byte_string:
18155  * @info: a #GFileInfo.
18156  * @attribute: a file attribute key.
18157  *
18158  * Gets the value of a byte string attribute. If the attribute does
18159  * not contain a byte string, %NULL will be returned.
18160  *
18161  * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18162  */
18163
18164
18165 /**
18166  * g_file_info_get_attribute_data:
18167  * @info: a #GFileInfo
18168  * @attribute: a file attribute key
18169  * @type: (out) (allow-none): return location for the attribute type, or %NULL
18170  * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18171  * @status: (out) (allow-none): return location for the attribute status, or %NULL
18172  *
18173  * Gets the attribute type, value and status for an attribute key.
18174  *
18175  * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18176  */
18177
18178
18179 /**
18180  * g_file_info_get_attribute_int32:
18181  * @info: a #GFileInfo.
18182  * @attribute: a file attribute key.
18183  *
18184  * Gets a signed 32-bit integer contained within the attribute. If the
18185  * attribute does not contain a signed 32-bit integer, or is invalid,
18186  * 0 will be returned.
18187  *
18188  * Returns: a signed 32-bit integer from the attribute.
18189  */
18190
18191
18192 /**
18193  * g_file_info_get_attribute_int64:
18194  * @info: a #GFileInfo.
18195  * @attribute: a file attribute key.
18196  *
18197  * Gets a signed 64-bit integer contained within the attribute. If the
18198  * attribute does not contain an signed 64-bit integer, or is invalid,
18199  * 0 will be returned.
18200  *
18201  * Returns: a signed 64-bit integer from the attribute.
18202  */
18203
18204
18205 /**
18206  * g_file_info_get_attribute_object:
18207  * @info: a #GFileInfo.
18208  * @attribute: a file attribute key.
18209  *
18210  * Gets the value of a #GObject attribute. If the attribute does
18211  * not contain a #GObject, %NULL will be returned.
18212  *
18213  * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18214  */
18215
18216
18217 /**
18218  * g_file_info_get_attribute_status:
18219  * @info: a #GFileInfo
18220  * @attribute: a file attribute key
18221  *
18222  * Gets the attribute status for an attribute key.
18223  *
18224  * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18225  */
18226
18227
18228 /**
18229  * g_file_info_get_attribute_string:
18230  * @info: a #GFileInfo.
18231  * @attribute: a file attribute key.
18232  *
18233  * Gets the value of a string attribute. If the attribute does
18234  * not contain a string, %NULL will be returned.
18235  *
18236  * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18237  */
18238
18239
18240 /**
18241  * g_file_info_get_attribute_stringv:
18242  * @info: a #GFileInfo.
18243  * @attribute: a file attribute key.
18244  *
18245  * Gets the value of a stringv attribute. If the attribute does
18246  * not contain a stringv, %NULL will be returned.
18247  *
18248  * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18249  * Since: 2.22
18250  */
18251
18252
18253 /**
18254  * g_file_info_get_attribute_type:
18255  * @info: a #GFileInfo.
18256  * @attribute: a file attribute key.
18257  *
18258  * Gets the attribute type for an attribute key.
18259  *
18260  * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18261  */
18262
18263
18264 /**
18265  * g_file_info_get_attribute_uint32:
18266  * @info: a #GFileInfo.
18267  * @attribute: a file attribute key.
18268  *
18269  * Gets an unsigned 32-bit integer contained within the attribute. If the
18270  * attribute does not contain an unsigned 32-bit integer, or is invalid,
18271  * 0 will be returned.
18272  *
18273  * Returns: an unsigned 32-bit integer from the attribute.
18274  */
18275
18276
18277 /**
18278  * g_file_info_get_attribute_uint64:
18279  * @info: a #GFileInfo.
18280  * @attribute: a file attribute key.
18281  *
18282  * Gets a unsigned 64-bit integer contained within the attribute. If the
18283  * attribute does not contain an unsigned 64-bit integer, or is invalid,
18284  * 0 will be returned.
18285  *
18286  * Returns: a unsigned 64-bit integer from the attribute.
18287  */
18288
18289
18290 /**
18291  * g_file_info_get_content_type:
18292  * @info: a #GFileInfo.
18293  *
18294  * Gets the file's content type.
18295  *
18296  * Returns: a string containing the file's content type.
18297  */
18298
18299
18300 /**
18301  * g_file_info_get_display_name:
18302  * @info: a #GFileInfo.
18303  *
18304  * Gets a display name for a file.
18305  *
18306  * Returns: a string containing the display name.
18307  */
18308
18309
18310 /**
18311  * g_file_info_get_edit_name:
18312  * @info: a #GFileInfo.
18313  *
18314  * Gets the edit name for a file.
18315  *
18316  * Returns: a string containing the edit name.
18317  */
18318
18319
18320 /**
18321  * g_file_info_get_etag:
18322  * @info: a #GFileInfo.
18323  *
18324  * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18325  * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18326  *
18327  * Returns: a string containing the value of the "etag:value" attribute.
18328  */
18329
18330
18331 /**
18332  * g_file_info_get_file_type:
18333  * @info: a #GFileInfo.
18334  *
18335  * Gets a file's type (whether it is a regular file, symlink, etc).
18336  * This is different from the file's content type, see g_file_info_get_content_type().
18337  *
18338  * Returns: a #GFileType for the given file.
18339  */
18340
18341
18342 /**
18343  * g_file_info_get_icon:
18344  * @info: a #GFileInfo.
18345  *
18346  * Gets the icon for a file.
18347  *
18348  * Returns: (transfer none): #GIcon for the given @info.
18349  */
18350
18351
18352 /**
18353  * g_file_info_get_is_backup:
18354  * @info: a #GFileInfo.
18355  *
18356  * Checks if a file is a backup file.
18357  *
18358  * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18359  */
18360
18361
18362 /**
18363  * g_file_info_get_is_hidden:
18364  * @info: a #GFileInfo.
18365  *
18366  * Checks if a file is hidden.
18367  *
18368  * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18369  */
18370
18371
18372 /**
18373  * g_file_info_get_is_symlink:
18374  * @info: a #GFileInfo.
18375  *
18376  * Checks if a file is a symlink.
18377  *
18378  * Returns: %TRUE if the given @info is a symlink.
18379  */
18380
18381
18382 /**
18383  * g_file_info_get_modification_time:
18384  * @info: a #GFileInfo.
18385  * @result: (out caller-allocates): a #GTimeVal.
18386  *
18387  * Gets the modification time of the current @info and sets it
18388  * in @result.
18389  */
18390
18391
18392 /**
18393  * g_file_info_get_name:
18394  * @info: a #GFileInfo.
18395  *
18396  * Gets the name for a file.
18397  *
18398  * Returns: a string containing the file name.
18399  */
18400
18401
18402 /**
18403  * g_file_info_get_size:
18404  * @info: a #GFileInfo.
18405  *
18406  * Gets the file's size.
18407  *
18408  * Returns: a #goffset containing the file's size.
18409  */
18410
18411
18412 /**
18413  * g_file_info_get_sort_order:
18414  * @info: a #GFileInfo.
18415  *
18416  * Gets the value of the sort_order attribute from the #GFileInfo.
18417  * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18418  *
18419  * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18420  */
18421
18422
18423 /**
18424  * g_file_info_get_symlink_target:
18425  * @info: a #GFileInfo.
18426  *
18427  * Gets the symlink target for a given #GFileInfo.
18428  *
18429  * Returns: a string containing the symlink target.
18430  */
18431
18432
18433 /**
18434  * g_file_info_has_attribute:
18435  * @info: a #GFileInfo.
18436  * @attribute: a file attribute key.
18437  *
18438  * Checks if a file info structure has an attribute named @attribute.
18439  *
18440  * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18441  */
18442
18443
18444 /**
18445  * g_file_info_has_namespace:
18446  * @info: a #GFileInfo.
18447  * @name_space: a file attribute namespace.
18448  *
18449  * Checks if a file info structure has an attribute in the
18450  * specified @name_space.
18451  *
18452  * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18453  * Since: 2.22
18454  */
18455
18456
18457 /**
18458  * g_file_info_list_attributes:
18459  * @info: a #GFileInfo.
18460  * @name_space: a file attribute key's namespace.
18461  *
18462  * Lists the file info structure's attributes.
18463  *
18464  * 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.
18465  */
18466
18467
18468 /**
18469  * g_file_info_new:
18470  *
18471  * Creates a new file info structure.
18472  *
18473  * Returns: a #GFileInfo.
18474  */
18475
18476
18477 /**
18478  * g_file_info_remove_attribute:
18479  * @info: a #GFileInfo.
18480  * @attribute: a file attribute key.
18481  *
18482  * Removes all cases of @attribute from @info if it exists.
18483  */
18484
18485
18486 /**
18487  * g_file_info_set_attribute:
18488  * @info: a #GFileInfo.
18489  * @attribute: a file attribute key.
18490  * @type: a #GFileAttributeType
18491  * @value_p: pointer to the value
18492  *
18493  * Sets the @attribute to contain the given value, if possible. To unset the
18494  * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18495  */
18496
18497
18498 /**
18499  * g_file_info_set_attribute_boolean:
18500  * @info: a #GFileInfo.
18501  * @attribute: a file attribute key.
18502  * @attr_value: a boolean value.
18503  *
18504  * Sets the @attribute to contain the given @attr_value,
18505  * if possible.
18506  */
18507
18508
18509 /**
18510  * g_file_info_set_attribute_byte_string:
18511  * @info: a #GFileInfo.
18512  * @attribute: a file attribute key.
18513  * @attr_value: a byte string.
18514  *
18515  * Sets the @attribute to contain the given @attr_value,
18516  * if possible.
18517  */
18518
18519
18520 /**
18521  * g_file_info_set_attribute_int32:
18522  * @info: a #GFileInfo.
18523  * @attribute: a file attribute key.
18524  * @attr_value: a signed 32-bit integer
18525  *
18526  * Sets the @attribute to contain the given @attr_value,
18527  * if possible.
18528  */
18529
18530
18531 /**
18532  * g_file_info_set_attribute_int64:
18533  * @info: a #GFileInfo.
18534  * @attribute: attribute name to set.
18535  * @attr_value: int64 value to set attribute to.
18536  *
18537  * Sets the @attribute to contain the given @attr_value,
18538  * if possible.
18539  */
18540
18541
18542 /**
18543  * g_file_info_set_attribute_mask:
18544  * @info: a #GFileInfo.
18545  * @mask: a #GFileAttributeMatcher.
18546  *
18547  * Sets @mask on @info to match specific attribute types.
18548  */
18549
18550
18551 /**
18552  * g_file_info_set_attribute_object:
18553  * @info: a #GFileInfo.
18554  * @attribute: a file attribute key.
18555  * @attr_value: a #GObject.
18556  *
18557  * Sets the @attribute to contain the given @attr_value,
18558  * if possible.
18559  */
18560
18561
18562 /**
18563  * g_file_info_set_attribute_status:
18564  * @info: a #GFileInfo
18565  * @attribute: a file attribute key
18566  * @status: a #GFileAttributeStatus
18567  *
18568  * Sets the attribute status for an attribute key. This is only
18569  * needed by external code that implement g_file_set_attributes_from_info()
18570  * or similar functions.
18571  *
18572  * The attribute must exist in @info for this to work. Otherwise %FALSE
18573  * is returned and @info is unchanged.
18574  *
18575  * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18576  * Since: 2.22
18577  */
18578
18579
18580 /**
18581  * g_file_info_set_attribute_string:
18582  * @info: a #GFileInfo.
18583  * @attribute: a file attribute key.
18584  * @attr_value: a UTF-8 string.
18585  *
18586  * Sets the @attribute to contain the given @attr_value,
18587  * if possible.
18588  */
18589
18590
18591 /**
18592  * g_file_info_set_attribute_stringv:
18593  * @info: a #GFileInfo.
18594  * @attribute: a file attribute key
18595  * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18596  *
18597  * Sets the @attribute to contain the given @attr_value,
18598  * if possible.
18599  *
18600  * Sinze: 2.22
18601  */
18602
18603
18604 /**
18605  * g_file_info_set_attribute_uint32:
18606  * @info: a #GFileInfo.
18607  * @attribute: a file attribute key.
18608  * @attr_value: an unsigned 32-bit integer.
18609  *
18610  * Sets the @attribute to contain the given @attr_value,
18611  * if possible.
18612  */
18613
18614
18615 /**
18616  * g_file_info_set_attribute_uint64:
18617  * @info: a #GFileInfo.
18618  * @attribute: a file attribute key.
18619  * @attr_value: an unsigned 64-bit integer.
18620  *
18621  * Sets the @attribute to contain the given @attr_value,
18622  * if possible.
18623  */
18624
18625
18626 /**
18627  * g_file_info_set_content_type:
18628  * @info: a #GFileInfo.
18629  * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18630  *
18631  * Sets the content type attribute for a given #GFileInfo.
18632  * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18633  */
18634
18635
18636 /**
18637  * g_file_info_set_display_name:
18638  * @info: a #GFileInfo.
18639  * @display_name: a string containing a display name.
18640  *
18641  * Sets the display name for the current #GFileInfo.
18642  * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18643  */
18644
18645
18646 /**
18647  * g_file_info_set_edit_name:
18648  * @info: a #GFileInfo.
18649  * @edit_name: a string containing an edit name.
18650  *
18651  * Sets the edit name for the current file.
18652  * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18653  */
18654
18655
18656 /**
18657  * g_file_info_set_file_type:
18658  * @info: a #GFileInfo.
18659  * @type: a #GFileType.
18660  *
18661  * Sets the file type in a #GFileInfo to @type.
18662  * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18663  */
18664
18665
18666 /**
18667  * g_file_info_set_icon:
18668  * @info: a #GFileInfo.
18669  * @icon: a #GIcon.
18670  *
18671  * Sets the icon for a given #GFileInfo.
18672  * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18673  */
18674
18675
18676 /**
18677  * g_file_info_set_is_hidden:
18678  * @info: a #GFileInfo.
18679  * @is_hidden: a #gboolean.
18680  *
18681  * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18682  * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18683  */
18684
18685
18686 /**
18687  * g_file_info_set_is_symlink:
18688  * @info: a #GFileInfo.
18689  * @is_symlink: a #gboolean.
18690  *
18691  * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18692  * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18693  */
18694
18695
18696 /**
18697  * g_file_info_set_modification_time:
18698  * @info: a #GFileInfo.
18699  * @mtime: a #GTimeVal.
18700  *
18701  * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18702  * info to the given time value.
18703  */
18704
18705
18706 /**
18707  * g_file_info_set_name:
18708  * @info: a #GFileInfo.
18709  * @name: a string containing a name.
18710  *
18711  * Sets the name attribute for the current #GFileInfo.
18712  * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18713  */
18714
18715
18716 /**
18717  * g_file_info_set_size:
18718  * @info: a #GFileInfo.
18719  * @size: a #goffset containing the file's size.
18720  *
18721  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18722  * to the given size.
18723  */
18724
18725
18726 /**
18727  * g_file_info_set_sort_order:
18728  * @info: a #GFileInfo.
18729  * @sort_order: a sort order integer.
18730  *
18731  * Sets the sort order attribute in the file info structure. See
18732  * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18733  */
18734
18735
18736 /**
18737  * g_file_info_set_symlink_target:
18738  * @info: a #GFileInfo.
18739  * @symlink_target: a static string containing a path to a symlink target.
18740  *
18741  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18742  * to the given symlink target.
18743  */
18744
18745
18746 /**
18747  * g_file_info_unset_attribute_mask:
18748  * @info: #GFileInfo.
18749  *
18750  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18751  * is set.
18752  */
18753
18754
18755 /**
18756  * g_file_input_stream_query_info:
18757  * @stream: a #GFileInputStream.
18758  * @attributes: a file attribute query string.
18759  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18760  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18761  *
18762  * Queries a file input stream the given @attributes. This function blocks
18763  * while querying the stream. For the asynchronous (non-blocking) version
18764  * of this function, see g_file_input_stream_query_info_async(). While the
18765  * stream is blocked, the stream will set the pending flag internally, and
18766  * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18767  *
18768  * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18769  */
18770
18771
18772 /**
18773  * g_file_input_stream_query_info_async:
18774  * @stream: a #GFileInputStream.
18775  * @attributes: a file attribute query string.
18776  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18777  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18778  * @callback: (scope async): callback to call when the request is satisfied
18779  * @user_data: (closure): the data to pass to callback function
18780  *
18781  * Queries the stream information asynchronously.
18782  * When the operation is finished @callback will be called.
18783  * You can then call g_file_input_stream_query_info_finish()
18784  * to get the result of the operation.
18785  *
18786  * For the synchronous version of this function,
18787  * see g_file_input_stream_query_info().
18788  *
18789  * If @cancellable is not %NULL, then the operation can be cancelled by
18790  * triggering the cancellable object from another thread. If the operation
18791  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18792  */
18793
18794
18795 /**
18796  * g_file_input_stream_query_info_finish:
18797  * @stream: a #GFileInputStream.
18798  * @result: a #GAsyncResult.
18799  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18800  *
18801  * Finishes an asynchronous info query operation.
18802  *
18803  * Returns: (transfer full): #GFileInfo.
18804  */
18805
18806
18807 /**
18808  * g_file_io_stream_get_etag:
18809  * @stream: a #GFileIOStream.
18810  *
18811  * Gets the entity tag for the file when it has been written.
18812  * This must be called after the stream has been written
18813  * and closed, as the etag can change while writing.
18814  *
18815  * Returns: the entity tag for the stream.
18816  * Since: 2.22
18817  */
18818
18819
18820 /**
18821  * g_file_io_stream_query_info:
18822  * @stream: a #GFileIOStream.
18823  * @attributes: a file attribute query string.
18824  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18825  * @error: a #GError, %NULL to ignore.
18826  *
18827  * Queries a file io stream for the given @attributes.
18828  * This function blocks while querying the stream. For the asynchronous
18829  * version of this function, see g_file_io_stream_query_info_async().
18830  * While the stream is blocked, the stream will set the pending flag
18831  * internally, and any other operations on the stream will fail with
18832  * %G_IO_ERROR_PENDING.
18833  *
18834  * Can fail if the stream was already closed (with @error being set to
18835  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
18836  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
18837  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
18838  * all cases of failure, %NULL will be returned.
18839  *
18840  * If @cancellable is not %NULL, then the operation can be cancelled by
18841  * triggering the cancellable object from another thread. If the operation
18842  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
18843  * be returned.
18844  *
18845  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
18846  * Since: 2.22
18847  */
18848
18849
18850 /**
18851  * g_file_io_stream_query_info_async:
18852  * @stream: a #GFileIOStream.
18853  * @attributes: a file attribute query string.
18854  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
18855  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18856  * @callback: (scope async): callback to call when the request is satisfied
18857  * @user_data: (closure): the data to pass to callback function
18858  *
18859  * Asynchronously queries the @stream for a #GFileInfo. When completed,
18860  * @callback will be called with a #GAsyncResult which can be used to
18861  * finish the operation with g_file_io_stream_query_info_finish().
18862  *
18863  * For the synchronous version of this function, see
18864  * g_file_io_stream_query_info().
18865  *
18866  * Since: 2.22
18867  */
18868
18869
18870 /**
18871  * g_file_io_stream_query_info_finish:
18872  * @stream: a #GFileIOStream.
18873  * @result: a #GAsyncResult.
18874  * @error: a #GError, %NULL to ignore.
18875  *
18876  * Finalizes the asynchronous query started
18877  * by g_file_io_stream_query_info_async().
18878  *
18879  * Returns: (transfer full): A #GFileInfo for the finished query.
18880  * Since: 2.22
18881  */
18882
18883
18884 /**
18885  * g_file_is_native:
18886  * @file: input #GFile.
18887  *
18888  * Checks to see if a file is native to the platform.
18889  *
18890  * A native file s one expressed in the platform-native filename format,
18891  * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
18892  * as it might be on a locally mounted remote filesystem.
18893  *
18894  * On some systems non-native files may be available using
18895  * the native filesystem via a userspace filesystem (FUSE), in
18896  * these cases this call will return %FALSE, but g_file_get_path()
18897  * will still return a native path.
18898  *
18899  * This call does no blocking i/o.
18900  *
18901  * Returns: %TRUE if file is native.
18902  */
18903
18904
18905 /**
18906  * g_file_load_contents:
18907  * @file: input #GFile.
18908  * @cancellable: optional #GCancellable object, %NULL to ignore.
18909  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
18910  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18911  * @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
18912  * @error: a #GError, or %NULL
18913  *
18914  * Loads the content of the file into memory. The data is always
18915  * zero-terminated, but this is not included in the resultant @length.
18916  * The returned @content should be freed with g_free() when no longer
18917  * needed.
18918  *
18919  * If @cancellable is not %NULL, then the operation can be cancelled by
18920  * triggering the cancellable object from another thread. If the operation
18921  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18922  *
18923  * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
18924  */
18925
18926
18927 /**
18928  * g_file_load_contents_async:
18929  * @file: input #GFile.
18930  * @cancellable: optional #GCancellable object, %NULL to ignore.
18931  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18932  * @user_data: the data to pass to callback function
18933  *
18934  * Starts an asynchronous load of the @file's contents.
18935  *
18936  * For more details, see g_file_load_contents() which is
18937  * the synchronous version of this call.
18938  *
18939  * When the load operation has completed, @callback will be called
18940  * with @user data. To finish the operation, call
18941  * g_file_load_contents_finish() with the #GAsyncResult returned by
18942  * the @callback.
18943  *
18944  * If @cancellable is not %NULL, then the operation can be cancelled by
18945  * triggering the cancellable object from another thread. If the operation
18946  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18947  */
18948
18949
18950 /**
18951  * g_file_load_contents_finish:
18952  * @file: input #GFile.
18953  * @res: a #GAsyncResult.
18954  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
18955  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18956  * @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
18957  * @error: a #GError, or %NULL
18958  *
18959  * Finishes an asynchronous load of the @file's contents.
18960  * The contents are placed in @contents, and @length is set to the
18961  * size of the @contents string. The @content should be freed with
18962  * g_free() when no longer needed. If @etag_out is present, it will be
18963  * set to the new entity tag for the @file.
18964  *
18965  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
18966  */
18967
18968
18969 /**
18970  * g_file_load_partial_contents_async: (skip)
18971  * @file: input #GFile.
18972  * @cancellable: optional #GCancellable object, %NULL to ignore.
18973  * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read.
18974  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18975  * @user_data: the data to pass to the callback functions.
18976  *
18977  * Reads the partial contents of a file. A #GFileReadMoreCallback should be
18978  * used to stop reading from the file when appropriate, else this function
18979  * will behave exactly as g_file_load_contents_async(). This operation
18980  * can be finished by g_file_load_partial_contents_finish().
18981  *
18982  * Users of this function should be aware that @user_data is passed to
18983  * both the @read_more_callback and the @callback.
18984  *
18985  * If @cancellable is not %NULL, then the operation can be cancelled by
18986  * triggering the cancellable object from another thread. If the operation
18987  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18988  */
18989
18990
18991 /**
18992  * g_file_load_partial_contents_finish:
18993  * @file: input #GFile.
18994  * @res: a #GAsyncResult.
18995  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
18996  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18997  * @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
18998  * @error: a #GError, or %NULL
18999  *
19000  * Finishes an asynchronous partial load operation that was started
19001  * with g_file_load_partial_contents_async(). The data is always
19002  * zero-terminated, but this is not included in the resultant @length.
19003  * The returned @content should be freed with g_free() when no longer
19004  * needed.
19005  *
19006  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19007  */
19008
19009
19010 /**
19011  * g_file_make_directory:
19012  * @file: input #GFile.
19013  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19014  * @error: a #GError, or %NULL
19015  *
19016  * Creates a directory. Note that this will only create a child directory of
19017  * the immediate parent directory of the path or URI given by the #GFile. To
19018  * recursively create directories, see g_file_make_directory_with_parents().
19019  * This function will fail if the parent directory does not exist, setting
19020  * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support creating
19021  * directories, this function will fail, setting @error to
19022  * %G_IO_ERROR_NOT_SUPPORTED.
19023  *
19024  * For a local #GFile the newly created directory will have the default
19025  * (current) ownership and permissions of the current process.
19026  *
19027  * If @cancellable is not %NULL, then the operation can be cancelled by
19028  * triggering the cancellable object from another thread. If the operation
19029  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19030  *
19031  * Returns: %TRUE on successful creation, %FALSE otherwise.
19032  */
19033
19034
19035 /**
19036  * g_file_make_directory_with_parents:
19037  * @file: input #GFile.
19038  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19039  * @error: a #GError, or %NULL
19040  *
19041  * Creates a directory and any parent directories that may not exist similar to
19042  * 'mkdir -p'. If the file system does not support creating directories, this
19043  * function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If the
19044  * directory itself already exists, this function will fail setting @error
19045  * to %G_IO_ERROR_EXISTS, unlike the similar g_mkdir_with_parents().
19046  *
19047  * For a local #GFile the newly created directories will have the default
19048  * (current) ownership and permissions of the current process.
19049  *
19050  * If @cancellable is not %NULL, then the operation can be cancelled by
19051  * triggering the cancellable object from another thread. If the operation
19052  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19053  *
19054  * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19055  * Since: 2.18
19056  */
19057
19058
19059 /**
19060  * g_file_make_symbolic_link:
19061  * @file: a #GFile with the name of the symlink to create
19062  * @symlink_value: a string with the path for the target of the new symlink
19063  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19064  * @error: a #GError.
19065  *
19066  * Creates a symbolic link named @file which contains the string
19067  * @symlink_value.
19068  *
19069  * If @cancellable is not %NULL, then the operation can be cancelled by
19070  * triggering the cancellable object from another thread. If the operation
19071  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19072  *
19073  * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19074  */
19075
19076
19077 /**
19078  * g_file_monitor:
19079  * @file: input #GFile
19080  * @flags: a set of #GFileMonitorFlags
19081  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19082  * @error: a #GError, or %NULL
19083  *
19084  * Obtains a file or directory monitor for the given file, depending
19085  * on the type of the file.
19086  *
19087  * If @cancellable is not %NULL, then the operation can be cancelled by
19088  * triggering the cancellable object from another thread. If the operation
19089  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19090  *
19091  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19092  * Since: 2.18
19093  */
19094
19095
19096 /**
19097  * g_file_monitor_cancel:
19098  * @monitor: a #GFileMonitor.
19099  *
19100  * Cancels a file monitor.
19101  *
19102  * Returns: %TRUE if monitor was cancelled.
19103  */
19104
19105
19106 /**
19107  * g_file_monitor_directory:
19108  * @file: input #GFile.
19109  * @flags: a set of #GFileMonitorFlags.
19110  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19111  * @error: a #GError, or %NULL.
19112  *
19113  * Obtains a directory monitor for the given file.
19114  * This may fail if directory monitoring is not supported.
19115  *
19116  * If @cancellable is not %NULL, then the operation can be cancelled by
19117  * triggering the cancellable object from another thread. If the operation
19118  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19119  *
19120  * Virtual: monitor_dir
19121  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19122  */
19123
19124
19125 /**
19126  * g_file_monitor_emit_event:
19127  * @monitor: a #GFileMonitor.
19128  * @child: a #GFile.
19129  * @other_file: a #GFile.
19130  * @event_type: a set of #GFileMonitorEvent flags.
19131  *
19132  * Emits the #GFileMonitor::changed signal if a change
19133  * has taken place. Should be called from file monitor
19134  * implementations only.
19135  *
19136  * The signal will be emitted from an idle handler (in the <link
19137  * linkend="g-main-context-push-thread-default">thread-default main
19138  * context</link>).
19139  */
19140
19141
19142 /**
19143  * g_file_monitor_file:
19144  * @file: input #GFile.
19145  * @flags: a set of #GFileMonitorFlags.
19146  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19147  * @error: a #GError, or %NULL.
19148  *
19149  * Obtains a file monitor for the given file. If no file notification
19150  * mechanism exists, then regular polling of the file is used.
19151  *
19152  * If @cancellable is not %NULL, then the operation can be cancelled by
19153  * triggering the cancellable object from another thread. If the operation
19154  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19155  *
19156  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19157  */
19158
19159
19160 /**
19161  * g_file_monitor_is_cancelled:
19162  * @monitor: a #GFileMonitor
19163  *
19164  * Returns whether the monitor is canceled.
19165  *
19166  * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19167  */
19168
19169
19170 /**
19171  * g_file_monitor_set_rate_limit:
19172  * @monitor: a #GFileMonitor.
19173  * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19174  *
19175  * Sets the rate limit to which the @monitor will report
19176  * consecutive change events to the same file.
19177  */
19178
19179
19180 /**
19181  * g_file_mount_enclosing_volume:
19182  * @location: input #GFile.
19183  * @flags: flags affecting the operation
19184  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
19185  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19186  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
19187  * @user_data: the data to pass to callback function
19188  *
19189  * Starts a @mount_operation, mounting the volume that contains the file @location.
19190  *
19191  * When this operation has completed, @callback will be called with
19192  * @user_user data, and the operation can be finalized with
19193  * g_file_mount_enclosing_volume_finish().
19194  *
19195  * If @cancellable is not %NULL, then the operation can be cancelled by
19196  * triggering the cancellable object from another thread. If the operation
19197  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19198  */
19199
19200
19201 /**
19202  * g_file_mount_enclosing_volume_finish:
19203  * @location: input #GFile.
19204  * @result: a #GAsyncResult.
19205  * @error: a #GError, or %NULL
19206  *
19207  * Finishes a mount operation started by g_file_mount_enclosing_volume().
19208  *
19209  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19210  */
19211
19212
19213 /**
19214  * g_file_mount_mountable:
19215  * @file: input #GFile.
19216  * @flags: flags affecting the operation
19217  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
19218  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19219  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
19220  * @user_data: (closure): the data to pass to callback function
19221  *
19222  * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19223  * Using @mount_operation, you can request callbacks when, for instance,
19224  * passwords are needed during authentication.
19225  *
19226  * If @cancellable is not %NULL, then the operation can be cancelled by
19227  * triggering the cancellable object from another thread. If the operation
19228  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19229  *
19230  * When the operation is finished, @callback will be called. You can then call
19231  * g_file_mount_mountable_finish() to get the result of the operation.
19232  */
19233
19234
19235 /**
19236  * g_file_mount_mountable_finish:
19237  * @file: input #GFile.
19238  * @result: a #GAsyncResult.
19239  * @error: a #GError, or %NULL
19240  *
19241  * Finishes a mount operation. See g_file_mount_mountable() for details.
19242  *
19243  * Finish an asynchronous mount operation that was started
19244  * with g_file_mount_mountable().
19245  *
19246  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19247  */
19248
19249
19250 /**
19251  * g_file_move:
19252  * @source: #GFile pointing to the source location.
19253  * @destination: #GFile pointing to the destination location.
19254  * @flags: set of #GFileCopyFlags.
19255  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19256  * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates.
19257  * @progress_callback_data: (closure): gpointer to user data for the callback function.
19258  * @error: #GError for returning error conditions, or %NULL
19259  *
19260  * Tries to move the file or directory @source to the location specified by @destination.
19261  * If native move operations are supported then this is used, otherwise a copy + delete
19262  * fallback is used. The native implementation may support moving directories (for instance
19263  * on moves inside the same filesystem), but the fallback code does not.
19264  *
19265  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19266  * existing @destination file is overwritten.
19267  *
19268  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19269  * will be copied as symlinks, otherwise the target of the
19270  * @source symlink will be copied.
19271  *
19272  * If @cancellable is not %NULL, then the operation can be cancelled by
19273  * triggering the cancellable object from another thread. If the operation
19274  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19275  *
19276  * If @progress_callback is not %NULL, then the operation can be monitored by
19277  * setting this to a #GFileProgressCallback function. @progress_callback_data
19278  * will be passed to this function. It is guaranteed that this callback will
19279  * be called after all data has been transferred with the total number of bytes
19280  * copied during the operation.
19281  *
19282  * If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
19283  * error is returned, independent on the status of the @destination.
19284  *
19285  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
19286  * error G_IO_ERROR_EXISTS is returned.
19287  *
19288  * If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
19289  * error is returned. If trying to overwrite a directory with a directory the
19290  * G_IO_ERROR_WOULD_MERGE error is returned.
19291  *
19292  * If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is
19293  * specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error
19294  * may be returned (if the native move operation isn't available).
19295  *
19296  * Returns: %TRUE on successful move, %FALSE otherwise.
19297  */
19298
19299
19300 /**
19301  * g_file_new_for_commandline_arg:
19302  * @arg: a command line string.
19303  *
19304  * Creates a #GFile with the given argument from the command line. The value of
19305  * @arg can be either a URI, an absolute path or a relative path resolved
19306  * relative to the current working directory.
19307  * This operation never fails, but the returned object might not support any
19308  * I/O operation if @arg points to a malformed path.
19309  *
19310  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19311  */
19312
19313
19314 /**
19315  * g_file_new_for_path:
19316  * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19317  *
19318  * Constructs a #GFile for a given path. This operation never
19319  * fails, but the returned object might not support any I/O
19320  * operation if @path is malformed.
19321  *
19322  * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19323  */
19324
19325
19326 /**
19327  * g_file_new_for_uri:
19328  * @uri: a UTF8 string containing a URI.
19329  *
19330  * Constructs a #GFile for a given URI. This operation never
19331  * fails, but the returned object might not support any I/O
19332  * operation if @uri is malformed or if the uri type is
19333  * not supported.
19334  *
19335  * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19336  */
19337
19338
19339 /**
19340  * g_file_new_tmp:
19341  * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template.
19342  * @iostream: (out): on return, a #GFileIOStream for the created file.
19343  * @error: a #GError, or %NULL
19344  *
19345  * Opens a file in the preferred directory for temporary files (as
19346  * returned by g_get_tmp_dir()) and returns a #GFile and
19347  * #GFileIOStream pointing to it.
19348  *
19349  * @tmpl should be a string in the GLib file name encoding
19350  * containing a sequence of six 'X' characters, and containing no
19351  * directory components. If it is %NULL, a default template is used.
19352  *
19353  * Unlike the other #GFile constructors, this will return %NULL if
19354  * a temporary file could not be created.
19355  *
19356  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19357  * Since: 2.32
19358  */
19359
19360
19361 /**
19362  * g_file_open_readwrite:
19363  * @file: #GFile to open
19364  * @cancellable: (allow-none): a #GCancellable
19365  * @error: a #GError, or %NULL
19366  *
19367  * Opens an existing file for reading and writing. The result is
19368  * a #GFileIOStream that can be used to read and write the contents of the file.
19369  *
19370  * If @cancellable is not %NULL, then the operation can be cancelled by
19371  * triggering the cancellable object from another thread. If the operation
19372  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19373  *
19374  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19375  * If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
19376  * Other errors are possible too, and depend on what kind of filesystem the file is on.
19377  * Note that in many non-local file cases read and write streams are not supported,
19378  * so make sure you really need to do read and write streaming, rather than
19379  * just opening for reading or writing.
19380  *
19381  * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19382  * Since: 2.22
19383  */
19384
19385
19386 /**
19387  * g_file_open_readwrite_async:
19388  * @file: input #GFile.
19389  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19390  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19391  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19392  * @user_data: (closure): the data to pass to callback function
19393  *
19394  * Asynchronously opens @file for reading and writing.
19395  *
19396  * For more details, see g_file_open_readwrite() which is
19397  * the synchronous version of this call.
19398  *
19399  * When the operation is finished, @callback will be called. You can then call
19400  * g_file_open_readwrite_finish() to get the result of the operation.
19401  *
19402  * Since: 2.22
19403  */
19404
19405
19406 /**
19407  * g_file_open_readwrite_finish:
19408  * @file: input #GFile.
19409  * @res: a #GAsyncResult.
19410  * @error: a #GError, or %NULL
19411  *
19412  * Finishes an asynchronous file read operation started with
19413  * g_file_open_readwrite_async().
19414  *
19415  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19416  * Since: 2.22
19417  */
19418
19419
19420 /**
19421  * g_file_output_stream_get_etag:
19422  * @stream: a #GFileOutputStream.
19423  *
19424  * Gets the entity tag for the file when it has been written.
19425  * This must be called after the stream has been written
19426  * and closed, as the etag can change while writing.
19427  *
19428  * Returns: the entity tag for the stream.
19429  */
19430
19431
19432 /**
19433  * g_file_output_stream_query_info:
19434  * @stream: a #GFileOutputStream.
19435  * @attributes: a file attribute query string.
19436  * @cancellable: optional #GCancellable object, %NULL to ignore.
19437  * @error: a #GError, %NULL to ignore.
19438  *
19439  * Queries a file output stream for the given @attributes.
19440  * This function blocks while querying the stream. For the asynchronous
19441  * version of this function, see g_file_output_stream_query_info_async().
19442  * While the stream is blocked, the stream will set the pending flag
19443  * internally, and any other operations on the stream will fail with
19444  * %G_IO_ERROR_PENDING.
19445  *
19446  * Can fail if the stream was already closed (with @error being set to
19447  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19448  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19449  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19450  * all cases of failure, %NULL will be returned.
19451  *
19452  * If @cancellable is not %NULL, then the operation can be cancelled by
19453  * triggering the cancellable object from another thread. If the operation
19454  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19455  * be returned.
19456  *
19457  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19458  */
19459
19460
19461 /**
19462  * g_file_output_stream_query_info_async:
19463  * @stream: a #GFileOutputStream.
19464  * @attributes: a file attribute query string.
19465  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19466  * @cancellable: optional #GCancellable object, %NULL to ignore.
19467  * @callback: callback to call when the request is satisfied
19468  * @user_data: the data to pass to callback function
19469  *
19470  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19471  * @callback will be called with a #GAsyncResult which can be used to
19472  * finish the operation with g_file_output_stream_query_info_finish().
19473  *
19474  * For the synchronous version of this function, see
19475  * g_file_output_stream_query_info().
19476  */
19477
19478
19479 /**
19480  * g_file_output_stream_query_info_finish:
19481  * @stream: a #GFileOutputStream.
19482  * @result: a #GAsyncResult.
19483  * @error: a #GError, %NULL to ignore.
19484  *
19485  * Finalizes the asynchronous query started
19486  * by g_file_output_stream_query_info_async().
19487  *
19488  * Returns: (transfer full): A #GFileInfo for the finished query.
19489  */
19490
19491
19492 /**
19493  * g_file_parse_name:
19494  * @parse_name: a file name or path to be parsed.
19495  *
19496  * Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
19497  * This operation never fails, but the returned object might not support any I/O
19498  * operation if the @parse_name cannot be parsed.
19499  *
19500  * Returns: (transfer full): a new #GFile.
19501  */
19502
19503
19504 /**
19505  * g_file_poll_mountable:
19506  * @file: input #GFile.
19507  * @cancellable: optional #GCancellable object, %NULL to ignore.
19508  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
19509  * @user_data: the data to pass to callback function
19510  *
19511  * Polls a file of type G_FILE_TYPE_MOUNTABLE.
19512  *
19513  * If @cancellable is not %NULL, then the operation can be cancelled by
19514  * triggering the cancellable object from another thread. If the operation
19515  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19516  *
19517  * When the operation is finished, @callback will be called. You can then call
19518  * g_file_mount_mountable_finish() to get the result of the operation.
19519  *
19520  * Since: 2.22
19521  */
19522
19523
19524 /**
19525  * g_file_poll_mountable_finish:
19526  * @file: input #GFile.
19527  * @result: a #GAsyncResult.
19528  * @error: a #GError, or %NULL
19529  *
19530  * Finishes a poll operation. See g_file_poll_mountable() for details.
19531  *
19532  * Finish an asynchronous poll operation that was polled
19533  * with g_file_poll_mountable().
19534  *
19535  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19536  * Since: 2.22
19537  */
19538
19539
19540 /**
19541  * g_file_query_default_handler:
19542  * @file: a #GFile to open.
19543  * @cancellable: optional #GCancellable object, %NULL to ignore.
19544  * @error: a #GError, or %NULL
19545  *
19546  * Returns the #GAppInfo that is registered as the default
19547  * application to handle the file specified by @file.
19548  *
19549  * If @cancellable is not %NULL, then the operation can be cancelled by
19550  * triggering the cancellable object from another thread. If the operation
19551  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19552  *
19553  * 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()
19554  */
19555
19556
19557 /**
19558  * g_file_query_exists:
19559  * @file: input #GFile.
19560  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19561  *
19562  * Utility function to check if a particular file exists. This is
19563  * implemented using g_file_query_info() and as such does blocking I/O.
19564  *
19565  * Note that in many cases it is racy to first check for file existence
19566  * and then execute something based on the outcome of that, because the
19567  * file might have been created or removed in between the operations. The
19568  * general approach to handling that is to not check, but just do the
19569  * operation and handle the errors as they come.
19570  *
19571  * As an example of race-free checking, take the case of reading a file, and
19572  * if it doesn't exist, creating it. There are two racy versions: read it, and
19573  * on error create it; and: check if it exists, if not create it. These
19574  * can both result in two processes creating the file (with perhaps a partially
19575  * written file as the result). The correct approach is to always try to create
19576  * the file with g_file_create() which will either atomically create the file
19577  * or fail with a G_IO_ERROR_EXISTS error.
19578  *
19579  * However, in many cases an existence check is useful in a user
19580  * interface, for instance to make a menu item sensitive/insensitive, so that
19581  * you don't have to fool users that something is possible and then just show
19582  * and error dialog. If you do this, you should make sure to also handle the
19583  * errors that can happen due to races when you execute the operation.
19584  *
19585  * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19586  */
19587
19588
19589 /**
19590  * g_file_query_file_type:
19591  * @file: input #GFile.
19592  * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info().
19593  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19594  *
19595  * Utility function to inspect the #GFileType of a file. This is
19596  * implemented using g_file_query_info() and as such does blocking I/O.
19597  *
19598  * The primary use case of this method is to check if a file is a regular file,
19599  * directory, or symlink.
19600  *
19601  * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19602  * Since: 2.18
19603  */
19604
19605
19606 /**
19607  * g_file_query_filesystem_info:
19608  * @file: input #GFile.
19609  * @attributes: an attribute query string.
19610  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19611  * @error: a #GError.
19612  *
19613  * Similar to g_file_query_info(), but obtains information
19614  * about the filesystem the @file is on, rather than the file itself.
19615  * For instance the amount of space available and the type of
19616  * the filesystem.
19617  *
19618  * The @attributes value is a string that specifies the file attributes that
19619  * should be gathered. It is not an error if it's not possible to read a particular
19620  * requested attribute from a file - it just won't be set. @attributes should
19621  * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
19622  * means all attributes, and a wildcard like "filesystem::*" means all attributes in the
19623  * filesystem namespace. The standard namespace for filesystem attributes is "filesystem".
19624  * Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
19625  * (the total size of the filesystem in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
19626  * bytes available), and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19627  *
19628  * If @cancellable is not %NULL, then the operation can be cancelled by
19629  * triggering the cancellable object from another thread. If the operation
19630  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19631  *
19632  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19633  * Other errors are possible too, and depend on what kind of filesystem the file is on.
19634  *
19635  * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19636  */
19637
19638
19639 /**
19640  * g_file_query_filesystem_info_async:
19641  * @file: input #GFile.
19642  * @attributes: an attribute query string.
19643  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19644  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19645  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19646  * @user_data: (closure): the data to pass to callback function
19647  *
19648  * Asynchronously gets the requested information about the filesystem
19649  * that the specified @file is on. The result is a #GFileInfo object
19650  * that contains key-value attributes (such as type or size for the
19651  * file).
19652  *
19653  * For more details, see g_file_query_filesystem_info() which is the
19654  * synchronous version of this call.
19655  *
19656  * When the operation is finished, @callback will be called. You can
19657  * then call g_file_query_info_finish() to get the result of the
19658  * operation.
19659  */
19660
19661
19662 /**
19663  * g_file_query_filesystem_info_finish:
19664  * @file: input #GFile.
19665  * @res: a #GAsyncResult.
19666  * @error: a #GError.
19667  *
19668  * Finishes an asynchronous filesystem info query.  See
19669  * g_file_query_filesystem_info_async().
19670  *
19671  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19672  */
19673
19674
19675 /**
19676  * g_file_query_info:
19677  * @file: input #GFile.
19678  * @attributes: an attribute query string.
19679  * @flags: a set of #GFileQueryInfoFlags.
19680  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19681  * @error: a #GError.
19682  *
19683  * Gets the requested information about specified @file. The result
19684  * is a #GFileInfo object that contains key-value attributes (such as
19685  * the type or size of the file).
19686  *
19687  * The @attributes value is a string that specifies the file attributes that
19688  * should be gathered. It is not an error if it's not possible to read a particular
19689  * requested attribute from a file - it just won't be set. @attributes should
19690  * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
19691  * means all attributes, and a wildcard like "standard::*" means all attributes in the standard
19692  * namespace. An example attribute query be "standard::*,owner::user".
19693  * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
19694  *
19695  * If @cancellable is not %NULL, then the operation can be cancelled by
19696  * triggering the cancellable object from another thread. If the operation
19697  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19698  *
19699  * For symlinks, normally the information about the target of the
19700  * symlink is returned, rather than information about the symlink itself.
19701  * However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the
19702  * information about the symlink itself will be returned. Also, for symlinks
19703  * that point to non-existing files the information about the symlink itself
19704  * will be returned.
19705  *
19706  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19707  * Other errors are possible too, and depend on what kind of filesystem the file is on.
19708  *
19709  * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19710  */
19711
19712
19713 /**
19714  * g_file_query_info_async:
19715  * @file: input #GFile.
19716  * @attributes: an attribute query string.
19717  * @flags: a set of #GFileQueryInfoFlags.
19718  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19719  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19720  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19721  * @user_data: (closure): the data to pass to callback function
19722  *
19723  * Asynchronously gets the requested information about specified @file. The result
19724  * is a #GFileInfo object that contains key-value attributes (such as type or size
19725  * for the file).
19726  *
19727  * For more details, see g_file_query_info() which is
19728  * the synchronous version of this call.
19729  *
19730  * When the operation is finished, @callback will be called. You can then call
19731  * g_file_query_info_finish() to get the result of the operation.
19732  */
19733
19734
19735 /**
19736  * g_file_query_info_finish:
19737  * @file: input #GFile.
19738  * @res: a #GAsyncResult.
19739  * @error: a #GError.
19740  *
19741  * Finishes an asynchronous file info query.
19742  * See g_file_query_info_async().
19743  *
19744  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19745  */
19746
19747
19748 /**
19749  * g_file_query_settable_attributes:
19750  * @file: input #GFile.
19751  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19752  * @error: a #GError, or %NULL
19753  *
19754  * Obtain the list of settable attributes for the file.
19755  *
19756  * Returns the type and full attribute name of all the attributes
19757  * that can be set on this file. This doesn't mean setting it will always
19758  * succeed though, you might get an access failure, or some specific
19759  * file may not support a specific attribute.
19760  *
19761  * If @cancellable is not %NULL, then the operation can be cancelled by
19762  * triggering the cancellable object from another thread. If the operation
19763  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19764  *
19765  * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19766  */
19767
19768
19769 /**
19770  * g_file_query_writable_namespaces:
19771  * @file: input #GFile.
19772  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19773  * @error: a #GError, or %NULL
19774  *
19775  * Obtain the list of attribute namespaces where new attributes
19776  * can be created by a user. An example of this is extended
19777  * attributes (in the "xattr" namespace).
19778  *
19779  * If @cancellable is not %NULL, then the operation can be cancelled by
19780  * triggering the cancellable object from another thread. If the operation
19781  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19782  *
19783  * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19784  */
19785
19786
19787 /**
19788  * g_file_read:
19789  * @file: #GFile to read.
19790  * @cancellable: (allow-none): a #GCancellable
19791  * @error: a #GError, or %NULL
19792  *
19793  * Opens a file for reading. The result is a #GFileInputStream that
19794  * can be used to read the contents of the file.
19795  *
19796  * If @cancellable is not %NULL, then the operation can be cancelled by
19797  * triggering the cancellable object from another thread. If the operation
19798  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19799  *
19800  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19801  * If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
19802  * Other errors are possible too, and depend on what kind of filesystem the file is on.
19803  *
19804  * Virtual: read_fn
19805  * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19806  */
19807
19808
19809 /**
19810  * g_file_read_async:
19811  * @file: input #GFile
19812  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19813  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19814  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19815  * @user_data: (closure): the data to pass to callback function
19816  *
19817  * Asynchronously opens @file for reading.
19818  *
19819  * For more details, see g_file_read() which is
19820  * the synchronous version of this call.
19821  *
19822  * When the operation is finished, @callback will be called. You can then call
19823  * g_file_read_finish() to get the result of the operation.
19824  */
19825
19826
19827 /**
19828  * g_file_read_finish:
19829  * @file: input #GFile.
19830  * @res: a #GAsyncResult.
19831  * @error: a #GError, or %NULL
19832  *
19833  * Finishes an asynchronous file read operation started with
19834  * g_file_read_async().
19835  *
19836  * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19837  */
19838
19839
19840 /**
19841  * g_file_replace:
19842  * @file: input #GFile.
19843  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
19844  * @make_backup: %TRUE if a backup should be created.
19845  * @flags: a set of #GFileCreateFlags.
19846  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19847  * @error: a #GError, or %NULL
19848  *
19849  * Returns an output stream for overwriting the file, possibly
19850  * creating a backup copy of the file first. If the file doesn't exist,
19851  * it will be created.
19852  *
19853  * This will try to replace the file in the safest way possible so
19854  * that any errors during the writing will not affect an already
19855  * existing copy of the file. For instance, for local files it
19856  * may write to a temporary file and then atomically rename over
19857  * the destination when the stream is closed.
19858  *
19859  * By default files created are generally readable by everyone,
19860  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
19861  * will be made readable only to the current user, to the level that
19862  * is supported on the target filesystem.
19863  *
19864  * If @cancellable is not %NULL, then the operation can be cancelled by
19865  * triggering the cancellable object from another thread. If the operation
19866  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19867  *
19868  * If you pass in a non-#NULL @etag value, then this value is
19869  * compared to the current entity tag of the file, and if they differ
19870  * an G_IO_ERROR_WRONG_ETAG error is returned. This generally means
19871  * that the file has been changed since you last read it. You can get
19872  * the new etag from g_file_output_stream_get_etag() after you've
19873  * finished writing and closed the #GFileOutputStream. When you load
19874  * a new file you can use g_file_input_stream_query_info() to get
19875  * the etag of the file.
19876  *
19877  * If @make_backup is %TRUE, this function will attempt to make a backup
19878  * of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP
19879  * error will be returned. If you want to replace anyway, try again with
19880  * @make_backup set to %FALSE.
19881  *
19882  * If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned,
19883  * and if the file is some other form of non-regular file then a
19884  * G_IO_ERROR_NOT_REGULAR_FILE error will be returned.
19885  * Some file systems don't allow all file names, and may
19886  * return an G_IO_ERROR_INVALID_FILENAME error, and if the name
19887  * is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
19888  * Other errors are possible too, and depend on what kind of
19889  * filesystem the file is on.
19890  *
19891  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
19892  */
19893
19894
19895 /**
19896  * g_file_replace_async:
19897  * @file: input #GFile.
19898  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
19899  * @make_backup: %TRUE if a backup should be created.
19900  * @flags: a set of #GFileCreateFlags.
19901  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19902  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19903  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19904  * @user_data: (closure): the data to pass to callback function
19905  *
19906  * Asynchronously overwrites the file, replacing the contents, possibly
19907  * creating a backup copy of the file first.
19908  *
19909  * For more details, see g_file_replace() which is
19910  * the synchronous version of this call.
19911  *
19912  * When the operation is finished, @callback will be called. You can then call
19913  * g_file_replace_finish() to get the result of the operation.
19914  */
19915
19916
19917 /**
19918  * g_file_replace_contents:
19919  * @file: input #GFile.
19920  * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file.
19921  * @length: the length of @contents in bytes.
19922  * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
19923  * @make_backup: %TRUE if a backup should be created.
19924  * @flags: a set of #GFileCreateFlags.
19925  * @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
19926  * @cancellable: optional #GCancellable object, %NULL to ignore.
19927  * @error: a #GError, or %NULL
19928  *
19929  * Replaces the contents of @file with @contents of @length bytes.
19930  *
19931  * If @etag is specified (not %NULL) any existing file must have that etag, or
19932  * the error %G_IO_ERROR_WRONG_ETAG will be returned.
19933  *
19934  * If @make_backup is %TRUE, this function will attempt to make a backup of @file.
19935  *
19936  * If @cancellable is not %NULL, then the operation can be cancelled by
19937  * triggering the cancellable object from another thread. If the operation
19938  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19939  *
19940  * The returned @new_etag can be used to verify that the file hasn't changed the
19941  * next time it is saved over.
19942  *
19943  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19944  */
19945
19946
19947 /**
19948  * g_file_replace_contents_async:
19949  * @file: input #GFile.
19950  * @contents: (element-type guint8) (array length=length): string of contents to replace the file with.
19951  * @length: the length of @contents in bytes.
19952  * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
19953  * @make_backup: %TRUE if a backup should be created.
19954  * @flags: a set of #GFileCreateFlags.
19955  * @cancellable: optional #GCancellable object, %NULL to ignore.
19956  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19957  * @user_data: the data to pass to callback function
19958  *
19959  * Starts an asynchronous replacement of @file with the given
19960  * @contents of @length bytes. @etag will replace the document's
19961  * current entity tag.
19962  *
19963  * When this operation has completed, @callback will be called with
19964  * @user_user data, and the operation can be finalized with
19965  * g_file_replace_contents_finish().
19966  *
19967  * If @cancellable is not %NULL, then the operation can be cancelled by
19968  * triggering the cancellable object from another thread. If the operation
19969  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19970  *
19971  * If @make_backup is %TRUE, this function will attempt to
19972  * make a backup of @file.
19973  */
19974
19975
19976 /**
19977  * g_file_replace_contents_finish:
19978  * @file: input #GFile.
19979  * @res: a #GAsyncResult.
19980  * @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
19981  * @error: a #GError, or %NULL
19982  *
19983  * Finishes an asynchronous replace of the given @file. See
19984  * g_file_replace_contents_async(). Sets @new_etag to the new entity
19985  * tag for the document, if present.
19986  *
19987  * Returns: %TRUE on success, %FALSE on failure.
19988  */
19989
19990
19991 /**
19992  * g_file_replace_finish:
19993  * @file: input #GFile.
19994  * @res: a #GAsyncResult.
19995  * @error: a #GError, or %NULL
19996  *
19997  * Finishes an asynchronous file replace operation started with
19998  * g_file_replace_async().
19999  *
20000  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20001  */
20002
20003
20004 /**
20005  * g_file_replace_readwrite:
20006  * @file: a #GFile
20007  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20008  * @make_backup: %TRUE if a backup should be created
20009  * @flags: a set of #GFileCreateFlags
20010  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20011  * @error: return location for a #GError, or %NULL
20012  *
20013  * Returns an output stream for overwriting the file in readwrite mode,
20014  * possibly creating a backup copy of the file first. If the file doesn't
20015  * exist, it will be created.
20016  *
20017  * For details about the behaviour, see g_file_replace() which does the same
20018  * thing but returns an output stream only.
20019  *
20020  * Note that in many non-local file cases read and write streams are not
20021  * supported, so make sure you really need to do read and write streaming,
20022  * rather than just opening for reading or writing.
20023  *
20024  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20025  * Since: 2.22
20026  */
20027
20028
20029 /**
20030  * g_file_replace_readwrite_async:
20031  * @file: input #GFile.
20032  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
20033  * @make_backup: %TRUE if a backup should be created.
20034  * @flags: a set of #GFileCreateFlags.
20035  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20036  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20037  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20038  * @user_data: (closure): the data to pass to callback function
20039  *
20040  * Asynchronously overwrites the file in read-write mode, replacing the
20041  * contents, possibly creating a backup copy of the file first.
20042  *
20043  * For more details, see g_file_replace_readwrite() which is
20044  * the synchronous version of this call.
20045  *
20046  * When the operation is finished, @callback will be called. You can then
20047  * call g_file_replace_readwrite_finish() to get the result of the operation.
20048  *
20049  * Since: 2.22
20050  */
20051
20052
20053 /**
20054  * g_file_replace_readwrite_finish:
20055  * @file: input #GFile.
20056  * @res: a #GAsyncResult.
20057  * @error: a #GError, or %NULL
20058  *
20059  * Finishes an asynchronous file replace operation started with
20060  * g_file_replace_readwrite_async().
20061  *
20062  * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20063  * Since: 2.22
20064  */
20065
20066
20067 /**
20068  * g_file_resolve_relative_path:
20069  * @file: input #GFile.
20070  * @relative_path: a given relative path string.
20071  *
20072  * Resolves a relative path for @file to an absolute path.
20073  *
20074  * This call does no blocking i/o.
20075  *
20076  * 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().
20077  */
20078
20079
20080 /**
20081  * g_file_set_attribute:
20082  * @file: input #GFile.
20083  * @attribute: a string containing the attribute's name.
20084  * @type: The type of the attribute
20085  * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20086  * @flags: a set of #GFileQueryInfoFlags.
20087  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20088  * @error: a #GError, or %NULL
20089  *
20090  * Sets an attribute in the file with attribute name @attribute to @value.
20091  *
20092  * Some attributes can be unset by setting @attribute to
20093  * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20094  *
20095  * If @cancellable is not %NULL, then the operation can be cancelled by
20096  * triggering the cancellable object from another thread. If the operation
20097  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20098  *
20099  * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20100  */
20101
20102
20103 /**
20104  * g_file_set_attribute_byte_string:
20105  * @file: input #GFile.
20106  * @attribute: a string containing the attribute's name.
20107  * @value: a string containing the attribute's new value.
20108  * @flags: a #GFileQueryInfoFlags.
20109  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20110  * @error: a #GError, or %NULL
20111  *
20112  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20113  * If @attribute is of a different type, this operation will fail,
20114  * returning %FALSE.
20115  *
20116  * If @cancellable is not %NULL, then the operation can be cancelled by
20117  * triggering the cancellable object from another thread. If the operation
20118  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20119  *
20120  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20121  */
20122
20123
20124 /**
20125  * g_file_set_attribute_int32:
20126  * @file: input #GFile.
20127  * @attribute: a string containing the attribute's name.
20128  * @value: a #gint32 containing the attribute's new value.
20129  * @flags: a #GFileQueryInfoFlags.
20130  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20131  * @error: a #GError, or %NULL
20132  *
20133  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20134  * If @attribute is of a different type, this operation will fail.
20135  *
20136  * If @cancellable is not %NULL, then the operation can be cancelled by
20137  * triggering the cancellable object from another thread. If the operation
20138  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20139  *
20140  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20141  */
20142
20143
20144 /**
20145  * g_file_set_attribute_int64:
20146  * @file: input #GFile.
20147  * @attribute: a string containing the attribute's name.
20148  * @value: a #guint64 containing the attribute's new value.
20149  * @flags: a #GFileQueryInfoFlags.
20150  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20151  * @error: a #GError, or %NULL
20152  *
20153  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20154  * If @attribute is of a different type, this operation will fail.
20155  *
20156  * If @cancellable is not %NULL, then the operation can be cancelled by
20157  * triggering the cancellable object from another thread. If the operation
20158  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20159  *
20160  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20161  */
20162
20163
20164 /**
20165  * g_file_set_attribute_string:
20166  * @file: input #GFile.
20167  * @attribute: a string containing the attribute's name.
20168  * @value: a string containing the attribute's value.
20169  * @flags: #GFileQueryInfoFlags.
20170  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20171  * @error: a #GError, or %NULL
20172  *
20173  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20174  * If @attribute is of a different type, this operation will fail.
20175  *
20176  * If @cancellable is not %NULL, then the operation can be cancelled by
20177  * triggering the cancellable object from another thread. If the operation
20178  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20179  *
20180  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20181  */
20182
20183
20184 /**
20185  * g_file_set_attribute_uint32:
20186  * @file: input #GFile.
20187  * @attribute: a string containing the attribute's name.
20188  * @value: a #guint32 containing the attribute's new value.
20189  * @flags: a #GFileQueryInfoFlags.
20190  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20191  * @error: a #GError, or %NULL
20192  *
20193  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20194  * If @attribute is of a different type, this operation will fail.
20195  *
20196  * If @cancellable is not %NULL, then the operation can be cancelled by
20197  * triggering the cancellable object from another thread. If the operation
20198  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20199  *
20200  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20201  */
20202
20203
20204 /**
20205  * g_file_set_attribute_uint64:
20206  * @file: input #GFile.
20207  * @attribute: a string containing the attribute's name.
20208  * @value: a #guint64 containing the attribute's new value.
20209  * @flags: a #GFileQueryInfoFlags.
20210  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20211  * @error: a #GError, or %NULL
20212  *
20213  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20214  * If @attribute is of a different type, this operation will fail.
20215  *
20216  * If @cancellable is not %NULL, then the operation can be cancelled by
20217  * triggering the cancellable object from another thread. If the operation
20218  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20219  *
20220  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20221  */
20222
20223
20224 /**
20225  * g_file_set_attributes_async:
20226  * @file: input #GFile.
20227  * @info: a #GFileInfo.
20228  * @flags: a #GFileQueryInfoFlags.
20229  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20230  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20231  * @callback: (scope async): a #GAsyncReadyCallback.
20232  * @user_data: (closure): a #gpointer.
20233  *
20234  * Asynchronously sets the attributes of @file with @info.
20235  *
20236  * For more details, see g_file_set_attributes_from_info() which is
20237  * the synchronous version of this call.
20238  *
20239  * When the operation is finished, @callback will be called. You can then call
20240  * g_file_set_attributes_finish() to get the result of the operation.
20241  */
20242
20243
20244 /**
20245  * g_file_set_attributes_finish:
20246  * @file: input #GFile.
20247  * @result: a #GAsyncResult.
20248  * @info: (out) (transfer full): a #GFileInfo.
20249  * @error: a #GError, or %NULL
20250  *
20251  * Finishes setting an attribute started in g_file_set_attributes_async().
20252  *
20253  * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20254  */
20255
20256
20257 /**
20258  * g_file_set_attributes_from_info:
20259  * @file: input #GFile.
20260  * @info: a #GFileInfo.
20261  * @flags: #GFileQueryInfoFlags
20262  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20263  * @error: a #GError, or %NULL
20264  *
20265  * Tries to set all attributes in the #GFileInfo on the target values,
20266  * not stopping on the first error.
20267  *
20268  * If there is any error during this operation then @error will be set to
20269  * the first error. Error on particular fields are flagged by setting
20270  * the "status" field in the attribute value to
20271  * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can also detect
20272  * further errors.
20273  *
20274  * If @cancellable is not %NULL, then the operation can be cancelled by
20275  * triggering the cancellable object from another thread. If the operation
20276  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20277  *
20278  * Returns: %TRUE if there was any error, %FALSE otherwise.
20279  */
20280
20281
20282 /**
20283  * g_file_set_display_name:
20284  * @file: input #GFile.
20285  * @display_name: a string.
20286  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20287  * @error: a #GError, or %NULL
20288  *
20289  * Renames @file to the specified display name.
20290  *
20291  * The display name is converted from UTF8 to the correct encoding for the target
20292  * filesystem if possible and the @file is renamed to this.
20293  *
20294  * If you want to implement a rename operation in the user interface the edit name
20295  * (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename
20296  * widget, and then the result after editing should be passed to g_file_set_display_name().
20297  *
20298  * On success the resulting converted filename is returned.
20299  *
20300  * If @cancellable is not %NULL, then the operation can be cancelled by
20301  * triggering the cancellable object from another thread. If the operation
20302  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20303  *
20304  * 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().
20305  */
20306
20307
20308 /**
20309  * g_file_set_display_name_async:
20310  * @file: input #GFile.
20311  * @display_name: a string.
20312  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20313  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20314  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20315  * @user_data: (closure): the data to pass to callback function
20316  *
20317  * Asynchronously sets the display name for a given #GFile.
20318  *
20319  * For more details, see g_file_set_display_name() which is
20320  * the synchronous version of this call.
20321  *
20322  * When the operation is finished, @callback will be called. You can then call
20323  * g_file_set_display_name_finish() to get the result of the operation.
20324  */
20325
20326
20327 /**
20328  * g_file_set_display_name_finish:
20329  * @file: input #GFile.
20330  * @res: a #GAsyncResult.
20331  * @error: a #GError, or %NULL
20332  *
20333  * Finishes setting a display name started with
20334  * g_file_set_display_name_async().
20335  *
20336  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20337  */
20338
20339
20340 /**
20341  * g_file_start_mountable:
20342  * @file: input #GFile.
20343  * @flags: flags affecting the operation
20344  * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20345  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20346  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20347  * @user_data: the data to pass to callback function
20348  *
20349  * Starts a file of type G_FILE_TYPE_MOUNTABLE.
20350  * Using @start_operation, you can request callbacks when, for instance,
20351  * passwords are needed during authentication.
20352  *
20353  * If @cancellable is not %NULL, then the operation can be cancelled by
20354  * triggering the cancellable object from another thread. If the operation
20355  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20356  *
20357  * When the operation is finished, @callback will be called. You can then call
20358  * g_file_mount_mountable_finish() to get the result of the operation.
20359  *
20360  * Since: 2.22
20361  */
20362
20363
20364 /**
20365  * g_file_start_mountable_finish:
20366  * @file: input #GFile.
20367  * @result: a #GAsyncResult.
20368  * @error: a #GError, or %NULL
20369  *
20370  * Finishes a start operation. See g_file_start_mountable() for details.
20371  *
20372  * Finish an asynchronous start operation that was started
20373  * with g_file_start_mountable().
20374  *
20375  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20376  * Since: 2.22
20377  */
20378
20379
20380 /**
20381  * g_file_stop_mountable:
20382  * @file: input #GFile.
20383  * @flags: flags affecting the operation
20384  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20385  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20386  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20387  * @user_data: the data to pass to callback function
20388  *
20389  * Stops a file of type G_FILE_TYPE_MOUNTABLE.
20390  *
20391  * If @cancellable is not %NULL, then the operation can be cancelled by
20392  * triggering the cancellable object from another thread. If the operation
20393  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20394  *
20395  * When the operation is finished, @callback will be called. You can then call
20396  * g_file_stop_mountable_finish() to get the result of the operation.
20397  *
20398  * Since: 2.22
20399  */
20400
20401
20402 /**
20403  * g_file_stop_mountable_finish:
20404  * @file: input #GFile.
20405  * @result: a #GAsyncResult.
20406  * @error: a #GError, or %NULL
20407  *
20408  * Finishes an stop operation, see g_file_stop_mountable() for details.
20409  *
20410  * Finish an asynchronous stop operation that was started
20411  * with g_file_stop_mountable().
20412  *
20413  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20414  * Since: 2.22
20415  */
20416
20417
20418 /**
20419  * g_file_supports_thread_contexts:
20420  * @file: a #GFile.
20421  *
20422  * Checks if @file supports <link
20423  * linkend="g-main-context-push-thread-default-context">thread-default
20424  * contexts</link>. If this returns %FALSE, you cannot perform
20425  * asynchronous operations on @file in a thread that has a
20426  * thread-default context.
20427  *
20428  * Returns: Whether or not @file supports thread-default contexts.
20429  * Since: 2.22
20430  */
20431
20432
20433 /**
20434  * g_file_trash:
20435  * @file: #GFile to send to trash.
20436  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20437  * @error: a #GError, or %NULL
20438  *
20439  * Sends @file to the "Trashcan", if possible. This is similar to
20440  * deleting it, but the user can recover it before emptying the trashcan.
20441  * Not all file systems support trashing, so this call can return the
20442  * %G_IO_ERROR_NOT_SUPPORTED error.
20443  *
20444  *
20445  * If @cancellable is not %NULL, then the operation can be cancelled by
20446  * triggering the cancellable object from another thread. If the operation
20447  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20448  *
20449  * Returns: %TRUE on successful trash, %FALSE otherwise.
20450  */
20451
20452
20453 /**
20454  * g_file_unmount_mountable:
20455  * @file: input #GFile.
20456  * @flags: flags affecting the operation
20457  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20458  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20459  * @user_data: (closure): the data to pass to callback function
20460  *
20461  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20462  *
20463  * If @cancellable is not %NULL, then the operation can be cancelled by
20464  * triggering the cancellable object from another thread. If the operation
20465  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20466  *
20467  * When the operation is finished, @callback will be called. You can then call
20468  * g_file_unmount_mountable_finish() to get the result of the operation.
20469  *
20470  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20471  */
20472
20473
20474 /**
20475  * g_file_unmount_mountable_finish:
20476  * @file: input #GFile.
20477  * @result: a #GAsyncResult.
20478  * @error: a #GError, or %NULL
20479  *
20480  * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20481  *
20482  * Finish an asynchronous unmount operation that was started
20483  * with g_file_unmount_mountable().
20484  *
20485  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20486  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20487  */
20488
20489
20490 /**
20491  * g_file_unmount_mountable_with_operation:
20492  * @file: input #GFile.
20493  * @flags: flags affecting the operation
20494  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20495  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20496  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20497  * @user_data: (closure): the data to pass to callback function
20498  *
20499  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20500  *
20501  * If @cancellable is not %NULL, then the operation can be cancelled by
20502  * triggering the cancellable object from another thread. If the operation
20503  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20504  *
20505  * When the operation is finished, @callback will be called. You can then call
20506  * g_file_unmount_mountable_finish() to get the result of the operation.
20507  *
20508  * Since: 2.22
20509  */
20510
20511
20512 /**
20513  * g_file_unmount_mountable_with_operation_finish:
20514  * @file: input #GFile.
20515  * @result: a #GAsyncResult.
20516  * @error: a #GError, or %NULL
20517  *
20518  * Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.
20519  *
20520  * Finish an asynchronous unmount operation that was started
20521  * with g_file_unmount_mountable_with_operation().
20522  *
20523  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20524  * Since: 2.22
20525  */
20526
20527
20528 /**
20529  * g_filename_completer_get_completion_suffix:
20530  * @completer: the filename completer.
20531  * @initial_text: text to be completed.
20532  *
20533  * Obtains a completion for @initial_text from @completer.
20534  *
20535  * 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.
20536  */
20537
20538
20539 /**
20540  * g_filename_completer_get_completions:
20541  * @completer: the filename completer.
20542  * @initial_text: text to be completed.
20543  *
20544  * Gets an array of completion strings for a given initial text.
20545  *
20546  * 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.
20547  */
20548
20549
20550 /**
20551  * g_filename_completer_new:
20552  *
20553  * Creates a new filename completer.
20554  *
20555  * Returns: a #GFilenameCompleter.
20556  */
20557
20558
20559 /**
20560  * g_filename_completer_set_dirs_only:
20561  * @completer: the filename completer.
20562  * @dirs_only: a #gboolean.
20563  *
20564  * If @dirs_only is %TRUE, @completer will only
20565  * complete directory names, and not file names.
20566  */
20567
20568
20569 /**
20570  * g_filter_input_stream_get_base_stream:
20571  * @stream: a #GFilterInputStream.
20572  *
20573  * Gets the base stream for the filter stream.
20574  *
20575  * Returns: (transfer none): a #GInputStream.
20576  */
20577
20578
20579 /**
20580  * g_filter_input_stream_get_close_base_stream:
20581  * @stream: a #GFilterInputStream.
20582  *
20583  * Returns whether the base stream will be closed when @stream is
20584  * closed.
20585  *
20586  * Returns: %TRUE if the base stream will be closed.
20587  */
20588
20589
20590 /**
20591  * g_filter_input_stream_set_close_base_stream:
20592  * @stream: a #GFilterInputStream.
20593  * @close_base: %TRUE to close the base stream.
20594  *
20595  * Sets whether the base stream will be closed when @stream is closed.
20596  */
20597
20598
20599 /**
20600  * g_filter_output_stream_get_base_stream:
20601  * @stream: a #GFilterOutputStream.
20602  *
20603  * Gets the base stream for the filter stream.
20604  *
20605  * Returns: (transfer none): a #GOutputStream.
20606  */
20607
20608
20609 /**
20610  * g_filter_output_stream_get_close_base_stream:
20611  * @stream: a #GFilterOutputStream.
20612  *
20613  * Returns whether the base stream will be closed when @stream is
20614  * closed.
20615  *
20616  * Returns: %TRUE if the base stream will be closed.
20617  */
20618
20619
20620 /**
20621  * g_filter_output_stream_set_close_base_stream:
20622  * @stream: a #GFilterOutputStream.
20623  * @close_base: %TRUE to close the base stream.
20624  *
20625  * Sets whether the base stream will be closed when @stream is closed.
20626  */
20627
20628
20629 /**
20630  * g_icon_equal:
20631  * @icon1: (allow-none): pointer to the first #GIcon.
20632  * @icon2: (allow-none): pointer to the second #GIcon.
20633  *
20634  * Checks if two icons are equal.
20635  *
20636  * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20637  */
20638
20639
20640 /**
20641  * g_icon_hash:
20642  * @icon: #gconstpointer to an icon object.
20643  *
20644  * Gets a hash for an icon.
20645  *
20646  * Virtual: hash
20647  * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20648  */
20649
20650
20651 /**
20652  * g_icon_new_for_string:
20653  * @str: A string obtained via g_icon_to_string().
20654  * @error: Return location for error.
20655  *
20656  * Generate a #GIcon instance from @str. This function can fail if
20657  * @str is not valid - see g_icon_to_string() for discussion.
20658  *
20659  * If your application or library provides one or more #GIcon
20660  * implementations you need to ensure that each #GType is registered
20661  * with the type system prior to calling g_icon_new_for_string().
20662  *
20663  * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20664  * Since: 2.20
20665  */
20666
20667
20668 /**
20669  * g_icon_to_string:
20670  * @icon: a #GIcon.
20671  *
20672  * Generates a textual representation of @icon that can be used for
20673  * serialization such as when passing @icon to a different process or
20674  * saving it to persistent storage. Use g_icon_new_for_string() to
20675  * get @icon back from the returned string.
20676  *
20677  * The encoding of the returned string is proprietary to #GIcon except
20678  * in the following two cases
20679  *
20680  * <itemizedlist>
20681  * <listitem><para>
20682  *     If @icon is a #GFileIcon, the returned string is a native path
20683  *     (such as <literal>/path/to/my icon.png</literal>) without escaping
20684  *     if the #GFile for @icon is a native file.  If the file is not
20685  *     native, the returned string is the result of g_file_get_uri()
20686  *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
20687  * </para></listitem>
20688  * <listitem><para>
20689  *    If @icon is a #GThemedIcon with exactly one name, the encoding is
20690  *    simply the name (such as <literal>network-server</literal>).
20691  * </para></listitem>
20692  * </itemizedlist>
20693  *
20694  * Virtual: to_tokens
20695  * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20696  * Since: 2.20
20697  */
20698
20699
20700 /**
20701  * g_inet_address_equal:
20702  * @address: A #GInetAddress.
20703  * @other_address: Another #GInetAddress.
20704  *
20705  * Checks if two #GInetAddress instances are equal, e.g. the same address.
20706  *
20707  * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20708  * Since: 2.30
20709  */
20710
20711
20712 /**
20713  * g_inet_address_get_family:
20714  * @address: a #GInetAddress
20715  *
20716  * Gets @address's family
20717  *
20718  * Returns: @address's family
20719  * Since: 2.22
20720  */
20721
20722
20723 /**
20724  * g_inet_address_get_is_any:
20725  * @address: a #GInetAddress
20726  *
20727  * Tests whether @address is the "any" address for its family.
20728  *
20729  * Returns: %TRUE if @address is the "any" address for its family.
20730  * Since: 2.22
20731  */
20732
20733
20734 /**
20735  * g_inet_address_get_is_link_local:
20736  * @address: a #GInetAddress
20737  *
20738  * Tests whether @address is a link-local address (that is, if it
20739  * identifies a host on a local network that is not connected to the
20740  * Internet).
20741  *
20742  * Returns: %TRUE if @address is a link-local address.
20743  * Since: 2.22
20744  */
20745
20746
20747 /**
20748  * g_inet_address_get_is_loopback:
20749  * @address: a #GInetAddress
20750  *
20751  * Tests whether @address is the loopback address for its family.
20752  *
20753  * Returns: %TRUE if @address is the loopback address for its family.
20754  * Since: 2.22
20755  */
20756
20757
20758 /**
20759  * g_inet_address_get_is_mc_global:
20760  * @address: a #GInetAddress
20761  *
20762  * Tests whether @address is a global multicast address.
20763  *
20764  * Returns: %TRUE if @address is a global multicast address.
20765  * Since: 2.22
20766  */
20767
20768
20769 /**
20770  * g_inet_address_get_is_mc_link_local:
20771  * @address: a #GInetAddress
20772  *
20773  * Tests whether @address is a link-local multicast address.
20774  *
20775  * Returns: %TRUE if @address is a link-local multicast address.
20776  * Since: 2.22
20777  */
20778
20779
20780 /**
20781  * g_inet_address_get_is_mc_node_local:
20782  * @address: a #GInetAddress
20783  *
20784  * Tests whether @address is a node-local multicast address.
20785  *
20786  * Returns: %TRUE if @address is a node-local multicast address.
20787  * Since: 2.22
20788  */
20789
20790
20791 /**
20792  * g_inet_address_get_is_mc_org_local:
20793  * @address: a #GInetAddress
20794  *
20795  * Tests whether @address is an organization-local multicast address.
20796  *
20797  * Returns: %TRUE if @address is an organization-local multicast address.
20798  * Since: 2.22
20799  */
20800
20801
20802 /**
20803  * g_inet_address_get_is_mc_site_local:
20804  * @address: a #GInetAddress
20805  *
20806  * Tests whether @address is a site-local multicast address.
20807  *
20808  * Returns: %TRUE if @address is a site-local multicast address.
20809  * Since: 2.22
20810  */
20811
20812
20813 /**
20814  * g_inet_address_get_is_multicast:
20815  * @address: a #GInetAddress
20816  *
20817  * Tests whether @address is a multicast address.
20818  *
20819  * Returns: %TRUE if @address is a multicast address.
20820  * Since: 2.22
20821  */
20822
20823
20824 /**
20825  * g_inet_address_get_is_site_local:
20826  * @address: a #GInetAddress
20827  *
20828  * Tests whether @address is a site-local address such as 10.0.0.1
20829  * (that is, the address identifies a host on a local network that can
20830  * not be reached directly from the Internet, but which may have
20831  * outgoing Internet connectivity via a NAT or firewall).
20832  *
20833  * Returns: %TRUE if @address is a site-local address.
20834  * Since: 2.22
20835  */
20836
20837
20838 /**
20839  * g_inet_address_get_native_size:
20840  * @address: a #GInetAddress
20841  *
20842  * Gets the size of the native raw binary address for @address. This
20843  * is the size of the data that you get from g_inet_address_to_bytes().
20844  *
20845  * Returns: the number of bytes used for the native version of @address.
20846  * Since: 2.22
20847  */
20848
20849
20850 /**
20851  * g_inet_address_mask_equal:
20852  * @mask: a #GInetAddressMask
20853  * @mask2: another #GInetAddressMask
20854  *
20855  * Tests if @mask and @mask2 are the same mask.
20856  *
20857  * Returns: whether @mask and @mask2 are the same mask
20858  * Since: 2.32
20859  */
20860
20861
20862 /**
20863  * g_inet_address_mask_get_address:
20864  * @mask: a #GInetAddressMask
20865  *
20866  * Gets @mask's base address
20867  *
20868  * Returns: (transfer none): @mask's base address
20869  * Since: 2.32
20870  */
20871
20872
20873 /**
20874  * g_inet_address_mask_get_family:
20875  * @mask: a #GInetAddressMask
20876  *
20877  * Gets the #GSocketFamily of @mask's address
20878  *
20879  * Returns: the #GSocketFamily of @mask's address
20880  * Since: 2.32
20881  */
20882
20883
20884 /**
20885  * g_inet_address_mask_get_length:
20886  * @mask: a #GInetAddressMask
20887  *
20888  * Gets @mask's length
20889  *
20890  * Returns: @mask's length
20891  * Since: 2.32
20892  */
20893
20894
20895 /**
20896  * g_inet_address_mask_matches:
20897  * @mask: a #GInetAddressMask
20898  * @address: a #GInetAddress
20899  *
20900  * Tests if @address falls within the range described by @mask.
20901  *
20902  * Returns: whether @address falls within the range described by @mask.
20903  * Since: 2.32
20904  */
20905
20906
20907 /**
20908  * g_inet_address_mask_new:
20909  * @addr: a #GInetAddress
20910  * @length: number of bits of @addr to use
20911  * @error: return location for #GError, or %NULL
20912  *
20913  * Creates a new #GInetAddressMask representing all addresses whose
20914  * first @length bits match @addr.
20915  *
20916  * Returns: a new #GInetAddressMask, or %NULL on error
20917  * Since: 2.32
20918  */
20919
20920
20921 /**
20922  * g_inet_address_mask_new_from_string:
20923  * @mask_string: an IP address or address/length string
20924  * @error: return location for #GError, or %NULL
20925  *
20926  * Parses @mask_string as an IP address and (optional) length, and
20927  * creates a new #GInetAddressMask. The length, if present, is
20928  * delimited by a "/". If it is not present, then the length is
20929  * assumed to be the full length of the address.
20930  *
20931  * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
20932  * Since: 2.32
20933  */
20934
20935
20936 /**
20937  * g_inet_address_mask_to_string:
20938  * @mask: a #GInetAddressMask
20939  *
20940  * Converts @mask back to its corresponding string form.
20941  *
20942  * Returns: a string corresponding to @mask.
20943  * Since: 2.32
20944  */
20945
20946
20947 /**
20948  * g_inet_address_new_any:
20949  * @family: the address family
20950  *
20951  * Creates a #GInetAddress for the "any" address (unassigned/"don't
20952  * care") for @family.
20953  *
20954  * Returns: a new #GInetAddress corresponding to the "any" address for @family.
20955  * Since: 2.22
20956  */
20957
20958
20959 /**
20960  * g_inet_address_new_from_bytes:
20961  * @bytes: (array) (element-type guint8): raw address data
20962  * @family: the address family of @bytes
20963  *
20964  * Creates a new #GInetAddress from the given @family and @bytes.
20965  * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
20966  * %G_SOCKET_FAMILY_IPV6.
20967  *
20968  * Returns: a new #GInetAddress corresponding to @family and @bytes.
20969  * Since: 2.22
20970  */
20971
20972
20973 /**
20974  * g_inet_address_new_from_string:
20975  * @string: a string representation of an IP address
20976  *
20977  * Parses @string as an IP address and creates a new #GInetAddress.
20978  *
20979  * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
20980  * Since: 2.22
20981  */
20982
20983
20984 /**
20985  * g_inet_address_new_loopback:
20986  * @family: the address family
20987  *
20988  * Creates a #GInetAddress for the loopback address for @family.
20989  *
20990  * Returns: a new #GInetAddress corresponding to the loopback address for @family.
20991  * Since: 2.22
20992  */
20993
20994
20995 /**
20996  * g_inet_address_to_bytes: (skip)
20997  * @address: a #GInetAddress
20998  *
20999  * Gets the raw binary address data from @address.
21000  *
21001  * 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().
21002  * Since: 2.22
21003  */
21004
21005
21006 /**
21007  * g_inet_address_to_string:
21008  * @address: a #GInetAddress
21009  *
21010  * Converts @address to string form.
21011  *
21012  * Returns: a representation of @address as a string, which should be freed after use.
21013  * Since: 2.22
21014  */
21015
21016
21017 /**
21018  * g_inet_socket_address_get_address:
21019  * @address: a #GInetSocketAddress
21020  *
21021  * Gets @address's #GInetAddress.
21022  *
21023  * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21024  * Since: 2.22
21025  */
21026
21027
21028 /**
21029  * g_inet_socket_address_get_flowinfo:
21030  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21031  *
21032  * Gets the <literal>sin6_flowinfo</literal> field from @address,
21033  * which must be an IPv6 address.
21034  *
21035  * Returns: the flowinfo field
21036  * Since: 2.32
21037  */
21038
21039
21040 /**
21041  * g_inet_socket_address_get_port:
21042  * @address: a #GInetSocketAddress
21043  *
21044  * Gets @address's port.
21045  *
21046  * Returns: the port for @address
21047  * Since: 2.22
21048  */
21049
21050
21051 /**
21052  * g_inet_socket_address_get_scope_id:
21053  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21054  *
21055  * Gets the <literal>sin6_scope_id</literal> field from @address,
21056  * which must be an IPv6 address.
21057  *
21058  * Returns: the scope id field
21059  * Since: 2.32
21060  */
21061
21062
21063 /**
21064  * g_inet_socket_address_new:
21065  * @address: a #GInetAddress
21066  * @port: a port number
21067  *
21068  * Creates a new #GInetSocketAddress for @address and @port.
21069  *
21070  * Returns: a new #GInetSocketAddress
21071  * Since: 2.22
21072  */
21073
21074
21075 /**
21076  * g_initable_init:
21077  * @initable: a #GInitable.
21078  * @cancellable: optional #GCancellable object, %NULL to ignore.
21079  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21080  *
21081  * Initializes the object implementing the interface.
21082  *
21083  * The object must be initialized before any real use after initial
21084  * construction, either with this function or g_async_initable_init_async().
21085  *
21086  * Implementations may also support cancellation. If @cancellable is not %NULL,
21087  * then initialization can be cancelled by triggering the cancellable object
21088  * from another thread. If the operation was cancelled, the error
21089  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21090  * the object doesn't support cancellable initialization the error
21091  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21092  *
21093  * If the object is not initialized, or initialization returns with an
21094  * error, then all operations on the object except g_object_ref() and
21095  * g_object_unref() are considered to be invalid, and have undefined
21096  * behaviour. See the <xref linkend="ginitable"/> section introduction
21097  * for more details.
21098  *
21099  * Implementations of this method must be idempotent, i.e. multiple calls
21100  * to this function with the same argument should return the same results.
21101  * Only the first call initializes the object, further calls return the result
21102  * of the first call. This is so that it's safe to implement the singleton
21103  * pattern in the GObject constructor function.
21104  *
21105  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21106  * Since: 2.22
21107  */
21108
21109
21110 /**
21111  * g_initable_new:
21112  * @object_type: a #GType supporting #GInitable.
21113  * @cancellable: optional #GCancellable object, %NULL to ignore.
21114  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21115  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21116  * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21117  *
21118  * Helper function for constructing #GInitable object. This is
21119  * similar to g_object_new() but also initializes the object
21120  * and returns %NULL, setting an error on failure.
21121  *
21122  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21123  * Since: 2.22
21124  */
21125
21126
21127 /**
21128  * g_initable_new_valist:
21129  * @object_type: a #GType supporting #GInitable.
21130  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21131  * @var_args: The var args list generated from @first_property_name.
21132  * @cancellable: optional #GCancellable object, %NULL to ignore.
21133  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21134  *
21135  * Helper function for constructing #GInitable object. This is
21136  * similar to g_object_new_valist() but also initializes the object
21137  * and returns %NULL, setting an error on failure.
21138  *
21139  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21140  * Since: 2.22
21141  */
21142
21143
21144 /**
21145  * g_initable_newv:
21146  * @object_type: a #GType supporting #GInitable.
21147  * @n_parameters: the number of parameters in @parameters
21148  * @parameters: (array length=n_parameters): the parameters to use to construct the object
21149  * @cancellable: optional #GCancellable object, %NULL to ignore.
21150  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21151  *
21152  * Helper function for constructing #GInitable object. This is
21153  * similar to g_object_newv() but also initializes the object
21154  * and returns %NULL, setting an error on failure.
21155  *
21156  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21157  * Since: 2.22
21158  */
21159
21160
21161 /**
21162  * g_input_stream_clear_pending:
21163  * @stream: input stream
21164  *
21165  * Clears the pending flag on @stream.
21166  */
21167
21168
21169 /**
21170  * g_input_stream_close:
21171  * @stream: A #GInputStream.
21172  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21173  * @error: location to store the error occurring, or %NULL to ignore
21174  *
21175  * Closes the stream, releasing resources related to it.
21176  *
21177  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21178  * Closing a stream multiple times will not return an error.
21179  *
21180  * Streams will be automatically closed when the last reference
21181  * is dropped, but you might want to call this function to make sure
21182  * resources are released as early as possible.
21183  *
21184  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21185  * open after the stream is closed. See the documentation for the individual
21186  * stream for details.
21187  *
21188  * On failure the first error that happened will be reported, but the close
21189  * operation will finish as much as possible. A stream that failed to
21190  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21191  * is important to check and report the error to the user.
21192  *
21193  * If @cancellable is not %NULL, then the operation can be cancelled by
21194  * triggering the cancellable object from another thread. If the operation
21195  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21196  * Cancelling a close will still leave the stream closed, but some streams
21197  * can use a faster close that doesn't block to e.g. check errors.
21198  *
21199  * Returns: %TRUE on success, %FALSE on failure
21200  */
21201
21202
21203 /**
21204  * g_input_stream_close_async:
21205  * @stream: A #GInputStream.
21206  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21207  * @cancellable: (allow-none): optional cancellable object
21208  * @callback: (scope async): callback to call when the request is satisfied
21209  * @user_data: (closure): the data to pass to callback function
21210  *
21211  * Requests an asynchronous closes of the stream, releasing resources related to it.
21212  * When the operation is finished @callback will be called.
21213  * You can then call g_input_stream_close_finish() to get the result of the
21214  * operation.
21215  *
21216  * For behaviour details see g_input_stream_close().
21217  *
21218  * The asyncronous methods have a default fallback that uses threads to implement
21219  * asynchronicity, so they are optional for inheriting classes. However, if you
21220  * override one you must override all.
21221  */
21222
21223
21224 /**
21225  * g_input_stream_close_finish:
21226  * @stream: a #GInputStream.
21227  * @result: a #GAsyncResult.
21228  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21229  *
21230  * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21231  *
21232  * Returns: %TRUE if the stream was closed successfully.
21233  */
21234
21235
21236 /**
21237  * g_input_stream_has_pending:
21238  * @stream: input stream.
21239  *
21240  * Checks if an input stream has pending actions.
21241  *
21242  * Returns: %TRUE if @stream has pending actions.
21243  */
21244
21245
21246 /**
21247  * g_input_stream_is_closed:
21248  * @stream: input stream.
21249  *
21250  * Checks if an input stream is closed.
21251  *
21252  * Returns: %TRUE if the stream is closed.
21253  */
21254
21255
21256 /**
21257  * g_input_stream_read:
21258  * @stream: a #GInputStream.
21259  * @buffer: a buffer to read data into (which should be at least count bytes long).
21260  * @count: the number of bytes that will be read from the stream
21261  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21262  * @error: location to store the error occurring, or %NULL to ignore
21263  *
21264  * Tries to read @count bytes from the stream into the buffer starting at
21265  * @buffer. Will block during this read.
21266  *
21267  * If count is zero returns zero and does nothing. A value of @count
21268  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21269  *
21270  * On success, the number of bytes read into the buffer is returned.
21271  * It is not an error if this is not the same as the requested size, as it
21272  * can happen e.g. near the end of a file. Zero is returned on end of file
21273  * (or if @count is zero),  but never otherwise.
21274  *
21275  * If @cancellable is not %NULL, then the operation can be cancelled by
21276  * triggering the cancellable object from another thread. If the operation
21277  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21278  * operation was partially finished when the operation was cancelled the
21279  * partial result will be returned, without an error.
21280  *
21281  * On error -1 is returned and @error is set accordingly.
21282  *
21283  * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21284  */
21285
21286
21287 /**
21288  * g_input_stream_read_all:
21289  * @stream: a #GInputStream.
21290  * @buffer: a buffer to read data into (which should be at least count bytes long).
21291  * @count: the number of bytes that will be read from the stream
21292  * @bytes_read: (out): location to store the number of bytes that was read from the stream
21293  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21294  * @error: location to store the error occurring, or %NULL to ignore
21295  *
21296  * Tries to read @count bytes from the stream into the buffer starting at
21297  * @buffer. Will block during this read.
21298  *
21299  * This function is similar to g_input_stream_read(), except it tries to
21300  * read as many bytes as requested, only stopping on an error or end of stream.
21301  *
21302  * On a successful read of @count bytes, or if we reached the end of the
21303  * stream,  %TRUE is returned, and @bytes_read is set to the number of bytes
21304  * read into @buffer.
21305  *
21306  * If there is an error during the operation %FALSE is returned and @error
21307  * is set to indicate the error status, @bytes_read is updated to contain
21308  * the number of bytes read into @buffer before the error occurred.
21309  *
21310  * Returns: %TRUE on success, %FALSE if there was an error
21311  */
21312
21313
21314 /**
21315  * g_input_stream_read_async:
21316  * @stream: A #GInputStream.
21317  * @buffer: a buffer to read data into (which should be at least count bytes long).
21318  * @count: the number of bytes that will be read from the stream
21319  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21320  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21321  * @callback: (scope async): callback to call when the request is satisfied
21322  * @user_data: (closure): the data to pass to callback function
21323  *
21324  * Request an asynchronous read of @count bytes from the stream into the buffer
21325  * starting at @buffer. When the operation is finished @callback will be called.
21326  * You can then call g_input_stream_read_finish() to get the result of the
21327  * operation.
21328  *
21329  * During an async request no other sync and async calls are allowed on @stream, and will
21330  * result in %G_IO_ERROR_PENDING errors.
21331  *
21332  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21333  *
21334  * On success, the number of bytes read into the buffer will be passed to the
21335  * callback. It is not an error if this is not the same as the requested size, as it
21336  * can happen e.g. near the end of a file, but generally we try to read
21337  * as many bytes as requested. Zero is returned on end of file
21338  * (or if @count is zero),  but never otherwise.
21339  *
21340  * Any outstanding i/o request with higher priority (lower numerical value) will
21341  * be executed before an outstanding request with lower priority. Default
21342  * priority is %G_PRIORITY_DEFAULT.
21343  *
21344  * The asyncronous methods have a default fallback that uses threads to implement
21345  * asynchronicity, so they are optional for inheriting classes. However, if you
21346  * override one you must override all.
21347  */
21348
21349
21350 /**
21351  * g_input_stream_read_bytes:
21352  * @stream: a #GInputStream.
21353  * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21354  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21355  * @error: location to store the error occurring, or %NULL to ignore
21356  *
21357  * Like g_input_stream_read(), this tries to read @count bytes from
21358  * the stream in a blocking fashion. However, rather than reading into
21359  * a user-supplied buffer, this will create a new #GBytes containing
21360  * the data that was read. This may be easier to use from language
21361  * bindings.
21362  *
21363  * If count is zero, returns a zero-length #GBytes and does nothing. A
21364  * value of @count larger than %G_MAXSSIZE will cause a
21365  * %G_IO_ERROR_INVALID_ARGUMENT error.
21366  *
21367  * On success, a new #GBytes is returned. It is not an error if the
21368  * size of this object is not the same as the requested size, as it
21369  * can happen e.g. near the end of a file. A zero-length #GBytes is
21370  * returned on end of file (or if @count is zero), but never
21371  * otherwise.
21372  *
21373  * If @cancellable is not %NULL, then the operation can be cancelled by
21374  * triggering the cancellable object from another thread. If the operation
21375  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21376  * operation was partially finished when the operation was cancelled the
21377  * partial result will be returned, without an error.
21378  *
21379  * On error %NULL is returned and @error is set accordingly.
21380  *
21381  * Returns: a new #GBytes, or %NULL on error
21382  */
21383
21384
21385 /**
21386  * g_input_stream_read_bytes_async:
21387  * @stream: A #GInputStream.
21388  * @count: the number of bytes that will be read from the stream
21389  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21390  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21391  * @callback: (scope async): callback to call when the request is satisfied
21392  * @user_data: (closure): the data to pass to callback function
21393  *
21394  * Request an asynchronous read of @count bytes from the stream into a
21395  * new #GBytes. When the operation is finished @callback will be
21396  * called. You can then call g_input_stream_read_bytes_finish() to get the
21397  * result of the operation.
21398  *
21399  * During an async request no other sync and async calls are allowed
21400  * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21401  *
21402  * A value of @count larger than %G_MAXSSIZE will cause a
21403  * %G_IO_ERROR_INVALID_ARGUMENT error.
21404  *
21405  * On success, the new #GBytes will be passed to the callback. It is
21406  * not an error if this is smaller than the requested size, as it can
21407  * happen e.g. near the end of a file, but generally we try to read as
21408  * many bytes as requested. Zero is returned on end of file (or if
21409  * @count is zero), but never otherwise.
21410  *
21411  * Any outstanding I/O request with higher priority (lower numerical
21412  * value) will be executed before an outstanding request with lower
21413  * priority. Default priority is %G_PRIORITY_DEFAULT.
21414  */
21415
21416
21417 /**
21418  * g_input_stream_read_bytes_finish:
21419  * @stream: a #GInputStream.
21420  * @result: a #GAsyncResult.
21421  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21422  *
21423  * Finishes an asynchronous stream read-into-#GBytes operation.
21424  *
21425  * Returns: the newly-allocated #GBytes, or %NULL on error
21426  */
21427
21428
21429 /**
21430  * g_input_stream_read_finish:
21431  * @stream: a #GInputStream.
21432  * @result: a #GAsyncResult.
21433  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21434  *
21435  * Finishes an asynchronous stream read operation.
21436  *
21437  * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21438  */
21439
21440
21441 /**
21442  * g_input_stream_set_pending:
21443  * @stream: input stream
21444  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21445  *
21446  * Sets @stream to have actions pending. If the pending flag is
21447  * already set or @stream is closed, it will return %FALSE and set
21448  * @error.
21449  *
21450  * Returns: %TRUE if pending was previously unset and is now set.
21451  */
21452
21453
21454 /**
21455  * g_input_stream_skip:
21456  * @stream: a #GInputStream.
21457  * @count: the number of bytes that will be skipped from the stream
21458  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21459  * @error: location to store the error occurring, or %NULL to ignore
21460  *
21461  * Tries to skip @count bytes from the stream. Will block during the operation.
21462  *
21463  * This is identical to g_input_stream_read(), from a behaviour standpoint,
21464  * but the bytes that are skipped are not returned to the user. Some
21465  * streams have an implementation that is more efficient than reading the data.
21466  *
21467  * This function is optional for inherited classes, as the default implementation
21468  * emulates it using read.
21469  *
21470  * If @cancellable is not %NULL, then the operation can be cancelled by
21471  * triggering the cancellable object from another thread. If the operation
21472  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21473  * operation was partially finished when the operation was cancelled the
21474  * partial result will be returned, without an error.
21475  *
21476  * Returns: Number of bytes skipped, or -1 on error
21477  */
21478
21479
21480 /**
21481  * g_input_stream_skip_async:
21482  * @stream: A #GInputStream.
21483  * @count: the number of bytes that will be skipped from the stream
21484  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21485  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21486  * @callback: (scope async): callback to call when the request is satisfied
21487  * @user_data: (closure): the data to pass to callback function
21488  *
21489  * Request an asynchronous skip of @count bytes from the stream.
21490  * When the operation is finished @callback will be called.
21491  * You can then call g_input_stream_skip_finish() to get the result
21492  * of the operation.
21493  *
21494  * During an async request no other sync and async calls are allowed,
21495  * and will result in %G_IO_ERROR_PENDING errors.
21496  *
21497  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21498  *
21499  * On success, the number of bytes skipped will be passed to the callback.
21500  * It is not an error if this is not the same as the requested size, as it
21501  * can happen e.g. near the end of a file, but generally we try to skip
21502  * as many bytes as requested. Zero is returned on end of file
21503  * (or if @count is zero), but never otherwise.
21504  *
21505  * Any outstanding i/o request with higher priority (lower numerical value)
21506  * will be executed before an outstanding request with lower priority.
21507  * Default priority is %G_PRIORITY_DEFAULT.
21508  *
21509  * The asynchronous methods have a default fallback that uses threads to
21510  * implement asynchronicity, so they are optional for inheriting classes.
21511  * However, if you override one, you must override all.
21512  */
21513
21514
21515 /**
21516  * g_input_stream_skip_finish:
21517  * @stream: a #GInputStream.
21518  * @result: a #GAsyncResult.
21519  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21520  *
21521  * Finishes a stream skip operation.
21522  *
21523  * Returns: the size of the bytes skipped, or %-1 on error.
21524  */
21525
21526
21527 /**
21528  * g_io_error_from_errno:
21529  * @err_no: Error number as defined in errno.h.
21530  *
21531  * Converts errno.h error codes into GIO error codes.
21532  *
21533  * Returns: #GIOErrorEnum value for the given errno.h error number.
21534  */
21535
21536
21537 /**
21538  * g_io_error_from_win32_error:
21539  * @error_code: Windows error number.
21540  *
21541  * Converts some common error codes into GIO error codes. The
21542  * fallback value G_IO_ERROR_FAILED is returned for error codes not
21543  * handled.
21544  *
21545  * Returns: #GIOErrorEnum value for the given error number.
21546  * Since: 2.26
21547  */
21548
21549
21550 /**
21551  * g_io_error_quark:
21552  *
21553  * Gets the GIO Error Quark.
21554  *
21555  * Returns: a #GQuark.
21556  */
21557
21558
21559 /**
21560  * g_io_extension_get_name:
21561  * @extension: a #GIOExtension
21562  *
21563  * Gets the name under which @extension was registered.
21564  *
21565  * Note that the same type may be registered as extension
21566  * for multiple extension points, under different names.
21567  *
21568  * Returns: the name of @extension.
21569  */
21570
21571
21572 /**
21573  * g_io_extension_get_priority:
21574  * @extension: a #GIOExtension
21575  *
21576  * Gets the priority with which @extension was registered.
21577  *
21578  * Returns: the priority of @extension
21579  */
21580
21581
21582 /**
21583  * g_io_extension_get_type:
21584  * @extension: a #GIOExtension
21585  *
21586  * Gets the type associated with @extension.
21587  *
21588  * Returns: the type of @extension
21589  */
21590
21591
21592 /**
21593  * g_io_extension_point_get_extension_by_name:
21594  * @extension_point: a #GIOExtensionPoint
21595  * @name: the name of the extension to get
21596  *
21597  * Finds a #GIOExtension for an extension point by name.
21598  *
21599  * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21600  */
21601
21602
21603 /**
21604  * g_io_extension_point_get_extensions:
21605  * @extension_point: a #GIOExtensionPoint
21606  *
21607  * Gets a list of all extensions that implement this extension point.
21608  * The list is sorted by priority, beginning with the highest priority.
21609  *
21610  * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21611  */
21612
21613
21614 /**
21615  * g_io_extension_point_get_required_type:
21616  * @extension_point: a #GIOExtensionPoint
21617  *
21618  * Gets the required type for @extension_point.
21619  *
21620  * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21621  */
21622
21623
21624 /**
21625  * g_io_extension_point_implement:
21626  * @extension_point_name: the name of the extension point
21627  * @type: the #GType to register as extension
21628  * @extension_name: the name for the extension
21629  * @priority: the priority for the extension
21630  *
21631  * Registers @type as extension for the extension point with name
21632  * @extension_point_name.
21633  *
21634  * If @type has already been registered as an extension for this
21635  * extension point, the existing #GIOExtension object is returned.
21636  *
21637  * Returns: (transfer none): a #GIOExtension object for #GType
21638  */
21639
21640
21641 /**
21642  * g_io_extension_point_lookup:
21643  * @name: the name of the extension point
21644  *
21645  * Looks up an existing extension point.
21646  *
21647  * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21648  */
21649
21650
21651 /**
21652  * g_io_extension_point_register:
21653  * @name: The name of the extension point
21654  *
21655  * Registers an extension point.
21656  *
21657  * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21658  */
21659
21660
21661 /**
21662  * g_io_extension_point_set_required_type:
21663  * @extension_point: a #GIOExtensionPoint
21664  * @type: the #GType to require
21665  *
21666  * Sets the required type for @extension_point to @type.
21667  * All implementations must henceforth have this type.
21668  */
21669
21670
21671 /**
21672  * g_io_extension_ref_class:
21673  * @extension: a #GIOExtension
21674  *
21675  * Gets a reference to the class for the type that is
21676  * associated with @extension.
21677  *
21678  * Returns: (transfer full): the #GTypeClass for the type of @extension
21679  */
21680
21681
21682 /**
21683  * g_io_module_new:
21684  * @filename: filename of the shared library module.
21685  *
21686  * Creates a new GIOModule that will load the specific
21687  * shared library when in use.
21688  *
21689  * Returns: a #GIOModule from given @filename, or %NULL on error.
21690  */
21691
21692
21693 /**
21694  * g_io_module_scope_block:
21695  * @scope: a module loading scope
21696  * @basename: the basename to block
21697  *
21698  * Block modules with the given @basename from being loaded when
21699  * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21700  * or g_io_modules_load_all_in_directory_with_scope().
21701  *
21702  * Since: 2.30
21703  */
21704
21705
21706 /**
21707  * g_io_module_scope_free:
21708  * @scope: a module loading scope
21709  *
21710  * Free a module scope.
21711  *
21712  * Since: 2.30
21713  */
21714
21715
21716 /**
21717  * g_io_module_scope_new:
21718  * @flags: flags for the new scope
21719  *
21720  * Create a new scope for loading of IO modules. A scope can be used for
21721  * blocking duplicate modules, or blocking a module you don't want to load.
21722  *
21723  * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21724  * which have the same base name as a module that has already been seen
21725  * in this scope.
21726  *
21727  * Returns: (transfer full): the new module scope
21728  * Since: 2.30
21729  */
21730
21731
21732 /**
21733  * g_io_modules_load_all_in_directory:
21734  * @dirname: pathname for a directory containing modules to load.
21735  *
21736  * Loads all the modules in the specified directory.
21737  *
21738  * If don't require all modules to be initialized (and thus registering
21739  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21740  * which allows delayed/lazy loading of modules.
21741  *
21742  * 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().
21743  */
21744
21745
21746 /**
21747  * g_io_modules_load_all_in_directory_with_scope:
21748  * @dirname: pathname for a directory containing modules to load.
21749  * @scope: a scope to use when scanning the modules.
21750  *
21751  * Loads all the modules in the specified directory.
21752  *
21753  * If don't require all modules to be initialized (and thus registering
21754  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21755  * which allows delayed/lazy loading of modules.
21756  *
21757  * 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().
21758  * Since: 2.30
21759  */
21760
21761
21762 /**
21763  * g_io_modules_scan_all_in_directory:
21764  * @dirname: pathname for a directory containing modules to scan.
21765  *
21766  * Scans all the modules in the specified directory, ensuring that
21767  * any extension point implemented by a module is registered.
21768  *
21769  * This may not actually load and initialize all the types in each
21770  * module, some modules may be lazily loaded and initialized when
21771  * an extension point it implementes is used with e.g.
21772  * g_io_extension_point_get_extensions() or
21773  * g_io_extension_point_get_extension_by_name().
21774  *
21775  * If you need to guarantee that all types are loaded in all the modules,
21776  * use g_io_modules_load_all_in_directory().
21777  *
21778  * Since: 2.24
21779  */
21780
21781
21782 /**
21783  * g_io_modules_scan_all_in_directory_with_scope:
21784  * @dirname: pathname for a directory containing modules to scan.
21785  * @scope: a scope to use when scanning the modules
21786  *
21787  * Scans all the modules in the specified directory, ensuring that
21788  * any extension point implemented by a module is registered.
21789  *
21790  * This may not actually load and initialize all the types in each
21791  * module, some modules may be lazily loaded and initialized when
21792  * an extension point it implementes is used with e.g.
21793  * g_io_extension_point_get_extensions() or
21794  * g_io_extension_point_get_extension_by_name().
21795  *
21796  * If you need to guarantee that all types are loaded in all the modules,
21797  * use g_io_modules_load_all_in_directory().
21798  *
21799  * Since: 2.30
21800  */
21801
21802
21803 /**
21804  * g_io_scheduler_cancel_all_jobs:
21805  *
21806  * Cancels all cancellable I/O jobs.
21807  *
21808  * A job is cancellable if a #GCancellable was passed into
21809  * g_io_scheduler_push_job().
21810  */
21811
21812
21813 /**
21814  * g_io_scheduler_job_send_to_mainloop:
21815  * @job: a #GIOSchedulerJob
21816  * @func: a #GSourceFunc callback that will be called in the original thread
21817  * @user_data: data to pass to @func
21818  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21819  *
21820  * Used from an I/O job to send a callback to be run in the thread
21821  * that the job was started from, waiting for the result (and thus
21822  * blocking the I/O job).
21823  *
21824  * Returns: The return value of @func
21825  */
21826
21827
21828 /**
21829  * g_io_scheduler_job_send_to_mainloop_async:
21830  * @job: a #GIOSchedulerJob
21831  * @func: a #GSourceFunc callback that will be called in the original thread
21832  * @user_data: data to pass to @func
21833  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21834  *
21835  * Used from an I/O job to send a callback to be run asynchronously in
21836  * the thread that the job was started from. The callback will be run
21837  * when the main loop is available, but at that time the I/O job might
21838  * have finished. The return value from the callback is ignored.
21839  *
21840  * Note that if you are passing the @user_data from g_io_scheduler_push_job()
21841  * on to this function you have to ensure that it is not freed before
21842  * @func is called, either by passing %NULL as @notify to
21843  * g_io_scheduler_push_job() or by using refcounting for @user_data.
21844  */
21845
21846
21847 /**
21848  * g_io_scheduler_push_job:
21849  * @job_func: a #GIOSchedulerJobFunc.
21850  * @user_data: data to pass to @job_func
21851  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21852  * @io_priority: the <link linkend="gioscheduler">I/O priority</link> of the request.
21853  * @cancellable: optional #GCancellable object, %NULL to ignore.
21854  *
21855  * Schedules the I/O job to run in another thread.
21856  *
21857  * @notify will be called on @user_data after @job_func has returned,
21858  * regardless whether the job was cancelled or has run to completion.
21859  *
21860  * If @cancellable is not %NULL, it can be used to cancel the I/O job
21861  * by calling g_cancellable_cancel() or by calling
21862  * g_io_scheduler_cancel_all_jobs().
21863  */
21864
21865
21866 /**
21867  * g_io_stream_clear_pending:
21868  * @stream: a #GIOStream
21869  *
21870  * Clears the pending flag on @stream.
21871  *
21872  * Since: 2.22
21873  */
21874
21875
21876 /**
21877  * g_io_stream_close:
21878  * @stream: a #GIOStream
21879  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21880  * @error: location to store the error occurring, or %NULL to ignore
21881  *
21882  * Closes the stream, releasing resources related to it. This will also
21883  * closes the individual input and output streams, if they are not already
21884  * closed.
21885  *
21886  * Once the stream is closed, all other operations will return
21887  * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
21888  * return an error.
21889  *
21890  * Closing a stream will automatically flush any outstanding buffers
21891  * in the stream.
21892  *
21893  * Streams will be automatically closed when the last reference
21894  * is dropped, but you might want to call this function to make sure
21895  * resources are released as early as possible.
21896  *
21897  * Some streams might keep the backing store of the stream (e.g. a file
21898  * descriptor) open after the stream is closed. See the documentation for
21899  * the individual stream for details.
21900  *
21901  * On failure the first error that happened will be reported, but the
21902  * close operation will finish as much as possible. A stream that failed
21903  * to close will still return %G_IO_ERROR_CLOSED for all operations.
21904  * Still, it is important to check and report the error to the user,
21905  * otherwise there might be a loss of data as all data might not be written.
21906  *
21907  * If @cancellable is not NULL, then the operation can be cancelled by
21908  * triggering the cancellable object from another thread. If the operation
21909  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21910  * Cancelling a close will still leave the stream closed, but some streams
21911  * can use a faster close that doesn't block to e.g. check errors.
21912  *
21913  * The default implementation of this method just calls close on the
21914  * individual input/output streams.
21915  *
21916  * Returns: %TRUE on success, %FALSE on failure
21917  * Since: 2.22
21918  */
21919
21920
21921 /**
21922  * g_io_stream_close_async:
21923  * @stream: a #GIOStream
21924  * @io_priority: the io priority of the request
21925  * @cancellable: (allow-none): optional cancellable object
21926  * @callback: (scope async): callback to call when the request is satisfied
21927  * @user_data: (closure): the data to pass to callback function
21928  *
21929  * Requests an asynchronous close of the stream, releasing resources
21930  * related to it. When the operation is finished @callback will be
21931  * called. You can then call g_io_stream_close_finish() to get
21932  * the result of the operation.
21933  *
21934  * For behaviour details see g_io_stream_close().
21935  *
21936  * The asynchronous methods have a default fallback that uses threads
21937  * to implement asynchronicity, so they are optional for inheriting
21938  * classes. However, if you override one you must override all.
21939  *
21940  * Since: 2.22
21941  */
21942
21943
21944 /**
21945  * g_io_stream_close_finish:
21946  * @stream: a #GIOStream
21947  * @result: a #GAsyncResult
21948  * @error: a #GError location to store the error occurring, or %NULL to ignore
21949  *
21950  * Closes a stream.
21951  *
21952  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
21953  * Since: 2.22
21954  */
21955
21956
21957 /**
21958  * g_io_stream_get_input_stream:
21959  * @stream: a #GIOStream
21960  *
21961  * Gets the input stream for this object. This is used
21962  * for reading.
21963  *
21964  * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
21965  * Since: 2.22
21966  */
21967
21968
21969 /**
21970  * g_io_stream_get_output_stream:
21971  * @stream: a #GIOStream
21972  *
21973  * Gets the output stream for this object. This is used for
21974  * writing.
21975  *
21976  * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
21977  * Since: 2.22
21978  */
21979
21980
21981 /**
21982  * g_io_stream_has_pending:
21983  * @stream: a #GIOStream
21984  *
21985  * Checks if a stream has pending actions.
21986  *
21987  * Returns: %TRUE if @stream has pending actions.
21988  * Since: 2.22
21989  */
21990
21991
21992 /**
21993  * g_io_stream_is_closed:
21994  * @stream: a #GIOStream
21995  *
21996  * Checks if a stream is closed.
21997  *
21998  * Returns: %TRUE if the stream is closed.
21999  * Since: 2.22
22000  */
22001
22002
22003 /**
22004  * g_io_stream_set_pending:
22005  * @stream: a #GIOStream
22006  * @error: a #GError location to store the error occurring, or %NULL to ignore
22007  *
22008  * Sets @stream to have actions pending. If the pending flag is
22009  * already set or @stream is closed, it will return %FALSE and set
22010  * @error.
22011  *
22012  * Returns: %TRUE if pending was previously unset and is now set.
22013  * Since: 2.22
22014  */
22015
22016
22017 /**
22018  * g_io_stream_splice_async:
22019  * @stream1: a #GIOStream.
22020  * @stream2: a #GIOStream.
22021  * @flags: a set of #GIOStreamSpliceFlags.
22022  * @io_priority: the io priority of the request.
22023  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22024  * @callback: (scope async): a #GAsyncReadyCallback.
22025  * @user_data: (closure): user data passed to @callback.
22026  *
22027  * Asyncronously splice the output stream of @stream1 to the input stream of
22028  * @stream2, and splice the output stream of @stream2 to the input stream of
22029  * @stream1.
22030  *
22031  * When the operation is finished @callback will be called.
22032  * You can then call g_io_stream_splice_finish() to get the
22033  * result of the operation.
22034  *
22035  * Since: 2.28
22036  */
22037
22038
22039 /**
22040  * g_io_stream_splice_finish:
22041  * @result: a #GAsyncResult.
22042  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22043  *
22044  * Finishes an asynchronous io stream splice operation.
22045  *
22046  * Returns: %TRUE on success, %FALSE otherwise.
22047  * Since: 2.28
22048  */
22049
22050
22051 /**
22052  * g_keyfile_settings_backend_new:
22053  * @filename: the filename of the keyfile
22054  * @root_path: the path under which all settings keys appear
22055  * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22056  *
22057  * Creates a keyfile-backed #GSettingsBackend.
22058  *
22059  * The filename of the keyfile to use is given by @filename.
22060  *
22061  * All settings read to or written from the backend must fall under the
22062  * path given in @root_path (which must start and end with a slash and
22063  * not contain two consecutive slashes).  @root_path may be "/".
22064  *
22065  * If @root_group is non-%NULL then it specifies the name of the keyfile
22066  * group used for keys that are written directly below @root_path.  For
22067  * example, if @root_path is "/apps/example/" and @root_group is
22068  * "toplevel", then settings the key "/apps/example/enabled" to a value
22069  * of %TRUE will cause the following to appear in the keyfile:
22070  *
22071  * |[
22072  *   [toplevel]
22073  *   enabled=true
22074  * ]|
22075  *
22076  * If @root_group is %NULL then it is not permitted to store keys
22077  * directly below the @root_path.
22078  *
22079  * For keys not stored directly below @root_path (ie: in a sub-path),
22080  * the name of the subpath (with the final slash stripped) is used as
22081  * the name of the keyfile group.  To continue the example, if
22082  * "/apps/example/profiles/default/font-size" were set to
22083  * 12 then the following would appear in the keyfile:
22084  *
22085  * |[
22086  *   [profiles/default]
22087  *   font-size=12
22088  * ]|
22089  *
22090  * The backend will refuse writes (and return writability as being
22091  * %FALSE) for keys outside of @root_path and, in the event that
22092  * @root_group is %NULL, also for keys directly under @root_path.
22093  * Writes will also be refused if the backend detects that it has the
22094  * inability to rewrite the keyfile (ie: the containing directory is not
22095  * writable).
22096  *
22097  * There is no checking done for your key namespace clashing with the
22098  * syntax of the key file format.  For example, if you have '[' or ']'
22099  * characters in your path names or '=' in your key names you may be in
22100  * trouble.
22101  *
22102  * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22103  */
22104
22105
22106 /**
22107  * g_loadable_icon_load:
22108  * @icon: a #GLoadableIcon.
22109  * @size: an integer.
22110  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22111  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22112  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22113  *
22114  * Loads a loadable icon. For the asynchronous version of this function,
22115  * see g_loadable_icon_load_async().
22116  *
22117  * Returns: (transfer full): a #GInputStream to read the icon from.
22118  */
22119
22120
22121 /**
22122  * g_loadable_icon_load_async:
22123  * @icon: a #GLoadableIcon.
22124  * @size: an integer.
22125  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22126  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22127  * @user_data: (closure): the data to pass to callback function
22128  *
22129  * Loads an icon asynchronously. To finish this function, see
22130  * g_loadable_icon_load_finish(). For the synchronous, blocking
22131  * version of this function, see g_loadable_icon_load().
22132  */
22133
22134
22135 /**
22136  * g_loadable_icon_load_finish:
22137  * @icon: a #GLoadableIcon.
22138  * @res: a #GAsyncResult.
22139  * @type: a location to store the type of the loaded icon, %NULL to ignore.
22140  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22141  *
22142  * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22143  *
22144  * Returns: (transfer full): a #GInputStream to read the icon from.
22145  */
22146
22147
22148 /**
22149  * g_local_vfs_new:
22150  *
22151  * Returns a new #GVfs handle for a local vfs.
22152  *
22153  * Returns: a new #GVfs handle.
22154  */
22155
22156
22157 /**
22158  * g_memory_input_stream_add_bytes:
22159  * @stream: a #GMemoryInputStream
22160  * @bytes: input data
22161  *
22162  * Appends @bytes to data that can be read from the input stream.
22163  *
22164  * Since: 2.34
22165  */
22166
22167
22168 /**
22169  * g_memory_input_stream_add_data:
22170  * @stream: a #GMemoryInputStream
22171  * @data: (array length=len) (element-type guint8) (transfer full): input data
22172  * @len: length of the data, may be -1 if @data is a nul-terminated string
22173  * @destroy: (allow-none): function that is called to free @data, or %NULL
22174  *
22175  * Appends @data to data that can be read from the input stream
22176  */
22177
22178
22179 /**
22180  * g_memory_input_stream_new:
22181  *
22182  * Creates a new empty #GMemoryInputStream.
22183  *
22184  * Returns: a new #GInputStream
22185  */
22186
22187
22188 /**
22189  * g_memory_input_stream_new_from_bytes:
22190  * @bytes: a #GBytes
22191  *
22192  * Creates a new #GMemoryInputStream with data from the given @bytes.
22193  *
22194  * Returns: new #GInputStream read from @bytes
22195  * Since: 2.34
22196  */
22197
22198
22199 /**
22200  * g_memory_input_stream_new_from_data:
22201  * @data: (array length=len) (element-type guint8) (transfer full): input data
22202  * @len: length of the data, may be -1 if @data is a nul-terminated string
22203  * @destroy: (allow-none): function that is called to free @data, or %NULL
22204  *
22205  * Creates a new #GMemoryInputStream with data in memory of a given size.
22206  *
22207  * Returns: new #GInputStream read from @data of @len bytes.
22208  */
22209
22210
22211 /**
22212  * g_memory_output_stream_get_data:
22213  * @ostream: a #GMemoryOutputStream
22214  *
22215  * Gets any loaded data from the @ostream.
22216  *
22217  * Note that the returned pointer may become invalid on the next
22218  * write or truncate operation on the stream.
22219  *
22220  * Returns: (transfer none): pointer to the stream's data
22221  */
22222
22223
22224 /**
22225  * g_memory_output_stream_get_data_size:
22226  * @ostream: a #GMemoryOutputStream
22227  *
22228  * Returns the number of bytes from the start up
22229  * to including the last byte written in the stream
22230  * that has not been truncated away.
22231  *
22232  * Returns: the number of bytes written to the stream
22233  * Since: 2.18
22234  */
22235
22236
22237 /**
22238  * g_memory_output_stream_get_size:
22239  * @ostream: a #GMemoryOutputStream
22240  *
22241  * Gets the size of the currently allocated data area (available from
22242  * g_memory_output_stream_get_data()). If the stream isn't
22243  * growable (no realloc was passed to g_memory_output_stream_new()) then
22244  * this is the maximum size of the stream and further writes
22245  * will return %G_IO_ERROR_NO_SPACE.
22246  *
22247  * Note that for growable streams the returned size may become invalid on
22248  * the next write or truncate operation on the stream.
22249  *
22250  * If you want the number of bytes currently written to the stream, use
22251  * g_memory_output_stream_get_data_size().
22252  *
22253  * Returns: the number of bytes allocated for the data buffer
22254  */
22255
22256
22257 /**
22258  * g_memory_output_stream_new: (skip)
22259  * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22260  * @size: the size of @data
22261  * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22262  * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22263  *
22264  * Creates a new #GMemoryOutputStream.
22265  *
22266  * If @data is non-%NULL, the stream  will use that for its internal storage.
22267  * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22268  * storage when necessary. To construct a fixed-size output stream,
22269  * pass %NULL as @realloc_fn.
22270  *
22271  * |[
22272  * /&ast; a stream that can grow &ast;/
22273  * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22274  *
22275  * /&ast; another stream that can grow &ast;/
22276  * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22277  *
22278  * /&ast; a fixed-size stream &ast;/
22279  * data = malloc (200);
22280  * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22281  * ]|
22282  *
22283  * Returns: A newly created #GMemoryOutputStream object.
22284  */
22285
22286
22287 /**
22288  * g_memory_output_stream_steal_as_bytes:
22289  * @ostream: a #GMemoryOutputStream
22290  *
22291  * Returns data from the @ostream as a #GBytes. @ostream must be
22292  * closed before calling this function.
22293  *
22294  * Returns: (transfer full): the stream's data
22295  * Since: 2.34
22296  */
22297
22298
22299 /**
22300  * g_memory_output_stream_steal_data:
22301  * @ostream: a #GMemoryOutputStream
22302  *
22303  * Gets any loaded data from the @ostream. Ownership of the data
22304  * is transferred to the caller; when no longer needed it must be
22305  * freed using the free function set in @ostream's
22306  * #GMemoryOutputStream:destroy-function property.
22307  *
22308  * @ostream must be closed before calling this function.
22309  *
22310  * Returns: (transfer full): the stream's data
22311  * Since: 2.26
22312  */
22313
22314
22315 /**
22316  * g_memory_settings_backend_new:
22317  *
22318  * Creates a memory-backed #GSettingsBackend.
22319  *
22320  * This backend allows changes to settings, but does not write them
22321  * to any backing storage, so the next time you run your application,
22322  * the memory backend will start out with the default values again.
22323  *
22324  * Returns: (transfer full): a newly created #GSettingsBackend
22325  * Since: 2.28
22326  */
22327
22328
22329 /**
22330  * g_menu_append:
22331  * @menu: a #GMenu
22332  * @label: (allow-none): the section label, or %NULL
22333  * @detailed_action: (allow-none): the detailed action string, or %NULL
22334  *
22335  * Convenience function for appending a normal menu item to the end of
22336  * @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
22337  * flexible alternative.
22338  *
22339  * Since: 2.32
22340  */
22341
22342
22343 /**
22344  * g_menu_append_item:
22345  * @menu: a #GMenu
22346  * @item: a #GMenuItem to append
22347  *
22348  * Appends @item to the end of @menu.
22349  *
22350  * See g_menu_insert_item() for more information.
22351  *
22352  * Since: 2.32
22353  */
22354
22355
22356 /**
22357  * g_menu_append_section:
22358  * @menu: a #GMenu
22359  * @label: (allow-none): the section label, or %NULL
22360  * @section: a #GMenuModel with the items of the section
22361  *
22362  * Convenience function for appending a section menu item to the end of
22363  * @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for a
22364  * more flexible alternative.
22365  *
22366  * Since: 2.32
22367  */
22368
22369
22370 /**
22371  * g_menu_append_submenu:
22372  * @menu: a #GMenu
22373  * @label: (allow-none): the section label, or %NULL
22374  * @submenu: a #GMenuModel with the items of the submenu
22375  *
22376  * Convenience function for appending a submenu menu item to the end of
22377  * @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22378  * more flexible alternative.
22379  *
22380  * Since: 2.32
22381  */
22382
22383
22384 /**
22385  * g_menu_attribute_iter_get_name:
22386  * @iter: a #GMenuAttributeIter
22387  *
22388  * Gets the name of the attribute at the current iterator position, as
22389  * a string.
22390  *
22391  * The iterator is not advanced.
22392  *
22393  * Returns: the name of the attribute
22394  * Since: 2.32
22395  */
22396
22397
22398 /**
22399  * g_menu_attribute_iter_get_next:
22400  * @iter: a #GMenuAttributeIter
22401  * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22402  * @value: (out) (allow-none) (transfer full): the attribute value
22403  *
22404  * This function combines g_menu_attribute_iter_next() with
22405  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22406  *
22407  * First the iterator is advanced to the next (possibly first) attribute.
22408  * If that fails, then %FALSE is returned and there are no other
22409  * effects.
22410  *
22411  * If successful, @name and @value are set to the name and value of the
22412  * attribute that has just been advanced to.  At this point,
22413  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22414  * return the same values again.
22415  *
22416  * The value returned in @name remains valid for as long as the iterator
22417  * remains at the current position.  The value returned in @value must
22418  * be unreffed using g_variant_unref() when it is no longer in use.
22419  *
22420  * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22421  * Since: 2.32
22422  */
22423
22424
22425 /**
22426  * g_menu_attribute_iter_get_value:
22427  * @iter: a #GMenuAttributeIter
22428  *
22429  * Gets the value of the attribute at the current iterator position.
22430  *
22431  * The iterator is not advanced.
22432  *
22433  * Returns: (transfer full): the value of the current attribute
22434  * Since: 2.32
22435  */
22436
22437
22438 /**
22439  * g_menu_attribute_iter_next:
22440  * @iter: a #GMenuAttributeIter
22441  *
22442  * Attempts to advance the iterator to the next (possibly first)
22443  * attribute.
22444  *
22445  * %TRUE is returned on success, or %FALSE if there are no more
22446  * attributes.
22447  *
22448  * You must call this function when you first acquire the iterator
22449  * to advance it to the first attribute (and determine if the first
22450  * attribute exists at all).
22451  *
22452  * Returns: %TRUE on success, or %FALSE when there are no more attributes
22453  * Since: 2.32
22454  */
22455
22456
22457 /**
22458  * g_menu_freeze:
22459  * @menu: a #GMenu
22460  *
22461  * Marks @menu as frozen.
22462  *
22463  * After the menu is frozen, it is an error to attempt to make any
22464  * changes to it.  In effect this means that the #GMenu API must no
22465  * longer be used.
22466  *
22467  * This function causes g_menu_model_is_mutable() to begin returning
22468  * %FALSE, which has some positive performance implications.
22469  *
22470  * Since: 2.32
22471  */
22472
22473
22474 /**
22475  * g_menu_insert:
22476  * @menu: a #GMenu
22477  * @position: the position at which to insert the item
22478  * @label: (allow-none): the section label, or %NULL
22479  * @detailed_action: (allow-none): the detailed action string, or %NULL
22480  *
22481  * Convenience function for inserting a normal menu item into @menu.
22482  * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22483  * alternative.
22484  *
22485  * Since: 2.32
22486  */
22487
22488
22489 /**
22490  * g_menu_insert_item:
22491  * @menu: a #GMenu
22492  * @position: the position at which to insert the item
22493  * @item: the #GMenuItem to insert
22494  *
22495  * Inserts @item into @menu.
22496  *
22497  * The "insertion" is actually done by copying all of the attribute and
22498  * link values of @item and using them to form a new item within @menu.
22499  * As such, @item itself is not really inserted, but rather, a menu item
22500  * that is exactly the same as the one presently described by @item.
22501  *
22502  * This means that @item is essentially useless after the insertion
22503  * occurs.  Any changes you make to it are ignored unless it is inserted
22504  * again (at which point its updated values will be copied).
22505  *
22506  * You should probably just free @item once you're done.
22507  *
22508  * There are many convenience functions to take care of common cases.
22509  * See g_menu_insert(), g_menu_insert_section() and
22510  * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22511  * each of these functions.
22512  *
22513  * Since: 2.32
22514  */
22515
22516
22517 /**
22518  * g_menu_insert_section:
22519  * @menu: a #GMenu
22520  * @position: the position at which to insert the item
22521  * @label: (allow-none): the section label, or %NULL
22522  * @section: a #GMenuModel with the items of the section
22523  *
22524  * Convenience function for inserting a section menu item into @menu.
22525  * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22526  * flexible alternative.
22527  *
22528  * Since: 2.32
22529  */
22530
22531
22532 /**
22533  * g_menu_insert_submenu:
22534  * @menu: a #GMenu
22535  * @position: the position at which to insert the item
22536  * @label: (allow-none): the section label, or %NULL
22537  * @submenu: a #GMenuModel with the items of the submenu
22538  *
22539  * Convenience function for inserting a submenu menu item into @menu.
22540  * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22541  * flexible alternative.
22542  *
22543  * Since: 2.32
22544  */
22545
22546
22547 /**
22548  * g_menu_item_new:
22549  * @label: (allow-none): the section label, or %NULL
22550  * @detailed_action: (allow-none): the detailed action string, or %NULL
22551  *
22552  * Creates a new #GMenuItem.
22553  *
22554  * If @label is non-%NULL it is used to set the "label" attribute of the
22555  * new item.
22556  *
22557  * If @detailed_action is non-%NULL it is used to set the "action" and
22558  * possibly the "target" attribute of the new item.  See
22559  * g_menu_item_set_detailed_action() for more information.
22560  *
22561  * Returns: a new #GMenuItem
22562  * Since: 2.32
22563  */
22564
22565
22566 /**
22567  * g_menu_item_new_section:
22568  * @label: (allow-none): the section label, or %NULL
22569  * @section: a #GMenuModel with the items of the section
22570  *
22571  * Creates a new #GMenuItem representing a section.
22572  *
22573  * This is a convenience API around g_menu_item_new() and
22574  * g_menu_item_set_section().
22575  *
22576  * The effect of having one menu appear as a section of another is
22577  * exactly as it sounds: the items from @section become a direct part of
22578  * the menu that @menu_item is added to.
22579  *
22580  * Visual separation is typically displayed between two non-empty
22581  * sections.  If @label is non-%NULL then it will be encorporated into
22582  * this visual indication.  This allows for labeled subsections of a
22583  * menu.
22584  *
22585  * As a simple example, consider a typical "Edit" menu from a simple
22586  * program.  It probably contains an "Undo" and "Redo" item, followed by
22587  * a separator, followed by "Cut", "Copy" and "Paste".
22588  *
22589  * This would be accomplished by creating three #GMenu instances.  The
22590  * first would be populated with the "Undo" and "Redo" items, and the
22591  * second with the "Cut", "Copy" and "Paste" items.  The first and
22592  * second menus would then be added as submenus of the third.  In XML
22593  * format, this would look something like the following:
22594  *
22595  * <informalexample><programlisting><![CDATA[
22596  * <menu id='edit-menu'>
22597  *   <section>
22598  *     <item label='Undo'/>
22599  *     <item label='Redo'/>
22600  *   </section>
22601  *   <section>
22602  *     <item label='Cut'/>
22603  *     <item label='Copy'/>
22604  *     <item label='Paste'/>
22605  *   </section>
22606  * </menu>
22607  * ]]></programlisting></informalexample>
22608  *
22609  * The following example is exactly equivalent.  It is more illustrative
22610  * of the exact relationship between the menus and items (keeping in
22611  * mind that the 'link' element defines a new menu that is linked to the
22612  * containing one).  The style of the second example is more verbose and
22613  * difficult to read (and therefore not recommended except for the
22614  * purpose of understanding what is really going on).
22615  *
22616  * <informalexample><programlisting><![CDATA[
22617  * <menu id='edit-menu'>
22618  *   <item>
22619  *     <link name='section'>
22620  *       <item label='Undo'/>
22621  *       <item label='Redo'/>
22622  *     </link>
22623  *   </item>
22624  *   <item>
22625  *     <link name='section'>
22626  *       <item label='Cut'/>
22627  *       <item label='Copy'/>
22628  *       <item label='Paste'/>
22629  *     </link>
22630  *   </item>
22631  * </menu>
22632  * ]]></programlisting></informalexample>
22633  *
22634  * Returns: a new #GMenuItem
22635  * Since: 2.32
22636  */
22637
22638
22639 /**
22640  * g_menu_item_new_submenu:
22641  * @label: (allow-none): the section label, or %NULL
22642  * @submenu: a #GMenuModel with the items of the submenu
22643  *
22644  * Creates a new #GMenuItem representing a submenu.
22645  *
22646  * This is a convenience API around g_menu_item_new() and
22647  * g_menu_item_set_submenu().
22648  *
22649  * Returns: a new #GMenuItem
22650  * Since: 2.32
22651  */
22652
22653
22654 /**
22655  * g_menu_item_set_action_and_target:
22656  * @menu_item: a #GMenuItem
22657  * @action: (allow-none): the name of the action for this item
22658  * @format_string: (allow-none): a GVariant format string
22659  * @...: positional parameters, as per @format_string
22660  *
22661  * Sets or unsets the "action" and "target" attributes of @menu_item.
22662  *
22663  * If @action is %NULL then both the "action" and "target" attributes
22664  * are unset (and @format_string is ignored along with the positional
22665  * parameters).
22666  *
22667  * If @action is non-%NULL then the "action" attribute is set.
22668  * @format_string is then inspected.  If it is non-%NULL then the proper
22669  * position parameters are collected to create a #GVariant instance to
22670  * use as the target value.  If it is %NULL then the positional
22671  * parameters are ignored and the "target" attribute is unset.
22672  *
22673  * See also g_menu_item_set_action_and_target_value() for an equivalent
22674  * call that directly accepts a #GVariant.  See
22675  * g_menu_item_set_detailed_action() for a more convenient version that
22676  * works with string-typed targets.
22677  *
22678  * See also g_menu_item_set_action_and_target_value() for a
22679  * description of the semantics of the action and target attributes.
22680  *
22681  * Since: 2.32
22682  */
22683
22684
22685 /**
22686  * g_menu_item_set_action_and_target_value:
22687  * @menu_item: a #GMenuItem
22688  * @action: (allow-none): the name of the action for this item
22689  * @target_value: (allow-none): a #GVariant to use as the action target
22690  *
22691  * Sets or unsets the "action" and "target" attributes of @menu_item.
22692  *
22693  * If @action is %NULL then both the "action" and "target" attributes
22694  * are unset (and @target_value is ignored).
22695  *
22696  * If @action is non-%NULL then the "action" attribute is set.  The
22697  * "target" attribute is then set to the value of @target_value if it is
22698  * non-%NULL or unset otherwise.
22699  *
22700  * Normal menu items (ie: not submenu, section or other custom item
22701  * types) are expected to have the "action" attribute set to identify
22702  * the action that they are associated with.  The state type of the
22703  * action help to determine the disposition of the menu item.  See
22704  * #GAction and #GActionGroup for an overview of actions.
22705  *
22706  * In general, clicking on the menu item will result in activation of
22707  * the named action with the "target" attribute given as the parameter
22708  * to the action invocation.  If the "target" attribute is not set then
22709  * the action is invoked with no parameter.
22710  *
22711  * If the action has no state then the menu item is usually drawn as a
22712  * plain menu item (ie: with no additional decoration).
22713  *
22714  * If the action has a boolean state then the menu item is usually drawn
22715  * as a toggle menu item (ie: with a checkmark or equivalent
22716  * indication).  The item should be marked as 'toggled' or 'checked'
22717  * when the boolean state is %TRUE.
22718  *
22719  * If the action has a string state then the menu item is usually drawn
22720  * as a radio menu item (ie: with a radio bullet or equivalent
22721  * indication).  The item should be marked as 'selected' when the string
22722  * state is equal to the value of the @target property.
22723  *
22724  * See g_menu_item_set_action_and_target() or
22725  * g_menu_item_set_detailed_action() for two equivalent calls that are
22726  * probably more convenient for most uses.
22727  *
22728  * Since: 2.32
22729  */
22730
22731
22732 /**
22733  * g_menu_item_set_attribute:
22734  * @menu_item: a #GMenuItem
22735  * @attribute: the attribute to set
22736  * @format_string: (allow-none): a #GVariant format string, or %NULL
22737  * @...: positional parameters, as per @format_string
22738  *
22739  * Sets or unsets an attribute on @menu_item.
22740  *
22741  * The attribute to set or unset is specified by @attribute. This
22742  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22743  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22744  * attribute name.
22745  * Attribute names are restricted to lowercase characters, numbers
22746  * and '-'. Furthermore, the names must begin with a lowercase character,
22747  * must not end with a '-', and must not contain consecutive dashes.
22748  *
22749  * If @format_string is non-%NULL then the proper position parameters
22750  * are collected to create a #GVariant instance to use as the attribute
22751  * value.  If it is %NULL then the positional parameterrs are ignored
22752  * and the named attribute is unset.
22753  *
22754  * See also g_menu_item_set_attribute_value() for an equivalent call
22755  * that directly accepts a #GVariant.
22756  *
22757  * Since: 2.32
22758  */
22759
22760
22761 /**
22762  * g_menu_item_set_attribute_value:
22763  * @menu_item: a #GMenuItem
22764  * @attribute: the attribute to set
22765  * @value: (allow-none): a #GVariant to use as the value, or %NULL
22766  *
22767  * Sets or unsets an attribute on @menu_item.
22768  *
22769  * The attribute to set or unset is specified by @attribute. This
22770  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22771  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22772  * attribute name.
22773  * Attribute names are restricted to lowercase characters, numbers
22774  * and '-'. Furthermore, the names must begin with a lowercase character,
22775  * must not end with a '-', and must not contain consecutive dashes.
22776  *
22777  * must consist only of lowercase
22778  * ASCII characters, digits and '-'.
22779  *
22780  * If @value is non-%NULL then it is used as the new value for the
22781  * attribute.  If @value is %NULL then the attribute is unset. If
22782  * the @value #GVariant is floating, it is consumed.
22783  *
22784  * See also g_menu_item_set_attribute() for a more convenient way to do
22785  * the same.
22786  *
22787  * Since: 2.32
22788  */
22789
22790
22791 /**
22792  * g_menu_item_set_detailed_action:
22793  * @menu_item: a #GMenuItem
22794  * @detailed_action: the "detailed" action string
22795  *
22796  * Sets the "action" and possibly the "target" attribute of @menu_item.
22797  *
22798  * If @detailed_action contains a double colon ("::") then it is used as
22799  * a separator between an action name and a target string.  In this
22800  * case, this call is equivalent to calling
22801  * g_menu_item_set_action_and_target() with the part before the "::" and
22802  * with a string-type #GVariant containing the part following the "::".
22803  *
22804  * If @detailed_action doesn't contain "::" then the action is set to
22805  * the given string (verbatim) and the target value is unset.
22806  *
22807  * See g_menu_item_set_action_and_target() or
22808  * g_menu_item_set_action_and_target_value() for more flexible (but
22809  * slightly less convenient) alternatives.
22810  *
22811  * See also g_menu_item_set_action_and_target_value() for a description of
22812  * the semantics of the action and target attributes.
22813  *
22814  * Since: 2.32
22815  */
22816
22817
22818 /**
22819  * g_menu_item_set_label:
22820  * @menu_item: a #GMenuItem
22821  * @label: (allow-none): the label to set, or %NULL to unset
22822  *
22823  * Sets or unsets the "label" attribute of @menu_item.
22824  *
22825  * If @label is non-%NULL it is used as the label for the menu item.  If
22826  * it is %NULL then the label attribute is unset.
22827  *
22828  * Since: 2.32
22829  */
22830
22831
22832 /**
22833  * g_menu_item_set_link:
22834  * @menu_item: a #GMenuItem
22835  * @link: type of link to establish or unset
22836  * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
22837  *
22838  * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
22839  *
22840  * Links are used to establish a relationship between a particular menu
22841  * item and another menu.  For example, %G_MENU_LINK_SUBMENU is used to
22842  * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
22843  * is used to create a section. Other types of link can be used, but there
22844  * is no guarantee that clients will be able to make sense of them.
22845  * Link types are restricted to lowercase characters, numbers
22846  * and '-'. Furthermore, the names must begin with a lowercase character,
22847  * must not end with a '-', and must not contain consecutive dashes.
22848  *
22849  * Since: 2.32
22850  */
22851
22852
22853 /**
22854  * g_menu_item_set_section:
22855  * @menu_item: a #GMenuItem
22856  * @section: (allow-none): a #GMenuModel, or %NULL
22857  *
22858  * Sets or unsets the "section" link of @menu_item to @section.
22859  *
22860  * The effect of having one menu appear as a section of another is
22861  * exactly as it sounds: the items from @section become a direct part of
22862  * the menu that @menu_item is added to.  See g_menu_item_new_section()
22863  * for more information about what it means for a menu item to be a
22864  * section.
22865  *
22866  * Since: 2.32
22867  */
22868
22869
22870 /**
22871  * g_menu_item_set_submenu:
22872  * @menu_item: a #GMenuItem
22873  * @submenu: (allow-none): a #GMenuModel, or %NULL
22874  *
22875  * Sets or unsets the "submenu" link of @menu_item to @submenu.
22876  *
22877  * If @submenu is non-%NULL, it is linked to.  If it is %NULL then the
22878  * link is unset.
22879  *
22880  * The effect of having one menu appear as a submenu of another is
22881  * exactly as it sounds.
22882  *
22883  * Since: 2.32
22884  */
22885
22886
22887 /**
22888  * g_menu_link_iter_get_name:
22889  * @iter: a #GMenuLinkIter
22890  *
22891  * Gets the name of the link at the current iterator position.
22892  *
22893  * The iterator is not advanced.
22894  *
22895  * Returns: the type of the link
22896  * Since: 2.32
22897  */
22898
22899
22900 /**
22901  * g_menu_link_iter_get_next:
22902  * @iter: a #GMenuLinkIter
22903  * @out_link: (out) (allow-none) (transfer none): the name of the link
22904  * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
22905  *
22906  * This function combines g_menu_link_iter_next() with
22907  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
22908  *
22909  * First the iterator is advanced to the next (possibly first) link.
22910  * If that fails, then %FALSE is returned and there are no other effects.
22911  *
22912  * If successful, @out_link and @value are set to the name and #GMenuModel
22913  * of the link that has just been advanced to.  At this point,
22914  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
22915  * same values again.
22916  *
22917  * The value returned in @out_link remains valid for as long as the iterator
22918  * remains at the current position.  The value returned in @value must
22919  * be unreffed using g_object_unref() when it is no longer in use.
22920  *
22921  * Returns: %TRUE on success, or %FALSE if there is no additional link
22922  * Since: 2.32
22923  */
22924
22925
22926 /**
22927  * g_menu_link_iter_get_value:
22928  * @iter: a #GMenuLinkIter
22929  *
22930  * Gets the linked #GMenuModel at the current iterator position.
22931  *
22932  * The iterator is not advanced.
22933  *
22934  * Returns: (transfer full): the #GMenuModel that is linked to
22935  * Since: 2.32
22936  */
22937
22938
22939 /**
22940  * g_menu_link_iter_next:
22941  * @iter: a #GMenuLinkIter
22942  *
22943  * Attempts to advance the iterator to the next (possibly first)
22944  * link.
22945  *
22946  * %TRUE is returned on success, or %FALSE if there are no more links.
22947  *
22948  * You must call this function when you first acquire the iterator to
22949  * advance it to the first link (and determine if the first link exists
22950  * at all).
22951  *
22952  * Returns: %TRUE on success, or %FALSE when there are no more links
22953  * Since: 2.32
22954  */
22955
22956
22957 /**
22958  * g_menu_model_get_item_attribute:
22959  * @model: a #GMenuModel
22960  * @item_index: the index of the item
22961  * @attribute: the attribute to query
22962  * @format_string: a #GVariant format string
22963  * @...: positional parameters, as per @format_string
22964  *
22965  * Queries item at position @item_index in @model for the attribute
22966  * specified by @attribute.
22967  *
22968  * If the attribute exists and matches the #GVariantType corresponding
22969  * to @format_string then @format_string is used to deconstruct the
22970  * value into the positional parameters and %TRUE is returned.
22971  *
22972  * If the attribute does not exist, or it does exist but has the wrong
22973  * type, then the positional parameters are ignored and %FALSE is
22974  * returned.
22975  *
22976  * Returns: %TRUE if the named attribute was found with the expected type
22977  * Since: 2.32
22978  */
22979
22980
22981 /**
22982  * g_menu_model_get_item_attribute_value:
22983  * @model: a #GMenuModel
22984  * @item_index: the index of the item
22985  * @attribute: the attribute to query
22986  * @expected_type: (allow-none): the expected type of the attribute, or %NULL
22987  *
22988  * Queries the item at position @item_index in @model for the attribute
22989  * specified by @attribute.
22990  *
22991  * If @expected_type is non-%NULL then it specifies the expected type of
22992  * the attribute.  If it is %NULL then any type will be accepted.
22993  *
22994  * If the attribute exists and matches @expected_type (or if the
22995  * expected type is unspecified) then the value is returned.
22996  *
22997  * If the attribute does not exist, or does not match the expected type
22998  * then %NULL is returned.
22999  *
23000  * Returns: (transfer full): the value of the attribute
23001  * Since: 2.32
23002  */
23003
23004
23005 /**
23006  * g_menu_model_get_item_link:
23007  * @model: a #GMenuModel
23008  * @item_index: the index of the item
23009  * @link: the link to query
23010  *
23011  * Queries the item at position @item_index in @model for the link
23012  * specified by @link.
23013  *
23014  * If the link exists, the linked #GMenuModel is returned.  If the link
23015  * does not exist, %NULL is returned.
23016  *
23017  * Returns: (transfer full): the linked #GMenuModel, or %NULL
23018  * Since: 2.32
23019  */
23020
23021
23022 /**
23023  * g_menu_model_get_n_items:
23024  * @model: a #GMenuModel
23025  *
23026  * Query the number of items in @model.
23027  *
23028  * Returns: the number of items
23029  * Since: 2.32
23030  */
23031
23032
23033 /**
23034  * g_menu_model_is_mutable:
23035  * @model: a #GMenuModel
23036  *
23037  * Queries if @model is mutable.
23038  *
23039  * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23040  * signal. Consumers of the model may make optimisations accordingly.
23041  *
23042  * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23043  * Since: 2.32
23044  */
23045
23046
23047 /**
23048  * g_menu_model_items_changed:
23049  * @model: a #GMenuModel
23050  * @position: the position of the change
23051  * @removed: the number of items removed
23052  * @added: the number of items added
23053  *
23054  * Requests emission of the #GMenuModel::items-changed signal on @model.
23055  *
23056  * This function should never be called except by #GMenuModel
23057  * subclasses.  Any other calls to this function will very likely lead
23058  * to a violation of the interface of the model.
23059  *
23060  * The implementation should update its internal representation of the
23061  * menu before emitting the signal.  The implementation should further
23062  * expect to receive queries about the new state of the menu (and
23063  * particularly added menu items) while signal handlers are running.
23064  *
23065  * The implementation must dispatch this call directly from a mainloop
23066  * entry and not in response to calls -- particularly those from the
23067  * #GMenuModel API.  Said another way: the menu must not change while
23068  * user code is running without returning to the mainloop.
23069  *
23070  * Since: 2.32
23071  */
23072
23073
23074 /**
23075  * g_menu_model_iterate_item_attributes:
23076  * @model: a #GMenuModel
23077  * @item_index: the index of the item
23078  *
23079  * Creates a #GMenuAttributeIter to iterate over the attributes of
23080  * the item at position @item_index in @model.
23081  *
23082  * You must free the iterator with g_object_unref() when you are done.
23083  *
23084  * Returns: (transfer full): a new #GMenuAttributeIter
23085  * Since: 2.32
23086  */
23087
23088
23089 /**
23090  * g_menu_model_iterate_item_links:
23091  * @model: a #GMenuModel
23092  * @item_index: the index of the item
23093  *
23094  * Creates a #GMenuLinkIter to iterate over the links of the item at
23095  * position @item_index in @model.
23096  *
23097  * You must free the iterator with g_object_unref() when you are done.
23098  *
23099  * Returns: (transfer full): a new #GMenuLinkIter
23100  * Since: 2.32
23101  */
23102
23103
23104 /**
23105  * g_menu_new:
23106  *
23107  * Creates a new #GMenu.
23108  *
23109  * The new menu has no items.
23110  *
23111  * Returns: a new #GMenu
23112  * Since: 2.32
23113  */
23114
23115
23116 /**
23117  * g_menu_prepend:
23118  * @menu: a #GMenu
23119  * @label: (allow-none): the section label, or %NULL
23120  * @detailed_action: (allow-none): the detailed action string, or %NULL
23121  *
23122  * Convenience function for prepending a normal menu item to the start
23123  * of @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
23124  * flexible alternative.
23125  *
23126  * Since: 2.32
23127  */
23128
23129
23130 /**
23131  * g_menu_prepend_item:
23132  * @menu: a #GMenu
23133  * @item: a #GMenuItem to prepend
23134  *
23135  * Prepends @item to the start of @menu.
23136  *
23137  * See g_menu_insert_item() for more information.
23138  *
23139  * Since: 2.32
23140  */
23141
23142
23143 /**
23144  * g_menu_prepend_section:
23145  * @menu: a #GMenu
23146  * @label: (allow-none): the section label, or %NULL
23147  * @section: a #GMenuModel with the items of the section
23148  *
23149  * Convenience function for prepending a section menu item to the start
23150  * of @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for
23151  * a more flexible alternative.
23152  *
23153  * Since: 2.32
23154  */
23155
23156
23157 /**
23158  * g_menu_prepend_submenu:
23159  * @menu: a #GMenu
23160  * @label: (allow-none): the section label, or %NULL
23161  * @submenu: a #GMenuModel with the items of the submenu
23162  *
23163  * Convenience function for prepending a submenu menu item to the start
23164  * of @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23165  * a more flexible alternative.
23166  *
23167  * Since: 2.32
23168  */
23169
23170
23171 /**
23172  * g_menu_remove:
23173  * @menu: a #GMenu
23174  * @position: the position of the item to remove
23175  *
23176  * Removes an item from the menu.
23177  *
23178  * @position gives the index of the item to remove.
23179  *
23180  * It is an error if position is not in range the range from 0 to one
23181  * less than the number of items in the menu.
23182  *
23183  * It is not possible to remove items by identity since items are added
23184  * to the menu simply by copying their links and attributes (ie:
23185  * identity of the item itself is not preserved).
23186  *
23187  * Since: 2.32
23188  */
23189
23190
23191 /**
23192  * g_mount_can_eject:
23193  * @mount: a #GMount.
23194  *
23195  * Checks if @mount can be eject.
23196  *
23197  * Returns: %TRUE if the @mount can be ejected.
23198  */
23199
23200
23201 /**
23202  * g_mount_can_unmount:
23203  * @mount: a #GMount.
23204  *
23205  * Checks if @mount can be mounted.
23206  *
23207  * Returns: %TRUE if the @mount can be unmounted.
23208  */
23209
23210
23211 /**
23212  * g_mount_eject:
23213  * @mount: a #GMount.
23214  * @flags: flags affecting the unmount if required for eject
23215  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23216  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23217  * @user_data: user data passed to @callback.
23218  *
23219  * Ejects a mount. This is an asynchronous operation, and is
23220  * finished by calling g_mount_eject_finish() with the @mount
23221  * and #GAsyncResult data returned in the @callback.
23222  *
23223  * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23224  */
23225
23226
23227 /**
23228  * g_mount_eject_finish:
23229  * @mount: a #GMount.
23230  * @result: a #GAsyncResult.
23231  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23232  *
23233  * Finishes ejecting a mount. If any errors occurred during the operation,
23234  * @error will be set to contain the errors and %FALSE will be returned.
23235  *
23236  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23237  * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23238  */
23239
23240
23241 /**
23242  * g_mount_eject_with_operation:
23243  * @mount: a #GMount.
23244  * @flags: flags affecting the unmount if required for eject
23245  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23246  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23247  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23248  * @user_data: user data passed to @callback.
23249  *
23250  * Ejects a mount. This is an asynchronous operation, and is
23251  * finished by calling g_mount_eject_with_operation_finish() with the @mount
23252  * and #GAsyncResult data returned in the @callback.
23253  *
23254  * Since: 2.22
23255  */
23256
23257
23258 /**
23259  * g_mount_eject_with_operation_finish:
23260  * @mount: a #GMount.
23261  * @result: a #GAsyncResult.
23262  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23263  *
23264  * Finishes ejecting a mount. If any errors occurred during the operation,
23265  * @error will be set to contain the errors and %FALSE will be returned.
23266  *
23267  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23268  * Since: 2.22
23269  */
23270
23271
23272 /**
23273  * g_mount_get_default_location:
23274  * @mount: a #GMount.
23275  *
23276  * Gets the default location of @mount. The default location of the given
23277  * @mount is a path that reflects the main entry point for the user (e.g.
23278  * the home directory, or the root of the volume).
23279  *
23280  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23281  */
23282
23283
23284 /**
23285  * g_mount_get_drive:
23286  * @mount: a #GMount.
23287  *
23288  * Gets the drive for the @mount.
23289  *
23290  * This is a convenience method for getting the #GVolume and then
23291  * using that object to get the #GDrive.
23292  *
23293  * 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.
23294  */
23295
23296
23297 /**
23298  * g_mount_get_icon:
23299  * @mount: a #GMount.
23300  *
23301  * Gets the icon for @mount.
23302  *
23303  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23304  */
23305
23306
23307 /**
23308  * g_mount_get_name:
23309  * @mount: a #GMount.
23310  *
23311  * Gets the name of @mount.
23312  *
23313  * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23314  */
23315
23316
23317 /**
23318  * g_mount_get_root:
23319  * @mount: a #GMount.
23320  *
23321  * Gets the root directory on @mount.
23322  *
23323  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23324  */
23325
23326
23327 /**
23328  * g_mount_get_sort_key:
23329  * @mount: A #GMount.
23330  *
23331  * Gets the sort key for @mount, if any.
23332  *
23333  * Returns: Sorting key for @mount or %NULL if no such key is available.
23334  * Since: 2.32
23335  */
23336
23337
23338 /**
23339  * g_mount_get_uuid:
23340  * @mount: a #GMount.
23341  *
23342  * Gets the UUID for the @mount. The reference is typically based on
23343  * the file system UUID for the mount in question and should be
23344  * considered an opaque string. Returns %NULL if there is no UUID
23345  * available.
23346  *
23347  * 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.
23348  */
23349
23350
23351 /**
23352  * g_mount_get_volume:
23353  * @mount: a #GMount.
23354  *
23355  * Gets the volume for the @mount.
23356  *
23357  * 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.
23358  */
23359
23360
23361 /**
23362  * g_mount_guess_content_type:
23363  * @mount: a #GMount
23364  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23365  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23366  * @callback: a #GAsyncReadyCallback
23367  * @user_data: user data passed to @callback
23368  *
23369  * Tries to guess the type of content stored on @mount. Returns one or
23370  * more textual identifiers of well-known content types (typically
23371  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23372  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23373  * specification for more on x-content types.
23374  *
23375  * This is an asynchronous operation (see
23376  * g_mount_guess_content_type_sync() for the synchronous version), and
23377  * is finished by calling g_mount_guess_content_type_finish() with the
23378  * @mount and #GAsyncResult data returned in the @callback.
23379  *
23380  * Since: 2.18
23381  */
23382
23383
23384 /**
23385  * g_mount_guess_content_type_finish:
23386  * @mount: a #GMount
23387  * @result: a #GAsyncResult
23388  * @error: a #GError location to store the error occurring, or %NULL to ignore
23389  *
23390  * Finishes guessing content types of @mount. If any errors occurred
23391  * during the operation, @error will be set to contain the errors and
23392  * %FALSE will be returned. In particular, you may get an
23393  * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23394  * guessing.
23395  *
23396  * 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.
23397  * Since: 2.18
23398  */
23399
23400
23401 /**
23402  * g_mount_guess_content_type_sync:
23403  * @mount: a #GMount
23404  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23405  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23406  * @error: a #GError location to store the error occurring, or %NULL to ignore
23407  *
23408  * Tries to guess the type of content stored on @mount. Returns one or
23409  * more textual identifiers of well-known content types (typically
23410  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23411  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23412  * specification for more on x-content types.
23413  *
23414  * This is an synchronous operation and as such may block doing IO;
23415  * see g_mount_guess_content_type() for the asynchronous version.
23416  *
23417  * 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.
23418  * Since: 2.18
23419  */
23420
23421
23422 /**
23423  * g_mount_is_shadowed:
23424  * @mount: A #GMount.
23425  *
23426  * Determines if @mount is shadowed. Applications or libraries should
23427  * avoid displaying @mount in the user interface if it is shadowed.
23428  *
23429  * A mount is said to be shadowed if there exists one or more user
23430  * visible objects (currently #GMount objects) with a root that is
23431  * inside the root of @mount.
23432  *
23433  * One application of shadow mounts is when exposing a single file
23434  * system that is used to address several logical volumes. In this
23435  * situation, a #GVolumeMonitor implementation would create two
23436  * #GVolume objects (for example, one for the camera functionality of
23437  * the device and one for a SD card reader on the device) with
23438  * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23439  * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23440  * underlying mount (with root
23441  * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23442  * #GVolumeMonitor implementation would create two #GMount objects
23443  * (each with their root matching the corresponding volume activation
23444  * root) that would shadow the original mount.
23445  *
23446  * The proxy monitor in GVfs 2.26 and later, automatically creates and
23447  * manage shadow mounts (and shadows the underlying mount) if the
23448  * activation root on a #GVolume is set.
23449  *
23450  * Returns: %TRUE if @mount is shadowed.
23451  * Since: 2.20
23452  */
23453
23454
23455 /**
23456  * g_mount_operation_get_anonymous:
23457  * @op: a #GMountOperation.
23458  *
23459  * Check to see whether the mount operation is being used
23460  * for an anonymous user.
23461  *
23462  * Returns: %TRUE if mount operation is anonymous.
23463  */
23464
23465
23466 /**
23467  * g_mount_operation_get_choice:
23468  * @op: a #GMountOperation.
23469  *
23470  * Gets a choice from the mount operation.
23471  *
23472  * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23473  */
23474
23475
23476 /**
23477  * g_mount_operation_get_domain:
23478  * @op: a #GMountOperation.
23479  *
23480  * Gets the domain of the mount operation.
23481  *
23482  * Returns: a string set to the domain.
23483  */
23484
23485
23486 /**
23487  * g_mount_operation_get_password:
23488  * @op: a #GMountOperation.
23489  *
23490  * Gets a password from the mount operation.
23491  *
23492  * Returns: a string containing the password within @op.
23493  */
23494
23495
23496 /**
23497  * g_mount_operation_get_password_save:
23498  * @op: a #GMountOperation.
23499  *
23500  * Gets the state of saving passwords for the mount operation.
23501  *
23502  * Returns: a #GPasswordSave flag.
23503  */
23504
23505
23506 /**
23507  * g_mount_operation_get_username:
23508  * @op: a #GMountOperation.
23509  *
23510  * Get the user name from the mount operation.
23511  *
23512  * Returns: a string containing the user name.
23513  */
23514
23515
23516 /**
23517  * g_mount_operation_new:
23518  *
23519  * Creates a new mount operation.
23520  *
23521  * Returns: a #GMountOperation.
23522  */
23523
23524
23525 /**
23526  * g_mount_operation_reply:
23527  * @op: a #GMountOperation
23528  * @result: a #GMountOperationResult
23529  *
23530  * Emits the #GMountOperation::reply signal.
23531  */
23532
23533
23534 /**
23535  * g_mount_operation_set_anonymous:
23536  * @op: a #GMountOperation.
23537  * @anonymous: boolean value.
23538  *
23539  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23540  */
23541
23542
23543 /**
23544  * g_mount_operation_set_choice:
23545  * @op: a #GMountOperation.
23546  * @choice: an integer.
23547  *
23548  * Sets a default choice for the mount operation.
23549  */
23550
23551
23552 /**
23553  * g_mount_operation_set_domain:
23554  * @op: a #GMountOperation.
23555  * @domain: the domain to set.
23556  *
23557  * Sets the mount operation's domain.
23558  */
23559
23560
23561 /**
23562  * g_mount_operation_set_password:
23563  * @op: a #GMountOperation.
23564  * @password: password to set.
23565  *
23566  * Sets the mount operation's password to @password.
23567  */
23568
23569
23570 /**
23571  * g_mount_operation_set_password_save:
23572  * @op: a #GMountOperation.
23573  * @save: a set of #GPasswordSave flags.
23574  *
23575  * Sets the state of saving passwords for the mount operation.
23576  */
23577
23578
23579 /**
23580  * g_mount_operation_set_username:
23581  * @op: a #GMountOperation.
23582  * @username: input username.
23583  *
23584  * Sets the user name within @op to @username.
23585  */
23586
23587
23588 /**
23589  * g_mount_remount:
23590  * @mount: a #GMount.
23591  * @flags: flags affecting the operation
23592  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23593  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23594  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23595  * @user_data: user data passed to @callback.
23596  *
23597  * Remounts a mount. This is an asynchronous operation, and is
23598  * finished by calling g_mount_remount_finish() with the @mount
23599  * and #GAsyncResults data returned in the @callback.
23600  *
23601  * Remounting is useful when some setting affecting the operation
23602  * of the volume has been changed, as these may need a remount to
23603  * take affect. While this is semantically equivalent with unmounting
23604  * and then remounting not all backends might need to actually be
23605  * unmounted.
23606  */
23607
23608
23609 /**
23610  * g_mount_remount_finish:
23611  * @mount: a #GMount.
23612  * @result: a #GAsyncResult.
23613  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23614  *
23615  * Finishes remounting a mount. If any errors occurred during the operation,
23616  * @error will be set to contain the errors and %FALSE will be returned.
23617  *
23618  * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23619  */
23620
23621
23622 /**
23623  * g_mount_shadow:
23624  * @mount: A #GMount.
23625  *
23626  * Increments the shadow count on @mount. Usually used by
23627  * #GVolumeMonitor implementations when creating a shadow mount for
23628  * @mount, see g_mount_is_shadowed() for more information. The caller
23629  * will need to emit the #GMount::changed signal on @mount manually.
23630  *
23631  * Since: 2.20
23632  */
23633
23634
23635 /**
23636  * g_mount_unmount:
23637  * @mount: a #GMount.
23638  * @flags: flags affecting the operation
23639  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23640  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23641  * @user_data: user data passed to @callback.
23642  *
23643  * Unmounts a mount. This is an asynchronous operation, and is
23644  * finished by calling g_mount_unmount_finish() with the @mount
23645  * and #GAsyncResult data returned in the @callback.
23646  *
23647  * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23648  */
23649
23650
23651 /**
23652  * g_mount_unmount_finish:
23653  * @mount: a #GMount.
23654  * @result: a #GAsyncResult.
23655  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23656  *
23657  * Finishes unmounting a mount. If any errors occurred during the operation,
23658  * @error will be set to contain the errors and %FALSE will be returned.
23659  *
23660  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23661  * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23662  */
23663
23664
23665 /**
23666  * g_mount_unmount_with_operation:
23667  * @mount: a #GMount.
23668  * @flags: flags affecting the operation
23669  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23670  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23671  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23672  * @user_data: user data passed to @callback.
23673  *
23674  * Unmounts a mount. This is an asynchronous operation, and is
23675  * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23676  * and #GAsyncResult data returned in the @callback.
23677  *
23678  * Since: 2.22
23679  */
23680
23681
23682 /**
23683  * g_mount_unmount_with_operation_finish:
23684  * @mount: a #GMount.
23685  * @result: a #GAsyncResult.
23686  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23687  *
23688  * Finishes unmounting a mount. If any errors occurred during the operation,
23689  * @error will be set to contain the errors and %FALSE will be returned.
23690  *
23691  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23692  * Since: 2.22
23693  */
23694
23695
23696 /**
23697  * g_mount_unshadow:
23698  * @mount: A #GMount.
23699  *
23700  * Decrements the shadow count on @mount. Usually used by
23701  * #GVolumeMonitor implementations when destroying a shadow mount for
23702  * @mount, see g_mount_is_shadowed() for more information. The caller
23703  * will need to emit the #GMount::changed signal on @mount manually.
23704  *
23705  * Since: 2.20
23706  */
23707
23708
23709 /**
23710  * g_network_address_get_hostname:
23711  * @addr: a #GNetworkAddress
23712  *
23713  * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
23714  * depending on what @addr was created with.
23715  *
23716  * Returns: @addr's hostname
23717  * Since: 2.22
23718  */
23719
23720
23721 /**
23722  * g_network_address_get_port:
23723  * @addr: a #GNetworkAddress
23724  *
23725  * Gets @addr's port number
23726  *
23727  * Returns: @addr's port (which may be 0)
23728  * Since: 2.22
23729  */
23730
23731
23732 /**
23733  * g_network_address_get_scheme:
23734  * @addr: a #GNetworkAddress
23735  *
23736  * Gets @addr's scheme
23737  *
23738  * Returns: @addr's scheme (%NULL if not built from URI)
23739  * Since: 2.26
23740  */
23741
23742
23743 /**
23744  * g_network_address_new:
23745  * @hostname: the hostname
23746  * @port: the port
23747  *
23748  * Creates a new #GSocketConnectable for connecting to the given
23749  * @hostname and @port.
23750  *
23751  * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
23752  * Since: 2.22
23753  */
23754
23755
23756 /**
23757  * g_network_address_parse:
23758  * @host_and_port: the hostname and optionally a port
23759  * @default_port: the default port if not in @host_and_port
23760  * @error: a pointer to a #GError, or %NULL
23761  *
23762  * Creates a new #GSocketConnectable for connecting to the given
23763  * @hostname and @port. May fail and return %NULL in case
23764  * parsing @host_and_port fails.
23765  *
23766  * @host_and_port may be in any of a number of recognised formats; an IPv6
23767  * address, an IPv4 address, or a domain name (in which case a DNS
23768  * lookup is performed). Quoting with [] is supported for all address
23769  * types. A port override may be specified in the usual way with a
23770  * colon.
23771  *
23772  * If no port is specified in @host_and_port then @default_port will be
23773  * used as the port number to connect to.
23774  *
23775  * In general, @host_and_port is expected to be provided by the user
23776  * (allowing them to give the hostname, and a port overide if necessary)
23777  * and @default_port is expected to be provided by the application.
23778  *
23779  * (The port component of @host_and_port can also be specified as a
23780  * service name rather than as a numeric port, but this functionality
23781  * is deprecated, because it depends on the contents of /etc/services,
23782  * which is generally quite sparse on platforms other than Linux.)
23783  *
23784  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23785  * Since: 2.22
23786  */
23787
23788
23789 /**
23790  * g_network_address_parse_uri:
23791  * @uri: the hostname and optionally a port
23792  * @default_port: The default port if none is found in the URI
23793  * @error: a pointer to a #GError, or %NULL
23794  *
23795  * Creates a new #GSocketConnectable for connecting to the given
23796  * @uri. May fail and return %NULL in case parsing @uri fails.
23797  *
23798  * Using this rather than g_network_address_new() or
23799  * g_network_address_parse() allows #GSocketClient to determine
23800  * when to use application-specific proxy protocols.
23801  *
23802  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23803  * Since: 2.26
23804  */
23805
23806
23807 /**
23808  * g_network_monitor_base_add_network:
23809  * @monitor: the #GNetworkMonitorBase
23810  * @network: a #GInetAddressMask
23811  *
23812  * Adds @network to @monitor's list of available networks.
23813  *
23814  * Since: 2.32
23815  */
23816
23817
23818 /**
23819  * g_network_monitor_base_remove_network:
23820  * @monitor: the #GNetworkMonitorBase
23821  * @network: a #GInetAddressMask
23822  *
23823  * Removes @network from @monitor's list of available networks.
23824  *
23825  * Since: 2.32
23826  */
23827
23828
23829 /**
23830  * g_network_monitor_base_set_networks:
23831  * @monitor: the #GNetworkMonitorBase
23832  * @networks: (array length=length): an array of #GInetAddressMask
23833  * @length: length of @networks
23834  *
23835  * Drops @monitor's current list of available networks and replaces
23836  * it with @networks.
23837  */
23838
23839
23840 /**
23841  * g_network_monitor_can_reach:
23842  * @monitor: a #GNetworkMonitor
23843  * @connectable: a #GSocketConnectable
23844  * @cancellable: (allow-none): a #GCancellable, or %NULL
23845  * @error: return location for a #GError, or %NULL
23846  *
23847  * Attempts to determine whether or not the host pointed to by
23848  * @connectable can be reached, without actually trying to connect to
23849  * it.
23850  *
23851  * This may return %TRUE even when #GNetworkMonitor:network-available
23852  * is %FALSE, if, for example, @monitor can determine that
23853  * @connectable refers to a host on a local network.
23854  *
23855  * If @monitor believes that an attempt to connect to @connectable
23856  * will succeed, it will return %TRUE. Otherwise, it will return
23857  * %FALSE and set @error to an appropriate error (such as
23858  * %G_IO_ERROR_HOST_UNREACHABLE).
23859  *
23860  * Note that although this does not attempt to connect to
23861  * @connectable, it may still block for a brief period of time (eg,
23862  * trying to do multicast DNS on the local network), so if you do not
23863  * want to block, you should use g_network_monitor_can_reach_async().
23864  *
23865  * Returns: %TRUE if @connectable is reachable, %FALSE if not.
23866  * Since: 2.32
23867  */
23868
23869
23870 /**
23871  * g_network_monitor_can_reach_async:
23872  * @monitor: a #GNetworkMonitor
23873  * @connectable: a #GSocketConnectable
23874  * @cancellable: (allow-none): a #GCancellable, or %NULL
23875  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
23876  * @user_data: (closure): the data to pass to callback function
23877  *
23878  * Asynchronously attempts to determine whether or not the host
23879  * pointed to by @connectable can be reached, without actually
23880  * trying to connect to it.
23881  *
23882  * For more details, see g_network_monitor_can_reach().
23883  *
23884  * When the operation is finished, @callback will be called.
23885  * You can then call g_network_monitor_can_reach_finish()
23886  * to get the result of the operation.
23887  */
23888
23889
23890 /**
23891  * g_network_monitor_can_reach_finish:
23892  * @monitor: a #GNetworkMonitor
23893  * @result: a #GAsyncResult
23894  * @error: return location for errors, or %NULL
23895  *
23896  * Finishes an async network connectivity test.
23897  * See g_network_monitor_can_reach_async().
23898  *
23899  * Returns: %TRUE if network is reachable, %FALSE if not.
23900  */
23901
23902
23903 /**
23904  * g_network_monitor_get_default:
23905  *
23906  * Gets the default #GNetworkMonitor for the system.
23907  *
23908  * Returns: (transfer none): a #GNetworkMonitor
23909  * Since: 2.32
23910  */
23911
23912
23913 /**
23914  * g_network_monitor_get_network_available:
23915  * @monitor: the #GNetworkMonitor
23916  *
23917  * Checks if the network is available. "Available" here means that the
23918  * system has a default route available for at least one of IPv4 or
23919  * IPv6. It does not necessarily imply that the public Internet is
23920  * reachable. See #GNetworkMonitor:network-available for more details.
23921  *
23922  * Returns: whether the network is available
23923  * Since: 2.32
23924  */
23925
23926
23927 /**
23928  * g_network_service_get_domain:
23929  * @srv: a #GNetworkService
23930  *
23931  * Gets the domain that @srv serves. This might be either UTF-8 or
23932  * ASCII-encoded, depending on what @srv was created with.
23933  *
23934  * Returns: @srv's domain name
23935  * Since: 2.22
23936  */
23937
23938
23939 /**
23940  * g_network_service_get_protocol:
23941  * @srv: a #GNetworkService
23942  *
23943  * Gets @srv's protocol name (eg, "tcp").
23944  *
23945  * Returns: @srv's protocol name
23946  * Since: 2.22
23947  */
23948
23949
23950 /**
23951  * g_network_service_get_scheme:
23952  * @srv: a #GNetworkService
23953  *
23954  * Get's the URI scheme used to resolve proxies. By default, the service name
23955  * is used as scheme.
23956  *
23957  * Returns: @srv's scheme name
23958  * Since: 2.26
23959  */
23960
23961
23962 /**
23963  * g_network_service_get_service:
23964  * @srv: a #GNetworkService
23965  *
23966  * Gets @srv's service name (eg, "ldap").
23967  *
23968  * Returns: @srv's service name
23969  * Since: 2.22
23970  */
23971
23972
23973 /**
23974  * g_network_service_new:
23975  * @service: the service type to look up (eg, "ldap")
23976  * @protocol: the networking protocol to use for @service (eg, "tcp")
23977  * @domain: the DNS domain to look up the service in
23978  *
23979  * Creates a new #GNetworkService representing the given @service,
23980  * @protocol, and @domain. This will initially be unresolved; use the
23981  * #GSocketConnectable interface to resolve it.
23982  *
23983  * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
23984  * Since: 2.22
23985  */
23986
23987
23988 /**
23989  * g_network_service_set_scheme:
23990  * @srv: a #GNetworkService
23991  * @scheme: a URI scheme
23992  *
23993  * Set's the URI scheme used to resolve proxies. By default, the service name
23994  * is used as scheme.
23995  *
23996  * Since: 2.26
23997  */
23998
23999
24000 /**
24001  * g_null_settings_backend_new:
24002  *
24003  * Creates a readonly #GSettingsBackend.
24004  *
24005  * This backend does not allow changes to settings, so all settings
24006  * will always have their default values.
24007  *
24008  * Returns: (transfer full): a newly created #GSettingsBackend
24009  * Since: 2.28
24010  */
24011
24012
24013 /**
24014  * g_output_stream_clear_pending:
24015  * @stream: output stream
24016  *
24017  * Clears the pending flag on @stream.
24018  */
24019
24020
24021 /**
24022  * g_output_stream_close:
24023  * @stream: A #GOutputStream.
24024  * @cancellable: (allow-none): optional cancellable object
24025  * @error: location to store the error occurring, or %NULL to ignore
24026  *
24027  * Closes the stream, releasing resources related to it.
24028  *
24029  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24030  * Closing a stream multiple times will not return an error.
24031  *
24032  * Closing a stream will automatically flush any outstanding buffers in the
24033  * stream.
24034  *
24035  * Streams will be automatically closed when the last reference
24036  * is dropped, but you might want to call this function to make sure
24037  * resources are released as early as possible.
24038  *
24039  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24040  * open after the stream is closed. See the documentation for the individual
24041  * stream for details.
24042  *
24043  * On failure the first error that happened will be reported, but the close
24044  * operation will finish as much as possible. A stream that failed to
24045  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24046  * is important to check and report the error to the user, otherwise
24047  * there might be a loss of data as all data might not be written.
24048  *
24049  * If @cancellable is not %NULL, then the operation can be cancelled by
24050  * triggering the cancellable object from another thread. If the operation
24051  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24052  * Cancelling a close will still leave the stream closed, but there some streams
24053  * can use a faster close that doesn't block to e.g. check errors. On
24054  * cancellation (as with any error) there is no guarantee that all written
24055  * data will reach the target.
24056  *
24057  * Returns: %TRUE on success, %FALSE on failure
24058  */
24059
24060
24061 /**
24062  * g_output_stream_close_async:
24063  * @stream: A #GOutputStream.
24064  * @io_priority: the io priority of the request.
24065  * @cancellable: (allow-none): optional cancellable object
24066  * @callback: (scope async): callback to call when the request is satisfied
24067  * @user_data: (closure): the data to pass to callback function
24068  *
24069  * Requests an asynchronous close of the stream, releasing resources
24070  * related to it. When the operation is finished @callback will be
24071  * called. You can then call g_output_stream_close_finish() to get
24072  * the result of the operation.
24073  *
24074  * For behaviour details see g_output_stream_close().
24075  *
24076  * The asyncronous methods have a default fallback that uses threads
24077  * to implement asynchronicity, so they are optional for inheriting
24078  * classes. However, if you override one you must override all.
24079  */
24080
24081
24082 /**
24083  * g_output_stream_close_finish:
24084  * @stream: a #GOutputStream.
24085  * @result: a #GAsyncResult.
24086  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24087  *
24088  * Closes an output stream.
24089  *
24090  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24091  */
24092
24093
24094 /**
24095  * g_output_stream_flush:
24096  * @stream: a #GOutputStream.
24097  * @cancellable: (allow-none): optional cancellable object
24098  * @error: location to store the error occurring, or %NULL to ignore
24099  *
24100  * Forces a write of all user-space buffered data for the given
24101  * @stream. Will block during the operation. Closing the stream will
24102  * implicitly cause a flush.
24103  *
24104  * This function is optional for inherited classes.
24105  *
24106  * If @cancellable is not %NULL, then the operation can be cancelled by
24107  * triggering the cancellable object from another thread. If the operation
24108  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24109  *
24110  * Returns: %TRUE on success, %FALSE on error
24111  */
24112
24113
24114 /**
24115  * g_output_stream_flush_async:
24116  * @stream: a #GOutputStream.
24117  * @io_priority: the io priority of the request.
24118  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24119  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24120  * @user_data: (closure): the data to pass to callback function
24121  *
24122  * Forces an asynchronous write of all user-space buffered data for
24123  * the given @stream.
24124  * For behaviour details see g_output_stream_flush().
24125  *
24126  * When the operation is finished @callback will be
24127  * called. You can then call g_output_stream_flush_finish() to get the
24128  * result of the operation.
24129  */
24130
24131
24132 /**
24133  * g_output_stream_flush_finish:
24134  * @stream: a #GOutputStream.
24135  * @result: a GAsyncResult.
24136  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24137  *
24138  * Finishes flushing an output stream.
24139  *
24140  * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24141  */
24142
24143
24144 /**
24145  * g_output_stream_has_pending:
24146  * @stream: a #GOutputStream.
24147  *
24148  * Checks if an ouput stream has pending actions.
24149  *
24150  * Returns: %TRUE if @stream has pending actions.
24151  */
24152
24153
24154 /**
24155  * g_output_stream_is_closed:
24156  * @stream: a #GOutputStream.
24157  *
24158  * Checks if an output stream has already been closed.
24159  *
24160  * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24161  */
24162
24163
24164 /**
24165  * g_output_stream_is_closing:
24166  * @stream: a #GOutputStream.
24167  *
24168  * Checks if an output stream is being closed. This can be
24169  * used inside e.g. a flush implementation to see if the
24170  * flush (or other i/o operation) is called from within
24171  * the closing operation.
24172  *
24173  * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24174  * Since: 2.24
24175  */
24176
24177
24178 /**
24179  * g_output_stream_set_pending:
24180  * @stream: a #GOutputStream.
24181  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24182  *
24183  * Sets @stream to have actions pending. If the pending flag is
24184  * already set or @stream is closed, it will return %FALSE and set
24185  * @error.
24186  *
24187  * Returns: %TRUE if pending was previously unset and is now set.
24188  */
24189
24190
24191 /**
24192  * g_output_stream_splice:
24193  * @stream: a #GOutputStream.
24194  * @source: a #GInputStream.
24195  * @flags: a set of #GOutputStreamSpliceFlags.
24196  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24197  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24198  *
24199  * Splices an input stream into an output stream.
24200  *
24201  * 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.
24202  */
24203
24204
24205 /**
24206  * g_output_stream_splice_async:
24207  * @stream: a #GOutputStream.
24208  * @source: a #GInputStream.
24209  * @flags: a set of #GOutputStreamSpliceFlags.
24210  * @io_priority: the io priority of the request.
24211  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24212  * @callback: (scope async): a #GAsyncReadyCallback.
24213  * @user_data: (closure): user data passed to @callback.
24214  *
24215  * Splices a stream asynchronously.
24216  * When the operation is finished @callback will be called.
24217  * You can then call g_output_stream_splice_finish() to get the
24218  * result of the operation.
24219  *
24220  * For the synchronous, blocking version of this function, see
24221  * g_output_stream_splice().
24222  */
24223
24224
24225 /**
24226  * g_output_stream_splice_finish:
24227  * @stream: a #GOutputStream.
24228  * @result: a #GAsyncResult.
24229  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24230  *
24231  * Finishes an asynchronous stream splice operation.
24232  *
24233  * 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.
24234  */
24235
24236
24237 /**
24238  * g_output_stream_write:
24239  * @stream: a #GOutputStream.
24240  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24241  * @count: the number of bytes to write
24242  * @cancellable: (allow-none): optional cancellable object
24243  * @error: location to store the error occurring, or %NULL to ignore
24244  *
24245  * Tries to write @count bytes from @buffer into the stream. Will block
24246  * during the operation.
24247  *
24248  * If count is 0, returns 0 and does nothing. A value of @count
24249  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24250  *
24251  * On success, the number of bytes written to the stream is returned.
24252  * It is not an error if this is not the same as the requested size, as it
24253  * can happen e.g. on a partial I/O error, or if there is not enough
24254  * storage in the stream. All writes block until at least one byte
24255  * is written or an error occurs; 0 is never returned (unless
24256  * @count is 0).
24257  *
24258  * If @cancellable is not %NULL, then the operation can be cancelled by
24259  * triggering the cancellable object from another thread. If the operation
24260  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24261  * operation was partially finished when the operation was cancelled the
24262  * partial result will be returned, without an error.
24263  *
24264  * On error -1 is returned and @error is set accordingly.
24265  *
24266  * Virtual: write_fn
24267  * Returns: Number of bytes written, or -1 on error
24268  */
24269
24270
24271 /**
24272  * g_output_stream_write_all:
24273  * @stream: a #GOutputStream.
24274  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24275  * @count: the number of bytes to write
24276  * @bytes_written: (out): location to store the number of bytes that was written to the stream
24277  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24278  * @error: location to store the error occurring, or %NULL to ignore
24279  *
24280  * Tries to write @count bytes from @buffer into the stream. Will block
24281  * during the operation.
24282  *
24283  * This function is similar to g_output_stream_write(), except it tries to
24284  * write as many bytes as requested, only stopping on an error.
24285  *
24286  * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24287  * is set to @count.
24288  *
24289  * If there is an error during the operation %FALSE is returned and @error
24290  * is set to indicate the error status, @bytes_written is updated to contain
24291  * the number of bytes written into the stream before the error occurred.
24292  *
24293  * Returns: %TRUE on success, %FALSE if there was an error
24294  */
24295
24296
24297 /**
24298  * g_output_stream_write_async:
24299  * @stream: A #GOutputStream.
24300  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24301  * @count: the number of bytes to write
24302  * @io_priority: the io priority of the request.
24303  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24304  * @callback: (scope async): callback to call when the request is satisfied
24305  * @user_data: (closure): the data to pass to callback function
24306  *
24307  * Request an asynchronous write of @count bytes from @buffer into
24308  * the stream. When the operation is finished @callback will be called.
24309  * You can then call g_output_stream_write_finish() to get the result of the
24310  * operation.
24311  *
24312  * During an async request no other sync and async calls are allowed,
24313  * and will result in %G_IO_ERROR_PENDING errors.
24314  *
24315  * A value of @count larger than %G_MAXSSIZE will cause a
24316  * %G_IO_ERROR_INVALID_ARGUMENT error.
24317  *
24318  * On success, the number of bytes written will be passed to the
24319  * @callback. It is not an error if this is not the same as the
24320  * requested size, as it can happen e.g. on a partial I/O error,
24321  * but generally we try to write as many bytes as requested.
24322  *
24323  * You are guaranteed that this method will never fail with
24324  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24325  * method will just wait until this changes.
24326  *
24327  * Any outstanding I/O request with higher priority (lower numerical
24328  * value) will be executed before an outstanding request with lower
24329  * priority. Default priority is %G_PRIORITY_DEFAULT.
24330  *
24331  * The asyncronous methods have a default fallback that uses threads
24332  * to implement asynchronicity, so they are optional for inheriting
24333  * classes. However, if you override one you must override all.
24334  *
24335  * For the synchronous, blocking version of this function, see
24336  * g_output_stream_write().
24337  */
24338
24339
24340 /**
24341  * g_output_stream_write_bytes:
24342  * @stream: a #GOutputStream.
24343  * @bytes: the #GBytes to write
24344  * @cancellable: (allow-none): optional cancellable object
24345  * @error: location to store the error occurring, or %NULL to ignore
24346  *
24347  * Tries to write the data from @bytes into the stream. Will block
24348  * during the operation.
24349  *
24350  * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24351  * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24352  *
24353  * On success, the number of bytes written to the stream is returned.
24354  * It is not an error if this is not the same as the requested size, as it
24355  * can happen e.g. on a partial I/O error, or if there is not enough
24356  * storage in the stream. All writes block until at least one byte
24357  * is written or an error occurs; 0 is never returned (unless
24358  * the size of @bytes is 0).
24359  *
24360  * If @cancellable is not %NULL, then the operation can be cancelled by
24361  * triggering the cancellable object from another thread. If the operation
24362  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24363  * operation was partially finished when the operation was cancelled the
24364  * partial result will be returned, without an error.
24365  *
24366  * On error -1 is returned and @error is set accordingly.
24367  *
24368  * Returns: Number of bytes written, or -1 on error
24369  */
24370
24371
24372 /**
24373  * g_output_stream_write_bytes_async:
24374  * @stream: A #GOutputStream.
24375  * @bytes: The bytes to write
24376  * @io_priority: the io priority of the request.
24377  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24378  * @callback: (scope async): callback to call when the request is satisfied
24379  * @user_data: (closure): the data to pass to callback function
24380  *
24381  * Request an asynchronous write of the data in @bytes to the stream.
24382  * When the operation is finished @callback will be called. You can
24383  * then call g_output_stream_write_bytes_finish() to get the result of
24384  * the operation.
24385  *
24386  * During an async request no other sync and async calls are allowed,
24387  * and will result in %G_IO_ERROR_PENDING errors.
24388  *
24389  * A #GBytes larger than %G_MAXSSIZE will cause a
24390  * %G_IO_ERROR_INVALID_ARGUMENT error.
24391  *
24392  * On success, the number of bytes written will be passed to the
24393  * @callback. It is not an error if this is not the same as the
24394  * requested size, as it can happen e.g. on a partial I/O error,
24395  * but generally we try to write as many bytes as requested.
24396  *
24397  * You are guaranteed that this method will never fail with
24398  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24399  * method will just wait until this changes.
24400  *
24401  * Any outstanding I/O request with higher priority (lower numerical
24402  * value) will be executed before an outstanding request with lower
24403  * priority. Default priority is %G_PRIORITY_DEFAULT.
24404  *
24405  * For the synchronous, blocking version of this function, see
24406  * g_output_stream_write_bytes().
24407  */
24408
24409
24410 /**
24411  * g_output_stream_write_bytes_finish:
24412  * @stream: a #GOutputStream.
24413  * @result: a #GAsyncResult.
24414  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24415  *
24416  * Finishes a stream write-from-#GBytes operation.
24417  *
24418  * Returns: a #gssize containing the number of bytes written to the stream.
24419  */
24420
24421
24422 /**
24423  * g_output_stream_write_finish:
24424  * @stream: a #GOutputStream.
24425  * @result: a #GAsyncResult.
24426  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24427  *
24428  * Finishes a stream write operation.
24429  *
24430  * Returns: a #gssize containing the number of bytes written to the stream.
24431  */
24432
24433
24434 /**
24435  * g_permission_acquire:
24436  * @permission: a #GPermission instance
24437  * @cancellable: (allow-none): a #GCancellable, or %NULL
24438  * @error: a pointer to a %NULL #GError, or %NULL
24439  *
24440  * Attempts to acquire the permission represented by @permission.
24441  *
24442  * The precise method by which this happens depends on the permission
24443  * and the underlying authentication mechanism.  A simple example is
24444  * that a dialog may appear asking the user to enter their password.
24445  *
24446  * You should check with g_permission_get_can_acquire() before calling
24447  * this function.
24448  *
24449  * If the permission is acquired then %TRUE is returned.  Otherwise,
24450  * %FALSE is returned and @error is set appropriately.
24451  *
24452  * This call is blocking, likely for a very long time (in the case that
24453  * user interaction is required).  See g_permission_acquire_async() for
24454  * the non-blocking version.
24455  *
24456  * Returns: %TRUE if the permission was successfully acquired
24457  * Since: 2.26
24458  */
24459
24460
24461 /**
24462  * g_permission_acquire_async:
24463  * @permission: a #GPermission instance
24464  * @cancellable: (allow-none): a #GCancellable, or %NULL
24465  * @callback: the #GAsyncReadyCallback to call when done
24466  * @user_data: the user data to pass to @callback
24467  *
24468  * Attempts to acquire the permission represented by @permission.
24469  *
24470  * This is the first half of the asynchronous version of
24471  * g_permission_acquire().
24472  *
24473  * Since: 2.26
24474  */
24475
24476
24477 /**
24478  * g_permission_acquire_finish:
24479  * @permission: a #GPermission instance
24480  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24481  * @error: a pointer to a %NULL #GError, or %NULL
24482  *
24483  * Collects the result of attempting to acquire the permission
24484  * represented by @permission.
24485  *
24486  * This is the second half of the asynchronous version of
24487  * g_permission_acquire().
24488  *
24489  * Returns: %TRUE if the permission was successfully acquired
24490  * Since: 2.26
24491  */
24492
24493
24494 /**
24495  * g_permission_get_allowed:
24496  * @permission: a #GPermission instance
24497  *
24498  * Gets the value of the 'allowed' property.  This property is %TRUE if
24499  * the caller currently has permission to perform the action that
24500  * @permission represents the permission to perform.
24501  *
24502  * Returns: the value of the 'allowed' property
24503  * Since: 2.26
24504  */
24505
24506
24507 /**
24508  * g_permission_get_can_acquire:
24509  * @permission: a #GPermission instance
24510  *
24511  * Gets the value of the 'can-acquire' property.  This property is %TRUE
24512  * if it is generally possible to acquire the permission by calling
24513  * g_permission_acquire().
24514  *
24515  * Returns: the value of the 'can-acquire' property
24516  * Since: 2.26
24517  */
24518
24519
24520 /**
24521  * g_permission_get_can_release:
24522  * @permission: a #GPermission instance
24523  *
24524  * Gets the value of the 'can-release' property.  This property is %TRUE
24525  * if it is generally possible to release the permission by calling
24526  * g_permission_release().
24527  *
24528  * Returns: the value of the 'can-release' property
24529  * Since: 2.26
24530  */
24531
24532
24533 /**
24534  * g_permission_impl_update:
24535  * @permission: a #GPermission instance
24536  * @allowed: the new value for the 'allowed' property
24537  * @can_acquire: the new value for the 'can-acquire' property
24538  * @can_release: the new value for the 'can-release' property
24539  *
24540  * This function is called by the #GPermission implementation to update
24541  * the properties of the permission.  You should never call this
24542  * function except from a #GPermission implementation.
24543  *
24544  * GObject notify signals are generated, as appropriate.
24545  *
24546  * Since: 2.26
24547  */
24548
24549
24550 /**
24551  * g_permission_release:
24552  * @permission: a #GPermission instance
24553  * @cancellable: (allow-none): a #GCancellable, or %NULL
24554  * @error: a pointer to a %NULL #GError, or %NULL
24555  *
24556  * Attempts to release the permission represented by @permission.
24557  *
24558  * The precise method by which this happens depends on the permission
24559  * and the underlying authentication mechanism.  In most cases the
24560  * permission will be dropped immediately without further action.
24561  *
24562  * You should check with g_permission_get_can_release() before calling
24563  * this function.
24564  *
24565  * If the permission is released then %TRUE is returned.  Otherwise,
24566  * %FALSE is returned and @error is set appropriately.
24567  *
24568  * This call is blocking, likely for a very long time (in the case that
24569  * user interaction is required).  See g_permission_release_async() for
24570  * the non-blocking version.
24571  *
24572  * Returns: %TRUE if the permission was successfully released
24573  * Since: 2.26
24574  */
24575
24576
24577 /**
24578  * g_permission_release_async:
24579  * @permission: a #GPermission instance
24580  * @cancellable: (allow-none): a #GCancellable, or %NULL
24581  * @callback: the #GAsyncReadyCallback to call when done
24582  * @user_data: the user data to pass to @callback
24583  *
24584  * Attempts to release the permission represented by @permission.
24585  *
24586  * This is the first half of the asynchronous version of
24587  * g_permission_release().
24588  *
24589  * Since: 2.26
24590  */
24591
24592
24593 /**
24594  * g_permission_release_finish:
24595  * @permission: a #GPermission instance
24596  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24597  * @error: a pointer to a %NULL #GError, or %NULL
24598  *
24599  * Collects the result of attempting to release the permission
24600  * represented by @permission.
24601  *
24602  * This is the second half of the asynchronous version of
24603  * g_permission_release().
24604  *
24605  * Returns: %TRUE if the permission was successfully released
24606  * Since: 2.26
24607  */
24608
24609
24610 /**
24611  * g_poll_file_monitor_new:
24612  * @file: a #GFile.
24613  *
24614  * Polls @file for changes.
24615  *
24616  * Returns: a new #GFileMonitor for the given #GFile.
24617  */
24618
24619
24620 /**
24621  * g_pollable_input_stream_can_poll:
24622  * @stream: a #GPollableInputStream.
24623  *
24624  * Checks if @stream is actually pollable. Some classes may implement
24625  * #GPollableInputStream but have only certain instances of that class
24626  * be pollable. If this method returns %FALSE, then the behavior of
24627  * other #GPollableInputStream methods is undefined.
24628  *
24629  * For any given stream, the value returned by this method is constant;
24630  * a stream cannot switch from pollable to non-pollable or vice versa.
24631  *
24632  * Returns: %TRUE if @stream is pollable, %FALSE if not.
24633  * Since: 2.28
24634  */
24635
24636
24637 /**
24638  * g_pollable_input_stream_create_source:
24639  * @stream: a #GPollableInputStream.
24640  * @cancellable: (allow-none): a #GCancellable, or %NULL
24641  *
24642  * Creates a #GSource that triggers when @stream can be read, or
24643  * @cancellable is triggered or an error occurs. The callback on the
24644  * source is of the #GPollableSourceFunc type.
24645  *
24646  * As with g_pollable_input_stream_is_readable(), it is possible that
24647  * the stream may not actually be readable even after the source
24648  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24649  * rather than g_input_stream_read() from the callback.
24650  *
24651  * Returns: (transfer full): a new #GSource
24652  * Since: 2.28
24653  */
24654
24655
24656 /**
24657  * g_pollable_input_stream_is_readable:
24658  * @stream: a #GPollableInputStream.
24659  *
24660  * Checks if @stream can be read.
24661  *
24662  * Note that some stream types may not be able to implement this 100%
24663  * reliably, and it is possible that a call to g_input_stream_read()
24664  * after this returns %TRUE would still block. To guarantee
24665  * non-blocking behavior, you should always use
24666  * g_pollable_input_stream_read_nonblocking(), which will return a
24667  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24668  *
24669  * 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.
24670  * Since: 2.28
24671  */
24672
24673
24674 /**
24675  * g_pollable_input_stream_read_nonblocking:
24676  * @stream: a #GPollableInputStream
24677  * @buffer: a buffer to read data into (which should be at least @count bytes long).
24678  * @count: the number of bytes you want to read
24679  * @cancellable: (allow-none): a #GCancellable, or %NULL
24680  * @error: #GError for error reporting, or %NULL to ignore.
24681  *
24682  * Attempts to read up to @count bytes from @stream into @buffer, as
24683  * with g_input_stream_read(). If @stream is not currently readable,
24684  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24685  * use g_pollable_input_stream_create_source() to create a #GSource
24686  * that will be triggered when @stream is readable.
24687  *
24688  * Note that since this method never blocks, you cannot actually
24689  * use @cancellable to cancel it. However, it will return an error
24690  * if @cancellable has already been cancelled when you call, which
24691  * may happen if you call this method after a source triggers due
24692  * to having been cancelled.
24693  *
24694  * Virtual: read_nonblocking
24695  * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24696  */
24697
24698
24699 /**
24700  * g_pollable_output_stream_can_poll:
24701  * @stream: a #GPollableOutputStream.
24702  *
24703  * Checks if @stream is actually pollable. Some classes may implement
24704  * #GPollableOutputStream but have only certain instances of that
24705  * class be pollable. If this method returns %FALSE, then the behavior
24706  * of other #GPollableOutputStream methods is undefined.
24707  *
24708  * For any given stream, the value returned by this method is constant;
24709  * a stream cannot switch from pollable to non-pollable or vice versa.
24710  *
24711  * Returns: %TRUE if @stream is pollable, %FALSE if not.
24712  * Since: 2.28
24713  */
24714
24715
24716 /**
24717  * g_pollable_output_stream_create_source:
24718  * @stream: a #GPollableOutputStream.
24719  * @cancellable: (allow-none): a #GCancellable, or %NULL
24720  *
24721  * Creates a #GSource that triggers when @stream can be written, or
24722  * @cancellable is triggered or an error occurs. The callback on the
24723  * source is of the #GPollableSourceFunc type.
24724  *
24725  * As with g_pollable_output_stream_is_writable(), it is possible that
24726  * the stream may not actually be writable even after the source
24727  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
24728  * rather than g_output_stream_write() from the callback.
24729  *
24730  * Returns: (transfer full): a new #GSource
24731  * Since: 2.28
24732  */
24733
24734
24735 /**
24736  * g_pollable_output_stream_is_writable:
24737  * @stream: a #GPollableOutputStream.
24738  *
24739  * Checks if @stream can be written.
24740  *
24741  * Note that some stream types may not be able to implement this 100%
24742  * reliably, and it is possible that a call to g_output_stream_write()
24743  * after this returns %TRUE would still block. To guarantee
24744  * non-blocking behavior, you should always use
24745  * g_pollable_output_stream_write_nonblocking(), which will return a
24746  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24747  *
24748  * 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.
24749  * Since: 2.28
24750  */
24751
24752
24753 /**
24754  * g_pollable_output_stream_write_nonblocking:
24755  * @stream: a #GPollableOutputStream
24756  * @buffer: (array length=count) (element-type guint8): a buffer to write data from
24757  * @count: the number of bytes you want to write
24758  * @cancellable: (allow-none): a #GCancellable, or %NULL
24759  * @error: #GError for error reporting, or %NULL to ignore.
24760  *
24761  * Attempts to write up to @count bytes from @buffer to @stream, as
24762  * with g_output_stream_write(). If @stream is not currently writable,
24763  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24764  * use g_pollable_output_stream_create_source() to create a #GSource
24765  * that will be triggered when @stream is writable.
24766  *
24767  * Note that since this method never blocks, you cannot actually
24768  * use @cancellable to cancel it. However, it will return an error
24769  * if @cancellable has already been cancelled when you call, which
24770  * may happen if you call this method after a source triggers due
24771  * to having been cancelled.
24772  *
24773  * Virtual: write_nonblocking
24774  * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24775  */
24776
24777
24778 /**
24779  * g_pollable_source_new:
24780  * @pollable_stream: the stream associated with the new source
24781  *
24782  * Utility method for #GPollableInputStream and #GPollableOutputStream
24783  * implementations. Creates a new #GSource that expects a callback of
24784  * type #GPollableSourceFunc. The new source does not actually do
24785  * anything on its own; use g_source_add_child_source() to add other
24786  * sources to it to cause it to trigger.
24787  *
24788  * Returns: (transfer full): the new #GSource.
24789  * Since: 2.28
24790  */
24791
24792
24793 /**
24794  * g_pollable_source_new_full:
24795  * @pollable_stream: (type GObject): the stream associated with the new source
24796  * @child_source: (allow-none): optional child source to attach
24797  * @cancellable: (allow-none): optional #GCancellable to attach
24798  *
24799  * Utility method for #GPollableInputStream and #GPollableOutputStream
24800  * implementations. Creates a new #GSource, as with
24801  * g_pollable_source_new(), but also attaching @child_source (with a
24802  * dummy callback), and @cancellable, if they are non-%NULL.
24803  *
24804  * Returns: (transfer full): the new #GSource.
24805  * Since: 2.34
24806  */
24807
24808
24809 /**
24810  * g_pollable_stream_read:
24811  * @stream: a #GInputStream
24812  * @buffer: a buffer to read data into
24813  * @count: the number of bytes to read
24814  * @blocking: whether to do blocking I/O
24815  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24816  * @error: location to store the error occurring, or %NULL to ignore
24817  *
24818  * Tries to read from @stream, as with g_input_stream_read() (if
24819  * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
24820  * (if @blocking is %FALSE). This can be used to more easily share
24821  * code between blocking and non-blocking implementations of a method.
24822  *
24823  * If @blocking is %FALSE, then @stream must be a
24824  * #GPollableInputStream for which g_pollable_input_stream_can_poll()
24825  * returns %TRUE, or else the behavior is undefined. If @blocking is
24826  * %TRUE, then @stream does not need to be a #GPollableInputStream.
24827  *
24828  * Returns: the number of bytes read, or -1 on error.
24829  * Since: 2.34
24830  */
24831
24832
24833 /**
24834  * g_pollable_stream_write:
24835  * @stream: a #GOutputStream.
24836  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24837  * @count: the number of bytes to write
24838  * @blocking: whether to do blocking I/O
24839  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24840  * @error: location to store the error occurring, or %NULL to ignore
24841  *
24842  * Tries to write to @stream, as with g_output_stream_write() (if
24843  * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
24844  * (if @blocking is %FALSE). This can be used to more easily share
24845  * code between blocking and non-blocking implementations of a method.
24846  *
24847  * If @blocking is %FALSE, then @stream must be a
24848  * #GPollableOutputStream for which
24849  * g_pollable_output_stream_can_poll() returns %TRUE or else the
24850  * behavior is undefined. If @blocking is %TRUE, then @stream does not
24851  * need to be a #GPollableOutputStream.
24852  *
24853  * Returns: the number of bytes written, or -1 on error.
24854  * Since: 2.34
24855  */
24856
24857
24858 /**
24859  * g_pollable_stream_write_all:
24860  * @stream: a #GOutputStream.
24861  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24862  * @count: the number of bytes to write
24863  * @blocking: whether to do blocking I/O
24864  * @bytes_written: (out): location to store the number of bytes that was written to the stream
24865  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24866  * @error: location to store the error occurring, or %NULL to ignore
24867  *
24868  * Tries to write @count bytes to @stream, as with
24869  * g_output_stream_write_all(), but using g_pollable_stream_write()
24870  * rather than g_output_stream_write().
24871  *
24872  * On a successful write of @count bytes, %TRUE is returned, and
24873  * @bytes_written is set to @count.
24874  *
24875  * If there is an error during the operation (including
24876  * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
24877  * returned and @error is set to indicate the error status,
24878  * @bytes_written is updated to contain the number of bytes written
24879  * into the stream before the error occurred.
24880  *
24881  * As with g_pollable_stream_write(), if @blocking is %FALSE, then
24882  * @stream must be a #GPollableOutputStream for which
24883  * g_pollable_output_stream_can_poll() returns %TRUE or else the
24884  * behavior is undefined. If @blocking is %TRUE, then @stream does not
24885  * need to be a #GPollableOutputStream.
24886  *
24887  * Returns: %TRUE on success, %FALSE if there was an error
24888  * Since: 2.34
24889  */
24890
24891
24892 /**
24893  * g_proxy_address_get_destination_hostname:
24894  * @proxy: a #GProxyAddress
24895  *
24896  * Gets @proxy's destination hostname; that is, the name of the host
24897  * that will be connected to via the proxy, not the name of the proxy
24898  * itself.
24899  *
24900  * Returns: the @proxy's destination hostname
24901  * Since: 2.26
24902  */
24903
24904
24905 /**
24906  * g_proxy_address_get_destination_port:
24907  * @proxy: a #GProxyAddress
24908  *
24909  * Gets @proxy's destination port; that is, the port on the
24910  * destination host that will be connected to via the proxy, not the
24911  * port number of the proxy itself.
24912  *
24913  * Returns: the @proxy's destination port
24914  * Since: 2.26
24915  */
24916
24917
24918 /**
24919  * g_proxy_address_get_destination_protocol:
24920  * @proxy: a #GProxyAddress
24921  *
24922  * Gets the protocol that is being spoken to the destination
24923  * server; eg, "http" or "ftp".
24924  *
24925  * Returns: the @proxy's destination protocol
24926  * Since: 2.34
24927  */
24928
24929
24930 /**
24931  * g_proxy_address_get_password:
24932  * @proxy: a #GProxyAddress
24933  *
24934  * Gets @proxy's password.
24935  *
24936  * Returns: the @proxy's password
24937  * Since: 2.26
24938  */
24939
24940
24941 /**
24942  * g_proxy_address_get_protocol:
24943  * @proxy: a #GProxyAddress
24944  *
24945  * Gets @proxy's protocol. eg, "socks" or "http"
24946  *
24947  * Returns: the @proxy's protocol
24948  * Since: 2.26
24949  */
24950
24951
24952 /**
24953  * g_proxy_address_get_uri:
24954  * @proxy: a #GProxyAddress
24955  *
24956  * Gets the proxy URI that @proxy was constructed from.
24957  *
24958  * Returns: the @proxy's URI, or %NULL if unknown
24959  * Since: 2.34
24960  */
24961
24962
24963 /**
24964  * g_proxy_address_get_username:
24965  * @proxy: a #GProxyAddress
24966  *
24967  * Gets @proxy's username.
24968  *
24969  * Returns: the @proxy's username
24970  * Since: 2.26
24971  */
24972
24973
24974 /**
24975  * g_proxy_address_new:
24976  * @inetaddr: The proxy server #GInetAddress.
24977  * @port: The proxy server port.
24978  * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
24979  * @dest_hostname: The destination hostname the the proxy should tunnel to.
24980  * @dest_port: The destination port to tunnel to.
24981  * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
24982  * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
24983  *
24984  * Creates a new #GProxyAddress for @inetaddr with @protocol that should
24985  * tunnel through @dest_hostname and @dest_port.
24986  *
24987  * (Note that this method doesn't set the #GProxyAddress:uri or
24988  * #GProxyAddress:destination-protocol fields; use g_object_new()
24989  * directly if you want to set those.)
24990  *
24991  * Returns: a new #GProxyAddress
24992  * Since: 2.26
24993  */
24994
24995
24996 /**
24997  * g_proxy_connect:
24998  * @proxy: a #GProxy
24999  * @connection: a #GIOStream
25000  * @proxy_address: a #GProxyAddress
25001  * @cancellable: (allow-none): a #GCancellable
25002  * @error: return #GError
25003  *
25004  * Given @connection to communicate with a proxy (eg, a
25005  * #GSocketConnection that is connected to the proxy server), this
25006  * does the necessary handshake to connect to @proxy_address, and if
25007  * required, wraps the #GIOStream to handle proxy payload.
25008  *
25009  * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25010  * Since: 2.26
25011  */
25012
25013
25014 /**
25015  * g_proxy_connect_async:
25016  * @proxy: a #GProxy
25017  * @connection: a #GIOStream
25018  * @proxy_address: a #GProxyAddress
25019  * @cancellable: (allow-none): a #GCancellable
25020  * @callback: (scope async): a #GAsyncReadyCallback
25021  * @user_data: (closure): callback data
25022  *
25023  * Asynchronous version of g_proxy_connect().
25024  *
25025  * Since: 2.26
25026  */
25027
25028
25029 /**
25030  * g_proxy_connect_finish:
25031  * @proxy: a #GProxy
25032  * @result: a #GAsyncResult
25033  * @error: return #GError
25034  *
25035  * See g_proxy_connect().
25036  *
25037  * Returns: (transfer full): a #GIOStream.
25038  * Since: 2.26
25039  */
25040
25041
25042 /**
25043  * g_proxy_get_default_for_protocol:
25044  * @protocol: the proxy protocol name (e.g. http, socks, etc)
25045  *
25046  * Lookup "gio-proxy" extension point for a proxy implementation that supports
25047  * specified protocol.
25048  *
25049  * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25050  * Since: 2.26
25051  */
25052
25053
25054 /**
25055  * g_proxy_resolver_get_default:
25056  *
25057  * Gets the default #GProxyResolver for the system.
25058  *
25059  * Returns: (transfer none): the default #GProxyResolver.
25060  * Since: 2.26
25061  */
25062
25063
25064 /**
25065  * g_proxy_resolver_is_supported:
25066  * @resolver: a #GProxyResolver
25067  *
25068  * Checks if @resolver can be used on this system. (This is used
25069  * internally; g_proxy_resolver_get_default() will only return a proxy
25070  * resolver that returns %TRUE for this method.)
25071  *
25072  * Returns: %TRUE if @resolver is supported.
25073  * Since: 2.26
25074  */
25075
25076
25077 /**
25078  * g_proxy_resolver_lookup:
25079  * @resolver: a #GProxyResolver
25080  * @uri: a URI representing the destination to connect to
25081  * @cancellable: (allow-none): a #GCancellable, or %NULL
25082  * @error: return location for a #GError, or %NULL
25083  *
25084  * Looks into the system proxy configuration to determine what proxy,
25085  * if any, to use to connect to @uri. The returned proxy URIs are of the
25086  * form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
25087  * or <literal>direct://</literal>, where &lt;protocol&gt; could be
25088  * http, rtsp, socks or other proxying protocol.
25089  *
25090  * If you don't know what network protocol is being used on the
25091  * socket, you should use <literal>none</literal> as the URI protocol.
25092  * In this case, the resolver might still return a generic proxy type
25093  * (such as SOCKS), but would not return protocol-specific proxy types
25094  * (such as http).
25095  *
25096  * <literal>direct://</literal> is used when no proxy is needed.
25097  * Direct connection should not be attempted unless it is part of the
25098  * returned array of proxies.
25099  *
25100  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25101  * Since: 2.26
25102  */
25103
25104
25105 /**
25106  * g_proxy_resolver_lookup_async:
25107  * @resolver: a #GProxyResolver
25108  * @uri: a URI representing the destination to connect to
25109  * @cancellable: (allow-none): a #GCancellable, or %NULL
25110  * @callback: (scope async): callback to call after resolution completes
25111  * @user_data: (closure): data for @callback
25112  *
25113  * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25114  * details.
25115  *
25116  * Since: 2.26
25117  */
25118
25119
25120 /**
25121  * g_proxy_resolver_lookup_finish:
25122  * @resolver: a #GProxyResolver
25123  * @result: the result passed to your #GAsyncReadyCallback
25124  * @error: return location for a #GError, or %NULL
25125  *
25126  * Call this function to obtain the array of proxy URIs when
25127  * g_proxy_resolver_lookup_async() is complete. See
25128  * g_proxy_resolver_lookup() for more details.
25129  *
25130  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25131  * Since: 2.26
25132  */
25133
25134
25135 /**
25136  * g_proxy_supports_hostname:
25137  * @proxy: a #GProxy
25138  *
25139  * Some proxy protocols expect to be passed a hostname, which they
25140  * will resolve to an IP address themselves. Others, like SOCKS4, do
25141  * not allow this. This function will return %FALSE if @proxy is
25142  * implementing such a protocol. When %FALSE is returned, the caller
25143  * should resolve the destination hostname first, and then pass a
25144  * #GProxyAddress containing the stringified IP address to
25145  * g_proxy_connect() or g_proxy_connect_async().
25146  *
25147  * Returns: %TRUE if hostname resolution is supported.
25148  * Since: 2.26
25149  */
25150
25151
25152 /**
25153  * g_remote_action_group_activate_action_full:
25154  * @remote: a #GDBusActionGroup
25155  * @action_name: the name of the action to activate
25156  * @parameter: (allow-none): the optional parameter to the activation
25157  * @platform_data: the platform data to send
25158  *
25159  * Activates the remote action.
25160  *
25161  * This is the same as g_action_group_activate_action() except that it
25162  * allows for provision of "platform data" to be sent along with the
25163  * activation request.  This typically contains details such as the user
25164  * interaction timestamp or startup notification information.
25165  *
25166  * @platform_data must be non-%NULL and must have the type
25167  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25168  *
25169  * Since: 2.32
25170  */
25171
25172
25173 /**
25174  * g_remote_action_group_change_action_state_full:
25175  * @remote: a #GRemoteActionGroup
25176  * @action_name: the name of the action to change the state of
25177  * @value: the new requested value for the state
25178  * @platform_data: the platform data to send
25179  *
25180  * Changes the state of a remote action.
25181  *
25182  * This is the same as g_action_group_change_action_state() except that
25183  * it allows for provision of "platform data" to be sent along with the
25184  * state change request.  This typically contains details such as the
25185  * user interaction timestamp or startup notification information.
25186  *
25187  * @platform_data must be non-%NULL and must have the type
25188  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25189  *
25190  * Since: 2.32
25191  */
25192
25193
25194 /**
25195  * g_resolver_error_quark:
25196  *
25197  * Gets the #GResolver Error Quark.
25198  *
25199  * Returns: a #GQuark.
25200  * Since: 2.22
25201  */
25202
25203
25204 /**
25205  * g_resolver_free_addresses: (skip)
25206  * @addresses: a #GList of #GInetAddress
25207  *
25208  * Frees @addresses (which should be the return value from
25209  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25210  * (This is a convenience method; you can also simply free the results
25211  * by hand.)
25212  *
25213  * Since: 2.22
25214  */
25215
25216
25217 /**
25218  * g_resolver_free_targets: (skip)
25219  * @targets: a #GList of #GSrvTarget
25220  *
25221  * Frees @targets (which should be the return value from
25222  * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25223  * (This is a convenience method; you can also simply free the
25224  * results by hand.)
25225  *
25226  * Since: 2.22
25227  */
25228
25229
25230 /**
25231  * g_resolver_get_default:
25232  *
25233  * Gets the default #GResolver. You should unref it when you are done
25234  * with it. #GResolver may use its reference count as a hint about how
25235  * many threads it should allocate for concurrent DNS resolutions.
25236  *
25237  * Returns: (transfer full): the default #GResolver.
25238  * Since: 2.22
25239  */
25240
25241
25242 /**
25243  * g_resolver_lookup_by_address:
25244  * @resolver: a #GResolver
25245  * @address: the address to reverse-resolve
25246  * @cancellable: (allow-none): a #GCancellable, or %NULL
25247  * @error: return location for a #GError, or %NULL
25248  *
25249  * Synchronously reverse-resolves @address to determine its
25250  * associated hostname.
25251  *
25252  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25253  * a value from #GResolverError.
25254  *
25255  * If @cancellable is non-%NULL, it can be used to cancel the
25256  * operation, in which case @error (if non-%NULL) will be set to
25257  * %G_IO_ERROR_CANCELLED.
25258  *
25259  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25260  * Since: 2.22
25261  */
25262
25263
25264 /**
25265  * g_resolver_lookup_by_address_async:
25266  * @resolver: a #GResolver
25267  * @address: the address to reverse-resolve
25268  * @cancellable: (allow-none): a #GCancellable, or %NULL
25269  * @callback: (scope async): callback to call after resolution completes
25270  * @user_data: (closure): data for @callback
25271  *
25272  * Begins asynchronously reverse-resolving @address to determine its
25273  * associated hostname, and eventually calls @callback, which must
25274  * call g_resolver_lookup_by_address_finish() to get the final result.
25275  *
25276  * Since: 2.22
25277  */
25278
25279
25280 /**
25281  * g_resolver_lookup_by_address_finish:
25282  * @resolver: a #GResolver
25283  * @result: the result passed to your #GAsyncReadyCallback
25284  * @error: return location for a #GError, or %NULL
25285  *
25286  * Retrieves the result of a previous call to
25287  * g_resolver_lookup_by_address_async().
25288  *
25289  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25290  * a value from #GResolverError. If the operation was cancelled,
25291  * @error will be set to %G_IO_ERROR_CANCELLED.
25292  *
25293  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25294  * Since: 2.22
25295  */
25296
25297
25298 /**
25299  * g_resolver_lookup_by_name:
25300  * @resolver: a #GResolver
25301  * @hostname: the hostname to look up
25302  * @cancellable: (allow-none): a #GCancellable, or %NULL
25303  * @error: return location for a #GError, or %NULL
25304  *
25305  * Synchronously resolves @hostname to determine its associated IP
25306  * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25307  * the textual form of an IP address (in which case this just becomes
25308  * a wrapper around g_inet_address_new_from_string()).
25309  *
25310  * On success, g_resolver_lookup_by_name() will return a #GList of
25311  * #GInetAddress, sorted in order of preference and guaranteed to not
25312  * contain duplicates. That is, if using the result to connect to
25313  * @hostname, you should attempt to connect to the first address
25314  * first, then the second if the first fails, etc. If you are using
25315  * the result to listen on a socket, it is appropriate to add each
25316  * result using e.g. g_socket_listener_add_address().
25317  *
25318  * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25319  * value from #GResolverError.
25320  *
25321  * If @cancellable is non-%NULL, it can be used to cancel the
25322  * operation, in which case @error (if non-%NULL) will be set to
25323  * %G_IO_ERROR_CANCELLED.
25324  *
25325  * If you are planning to connect to a socket on the resolved IP
25326  * address, it may be easier to create a #GNetworkAddress and use its
25327  * #GSocketConnectable interface.
25328  *
25329  * 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.)
25330  * Since: 2.22
25331  */
25332
25333
25334 /**
25335  * g_resolver_lookup_by_name_async:
25336  * @resolver: a #GResolver
25337  * @hostname: the hostname to look up the address of
25338  * @cancellable: (allow-none): a #GCancellable, or %NULL
25339  * @callback: (scope async): callback to call after resolution completes
25340  * @user_data: (closure): data for @callback
25341  *
25342  * Begins asynchronously resolving @hostname to determine its
25343  * associated IP address(es), and eventually calls @callback, which
25344  * must call g_resolver_lookup_by_name_finish() to get the result.
25345  * See g_resolver_lookup_by_name() for more details.
25346  *
25347  * Since: 2.22
25348  */
25349
25350
25351 /**
25352  * g_resolver_lookup_by_name_finish:
25353  * @resolver: a #GResolver
25354  * @result: the result passed to your #GAsyncReadyCallback
25355  * @error: return location for a #GError, or %NULL
25356  *
25357  * Retrieves the result of a call to
25358  * g_resolver_lookup_by_name_async().
25359  *
25360  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25361  * a value from #GResolverError. If the operation was cancelled,
25362  * @error will be set to %G_IO_ERROR_CANCELLED.
25363  *
25364  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25365  * Since: 2.22
25366  */
25367
25368
25369 /**
25370  * g_resolver_lookup_records:
25371  * @resolver: a #GResolver
25372  * @rrname: the DNS name to lookup the record for
25373  * @record_type: the type of DNS record to lookup
25374  * @cancellable: (allow-none): a #GCancellable, or %NULL
25375  * @error: return location for a #GError, or %NULL
25376  *
25377  * Synchronously performs a DNS record lookup for the given @rrname and returns
25378  * a list of records as #GVariant tuples. See #GResolverRecordType for
25379  * information on what the records contain for each @record_type.
25380  *
25381  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25382  * a value from #GResolverError.
25383  *
25384  * If @cancellable is non-%NULL, it can be used to cancel the
25385  * operation, in which case @error (if non-%NULL) will be set to
25386  * %G_IO_ERROR_CANCELLED.
25387  *
25388  * 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.)
25389  * Since: 2.34
25390  */
25391
25392
25393 /**
25394  * g_resolver_lookup_records_async:
25395  * @resolver: a #GResolver
25396  * @rrname: the DNS name to lookup the record for
25397  * @record_type: the type of DNS record to lookup
25398  * @cancellable: (allow-none): a #GCancellable, or %NULL
25399  * @callback: (scope async): callback to call after resolution completes
25400  * @user_data: (closure): data for @callback
25401  *
25402  * Begins asynchronously performing a DNS lookup for the given
25403  * @rrname, and eventually calls @callback, which must call
25404  * g_resolver_lookup_records_finish() to get the final result. See
25405  * g_resolver_lookup_records() for more details.
25406  *
25407  * Since: 2.34
25408  */
25409
25410
25411 /**
25412  * g_resolver_lookup_records_finish:
25413  * @resolver: a #GResolver
25414  * @result: the result passed to your #GAsyncReadyCallback
25415  * @error: return location for a #GError, or %NULL
25416  *
25417  * Retrieves the result of a previous call to
25418  * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25419  * tuples. See #GResolverRecordType for information on what the records contain.
25420  *
25421  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25422  * a value from #GResolverError. If the operation was cancelled,
25423  * @error will be set to %G_IO_ERROR_CANCELLED.
25424  *
25425  * 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.)
25426  * Since: 2.34
25427  */
25428
25429
25430 /**
25431  * g_resolver_lookup_service:
25432  * @resolver: a #GResolver
25433  * @service: the service type to look up (eg, "ldap")
25434  * @protocol: the networking protocol to use for @service (eg, "tcp")
25435  * @domain: the DNS domain to look up the service in
25436  * @cancellable: (allow-none): a #GCancellable, or %NULL
25437  * @error: return location for a #GError, or %NULL
25438  *
25439  * Synchronously performs a DNS SRV lookup for the given @service and
25440  * @protocol in the given @domain and returns an array of #GSrvTarget.
25441  * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25442  * @service and @protocol arguments <emphasis>do not</emphasis>
25443  * include the leading underscore that appears in the actual DNS
25444  * entry.
25445  *
25446  * On success, g_resolver_lookup_service() will return a #GList of
25447  * #GSrvTarget, sorted in order of preference. (That is, you should
25448  * attempt to connect to the first target first, then the second if
25449  * the first fails, etc.)
25450  *
25451  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25452  * a value from #GResolverError.
25453  *
25454  * If @cancellable is non-%NULL, it can be used to cancel the
25455  * operation, in which case @error (if non-%NULL) will be set to
25456  * %G_IO_ERROR_CANCELLED.
25457  *
25458  * If you are planning to connect to the service, it is usually easier
25459  * to create a #GNetworkService and use its #GSocketConnectable
25460  * interface.
25461  *
25462  * 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.)
25463  * Since: 2.22
25464  */
25465
25466
25467 /**
25468  * g_resolver_lookup_service_async:
25469  * @resolver: a #GResolver
25470  * @service: the service type to look up (eg, "ldap")
25471  * @protocol: the networking protocol to use for @service (eg, "tcp")
25472  * @domain: the DNS domain to look up the service in
25473  * @cancellable: (allow-none): a #GCancellable, or %NULL
25474  * @callback: (scope async): callback to call after resolution completes
25475  * @user_data: (closure): data for @callback
25476  *
25477  * Begins asynchronously performing a DNS SRV lookup for the given
25478  * @service and @protocol in the given @domain, and eventually calls
25479  * @callback, which must call g_resolver_lookup_service_finish() to
25480  * get the final result. See g_resolver_lookup_service() for more
25481  * details.
25482  *
25483  * Since: 2.22
25484  */
25485
25486
25487 /**
25488  * g_resolver_lookup_service_finish:
25489  * @resolver: a #GResolver
25490  * @result: the result passed to your #GAsyncReadyCallback
25491  * @error: return location for a #GError, or %NULL
25492  *
25493  * Retrieves the result of a previous call to
25494  * g_resolver_lookup_service_async().
25495  *
25496  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25497  * a value from #GResolverError. If the operation was cancelled,
25498  * @error will be set to %G_IO_ERROR_CANCELLED.
25499  *
25500  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25501  * Since: 2.22
25502  */
25503
25504
25505 /**
25506  * g_resolver_set_default:
25507  * @resolver: the new default #GResolver
25508  *
25509  * Sets @resolver to be the application's default resolver (reffing
25510  * @resolver, and unreffing the previous default resolver, if any).
25511  * Future calls to g_resolver_get_default() will return this resolver.
25512  *
25513  * This can be used if an application wants to perform any sort of DNS
25514  * caching or "pinning"; it can implement its own #GResolver that
25515  * calls the original default resolver for DNS operations, and
25516  * implements its own cache policies on top of that, and then set
25517  * itself as the default resolver for all later code to use.
25518  *
25519  * Since: 2.22
25520  */
25521
25522
25523 /**
25524  * g_resource_enumerate_children:
25525  * @resource: A #GResource
25526  * @path: A pathname inside the resource
25527  * @lookup_flags: A #GResourceLookupFlags
25528  * @error: return location for a #GError, or %NULL
25529  *
25530  * Returns all the names of children at the specified @path in the resource.
25531  * The return result is a %NULL terminated list of strings which should
25532  * be released with g_strfreev().
25533  *
25534  * @lookup_flags controls the behaviour of the lookup.
25535  *
25536  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25537  * Since: 2.32
25538  */
25539
25540
25541 /**
25542  * g_resource_error_quark:
25543  *
25544  * Gets the #GResource Error Quark.
25545  *
25546  * Returns: a #GQuark
25547  * Since: 2.32
25548  */
25549
25550
25551 /**
25552  * g_resource_get_info:
25553  * @resource: A #GResource
25554  * @path: A pathname inside the resource
25555  * @lookup_flags: A #GResourceLookupFlags
25556  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25557  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25558  * @error: return location for a #GError, or %NULL
25559  *
25560  * Looks for a file at the specified @path in the resource and
25561  * if found returns information about it.
25562  *
25563  * @lookup_flags controls the behaviour of the lookup.
25564  *
25565  * Returns: %TRUE if the file was found. %FALSE if there were errors
25566  * Since: 2.32
25567  */
25568
25569
25570 /**
25571  * g_resource_load:
25572  * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25573  * @error: return location for a #GError, or %NULL
25574  *
25575  * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25576  * you to query it for data.
25577  *
25578  * If you want to use this resource in the global resource namespace you need
25579  * to register it with g_resources_register().
25580  *
25581  * Returns: (transfer full): a new #GResource, or %NULL on error
25582  * Since: 2.32
25583  */
25584
25585
25586 /**
25587  * g_resource_lookup_data:
25588  * @resource: A #GResource
25589  * @path: A pathname inside the resource
25590  * @lookup_flags: A #GResourceLookupFlags
25591  * @error: return location for a #GError, or %NULL
25592  *
25593  * Looks for a file at the specified @path in the resource and
25594  * returns a #GBytes that lets you directly access the data in
25595  * memory.
25596  *
25597  * The data is always followed by a zero byte, so you
25598  * can safely use the data as a C string. However, that byte
25599  * is not included in the size of the GBytes.
25600  *
25601  * For uncompressed resource files this is a pointer directly into
25602  * the resource bundle, which is typically in some readonly data section
25603  * in the program binary. For compressed files we allocate memory on
25604  * the heap and automatically uncompress the data.
25605  *
25606  * @lookup_flags controls the behaviour of the lookup.
25607  *
25608  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25609  * Since: 2.32
25610  */
25611
25612
25613 /**
25614  * g_resource_new_from_data:
25615  * @data: A #GBytes
25616  * @error: return location for a #GError, or %NULL
25617  *
25618  * Creates a GResource from a reference to the binary resource bundle.
25619  * This will keep a reference to @data while the resource lives, so
25620  * the data should not be modified or freed.
25621  *
25622  * If you want to use this resource in the global resource namespace you need
25623  * to register it with g_resources_register().
25624  *
25625  * Returns: (transfer full): a new #GResource, or %NULL on error
25626  * Since: 2.32
25627  */
25628
25629
25630 /**
25631  * g_resource_open_stream:
25632  * @resource: A #GResource
25633  * @path: A pathname inside the resource
25634  * @lookup_flags: A #GResourceLookupFlags
25635  * @error: return location for a #GError, or %NULL
25636  *
25637  * Looks for a file at the specified @path in the resource and
25638  * returns a #GInputStream that lets you read the data.
25639  *
25640  * @lookup_flags controls the behaviour of the lookup.
25641  *
25642  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25643  * Since: 2.32
25644  */
25645
25646
25647 /**
25648  * g_resource_ref:
25649  * @resource: A #GResource
25650  *
25651  * Atomically increments the reference count of @array by one. This
25652  * function is MT-safe and may be called from any thread.
25653  *
25654  * Returns: The passed in #GResource
25655  * Since: 2.32
25656  */
25657
25658
25659 /**
25660  * g_resource_unref:
25661  * @resource: A #GResource
25662  *
25663  * Atomically decrements the reference count of @resource by one. If the
25664  * reference count drops to 0, all memory allocated by the array is
25665  * released. This function is MT-safe and may be called from any
25666  * thread.
25667  *
25668  * Since: 2.32
25669  */
25670
25671
25672 /**
25673  * g_resources_enumerate_children:
25674  * @path: A pathname inside the resource
25675  * @lookup_flags: A #GResourceLookupFlags
25676  * @error: return location for a #GError, or %NULL
25677  *
25678  * Returns all the names of children at the specified @path in the set of
25679  * globally registred resources.
25680  * The return result is a %NULL terminated list of strings which should
25681  * be released with g_strfreev().
25682  *
25683  * @lookup_flags controls the behaviour of the lookup.
25684  *
25685  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25686  * Since: 2.32
25687  */
25688
25689
25690 /**
25691  * g_resources_get_info:
25692  * @path: A pathname inside the resource
25693  * @lookup_flags: A #GResourceLookupFlags
25694  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25695  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25696  * @error: return location for a #GError, or %NULL
25697  *
25698  * Looks for a file at the specified @path in the set of
25699  * globally registred resources and if found returns information about it.
25700  *
25701  * @lookup_flags controls the behaviour of the lookup.
25702  *
25703  * Returns: %TRUE if the file was found. %FALSE if there were errors
25704  * Since: 2.32
25705  */
25706
25707
25708 /**
25709  * g_resources_lookup_data:
25710  * @path: A pathname inside the resource
25711  * @lookup_flags: A #GResourceLookupFlags
25712  * @error: return location for a #GError, or %NULL
25713  *
25714  * Looks for a file at the specified @path in the set of
25715  * globally registred resources and returns a #GBytes that
25716  * lets you directly access the data in memory.
25717  *
25718  * The data is always followed by a zero byte, so you
25719  * can safely use the data as a C string. However, that byte
25720  * is not included in the size of the GBytes.
25721  *
25722  * For uncompressed resource files this is a pointer directly into
25723  * the resource bundle, which is typically in some readonly data section
25724  * in the program binary. For compressed files we allocate memory on
25725  * the heap and automatically uncompress the data.
25726  *
25727  * @lookup_flags controls the behaviour of the lookup.
25728  *
25729  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25730  * Since: 2.32
25731  */
25732
25733
25734 /**
25735  * g_resources_open_stream:
25736  * @path: A pathname inside the resource
25737  * @lookup_flags: A #GResourceLookupFlags
25738  * @error: return location for a #GError, or %NULL
25739  *
25740  * Looks for a file at the specified @path in the set of
25741  * globally registred resources and returns a #GInputStream
25742  * that lets you read the data.
25743  *
25744  * @lookup_flags controls the behaviour of the lookup.
25745  *
25746  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25747  * Since: 2.32
25748  */
25749
25750
25751 /**
25752  * g_resources_register:
25753  * @resource: A #GResource
25754  *
25755  * Registers the resource with the process-global set of resources.
25756  * Once a resource is registered the files in it can be accessed
25757  * with the global resource lookup functions like g_resources_lookup_data().
25758  *
25759  * Since: 2.32
25760  */
25761
25762
25763 /**
25764  * g_resources_unregister:
25765  * @resource: A #GResource
25766  *
25767  * Unregisters the resource from the process-global set of resources.
25768  *
25769  * Since: 2.32
25770  */
25771
25772
25773 /**
25774  * g_seekable_can_seek:
25775  * @seekable: a #GSeekable.
25776  *
25777  * Tests if the stream supports the #GSeekableIface.
25778  *
25779  * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
25780  */
25781
25782
25783 /**
25784  * g_seekable_can_truncate:
25785  * @seekable: a #GSeekable.
25786  *
25787  * Tests if the stream can be truncated.
25788  *
25789  * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
25790  */
25791
25792
25793 /**
25794  * g_seekable_seek:
25795  * @seekable: a #GSeekable.
25796  * @offset: a #goffset.
25797  * @type: a #GSeekType.
25798  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25799  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25800  *
25801  * Seeks in the stream by the given @offset, modified by @type.
25802  *
25803  * If @cancellable is not %NULL, then the operation can be cancelled by
25804  * triggering the cancellable object from another thread. If the operation
25805  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
25806  *
25807  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25808  */
25809
25810
25811 /**
25812  * g_seekable_tell:
25813  * @seekable: a #GSeekable.
25814  *
25815  * Tells the current position within the stream.
25816  *
25817  * Returns: the offset from the beginning of the buffer.
25818  */
25819
25820
25821 /**
25822  * g_seekable_truncate:
25823  * @seekable: a #GSeekable.
25824  * @offset: a #goffset.
25825  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25826  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25827  *
25828  * Truncates a stream with a given #offset.
25829  *
25830  * If @cancellable is not %NULL, then the operation can be cancelled by
25831  * triggering the cancellable object from another thread. If the operation
25832  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25833  * operation was partially finished when the operation was cancelled the
25834  * partial result will be returned, without an error.
25835  *
25836  * Virtual: truncate_fn
25837  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25838  */
25839
25840
25841 /**
25842  * g_settings_apply:
25843  * @settings: a #GSettings instance
25844  *
25845  * Applies any changes that have been made to the settings.  This
25846  * function does nothing unless @settings is in 'delay-apply' mode;
25847  * see g_settings_delay().  In the normal case settings are always
25848  * applied immediately.
25849  */
25850
25851
25852 /**
25853  * g_settings_backend_changed:
25854  * @backend: a #GSettingsBackend implementation
25855  * @key: the name of the key
25856  * @origin_tag: the origin tag
25857  *
25858  * Signals that a single key has possibly changed.  Backend
25859  * implementations should call this if a key has possibly changed its
25860  * value.
25861  *
25862  * @key must be a valid key (ie starting with a slash, not containing
25863  * '//', and not ending with a slash).
25864  *
25865  * The implementation must call this function during any call to
25866  * g_settings_backend_write(), before the call returns (except in the
25867  * case that no keys are actually changed and it cares to detect this
25868  * fact).  It may not rely on the existence of a mainloop for
25869  * dispatching the signal later.
25870  *
25871  * The implementation may call this function at any other time it likes
25872  * in response to other events (such as changes occurring outside of the
25873  * program).  These calls may originate from a mainloop or may originate
25874  * in response to any other action (including from calls to
25875  * g_settings_backend_write()).
25876  *
25877  * In the case that this call is in response to a call to
25878  * g_settings_backend_write() then @origin_tag must be set to the same
25879  * value that was passed to that call.
25880  *
25881  * Since: 2.26
25882  */
25883
25884
25885 /**
25886  * g_settings_backend_changed_tree:
25887  * @backend: a #GSettingsBackend implementation
25888  * @tree: a #GTree containing the changes
25889  * @origin_tag: the origin tag
25890  *
25891  * This call is a convenience wrapper.  It gets the list of changes from
25892  * @tree, computes the longest common prefix and calls
25893  * g_settings_backend_changed().
25894  *
25895  * Since: 2.26
25896  */
25897
25898
25899 /**
25900  * g_settings_backend_flatten_tree:
25901  * @tree: a #GTree containing the changes
25902  * @path: (out): the location to save the path
25903  * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
25904  * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
25905  *
25906  * Calculate the longest common prefix of all keys in a tree and write
25907  * out an array of the key names relative to that prefix and,
25908  * optionally, the value to store at each of those keys.
25909  *
25910  * You must free the value returned in @path, @keys and @values using
25911  * g_free().  You should not attempt to free or unref the contents of
25912  * @keys or @values.
25913  *
25914  * Since: 2.26
25915  */
25916
25917
25918 /**
25919  * g_settings_backend_get_default:
25920  *
25921  * Returns the default #GSettingsBackend. It is possible to override
25922  * the default by setting the <envar>GSETTINGS_BACKEND</envar>
25923  * environment variable to the name of a settings backend.
25924  *
25925  * The user gets a reference to the backend.
25926  *
25927  * Returns: (transfer full): the default #GSettingsBackend
25928  * Since: 2.28
25929  */
25930
25931
25932 /**
25933  * g_settings_backend_keys_changed:
25934  * @backend: a #GSettingsBackend implementation
25935  * @path: the path containing the changes
25936  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
25937  * @origin_tag: the origin tag
25938  *
25939  * Signals that a list of keys have possibly changed.  Backend
25940  * implementations should call this if keys have possibly changed their
25941  * values.
25942  *
25943  * @path must be a valid path (ie starting and ending with a slash and
25944  * not containing '//').  Each string in @items must form a valid key
25945  * name when @path is prefixed to it (ie: each item must not start or
25946  * end with '/' and must not contain '//').
25947  *
25948  * The meaning of this signal is that any of the key names resulting
25949  * from the contatenation of @path with each item in @items may have
25950  * changed.
25951  *
25952  * The same rules for when notifications must occur apply as per
25953  * g_settings_backend_changed().  These two calls can be used
25954  * interchangeably if exactly one item has changed (although in that
25955  * case g_settings_backend_changed() is definitely preferred).
25956  *
25957  * For efficiency reasons, the implementation should strive for @path to
25958  * be as long as possible (ie: the longest common prefix of all of the
25959  * keys that were changed) but this is not strictly required.
25960  *
25961  * Since: 2.26
25962  */
25963
25964
25965 /**
25966  * g_settings_backend_path_changed:
25967  * @backend: a #GSettingsBackend implementation
25968  * @path: the path containing the changes
25969  * @origin_tag: the origin tag
25970  *
25971  * Signals that all keys below a given path may have possibly changed.
25972  * Backend implementations should call this if an entire path of keys
25973  * have possibly changed their values.
25974  *
25975  * @path must be a valid path (ie starting and ending with a slash and
25976  * not containing '//').
25977  *
25978  * The meaning of this signal is that any of the key which has a name
25979  * starting with @path may have changed.
25980  *
25981  * The same rules for when notifications must occur apply as per
25982  * g_settings_backend_changed().  This call might be an appropriate
25983  * reasponse to a 'reset' call but implementations are also free to
25984  * explicitly list the keys that were affected by that call if they can
25985  * easily do so.
25986  *
25987  * For efficiency reasons, the implementation should strive for @path to
25988  * be as long as possible (ie: the longest common prefix of all of the
25989  * keys that were changed) but this is not strictly required.  As an
25990  * example, if this function is called with the path of "/" then every
25991  * single key in the application will be notified of a possible change.
25992  *
25993  * Since: 2.26
25994  */
25995
25996
25997 /**
25998  * g_settings_backend_path_writable_changed:
25999  * @backend: a #GSettingsBackend implementation
26000  * @path: the name of the path
26001  *
26002  * Signals that the writability of all keys below a given path may have
26003  * changed.
26004  *
26005  * Since GSettings performs no locking operations for itself, this call
26006  * will always be made in response to external events.
26007  *
26008  * Since: 2.26
26009  */
26010
26011
26012 /**
26013  * g_settings_backend_writable_changed:
26014  * @backend: a #GSettingsBackend implementation
26015  * @key: the name of the key
26016  *
26017  * Signals that the writability of a single key has possibly changed.
26018  *
26019  * Since GSettings performs no locking operations for itself, this call
26020  * will always be made in response to external events.
26021  *
26022  * Since: 2.26
26023  */
26024
26025
26026 /**
26027  * g_settings_bind:
26028  * @settings: a #GSettings object
26029  * @key: the key to bind
26030  * @object: (type GObject.Object): a #GObject
26031  * @property: the name of the property to bind
26032  * @flags: flags for the binding
26033  *
26034  * Create a binding between the @key in the @settings object
26035  * and the property @property of @object.
26036  *
26037  * The binding uses the default GIO mapping functions to map
26038  * between the settings and property values. These functions
26039  * handle booleans, numeric types and string types in a
26040  * straightforward way. Use g_settings_bind_with_mapping() if
26041  * you need a custom mapping, or map between types that are not
26042  * supported by the default mapping functions.
26043  *
26044  * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26045  * function also establishes a binding between the writability of
26046  * @key and the "sensitive" property of @object (if @object has
26047  * a boolean property by that name). See g_settings_bind_writable()
26048  * for more details about writable bindings.
26049  *
26050  * Note that the lifecycle of the binding is tied to the object,
26051  * and that you can have only one binding per object property.
26052  * If you bind the same property twice on the same object, the second
26053  * binding overrides the first one.
26054  *
26055  * Since: 2.26
26056  */
26057
26058
26059 /**
26060  * g_settings_bind_with_mapping: (skip)
26061  * @settings: a #GSettings object
26062  * @key: the key to bind
26063  * @object: (type GObject.Object): a #GObject
26064  * @property: the name of the property to bind
26065  * @flags: flags for the binding
26066  * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26067  * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26068  * @user_data: data that gets passed to @get_mapping and @set_mapping
26069  * @destroy: #GDestroyNotify function for @user_data
26070  *
26071  * Create a binding between the @key in the @settings object
26072  * and the property @property of @object.
26073  *
26074  * The binding uses the provided mapping functions to map between
26075  * settings and property values.
26076  *
26077  * Note that the lifecycle of the binding is tied to the object,
26078  * and that you can have only one binding per object property.
26079  * If you bind the same property twice on the same object, the second
26080  * binding overrides the first one.
26081  *
26082  * Since: 2.26
26083  */
26084
26085
26086 /**
26087  * g_settings_bind_writable:
26088  * @settings: a #GSettings object
26089  * @key: the key to bind
26090  * @object: (type GObject.Object): a #GObject
26091  * @property: the name of a boolean property to bind
26092  * @inverted: whether to 'invert' the value
26093  *
26094  * Create a binding between the writability of @key in the
26095  * @settings object and the property @property of @object.
26096  * The property must be boolean; "sensitive" or "visible"
26097  * properties of widgets are the most likely candidates.
26098  *
26099  * Writable bindings are always uni-directional; changes of the
26100  * writability of the setting will be propagated to the object
26101  * property, not the other way.
26102  *
26103  * When the @inverted argument is %TRUE, the binding inverts the
26104  * value as it passes from the setting to the object, i.e. @property
26105  * will be set to %TRUE if the key is <emphasis>not</emphasis>
26106  * writable.
26107  *
26108  * Note that the lifecycle of the binding is tied to the object,
26109  * and that you can have only one binding per object property.
26110  * If you bind the same property twice on the same object, the second
26111  * binding overrides the first one.
26112  *
26113  * Since: 2.26
26114  */
26115
26116
26117 /**
26118  * g_settings_create_action:
26119  * @settings: a #GSettings
26120  * @key: the name of a key in @settings
26121  *
26122  * Creates a #GAction corresponding to a given #GSettings key.
26123  *
26124  * The action has the same name as the key.
26125  *
26126  * The value of the key becomes the state of the action and the action
26127  * is enabled when the key is writable.  Changing the state of the
26128  * action results in the key being written to.  Changes to the value or
26129  * writability of the key cause appropriate change notifications to be
26130  * emitted for the action.
26131  *
26132  * For boolean-valued keys, action activations take no parameter and
26133  * result in the toggling of the value.  For all other types,
26134  * activations take the new value for the key (which must have the
26135  * correct type).
26136  *
26137  * Returns: (transfer full): a new #GAction
26138  * Since: 2.32
26139  */
26140
26141
26142 /**
26143  * g_settings_delay:
26144  * @settings: a #GSettings object
26145  *
26146  * Changes the #GSettings object into 'delay-apply' mode. In this
26147  * mode, changes to @settings are not immediately propagated to the
26148  * backend, but kept locally until g_settings_apply() is called.
26149  *
26150  * Since: 2.26
26151  */
26152
26153
26154 /**
26155  * g_settings_get:
26156  * @settings: a #GSettings object
26157  * @key: the key to get the value for
26158  * @format: a #GVariant format string
26159  * @...: arguments as per @format
26160  *
26161  * Gets the value that is stored at @key in @settings.
26162  *
26163  * A convenience function that combines g_settings_get_value() with
26164  * g_variant_get().
26165  *
26166  * It is a programmer error to give a @key that isn't contained in the
26167  * schema for @settings or for the #GVariantType of @format to mismatch
26168  * the type given in the schema.
26169  *
26170  * Since: 2.26
26171  */
26172
26173
26174 /**
26175  * g_settings_get_boolean:
26176  * @settings: a #GSettings object
26177  * @key: the key to get the value for
26178  *
26179  * Gets the value that is stored at @key in @settings.
26180  *
26181  * A convenience variant of g_settings_get() for booleans.
26182  *
26183  * It is a programmer error to give a @key that isn't specified as
26184  * having a boolean type in the schema for @settings.
26185  *
26186  * Returns: a boolean
26187  * Since: 2.26
26188  */
26189
26190
26191 /**
26192  * g_settings_get_child:
26193  * @settings: a #GSettings object
26194  * @name: the name of the 'child' schema
26195  *
26196  * Creates a 'child' settings object which has a base path of
26197  * <replaceable>base-path</replaceable>/@name, where
26198  * <replaceable>base-path</replaceable> is the base path of @settings.
26199  *
26200  * The schema for the child settings object must have been declared
26201  * in the schema of @settings using a <tag class="starttag">child</tag> element.
26202  *
26203  * Returns: (transfer full): a 'child' settings object
26204  * Since: 2.26
26205  */
26206
26207
26208 /**
26209  * g_settings_get_double:
26210  * @settings: a #GSettings object
26211  * @key: the key to get the value for
26212  *
26213  * Gets the value that is stored at @key in @settings.
26214  *
26215  * A convenience variant of g_settings_get() for doubles.
26216  *
26217  * It is a programmer error to give a @key that isn't specified as
26218  * having a 'double' type in the schema for @settings.
26219  *
26220  * Returns: a double
26221  * Since: 2.26
26222  */
26223
26224
26225 /**
26226  * g_settings_get_enum:
26227  * @settings: a #GSettings object
26228  * @key: the key to get the value for
26229  *
26230  * Gets the value that is stored in @settings for @key and converts it
26231  * to the enum value that it represents.
26232  *
26233  * In order to use this function the type of the value must be a string
26234  * and it must be marked in the schema file as an enumerated type.
26235  *
26236  * It is a programmer error to give a @key that isn't contained in the
26237  * schema for @settings or is not marked as an enumerated type.
26238  *
26239  * If the value stored in the configuration database is not a valid
26240  * value for the enumerated type then this function will return the
26241  * default value.
26242  *
26243  * Returns: the enum value
26244  * Since: 2.26
26245  */
26246
26247
26248 /**
26249  * g_settings_get_flags:
26250  * @settings: a #GSettings object
26251  * @key: the key to get the value for
26252  *
26253  * Gets the value that is stored in @settings for @key and converts it
26254  * to the flags value that it represents.
26255  *
26256  * In order to use this function the type of the value must be an array
26257  * of strings and it must be marked in the schema file as an flags type.
26258  *
26259  * It is a programmer error to give a @key that isn't contained in the
26260  * schema for @settings or is not marked as a flags type.
26261  *
26262  * If the value stored in the configuration database is not a valid
26263  * value for the flags type then this function will return the default
26264  * value.
26265  *
26266  * Returns: the flags value
26267  * Since: 2.26
26268  */
26269
26270
26271 /**
26272  * g_settings_get_has_unapplied:
26273  * @settings: a #GSettings object
26274  *
26275  * Returns whether the #GSettings object has any unapplied
26276  * changes.  This can only be the case if it is in 'delayed-apply' mode.
26277  *
26278  * Returns: %TRUE if @settings has unapplied changes
26279  * Since: 2.26
26280  */
26281
26282
26283 /**
26284  * g_settings_get_int:
26285  * @settings: a #GSettings object
26286  * @key: the key to get the value for
26287  *
26288  * Gets the value that is stored at @key in @settings.
26289  *
26290  * A convenience variant of g_settings_get() for 32-bit integers.
26291  *
26292  * It is a programmer error to give a @key that isn't specified as
26293  * having a int32 type in the schema for @settings.
26294  *
26295  * Returns: an integer
26296  * Since: 2.26
26297  */
26298
26299
26300 /**
26301  * g_settings_get_mapped:
26302  * @settings: a #GSettings object
26303  * @key: the key to get the value for
26304  * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26305  * @user_data: user data for @mapping
26306  *
26307  * Gets the value that is stored at @key in @settings, subject to
26308  * application-level validation/mapping.
26309  *
26310  * You should use this function when the application needs to perform
26311  * some processing on the value of the key (for example, parsing).  The
26312  * @mapping function performs that processing.  If the function
26313  * indicates that the processing was unsuccessful (due to a parse error,
26314  * for example) then the mapping is tried again with another value.
26315  *
26316  * This allows a robust 'fall back to defaults' behaviour to be
26317  * implemented somewhat automatically.
26318  *
26319  * The first value that is tried is the user's setting for the key.  If
26320  * the mapping function fails to map this value, other values may be
26321  * tried in an unspecified order (system or site defaults, translated
26322  * schema default values, untranslated schema default values, etc).
26323  *
26324  * If the mapping function fails for all possible values, one additional
26325  * attempt is made: the mapping function is called with a %NULL value.
26326  * If the mapping function still indicates failure at this point then
26327  * the application will be aborted.
26328  *
26329  * The result parameter for the @mapping function is pointed to a
26330  * #gpointer which is initially set to %NULL.  The same pointer is given
26331  * to each invocation of @mapping.  The final value of that #gpointer is
26332  * what is returned by this function.  %NULL is valid; it is returned
26333  * just as any other value would be.
26334  *
26335  * Returns: (transfer full): the result, which may be %NULL
26336  */
26337
26338
26339 /**
26340  * g_settings_get_range:
26341  * @settings: a #GSettings
26342  * @key: the key to query the range of
26343  *
26344  * Queries the range of a key.
26345  *
26346  * This function will return a #GVariant that fully describes the range
26347  * of values that are valid for @key.
26348  *
26349  * The type of #GVariant returned is <literal>(sv)</literal>.  The
26350  * string describes the type of range restriction in effect.  The type
26351  * and meaning of the value contained in the variant depends on the
26352  * string.
26353  *
26354  * If the string is <literal>'type'</literal> then the variant contains
26355  * an empty array.  The element type of that empty array is the expected
26356  * type of value and all values of that type are valid.
26357  *
26358  * If the string is <literal>'enum'</literal> then the variant contains
26359  * an array enumerating the possible values.  Each item in the array is
26360  * a possible valid value and no other values are valid.
26361  *
26362  * If the string is <literal>'flags'</literal> then the variant contains
26363  * an array.  Each item in the array is a value that may appear zero or
26364  * one times in an array to be used as the value for this key.  For
26365  * example, if the variant contained the array <literal>['x',
26366  * 'y']</literal> then the valid values for the key would be
26367  * <literal>[]</literal>, <literal>['x']</literal>,
26368  * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26369  * <literal>['y', 'x']</literal>.
26370  *
26371  * Finally, if the string is <literal>'range'</literal> then the variant
26372  * contains a pair of like-typed values -- the minimum and maximum
26373  * permissible values for this key.
26374  *
26375  * This information should not be used by normal programs.  It is
26376  * considered to be a hint for introspection purposes.  Normal programs
26377  * should already know what is permitted by their own schema.  The
26378  * format may change in any way in the future -- but particularly, new
26379  * forms may be added to the possibilities described above.
26380  *
26381  * It is a programmer error to give a @key that isn't contained in the
26382  * schema for @settings.
26383  *
26384  * You should free the returned value with g_variant_unref() when it is
26385  * no longer needed.
26386  *
26387  * Returns: a #GVariant describing the range
26388  * Since: 2.28
26389  */
26390
26391
26392 /**
26393  * g_settings_get_string:
26394  * @settings: a #GSettings object
26395  * @key: the key to get the value for
26396  *
26397  * Gets the value that is stored at @key in @settings.
26398  *
26399  * A convenience variant of g_settings_get() for strings.
26400  *
26401  * It is a programmer error to give a @key that isn't specified as
26402  * having a string type in the schema for @settings.
26403  *
26404  * Returns: a newly-allocated string
26405  * Since: 2.26
26406  */
26407
26408
26409 /**
26410  * g_settings_get_strv:
26411  * @settings: a #GSettings object
26412  * @key: the key to get the value for
26413  *
26414  * A convenience variant of g_settings_get() for string arrays.
26415  *
26416  * It is a programmer error to give a @key that isn't specified as
26417  * having an array of strings type in the schema for @settings.
26418  *
26419  * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26420  * Since: 2.26
26421  */
26422
26423
26424 /**
26425  * g_settings_get_uint:
26426  * @settings: a #GSettings object
26427  * @key: the key to get the value for
26428  *
26429  * Gets the value that is stored at @key in @settings.
26430  *
26431  * A convenience variant of g_settings_get() for 32-bit unsigned
26432  * integers.
26433  *
26434  * It is a programmer error to give a @key that isn't specified as
26435  * having a uint32 type in the schema for @settings.
26436  *
26437  * Returns: an unsigned integer
26438  * Since: 2.30
26439  */
26440
26441
26442 /**
26443  * g_settings_get_value:
26444  * @settings: a #GSettings object
26445  * @key: the key to get the value for
26446  *
26447  * Gets the value that is stored in @settings for @key.
26448  *
26449  * It is a programmer error to give a @key that isn't contained in the
26450  * schema for @settings.
26451  *
26452  * Returns: a new #GVariant
26453  * Since: 2.26
26454  */
26455
26456
26457 /**
26458  * g_settings_is_writable:
26459  * @settings: a #GSettings object
26460  * @name: the name of a key
26461  *
26462  * Finds out if a key can be written or not
26463  *
26464  * Returns: %TRUE if the key @name is writable
26465  * Since: 2.26
26466  */
26467
26468
26469 /**
26470  * g_settings_list_children:
26471  * @settings: a #GSettings object
26472  *
26473  * Gets the list of children on @settings.
26474  *
26475  * The list is exactly the list of strings for which it is not an error
26476  * to call g_settings_get_child().
26477  *
26478  * For GSettings objects that are lists, this value can change at any
26479  * time and you should connect to the "children-changed" signal to watch
26480  * for those changes.  Note that there is a race condition here: you may
26481  * request a child after listing it only for it to have been destroyed
26482  * in the meantime.  For this reason, g_settings_get_child() may return
26483  * %NULL even for a child that was listed by this function.
26484  *
26485  * For GSettings objects that are not lists, you should probably not be
26486  * calling this function from "normal" code (since you should already
26487  * know what children are in your schema).  This function may still be
26488  * useful there for introspection reasons, however.
26489  *
26490  * You should free the return value with g_strfreev() when you are done
26491  * with it.
26492  *
26493  * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26494  */
26495
26496
26497 /**
26498  * g_settings_list_keys:
26499  * @settings: a #GSettings object
26500  *
26501  * Introspects the list of keys on @settings.
26502  *
26503  * You should probably not be calling this function from "normal" code
26504  * (since you should already know what keys are in your schema).  This
26505  * function is intended for introspection reasons.
26506  *
26507  * You should free the return value with g_strfreev() when you are done
26508  * with it.
26509  *
26510  * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26511  */
26512
26513
26514 /**
26515  * g_settings_list_relocatable_schemas:
26516  *
26517  * Gets a list of the relocatable #GSettings schemas installed on the
26518  * system.  These are schemas that do not provide their own path.  It is
26519  * usual to instantiate these schemas directly, but if you want to you
26520  * can use g_settings_new_with_path() to specify the path.
26521  *
26522  * The output of this function, taken together with the output of
26523  * g_settings_list_schemas() represents the complete list of all
26524  * installed schemas.
26525  *
26526  * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available.  The list must not be modified or freed.
26527  * Since: 2.28
26528  */
26529
26530
26531 /**
26532  * g_settings_list_schemas:
26533  *
26534  * Gets a list of the #GSettings schemas installed on the system.  The
26535  * returned list is exactly the list of schemas for which you may call
26536  * g_settings_new() without adverse effects.
26537  *
26538  * This function does not list the schemas that do not provide their own
26539  * paths (ie: schemas for which you must use
26540  * g_settings_new_with_path()).  See
26541  * g_settings_list_relocatable_schemas() for that.
26542  *
26543  * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available.  The list must not be modified or freed.
26544  * Since: 2.26
26545  */
26546
26547
26548 /**
26549  * g_settings_new:
26550  * @schema_id: the id of the schema
26551  *
26552  * Creates a new #GSettings object with the schema specified by
26553  * @schema_id.
26554  *
26555  * Signals on the newly created #GSettings object will be dispatched
26556  * via the thread-default #GMainContext in effect at the time of the
26557  * call to g_settings_new().  The new #GSettings will hold a reference
26558  * on the context.  See g_main_context_push_thread_default().
26559  *
26560  * Returns: a new #GSettings object
26561  * Since: 2.26
26562  */
26563
26564
26565 /**
26566  * g_settings_new_full:
26567  * @schema: a #GSettingsSchema
26568  * @backend: (allow-none): a #GSettingsBackend
26569  * @path: (allow-none): the path to use
26570  *
26571  * Creates a new #GSettings object with a given schema, backend and
26572  * path.
26573  *
26574  * It should be extremely rare that you ever want to use this function.
26575  * It is made available for advanced use-cases (such as plugin systems
26576  * that want to provide access to schemas loaded from custom locations,
26577  * etc).
26578  *
26579  * At the most basic level, a #GSettings object is a pure composition of
26580  * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26581  * backend, and a #GMainContext to which signals are dispatched.
26582  *
26583  * This constructor therefore gives you full control over constructing
26584  * #GSettings instances.  The first 4 parameters are given directly as
26585  * @schema, @backend and @path, and the main context is taken from the
26586  * thread-default (as per g_settings_new()).
26587  *
26588  * If @backend is %NULL then the default backend is used.
26589  *
26590  * If @path is %NULL then the path from the schema is used.  It is an
26591  * error f @path is %NULL and the schema has no path of its own or if
26592  * @path is non-%NULL and not equal to the path that the schema does
26593  * have.
26594  *
26595  * Returns: a new #GSettings object
26596  * Since: 2.32
26597  */
26598
26599
26600 /**
26601  * g_settings_new_with_backend:
26602  * @schema_id: the id of the schema
26603  * @backend: the #GSettingsBackend to use
26604  *
26605  * Creates a new #GSettings object with the schema specified by
26606  * @schema_id and a given #GSettingsBackend.
26607  *
26608  * Creating a #GSettings object with a different backend allows accessing
26609  * settings from a database other than the usual one. For example, it may make
26610  * sense to pass a backend corresponding to the "defaults" settings database on
26611  * the system to get a settings object that modifies the system default
26612  * settings instead of the settings for this user.
26613  *
26614  * Returns: a new #GSettings object
26615  * Since: 2.26
26616  */
26617
26618
26619 /**
26620  * g_settings_new_with_backend_and_path:
26621  * @schema_id: the id of the schema
26622  * @backend: the #GSettingsBackend to use
26623  * @path: the path to use
26624  *
26625  * Creates a new #GSettings object with the schema specified by
26626  * @schema_id and a given #GSettingsBackend and path.
26627  *
26628  * This is a mix of g_settings_new_with_backend() and
26629  * g_settings_new_with_path().
26630  *
26631  * Returns: a new #GSettings object
26632  * Since: 2.26
26633  */
26634
26635
26636 /**
26637  * g_settings_new_with_path:
26638  * @schema_id: the id of the schema
26639  * @path: the path to use
26640  *
26641  * Creates a new #GSettings object with the relocatable schema specified
26642  * by @schema_id and a given path.
26643  *
26644  * You only need to do this if you want to directly create a settings
26645  * object with a schema that doesn't have a specified path of its own.
26646  * That's quite rare.
26647  *
26648  * It is a programmer error to call this function for a schema that
26649  * has an explicitly specified path.
26650  *
26651  * Returns: a new #GSettings object
26652  * Since: 2.26
26653  */
26654
26655
26656 /**
26657  * g_settings_range_check:
26658  * @settings: a #GSettings
26659  * @key: the key to check
26660  * @value: the value to check
26661  *
26662  * Checks if the given @value is of the correct type and within the
26663  * permitted range for @key.
26664  *
26665  * This API is not intended to be used by normal programs -- they should
26666  * already know what is permitted by their own schemas.  This API is
26667  * meant to be used by programs such as editors or commandline tools.
26668  *
26669  * It is a programmer error to give a @key that isn't contained in the
26670  * schema for @settings.
26671  *
26672  * Returns: %TRUE if @value is valid for @key
26673  * Since: 2.28
26674  */
26675
26676
26677 /**
26678  * g_settings_reset:
26679  * @settings: a #GSettings object
26680  * @key: the name of a key
26681  *
26682  * Resets @key to its default value.
26683  *
26684  * This call resets the key, as much as possible, to its default value.
26685  * That might the value specified in the schema or the one set by the
26686  * administrator.
26687  */
26688
26689
26690 /**
26691  * g_settings_revert:
26692  * @settings: a #GSettings instance
26693  *
26694  * Reverts all non-applied changes to the settings.  This function
26695  * does nothing unless @settings is in 'delay-apply' mode; see
26696  * g_settings_delay().  In the normal case settings are always applied
26697  * immediately.
26698  *
26699  * Change notifications will be emitted for affected keys.
26700  */
26701
26702
26703 /**
26704  * g_settings_schema_get_id:
26705  * @schema: a #GSettingsSchema
26706  *
26707  * Get the ID of @schema.
26708  *
26709  * Returns: (transfer none): the ID
26710  */
26711
26712
26713 /**
26714  * g_settings_schema_get_path:
26715  * @schema: a #GSettingsSchema
26716  *
26717  * Gets the path associated with @schema, or %NULL.
26718  *
26719  * Schemas may be single-instance or relocatable.  Single-instance
26720  * schemas correspond to exactly one set of keys in the backend
26721  * database: those located at the path returned by this function.
26722  *
26723  * Relocatable schemas can be referenced by other schemas and can
26724  * threfore describe multiple sets of keys at different locations.  For
26725  * relocatable schemas, this function will return %NULL.
26726  *
26727  * Returns: (transfer none): the path of the schema, or %NULL
26728  * Since: 2.32
26729  */
26730
26731
26732 /**
26733  * g_settings_schema_ref:
26734  * @schema: a #GSettingsSchema
26735  *
26736  * Increase the reference count of @schema, returning a new reference.
26737  *
26738  * Returns: a new reference to @schema
26739  * Since: 2.32
26740  */
26741
26742
26743 /**
26744  * g_settings_schema_source_get_default:
26745  *
26746  * Gets the default system schema source.
26747  *
26748  * This function is not required for normal uses of #GSettings but it
26749  * may be useful to authors of plugin management systems or to those who
26750  * want to introspect the content of schemas.
26751  *
26752  * If no schemas are installed, %NULL will be returned.
26753  *
26754  * The returned source may actually consist of multiple schema sources
26755  * from different directories, depending on which directories were given
26756  * in <envar>XDG_DATA_DIRS</envar> and
26757  * <envar>GSETTINGS_SCHEMA_DIR</envar>.  For this reason, all lookups
26758  * performed against the default source should probably be done
26759  * recursively.
26760  *
26761  * Returns: (transfer none): the default schema source
26762  * Since: 2.32
26763  */
26764
26765
26766 /**
26767  * g_settings_schema_source_lookup:
26768  * @source: a #GSettingsSchemaSource
26769  * @schema_id: a schema ID
26770  * @recursive: %TRUE if the lookup should be recursive
26771  *
26772  * Looks up a schema with the identifier @schema_id in @source.
26773  *
26774  * This function is not required for normal uses of #GSettings but it
26775  * may be useful to authors of plugin management systems or to those who
26776  * want to introspect the content of schemas.
26777  *
26778  * If the schema isn't found directly in @source and @recursive is %TRUE
26779  * then the parent sources will also be checked.
26780  *
26781  * If the schema isn't found, %NULL is returned.
26782  *
26783  * Returns: (transfer full): a new #GSettingsSchema
26784  * Since: 2.32
26785  */
26786
26787
26788 /**
26789  * g_settings_schema_source_new_from_directory:
26790  * @directory: the filename of a directory
26791  * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
26792  * @trusted: %TRUE, if the directory is trusted
26793  * @error: a pointer to a #GError pointer set to %NULL, or %NULL
26794  *
26795  * Attempts to create a new schema source corresponding to the contents
26796  * of the given directory.
26797  *
26798  * This function is not required for normal uses of #GSettings but it
26799  * may be useful to authors of plugin management systems.
26800  *
26801  * The directory should contain a file called
26802  * <filename>gschemas.compiled</filename> as produced by
26803  * <command>glib-compile-schemas</command>.
26804  *
26805  * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
26806  * trusted not to be corrupted.  This assumption has a performance
26807  * advantage, but can result in crashes or inconsistent behaviour in the
26808  * case of a corrupted file.  Generally, you should set @trusted to
26809  * %TRUE for files installed by the system and to %FALSE for files in
26810  * the home directory.
26811  *
26812  * If @parent is non-%NULL then there are two effects.
26813  *
26814  * First, if g_settings_schema_source_lookup() is called with the
26815  * @recursive flag set to %TRUE and the schema can not be found in the
26816  * source, the lookup will recurse to the parent.
26817  *
26818  * Second, any references to other schemas specified within this
26819  * source (ie: <literal>child</literal> or <literal>extents</literal>)
26820  * references may be resolved from the @parent.
26821  *
26822  * For this second reason, except in very unusual situations, the
26823  * @parent should probably be given as the default schema source, as
26824  * returned by g_settings_schema_source_get_default().
26825  *
26826  * Since: 2.32
26827  */
26828
26829
26830 /**
26831  * g_settings_schema_source_ref:
26832  * @source: a #GSettingsSchemaSource
26833  *
26834  * Increase the reference count of @source, returning a new reference.
26835  *
26836  * Returns: a new reference to @source
26837  * Since: 2.32
26838  */
26839
26840
26841 /**
26842  * g_settings_schema_source_unref:
26843  * @source: a #GSettingsSchemaSource
26844  *
26845  * Decrease the reference count of @source, possibly freeing it.
26846  *
26847  * Since: 2.32
26848  */
26849
26850
26851 /**
26852  * g_settings_schema_unref:
26853  * @schema: a #GSettingsSchema
26854  *
26855  * Decrease the reference count of @schema, possibly freeing it.
26856  *
26857  * Since: 2.32
26858  */
26859
26860
26861 /**
26862  * g_settings_set:
26863  * @settings: a #GSettings object
26864  * @key: the name of the key to set
26865  * @format: a #GVariant format string
26866  * @...: arguments as per @format
26867  *
26868  * Sets @key in @settings to @value.
26869  *
26870  * A convenience function that combines g_settings_set_value() with
26871  * g_variant_new().
26872  *
26873  * It is a programmer error to give a @key that isn't contained in the
26874  * schema for @settings or for the #GVariantType of @format to mismatch
26875  * the type given in the schema.
26876  *
26877  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26878  * Since: 2.26
26879  */
26880
26881
26882 /**
26883  * g_settings_set_boolean:
26884  * @settings: a #GSettings object
26885  * @key: the name of the key to set
26886  * @value: the value to set it to
26887  *
26888  * Sets @key in @settings to @value.
26889  *
26890  * A convenience variant of g_settings_set() for booleans.
26891  *
26892  * It is a programmer error to give a @key that isn't specified as
26893  * having a boolean type in the schema for @settings.
26894  *
26895  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26896  * Since: 2.26
26897  */
26898
26899
26900 /**
26901  * g_settings_set_double:
26902  * @settings: a #GSettings object
26903  * @key: the name of the key to set
26904  * @value: the value to set it to
26905  *
26906  * Sets @key in @settings to @value.
26907  *
26908  * A convenience variant of g_settings_set() for doubles.
26909  *
26910  * It is a programmer error to give a @key that isn't specified as
26911  * having a 'double' type in the schema for @settings.
26912  *
26913  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26914  * Since: 2.26
26915  */
26916
26917
26918 /**
26919  * g_settings_set_enum:
26920  * @settings: a #GSettings object
26921  * @key: a key, within @settings
26922  * @value: an enumerated value
26923  *
26924  * Looks up the enumerated type nick for @value and writes it to @key,
26925  * within @settings.
26926  *
26927  * It is a programmer error to give a @key that isn't contained in the
26928  * schema for @settings or is not marked as an enumerated type, or for
26929  * @value not to be a valid value for the named type.
26930  *
26931  * After performing the write, accessing @key directly with
26932  * g_settings_get_string() will return the 'nick' associated with
26933  * @value.
26934  *
26935  * Returns: %TRUE, if the set succeeds
26936  */
26937
26938
26939 /**
26940  * g_settings_set_flags:
26941  * @settings: a #GSettings object
26942  * @key: a key, within @settings
26943  * @value: a flags value
26944  *
26945  * Looks up the flags type nicks for the bits specified by @value, puts
26946  * them in an array of strings and writes the array to @key, within
26947  * @settings.
26948  *
26949  * It is a programmer error to give a @key that isn't contained in the
26950  * schema for @settings or is not marked as a flags type, or for @value
26951  * to contain any bits that are not value for the named type.
26952  *
26953  * After performing the write, accessing @key directly with
26954  * g_settings_get_strv() will return an array of 'nicks'; one for each
26955  * bit in @value.
26956  *
26957  * Returns: %TRUE, if the set succeeds
26958  */
26959
26960
26961 /**
26962  * g_settings_set_int:
26963  * @settings: a #GSettings object
26964  * @key: the name of the key to set
26965  * @value: the value to set it to
26966  *
26967  * Sets @key in @settings to @value.
26968  *
26969  * A convenience variant of g_settings_set() for 32-bit integers.
26970  *
26971  * It is a programmer error to give a @key that isn't specified as
26972  * having a int32 type in the schema for @settings.
26973  *
26974  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26975  * Since: 2.26
26976  */
26977
26978
26979 /**
26980  * g_settings_set_string:
26981  * @settings: a #GSettings object
26982  * @key: the name of the key to set
26983  * @value: the value to set it to
26984  *
26985  * Sets @key in @settings to @value.
26986  *
26987  * A convenience variant of g_settings_set() for strings.
26988  *
26989  * It is a programmer error to give a @key that isn't specified as
26990  * having a string type in the schema for @settings.
26991  *
26992  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26993  * Since: 2.26
26994  */
26995
26996
26997 /**
26998  * g_settings_set_strv:
26999  * @settings: a #GSettings object
27000  * @key: the name of the key to set
27001  * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27002  *
27003  * Sets @key in @settings to @value.
27004  *
27005  * A convenience variant of g_settings_set() for string arrays.  If
27006  * @value is %NULL, then @key is set to be the empty array.
27007  *
27008  * It is a programmer error to give a @key that isn't specified as
27009  * having an array of strings type in the schema for @settings.
27010  *
27011  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27012  * Since: 2.26
27013  */
27014
27015
27016 /**
27017  * g_settings_set_uint:
27018  * @settings: a #GSettings object
27019  * @key: the name of the key to set
27020  * @value: the value to set it to
27021  *
27022  * Sets @key in @settings to @value.
27023  *
27024  * A convenience variant of g_settings_set() for 32-bit unsigned
27025  * integers.
27026  *
27027  * It is a programmer error to give a @key that isn't specified as
27028  * having a uint32 type in the schema for @settings.
27029  *
27030  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27031  * Since: 2.30
27032  */
27033
27034
27035 /**
27036  * g_settings_set_value:
27037  * @settings: a #GSettings object
27038  * @key: the name of the key to set
27039  * @value: a #GVariant of the correct type
27040  *
27041  * Sets @key in @settings to @value.
27042  *
27043  * It is a programmer error to give a @key that isn't contained in the
27044  * schema for @settings or for @value to have the incorrect type, per
27045  * the schema.
27046  *
27047  * If @value is floating then this function consumes the reference.
27048  *
27049  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27050  * Since: 2.26
27051  */
27052
27053
27054 /**
27055  * g_settings_sync:
27056  *
27057  * Ensures that all pending operations for the given are complete for
27058  * the default backend.
27059  *
27060  * Writes made to a #GSettings are handled asynchronously.  For this
27061  * reason, it is very unlikely that the changes have it to disk by the
27062  * time g_settings_set() returns.
27063  *
27064  * This call will block until all of the writes have made it to the
27065  * backend.  Since the mainloop is not running, no change notifications
27066  * will be dispatched during this call (but some may be queued by the
27067  * time the call is done).
27068  */
27069
27070
27071 /**
27072  * g_settings_unbind:
27073  * @object: the object
27074  * @property: the property whose binding is removed
27075  *
27076  * Removes an existing binding for @property on @object.
27077  *
27078  * Note that bindings are automatically removed when the
27079  * object is finalized, so it is rarely necessary to call this
27080  * function.
27081  *
27082  * Since: 2.26
27083  */
27084
27085
27086 /**
27087  * g_simple_action_group_add_entries:
27088  * @simple: a #GSimpleActionGroup
27089  * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27090  * @n_entries: the length of @entries, or -1
27091  * @user_data: the user data for signal connections
27092  *
27093  * A convenience function for creating multiple #GSimpleAction instances
27094  * and adding them to the action group.
27095  *
27096  * Since: 2.30
27097  */
27098
27099
27100 /**
27101  * g_simple_action_group_insert:
27102  * @simple: a #GSimpleActionGroup
27103  * @action: a #GAction
27104  *
27105  * Adds an action to the action group.
27106  *
27107  * If the action group already contains an action with the same name as
27108  * @action then the old action is dropped from the group.
27109  *
27110  * The action group takes its own reference on @action.
27111  *
27112  * Since: 2.28
27113  */
27114
27115
27116 /**
27117  * g_simple_action_group_lookup:
27118  * @simple: a #GSimpleActionGroup
27119  * @action_name: the name of an action
27120  *
27121  * Looks up the action with the name @action_name in the group.
27122  *
27123  * If no such action exists, returns %NULL.
27124  *
27125  * Returns: (transfer none): a #GAction, or %NULL
27126  * Since: 2.28
27127  */
27128
27129
27130 /**
27131  * g_simple_action_group_new:
27132  *
27133  * Creates a new, empty, #GSimpleActionGroup.
27134  *
27135  * Returns: a new #GSimpleActionGroup
27136  * Since: 2.28
27137  */
27138
27139
27140 /**
27141  * g_simple_action_group_remove:
27142  * @simple: a #GSimpleActionGroup
27143  * @action_name: the name of the action
27144  *
27145  * Removes the named action from the action group.
27146  *
27147  * If no action of this name is in the group then nothing happens.
27148  *
27149  * Since: 2.28
27150  */
27151
27152
27153 /**
27154  * g_simple_action_new:
27155  * @name: the name of the action
27156  * @parameter_type: (allow-none): the type of parameter to the activate function
27157  *
27158  * Creates a new action.
27159  *
27160  * The created action is stateless.  See g_simple_action_new_stateful().
27161  *
27162  * Returns: a new #GSimpleAction
27163  * Since: 2.28
27164  */
27165
27166
27167 /**
27168  * g_simple_action_new_stateful:
27169  * @name: the name of the action
27170  * @parameter_type: (allow-none): the type of the parameter to the activate function
27171  * @state: the initial state of the action
27172  *
27173  * Creates a new stateful action.
27174  *
27175  * @state is the initial state of the action.  All future state values
27176  * must have the same #GVariantType as the initial state.
27177  *
27178  * If the @state GVariant is floating, it is consumed.
27179  *
27180  * Returns: a new #GSimpleAction
27181  * Since: 2.28
27182  */
27183
27184
27185 /**
27186  * g_simple_action_set_enabled:
27187  * @simple: a #GSimpleAction
27188  * @enabled: whether the action is enabled
27189  *
27190  * Sets the action as enabled or not.
27191  *
27192  * An action must be enabled in order to be activated or in order to
27193  * have its state changed from outside callers.
27194  *
27195  * This should only be called by the implementor of the action.  Users
27196  * of the action should not attempt to modify its enabled flag.
27197  *
27198  * Since: 2.28
27199  */
27200
27201
27202 /**
27203  * g_simple_action_set_state:
27204  * @simple: a #GSimpleAction
27205  * @value: the new #GVariant for the state
27206  *
27207  * Sets the state of the action.
27208  *
27209  * This directly updates the 'state' property to the given value.
27210  *
27211  * This should only be called by the implementor of the action.  Users
27212  * of the action should not attempt to directly modify the 'state'
27213  * property.  Instead, they should call g_action_change_state() to
27214  * request the change.
27215  *
27216  * Since: 2.30
27217  */
27218
27219
27220 /**
27221  * g_simple_async_report_error_in_idle: (skip)
27222  * @object: (allow-none): a #GObject, or %NULL.
27223  * @callback: a #GAsyncReadyCallback.
27224  * @user_data: user data passed to @callback.
27225  * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27226  * @code: a specific error code.
27227  * @format: a formatted error reporting string.
27228  * @...: a list of variables to fill in @format.
27229  *
27230  * Reports an error in an asynchronous function in an idle function by
27231  * directly setting the contents of the #GAsyncResult with the given error
27232  * information.
27233  */
27234
27235
27236 /**
27237  * g_simple_async_report_gerror_in_idle:
27238  * @object: (allow-none): a #GObject, or %NULL
27239  * @callback: (scope async): a #GAsyncReadyCallback.
27240  * @user_data: (closure): user data passed to @callback.
27241  * @error: the #GError to report
27242  *
27243  * Reports an error in an idle function. Similar to
27244  * g_simple_async_report_error_in_idle(), but takes a #GError rather
27245  * than building a new one.
27246  */
27247
27248
27249 /**
27250  * g_simple_async_report_take_gerror_in_idle: (skip)
27251  * @object: (allow-none): a #GObject, or %NULL
27252  * @callback: a #GAsyncReadyCallback.
27253  * @user_data: user data passed to @callback.
27254  * @error: the #GError to report
27255  *
27256  * Reports an error in an idle function. Similar to
27257  * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27258  * ownership of @error, so the caller does not have to free it any more.
27259  *
27260  * Since: 2.28
27261  */
27262
27263
27264 /**
27265  * g_simple_async_result_complete:
27266  * @simple: a #GSimpleAsyncResult.
27267  *
27268  * Completes an asynchronous I/O job immediately. Must be called in
27269  * the thread where the asynchronous result was to be delivered, as it
27270  * invokes the callback directly. If you are in a different thread use
27271  * g_simple_async_result_complete_in_idle().
27272  *
27273  * Calling this function takes a reference to @simple for as long as
27274  * is needed to complete the call.
27275  */
27276
27277
27278 /**
27279  * g_simple_async_result_complete_in_idle:
27280  * @simple: a #GSimpleAsyncResult.
27281  *
27282  * Completes an asynchronous function in an idle handler in the <link
27283  * linkend="g-main-context-push-thread-default">thread-default main
27284  * loop</link> of the thread that @simple was initially created in
27285  * (and re-pushes that context around the invocation of the callback).
27286  *
27287  * Calling this function takes a reference to @simple for as long as
27288  * is needed to complete the call.
27289  */
27290
27291
27292 /**
27293  * g_simple_async_result_get_op_res_gboolean:
27294  * @simple: a #GSimpleAsyncResult.
27295  *
27296  * Gets the operation result boolean from within the asynchronous result.
27297  *
27298  * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27299  */
27300
27301
27302 /**
27303  * g_simple_async_result_get_op_res_gpointer: (skip)
27304  * @simple: a #GSimpleAsyncResult.
27305  *
27306  * Gets a pointer result as returned by the asynchronous function.
27307  *
27308  * Returns: a pointer from the result.
27309  */
27310
27311
27312 /**
27313  * g_simple_async_result_get_op_res_gssize:
27314  * @simple: a #GSimpleAsyncResult.
27315  *
27316  * Gets a gssize from the asynchronous result.
27317  *
27318  * Returns: a gssize returned from the asynchronous function.
27319  */
27320
27321
27322 /**
27323  * g_simple_async_result_get_source_tag: (skip)
27324  * @simple: a #GSimpleAsyncResult.
27325  *
27326  * Gets the source tag for the #GSimpleAsyncResult.
27327  *
27328  * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27329  */
27330
27331
27332 /**
27333  * g_simple_async_result_is_valid:
27334  * @result: the #GAsyncResult passed to the _finish function.
27335  * @source: the #GObject passed to the _finish function.
27336  * @source_tag: the asynchronous function.
27337  *
27338  * Ensures that the data passed to the _finish function of an async
27339  * operation is consistent.  Three checks are performed.
27340  *
27341  * First, @result is checked to ensure that it is really a
27342  * #GSimpleAsyncResult.  Second, @source is checked to ensure that it
27343  * matches the source object of @result.  Third, @source_tag is
27344  * checked to ensure that it is either %NULL (as it is when the result was
27345  * created by g_simple_async_report_error_in_idle() or
27346  * g_simple_async_report_gerror_in_idle()) or equal to the
27347  * @source_tag argument given to g_simple_async_result_new() (which, by
27348  * convention, is a pointer to the _async function corresponding to the
27349  * _finish function from which this function is called).
27350  *
27351  * Returns: #TRUE if all checks passed or #FALSE if any failed.
27352  * Since: 2.20
27353  */
27354
27355
27356 /**
27357  * g_simple_async_result_new:
27358  * @source_object: (allow-none): a #GObject, or %NULL.
27359  * @callback: (scope async): a #GAsyncReadyCallback.
27360  * @user_data: (closure): user data passed to @callback.
27361  * @source_tag: the asynchronous function.
27362  *
27363  * Creates a #GSimpleAsyncResult.
27364  *
27365  * The common convention is to create the #GSimpleAsyncResult in the
27366  * function that starts the asynchronous operation and use that same
27367  * function as the @source_tag.
27368  *
27369  * If your operation supports cancellation with #GCancellable (which it
27370  * probably should) then you should provide the user's cancellable to
27371  * g_simple_async_result_set_check_cancellable() immediately after
27372  * this function returns.
27373  *
27374  * Returns: a #GSimpleAsyncResult.
27375  */
27376
27377
27378 /**
27379  * g_simple_async_result_new_error:
27380  * @source_object: (allow-none): a #GObject, or %NULL.
27381  * @callback: (scope async): a #GAsyncReadyCallback.
27382  * @user_data: (closure): user data passed to @callback.
27383  * @domain: a #GQuark.
27384  * @code: an error code.
27385  * @format: a string with format characters.
27386  * @...: a list of values to insert into @format.
27387  *
27388  * Creates a new #GSimpleAsyncResult with a set error.
27389  *
27390  * Returns: a #GSimpleAsyncResult.
27391  */
27392
27393
27394 /**
27395  * g_simple_async_result_new_from_error:
27396  * @source_object: (allow-none): a #GObject, or %NULL.
27397  * @callback: (scope async): a #GAsyncReadyCallback.
27398  * @user_data: (closure): user data passed to @callback.
27399  * @error: a #GError
27400  *
27401  * Creates a #GSimpleAsyncResult from an error condition.
27402  *
27403  * Returns: a #GSimpleAsyncResult.
27404  */
27405
27406
27407 /**
27408  * g_simple_async_result_new_take_error: (skip)
27409  * @source_object: (allow-none): a #GObject, or %NULL
27410  * @callback: (scope async): a #GAsyncReadyCallback
27411  * @user_data: (closure): user data passed to @callback
27412  * @error: a #GError
27413  *
27414  * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27415  * caller's ownership of @error, so the caller does not need to free it anymore.
27416  *
27417  * Returns: a #GSimpleAsyncResult
27418  * Since: 2.28
27419  */
27420
27421
27422 /**
27423  * g_simple_async_result_propagate_error:
27424  * @simple: a #GSimpleAsyncResult.
27425  * @dest: (out): a location to propagate the error to.
27426  *
27427  * Propagates an error from within the simple asynchronous result to
27428  * a given destination.
27429  *
27430  * If the #GCancellable given to a prior call to
27431  * g_simple_async_result_set_check_cancellable() is cancelled then this
27432  * function will return %TRUE with @dest set appropriately.
27433  *
27434  * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27435  */
27436
27437
27438 /**
27439  * g_simple_async_result_run_in_thread: (skip)
27440  * @simple: a #GSimpleAsyncResult.
27441  * @func: a #GSimpleAsyncThreadFunc.
27442  * @io_priority: the io priority of the request.
27443  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27444  *
27445  * Runs the asynchronous job in a separate thread and then calls
27446  * g_simple_async_result_complete_in_idle() on @simple to return
27447  * the result to the appropriate main loop.
27448  *
27449  * Calling this function takes a reference to @simple for as long as
27450  * is needed to run the job and report its completion.
27451  */
27452
27453
27454 /**
27455  * g_simple_async_result_set_check_cancellable:
27456  * @simple: a #GSimpleAsyncResult
27457  * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27458  *
27459  * Sets a #GCancellable to check before dispatching results.
27460  *
27461  * This function has one very specific purpose: the provided cancellable
27462  * is checked at the time of g_simple_async_result_propagate_error() If
27463  * it is cancelled, these functions will return an "Operation was
27464  * cancelled" error (%G_IO_ERROR_CANCELLED).
27465  *
27466  * Implementors of cancellable asynchronous functions should use this in
27467  * order to provide a guarantee to their callers that cancelling an
27468  * async operation will reliably result in an error being returned for
27469  * that operation (even if a positive result for the operation has
27470  * already been sent as an idle to the main context to be dispatched).
27471  *
27472  * The checking described above is done regardless of any call to the
27473  * unrelated g_simple_async_result_set_handle_cancellation() function.
27474  *
27475  * Since: 2.32
27476  */
27477
27478
27479 /**
27480  * g_simple_async_result_set_error: (skip)
27481  * @simple: a #GSimpleAsyncResult.
27482  * @domain: a #GQuark (usually #G_IO_ERROR).
27483  * @code: an error code.
27484  * @format: a formatted error reporting string.
27485  * @...: a list of variables to fill in @format.
27486  *
27487  * Sets an error within the asynchronous result without a #GError.
27488  */
27489
27490
27491 /**
27492  * g_simple_async_result_set_error_va: (skip)
27493  * @simple: a #GSimpleAsyncResult.
27494  * @domain: a #GQuark (usually #G_IO_ERROR).
27495  * @code: an error code.
27496  * @format: a formatted error reporting string.
27497  * @args: va_list of arguments.
27498  *
27499  * Sets an error within the asynchronous result without a #GError.
27500  * Unless writing a binding, see g_simple_async_result_set_error().
27501  */
27502
27503
27504 /**
27505  * g_simple_async_result_set_from_error:
27506  * @simple: a #GSimpleAsyncResult.
27507  * @error: #GError.
27508  *
27509  * Sets the result from a #GError.
27510  */
27511
27512
27513 /**
27514  * g_simple_async_result_set_handle_cancellation:
27515  * @simple: a #GSimpleAsyncResult.
27516  * @handle_cancellation: a #gboolean.
27517  *
27518  * Sets whether to handle cancellation within the asynchronous operation.
27519  *
27520  * This function has nothing to do with
27521  * g_simple_async_result_set_check_cancellable().  It only refers to the
27522  * #GCancellable passed to g_simple_async_result_run_in_thread().
27523  */
27524
27525
27526 /**
27527  * g_simple_async_result_set_op_res_gboolean:
27528  * @simple: a #GSimpleAsyncResult.
27529  * @op_res: a #gboolean.
27530  *
27531  * Sets the operation result to a boolean within the asynchronous result.
27532  */
27533
27534
27535 /**
27536  * g_simple_async_result_set_op_res_gpointer: (skip)
27537  * @simple: a #GSimpleAsyncResult.
27538  * @op_res: a pointer result from an asynchronous function.
27539  * @destroy_op_res: a #GDestroyNotify function.
27540  *
27541  * Sets the operation result within the asynchronous result to a pointer.
27542  */
27543
27544
27545 /**
27546  * g_simple_async_result_set_op_res_gssize:
27547  * @simple: a #GSimpleAsyncResult.
27548  * @op_res: a #gssize.
27549  *
27550  * Sets the operation result within the asynchronous result to
27551  * the given @op_res.
27552  */
27553
27554
27555 /**
27556  * g_simple_async_result_take_error: (skip)
27557  * @simple: a #GSimpleAsyncResult
27558  * @error: a #GError
27559  *
27560  * Sets the result from @error, and takes over the caller's ownership
27561  * of @error, so the caller does not need to free it any more.
27562  *
27563  * Since: 2.28
27564  */
27565
27566
27567 /**
27568  * g_simple_permission_new:
27569  * @allowed: %TRUE if the action is allowed
27570  *
27571  * Creates a new #GPermission instance that represents an action that is
27572  * either always or never allowed.
27573  *
27574  * Returns: the #GSimplePermission, as a #GPermission
27575  * Since: 2.26
27576  */
27577
27578
27579 /**
27580  * g_socket_accept:
27581  * @socket: a #GSocket.
27582  * @cancellable: (allow-none): a %GCancellable or %NULL
27583  * @error: #GError for error reporting, or %NULL to ignore.
27584  *
27585  * Accept incoming connections on a connection-based socket. This removes
27586  * the first outstanding connection request from the listening socket and
27587  * creates a #GSocket object for it.
27588  *
27589  * The @socket must be bound to a local address with g_socket_bind() and
27590  * must be listening for incoming connections (g_socket_listen()).
27591  *
27592  * If there are no outstanding connections then the operation will block
27593  * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27594  * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27595  *
27596  * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27597  * Since: 2.22
27598  */
27599
27600
27601 /**
27602  * g_socket_address_enumerator_next:
27603  * @enumerator: a #GSocketAddressEnumerator
27604  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27605  * @error: a #GError.
27606  *
27607  * Retrieves the next #GSocketAddress from @enumerator. Note that this
27608  * may block for some amount of time. (Eg, a #GNetworkAddress may need
27609  * to do a DNS lookup before it can return an address.) Use
27610  * g_socket_address_enumerator_next_async() if you need to avoid
27611  * blocking.
27612  *
27613  * If @enumerator is expected to yield addresses, but for some reason
27614  * is unable to (eg, because of a DNS error), then the first call to
27615  * g_socket_address_enumerator_next() will return an appropriate error
27616  * in *@error. However, if the first call to
27617  * g_socket_address_enumerator_next() succeeds, then any further
27618  * internal errors (other than @cancellable being triggered) will be
27619  * ignored.
27620  *
27621  * 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.
27622  */
27623
27624
27625 /**
27626  * g_socket_address_enumerator_next_async:
27627  * @enumerator: a #GSocketAddressEnumerator
27628  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27629  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27630  * @user_data: (closure): the data to pass to callback function
27631  *
27632  * Asynchronously retrieves the next #GSocketAddress from @enumerator
27633  * and then calls @callback, which must call
27634  * g_socket_address_enumerator_next_finish() to get the result.
27635  */
27636
27637
27638 /**
27639  * g_socket_address_enumerator_next_finish:
27640  * @enumerator: a #GSocketAddressEnumerator
27641  * @result: a #GAsyncResult
27642  * @error: a #GError
27643  *
27644  * Retrieves the result of a completed call to
27645  * g_socket_address_enumerator_next_async(). See
27646  * g_socket_address_enumerator_next() for more information about
27647  * error handling.
27648  *
27649  * 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.
27650  */
27651
27652
27653 /**
27654  * g_socket_address_get_family:
27655  * @address: a #GSocketAddress
27656  *
27657  * Gets the socket family type of @address.
27658  *
27659  * Returns: the socket family type of @address.
27660  * Since: 2.22
27661  */
27662
27663
27664 /**
27665  * g_socket_address_get_native_size:
27666  * @address: a #GSocketAddress
27667  *
27668  * Gets the size of @address's native <type>struct sockaddr</type>.
27669  * You can use this to allocate memory to pass to
27670  * g_socket_address_to_native().
27671  *
27672  * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27673  * Since: 2.22
27674  */
27675
27676
27677 /**
27678  * g_socket_address_new_from_native:
27679  * @native: a pointer to a <type>struct sockaddr</type>
27680  * @len: the size of the memory location pointed to by @native
27681  *
27682  * Creates a #GSocketAddress subclass corresponding to the native
27683  * <type>struct sockaddr</type> @native.
27684  *
27685  * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27686  * Since: 2.22
27687  */
27688
27689
27690 /**
27691  * g_socket_address_to_native:
27692  * @address: a #GSocketAddress
27693  * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27694  * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27695  * @error: #GError for error reporting, or %NULL to ignore.
27696  *
27697  * Converts a #GSocketAddress to a native <type>struct
27698  * sockaddr</type>, which can be passed to low-level functions like
27699  * connect() or bind().
27700  *
27701  * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27702  * returned. If the address type is not known on the system
27703  * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27704  *
27705  * Returns: %TRUE if @dest was filled in, %FALSE on error
27706  * Since: 2.22
27707  */
27708
27709
27710 /**
27711  * g_socket_bind:
27712  * @socket: a #GSocket.
27713  * @address: a #GSocketAddress specifying the local address.
27714  * @allow_reuse: whether to allow reusing this address
27715  * @error: #GError for error reporting, or %NULL to ignore.
27716  *
27717  * When a socket is created it is attached to an address family, but it
27718  * doesn't have an address in this family. g_socket_bind() assigns the
27719  * address (sometimes called name) of the socket.
27720  *
27721  * It is generally required to bind to a local address before you can
27722  * receive connections. (See g_socket_listen() and g_socket_accept() ).
27723  * In certain situations, you may also want to bind a socket that will be
27724  * used to initiate connections, though this is not normally required.
27725  *
27726  * @allow_reuse should be %TRUE for server sockets (sockets that you will
27727  * eventually call g_socket_accept() on), and %FALSE for client sockets.
27728  * (Specifically, if it is %TRUE, then g_socket_bind() will set the
27729  * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
27730  * that address was previously used by another socket that has not yet been
27731  * fully cleaned-up by the kernel. Failing to set this flag on a server
27732  * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
27733  * the server program is stopped and then immediately restarted.)
27734  *
27735  * Returns: %TRUE on success, %FALSE on error.
27736  * Since: 2.22
27737  */
27738
27739
27740 /**
27741  * g_socket_check_connect_result:
27742  * @socket: a #GSocket
27743  * @error: #GError for error reporting, or %NULL to ignore.
27744  *
27745  * Checks and resets the pending connect error for the socket.
27746  * This is used to check for errors when g_socket_connect() is
27747  * used in non-blocking mode.
27748  *
27749  * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
27750  * Since: 2.22
27751  */
27752
27753
27754 /**
27755  * g_socket_client_add_application_proxy:
27756  * @client: a #GSocketClient
27757  * @protocol: The proxy protocol
27758  *
27759  * Enable proxy protocols to be handled by the application. When the
27760  * indicated proxy protocol is returned by the #GProxyResolver,
27761  * #GSocketClient will consider this protocol as supported but will
27762  * not try to find a #GProxy instance to handle handshaking. The
27763  * application must check for this case by calling
27764  * g_socket_connection_get_remote_address() on the returned
27765  * #GSocketConnection, and seeing if it's a #GProxyAddress of the
27766  * appropriate type, to determine whether or not it needs to handle
27767  * the proxy handshaking itself.
27768  *
27769  * This should be used for proxy protocols that are dialects of
27770  * another protocol such as HTTP proxy. It also allows cohabitation of
27771  * proxy protocols that are reused between protocols. A good example
27772  * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
27773  * be use as generic socket proxy through the HTTP CONNECT method.
27774  *
27775  * When the proxy is detected as being an application proxy, TLS handshake
27776  * will be skipped. This is required to let the application do the proxy
27777  * specific handshake.
27778  */
27779
27780
27781 /**
27782  * g_socket_client_connect:
27783  * @client: a #GSocketClient.
27784  * @connectable: a #GSocketConnectable specifying the remote address.
27785  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27786  * @error: #GError for error reporting, or %NULL to ignore.
27787  *
27788  * Tries to resolve the @connectable and make a network connection to it.
27789  *
27790  * Upon a successful connection, a new #GSocketConnection is constructed
27791  * and returned.  The caller owns this new object and must drop their
27792  * reference to it when finished with it.
27793  *
27794  * The type of the #GSocketConnection object returned depends on the type of
27795  * the underlying socket that is used. For instance, for a TCP/IP connection
27796  * it will be a #GTcpConnection.
27797  *
27798  * The socket created will be the same family as the address that the
27799  * @connectable resolves to, unless family is set with g_socket_client_set_family()
27800  * or indirectly via g_socket_client_set_local_address(). The socket type
27801  * defaults to %G_SOCKET_TYPE_STREAM but can be set with
27802  * g_socket_client_set_socket_type().
27803  *
27804  * If a local address is specified with g_socket_client_set_local_address() the
27805  * socket will be bound to this address before connecting.
27806  *
27807  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27808  * Since: 2.22
27809  */
27810
27811
27812 /**
27813  * g_socket_client_connect_async:
27814  * @client: a #GSocketClient
27815  * @connectable: a #GSocketConnectable specifying the remote address.
27816  * @cancellable: (allow-none): a #GCancellable, or %NULL
27817  * @callback: (scope async): a #GAsyncReadyCallback
27818  * @user_data: (closure): user data for the callback
27819  *
27820  * This is the asynchronous version of g_socket_client_connect().
27821  *
27822  * When the operation is finished @callback will be
27823  * called. You can then call g_socket_client_connect_finish() to get
27824  * the result of the operation.
27825  *
27826  * Since: 2.22
27827  */
27828
27829
27830 /**
27831  * g_socket_client_connect_finish:
27832  * @client: a #GSocketClient.
27833  * @result: a #GAsyncResult.
27834  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27835  *
27836  * Finishes an async connect operation. See g_socket_client_connect_async()
27837  *
27838  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27839  * Since: 2.22
27840  */
27841
27842
27843 /**
27844  * g_socket_client_connect_to_host:
27845  * @client: a #GSocketClient
27846  * @host_and_port: the name and optionally port of the host to connect to
27847  * @default_port: the default port to connect to
27848  * @cancellable: (allow-none): a #GCancellable, or %NULL
27849  * @error: a pointer to a #GError, or %NULL
27850  *
27851  * This is a helper function for g_socket_client_connect().
27852  *
27853  * Attempts to create a TCP connection to the named host.
27854  *
27855  * @host_and_port may be in any of a number of recognized formats; an IPv6
27856  * address, an IPv4 address, or a domain name (in which case a DNS
27857  * lookup is performed).  Quoting with [] is supported for all address
27858  * types.  A port override may be specified in the usual way with a
27859  * colon.  Ports may be given as decimal numbers or symbolic names (in
27860  * which case an /etc/services lookup is performed).
27861  *
27862  * If no port override is given in @host_and_port then @default_port will be
27863  * used as the port number to connect to.
27864  *
27865  * In general, @host_and_port is expected to be provided by the user (allowing
27866  * them to give the hostname, and a port override if necessary) and
27867  * @default_port is expected to be provided by the application.
27868  *
27869  * In the case that an IP address is given, a single connection
27870  * attempt is made.  In the case that a name is given, multiple
27871  * connection attempts may be made, in turn and according to the
27872  * number of address records in DNS, until a connection succeeds.
27873  *
27874  * Upon a successful connection, a new #GSocketConnection is constructed
27875  * and returned.  The caller owns this new object and must drop their
27876  * reference to it when finished with it.
27877  *
27878  * In the event of any failure (DNS error, service not found, no hosts
27879  * connectable) %NULL is returned and @error (if non-%NULL) is set
27880  * accordingly.
27881  *
27882  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27883  * Since: 2.22
27884  */
27885
27886
27887 /**
27888  * g_socket_client_connect_to_host_async:
27889  * @client: a #GSocketClient
27890  * @host_and_port: the name and optionally the port of the host to connect to
27891  * @default_port: the default port to connect to
27892  * @cancellable: (allow-none): a #GCancellable, or %NULL
27893  * @callback: (scope async): a #GAsyncReadyCallback
27894  * @user_data: (closure): user data for the callback
27895  *
27896  * This is the asynchronous version of g_socket_client_connect_to_host().
27897  *
27898  * When the operation is finished @callback will be
27899  * called. You can then call g_socket_client_connect_to_host_finish() to get
27900  * the result of the operation.
27901  *
27902  * Since: 2.22
27903  */
27904
27905
27906 /**
27907  * g_socket_client_connect_to_host_finish:
27908  * @client: a #GSocketClient.
27909  * @result: a #GAsyncResult.
27910  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27911  *
27912  * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
27913  *
27914  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27915  * Since: 2.22
27916  */
27917
27918
27919 /**
27920  * g_socket_client_connect_to_service:
27921  * @client: a #GSocketConnection
27922  * @domain: a domain name
27923  * @service: the name of the service to connect to
27924  * @cancellable: (allow-none): a #GCancellable, or %NULL
27925  * @error: a pointer to a #GError, or %NULL
27926  *
27927  * Attempts to create a TCP connection to a service.
27928  *
27929  * This call looks up the SRV record for @service at @domain for the
27930  * "tcp" protocol.  It then attempts to connect, in turn, to each of
27931  * the hosts providing the service until either a connection succeeds
27932  * or there are no hosts remaining.
27933  *
27934  * Upon a successful connection, a new #GSocketConnection is constructed
27935  * and returned.  The caller owns this new object and must drop their
27936  * reference to it when finished with it.
27937  *
27938  * In the event of any failure (DNS error, service not found, no hosts
27939  * connectable) %NULL is returned and @error (if non-%NULL) is set
27940  * accordingly.
27941  *
27942  * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
27943  */
27944
27945
27946 /**
27947  * g_socket_client_connect_to_service_async:
27948  * @client: a #GSocketClient
27949  * @domain: a domain name
27950  * @service: the name of the service to connect to
27951  * @cancellable: (allow-none): a #GCancellable, or %NULL
27952  * @callback: (scope async): a #GAsyncReadyCallback
27953  * @user_data: (closure): user data for the callback
27954  *
27955  * This is the asynchronous version of
27956  * g_socket_client_connect_to_service().
27957  *
27958  * Since: 2.22
27959  */
27960
27961
27962 /**
27963  * g_socket_client_connect_to_service_finish:
27964  * @client: a #GSocketClient.
27965  * @result: a #GAsyncResult.
27966  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27967  *
27968  * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
27969  *
27970  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27971  * Since: 2.22
27972  */
27973
27974
27975 /**
27976  * g_socket_client_connect_to_uri:
27977  * @client: a #GSocketClient
27978  * @uri: A network URI
27979  * @default_port: the default port to connect to
27980  * @cancellable: (allow-none): a #GCancellable, or %NULL
27981  * @error: a pointer to a #GError, or %NULL
27982  *
27983  * This is a helper function for g_socket_client_connect().
27984  *
27985  * Attempts to create a TCP connection with a network URI.
27986  *
27987  * @uri may be any valid URI containing an "authority" (hostname/port)
27988  * component. If a port is not specified in the URI, @default_port
27989  * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
27990  * (#GSocketClient does not know to automatically assume TLS for
27991  * certain URI schemes.)
27992  *
27993  * Using this rather than g_socket_client_connect() or
27994  * g_socket_client_connect_to_host() allows #GSocketClient to
27995  * determine when to use application-specific proxy protocols.
27996  *
27997  * Upon a successful connection, a new #GSocketConnection is constructed
27998  * and returned.  The caller owns this new object and must drop their
27999  * reference to it when finished with it.
28000  *
28001  * In the event of any failure (DNS error, service not found, no hosts
28002  * connectable) %NULL is returned and @error (if non-%NULL) is set
28003  * accordingly.
28004  *
28005  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28006  * Since: 2.26
28007  */
28008
28009
28010 /**
28011  * g_socket_client_connect_to_uri_async:
28012  * @client: a #GSocketClient
28013  * @uri: a network uri
28014  * @default_port: the default port to connect to
28015  * @cancellable: (allow-none): a #GCancellable, or %NULL
28016  * @callback: (scope async): a #GAsyncReadyCallback
28017  * @user_data: (closure): user data for the callback
28018  *
28019  * This is the asynchronous version of g_socket_client_connect_to_uri().
28020  *
28021  * When the operation is finished @callback will be
28022  * called. You can then call g_socket_client_connect_to_uri_finish() to get
28023  * the result of the operation.
28024  *
28025  * Since: 2.26
28026  */
28027
28028
28029 /**
28030  * g_socket_client_connect_to_uri_finish:
28031  * @client: a #GSocketClient.
28032  * @result: a #GAsyncResult.
28033  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28034  *
28035  * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28036  *
28037  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28038  * Since: 2.26
28039  */
28040
28041
28042 /**
28043  * g_socket_client_get_enable_proxy:
28044  * @client: a #GSocketClient.
28045  *
28046  * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28047  *
28048  * Returns: whether proxying is enabled
28049  * Since: 2.26
28050  */
28051
28052
28053 /**
28054  * g_socket_client_get_family:
28055  * @client: a #GSocketClient.
28056  *
28057  * Gets the socket family of the socket client.
28058  *
28059  * See g_socket_client_set_family() for details.
28060  *
28061  * Returns: a #GSocketFamily
28062  * Since: 2.22
28063  */
28064
28065
28066 /**
28067  * g_socket_client_get_local_address:
28068  * @client: a #GSocketClient.
28069  *
28070  * Gets the local address of the socket client.
28071  *
28072  * See g_socket_client_set_local_address() for details.
28073  *
28074  * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28075  * Since: 2.22
28076  */
28077
28078
28079 /**
28080  * g_socket_client_get_protocol:
28081  * @client: a #GSocketClient
28082  *
28083  * Gets the protocol name type of the socket client.
28084  *
28085  * See g_socket_client_set_protocol() for details.
28086  *
28087  * Returns: a #GSocketProtocol
28088  * Since: 2.22
28089  */
28090
28091
28092 /**
28093  * g_socket_client_get_socket_type:
28094  * @client: a #GSocketClient.
28095  *
28096  * Gets the socket type of the socket client.
28097  *
28098  * See g_socket_client_set_socket_type() for details.
28099  *
28100  * Returns: a #GSocketFamily
28101  * Since: 2.22
28102  */
28103
28104
28105 /**
28106  * g_socket_client_get_timeout:
28107  * @client: a #GSocketClient
28108  *
28109  * Gets the I/O timeout time for sockets created by @client.
28110  *
28111  * See g_socket_client_set_timeout() for details.
28112  *
28113  * Returns: the timeout in seconds
28114  * Since: 2.26
28115  */
28116
28117
28118 /**
28119  * g_socket_client_get_tls:
28120  * @client: a #GSocketClient.
28121  *
28122  * Gets whether @client creates TLS connections. See
28123  * g_socket_client_set_tls() for details.
28124  *
28125  * Returns: whether @client uses TLS
28126  * Since: 2.28
28127  */
28128
28129
28130 /**
28131  * g_socket_client_get_tls_validation_flags:
28132  * @client: a #GSocketClient.
28133  *
28134  * Gets the TLS validation flags used creating TLS connections via
28135  * @client.
28136  *
28137  * Returns: the TLS validation flags
28138  * Since: 2.28
28139  */
28140
28141
28142 /**
28143  * g_socket_client_new:
28144  *
28145  * Creates a new #GSocketClient with the default options.
28146  *
28147  * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28148  * Since: 2.22
28149  */
28150
28151
28152 /**
28153  * g_socket_client_set_enable_proxy:
28154  * @client: a #GSocketClient.
28155  * @enable: whether to enable proxies
28156  *
28157  * Sets whether or not @client attempts to make connections via a
28158  * proxy server. When enabled (the default), #GSocketClient will use a
28159  * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28160  * needed, and automatically do the necessary proxy negotiation.
28161  *
28162  * Since: 2.26
28163  */
28164
28165
28166 /**
28167  * g_socket_client_set_family:
28168  * @client: a #GSocketClient.
28169  * @family: a #GSocketFamily
28170  *
28171  * Sets the socket family of the socket client.
28172  * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28173  * then the sockets created by this object will be of the specified
28174  * family.
28175  *
28176  * This might be useful for instance if you want to force the local
28177  * connection to be an ipv4 socket, even though the address might
28178  * be an ipv6 mapped to ipv4 address.
28179  *
28180  * Since: 2.22
28181  */
28182
28183
28184 /**
28185  * g_socket_client_set_local_address:
28186  * @client: a #GSocketClient.
28187  * @address: (allow-none): a #GSocketAddress, or %NULL
28188  *
28189  * Sets the local address of the socket client.
28190  * The sockets created by this object will bound to the
28191  * specified address (if not %NULL) before connecting.
28192  *
28193  * This is useful if you want to ensure that the local
28194  * side of the connection is on a specific port, or on
28195  * a specific interface.
28196  *
28197  * Since: 2.22
28198  */
28199
28200
28201 /**
28202  * g_socket_client_set_protocol:
28203  * @client: a #GSocketClient.
28204  * @protocol: a #GSocketProtocol
28205  *
28206  * Sets the protocol of the socket client.
28207  * The sockets created by this object will use of the specified
28208  * protocol.
28209  *
28210  * If @protocol is %0 that means to use the default
28211  * protocol for the socket family and type.
28212  *
28213  * Since: 2.22
28214  */
28215
28216
28217 /**
28218  * g_socket_client_set_socket_type:
28219  * @client: a #GSocketClient.
28220  * @type: a #GSocketType
28221  *
28222  * Sets the socket type of the socket client.
28223  * The sockets created by this object will be of the specified
28224  * type.
28225  *
28226  * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28227  * as GSocketClient is used for connection oriented services.
28228  *
28229  * Since: 2.22
28230  */
28231
28232
28233 /**
28234  * g_socket_client_set_timeout:
28235  * @client: a #GSocketClient.
28236  * @timeout: the timeout
28237  *
28238  * Sets the I/O timeout for sockets created by @client. @timeout is a
28239  * time in seconds, or 0 for no timeout (the default).
28240  *
28241  * The timeout value affects the initial connection attempt as well,
28242  * so setting this may cause calls to g_socket_client_connect(), etc,
28243  * to fail with %G_IO_ERROR_TIMED_OUT.
28244  *
28245  * Since: 2.26
28246  */
28247
28248
28249 /**
28250  * g_socket_client_set_tls:
28251  * @client: a #GSocketClient.
28252  * @tls: whether to use TLS
28253  *
28254  * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28255  * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28256  * and perform a TLS handshake when connecting.
28257  *
28258  * Note that since #GSocketClient must return a #GSocketConnection,
28259  * but #GTlsClientConnection is not a #GSocketConnection, this
28260  * actually wraps the resulting #GTlsClientConnection in a
28261  * #GTcpWrapperConnection when returning it. You can use
28262  * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28263  * to extract the #GTlsClientConnection.
28264  *
28265  * If you need to modify the behavior of the TLS handshake (eg, by
28266  * setting a client-side certificate to use, or connecting to the
28267  * #GTlsConnection::accept-certificate signal), you can connect to
28268  * @client's #GSocketClient::event signal and wait for it to be
28269  * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28270  * a chance to see the #GTlsClientConnection before the handshake
28271  * starts.
28272  *
28273  * Since: 2.28
28274  */
28275
28276
28277 /**
28278  * g_socket_client_set_tls_validation_flags:
28279  * @client: a #GSocketClient.
28280  * @flags: the validation flags
28281  *
28282  * Sets the TLS validation flags used when creating TLS connections
28283  * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28284  *
28285  * Since: 2.28
28286  */
28287
28288
28289 /**
28290  * g_socket_close:
28291  * @socket: a #GSocket
28292  * @error: #GError for error reporting, or %NULL to ignore.
28293  *
28294  * Closes the socket, shutting down any active connection.
28295  *
28296  * Closing a socket does not wait for all outstanding I/O operations
28297  * to finish, so the caller should not rely on them to be guaranteed
28298  * to complete even if the close returns with no error.
28299  *
28300  * Once the socket is closed, all other operations will return
28301  * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28302  * return an error.
28303  *
28304  * Sockets will be automatically closed when the last reference
28305  * is dropped, but you might want to call this function to make sure
28306  * resources are released as early as possible.
28307  *
28308  * Beware that due to the way that TCP works, it is possible for
28309  * recently-sent data to be lost if either you close a socket while the
28310  * %G_IO_IN condition is set, or else if the remote connection tries to
28311  * send something to you after you close the socket but before it has
28312  * finished reading all of the data you sent. There is no easy generic
28313  * way to avoid this problem; the easiest fix is to design the network
28314  * protocol such that the client will never send data "out of turn".
28315  * Another solution is for the server to half-close the connection by
28316  * calling g_socket_shutdown() with only the @shutdown_write flag set,
28317  * and then wait for the client to notice this and close its side of the
28318  * connection, after which the server can safely call g_socket_close().
28319  * (This is what #GTcpConnection does if you call
28320  * g_tcp_connection_set_graceful_disconnect(). But of course, this
28321  * only works if the client will close its connection after the server
28322  * does.)
28323  *
28324  * Returns: %TRUE on success, %FALSE on error
28325  * Since: 2.22
28326  */
28327
28328
28329 /**
28330  * g_socket_condition_check:
28331  * @socket: a #GSocket
28332  * @condition: a #GIOCondition mask to check
28333  *
28334  * Checks on the readiness of @socket to perform operations.
28335  * The operations specified in @condition are checked for and masked
28336  * against the currently-satisfied conditions on @socket. The result
28337  * is returned.
28338  *
28339  * Note that on Windows, it is possible for an operation to return
28340  * %G_IO_ERROR_WOULD_BLOCK even immediately after
28341  * g_socket_condition_check() has claimed that the socket is ready for
28342  * writing. Rather than calling g_socket_condition_check() and then
28343  * writing to the socket if it succeeds, it is generally better to
28344  * simply try writing to the socket right away, and try again later if
28345  * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28346  *
28347  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28348  * these conditions will always be set in the output if they are true.
28349  *
28350  * This call never blocks.
28351  *
28352  * Returns: the @GIOCondition mask of the current state
28353  * Since: 2.22
28354  */
28355
28356
28357 /**
28358  * g_socket_condition_timed_wait:
28359  * @socket: a #GSocket
28360  * @condition: a #GIOCondition mask to wait for
28361  * @timeout: the maximum time (in microseconds) to wait, or -1
28362  * @cancellable: (allow-none): a #GCancellable, or %NULL
28363  * @error: a #GError pointer, or %NULL
28364  *
28365  * Waits for up to @timeout microseconds for @condition to become true
28366  * on @socket. If the condition is met, %TRUE is returned.
28367  *
28368  * If @cancellable is cancelled before the condition is met, or if
28369  * @timeout (or the socket's #GSocket:timeout) is reached before the
28370  * condition is met, then %FALSE is returned and @error, if non-%NULL,
28371  * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28372  * %G_IO_ERROR_TIMED_OUT).
28373  *
28374  * If you don't want a timeout, use g_socket_condition_wait().
28375  * (Alternatively, you can pass -1 for @timeout.)
28376  *
28377  * Note that although @timeout is in microseconds for consistency with
28378  * other GLib APIs, this function actually only has millisecond
28379  * resolution, and the behavior is undefined if @timeout is not an
28380  * exact number of milliseconds.
28381  *
28382  * Returns: %TRUE if the condition was met, %FALSE otherwise
28383  * Since: 2.32
28384  */
28385
28386
28387 /**
28388  * g_socket_condition_wait:
28389  * @socket: a #GSocket
28390  * @condition: a #GIOCondition mask to wait for
28391  * @cancellable: (allow-none): a #GCancellable, or %NULL
28392  * @error: a #GError pointer, or %NULL
28393  *
28394  * Waits for @condition to become true on @socket. When the condition
28395  * is met, %TRUE is returned.
28396  *
28397  * If @cancellable is cancelled before the condition is met, or if the
28398  * socket has a timeout set and it is reached before the condition is
28399  * met, then %FALSE is returned and @error, if non-%NULL, is set to
28400  * the appropriate value (%G_IO_ERROR_CANCELLED or
28401  * %G_IO_ERROR_TIMED_OUT).
28402  *
28403  * See also g_socket_condition_timed_wait().
28404  *
28405  * Returns: %TRUE if the condition was met, %FALSE otherwise
28406  * Since: 2.22
28407  */
28408
28409
28410 /**
28411  * g_socket_connect:
28412  * @socket: a #GSocket.
28413  * @address: a #GSocketAddress specifying the remote address.
28414  * @cancellable: (allow-none): a %GCancellable or %NULL
28415  * @error: #GError for error reporting, or %NULL to ignore.
28416  *
28417  * Connect the socket to the specified remote address.
28418  *
28419  * For connection oriented socket this generally means we attempt to make
28420  * a connection to the @address. For a connection-less socket it sets
28421  * the default address for g_socket_send() and discards all incoming datagrams
28422  * from other sources.
28423  *
28424  * Generally connection oriented sockets can only connect once, but
28425  * connection-less sockets can connect multiple times to change the
28426  * default address.
28427  *
28428  * If the connect call needs to do network I/O it will block, unless
28429  * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28430  * and the user can be notified of the connection finishing by waiting
28431  * for the G_IO_OUT condition. The result of the connection must then be
28432  * checked with g_socket_check_connect_result().
28433  *
28434  * Returns: %TRUE if connected, %FALSE on error.
28435  * Since: 2.22
28436  */
28437
28438
28439 /**
28440  * g_socket_connectable_enumerate:
28441  * @connectable: a #GSocketConnectable
28442  *
28443  * Creates a #GSocketAddressEnumerator for @connectable.
28444  *
28445  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28446  * Since: 2.22
28447  */
28448
28449
28450 /**
28451  * g_socket_connectable_proxy_enumerate:
28452  * @connectable: a #GSocketConnectable
28453  *
28454  * Creates a #GSocketAddressEnumerator for @connectable that will
28455  * return #GProxyAddress<!-- -->es for addresses that you must connect
28456  * to via a proxy.
28457  *
28458  * If @connectable does not implement
28459  * g_socket_connectable_proxy_enumerate(), this will fall back to
28460  * calling g_socket_connectable_enumerate().
28461  *
28462  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28463  * Since: 2.26
28464  */
28465
28466
28467 /**
28468  * g_socket_connection_connect:
28469  * @connection: a #GSocketConnection
28470  * @address: a #GSocketAddress specifying the remote address.
28471  * @cancellable: (allow-none): a %GCancellable or %NULL
28472  * @error: #GError for error reporting, or %NULL to ignore.
28473  *
28474  * Connect @connection to the specified remote address.
28475  *
28476  * Returns: %TRUE if the connection succeeded, %FALSE on error
28477  * Since: 2.32
28478  */
28479
28480
28481 /**
28482  * g_socket_connection_connect_async:
28483  * @connection: a #GSocketConnection
28484  * @address: a #GSocketAddress specifying the remote address.
28485  * @cancellable: (allow-none): a %GCancellable or %NULL
28486  * @callback: (scope async): a #GAsyncReadyCallback
28487  * @user_data: (closure): user data for the callback
28488  *
28489  * Asynchronously connect @connection to the specified remote address.
28490  *
28491  * This clears the #GSocket:blocking flag on @connection's underlying
28492  * socket if it is currently set.
28493  *
28494  * Use g_socket_connection_connect_finish() to retrieve the result.
28495  *
28496  * Since: 2.32
28497  */
28498
28499
28500 /**
28501  * g_socket_connection_connect_finish:
28502  * @connection: a #GSocketConnection
28503  * @result: the #GAsyncResult
28504  * @error: #GError for error reporting, or %NULL to ignore.
28505  *
28506  * Gets the result of a g_socket_connection_connect_async() call.
28507  *
28508  * Returns: %TRUE if the connection succeeded, %FALSE on error
28509  * Since: 2.32
28510  */
28511
28512
28513 /**
28514  * g_socket_connection_factory_create_connection:
28515  * @socket: a #GSocket
28516  *
28517  * Creates a #GSocketConnection subclass of the right type for
28518  * @socket.
28519  *
28520  * Returns: (transfer full): a #GSocketConnection
28521  * Since: 2.22
28522  */
28523
28524
28525 /**
28526  * g_socket_connection_factory_lookup_type:
28527  * @family: a #GSocketFamily
28528  * @type: a #GSocketType
28529  * @protocol_id: a protocol id
28530  *
28531  * Looks up the #GType to be used when creating socket connections on
28532  * sockets with the specified @family, @type and @protocol_id.
28533  *
28534  * If no type is registered, the #GSocketConnection base type is returned.
28535  *
28536  * Returns: a #GType
28537  * Since: 2.22
28538  */
28539
28540
28541 /**
28542  * g_socket_connection_factory_register_type:
28543  * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28544  * @family: a #GSocketFamily
28545  * @type: a #GSocketType
28546  * @protocol: a protocol id
28547  *
28548  * Looks up the #GType to be used when creating socket connections on
28549  * sockets with the specified @family, @type and @protocol.
28550  *
28551  * If no type is registered, the #GSocketConnection base type is returned.
28552  *
28553  * Since: 2.22
28554  */
28555
28556
28557 /**
28558  * g_socket_connection_get_local_address:
28559  * @connection: a #GSocketConnection
28560  * @error: #GError for error reporting, or %NULL to ignore.
28561  *
28562  * Try to get the local address of a socket connection.
28563  *
28564  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28565  * Since: 2.22
28566  */
28567
28568
28569 /**
28570  * g_socket_connection_get_remote_address:
28571  * @connection: a #GSocketConnection
28572  * @error: #GError for error reporting, or %NULL to ignore.
28573  *
28574  * Try to get the remote address of a socket connection.
28575  *
28576  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28577  * Since: 2.22
28578  */
28579
28580
28581 /**
28582  * g_socket_connection_get_socket:
28583  * @connection: a #GSocketConnection
28584  *
28585  * Gets the underlying #GSocket object of the connection.
28586  * This can be useful if you want to do something unusual on it
28587  * not supported by the #GSocketConnection APIs.
28588  *
28589  * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28590  * Since: 2.22
28591  */
28592
28593
28594 /**
28595  * g_socket_connection_is_connected:
28596  * @connection: a #GSocketConnection
28597  *
28598  * Checks if @connection is connected. This is equivalent to calling
28599  * g_socket_is_connected() on @connection's underlying #GSocket.
28600  *
28601  * Returns: whether @connection is connected
28602  * Since: 2.32
28603  */
28604
28605
28606 /**
28607  * g_socket_control_message_deserialize:
28608  * @level: a socket level
28609  * @type: a socket control message type for the given @level
28610  * @size: the size of the data in bytes
28611  * @data: (array length=size) (element-type guint8): pointer to the message data
28612  *
28613  * Tries to deserialize a socket control message of a given
28614  * @level and @type. This will ask all known (to GType) subclasses
28615  * of #GSocketControlMessage if they can understand this kind
28616  * of message and if so deserialize it into a #GSocketControlMessage.
28617  *
28618  * If there is no implementation for this kind of control message, %NULL
28619  * will be returned.
28620  *
28621  * Returns: (transfer full): the deserialized message or %NULL
28622  * Since: 2.22
28623  */
28624
28625
28626 /**
28627  * g_socket_control_message_get_level:
28628  * @message: a #GSocketControlMessage
28629  *
28630  * Returns the "level" (i.e. the originating protocol) of the control message.
28631  * This is often SOL_SOCKET.
28632  *
28633  * Returns: an integer describing the level
28634  * Since: 2.22
28635  */
28636
28637
28638 /**
28639  * g_socket_control_message_get_msg_type:
28640  * @message: a #GSocketControlMessage
28641  *
28642  * Returns the protocol specific type of the control message.
28643  * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28644  *
28645  * Returns: an integer describing the type of control message
28646  * Since: 2.22
28647  */
28648
28649
28650 /**
28651  * g_socket_control_message_get_size:
28652  * @message: a #GSocketControlMessage
28653  *
28654  * Returns the space required for the control message, not including
28655  * headers or alignment.
28656  *
28657  * Returns: The number of bytes required.
28658  * Since: 2.22
28659  */
28660
28661
28662 /**
28663  * g_socket_control_message_serialize:
28664  * @message: a #GSocketControlMessage
28665  * @data: A buffer to write data to
28666  *
28667  * Converts the data in the message to bytes placed in the
28668  * message.
28669  *
28670  * @data is guaranteed to have enough space to fit the size
28671  * returned by g_socket_control_message_get_size() on this
28672  * object.
28673  *
28674  * Since: 2.22
28675  */
28676
28677
28678 /**
28679  * g_socket_create_source: (skip)
28680  * @socket: a #GSocket
28681  * @condition: a #GIOCondition mask to monitor
28682  * @cancellable: (allow-none): a %GCancellable or %NULL
28683  *
28684  * Creates a %GSource that can be attached to a %GMainContext to monitor
28685  * for the availibility of the specified @condition on the socket.
28686  *
28687  * The callback on the source is of the #GSocketSourceFunc type.
28688  *
28689  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28690  * these conditions will always be reported output if they are true.
28691  *
28692  * @cancellable if not %NULL can be used to cancel the source, which will
28693  * cause the source to trigger, reporting the current condition (which
28694  * is likely 0 unless cancellation happened at the same time as a
28695  * condition change). You can check for this in the callback using
28696  * g_cancellable_is_cancelled().
28697  *
28698  * If @socket has a timeout set, and it is reached before @condition
28699  * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28700  * %G_IO_OUT depending on @condition. However, @socket will have been
28701  * marked as having had a timeout, and so the next #GSocket I/O method
28702  * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28703  *
28704  * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
28705  * Since: 2.22
28706  */
28707
28708
28709 /**
28710  * g_socket_get_available_bytes:
28711  * @socket: a #GSocket
28712  *
28713  * Get the amount of data pending in the OS input buffer.
28714  *
28715  * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
28716  * Since: 2.32
28717  */
28718
28719
28720 /**
28721  * g_socket_get_blocking:
28722  * @socket: a #GSocket.
28723  *
28724  * Gets the blocking mode of the socket. For details on blocking I/O,
28725  * see g_socket_set_blocking().
28726  *
28727  * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
28728  * Since: 2.22
28729  */
28730
28731
28732 /**
28733  * g_socket_get_broadcast:
28734  * @socket: a #GSocket.
28735  *
28736  * Gets the broadcast setting on @socket; if %TRUE,
28737  * it is possible to send packets to broadcast
28738  * addresses or receive from broadcast addresses.
28739  *
28740  * Returns: the broadcast setting on @socket
28741  * Since: 2.32
28742  */
28743
28744
28745 /**
28746  * g_socket_get_credentials:
28747  * @socket: a #GSocket.
28748  * @error: #GError for error reporting, or %NULL to ignore.
28749  *
28750  * Returns the credentials of the foreign process connected to this
28751  * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
28752  * sockets).
28753  *
28754  * If this operation isn't supported on the OS, the method fails with
28755  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
28756  * by reading the %SO_PEERCRED option on the underlying socket.
28757  *
28758  * Other ways to obtain credentials from a foreign peer includes the
28759  * #GUnixCredentialsMessage type and
28760  * g_unix_connection_send_credentials() /
28761  * g_unix_connection_receive_credentials() functions.
28762  *
28763  * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
28764  * Since: 2.26
28765  */
28766
28767
28768 /**
28769  * g_socket_get_family:
28770  * @socket: a #GSocket.
28771  *
28772  * Gets the socket family of the socket.
28773  *
28774  * Returns: a #GSocketFamily
28775  * Since: 2.22
28776  */
28777
28778
28779 /**
28780  * g_socket_get_fd:
28781  * @socket: a #GSocket.
28782  *
28783  * Returns the underlying OS socket object. On unix this
28784  * is a socket file descriptor, and on windows this is
28785  * a Winsock2 SOCKET handle. This may be useful for
28786  * doing platform specific or otherwise unusual operations
28787  * on the socket.
28788  *
28789  * Returns: the file descriptor of the socket.
28790  * Since: 2.22
28791  */
28792
28793
28794 /**
28795  * g_socket_get_keepalive:
28796  * @socket: a #GSocket.
28797  *
28798  * Gets the keepalive mode of the socket. For details on this,
28799  * see g_socket_set_keepalive().
28800  *
28801  * Returns: %TRUE if keepalive is active, %FALSE otherwise.
28802  * Since: 2.22
28803  */
28804
28805
28806 /**
28807  * g_socket_get_listen_backlog:
28808  * @socket: a #GSocket.
28809  *
28810  * Gets the listen backlog setting of the socket. For details on this,
28811  * see g_socket_set_listen_backlog().
28812  *
28813  * Returns: the maximum number of pending connections.
28814  * Since: 2.22
28815  */
28816
28817
28818 /**
28819  * g_socket_get_local_address:
28820  * @socket: a #GSocket.
28821  * @error: #GError for error reporting, or %NULL to ignore.
28822  *
28823  * Try to get the local address of a bound socket. This is only
28824  * useful if the socket has been bound to a local address,
28825  * either explicitly or implicitly when connecting.
28826  *
28827  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28828  * Since: 2.22
28829  */
28830
28831
28832 /**
28833  * g_socket_get_multicast_loopback:
28834  * @socket: a #GSocket.
28835  *
28836  * Gets the multicast loopback setting on @socket; if %TRUE (the
28837  * default), outgoing multicast packets will be looped back to
28838  * multicast listeners on the same host.
28839  *
28840  * Returns: the multicast loopback setting on @socket
28841  * Since: 2.32
28842  */
28843
28844
28845 /**
28846  * g_socket_get_multicast_ttl:
28847  * @socket: a #GSocket.
28848  *
28849  * Gets the multicast time-to-live setting on @socket; see
28850  * g_socket_set_multicast_ttl() for more details.
28851  *
28852  * Returns: the multicast time-to-live setting on @socket
28853  * Since: 2.32
28854  */
28855
28856
28857 /**
28858  * g_socket_get_protocol:
28859  * @socket: a #GSocket.
28860  *
28861  * Gets the socket protocol id the socket was created with.
28862  * In case the protocol is unknown, -1 is returned.
28863  *
28864  * Returns: a protocol id, or -1 if unknown
28865  * Since: 2.22
28866  */
28867
28868
28869 /**
28870  * g_socket_get_remote_address:
28871  * @socket: a #GSocket.
28872  * @error: #GError for error reporting, or %NULL to ignore.
28873  *
28874  * Try to get the remove address of a connected socket. This is only
28875  * useful for connection oriented sockets that have been connected.
28876  *
28877  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28878  * Since: 2.22
28879  */
28880
28881
28882 /**
28883  * g_socket_get_socket_type:
28884  * @socket: a #GSocket.
28885  *
28886  * Gets the socket type of the socket.
28887  *
28888  * Returns: a #GSocketType
28889  * Since: 2.22
28890  */
28891
28892
28893 /**
28894  * g_socket_get_timeout:
28895  * @socket: a #GSocket.
28896  *
28897  * Gets the timeout setting of the socket. For details on this, see
28898  * g_socket_set_timeout().
28899  *
28900  * Returns: the timeout in seconds
28901  * Since: 2.26
28902  */
28903
28904
28905 /**
28906  * g_socket_get_ttl:
28907  * @socket: a #GSocket.
28908  *
28909  * Gets the unicast time-to-live setting on @socket; see
28910  * g_socket_set_ttl() for more details.
28911  *
28912  * Returns: the time-to-live setting on @socket
28913  * Since: 2.32
28914  */
28915
28916
28917 /**
28918  * g_socket_is_closed:
28919  * @socket: a #GSocket
28920  *
28921  * Checks whether a socket is closed.
28922  *
28923  * Returns: %TRUE if socket is closed, %FALSE otherwise
28924  * Since: 2.22
28925  */
28926
28927
28928 /**
28929  * g_socket_is_connected:
28930  * @socket: a #GSocket.
28931  *
28932  * Check whether the socket is connected. This is only useful for
28933  * connection-oriented sockets.
28934  *
28935  * Returns: %TRUE if socket is connected, %FALSE otherwise.
28936  * Since: 2.22
28937  */
28938
28939
28940 /**
28941  * g_socket_join_multicast_group:
28942  * @socket: a #GSocket.
28943  * @group: a #GInetAddress specifying the group address to join.
28944  * @iface: (allow-none): Name of the interface to use, or %NULL
28945  * @source_specific: %TRUE if source-specific multicast should be used
28946  * @error: #GError for error reporting, or %NULL to ignore.
28947  *
28948  * Registers @socket to receive multicast messages sent to @group.
28949  * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
28950  * been bound to an appropriate interface and port with
28951  * g_socket_bind().
28952  *
28953  * If @iface is %NULL, the system will automatically pick an interface
28954  * to bind to based on @group.
28955  *
28956  * If @source_specific is %TRUE, source-specific multicast as defined
28957  * in RFC 4604 is used. Note that on older platforms this may fail
28958  * with a %G_IO_ERROR_NOT_SUPPORTED error.
28959  *
28960  * Returns: %TRUE on success, %FALSE on error.
28961  * Since: 2.32
28962  */
28963
28964
28965 /**
28966  * g_socket_leave_multicast_group:
28967  * @socket: a #GSocket.
28968  * @group: a #GInetAddress specifying the group address to leave.
28969  * @iface: (allow-none): Interface used
28970  * @source_specific: %TRUE if source-specific multicast was used
28971  * @error: #GError for error reporting, or %NULL to ignore.
28972  *
28973  * Removes @socket from the multicast group defined by @group, @iface,
28974  * and @source_specific (which must all have the same values they had
28975  * when you joined the group).
28976  *
28977  * @socket remains bound to its address and port, and can still receive
28978  * unicast messages after calling this.
28979  *
28980  * Returns: %TRUE on success, %FALSE on error.
28981  * Since: 2.32
28982  */
28983
28984
28985 /**
28986  * g_socket_listen:
28987  * @socket: a #GSocket.
28988  * @error: #GError for error reporting, or %NULL to ignore.
28989  *
28990  * Marks the socket as a server socket, i.e. a socket that is used
28991  * to accept incoming requests using g_socket_accept().
28992  *
28993  * Before calling this the socket must be bound to a local address using
28994  * g_socket_bind().
28995  *
28996  * To set the maximum amount of outstanding clients, use
28997  * g_socket_set_listen_backlog().
28998  *
28999  * Returns: %TRUE on success, %FALSE on error.
29000  * Since: 2.22
29001  */
29002
29003
29004 /**
29005  * g_socket_listener_accept:
29006  * @listener: a #GSocketListener
29007  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29008  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29009  * @error: #GError for error reporting, or %NULL to ignore.
29010  *
29011  * Blocks waiting for a client to connect to any of the sockets added
29012  * to the listener. Returns a #GSocketConnection for the socket that was
29013  * accepted.
29014  *
29015  * If @source_object is not %NULL it will be filled out with the source
29016  * object specified when the corresponding socket or address was added
29017  * to the listener.
29018  *
29019  * If @cancellable is not %NULL, then the operation can be cancelled by
29020  * triggering the cancellable object from another thread. If the operation
29021  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29022  *
29023  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29024  * Since: 2.22
29025  */
29026
29027
29028 /**
29029  * g_socket_listener_accept_async:
29030  * @listener: a #GSocketListener
29031  * @cancellable: (allow-none): a #GCancellable, or %NULL
29032  * @callback: (scope async): a #GAsyncReadyCallback
29033  * @user_data: (closure): user data for the callback
29034  *
29035  * This is the asynchronous version of g_socket_listener_accept().
29036  *
29037  * When the operation is finished @callback will be
29038  * called. You can then call g_socket_listener_accept_socket()
29039  * to get the result of the operation.
29040  *
29041  * Since: 2.22
29042  */
29043
29044
29045 /**
29046  * g_socket_listener_accept_finish:
29047  * @listener: a #GSocketListener
29048  * @result: a #GAsyncResult.
29049  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29050  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29051  *
29052  * Finishes an async accept operation. See g_socket_listener_accept_async()
29053  *
29054  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29055  * Since: 2.22
29056  */
29057
29058
29059 /**
29060  * g_socket_listener_accept_socket:
29061  * @listener: a #GSocketListener
29062  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29063  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29064  * @error: #GError for error reporting, or %NULL to ignore.
29065  *
29066  * Blocks waiting for a client to connect to any of the sockets added
29067  * to the listener. Returns the #GSocket that was accepted.
29068  *
29069  * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29070  * which is often the case, then you should use g_socket_listener_accept()
29071  * instead.
29072  *
29073  * If @source_object is not %NULL it will be filled out with the source
29074  * object specified when the corresponding socket or address was added
29075  * to the listener.
29076  *
29077  * If @cancellable is not %NULL, then the operation can be cancelled by
29078  * triggering the cancellable object from another thread. If the operation
29079  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29080  *
29081  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29082  * Since: 2.22
29083  */
29084
29085
29086 /**
29087  * g_socket_listener_accept_socket_async:
29088  * @listener: a #GSocketListener
29089  * @cancellable: (allow-none): a #GCancellable, or %NULL
29090  * @callback: (scope async): a #GAsyncReadyCallback
29091  * @user_data: (closure): user data for the callback
29092  *
29093  * This is the asynchronous version of g_socket_listener_accept_socket().
29094  *
29095  * When the operation is finished @callback will be
29096  * called. You can then call g_socket_listener_accept_socket_finish()
29097  * to get the result of the operation.
29098  *
29099  * Since: 2.22
29100  */
29101
29102
29103 /**
29104  * g_socket_listener_accept_socket_finish:
29105  * @listener: a #GSocketListener
29106  * @result: a #GAsyncResult.
29107  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29108  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29109  *
29110  * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29111  *
29112  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29113  * Since: 2.22
29114  */
29115
29116
29117 /**
29118  * g_socket_listener_add_address:
29119  * @listener: a #GSocketListener
29120  * @address: a #GSocketAddress
29121  * @type: a #GSocketType
29122  * @protocol: a #GSocketProtocol
29123  * @source_object: (allow-none): Optional #GObject identifying this source
29124  * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29125  * @error: #GError for error reporting, or %NULL to ignore.
29126  *
29127  * Creates a socket of type @type and protocol @protocol, binds
29128  * it to @address and adds it to the set of sockets we're accepting
29129  * sockets from.
29130  *
29131  * Note that adding an IPv6 address, depending on the platform,
29132  * may or may not result in a listener that also accepts IPv4
29133  * connections.  For more deterministic behavior, see
29134  * g_socket_listener_add_inet_port().
29135  *
29136  * @source_object will be passed out in the various calls
29137  * to accept to identify this particular source, which is
29138  * useful if you're listening on multiple addresses and do
29139  * different things depending on what address is connected to.
29140  *
29141  * If successful and @effective_address is non-%NULL then it will
29142  * be set to the address that the binding actually occurred at.  This
29143  * is helpful for determining the port number that was used for when
29144  * requesting a binding to port 0 (ie: "any port").  This address, if
29145  * requested, belongs to the caller and must be freed.
29146  *
29147  * Returns: %TRUE on success, %FALSE on error.
29148  * Since: 2.22
29149  */
29150
29151
29152 /**
29153  * g_socket_listener_add_any_inet_port:
29154  * @listener: a #GSocketListener
29155  * @source_object: (allow-none): Optional #GObject identifying this source
29156  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29157  *
29158  * Listens for TCP connections on any available port number for both
29159  * IPv6 and IPv4 (if each is available).
29160  *
29161  * This is useful if you need to have a socket for incoming connections
29162  * but don't care about the specific port number.
29163  *
29164  * @source_object will be passed out in the various calls
29165  * to accept to identify this particular source, which is
29166  * useful if you're listening on multiple addresses and do
29167  * different things depending on what address is connected to.
29168  *
29169  * Returns: the port number, or 0 in case of failure.
29170  * Since: 2.24
29171  */
29172
29173
29174 /**
29175  * g_socket_listener_add_inet_port:
29176  * @listener: a #GSocketListener
29177  * @port: an IP port number (non-zero)
29178  * @source_object: (allow-none): Optional #GObject identifying this source
29179  * @error: #GError for error reporting, or %NULL to ignore.
29180  *
29181  * Helper function for g_socket_listener_add_address() that
29182  * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29183  * supported) on the specified port on all interfaces.
29184  *
29185  * @source_object will be passed out in the various calls
29186  * to accept to identify this particular source, which is
29187  * useful if you're listening on multiple addresses and do
29188  * different things depending on what address is connected to.
29189  *
29190  * Returns: %TRUE on success, %FALSE on error.
29191  * Since: 2.22
29192  */
29193
29194
29195 /**
29196  * g_socket_listener_add_socket:
29197  * @listener: a #GSocketListener
29198  * @socket: a listening #GSocket
29199  * @source_object: (allow-none): Optional #GObject identifying this source
29200  * @error: #GError for error reporting, or %NULL to ignore.
29201  *
29202  * Adds @socket to the set of sockets that we try to accept
29203  * new clients from. The socket must be bound to a local
29204  * address and listened to.
29205  *
29206  * @source_object will be passed out in the various calls
29207  * to accept to identify this particular source, which is
29208  * useful if you're listening on multiple addresses and do
29209  * different things depending on what address is connected to.
29210  *
29211  * Returns: %TRUE on success, %FALSE on error.
29212  * Since: 2.22
29213  */
29214
29215
29216 /**
29217  * g_socket_listener_close:
29218  * @listener: a #GSocketListener
29219  *
29220  * Closes all the sockets in the listener.
29221  *
29222  * Since: 2.22
29223  */
29224
29225
29226 /**
29227  * g_socket_listener_new:
29228  *
29229  * Creates a new #GSocketListener with no sockets to listen for.
29230  * New listeners can be added with e.g. g_socket_listener_add_address()
29231  * or g_socket_listener_add_inet_port().
29232  *
29233  * Returns: a new #GSocketListener.
29234  * Since: 2.22
29235  */
29236
29237
29238 /**
29239  * g_socket_listener_set_backlog:
29240  * @listener: a #GSocketListener
29241  * @listen_backlog: an integer
29242  *
29243  * Sets the listen backlog on the sockets in the listener.
29244  *
29245  * See g_socket_set_listen_backlog() for details
29246  *
29247  * Since: 2.22
29248  */
29249
29250
29251 /**
29252  * g_socket_new:
29253  * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29254  * @type: the socket type to use.
29255  * @protocol: the id of the protocol to use, or 0 for default.
29256  * @error: #GError for error reporting, or %NULL to ignore.
29257  *
29258  * Creates a new #GSocket with the defined family, type and protocol.
29259  * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29260  * for the family and type is used.
29261  *
29262  * The @protocol is a family and type specific int that specifies what
29263  * kind of protocol to use. #GSocketProtocol lists several common ones.
29264  * Many families only support one protocol, and use 0 for this, others
29265  * support several and using 0 means to use the default protocol for
29266  * the family and type.
29267  *
29268  * The protocol id is passed directly to the operating
29269  * system, so you can use protocols not listed in #GSocketProtocol if you
29270  * know the protocol number used for it.
29271  *
29272  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29273  * Since: 2.22
29274  */
29275
29276
29277 /**
29278  * g_socket_new_from_fd:
29279  * @fd: a native socket file descriptor.
29280  * @error: #GError for error reporting, or %NULL to ignore.
29281  *
29282  * Creates a new #GSocket from a native file descriptor
29283  * or winsock SOCKET handle.
29284  *
29285  * This reads all the settings from the file descriptor so that
29286  * all properties should work. Note that the file descriptor
29287  * will be set to non-blocking mode, independent on the blocking
29288  * mode of the #GSocket.
29289  *
29290  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29291  * Since: 2.22
29292  */
29293
29294
29295 /**
29296  * g_socket_receive:
29297  * @socket: a #GSocket
29298  * @buffer: a buffer to read data into (which should be at least @size bytes long).
29299  * @size: the number of bytes you want to read from the socket
29300  * @cancellable: (allow-none): a %GCancellable or %NULL
29301  * @error: #GError for error reporting, or %NULL to ignore.
29302  *
29303  * Receive data (up to @size bytes) from a socket. This is mainly used by
29304  * connection-oriented sockets; it is identical to g_socket_receive_from()
29305  * with @address set to %NULL.
29306  *
29307  * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29308  * g_socket_receive() will always read either 0 or 1 complete messages from
29309  * the socket. If the received message is too large to fit in @buffer, then
29310  * the data beyond @size bytes will be discarded, without any explicit
29311  * indication that this has occurred.
29312  *
29313  * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29314  * number of bytes, up to @size. If more than @size bytes have been
29315  * received, the additional data will be returned in future calls to
29316  * g_socket_receive().
29317  *
29318  * If the socket is in blocking mode the call will block until there
29319  * is some data to receive, the connection is closed, or there is an
29320  * error. If there is no data available and the socket is in
29321  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29322  * returned. To be notified when data is available, wait for the
29323  * %G_IO_IN condition.
29324  *
29325  * On error -1 is returned and @error is set accordingly.
29326  *
29327  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29328  * Since: 2.22
29329  */
29330
29331
29332 /**
29333  * g_socket_receive_from:
29334  * @socket: a #GSocket
29335  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29336  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29337  * @size: the number of bytes you want to read from the socket
29338  * @cancellable: (allow-none): a %GCancellable or %NULL
29339  * @error: #GError for error reporting, or %NULL to ignore.
29340  *
29341  * Receive data (up to @size bytes) from a socket.
29342  *
29343  * If @address is non-%NULL then @address will be set equal to the
29344  * source address of the received packet.
29345  * @address is owned by the caller.
29346  *
29347  * See g_socket_receive() for additional information.
29348  *
29349  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29350  * Since: 2.22
29351  */
29352
29353
29354 /**
29355  * g_socket_receive_message:
29356  * @socket: a #GSocket
29357  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29358  * @vectors: (array length=num_vectors): an array of #GInputVector structs
29359  * @num_vectors: the number of elements in @vectors, or -1
29360  * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29361  * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29362  * @flags: a pointer to an int containing #GSocketMsgFlags flags
29363  * @cancellable: (allow-none): a %GCancellable or %NULL
29364  * @error: a #GError pointer, or %NULL
29365  *
29366  * Receive data from a socket.  This is the most complicated and
29367  * fully-featured version of this call. For easier use, see
29368  * g_socket_receive() and g_socket_receive_from().
29369  *
29370  * If @address is non-%NULL then @address will be set equal to the
29371  * source address of the received packet.
29372  * @address is owned by the caller.
29373  *
29374  * @vector must point to an array of #GInputVector structs and
29375  * @num_vectors must be the length of this array.  These structs
29376  * describe the buffers that received data will be scattered into.
29377  * If @num_vectors is -1, then @vectors is assumed to be terminated
29378  * by a #GInputVector with a %NULL buffer pointer.
29379  *
29380  * As a special case, if @num_vectors is 0 (in which case, @vectors
29381  * may of course be %NULL), then a single byte is received and
29382  * discarded. This is to facilitate the common practice of sending a
29383  * single '\0' byte for the purposes of transferring ancillary data.
29384  *
29385  * @messages, if non-%NULL, will be set to point to a newly-allocated
29386  * array of #GSocketControlMessage instances or %NULL if no such
29387  * messages was received. These correspond to the control messages
29388  * received from the kernel, one #GSocketControlMessage per message
29389  * from the kernel. This array is %NULL-terminated and must be freed
29390  * by the caller using g_free() after calling g_object_unref() on each
29391  * element. If @messages is %NULL, any control messages received will
29392  * be discarded.
29393  *
29394  * @num_messages, if non-%NULL, will be set to the number of control
29395  * messages received.
29396  *
29397  * If both @messages and @num_messages are non-%NULL, then
29398  * @num_messages gives the number of #GSocketControlMessage instances
29399  * in @messages (ie: not including the %NULL terminator).
29400  *
29401  * @flags is an in/out parameter. The commonly available arguments
29402  * for this are available in the #GSocketMsgFlags enum, but the
29403  * values there are the same as the system values, and the flags
29404  * are passed in as-is, so you can pass in system-specific flags too
29405  * (and g_socket_receive_message() may pass system-specific flags out).
29406  *
29407  * As with g_socket_receive(), data may be discarded if @socket is
29408  * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29409  * provide enough buffer space to read a complete message. You can pass
29410  * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29411  * removing it from the receive queue, but there is no portable way to find
29412  * out the length of the message other than by reading it into a
29413  * sufficiently-large buffer.
29414  *
29415  * If the socket is in blocking mode the call will block until there
29416  * is some data to receive, the connection is closed, or there is an
29417  * error. If there is no data available and the socket is in
29418  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29419  * returned. To be notified when data is available, wait for the
29420  * %G_IO_IN condition.
29421  *
29422  * On error -1 is returned and @error is set accordingly.
29423  *
29424  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29425  * Since: 2.22
29426  */
29427
29428
29429 /**
29430  * g_socket_receive_with_blocking:
29431  * @socket: a #GSocket
29432  * @buffer: a buffer to read data into (which should be at least @size bytes long).
29433  * @size: the number of bytes you want to read from the socket
29434  * @blocking: whether to do blocking or non-blocking I/O
29435  * @cancellable: (allow-none): a %GCancellable or %NULL
29436  * @error: #GError for error reporting, or %NULL to ignore.
29437  *
29438  * This behaves exactly the same as g_socket_receive(), except that
29439  * the choice of blocking or non-blocking behavior is determined by
29440  * the @blocking argument rather than by @socket's properties.
29441  *
29442  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29443  * Since: 2.26
29444  */
29445
29446
29447 /**
29448  * g_socket_send:
29449  * @socket: a #GSocket
29450  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29451  * @size: the number of bytes to send
29452  * @cancellable: (allow-none): a %GCancellable or %NULL
29453  * @error: #GError for error reporting, or %NULL to ignore.
29454  *
29455  * Tries to send @size bytes from @buffer on the socket. This is
29456  * mainly used by connection-oriented sockets; it is identical to
29457  * g_socket_send_to() with @address set to %NULL.
29458  *
29459  * If the socket is in blocking mode the call will block until there is
29460  * space for the data in the socket queue. If there is no space available
29461  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29462  * will be returned. To be notified when space is available, wait for the
29463  * %G_IO_OUT condition. Note though that you may still receive
29464  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29465  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29466  * very common due to the way the underlying APIs work.)
29467  *
29468  * On error -1 is returned and @error is set accordingly.
29469  *
29470  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29471  * Since: 2.22
29472  */
29473
29474
29475 /**
29476  * g_socket_send_message:
29477  * @socket: a #GSocket
29478  * @address: (allow-none): a #GSocketAddress, or %NULL
29479  * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29480  * @num_vectors: the number of elements in @vectors, or -1
29481  * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29482  * @num_messages: number of elements in @messages, or -1.
29483  * @flags: an int containing #GSocketMsgFlags flags
29484  * @cancellable: (allow-none): a %GCancellable or %NULL
29485  * @error: #GError for error reporting, or %NULL to ignore.
29486  *
29487  * Send data to @address on @socket.  This is the most complicated and
29488  * fully-featured version of this call. For easier use, see
29489  * g_socket_send() and g_socket_send_to().
29490  *
29491  * If @address is %NULL then the message is sent to the default receiver
29492  * (set by g_socket_connect()).
29493  *
29494  * @vectors must point to an array of #GOutputVector structs and
29495  * @num_vectors must be the length of this array. (If @num_vectors is -1,
29496  * then @vectors is assumed to be terminated by a #GOutputVector with a
29497  * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29498  * that the sent data will be gathered from. Using multiple
29499  * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29500  * data from multiple sources into a single buffer, and more
29501  * network-efficient than making multiple calls to g_socket_send().
29502  *
29503  * @messages, if non-%NULL, is taken to point to an array of @num_messages
29504  * #GSocketControlMessage instances. These correspond to the control
29505  * messages to be sent on the socket.
29506  * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29507  * array.
29508  *
29509  * @flags modify how the message is sent. The commonly available arguments
29510  * for this are available in the #GSocketMsgFlags enum, but the
29511  * values there are the same as the system values, and the flags
29512  * are passed in as-is, so you can pass in system-specific flags too.
29513  *
29514  * If the socket is in blocking mode the call will block until there is
29515  * space for the data in the socket queue. If there is no space available
29516  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29517  * will be returned. To be notified when space is available, wait for the
29518  * %G_IO_OUT condition. Note though that you may still receive
29519  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29520  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29521  * very common due to the way the underlying APIs work.)
29522  *
29523  * On error -1 is returned and @error is set accordingly.
29524  *
29525  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29526  * Since: 2.22
29527  */
29528
29529
29530 /**
29531  * g_socket_send_to:
29532  * @socket: a #GSocket
29533  * @address: (allow-none): a #GSocketAddress, or %NULL
29534  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29535  * @size: the number of bytes to send
29536  * @cancellable: (allow-none): a %GCancellable or %NULL
29537  * @error: #GError for error reporting, or %NULL to ignore.
29538  *
29539  * Tries to send @size bytes from @buffer to @address. If @address is
29540  * %NULL then the message is sent to the default receiver (set by
29541  * g_socket_connect()).
29542  *
29543  * See g_socket_send() for additional information.
29544  *
29545  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29546  * Since: 2.22
29547  */
29548
29549
29550 /**
29551  * g_socket_send_with_blocking:
29552  * @socket: a #GSocket
29553  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29554  * @size: the number of bytes to send
29555  * @blocking: whether to do blocking or non-blocking I/O
29556  * @cancellable: (allow-none): a %GCancellable or %NULL
29557  * @error: #GError for error reporting, or %NULL to ignore.
29558  *
29559  * This behaves exactly the same as g_socket_send(), except that
29560  * the choice of blocking or non-blocking behavior is determined by
29561  * the @blocking argument rather than by @socket's properties.
29562  *
29563  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29564  * Since: 2.26
29565  */
29566
29567
29568 /**
29569  * g_socket_service_is_active:
29570  * @service: a #GSocketService
29571  *
29572  * Check whether the service is active or not. An active
29573  * service will accept new clients that connect, while
29574  * a non-active service will let connecting clients queue
29575  * up until the service is started.
29576  *
29577  * Returns: %TRUE if the service is active, %FALSE otherwise
29578  * Since: 2.22
29579  */
29580
29581
29582 /**
29583  * g_socket_service_new:
29584  *
29585  * Creates a new #GSocketService with no sockets to listen for.
29586  * New listeners can be added with e.g. g_socket_listener_add_address()
29587  * or g_socket_listener_add_inet_port().
29588  *
29589  * Returns: a new #GSocketService.
29590  * Since: 2.22
29591  */
29592
29593
29594 /**
29595  * g_socket_service_start:
29596  * @service: a #GSocketService
29597  *
29598  * Starts the service, i.e. start accepting connections
29599  * from the added sockets when the mainloop runs.
29600  *
29601  * This call is thread-safe, so it may be called from a thread
29602  * handling an incoming client request.
29603  *
29604  * Since: 2.22
29605  */
29606
29607
29608 /**
29609  * g_socket_service_stop:
29610  * @service: a #GSocketService
29611  *
29612  * Stops the service, i.e. stops accepting connections
29613  * from the added sockets when the mainloop runs.
29614  *
29615  * This call is thread-safe, so it may be called from a thread
29616  * handling an incoming client request.
29617  *
29618  * Since: 2.22
29619  */
29620
29621
29622 /**
29623  * g_socket_set_blocking:
29624  * @socket: a #GSocket.
29625  * @blocking: Whether to use blocking I/O or not.
29626  *
29627  * Sets the blocking mode of the socket. In blocking mode
29628  * all operations block until they succeed or there is an error. In
29629  * non-blocking mode all functions return results immediately or
29630  * with a %G_IO_ERROR_WOULD_BLOCK error.
29631  *
29632  * All sockets are created in blocking mode. However, note that the
29633  * platform level socket is always non-blocking, and blocking mode
29634  * is a GSocket level feature.
29635  *
29636  * Since: 2.22
29637  */
29638
29639
29640 /**
29641  * g_socket_set_broadcast:
29642  * @socket: a #GSocket.
29643  * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29644  *
29645  * Sets whether @socket should allow sending to and receiving from
29646  * broadcast addresses. This is %FALSE by default.
29647  *
29648  * Since: 2.32
29649  */
29650
29651
29652 /**
29653  * g_socket_set_keepalive:
29654  * @socket: a #GSocket.
29655  * @keepalive: Value for the keepalive flag
29656  *
29657  * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29658  * this flag is set on a socket, the system will attempt to verify that the
29659  * remote socket endpoint is still present if a sufficiently long period of
29660  * time passes with no data being exchanged. If the system is unable to
29661  * verify the presence of the remote endpoint, it will automatically close
29662  * the connection.
29663  *
29664  * This option is only functional on certain kinds of sockets. (Notably,
29665  * %G_SOCKET_PROTOCOL_TCP sockets.)
29666  *
29667  * The exact time between pings is system- and protocol-dependent, but will
29668  * normally be at least two hours. Most commonly, you would set this flag
29669  * on a server socket if you want to allow clients to remain idle for long
29670  * periods of time, but also want to ensure that connections are eventually
29671  * garbage-collected if clients crash or become unreachable.
29672  *
29673  * Since: 2.22
29674  */
29675
29676
29677 /**
29678  * g_socket_set_listen_backlog:
29679  * @socket: a #GSocket.
29680  * @backlog: the maximum number of pending connections.
29681  *
29682  * Sets the maximum number of outstanding connections allowed
29683  * when listening on this socket. If more clients than this are
29684  * connecting to the socket and the application is not handling them
29685  * on time then the new connections will be refused.
29686  *
29687  * Note that this must be called before g_socket_listen() and has no
29688  * effect if called after that.
29689  *
29690  * Since: 2.22
29691  */
29692
29693
29694 /**
29695  * g_socket_set_multicast_loopback:
29696  * @socket: a #GSocket.
29697  * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29698  *
29699  * Sets whether outgoing multicast packets will be received by sockets
29700  * listening on that multicast address on the same host. This is %TRUE
29701  * by default.
29702  *
29703  * Since: 2.32
29704  */
29705
29706
29707 /**
29708  * g_socket_set_multicast_ttl:
29709  * @socket: a #GSocket.
29710  * @ttl: the time-to-live value for all multicast datagrams on @socket
29711  *
29712  * Sets the time-to-live for outgoing multicast datagrams on @socket.
29713  * By default, this is 1, meaning that multicast packets will not leave
29714  * the local network.
29715  *
29716  * Since: 2.32
29717  */
29718
29719
29720 /**
29721  * g_socket_set_timeout:
29722  * @socket: a #GSocket.
29723  * @timeout: the timeout for @socket, in seconds, or 0 for none
29724  *
29725  * Sets the time in seconds after which I/O operations on @socket will
29726  * time out if they have not yet completed.
29727  *
29728  * On a blocking socket, this means that any blocking #GSocket
29729  * operation will time out after @timeout seconds of inactivity,
29730  * returning %G_IO_ERROR_TIMED_OUT.
29731  *
29732  * On a non-blocking socket, calls to g_socket_condition_wait() will
29733  * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
29734  * created with g_socket_create_source() will trigger after
29735  * @timeout seconds of inactivity, with the requested condition
29736  * set, at which point calling g_socket_receive(), g_socket_send(),
29737  * g_socket_check_connect_result(), etc, will fail with
29738  * %G_IO_ERROR_TIMED_OUT.
29739  *
29740  * If @timeout is 0 (the default), operations will never time out
29741  * on their own.
29742  *
29743  * Note that if an I/O operation is interrupted by a signal, this may
29744  * cause the timeout to be reset.
29745  *
29746  * Since: 2.26
29747  */
29748
29749
29750 /**
29751  * g_socket_set_ttl:
29752  * @socket: a #GSocket.
29753  * @ttl: the time-to-live value for all unicast packets on @socket
29754  *
29755  * Sets the time-to-live for outgoing unicast packets on @socket.
29756  * By default the platform-specific default value is used.
29757  *
29758  * Since: 2.32
29759  */
29760
29761
29762 /**
29763  * g_socket_shutdown:
29764  * @socket: a #GSocket
29765  * @shutdown_read: whether to shut down the read side
29766  * @shutdown_write: whether to shut down the write side
29767  * @error: #GError for error reporting, or %NULL to ignore.
29768  *
29769  * Shut down part of a full-duplex connection.
29770  *
29771  * If @shutdown_read is %TRUE then the receiving side of the connection
29772  * is shut down, and further reading is disallowed.
29773  *
29774  * If @shutdown_write is %TRUE then the sending side of the connection
29775  * is shut down, and further writing is disallowed.
29776  *
29777  * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
29778  *
29779  * One example where this is used is graceful disconnect for TCP connections
29780  * where you close the sending side, then wait for the other side to close
29781  * the connection, thus ensuring that the other side saw all sent data.
29782  *
29783  * Returns: %TRUE on success, %FALSE on error
29784  * Since: 2.22
29785  */
29786
29787
29788 /**
29789  * g_socket_speaks_ipv4:
29790  * @socket: a #GSocket
29791  *
29792  * Checks if a socket is capable of speaking IPv4.
29793  *
29794  * IPv4 sockets are capable of speaking IPv4.  On some operating systems
29795  * and under some combinations of circumstances IPv6 sockets are also
29796  * capable of speaking IPv4.  See RFC 3493 section 3.7 for more
29797  * information.
29798  *
29799  * No other types of sockets are currently considered as being capable
29800  * of speaking IPv4.
29801  *
29802  * Returns: %TRUE if this socket can be used with IPv4.
29803  * Since: 2.22
29804  */
29805
29806
29807 /**
29808  * g_srv_target_copy:
29809  * @target: a #GSrvTarget
29810  *
29811  * Copies @target
29812  *
29813  * Returns: a copy of @target
29814  * Since: 2.22
29815  */
29816
29817
29818 /**
29819  * g_srv_target_free:
29820  * @target: a #GSrvTarget
29821  *
29822  * Frees @target
29823  *
29824  * Since: 2.22
29825  */
29826
29827
29828 /**
29829  * g_srv_target_get_hostname:
29830  * @target: a #GSrvTarget
29831  *
29832  * Gets @target's hostname (in ASCII form; if you are going to present
29833  * this to the user, you should use g_hostname_is_ascii_encoded() to
29834  * check if it contains encoded Unicode segments, and use
29835  * g_hostname_to_unicode() to convert it if it does.)
29836  *
29837  * Returns: @target's hostname
29838  * Since: 2.22
29839  */
29840
29841
29842 /**
29843  * g_srv_target_get_port:
29844  * @target: a #GSrvTarget
29845  *
29846  * Gets @target's port
29847  *
29848  * Returns: @target's port
29849  * Since: 2.22
29850  */
29851
29852
29853 /**
29854  * g_srv_target_get_priority:
29855  * @target: a #GSrvTarget
29856  *
29857  * Gets @target's priority. You should not need to look at this;
29858  * #GResolver already sorts the targets according to the algorithm in
29859  * RFC 2782.
29860  *
29861  * Returns: @target's priority
29862  * Since: 2.22
29863  */
29864
29865
29866 /**
29867  * g_srv_target_get_weight:
29868  * @target: a #GSrvTarget
29869  *
29870  * Gets @target's weight. You should not need to look at this;
29871  * #GResolver already sorts the targets according to the algorithm in
29872  * RFC 2782.
29873  *
29874  * Returns: @target's weight
29875  * Since: 2.22
29876  */
29877
29878
29879 /**
29880  * g_srv_target_list_sort: (skip)
29881  * @targets: a #GList of #GSrvTarget
29882  *
29883  * Sorts @targets in place according to the algorithm in RFC 2782.
29884  *
29885  * Returns: (transfer full): the head of the sorted list.
29886  * Since: 2.22
29887  */
29888
29889
29890 /**
29891  * g_srv_target_new:
29892  * @hostname: the host that the service is running on
29893  * @port: the port that the service is running on
29894  * @priority: the target's priority
29895  * @weight: the target's weight
29896  *
29897  * Creates a new #GSrvTarget with the given parameters.
29898  *
29899  * You should not need to use this; normally #GSrvTarget<!-- -->s are
29900  * created by #GResolver.
29901  *
29902  * Returns: a new #GSrvTarget.
29903  * Since: 2.22
29904  */
29905
29906
29907 /**
29908  * g_static_resource_fini:
29909  * @static_resource: pointer to a static #GStaticResource
29910  *
29911  * Finalized a GResource initialized by g_static_resource_init().
29912  *
29913  * This is normally used by code generated by
29914  * <link linkend="glib-compile-resources">glib-compile-resources</link>
29915  * and is not typically used by other code.
29916  *
29917  * Since: 2.32
29918  */
29919
29920
29921 /**
29922  * g_static_resource_get_resource:
29923  * @static_resource: pointer to a static #GStaticResource
29924  *
29925  * Gets the GResource that was registred by a call to g_static_resource_init().
29926  *
29927  * This is normally used by code generated by
29928  * <link linkend="glib-compile-resources">glib-compile-resources</link>
29929  * and is not typically used by other code.
29930  *
29931  * Returns: (transfer none): a #GResource
29932  * Since: 2.32
29933  */
29934
29935
29936 /**
29937  * g_static_resource_init:
29938  * @static_resource: pointer to a static #GStaticResource
29939  *
29940  * Initializes a GResource from static data using a
29941  * GStaticResource.
29942  *
29943  * This is normally used by code generated by
29944  * <link linkend="glib-compile-resources">glib-compile-resources</link>
29945  * and is not typically used by other code.
29946  *
29947  * Since: 2.32
29948  */
29949
29950
29951 /**
29952  * g_tcp_connection_get_graceful_disconnect:
29953  * @connection: a #GTcpConnection
29954  *
29955  * Checks if graceful disconnects are used. See
29956  * g_tcp_connection_set_graceful_disconnect().
29957  *
29958  * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
29959  * Since: 2.22
29960  */
29961
29962
29963 /**
29964  * g_tcp_connection_set_graceful_disconnect:
29965  * @connection: a #GTcpConnection
29966  * @graceful_disconnect: Whether to do graceful disconnects or not
29967  *
29968  * This enabled graceful disconnects on close. A graceful disconnect
29969  * means that we signal the receiving end that the connection is terminated
29970  * and wait for it to close the connection before closing the connection.
29971  *
29972  * A graceful disconnect means that we can be sure that we successfully sent
29973  * all the outstanding data to the other end, or get an error reported.
29974  * However, it also means we have to wait for all the data to reach the
29975  * other side and for it to acknowledge this by closing the socket, which may
29976  * take a while. For this reason it is disabled by default.
29977  *
29978  * Since: 2.22
29979  */
29980
29981
29982 /**
29983  * g_tcp_wrapper_connection_get_base_io_stream:
29984  * @conn: a #GTcpWrapperConnection
29985  *
29986  * Get's @conn's base #GIOStream
29987  *
29988  * Returns: (transfer none): @conn's base #GIOStream
29989  */
29990
29991
29992 /**
29993  * g_tcp_wrapper_connection_new:
29994  * @base_io_stream: the #GIOStream to wrap
29995  * @socket: the #GSocket associated with @base_io_stream
29996  *
29997  * Wraps @base_io_stream and @socket together as a #GSocketConnection.
29998  *
29999  * Returns: the new #GSocketConnection.
30000  * Since: 2.28
30001  */
30002
30003
30004 /**
30005  * g_test_dbus_add_service_dir:
30006  * @self: a #GTestDBus
30007  * @path: path to a directory containing .service files
30008  *
30009  * Add a path where dbus-daemon will lookup for .services files. This can't be
30010  * called after g_test_dbus_up().
30011  */
30012
30013
30014 /**
30015  * g_test_dbus_down:
30016  * @self: a #GTestDBus
30017  *
30018  * Stop the session bus started by g_test_dbus_up().
30019  *
30020  * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30021  * is destroyed. This is done to ensure that the next unit test won't get a
30022  * leaked singleton from this test.
30023  */
30024
30025
30026 /**
30027  * g_test_dbus_get_bus_address:
30028  * @self: a #GTestDBus
30029  *
30030  * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30031  * been called yet, %NULL is returned. This can be used with
30032  * g_dbus_connection_new_for_address()
30033  *
30034  * Returns: the address of the bus, or %NULL.
30035  */
30036
30037
30038 /**
30039  * g_test_dbus_get_flags:
30040  * @self: a #GTestDBus
30041  *
30042  *
30043  *
30044  * Returns: the value of #GTestDBus:flags property
30045  */
30046
30047
30048 /**
30049  * g_test_dbus_new:
30050  * @flags: a #GTestDBusFlags
30051  *
30052  * Create a new #GTestDBus object.
30053  *
30054  * Returns: (transfer full): a new #GTestDBus.
30055  */
30056
30057
30058 /**
30059  * g_test_dbus_stop:
30060  * @self: a #GTestDBus
30061  *
30062  * Stop the session bus started by g_test_dbus_up().
30063  *
30064  * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30065  * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30066  * tests wanting to verify behaviour after the session bus has been stopped
30067  * can use this function but should still call g_test_dbus_down() when done.
30068  */
30069
30070
30071 /**
30072  * g_test_dbus_unset:
30073  *
30074  * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30075  * won't use user's session bus.
30076  *
30077  * This is useful for unit tests that want to verify behaviour when no session
30078  * bus is running. It is not necessary to call this if unit test already calls
30079  * g_test_dbus_up() before acquiring the session bus.
30080  */
30081
30082
30083 /**
30084  * g_test_dbus_up:
30085  * @self: a #GTestDBus
30086  *
30087  * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30088  * call, it is safe for unit tests to start sending messages on the session bug.
30089  *
30090  * If this function is called from setup callback of g_test_add(),
30091  * g_test_dbus_down() must be called in its teardown callback.
30092  *
30093  * If this function is called from unit test's main(), then g_test_dbus_down()
30094  * must be called after g_test_run().
30095  */
30096
30097
30098 /**
30099  * g_themed_icon_append_name:
30100  * @icon: a #GThemedIcon
30101  * @iconname: name of icon to append to list of icons from within @icon.
30102  *
30103  * Append a name to the list of icons from within @icon.
30104  *
30105  * <note><para>
30106  * Note that doing so invalidates the hash computed by prior calls
30107  * to g_icon_hash().
30108  * </para></note>
30109  */
30110
30111
30112 /**
30113  * g_themed_icon_get_names:
30114  * @icon: a #GThemedIcon.
30115  *
30116  * Gets the names of icons from within @icon.
30117  *
30118  * Returns: (transfer none): a list of icon names.
30119  */
30120
30121
30122 /**
30123  * g_themed_icon_new:
30124  * @iconname: a string containing an icon name.
30125  *
30126  * Creates a new themed icon for @iconname.
30127  *
30128  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30129  */
30130
30131
30132 /**
30133  * g_themed_icon_new_from_names:
30134  * @iconnames: (array length=len): an array of strings containing icon names.
30135  * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30136  *
30137  * Creates a new themed icon for @iconnames.
30138  *
30139  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30140  */
30141
30142
30143 /**
30144  * g_themed_icon_new_with_default_fallbacks:
30145  * @iconname: a string containing an icon name
30146  *
30147  * Creates a new themed icon for @iconname, and all the names
30148  * that can be created by shortening @iconname at '-' characters.
30149  *
30150  * In the following example, @icon1 and @icon2 are equivalent:
30151  * |[
30152  * const char *names[] = {
30153  *   "gnome-dev-cdrom-audio",
30154  *   "gnome-dev-cdrom",
30155  *   "gnome-dev",
30156  *   "gnome"
30157  * };
30158  *
30159  * icon1 = g_themed_icon_new_from_names (names, 4);
30160  * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30161  * ]|
30162  *
30163  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30164  */
30165
30166
30167 /**
30168  * g_themed_icon_prepend_name:
30169  * @icon: a #GThemedIcon
30170  * @iconname: name of icon to prepend to list of icons from within @icon.
30171  *
30172  * Prepend a name to the list of icons from within @icon.
30173  *
30174  * <note><para>
30175  * Note that doing so invalidates the hash computed by prior calls
30176  * to g_icon_hash().
30177  * </para></note>
30178  *
30179  * Since: 2.18
30180  */
30181
30182
30183 /**
30184  * g_threaded_socket_service_new:
30185  * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30186  *
30187  * Creates a new #GThreadedSocketService with no listeners. Listeners
30188  * must be added with one of the #GSocketListener "add" methods.
30189  *
30190  * Returns: a new #GSocketService.
30191  * Since: 2.22
30192  */
30193
30194
30195 /**
30196  * g_tls_backend_get_certificate_type:
30197  * @backend: the #GTlsBackend
30198  *
30199  * Gets the #GType of @backend's #GTlsCertificate implementation.
30200  *
30201  * Returns: the #GType of @backend's #GTlsCertificate implementation.
30202  * Since: 2.28
30203  */
30204
30205
30206 /**
30207  * g_tls_backend_get_client_connection_type:
30208  * @backend: the #GTlsBackend
30209  *
30210  * Gets the #GType of @backend's #GTlsClientConnection implementation.
30211  *
30212  * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30213  * Since: 2.28
30214  */
30215
30216
30217 /**
30218  * g_tls_backend_get_default:
30219  *
30220  * Gets the default #GTlsBackend for the system.
30221  *
30222  * Returns: (transfer none): a #GTlsBackend
30223  * Since: 2.28
30224  */
30225
30226
30227 /**
30228  * g_tls_backend_get_default_database:
30229  * @backend: the #GTlsBackend
30230  *
30231  * Gets the default #GTlsDatabase used to verify TLS connections.
30232  *
30233  * Returns: (transfer full): the default database, which should be unreffed when done.
30234  * Since: 2.30
30235  */
30236
30237
30238 /**
30239  * g_tls_backend_get_file_database_type:
30240  * @backend: the #GTlsBackend
30241  *
30242  * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30243  *
30244  * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30245  * Since: 2.30
30246  */
30247
30248
30249 /**
30250  * g_tls_backend_get_server_connection_type:
30251  * @backend: the #GTlsBackend
30252  *
30253  * Gets the #GType of @backend's #GTlsServerConnection implementation.
30254  *
30255  * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30256  * Since: 2.28
30257  */
30258
30259
30260 /**
30261  * g_tls_backend_supports_tls:
30262  * @backend: the #GTlsBackend
30263  *
30264  * Checks if TLS is supported; if this returns %FALSE for the default
30265  * #GTlsBackend, it means no "real" TLS backend is available.
30266  *
30267  * Returns: whether or not TLS is supported
30268  * Since: 2.28
30269  */
30270
30271
30272 /**
30273  * g_tls_certificate_get_issuer:
30274  * @cert: a #GTlsCertificate
30275  *
30276  * Gets the #GTlsCertificate representing @cert's issuer, if known
30277  *
30278  * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30279  * Since: 2.28
30280  */
30281
30282
30283 /**
30284  * g_tls_certificate_list_new_from_file:
30285  * @file: file containing PEM-encoded certificates to import
30286  * @error: #GError for error reporting, or %NULL to ignore.
30287  *
30288  * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30289  * data in @file. If @file cannot be read or parsed, the function will
30290  * return %NULL and set @error. If @file does not contain any
30291  * PEM-encoded certificates, this will return an empty list and not
30292  * set @error.
30293  *
30294  * 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.
30295  * Since: 2.28
30296  */
30297
30298
30299 /**
30300  * g_tls_certificate_new_from_file:
30301  * @file: file containing a PEM-encoded certificate to import
30302  * @error: #GError for error reporting, or %NULL to ignore.
30303  *
30304  * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30305  * @file cannot be read or parsed, the function will return %NULL and
30306  * set @error. Otherwise, this behaves like
30307  * g_tls_certificate_new_from_pem().
30308  *
30309  * Returns: the new certificate, or %NULL on error
30310  * Since: 2.28
30311  */
30312
30313
30314 /**
30315  * g_tls_certificate_new_from_files:
30316  * @cert_file: file containing a PEM-encoded certificate to import
30317  * @key_file: file containing a PEM-encoded private key to import
30318  * @error: #GError for error reporting, or %NULL to ignore.
30319  *
30320  * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30321  * and @key_file. If either file cannot be read or parsed, the
30322  * function will return %NULL and set @error. Otherwise, this behaves
30323  * like g_tls_certificate_new_from_pem().
30324  *
30325  * Returns: the new certificate, or %NULL on error
30326  * Since: 2.28
30327  */
30328
30329
30330 /**
30331  * g_tls_certificate_new_from_pem:
30332  * @data: PEM-encoded certificate data
30333  * @length: the length of @data, or -1 if it's 0-terminated.
30334  * @error: #GError for error reporting, or %NULL to ignore.
30335  *
30336  * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30337  * If @data includes both a certificate and a private key, then the
30338  * returned certificate will include the private key data as well. (See
30339  * the #GTlsCertificate:private-key-pem property for information about
30340  * supported formats.)
30341  *
30342  * If @data includes multiple certificates, only the first one will be
30343  * parsed.
30344  *
30345  * Returns: the new certificate, or %NULL if @data is invalid
30346  * Since: 2.28
30347  */
30348
30349
30350 /**
30351  * g_tls_certificate_verify:
30352  * @cert: a #GTlsCertificate
30353  * @identity: (allow-none): the expected peer identity
30354  * @trusted_ca: (allow-none): the certificate of a trusted authority
30355  *
30356  * This verifies @cert and returns a set of #GTlsCertificateFlags
30357  * indicating any problems found with it. This can be used to verify a
30358  * certificate outside the context of making a connection, or to
30359  * check a certificate against a CA that is not part of the system
30360  * CA database.
30361  *
30362  * If @identity is not %NULL, @cert's name(s) will be compared against
30363  * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30364  * value if it does not match. If @identity is %NULL, that bit will
30365  * never be set in the return value.
30366  *
30367  * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30368  * in its chain) must be signed by it, or else
30369  * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30370  * @trusted_ca is %NULL, that bit will never be set in the return
30371  * value.
30372  *
30373  * (All other #GTlsCertificateFlags values will always be set or unset
30374  * as appropriate.)
30375  *
30376  * Returns: the appropriate #GTlsCertificateFlags
30377  * Since: 2.28
30378  */
30379
30380
30381 /**
30382  * g_tls_client_connection_get_accepted_cas:
30383  * @conn: the #GTlsClientConnection
30384  *
30385  * Gets the list of distinguished names of the Certificate Authorities
30386  * that the server will accept certificates from. This will be set
30387  * during the TLS handshake if the server requests a certificate.
30388  * Otherwise, it will be %NULL.
30389  *
30390  * Each item in the list is a #GByteArray which contains the complete
30391  * subject DN of the certificate authority.
30392  *
30393  * 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().
30394  * Since: 2.28
30395  */
30396
30397
30398 /**
30399  * g_tls_client_connection_get_server_identity:
30400  * @conn: the #GTlsClientConnection
30401  *
30402  * Gets @conn's expected server identity
30403  *
30404  * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30405  * Since: 2.28
30406  */
30407
30408
30409 /**
30410  * g_tls_client_connection_get_use_ssl3:
30411  * @conn: the #GTlsClientConnection
30412  *
30413  * Gets whether @conn will use SSL 3.0 rather than the
30414  * highest-supported version of TLS; see
30415  * g_tls_client_connection_set_use_ssl3().
30416  *
30417  * Returns: whether @conn will use SSL 3.0
30418  * Since: 2.28
30419  */
30420
30421
30422 /**
30423  * g_tls_client_connection_get_validation_flags:
30424  * @conn: the #GTlsClientConnection
30425  *
30426  * Gets @conn's validation flags
30427  *
30428  * Returns: the validation flags
30429  * Since: 2.28
30430  */
30431
30432
30433 /**
30434  * g_tls_client_connection_new:
30435  * @base_io_stream: the #GIOStream to wrap
30436  * @server_identity: (allow-none): the expected identity of the server
30437  * @error: #GError for error reporting, or %NULL to ignore.
30438  *
30439  * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30440  * must have pollable input and output streams) which is assumed to
30441  * communicate with the server identified by @server_identity.
30442  *
30443  * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30444  * Since: 2.28
30445  */
30446
30447
30448 /**
30449  * g_tls_client_connection_set_server_identity:
30450  * @conn: the #GTlsClientConnection
30451  * @identity: a #GSocketConnectable describing the expected server identity
30452  *
30453  * Sets @conn's expected server identity, which is used both to tell
30454  * servers on virtual hosts which certificate to present, and also
30455  * to let @conn know what name to look for in the certificate when
30456  * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30457  *
30458  * Since: 2.28
30459  */
30460
30461
30462 /**
30463  * g_tls_client_connection_set_use_ssl3:
30464  * @conn: the #GTlsClientConnection
30465  * @use_ssl3: whether to use SSL 3.0
30466  *
30467  * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30468  * trying to properly negotiate the right version of TLS or SSL to use.
30469  * This can be used when talking to servers that do not implement the
30470  * fallbacks correctly and which will therefore fail to handshake with
30471  * a "modern" TLS handshake attempt.
30472  *
30473  * Since: 2.28
30474  */
30475
30476
30477 /**
30478  * g_tls_client_connection_set_validation_flags:
30479  * @conn: the #GTlsClientConnection
30480  * @flags: the #GTlsCertificateFlags to use
30481  *
30482  * Sets @conn's validation flags, to override the default set of
30483  * checks performed when validating a server certificate. By default,
30484  * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30485  *
30486  * Since: 2.28
30487  */
30488
30489
30490 /**
30491  * g_tls_connection_emit_accept_certificate:
30492  * @conn: a #GTlsConnection
30493  * @peer_cert: the peer's #GTlsCertificate
30494  * @errors: the problems with @peer_cert
30495  *
30496  * Used by #GTlsConnection implementations to emit the
30497  * #GTlsConnection::accept-certificate signal.
30498  *
30499  * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30500  * Since: 2.28
30501  */
30502
30503
30504 /**
30505  * g_tls_connection_get_certificate:
30506  * @conn: a #GTlsConnection
30507  *
30508  * Gets @conn's certificate, as set by
30509  * g_tls_connection_set_certificate().
30510  *
30511  * Returns: (transfer none): @conn's certificate, or %NULL
30512  * Since: 2.28
30513  */
30514
30515
30516 /**
30517  * g_tls_connection_get_database:
30518  * @conn: a #GTlsConnection
30519  *
30520  * Gets the certificate database that @conn uses to verify
30521  * peer certificates. See g_tls_connection_set_database().
30522  *
30523  * Returns: (transfer none): the certificate database that @conn uses or %NULL
30524  * Since: 2.30
30525  */
30526
30527
30528 /**
30529  * g_tls_connection_get_interaction:
30530  * @conn: a connection
30531  *
30532  * Get the object that will be used to interact with the user. It will be used
30533  * for things like prompting the user for passwords. If %NULL is returned, then
30534  * no user interaction will occur for this connection.
30535  *
30536  * Returns: (transfer none): The interaction object.
30537  * Since: 2.30
30538  */
30539
30540
30541 /**
30542  * g_tls_connection_get_peer_certificate:
30543  * @conn: a #GTlsConnection
30544  *
30545  * Gets @conn's peer's certificate after the handshake has completed.
30546  * (It is not set during the emission of
30547  * #GTlsConnection::accept-certificate.)
30548  *
30549  * Returns: (transfer none): @conn's peer's certificate, or %NULL
30550  * Since: 2.28
30551  */
30552
30553
30554 /**
30555  * g_tls_connection_get_peer_certificate_errors:
30556  * @conn: a #GTlsConnection
30557  *
30558  * Gets the errors associated with validating @conn's peer's
30559  * certificate, after the handshake has completed. (It is not set
30560  * during the emission of #GTlsConnection::accept-certificate.)
30561  *
30562  * Returns: @conn's peer's certificate errors
30563  * Since: 2.28
30564  */
30565
30566
30567 /**
30568  * g_tls_connection_get_rehandshake_mode:
30569  * @conn: a #GTlsConnection
30570  *
30571  * Gets @conn rehandshaking mode. See
30572  * g_tls_connection_set_rehandshake_mode() for details.
30573  *
30574  * Returns: @conn's rehandshaking mode
30575  * Since: 2.28
30576  */
30577
30578
30579 /**
30580  * g_tls_connection_get_require_close_notify:
30581  * @conn: a #GTlsConnection
30582  *
30583  * Tests whether or not @conn expects a proper TLS close notification
30584  * when the connection is closed. See
30585  * g_tls_connection_set_require_close_notify() for details.
30586  *
30587  * Returns: %TRUE if @conn requires a proper TLS close notification.
30588  * Since: 2.28
30589  */
30590
30591
30592 /**
30593  * g_tls_connection_get_use_system_certdb:
30594  * @conn: a #GTlsConnection
30595  *
30596  * Gets whether @conn uses the system certificate database to verify
30597  * peer certificates. See g_tls_connection_set_use_system_certdb().
30598  *
30599  * Returns: whether @conn uses the system certificate database
30600  * Deprecated: 2.30: Use g_tls_connection_get_database() instead
30601  */
30602
30603
30604 /**
30605  * g_tls_connection_handshake:
30606  * @conn: a #GTlsConnection
30607  * @cancellable: (allow-none): a #GCancellable, or %NULL
30608  * @error: a #GError, or %NULL
30609  *
30610  * Attempts a TLS handshake on @conn.
30611  *
30612  * On the client side, it is never necessary to call this method;
30613  * although the connection needs to perform a handshake after
30614  * connecting (or after sending a "STARTTLS"-type command) and may
30615  * need to rehandshake later if the server requests it,
30616  * #GTlsConnection will handle this for you automatically when you try
30617  * to send or receive data on the connection. However, you can call
30618  * g_tls_connection_handshake() manually if you want to know for sure
30619  * whether the initial handshake succeeded or failed (as opposed to
30620  * just immediately trying to write to @conn's output stream, in which
30621  * case if it fails, it may not be possible to tell if it failed
30622  * before or after completing the handshake).
30623  *
30624  * Likewise, on the server side, although a handshake is necessary at
30625  * the beginning of the communication, you do not need to call this
30626  * function explicitly unless you want clearer error reporting.
30627  * However, you may call g_tls_connection_handshake() later on to
30628  * renegotiate parameters (encryption methods, etc) with the client.
30629  *
30630  * #GTlsConnection::accept_certificate may be emitted during the
30631  * handshake.
30632  *
30633  * Returns: success or failure
30634  * Since: 2.28
30635  */
30636
30637
30638 /**
30639  * g_tls_connection_handshake_async:
30640  * @conn: a #GTlsConnection
30641  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
30642  * @cancellable: (allow-none): a #GCancellable, or %NULL
30643  * @callback: callback to call when the handshake is complete
30644  * @user_data: the data to pass to the callback function
30645  *
30646  * Asynchronously performs a TLS handshake on @conn. See
30647  * g_tls_connection_handshake() for more information.
30648  *
30649  * Since: 2.28
30650  */
30651
30652
30653 /**
30654  * g_tls_connection_handshake_finish:
30655  * @conn: a #GTlsConnection
30656  * @result: a #GAsyncResult.
30657  * @error: a #GError pointer, or %NULL
30658  *
30659  * Finish an asynchronous TLS handshake operation. See
30660  * g_tls_connection_handshake() for more information.
30661  *
30662  * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
30663  * Since: 2.28
30664  */
30665
30666
30667 /**
30668  * g_tls_connection_set_certificate:
30669  * @conn: a #GTlsConnection
30670  * @certificate: the certificate to use for @conn
30671  *
30672  * This sets the certificate that @conn will present to its peer
30673  * during the TLS handshake. For a #GTlsServerConnection, it is
30674  * mandatory to set this, and that will normally be done at construct
30675  * time.
30676  *
30677  * For a #GTlsClientConnection, this is optional. If a handshake fails
30678  * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
30679  * requires a certificate, and if you try connecting again, you should
30680  * call this method first. You can call
30681  * g_tls_client_connection_get_accepted_cas() on the failed connection
30682  * to get a list of Certificate Authorities that the server will
30683  * accept certificates from.
30684  *
30685  * (It is also possible that a server will allow the connection with
30686  * or without a certificate; in that case, if you don't provide a
30687  * certificate, you can tell that the server requested one by the fact
30688  * that g_tls_client_connection_get_accepted_cas() will return
30689  * non-%NULL.)
30690  *
30691  * Since: 2.28
30692  */
30693
30694
30695 /**
30696  * g_tls_connection_set_database:
30697  * @conn: a #GTlsConnection
30698  * @database: a #GTlsDatabase
30699  *
30700  * Sets the certificate database that is used to verify peer certificates.
30701  * This is set to the default database by default. See
30702  * g_tls_backend_get_default_database(). If set to %NULL, then
30703  * peer certificate validation will always set the
30704  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
30705  * #GTlsConnection::accept-certificate will always be emitted on
30706  * client-side connections, unless that bit is not set in
30707  * #GTlsClientConnection:validation-flags).
30708  *
30709  * Since: 2.30
30710  */
30711
30712
30713 /**
30714  * g_tls_connection_set_interaction:
30715  * @conn: a connection
30716  * @interaction: (allow-none): an interaction object, or %NULL
30717  *
30718  * Set the object that will be used to interact with the user. It will be used
30719  * for things like prompting the user for passwords.
30720  *
30721  * The @interaction argument will normally be a derived subclass of
30722  * #GTlsInteraction. %NULL can also be provided if no user interaction
30723  * should occur for this connection.
30724  *
30725  * Since: 2.30
30726  */
30727
30728
30729 /**
30730  * g_tls_connection_set_rehandshake_mode:
30731  * @conn: a #GTlsConnection
30732  * @mode: the rehandshaking mode
30733  *
30734  * Sets how @conn behaves with respect to rehandshaking requests.
30735  *
30736  * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
30737  * rehandshake after the initial handshake is complete. (For a client,
30738  * this means it will refuse rehandshake requests from the server, and
30739  * for a server, this means it will close the connection with an error
30740  * if the client attempts to rehandshake.)
30741  *
30742  * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
30743  * rehandshake only if the other end of the connection supports the
30744  * TLS <literal>renegotiation_info</literal> extension. This is the
30745  * default behavior, but means that rehandshaking will not work
30746  * against older implementations that do not support that extension.
30747  *
30748  * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
30749  * rehandshaking even without the
30750  * <literal>renegotiation_info</literal> extension. On the server side
30751  * in particular, this is not recommended, since it leaves the server
30752  * open to certain attacks. However, this mode is necessary if you
30753  * need to allow renegotiation with older client software.
30754  *
30755  * Since: 2.28
30756  */
30757
30758
30759 /**
30760  * g_tls_connection_set_require_close_notify:
30761  * @conn: a #GTlsConnection
30762  * @require_close_notify: whether or not to require close notification
30763  *
30764  * Sets whether or not @conn expects a proper TLS close notification
30765  * before the connection is closed. If this is %TRUE (the default),
30766  * then @conn will expect to receive a TLS close notification from its
30767  * peer before the connection is closed, and will return a
30768  * %G_TLS_ERROR_EOF error if the connection is closed without proper
30769  * notification (since this may indicate a network error, or
30770  * man-in-the-middle attack).
30771  *
30772  * In some protocols, the application will know whether or not the
30773  * connection was closed cleanly based on application-level data
30774  * (because the application-level data includes a length field, or is
30775  * somehow self-delimiting); in this case, the close notify is
30776  * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
30777  * in TLS 1.0 it is technically an error, but often done anyway.) You
30778  * can use g_tls_connection_set_require_close_notify() to tell @conn
30779  * to allow an "unannounced" connection close, in which case the close
30780  * will show up as a 0-length read, as in a non-TLS
30781  * #GSocketConnection, and it is up to the application to check that
30782  * the data has been fully received.
30783  *
30784  * Note that this only affects the behavior when the peer closes the
30785  * connection; when the application calls g_io_stream_close() itself
30786  * on @conn, this will send a close notification regardless of the
30787  * setting of this property. If you explicitly want to do an unclean
30788  * close, you can close @conn's #GTlsConnection:base-io-stream rather
30789  * than closing @conn itself.
30790  *
30791  * Since: 2.28
30792  */
30793
30794
30795 /**
30796  * g_tls_connection_set_use_system_certdb:
30797  * @conn: a #GTlsConnection
30798  * @use_system_certdb: whether to use the system certificate database
30799  *
30800  * Sets whether @conn uses the system certificate database to verify
30801  * peer certificates. This is %TRUE by default. If set to %FALSE, then
30802  * peer certificate validation will always set the
30803  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
30804  * #GTlsConnection::accept-certificate will always be emitted on
30805  * client-side connections, unless that bit is not set in
30806  * #GTlsClientConnection:validation-flags).
30807  *
30808  * Deprecated: 2.30: Use g_tls_connection_set_database() instead
30809  */
30810
30811
30812 /**
30813  * g_tls_database_create_certificate_handle:
30814  * @self: a #GTlsDatabase
30815  * @certificate: certificate for which to create a handle.
30816  *
30817  * Create a handle string for the certificate. The database will only be able
30818  * to create a handle for certificates that originate from the database. In
30819  * cases where the database cannot create a handle for a certificate, %NULL
30820  * will be returned.
30821  *
30822  * This handle should be stable across various instances of the application,
30823  * and between applications. If a certificate is modified in the database,
30824  * then it is not guaranteed that this handle will continue to point to it.
30825  *
30826  * Returns: (allow-none): a newly allocated string containing the handle.
30827  * Since: 2.30
30828  */
30829
30830
30831 /**
30832  * g_tls_database_lookup_certificate_for_handle:
30833  * @self: a #GTlsDatabase
30834  * @handle: a certificate handle
30835  * @interaction: (allow-none): used to interact with the user if necessary
30836  * @flags: Flags which affect the lookup.
30837  * @cancellable: (allow-none): a #GCancellable, or %NULL
30838  * @error: (allow-none): a #GError, or %NULL
30839  *
30840  * Lookup a certificate by its handle.
30841  *
30842  * The handle should have been created by calling
30843  * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
30844  * the same TLS backend. The handle is designed to remain valid across
30845  * instantiations of the database.
30846  *
30847  * If the handle is no longer valid, or does not point to a certificate in
30848  * this database, then %NULL will be returned.
30849  *
30850  * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
30851  * the lookup operation asynchronously.
30852  *
30853  * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
30854  * Since: 2.30
30855  */
30856
30857
30858 /**
30859  * g_tls_database_lookup_certificate_for_handle_async:
30860  * @self: a #GTlsDatabase
30861  * @handle: a certificate handle
30862  * @interaction: (allow-none): used to interact with the user if necessary
30863  * @flags: Flags which affect the lookup.
30864  * @cancellable: (allow-none): a #GCancellable, or %NULL
30865  * @callback: callback to call when the operation completes
30866  * @user_data: the data to pass to the callback function
30867  *
30868  * Asynchronously lookup a certificate by its handle in the database. See
30869  * g_tls_database_lookup_certificate_for_handle() for more information.
30870  *
30871  * Since: 2.30
30872  */
30873
30874
30875 /**
30876  * g_tls_database_lookup_certificate_for_handle_finish:
30877  * @self: a #GTlsDatabase
30878  * @result: a #GAsyncResult.
30879  * @error: a #GError pointer, or %NULL
30880  *
30881  * Finish an asynchronous lookup of a certificate by its handle. See
30882  * g_tls_database_lookup_certificate_handle() for more information.
30883  *
30884  * If the handle is no longer valid, or does not point to a certificate in
30885  * this database, then %NULL will be returned.
30886  *
30887  * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
30888  * Since: 2.30
30889  */
30890
30891
30892 /**
30893  * g_tls_database_lookup_certificate_issuer:
30894  * @self: a #GTlsDatabase
30895  * @certificate: a #GTlsCertificate
30896  * @interaction: (allow-none): used to interact with the user if necessary
30897  * @flags: flags which affect the lookup operation
30898  * @cancellable: (allow-none): a #GCancellable, or %NULL
30899  * @error: (allow-none): a #GError, or %NULL
30900  *
30901  * Lookup the issuer of @certificate in the database.
30902  *
30903  * The %issuer property
30904  * of @certificate is not modified, and the two certificates are not hooked
30905  * into a chain.
30906  *
30907  * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
30908  * the lookup operation asynchronously.
30909  *
30910  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
30911  * Since: 2.30
30912  */
30913
30914
30915 /**
30916  * g_tls_database_lookup_certificate_issuer_async:
30917  * @self: a #GTlsDatabase
30918  * @certificate: a #GTlsCertificate
30919  * @interaction: (allow-none): used to interact with the user if necessary
30920  * @flags: flags which affect the lookup operation
30921  * @cancellable: (allow-none): a #GCancellable, or %NULL
30922  * @callback: callback to call when the operation completes
30923  * @user_data: the data to pass to the callback function
30924  *
30925  * Asynchronously lookup the issuer of @certificate in the database. See
30926  * g_tls_database_lookup_certificate_issuer() for more information.
30927  *
30928  * Since: 2.30
30929  */
30930
30931
30932 /**
30933  * g_tls_database_lookup_certificate_issuer_finish:
30934  * @self: a #GTlsDatabase
30935  * @result: a #GAsyncResult.
30936  * @error: a #GError pointer, or %NULL
30937  *
30938  * Finish an asynchronous lookup issuer operation. See
30939  * g_tls_database_lookup_certificate_issuer() for more information.
30940  *
30941  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
30942  * Since: 2.30
30943  */
30944
30945
30946 /**
30947  * g_tls_database_lookup_certificates_issued_by:
30948  * @self: a #GTlsDatabase
30949  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
30950  * @interaction: (allow-none): used to interact with the user if necessary
30951  * @flags: Flags which affect the lookup operation.
30952  * @cancellable: (allow-none): a #GCancellable, or %NULL
30953  * @error: (allow-none): a #GError, or %NULL
30954  *
30955  * Lookup certificates issued by this issuer in the database.
30956  *
30957  * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
30958  * the lookup operation asynchronously.
30959  *
30960  * 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.
30961  * Since: 2.30
30962  */
30963
30964
30965 /**
30966  * g_tls_database_lookup_certificates_issued_by_async:
30967  * @self: a #GTlsDatabase
30968  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
30969  * @interaction: (allow-none): used to interact with the user if necessary
30970  * @flags: Flags which affect the lookup operation.
30971  * @cancellable: (allow-none): a #GCancellable, or %NULL
30972  * @callback: callback to call when the operation completes
30973  * @user_data: the data to pass to the callback function
30974  *
30975  * Asynchronously lookup certificates issued by this issuer in the database. See
30976  * g_tls_database_lookup_certificates_issued_by() for more information.
30977  *
30978  * The database may choose to hold a reference to the issuer byte array for the duration
30979  * of of this asynchronous operation. The byte array should not be modified during
30980  * this time.
30981  *
30982  * Since: 2.30
30983  */
30984
30985
30986 /**
30987  * g_tls_database_lookup_certificates_issued_by_finish:
30988  * @self: a #GTlsDatabase
30989  * @result: a #GAsyncResult.
30990  * @error: a #GError pointer, or %NULL
30991  *
30992  * Finish an asynchronous lookup of certificates. See
30993  * g_tls_database_lookup_certificates_issued_by() for more information.
30994  *
30995  * Returns: (transfer full): a newly allocated list of #GTlsCertificate objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
30996  * Since: 2.30
30997  */
30998
30999
31000 /**
31001  * g_tls_database_verify_chain:
31002  * @self: a #GTlsDatabase
31003  * @chain: a #GTlsCertificate chain
31004  * @purpose: the purpose that this certificate chain will be used for.
31005  * @identity: (allow-none): the expected peer identity
31006  * @interaction: (allow-none): used to interact with the user if necessary
31007  * @flags: additional verify flags
31008  * @cancellable: (allow-none): a #GCancellable, or %NULL
31009  * @error: (allow-none): a #GError, or %NULL
31010  *
31011  * Verify's a certificate chain after looking up and adding any missing
31012  * certificates to the chain.
31013  *
31014  * @chain is a chain of #GTlsCertificate objects each pointing to the next
31015  * certificate in the chain by its %issuer property. The chain may initially
31016  * consist of one or more certificates. After the verification process is
31017  * complete, @chain may be modified by adding missing certificates, or removing
31018  * extra certificates. If a certificate anchor was found, then it is added to
31019  * the @chain.
31020  *
31021  * @purpose describes the purpose (or usage) for which the certificate
31022  * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31023  * which means that the certificate is being used to authenticate a server
31024  * (and we are acting as the client).
31025  *
31026  * The @identity is used to check for pinned certificates (trust exceptions)
31027  * in the database. These will override the normal verification process on a
31028  * host by host basis.
31029  *
31030  * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31031  * used.
31032  *
31033  * This function can block, use g_tls_database_verify_chain_async() to perform
31034  * the verification operation asynchronously.
31035  *
31036  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31037  * Since: 2.30
31038  */
31039
31040
31041 /**
31042  * g_tls_database_verify_chain_async:
31043  * @self: a #GTlsDatabase
31044  * @chain: a #GTlsCertificate chain
31045  * @purpose: the purpose that this certificate chain will be used for.
31046  * @identity: (allow-none): the expected peer identity
31047  * @interaction: (allow-none): used to interact with the user if necessary
31048  * @flags: additional verify flags
31049  * @cancellable: (allow-none): a #GCancellable, or %NULL
31050  * @callback: callback to call when the operation completes
31051  * @user_data: the data to pass to the callback function
31052  *
31053  * Asynchronously verify's a certificate chain after looking up and adding
31054  * any missing certificates to the chain. See g_tls_database_verify_chain()
31055  * for more information.
31056  *
31057  * Since: 2.30
31058  */
31059
31060
31061 /**
31062  * g_tls_database_verify_chain_finish:
31063  * @self: a #GTlsDatabase
31064  * @result: a #GAsyncResult.
31065  * @error: a #GError pointer, or %NULL
31066  *
31067  * Finish an asynchronous verify chain operation. See
31068  * g_tls_database_verify_chain() for more information. *
31069  *
31070  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31071  * Since: 2.30
31072  */
31073
31074
31075 /**
31076  * g_tls_error_quark:
31077  *
31078  * Gets the TLS error quark.
31079  *
31080  * Returns: a #GQuark.
31081  * Since: 2.28
31082  */
31083
31084
31085 /**
31086  * g_tls_file_database_new:
31087  * @anchors: filename of anchor certificate authorities.
31088  * @error: #GError for error reporting, or %NULL to ignore.
31089  *
31090  * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31091  * in @anchors to verify certificate chains.
31092  *
31093  * The certificates in @anchors must be PEM encoded.
31094  *
31095  * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31096  * Since: 2.30
31097  */
31098
31099
31100 /**
31101  * g_tls_interaction_ask_password:
31102  * @interaction: a #GTlsInteraction object
31103  * @password: a #GTlsPassword object
31104  * @cancellable: an optional #GCancellable cancellation object
31105  * @error: an optional location to place an error on failure
31106  *
31107  * Run synchronous interaction to ask the user for a password. In general,
31108  * g_tls_interaction_invoke_ask_password() should be used instead of this
31109  * function.
31110  *
31111  * Derived subclasses usually implement a password prompt, although they may
31112  * also choose to provide a password from elsewhere. The @password value will
31113  * be filled in and then @callback will be called. Alternatively the user may
31114  * abort this password request, which will usually abort the TLS connection.
31115  *
31116  * If the interaction is cancelled by the cancellation object, or by the
31117  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31118  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31119  * not support immediate cancellation.
31120  *
31121  * Returns: The status of the ask password interaction.
31122  * Since: 2.30
31123  */
31124
31125
31126 /**
31127  * g_tls_interaction_ask_password_async:
31128  * @interaction: a #GTlsInteraction object
31129  * @password: a #GTlsPassword object
31130  * @cancellable: an optional #GCancellable cancellation object
31131  * @callback: (allow-none): will be called when the interaction completes
31132  * @user_data: (allow-none): data to pass to the @callback
31133  *
31134  * Run asynchronous interaction to ask the user for a password. In general,
31135  * g_tls_interaction_invoke_ask_password() should be used instead of this
31136  * function.
31137  *
31138  * Derived subclasses usually implement a password prompt, although they may
31139  * also choose to provide a password from elsewhere. The @password value will
31140  * be filled in and then @callback will be called. Alternatively the user may
31141  * abort this password request, which will usually abort the TLS connection.
31142  *
31143  * If the interaction is cancelled by the cancellation object, or by the
31144  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31145  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31146  * not support immediate cancellation.
31147  *
31148  * Certain implementations may not support immediate cancellation.
31149  *
31150  * Since: 2.30
31151  */
31152
31153
31154 /**
31155  * g_tls_interaction_ask_password_finish:
31156  * @interaction: a #GTlsInteraction object
31157  * @result: the result passed to the callback
31158  * @error: an optional location to place an error on failure
31159  *
31160  * Complete an ask password user interaction request. This should be once
31161  * the g_tls_interaction_ask_password_async() completion callback is called.
31162  *
31163  * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31164  * to g_tls_interaction_ask_password() will have its password filled in.
31165  *
31166  * If the interaction is cancelled by the cancellation object, or by the
31167  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31168  * contains a %G_IO_ERROR_CANCELLED error code.
31169  *
31170  * Returns: The status of the ask password interaction.
31171  * Since: 2.30
31172  */
31173
31174
31175 /**
31176  * g_tls_interaction_invoke_ask_password:
31177  * @interaction: a #GTlsInteraction object
31178  * @password: a #GTlsPassword object
31179  * @cancellable: an optional #GCancellable cancellation object
31180  * @error: an optional location to place an error on failure
31181  *
31182  * Invoke the interaction to ask the user for a password. It invokes this
31183  * interaction in the main loop, specifically the #GMainContext returned by
31184  * g_main_context_get_thread_default() when the interaction is created. This
31185  * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31186  * for a password.
31187  *
31188  * Derived subclasses usually implement a password prompt, although they may
31189  * also choose to provide a password from elsewhere. The @password value will
31190  * be filled in and then @callback will be called. Alternatively the user may
31191  * abort this password request, which will usually abort the TLS connection.
31192  *
31193  * The implementation can either be a synchronous (eg: modal dialog) or an
31194  * asynchronous one (eg: modeless dialog). This function will take care of
31195  * calling which ever one correctly.
31196  *
31197  * If the interaction is cancelled by the cancellation object, or by the
31198  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31199  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31200  * not support immediate cancellation.
31201  *
31202  * Returns: The status of the ask password interaction.
31203  * Since: 2.30
31204  */
31205
31206
31207 /**
31208  * g_tls_password_get_description:
31209  * @password: a #GTlsPassword object
31210  *
31211  * Get a description string about what the password will be used for.
31212  *
31213  * Returns: The description of the password.
31214  * Since: 2.30
31215  */
31216
31217
31218 /**
31219  * g_tls_password_get_flags:
31220  * @password: a #GTlsPassword object
31221  *
31222  * Get flags about the password.
31223  *
31224  * Returns: The flags about the password.
31225  * Since: 2.30
31226  */
31227
31228
31229 /**
31230  * g_tls_password_get_value:
31231  * @password: a #GTlsPassword object
31232  * @length: (allow-none): location to place the length of the password.
31233  *
31234  * Get the password value. If @length is not %NULL then it will be
31235  * filled in with the length of the password value. (Note that the
31236  * password value is not nul-terminated, so you can only pass %NULL
31237  * for @length in contexts where you know the password will have a
31238  * certain fixed length.)
31239  *
31240  * Returns: The password value (owned by the password object).
31241  * Since: 2.30
31242  */
31243
31244
31245 /**
31246  * g_tls_password_get_warning:
31247  * @password: a #GTlsPassword object
31248  *
31249  * Get a user readable translated warning. Usually this warning is a
31250  * representation of the password flags returned from
31251  * g_tls_password_get_flags().
31252  *
31253  * Returns: The warning.
31254  * Since: 2.30
31255  */
31256
31257
31258 /**
31259  * g_tls_password_new:
31260  * @flags: the password flags
31261  * @description: description of what the password is for
31262  *
31263  * Create a new #GTlsPassword object.
31264  *
31265  * Returns: (transfer full): The newly allocated password object
31266  */
31267
31268
31269 /**
31270  * g_tls_password_set_description:
31271  * @password: a #GTlsPassword object
31272  * @description: The description of the password
31273  *
31274  * Set a description string about what the password will be used for.
31275  *
31276  * Since: 2.30
31277  */
31278
31279
31280 /**
31281  * g_tls_password_set_flags:
31282  * @password: a #GTlsPassword object
31283  * @flags: The flags about the password
31284  *
31285  * Set flags about the password.
31286  *
31287  * Since: 2.30
31288  */
31289
31290
31291 /**
31292  * g_tls_password_set_value:
31293  * @password: a #GTlsPassword object
31294  * @value: the new password value
31295  * @length: the length of the password, or -1
31296  *
31297  * Set the value for this password. The @value will be copied by the password
31298  * object.
31299  *
31300  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31301  * @length if using a nul-terminated password, and @length will be
31302  * calculated automatically. (Note that the terminating nul is not
31303  * considered part of the password in this case.)
31304  *
31305  * Since: 2.30
31306  */
31307
31308
31309 /**
31310  * g_tls_password_set_value_full:
31311  * @password: a #GTlsPassword object
31312  * @value: the value for the password
31313  * @length: the length of the password, or -1
31314  * @destroy: (allow-none): a function to use to free the password.
31315  *
31316  * Provide the value for this password.
31317  *
31318  * The @value will be owned by the password object, and later freed using
31319  * the @destroy function callback.
31320  *
31321  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31322  * @length if using a nul-terminated password, and @length will be
31323  * calculated automatically. (Note that the terminating nul is not
31324  * considered part of the password in this case.)
31325  *
31326  * Virtual: set_value
31327  * Since: 2.30
31328  */
31329
31330
31331 /**
31332  * g_tls_password_set_warning:
31333  * @password: a #GTlsPassword object
31334  * @warning: The user readable warning
31335  *
31336  * Set a user readable translated warning. Usually this warning is a
31337  * representation of the password flags returned from
31338  * g_tls_password_get_flags().
31339  *
31340  * Since: 2.30
31341  */
31342
31343
31344 /**
31345  * g_tls_server_connection_new:
31346  * @base_io_stream: the #GIOStream to wrap
31347  * @certificate: (allow-none): the default server certificate, or %NULL
31348  * @error: #GError for error reporting, or %NULL to ignore.
31349  *
31350  * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31351  * must have pollable input and output streams).
31352  *
31353  * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31354  * Since: 2.28
31355  */
31356
31357
31358 /**
31359  * g_unix_connection_receive_credentials:
31360  * @connection: A #GUnixConnection.
31361  * @cancellable: (allow-none): A #GCancellable or %NULL.
31362  * @error: Return location for error or %NULL.
31363  *
31364  * Receives credentials from the sending end of the connection.  The
31365  * sending end has to call g_unix_connection_send_credentials() (or
31366  * similar) for this to work.
31367  *
31368  * As well as reading the credentials this also reads (and discards) a
31369  * single byte from the stream, as this is required for credentials
31370  * passing to work on some implementations.
31371  *
31372  * Other ways to exchange credentials with a foreign peer includes the
31373  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31374  *
31375  * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31376  * Since: 2.26
31377  */
31378
31379
31380 /**
31381  * g_unix_connection_receive_credentials_async:
31382  * @connection: A #GUnixConnection.
31383  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31384  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31385  * @user_data: (closure): the data to pass to callback function
31386  *
31387  * Asynchronously receive credentials.
31388  *
31389  * For more details, see g_unix_connection_receive_credentials() which is
31390  * the synchronous version of this call.
31391  *
31392  * When the operation is finished, @callback will be called. You can then call
31393  * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31394  *
31395  * Since: 2.32
31396  */
31397
31398
31399 /**
31400  * g_unix_connection_receive_credentials_finish:
31401  * @connection: A #GUnixConnection.
31402  * @result: a #GAsyncResult.
31403  * @error: a #GError, or %NULL
31404  *
31405  * Finishes an asynchronous receive credentials operation started with
31406  * g_unix_connection_receive_credentials_async().
31407  *
31408  * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31409  * Since: 2.32
31410  */
31411
31412
31413 /**
31414  * g_unix_connection_receive_fd:
31415  * @connection: a #GUnixConnection
31416  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31417  * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31418  *
31419  * Receives a file descriptor from the sending end of the connection.
31420  * The sending end has to call g_unix_connection_send_fd() for this
31421  * to work.
31422  *
31423  * As well as reading the fd this also reads a single byte from the
31424  * stream, as this is required for fd passing to work on some
31425  * implementations.
31426  *
31427  * Returns: a file descriptor on success, -1 on error.
31428  * Since: 2.22
31429  */
31430
31431
31432 /**
31433  * g_unix_connection_send_credentials:
31434  * @connection: A #GUnixConnection.
31435  * @cancellable: (allow-none): A #GCancellable or %NULL.
31436  * @error: Return location for error or %NULL.
31437  *
31438  * Passes the credentials of the current user the receiving side
31439  * of the connection. The receiving end has to call
31440  * g_unix_connection_receive_credentials() (or similar) to accept the
31441  * credentials.
31442  *
31443  * As well as sending the credentials this also writes a single NUL
31444  * byte to the stream, as this is required for credentials passing to
31445  * work on some implementations.
31446  *
31447  * Other ways to exchange credentials with a foreign peer includes the
31448  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31449  *
31450  * Returns: %TRUE on success, %FALSE if @error is set.
31451  * Since: 2.26
31452  */
31453
31454
31455 /**
31456  * g_unix_connection_send_credentials_async:
31457  * @connection: A #GUnixConnection.
31458  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31459  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31460  * @user_data: (closure): the data to pass to callback function
31461  *
31462  * Asynchronously send credentials.
31463  *
31464  * For more details, see g_unix_connection_send_credentials() which is
31465  * the synchronous version of this call.
31466  *
31467  * When the operation is finished, @callback will be called. You can then call
31468  * g_unix_connection_send_credentials_finish() to get the result of the operation.
31469  *
31470  * Since: 2.32
31471  */
31472
31473
31474 /**
31475  * g_unix_connection_send_credentials_finish:
31476  * @connection: A #GUnixConnection.
31477  * @result: a #GAsyncResult.
31478  * @error: a #GError, or %NULL
31479  *
31480  * Finishes an asynchronous send credentials operation started with
31481  * g_unix_connection_send_credentials_async().
31482  *
31483  * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31484  * Since: 2.32
31485  */
31486
31487
31488 /**
31489  * g_unix_connection_send_fd:
31490  * @connection: a #GUnixConnection
31491  * @fd: a file descriptor
31492  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31493  * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31494  *
31495  * Passes a file descriptor to the receiving side of the
31496  * connection. The receiving end has to call g_unix_connection_receive_fd()
31497  * to accept the file descriptor.
31498  *
31499  * As well as sending the fd this also writes a single byte to the
31500  * stream, as this is required for fd passing to work on some
31501  * implementations.
31502  *
31503  * Returns: a %TRUE on success, %NULL on error.
31504  * Since: 2.22
31505  */
31506
31507
31508 /**
31509  * g_unix_credentials_message_get_credentials:
31510  * @message: A #GUnixCredentialsMessage.
31511  *
31512  * Gets the credentials stored in @message.
31513  *
31514  * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31515  * Since: 2.26
31516  */
31517
31518
31519 /**
31520  * g_unix_credentials_message_is_supported:
31521  *
31522  * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31523  *
31524  * Returns: %TRUE if supported, %FALSE otherwise
31525  * Since: 2.26
31526  */
31527
31528
31529 /**
31530  * g_unix_credentials_message_new:
31531  *
31532  * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
31533  *
31534  * Returns: a new #GUnixCredentialsMessage
31535  * Since: 2.26
31536  */
31537
31538
31539 /**
31540  * g_unix_credentials_message_new_with_credentials:
31541  * @credentials: A #GCredentials object.
31542  *
31543  * Creates a new #GUnixCredentialsMessage holding @credentials.
31544  *
31545  * Returns: a new #GUnixCredentialsMessage
31546  * Since: 2.26
31547  */
31548
31549
31550 /**
31551  * g_unix_fd_list_append:
31552  * @list: a #GUnixFDList
31553  * @fd: a valid open file descriptor
31554  * @error: a #GError pointer
31555  *
31556  * Adds a file descriptor to @list.
31557  *
31558  * The file descriptor is duplicated using dup(). You keep your copy
31559  * of the descriptor and the copy contained in @list will be closed
31560  * when @list is finalized.
31561  *
31562  * A possible cause of failure is exceeding the per-process or
31563  * system-wide file descriptor limit.
31564  *
31565  * The index of the file descriptor in the list is returned.  If you use
31566  * this index with g_unix_fd_list_get() then you will receive back a
31567  * duplicated copy of the same file descriptor.
31568  *
31569  * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
31570  * Since: 2.24
31571  */
31572
31573
31574 /**
31575  * g_unix_fd_list_get:
31576  * @list: a #GUnixFDList
31577  * @index_: the index into the list
31578  * @error: a #GError pointer
31579  *
31580  * Gets a file descriptor out of @list.
31581  *
31582  * @index_ specifies the index of the file descriptor to get.  It is a
31583  * programmer error for @index_ to be out of range; see
31584  * g_unix_fd_list_get_length().
31585  *
31586  * The file descriptor is duplicated using dup() and set as
31587  * close-on-exec before being returned.  You must call close() on it
31588  * when you are done.
31589  *
31590  * A possible cause of failure is exceeding the per-process or
31591  * system-wide file descriptor limit.
31592  *
31593  * Returns: the file descriptor, or -1 in case of error
31594  * Since: 2.24
31595  */
31596
31597
31598 /**
31599  * g_unix_fd_list_get_length:
31600  * @list: a #GUnixFDList
31601  *
31602  * Gets the length of @list (ie: the number of file descriptors
31603  * contained within).
31604  *
31605  * Returns: the length of @list
31606  * Since: 2.24
31607  */
31608
31609
31610 /**
31611  * g_unix_fd_list_new:
31612  *
31613  * Creates a new #GUnixFDList containing no file descriptors.
31614  *
31615  * Returns: a new #GUnixFDList
31616  * Since: 2.24
31617  */
31618
31619
31620 /**
31621  * g_unix_fd_list_new_from_array:
31622  * @fds: (array length=n_fds): the initial list of file descriptors
31623  * @n_fds: the length of #fds, or -1
31624  *
31625  * Creates a new #GUnixFDList containing the file descriptors given in
31626  * @fds.  The file descriptors become the property of the new list and
31627  * may no longer be used by the caller.  The array itself is owned by
31628  * the caller.
31629  *
31630  * Each file descriptor in the array should be set to close-on-exec.
31631  *
31632  * If @n_fds is -1 then @fds must be terminated with -1.
31633  *
31634  * Returns: a new #GUnixFDList
31635  * Since: 2.24
31636  */
31637
31638
31639 /**
31640  * g_unix_fd_list_peek_fds:
31641  * @list: a #GUnixFDList
31642  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31643  *
31644  * Returns the array of file descriptors that is contained in this
31645  * object.
31646  *
31647  * After this call, the descriptors remain the property of @list.  The
31648  * caller must not close them and must not free the array.  The array is
31649  * valid only until @list is changed in any way.
31650  *
31651  * If @length is non-%NULL then it is set to the number of file
31652  * descriptors in the returned array. The returned array is also
31653  * terminated with -1.
31654  *
31655  * This function never returns %NULL. In case there are no file
31656  * descriptors contained in @list, an empty array is returned.
31657  *
31658  * Returns: (array length=length) (transfer none): an array of file descriptors
31659  * Since: 2.24
31660  */
31661
31662
31663 /**
31664  * g_unix_fd_list_steal_fds:
31665  * @list: a #GUnixFDList
31666  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31667  *
31668  * Returns the array of file descriptors that is contained in this
31669  * object.
31670  *
31671  * After this call, the descriptors are no longer contained in
31672  * @list. Further calls will return an empty list (unless more
31673  * descriptors have been added).
31674  *
31675  * The return result of this function must be freed with g_free().
31676  * The caller is also responsible for closing all of the file
31677  * descriptors.  The file descriptors in the array are set to
31678  * close-on-exec.
31679  *
31680  * If @length is non-%NULL then it is set to the number of file
31681  * descriptors in the returned array. The returned array is also
31682  * terminated with -1.
31683  *
31684  * This function never returns %NULL. In case there are no file
31685  * descriptors contained in @list, an empty array is returned.
31686  *
31687  * Returns: (array length=length) (transfer full): an array of file descriptors
31688  * Since: 2.24
31689  */
31690
31691
31692 /**
31693  * g_unix_fd_message_append_fd:
31694  * @message: a #GUnixFDMessage
31695  * @fd: a valid open file descriptor
31696  * @error: a #GError pointer
31697  *
31698  * Adds a file descriptor to @message.
31699  *
31700  * The file descriptor is duplicated using dup(). You keep your copy
31701  * of the descriptor and the copy contained in @message will be closed
31702  * when @message is finalized.
31703  *
31704  * A possible cause of failure is exceeding the per-process or
31705  * system-wide file descriptor limit.
31706  *
31707  * Returns: %TRUE in case of success, else %FALSE (and @error is set)
31708  * Since: 2.22
31709  */
31710
31711
31712 /**
31713  * g_unix_fd_message_get_fd_list:
31714  * @message: a #GUnixFDMessage
31715  *
31716  * Gets the #GUnixFDList contained in @message.  This function does not
31717  * return a reference to the caller, but the returned list is valid for
31718  * the lifetime of @message.
31719  *
31720  * Returns: (transfer none): the #GUnixFDList from @message
31721  * Since: 2.24
31722  */
31723
31724
31725 /**
31726  * g_unix_fd_message_new:
31727  *
31728  * Creates a new #GUnixFDMessage containing an empty file descriptor
31729  * list.
31730  *
31731  * Returns: a new #GUnixFDMessage
31732  * Since: 2.22
31733  */
31734
31735
31736 /**
31737  * g_unix_fd_message_new_with_fd_list:
31738  * @fd_list: a #GUnixFDList
31739  *
31740  * Creates a new #GUnixFDMessage containing @list.
31741  *
31742  * Returns: a new #GUnixFDMessage
31743  * Since: 2.24
31744  */
31745
31746
31747 /**
31748  * g_unix_fd_message_steal_fds:
31749  * @message: a #GUnixFDMessage
31750  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31751  *
31752  * Returns the array of file descriptors that is contained in this
31753  * object.
31754  *
31755  * After this call, the descriptors are no longer contained in
31756  * @message. Further calls will return an empty list (unless more
31757  * descriptors have been added).
31758  *
31759  * The return result of this function must be freed with g_free().
31760  * The caller is also responsible for closing all of the file
31761  * descriptors.
31762  *
31763  * If @length is non-%NULL then it is set to the number of file
31764  * descriptors in the returned array. The returned array is also
31765  * terminated with -1.
31766  *
31767  * This function never returns %NULL. In case there are no file
31768  * descriptors contained in @message, an empty array is returned.
31769  *
31770  * Returns: (array length=length) (transfer full): an array of file descriptors
31771  * Since: 2.22
31772  */
31773
31774
31775 /**
31776  * g_unix_input_stream_get_close_fd:
31777  * @stream: a #GUnixInputStream
31778  *
31779  * Returns whether the file descriptor of @stream will be
31780  * closed when the stream is closed.
31781  *
31782  * Returns: %TRUE if the file descriptor is closed when done
31783  * Since: 2.20
31784  */
31785
31786
31787 /**
31788  * g_unix_input_stream_get_fd:
31789  * @stream: a #GUnixInputStream
31790  *
31791  * Return the UNIX file descriptor that the stream reads from.
31792  *
31793  * Returns: The file descriptor of @stream
31794  * Since: 2.20
31795  */
31796
31797
31798 /**
31799  * g_unix_input_stream_new:
31800  * @fd: a UNIX file descriptor
31801  * @close_fd: %TRUE to close the file descriptor when done
31802  *
31803  * Creates a new #GUnixInputStream for the given @fd.
31804  *
31805  * If @close_fd is %TRUE, the file descriptor will be closed
31806  * when the stream is closed.
31807  *
31808  * Returns: a new #GUnixInputStream
31809  */
31810
31811
31812 /**
31813  * g_unix_input_stream_set_close_fd:
31814  * @stream: a #GUnixInputStream
31815  * @close_fd: %TRUE to close the file descriptor when done
31816  *
31817  * Sets whether the file descriptor of @stream shall be closed
31818  * when the stream is closed.
31819  *
31820  * Since: 2.20
31821  */
31822
31823
31824 /**
31825  * g_unix_is_mount_path_system_internal:
31826  * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
31827  *
31828  * Determines if @mount_path is considered an implementation of the
31829  * OS. This is primarily used for hiding mountable and mounted volumes
31830  * that only are used in the OS and has little to no relevance to the
31831  * casual user.
31832  *
31833  * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
31834  */
31835
31836
31837 /**
31838  * g_unix_mount_at: (skip)
31839  * @mount_path: path for a possible unix mount.
31840  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
31841  *
31842  * Gets a #GUnixMountEntry for a given mount path. If @time_read
31843  * is set, it will be filled with a unix timestamp for checking
31844  * if the mounts have changed since with g_unix_mounts_changed_since().
31845  *
31846  * Returns: (transfer full): a #GUnixMountEntry.
31847  */
31848
31849
31850 /**
31851  * g_unix_mount_compare:
31852  * @mount1: first #GUnixMountEntry to compare.
31853  * @mount2: second #GUnixMountEntry to compare.
31854  *
31855  * Compares two unix mounts.
31856  *
31857  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
31858  */
31859
31860
31861 /**
31862  * g_unix_mount_free:
31863  * @mount_entry: a #GUnixMountEntry.
31864  *
31865  * Frees a unix mount.
31866  */
31867
31868
31869 /**
31870  * g_unix_mount_get_device_path:
31871  * @mount_entry: a #GUnixMount.
31872  *
31873  * Gets the device path for a unix mount.
31874  *
31875  * Returns: a string containing the device path.
31876  */
31877
31878
31879 /**
31880  * g_unix_mount_get_fs_type:
31881  * @mount_entry: a #GUnixMount.
31882  *
31883  * Gets the filesystem type for the unix mount.
31884  *
31885  * Returns: a string containing the file system type.
31886  */
31887
31888
31889 /**
31890  * g_unix_mount_get_mount_path:
31891  * @mount_entry: input #GUnixMountEntry to get the mount path for.
31892  *
31893  * Gets the mount path for a unix mount.
31894  *
31895  * Returns: the mount path for @mount_entry.
31896  */
31897
31898
31899 /**
31900  * g_unix_mount_guess_can_eject:
31901  * @mount_entry: a #GUnixMountEntry
31902  *
31903  * Guesses whether a Unix mount can be ejected.
31904  *
31905  * Returns: %TRUE if @mount_entry is deemed to be ejectable.
31906  */
31907
31908
31909 /**
31910  * g_unix_mount_guess_icon:
31911  * @mount_entry: a #GUnixMountEntry
31912  *
31913  * Guesses the icon of a Unix mount.
31914  *
31915  * Returns: (transfer full): a #GIcon
31916  */
31917
31918
31919 /**
31920  * g_unix_mount_guess_name:
31921  * @mount_entry: a #GUnixMountEntry
31922  *
31923  * Guesses the name of a Unix mount.
31924  * The result is a translated string.
31925  *
31926  * Returns: A newly allocated string that must be freed with g_free()
31927  */
31928
31929
31930 /**
31931  * g_unix_mount_guess_should_display:
31932  * @mount_entry: a #GUnixMountEntry
31933  *
31934  * Guesses whether a Unix mount should be displayed in the UI.
31935  *
31936  * Returns: %TRUE if @mount_entry is deemed to be displayable.
31937  */
31938
31939
31940 /**
31941  * g_unix_mount_is_readonly:
31942  * @mount_entry: a #GUnixMount.
31943  *
31944  * Checks if a unix mount is mounted read only.
31945  *
31946  * Returns: %TRUE if @mount_entry is read only.
31947  */
31948
31949
31950 /**
31951  * g_unix_mount_is_system_internal:
31952  * @mount_entry: a #GUnixMount.
31953  *
31954  * Checks if a unix mount is a system path.
31955  *
31956  * Returns: %TRUE if the unix mount is for a system path.
31957  */
31958
31959
31960 /**
31961  * g_unix_mount_monitor_new:
31962  *
31963  * Gets a new #GUnixMountMonitor. The default rate limit for which the
31964  * monitor will report consecutive changes for the mount and mount
31965  * point entry files is the default for a #GFileMonitor. Use
31966  * g_unix_mount_monitor_set_rate_limit() to change this.
31967  *
31968  * Returns: a #GUnixMountMonitor.
31969  */
31970
31971
31972 /**
31973  * g_unix_mount_monitor_set_rate_limit:
31974  * @mount_monitor: a #GUnixMountMonitor
31975  * @limit_msec: a integer with the limit in milliseconds to poll for changes.
31976  *
31977  * Sets the rate limit to which the @mount_monitor will report
31978  * consecutive change events to the mount and mount point entry files.
31979  *
31980  * Since: 2.18
31981  */
31982
31983
31984 /**
31985  * g_unix_mount_point_compare:
31986  * @mount1: a #GUnixMount.
31987  * @mount2: a #GUnixMount.
31988  *
31989  * Compares two unix mount points.
31990  *
31991  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
31992  */
31993
31994
31995 /**
31996  * g_unix_mount_point_free:
31997  * @mount_point: unix mount point to free.
31998  *
31999  * Frees a unix mount point.
32000  */
32001
32002
32003 /**
32004  * g_unix_mount_point_get_device_path:
32005  * @mount_point: a #GUnixMountPoint.
32006  *
32007  * Gets the device path for a unix mount point.
32008  *
32009  * Returns: a string containing the device path.
32010  */
32011
32012
32013 /**
32014  * g_unix_mount_point_get_fs_type:
32015  * @mount_point: a #GUnixMountPoint.
32016  *
32017  * Gets the file system type for the mount point.
32018  *
32019  * Returns: a string containing the file system type.
32020  */
32021
32022
32023 /**
32024  * g_unix_mount_point_get_mount_path:
32025  * @mount_point: a #GUnixMountPoint.
32026  *
32027  * Gets the mount path for a unix mount point.
32028  *
32029  * Returns: a string containing the mount path.
32030  */
32031
32032
32033 /**
32034  * g_unix_mount_point_get_options:
32035  * @mount_point: a #GUnixMountPoint.
32036  *
32037  * Gets the options for the mount point.
32038  *
32039  * Returns: a string containing the options.
32040  * Since: 2.32
32041  */
32042
32043
32044 /**
32045  * g_unix_mount_point_guess_can_eject:
32046  * @mount_point: a #GUnixMountPoint
32047  *
32048  * Guesses whether a Unix mount point can be ejected.
32049  *
32050  * Returns: %TRUE if @mount_point is deemed to be ejectable.
32051  */
32052
32053
32054 /**
32055  * g_unix_mount_point_guess_icon:
32056  * @mount_point: a #GUnixMountPoint
32057  *
32058  * Guesses the icon of a Unix mount point.
32059  *
32060  * Returns: (transfer full): a #GIcon
32061  */
32062
32063
32064 /**
32065  * g_unix_mount_point_guess_name:
32066  * @mount_point: a #GUnixMountPoint
32067  *
32068  * Guesses the name of a Unix mount point.
32069  * The result is a translated string.
32070  *
32071  * Returns: A newly allocated string that must be freed with g_free()
32072  */
32073
32074
32075 /**
32076  * g_unix_mount_point_is_loopback:
32077  * @mount_point: a #GUnixMountPoint.
32078  *
32079  * Checks if a unix mount point is a loopback device.
32080  *
32081  * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32082  */
32083
32084
32085 /**
32086  * g_unix_mount_point_is_readonly:
32087  * @mount_point: a #GUnixMountPoint.
32088  *
32089  * Checks if a unix mount point is read only.
32090  *
32091  * Returns: %TRUE if a mount point is read only.
32092  */
32093
32094
32095 /**
32096  * g_unix_mount_point_is_user_mountable:
32097  * @mount_point: a #GUnixMountPoint.
32098  *
32099  * Checks if a unix mount point is mountable by the user.
32100  *
32101  * Returns: %TRUE if the mount point is user mountable.
32102  */
32103
32104
32105 /**
32106  * g_unix_mount_points_changed_since:
32107  * @time: guint64 to contain a timestamp.
32108  *
32109  * Checks if the unix mount points have changed since a given unix time.
32110  *
32111  * Returns: %TRUE if the mount points have changed since @time.
32112  */
32113
32114
32115 /**
32116  * g_unix_mount_points_get: (skip)
32117  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32118  *
32119  * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32120  * If @time_read is set, it will be filled with the mount timestamp,
32121  * allowing for checking if the mounts have changed with
32122  * g_unix_mount_points_changed_since().
32123  *
32124  * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32125  */
32126
32127
32128 /**
32129  * g_unix_mounts_changed_since:
32130  * @time: guint64 to contain a timestamp.
32131  *
32132  * Checks if the unix mounts have changed since a given unix time.
32133  *
32134  * Returns: %TRUE if the mounts have changed since @time.
32135  */
32136
32137
32138 /**
32139  * g_unix_mounts_get: (skip)
32140  * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32141  *
32142  * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32143  * If @time_read is set, it will be filled with the mount
32144  * timestamp, allowing for checking if the mounts have changed
32145  * with g_unix_mounts_changed_since().
32146  *
32147  * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32148  */
32149
32150
32151 /**
32152  * g_unix_output_stream_get_close_fd:
32153  * @stream: a #GUnixOutputStream
32154  *
32155  * Returns whether the file descriptor of @stream will be
32156  * closed when the stream is closed.
32157  *
32158  * Returns: %TRUE if the file descriptor is closed when done
32159  * Since: 2.20
32160  */
32161
32162
32163 /**
32164  * g_unix_output_stream_get_fd:
32165  * @stream: a #GUnixOutputStream
32166  *
32167  * Return the UNIX file descriptor that the stream writes to.
32168  *
32169  * Returns: The file descriptor of @stream
32170  * Since: 2.20
32171  */
32172
32173
32174 /**
32175  * g_unix_output_stream_new:
32176  * @fd: a UNIX file descriptor
32177  * @close_fd: %TRUE to close the file descriptor when done
32178  *
32179  * Creates a new #GUnixOutputStream for the given @fd.
32180  *
32181  * If @close_fd, is %TRUE, the file descriptor will be closed when
32182  * the output stream is destroyed.
32183  *
32184  * Returns: a new #GOutputStream
32185  */
32186
32187
32188 /**
32189  * g_unix_output_stream_set_close_fd:
32190  * @stream: a #GUnixOutputStream
32191  * @close_fd: %TRUE to close the file descriptor when done
32192  *
32193  * Sets whether the file descriptor of @stream shall be closed
32194  * when the stream is closed.
32195  *
32196  * Since: 2.20
32197  */
32198
32199
32200 /**
32201  * g_unix_socket_address_abstract_names_supported:
32202  *
32203  * Checks if abstract unix domain socket names are supported.
32204  *
32205  * Returns: %TRUE if supported, %FALSE otherwise
32206  * Since: 2.22
32207  */
32208
32209
32210 /**
32211  * g_unix_socket_address_get_address_type:
32212  * @address: a #GInetSocketAddress
32213  *
32214  * Gets @address's type.
32215  *
32216  * Returns: a #GUnixSocketAddressType
32217  * Since: 2.26
32218  */
32219
32220
32221 /**
32222  * g_unix_socket_address_get_is_abstract:
32223  * @address: a #GInetSocketAddress
32224  *
32225  * Tests if @address is abstract.
32226  *
32227  * Returns: %TRUE if the address is abstract, %FALSE otherwise
32228  * Since: 2.22
32229  * Deprecated: Use g_unix_socket_address_get_address_type()
32230  */
32231
32232
32233 /**
32234  * g_unix_socket_address_get_path:
32235  * @address: a #GInetSocketAddress
32236  *
32237  * Gets @address's path, or for abstract sockets the "name".
32238  *
32239  * Guaranteed to be zero-terminated, but an abstract socket
32240  * may contain embedded zeros, and thus you should use
32241  * g_unix_socket_address_get_path_len() to get the true length
32242  * of this string.
32243  *
32244  * Returns: the path for @address
32245  * Since: 2.22
32246  */
32247
32248
32249 /**
32250  * g_unix_socket_address_get_path_len:
32251  * @address: a #GInetSocketAddress
32252  *
32253  * Gets the length of @address's path.
32254  *
32255  * For details, see g_unix_socket_address_get_path().
32256  *
32257  * Returns: the length of the path
32258  * Since: 2.22
32259  */
32260
32261
32262 /**
32263  * g_unix_socket_address_new:
32264  * @path: the socket path
32265  *
32266  * Creates a new #GUnixSocketAddress for @path.
32267  *
32268  * To create abstract socket addresses, on systems that support that,
32269  * use g_unix_socket_address_new_abstract().
32270  *
32271  * Returns: a new #GUnixSocketAddress
32272  * Since: 2.22
32273  */
32274
32275
32276 /**
32277  * g_unix_socket_address_new_abstract:
32278  * @path: (array length=path_len) (element-type gchar): the abstract name
32279  * @path_len: the length of @path, or -1
32280  *
32281  * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32282  * #GUnixSocketAddress for @path.
32283  *
32284  * Returns: a new #GUnixSocketAddress
32285  * Deprecated: Use g_unix_socket_address_new_with_type().
32286  */
32287
32288
32289 /**
32290  * g_unix_socket_address_new_with_type:
32291  * @path: (array length=path_len) (element-type gchar): the name
32292  * @path_len: the length of @path, or -1
32293  * @type: a #GUnixSocketAddressType
32294  *
32295  * Creates a new #GUnixSocketAddress of type @type with name @path.
32296  *
32297  * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32298  * calling g_unix_socket_address_new().
32299  *
32300  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32301  * bytes of @path will be copied to the socket's path, and only those
32302  * bytes will be considered part of the name. (If @path_len is -1,
32303  * then @path is assumed to be NUL-terminated.) For example, if @path
32304  * was "test", then calling g_socket_address_get_native_size() on the
32305  * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32306  * abstract-socket indicator byte, and 4 bytes for the name "test").
32307  *
32308  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32309  * @path_len bytes of @path will be copied to the socket's path, the
32310  * rest of the path will be padded with 0 bytes, and the entire
32311  * zero-padded buffer will be considered the name. (As above, if
32312  * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32313  * this case, g_socket_address_get_native_size() will always return
32314  * the full size of a <literal>struct sockaddr_un</literal>, although
32315  * g_unix_socket_address_get_path_len() will still return just the
32316  * length of @path.
32317  *
32318  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32319  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32320  * when connecting to a server created by another process, you must
32321  * use the appropriate type corresponding to how that process created
32322  * its listening socket.
32323  *
32324  * Returns: a new #GUnixSocketAddress
32325  * Since: 2.26
32326  */
32327
32328
32329 /**
32330  * g_vfs_get_default:
32331  *
32332  * Gets the default #GVfs for the system.
32333  *
32334  * Returns: (transfer none): a #GVfs.
32335  */
32336
32337
32338 /**
32339  * g_vfs_get_file_for_path:
32340  * @vfs: a #GVfs.
32341  * @path: a string containing a VFS path.
32342  *
32343  * Gets a #GFile for @path.
32344  *
32345  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32346  */
32347
32348
32349 /**
32350  * g_vfs_get_file_for_uri:
32351  * @vfs: a#GVfs.
32352  * @uri: a string containing a URI
32353  *
32354  * Gets a #GFile for @uri.
32355  *
32356  * This operation never fails, but the returned object
32357  * might not support any I/O operation if the URI
32358  * is malformed or if the URI scheme is not supported.
32359  *
32360  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32361  */
32362
32363
32364 /**
32365  * g_vfs_get_local:
32366  *
32367  * Gets the local #GVfs for the system.
32368  *
32369  * Returns: (transfer none): a #GVfs.
32370  */
32371
32372
32373 /**
32374  * g_vfs_get_supported_uri_schemes:
32375  * @vfs: a #GVfs.
32376  *
32377  * Gets a list of URI schemes supported by @vfs.
32378  *
32379  * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32380  */
32381
32382
32383 /**
32384  * g_vfs_is_active:
32385  * @vfs: a #GVfs.
32386  *
32387  * Checks if the VFS is active.
32388  *
32389  * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32390  */
32391
32392
32393 /**
32394  * g_vfs_parse_name:
32395  * @vfs: a #GVfs.
32396  * @parse_name: a string to be parsed by the VFS module.
32397  *
32398  * This operation never fails, but the returned object might
32399  * not support any I/O operations if the @parse_name cannot
32400  * be parsed by the #GVfs module.
32401  *
32402  * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32403  */
32404
32405
32406 /**
32407  * g_volume_can_eject:
32408  * @volume: a #GVolume.
32409  *
32410  * Checks if a volume can be ejected.
32411  *
32412  * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32413  */
32414
32415
32416 /**
32417  * g_volume_can_mount:
32418  * @volume: a #GVolume.
32419  *
32420  * Checks if a volume can be mounted.
32421  *
32422  * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32423  */
32424
32425
32426 /**
32427  * g_volume_eject:
32428  * @volume: a #GVolume.
32429  * @flags: flags affecting the unmount if required for eject
32430  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32431  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32432  * @user_data: user data that gets passed to @callback
32433  *
32434  * Ejects a volume. This is an asynchronous operation, and is
32435  * finished by calling g_volume_eject_finish() with the @volume
32436  * and #GAsyncResult returned in the @callback.
32437  *
32438  * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32439  */
32440
32441
32442 /**
32443  * g_volume_eject_finish:
32444  * @volume: pointer to a #GVolume.
32445  * @result: a #GAsyncResult.
32446  * @error: a #GError location to store an error, or %NULL to ignore
32447  *
32448  * Finishes ejecting a volume. If any errors occurred during the operation,
32449  * @error will be set to contain the errors and %FALSE will be returned.
32450  *
32451  * Returns: %TRUE, %FALSE if operation failed.
32452  * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32453  */
32454
32455
32456 /**
32457  * g_volume_eject_with_operation:
32458  * @volume: a #GVolume.
32459  * @flags: flags affecting the unmount if required for eject
32460  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32461  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32462  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32463  * @user_data: user data passed to @callback.
32464  *
32465  * Ejects a volume. This is an asynchronous operation, and is
32466  * finished by calling g_volume_eject_with_operation_finish() with the @volume
32467  * and #GAsyncResult data returned in the @callback.
32468  *
32469  * Since: 2.22
32470  */
32471
32472
32473 /**
32474  * g_volume_eject_with_operation_finish:
32475  * @volume: a #GVolume.
32476  * @result: a #GAsyncResult.
32477  * @error: a #GError location to store the error occurring, or %NULL to ignore.
32478  *
32479  * Finishes ejecting a volume. If any errors occurred during the operation,
32480  * @error will be set to contain the errors and %FALSE will be returned.
32481  *
32482  * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32483  * Since: 2.22
32484  */
32485
32486
32487 /**
32488  * g_volume_enumerate_identifiers:
32489  * @volume: a #GVolume
32490  *
32491  * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32492  * that @volume has. Use g_volume_get_identifier() to obtain
32493  * the identifiers themselves.
32494  *
32495  * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32496  */
32497
32498
32499 /**
32500  * g_volume_get_activation_root:
32501  * @volume: a #GVolume
32502  *
32503  * Gets the activation root for a #GVolume if it is known ahead of
32504  * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32505  * is mounted, then the result of g_mount_get_root() on the
32506  * #GMount object obtained from g_volume_get_mount() will always
32507  * either be equal or a prefix of what this function returns. In
32508  * other words, in code
32509  *
32510  * <programlisting>
32511  *   GMount *mount;
32512  *   GFile *mount_root
32513  *   GFile *volume_activation_root;
32514  *
32515  *   mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
32516  *   mount_root = g_mount_get_root (mount);
32517  *   volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
32518  * </programlisting>
32519  *
32520  * then the expression
32521  *
32522  * <programlisting>
32523  *   (g_file_has_prefix (volume_activation_root, mount_root) ||
32524  *       g_file_equal (volume_activation_root, mount_root))
32525  * </programlisting>
32526  *
32527  * will always be %TRUE.
32528  *
32529  * Activation roots are typically used in #GVolumeMonitor
32530  * implementations to find the underlying mount to shadow, see
32531  * g_mount_is_shadowed() for more details.
32532  *
32533  * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
32534  * Since: 2.18
32535  */
32536
32537
32538 /**
32539  * g_volume_get_drive:
32540  * @volume: a #GVolume.
32541  *
32542  * Gets the drive for the @volume.
32543  *
32544  * 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.
32545  */
32546
32547
32548 /**
32549  * g_volume_get_icon:
32550  * @volume: a #GVolume.
32551  *
32552  * Gets the icon for @volume.
32553  *
32554  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32555  */
32556
32557
32558 /**
32559  * g_volume_get_identifier:
32560  * @volume: a #GVolume
32561  * @kind: the kind of identifier to return
32562  *
32563  * Gets the identifier of the given kind for @volume.
32564  * See the <link linkend="volume-identifier">introduction</link>
32565  * for more information about volume identifiers.
32566  *
32567  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
32568  */
32569
32570
32571 /**
32572  * g_volume_get_mount:
32573  * @volume: a #GVolume.
32574  *
32575  * Gets the mount for the @volume.
32576  *
32577  * 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.
32578  */
32579
32580
32581 /**
32582  * g_volume_get_name:
32583  * @volume: a #GVolume.
32584  *
32585  * Gets the name of @volume.
32586  *
32587  * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
32588  */
32589
32590
32591 /**
32592  * g_volume_get_sort_key:
32593  * @volume: A #GVolume.
32594  *
32595  * Gets the sort key for @volume, if any.
32596  *
32597  * Returns: Sorting key for @volume or %NULL if no such key is available.
32598  * Since: 2.32
32599  */
32600
32601
32602 /**
32603  * g_volume_get_uuid:
32604  * @volume: a #GVolume.
32605  *
32606  * Gets the UUID for the @volume. The reference is typically based on
32607  * the file system UUID for the volume in question and should be
32608  * considered an opaque string. Returns %NULL if there is no UUID
32609  * available.
32610  *
32611  * 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.
32612  */
32613
32614
32615 /**
32616  * g_volume_monitor_adopt_orphan_mount:
32617  * @mount: a #GMount object to find a parent for
32618  *
32619  * This function should be called by any #GVolumeMonitor
32620  * implementation when a new #GMount object is created that is not
32621  * associated with a #GVolume object. It must be called just before
32622  * emitting the @mount_added signal.
32623  *
32624  * If the return value is not %NULL, the caller must associate the
32625  * returned #GVolume object with the #GMount. This involves returning
32626  * it in its g_mount_get_volume() implementation. The caller must
32627  * also listen for the "removed" signal on the returned object
32628  * and give up its reference when handling that signal
32629  *
32630  * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
32631  * the implementor must take a reference to @mount and return it in
32632  * its g_volume_get_mount() implemented. Also, the implementor must
32633  * listen for the "unmounted" signal on @mount and give up its
32634  * reference upon handling that signal.
32635  *
32636  * There are two main use cases for this function.
32637  *
32638  * One is when implementing a user space file system driver that reads
32639  * blocks of a block device that is already represented by the native
32640  * volume monitor (for example a CD Audio file system driver). Such
32641  * a driver will generate its own #GMount object that needs to be
32642  * associated with the #GVolume object that represents the volume.
32643  *
32644  * The other is for implementing a #GVolumeMonitor whose sole purpose
32645  * is to return #GVolume objects representing entries in the users
32646  * "favorite servers" list or similar.
32647  *
32648  * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
32649  * 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.
32650  */
32651
32652
32653 /**
32654  * g_volume_monitor_get:
32655  *
32656  * Gets the volume monitor used by gio.
32657  *
32658  * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
32659  */
32660
32661
32662 /**
32663  * g_volume_monitor_get_connected_drives:
32664  * @volume_monitor: a #GVolumeMonitor.
32665  *
32666  * Gets a list of drives connected to the system.
32667  *
32668  * The returned list should be freed with g_list_free(), after
32669  * its elements have been unreffed with g_object_unref().
32670  *
32671  * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
32672  */
32673
32674
32675 /**
32676  * g_volume_monitor_get_mount_for_uuid:
32677  * @volume_monitor: a #GVolumeMonitor.
32678  * @uuid: the UUID to look for
32679  *
32680  * Finds a #GMount object by its UUID (see g_mount_get_uuid())
32681  *
32682  * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
32683  */
32684
32685
32686 /**
32687  * g_volume_monitor_get_mounts:
32688  * @volume_monitor: a #GVolumeMonitor.
32689  *
32690  * Gets a list of the mounts on the system.
32691  *
32692  * The returned list should be freed with g_list_free(), after
32693  * its elements have been unreffed with g_object_unref().
32694  *
32695  * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
32696  */
32697
32698
32699 /**
32700  * g_volume_monitor_get_volume_for_uuid:
32701  * @volume_monitor: a #GVolumeMonitor.
32702  * @uuid: the UUID to look for
32703  *
32704  * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
32705  *
32706  * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
32707  */
32708
32709
32710 /**
32711  * g_volume_monitor_get_volumes:
32712  * @volume_monitor: a #GVolumeMonitor.
32713  *
32714  * Gets a list of the volumes on the system.
32715  *
32716  * The returned list should be freed with g_list_free(), after
32717  * its elements have been unreffed with g_object_unref().
32718  *
32719  * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
32720  */
32721
32722
32723 /**
32724  * g_volume_mount:
32725  * @volume: a #GVolume.
32726  * @flags: flags affecting the operation
32727  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32728  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32729  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32730  * @user_data: user data that gets passed to @callback
32731  *
32732  * Mounts a volume. This is an asynchronous operation, and is
32733  * finished by calling g_volume_mount_finish() with the @volume
32734  * and #GAsyncResult returned in the @callback.
32735  *
32736  * Virtual: mount_fn
32737  */
32738
32739
32740 /**
32741  * g_volume_mount_finish:
32742  * @volume: a #GVolume
32743  * @result: a #GAsyncResult
32744  * @error: a #GError location to store an error, or %NULL to ignore
32745  *
32746  * Finishes mounting a volume. If any errors occurred during the operation,
32747  * @error will be set to contain the errors and %FALSE will be returned.
32748  *
32749  * If the mount operation succeeded, g_volume_get_mount() on @volume
32750  * is guaranteed to return the mount right after calling this
32751  * function; there's no need to listen for the 'mount-added' signal on
32752  * #GVolumeMonitor.
32753  *
32754  * Returns: %TRUE, %FALSE if operation failed.
32755  */
32756
32757
32758 /**
32759  * g_volume_should_automount:
32760  * @volume: a #GVolume
32761  *
32762  * Returns whether the volume should be automatically mounted.
32763  *
32764  * Returns: %TRUE if the volume should be automatically mounted.
32765  */
32766
32767
32768 /**
32769  * g_win32_input_stream_get_close_handle:
32770  * @stream: a #GWin32InputStream
32771  *
32772  * Returns whether the handle of @stream will be
32773  * closed when the stream is closed.
32774  *
32775  * Returns: %TRUE if the handle is closed when done
32776  * Since: 2.26
32777  */
32778
32779
32780 /**
32781  * g_win32_input_stream_get_handle:
32782  * @stream: a #GWin32InputStream
32783  *
32784  * Return the Windows file handle that the stream reads from.
32785  *
32786  * Returns: The file handle of @stream
32787  * Since: 2.26
32788  */
32789
32790
32791 /**
32792  * g_win32_input_stream_new:
32793  * @handle: a Win32 file handle
32794  * @close_handle: %TRUE to close the handle when done
32795  *
32796  * Creates a new #GWin32InputStream for the given @handle.
32797  *
32798  * If @close_handle is %TRUE, the handle will be closed
32799  * when the stream is closed.
32800  *
32801  * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
32802  * as used in the Windows C libraries.
32803  *
32804  * Returns: a new #GWin32InputStream
32805  */
32806
32807
32808 /**
32809  * g_win32_input_stream_set_close_handle:
32810  * @stream: a #GWin32InputStream
32811  * @close_handle: %TRUE to close the handle when done
32812  *
32813  * Sets whether the handle of @stream shall be closed
32814  * when the stream is closed.
32815  *
32816  * Since: 2.26
32817  */
32818
32819
32820 /**
32821  * g_win32_output_stream_get_close_handle:
32822  * @stream: a #GWin32OutputStream
32823  *
32824  * Returns whether the handle of @stream will be closed when the
32825  * stream is closed.
32826  *
32827  * Returns: %TRUE if the handle is closed when done
32828  * Since: 2.26
32829  */
32830
32831
32832 /**
32833  * g_win32_output_stream_get_handle:
32834  * @stream: a #GWin32OutputStream
32835  *
32836  * Return the Windows handle that the stream writes to.
32837  *
32838  * Returns: The handle descriptor of @stream
32839  * Since: 2.26
32840  */
32841
32842
32843 /**
32844  * g_win32_output_stream_new:
32845  * @handle: a Win32 file handle
32846  * @close_handle: %TRUE to close the handle when done
32847  *
32848  * Creates a new #GWin32OutputStream for the given @handle.
32849  *
32850  * If @close_handle, is %TRUE, the handle will be closed when the
32851  * output stream is destroyed.
32852  *
32853  * Returns: a new #GOutputStream
32854  * Since: 2.26
32855  */
32856
32857
32858 /**
32859  * g_win32_output_stream_set_close_handle:
32860  * @stream: a #GWin32OutputStream
32861  * @close_handle: %TRUE to close the handle when done
32862  *
32863  * Sets whether the handle of @stream shall be closed when the stream
32864  * is closed.
32865  *
32866  * Since: 2.26
32867  */
32868
32869
32870 /**
32871  * g_zlib_compressor_get_file_info:
32872  * @compressor: a #GZlibCompressor
32873  *
32874  * Returns the #GZlibCompressor:file-info property.
32875  *
32876  * Returns: (transfer none): a #GFileInfo, or %NULL
32877  * Since: 2.26
32878  */
32879
32880
32881 /**
32882  * g_zlib_compressor_new:
32883  * @format: The format to use for the compressed data
32884  * @level: compression level (0-9), -1 for default
32885  *
32886  * Creates a new #GZlibCompressor.
32887  *
32888  * Returns: a new #GZlibCompressor
32889  * Since: 2.24
32890  */
32891
32892
32893 /**
32894  * g_zlib_compressor_set_file_info:
32895  * @compressor: a #GZlibCompressor
32896  * @file_info: (allow-none): a #GFileInfo
32897  *
32898  * Sets @file_info in @compressor. If non-%NULL, and @compressor's
32899  * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
32900  * it will be used to set the file name and modification time in
32901  * the GZIP header of the compressed data.
32902  *
32903  * Note: it is an error to call this function while a compression is in
32904  * progress; it may only be called immediately after creation of @compressor,
32905  * or after resetting it with g_converter_reset().
32906  *
32907  * Since: 2.26
32908  */
32909
32910
32911 /**
32912  * g_zlib_decompressor_get_file_info:
32913  * @decompressor: a #GZlibDecompressor
32914  *
32915  * Retrieves the #GFileInfo constructed from the GZIP header data
32916  * of compressed data processed by @compressor, or %NULL if @decompressor's
32917  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
32918  * or the header data was not fully processed yet, or it not present in the
32919  * data stream at all.
32920  *
32921  * Returns: (transfer none): a #GFileInfo, or %NULL
32922  * Since: 2.26
32923  */
32924
32925
32926 /**
32927  * g_zlib_decompressor_new:
32928  * @format: The format to use for the compressed data
32929  *
32930  * Creates a new #GZlibDecompressor.
32931  *
32932  * Returns: a new #GZlibDecompressor
32933  * Since: 2.24
32934  */
32935
32936
32937 /**
32938  * get_all_desktop_entries_for_mime_type:
32939  * @mime_type: a mime type.
32940  * @except: NULL or a strv list
32941  *
32942  * Returns all the desktop ids for @mime_type. The desktop files
32943  * are listed in an order so that default applications are listed before
32944  * non-default ones, and handlers for inherited mimetypes are listed
32945  * after the base ones.
32946  *
32947  * Optionally doesn't list the desktop ids given in the @except
32948  *
32949  * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
32950  */
32951
32952
32953 /**
32954  * mime_info_cache_reload:
32955  * @dir: directory path which needs reloading.
32956  *
32957  * Reload the mime information for the @dir.
32958  */
32959
32960
32961
32962 /************************************************************/
32963 /* THIS FILE IS GENERATED DO NOT EDIT */
32964 /************************************************************/