giscanner: fix DocBlock().comment
[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: (allow-none): 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::show-unmount-progress:
1700  * @op: a #GMountOperation:
1701  * @message: string containing a mesage to display to the user
1702  * @time_left: the estimated time left before the operation completes, in microseconds, or -1
1703  * @bytes_left: the amount of bytes to be written before the operation completes (or -1 if such amount is not known), or zero if the operation is completed
1704  *
1705  * Emitted when an unmount operation has been busy for more than some time
1706  * (typically 1.5 seconds).
1707  *
1708  * When unmounting or ejecting a volume, the kernel might need to flush
1709  * pending data in its buffers to the volume stable storage, and this operation
1710  * can take a considerable amount of time. This signal may be emitted several
1711  * times as long as the unmount operation is outstanding, and then one
1712  * last time when the operation is completed, with @bytes_left set to zero.
1713  *
1714  * Implementations of GMountOperation should handle this signal by
1715  * showing an UI notification, and then dismiss it, or show another notification
1716  * of completion, when @bytes_left reaches zero.
1717  *
1718  * If the message contains a line break, the first line should be
1719  * presented as a heading. For example, it may be used as the
1720  * primary text in a #GtkMessageDialog.
1721  *
1722  * Since: 2.34
1723  */
1724
1725
1726 /**
1727  * GMountOperation:anonymous:
1728  *
1729  * Whether to use an anonymous user when authenticating.
1730  */
1731
1732
1733 /**
1734  * GMountOperation:choice:
1735  *
1736  * The index of the user's choice when a question is asked during the
1737  * mount operation. See the #GMountOperation::ask-question signal.
1738  */
1739
1740
1741 /**
1742  * GMountOperation:domain:
1743  *
1744  * The domain to use for the mount operation.
1745  */
1746
1747
1748 /**
1749  * GMountOperation:password:
1750  *
1751  * The password that is used for authentication when carrying out
1752  * the mount operation.
1753  */
1754
1755
1756 /**
1757  * GMountOperation:password-save:
1758  *
1759  * Determines if and how the password information should be saved.
1760  */
1761
1762
1763 /**
1764  * GMountOperation:username:
1765  *
1766  * The user name that is used for authentication when carrying out
1767  * the mount operation.
1768  */
1769
1770
1771 /**
1772  * GNetworkAddress:
1773  *
1774  * A #GSocketConnectable for resolving a hostname and connecting to
1775  * that host.
1776  */
1777
1778
1779 /**
1780  * GNetworkMonitor:
1781  *
1782  * #GNetworkMonitor monitors the status of network connections and
1783  * indicates when a possibly-user-visible change has occurred.
1784  *
1785  * Since: 2.32
1786  */
1787
1788
1789 /**
1790  * GNetworkMonitor::network-changed:
1791  * @monitor: a #GNetworkMonitor
1792  * @available: the current value of #GNetworkMonitor:network-available
1793  *
1794  * Emitted when the network configuration changes. If @available is
1795  * %TRUE, then some hosts may be reachable that were not reachable
1796  * before, while others that were reachable before may no longer be
1797  * reachable. If @available is %FALSE, then no remote hosts are
1798  * reachable.
1799  *
1800  * Since: 2.32
1801  */
1802
1803
1804 /**
1805  * GNetworkMonitor:network-available:
1806  *
1807  * Whether the network is considered available. That is, whether the
1808  * system has a default route for at least one of IPv4 or IPv6.
1809  *
1810  * Real-world networks are of course much more complicated than
1811  * this; the machine may be connected to a wifi hotspot that
1812  * requires payment before allowing traffic through, or may be
1813  * connected to a functioning router that has lost its own upstream
1814  * connectivity. Some hosts might only be accessible when a VPN is
1815  * active. Other hosts might only be accessible when the VPN is
1816  * <emphasis>not</emphasis> active. Thus, it is best to use
1817  * g_network_monitor_can_reach() or
1818  * g_network_monitor_can_reach_async() to test for reachability on a
1819  * host-by-host basis. (On the other hand, when the property is
1820  * %FALSE, the application can reasonably expect that no remote
1821  * hosts at all are reachable, and should indicate this to the user
1822  * in its UI.)
1823  *
1824  * See also #GNetworkMonitor::network-changed.
1825  *
1826  * Since: 2.32
1827  */
1828
1829
1830 /**
1831  * GNetworkService:
1832  *
1833  * A #GSocketConnectable for resolving a SRV record and connecting to
1834  * that service.
1835  */
1836
1837
1838 /**
1839  * GPermission:
1840  *
1841  * #GPermission is an opaque data structure and can only be accessed
1842  * using the following functions.
1843  */
1844
1845
1846 /**
1847  * GPermission:allowed:
1848  *
1849  * %TRUE if the caller currently has permission to perform the action that
1850  * @permission represents the permission to perform.
1851  */
1852
1853
1854 /**
1855  * GPermission:can-acquire:
1856  *
1857  * %TRUE if it is generally possible to acquire the permission by calling
1858  * g_permission_acquire().
1859  */
1860
1861
1862 /**
1863  * GPermission:can-release:
1864  *
1865  * %TRUE if it is generally possible to release the permission by calling
1866  * g_permission_release().
1867  */
1868
1869
1870 /**
1871  * GProxyAddress:
1872  *
1873  * A #GInetSocketAddress representing a connection via a proxy server
1874  *
1875  * Since: 2.26
1876  */
1877
1878
1879 /**
1880  * GProxyAddress:destination-protocol:
1881  *
1882  * The protocol being spoke to the destination host, or %NULL if
1883  * the #GProxyAddress doesn't know.
1884  *
1885  * Since: 2.34
1886  */
1887
1888
1889 /**
1890  * GProxyAddress:uri:
1891  *
1892  * The URI string that the proxy was constructed from (or %NULL
1893  * if the creator didn't specify this).
1894  *
1895  * Since: 2.34
1896  */
1897
1898
1899 /**
1900  * GRemoteActionGroupInterface:
1901  * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1902  * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1903  *
1904  * The virtual function table for #GRemoteActionGroup.
1905  *
1906  * Since: 2.32
1907  */
1908
1909
1910 /**
1911  * GResolver:
1912  *
1913  * The object that handles DNS resolution. Use g_resolver_get_default()
1914  * to get the default resolver.
1915  */
1916
1917
1918 /**
1919  * GResolver::reload:
1920  * @resolver: a #GResolver
1921  *
1922  * Emitted when the resolver notices that the system resolver
1923  * configuration has changed.
1924  */
1925
1926
1927 /**
1928  * GSettings::change-event:
1929  * @settings: the object on which the signal was emitted
1930  * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1931  * @n_keys: the length of the @keys array, or 0
1932  *
1933  * The "change-event" signal is emitted once per change event that
1934  * affects this settings object.  You should connect to this signal
1935  * only if you are interested in viewing groups of changes before they
1936  * are split out into multiple emissions of the "changed" signal.
1937  * For most use cases it is more appropriate to use the "changed" signal.
1938  *
1939  * In the event that the change event applies to one or more specified
1940  * keys, @keys will be an array of #GQuark of length @n_keys.  In the
1941  * event that the change event applies to the #GSettings object as a
1942  * whole (ie: potentially every key has been changed) then @keys will
1943  * be %NULL and @n_keys will be 0.
1944  *
1945  * The default handler for this signal invokes the "changed" signal
1946  * for each affected key.  If any other connected handler returns
1947  * %TRUE then this default functionality will be suppressed.
1948  *
1949  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1950  */
1951
1952
1953 /**
1954  * GSettings::changed:
1955  * @settings: the object on which the signal was emitted
1956  * @key: the name of the key that changed
1957  *
1958  * The "changed" signal is emitted when a key has potentially changed.
1959  * You should call one of the g_settings_get() calls to check the new
1960  * value.
1961  *
1962  * This signal supports detailed connections.  You can connect to the
1963  * detailed signal "changed::x" in order to only receive callbacks
1964  * when key "x" changes.
1965  */
1966
1967
1968 /**
1969  * GSettings::writable-change-event:
1970  * @settings: the object on which the signal was emitted
1971  * @key: the quark of the key, or 0
1972  *
1973  * The "writable-change-event" signal is emitted once per writability
1974  * change event that affects this settings object.  You should connect
1975  * to this signal if you are interested in viewing groups of changes
1976  * before they are split out into multiple emissions of the
1977  * "writable-changed" signal.  For most use cases it is more
1978  * appropriate to use the "writable-changed" signal.
1979  *
1980  * In the event that the writability change applies only to a single
1981  * key, @key will be set to the #GQuark for that key.  In the event
1982  * that the writability change affects the entire settings object,
1983  * @key will be 0.
1984  *
1985  * The default handler for this signal invokes the "writable-changed"
1986  * and "changed" signals for each affected key.  This is done because
1987  * changes in writability might also imply changes in value (if for
1988  * example, a new mandatory setting is introduced).  If any other
1989  * connected handler returns %TRUE then this default functionality
1990  * will be suppressed.
1991  *
1992  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1993  */
1994
1995
1996 /**
1997  * GSettings::writable-changed:
1998  * @settings: the object on which the signal was emitted
1999  * @key: the key
2000  *
2001  * The "writable-changed" signal is emitted when the writability of a
2002  * key has potentially changed.  You should call
2003  * g_settings_is_writable() in order to determine the new status.
2004  *
2005  * This signal supports detailed connections.  You can connect to the
2006  * detailed signal "writable-changed::x" in order to only receive
2007  * callbacks when the writability of "x" changes.
2008  */
2009
2010
2011 /**
2012  * GSettings:context:
2013  *
2014  * The name of the context that the settings are stored in.
2015  */
2016
2017
2018 /**
2019  * GSettings:delay-apply:
2020  *
2021  * Whether the #GSettings object is in 'delay-apply' mode. See
2022  * g_settings_delay() for details.
2023  *
2024  * Since: 2.28
2025  */
2026
2027
2028 /**
2029  * GSettings:has-unapplied:
2030  *
2031  * If this property is %TRUE, the #GSettings object has outstanding
2032  * changes that will be applied when g_settings_apply() is called.
2033  */
2034
2035
2036 /**
2037  * GSettings:path:
2038  *
2039  * The path within the backend where the settings are stored.
2040  */
2041
2042
2043 /**
2044  * GSettings:schema:
2045  *
2046  * The name of the schema that describes the types of keys
2047  * for this #GSettings object.
2048  *
2049  * The type of this property is *not* #GSettingsSchema.
2050  * #GSettingsSchema has only existed since version 2.32 and
2051  * unfortunately this name was used in previous versions to refer to
2052  * the schema ID rather than the schema itself.  Take care to use the
2053  * 'settings-schema' property if you wish to pass in a
2054  * #GSettingsSchema.
2055  *
2056  * Deprecated: 2.32:Use the 'schema-id' property instead.  In a future version, this property may instead refer to a #GSettingsSchema.
2057  */
2058
2059
2060 /**
2061  * GSettings:schema-id:
2062  *
2063  * The name of the schema that describes the types of keys
2064  * for this #GSettings object.
2065  */
2066
2067
2068 /**
2069  * GSettings:settings-schema:
2070  *
2071  * The #GSettingsSchema describing the types of keys for this
2072  * #GSettings object.
2073  *
2074  * Ideally, this property would be called 'schema'.  #GSettingsSchema
2075  * has only existed since version 2.32, however, and before then the
2076  * 'schema' property was used to refer to the ID of the schema rather
2077  * than the schema itself.  Take care.
2078  */
2079
2080
2081 /**
2082  * GSettingsSchema:
2083  *
2084  * This is an opaque structure type.  You may not access it directly.
2085  *
2086  * Since: 2.32
2087  */
2088
2089
2090 /**
2091  * GSettingsSchemaSource:
2092  *
2093  * This is an opaque structure type.  You may not access it directly.
2094  *
2095  * Since: 2.32
2096  */
2097
2098
2099 /**
2100  * GSimpleAction::activate:
2101  * @simple: the #GSimpleAction
2102  * @parameter: (allow-none): the parameter to the activation
2103  *
2104  * Indicates that the action was just activated.
2105  *
2106  * @parameter will always be of the expected type.  In the event that
2107  * an incorrect type was given, no signal will be emitted.
2108  *
2109  * Since: 2.28
2110  */
2111
2112
2113 /**
2114  * GSimpleAction::change-state:
2115  * @simple: the #GSimpleAction
2116  * @value: (allow-none): the requested value for the state
2117  *
2118  * Indicates that the action just received a request to change its
2119  * state.
2120  *
2121  * @value will always be of the correct state type.  In the event that
2122  * an incorrect type was given, no signal will be emitted.
2123  *
2124  * If no handler is connected to this signal then the default
2125  * behaviour is to call g_simple_action_set_state() to set the state
2126  * to the requested value.  If you connect a signal handler then no
2127  * default action is taken.  If the state should change then you must
2128  * call g_simple_action_set_state() from the handler.
2129  *
2130  * <example>
2131  * <title>Example 'change-state' handler</title>
2132  * <programlisting>
2133  * static void
2134  * change_volume_state (GSimpleAction *action,
2135  *                      GVariant      *value,
2136  *                      gpointer       user_data)
2137  * {
2138  *   gint requested;
2139  *
2140  *   requested = g_variant_get_int32 (value);
2141  *
2142  *   // Volume only goes from 0 to 10
2143  *   if (0 <= requested && requested <= 10)
2144  *     g_simple_action_set_state (action, value);
2145  * }
2146  * </programlisting>
2147  * </example>
2148  *
2149  * The handler need not set the state to the requested value.  It
2150  * could set it to any value at all, or take some other action.
2151  *
2152  * Since: 2.30
2153  */
2154
2155
2156 /**
2157  * GSimpleAction:enabled:
2158  *
2159  * If @action is currently enabled.
2160  *
2161  * If the action is disabled then calls to g_action_activate() and
2162  * g_action_change_state() have no effect.
2163  *
2164  * Since: 2.28
2165  */
2166
2167
2168 /**
2169  * GSimpleAction:name:
2170  *
2171  * The name of the action.  This is mostly meaningful for identifying
2172  * the action once it has been added to a #GSimpleActionGroup.
2173  *
2174  * Since: 2.28
2175  */
2176
2177
2178 /**
2179  * GSimpleAction:parameter-type:
2180  *
2181  * The type of the parameter that must be given when activating the
2182  * action.
2183  *
2184  * Since: 2.28
2185  */
2186
2187
2188 /**
2189  * GSimpleAction:state:
2190  *
2191  * The state of the action, or %NULL if the action is stateless.
2192  *
2193  * Since: 2.28
2194  */
2195
2196
2197 /**
2198  * GSimpleAction:state-type:
2199  *
2200  * The #GVariantType of the state that the action has, or %NULL if the
2201  * action is stateless.
2202  *
2203  * Since: 2.28
2204  */
2205
2206
2207 /**
2208  * GSimplePermission:
2209  *
2210  * #GSimplePermission is an opaque data structure.  There are no methods
2211  * except for those defined by #GPermission.
2212  */
2213
2214
2215 /**
2216  * GSocket:broadcast:
2217  *
2218  * Whether the socket should allow sending to and receiving from broadcast addresses.
2219  *
2220  * Since: 2.32
2221  */
2222
2223
2224 /**
2225  * GSocket:multicast-loopback:
2226  *
2227  * Whether outgoing multicast packets loop back to the local host.
2228  *
2229  * Since: 2.32
2230  */
2231
2232
2233 /**
2234  * GSocket:multicast-ttl:
2235  *
2236  * Time-to-live out outgoing multicast packets
2237  *
2238  * Since: 2.32
2239  */
2240
2241
2242 /**
2243  * GSocket:timeout:
2244  *
2245  * The timeout in seconds on socket I/O
2246  *
2247  * Since: 2.26
2248  */
2249
2250
2251 /**
2252  * GSocket:ttl:
2253  *
2254  * Time-to-live for outgoing unicast packets
2255  *
2256  * Since: 2.32
2257  */
2258
2259
2260 /**
2261  * GSocketAddress:
2262  *
2263  * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2264  * or one of its subtypes.
2265  */
2266
2267
2268 /**
2269  * GSocketClient::event:
2270  * @client: the #GSocketClient
2271  * @event: the event that is occurring
2272  * @connectable: the #GSocketConnectable that @event is occurring on
2273  * @connection: the current representation of the connection
2274  *
2275  * Emitted when @client's activity on @connectable changes state.
2276  * Among other things, this can be used to provide progress
2277  * information about a network connection in the UI. The meanings of
2278  * the different @event values are as follows:
2279  *
2280  * <variablelist>
2281  *   <varlistentry>
2282  *     <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2283  *     <listitem><para>
2284  *       @client is about to look up @connectable in DNS.
2285  *       @connection will be %NULL.
2286  *     </para></listitem>
2287  *   </varlistentry>
2288  *   <varlistentry>
2289  *     <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2290  *     <listitem><para>
2291  *       @client has successfully resolved @connectable in DNS.
2292  *       @connection will be %NULL.
2293  *     </para></listitem>
2294  *   </varlistentry>
2295  *   <varlistentry>
2296  *     <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2297  *     <listitem><para>
2298  *       @client is about to make a connection to a remote host;
2299  *       either a proxy server or the destination server itself.
2300  *       @connection is the #GSocketConnection, which is not yet
2301  *       connected.
2302  *     </para></listitem>
2303  *   </varlistentry>
2304  *   <varlistentry>
2305  *     <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2306  *     <listitem><para>
2307  *       @client has successfully connected to a remote host.
2308  *       @connection is the connected #GSocketConnection.
2309  *     </para></listitem>
2310  *   </varlistentry>
2311  *   <varlistentry>
2312  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2313  *     <listitem><para>
2314  *       @client is about to negotiate with a proxy to get it to
2315  *       connect to @connectable. @connection is the
2316  *       #GSocketConnection to the proxy server.
2317  *     </para></listitem>
2318  *   </varlistentry>
2319  *   <varlistentry>
2320  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2321  *     <listitem><para>
2322  *       @client has negotiated a connection to @connectable through
2323  *       a proxy server. @connection is the stream returned from
2324  *       g_proxy_connect(), which may or may not be a
2325  *       #GSocketConnection.
2326  *     </para></listitem>
2327  *   </varlistentry>
2328  *   <varlistentry>
2329  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2330  *     <listitem><para>
2331  *       @client is about to begin a TLS handshake. @connection is a
2332  *       #GTlsClientConnection.
2333  *     </para></listitem>
2334  *   </varlistentry>
2335  *   <varlistentry>
2336  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2337  *     <listitem><para>
2338  *       @client has successfully completed the TLS handshake.
2339  *       @connection is a #GTlsClientConnection.
2340  *     </para></listitem>
2341  *   </varlistentry>
2342  *   <varlistentry>
2343  *     <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2344  *     <listitem><para>
2345  *       @client has either successfully connected to @connectable
2346  *       (in which case @connection is the #GSocketConnection that
2347  *       it will be returning to the caller) or has failed (in which
2348  *       case @connection is %NULL and the client is about to return
2349  *       an error).
2350  *     </para></listitem>
2351  *   </varlistentry>
2352  * </variablelist>
2353  *
2354  * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2355  * multiple times (or not at all) for a given connectable (in
2356  * particular, if @client ends up attempting to connect to more than
2357  * one address). However, if @client emits the #GSocketClient::event
2358  * signal at all for a given connectable, that it will always emit
2359  * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2360  *
2361  * Note that there may be additional #GSocketClientEvent values in
2362  * the future; unrecognized @event values should be ignored.
2363  *
2364  * Since: 2.32
2365  */
2366
2367
2368 /**
2369  * GSocketService::incoming:
2370  * @service: the #GSocketService
2371  * @connection: a new #GSocketConnection object
2372  * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2373  *
2374  * The ::incoming signal is emitted when a new incoming connection
2375  * to @service needs to be handled. The handler must initiate the
2376  * handling of @connection, but may not block; in essence,
2377  * asynchronous operations must be used.
2378  *
2379  * @connection will be unreffed once the signal handler returns,
2380  * so you need to ref it yourself if you are planning to use it.
2381  *
2382  * Returns: %TRUE to stop other handlers from being called
2383  * Since: 2.22
2384  */
2385
2386
2387 /**
2388  * GSrvTarget:
2389  *
2390  * A single target host/port that a network service is running on.
2391  */
2392
2393
2394 /**
2395  * GTask:
2396  *
2397  * The opaque object representing a synchronous or asynchronous task
2398  * and its result.
2399  */
2400
2401
2402 /**
2403  * GTaskThreadFunc:
2404  * @task: the #GTask
2405  * @source_object: @task's source object
2406  * @task_data: @task's task data
2407  * @cancellable: @task's #GCancellable, or %NULL
2408  *
2409  * The prototype for a task function to be run in a thread via
2410  * g_task_run_in_thread() or g_task_run_in_thread_sync().
2411  *
2412  * If the return-on-cancel flag is set on @task, and @cancellable gets
2413  * cancelled, then the #GTask will be completed immediately (as though
2414  * g_task_return_error_if_cancelled() had been called), without
2415  * waiting for the task function to complete. However, the task
2416  * function will continue running in its thread in the background. The
2417  * function therefore needs to be careful about how it uses
2418  * externally-visible state in this case. See
2419  * g_task_set_return_on_cancel() for more details.
2420  *
2421  * Other than in that case, @task will be completed when the
2422  * #GTaskThreadFunc returns, <emphasis>not</emphasis> when it calls
2423  * a <literal>g_task_return_</literal> function.
2424  *
2425  * Since: 2.36
2426  */
2427
2428
2429 /**
2430  * GTestDBus:
2431  *
2432  * The #GTestDBus structure contains only private data and
2433  * should only be accessed using the provided API.
2434  *
2435  * Since: 2.34
2436  */
2437
2438
2439 /**
2440  * GTestDBus:flags:
2441  *
2442  * #GTestDBusFlags specifying the behaviour of the dbus session
2443  *
2444  * Since: 2.34
2445  */
2446
2447
2448 /**
2449  * GThemedIcon:name:
2450  *
2451  * The icon name.
2452  */
2453
2454
2455 /**
2456  * GThemedIcon:names:
2457  *
2458  * A %NULL-terminated array of icon names.
2459  */
2460
2461
2462 /**
2463  * GThemedIcon:use-default-fallbacks:
2464  *
2465  * Whether to use the default fallbacks found by shortening the icon name
2466  * at '-' characters. If the "names" array has more than one element,
2467  * ignores any past the first.
2468  *
2469  * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2470  * would become
2471  * |[
2472  * {
2473  *   "gnome-dev-cdrom-audio",
2474  *   "gnome-dev-cdrom",
2475  *   "gnome-dev",
2476  *   "gnome",
2477  *   NULL
2478  * };
2479  * ]|
2480  */
2481
2482
2483 /**
2484  * GThreadedSocketService::run:
2485  * @service: the #GThreadedSocketService.
2486  * @connection: a new #GSocketConnection object.
2487  * @source_object: the source_object passed to g_socket_listener_add_address().
2488  *
2489  * The ::run signal is emitted in a worker thread in response to an
2490  * incoming connection. This thread is dedicated to handling
2491  * @connection and may perform blocking IO. The signal handler need
2492  * not return until the connection is closed.
2493  *
2494  * Returns: %TRUE to stop further signal handlers from being called
2495  */
2496
2497
2498 /**
2499  * GTlsBackend:
2500  *
2501  * TLS (Transport Layer Security, aka SSL) backend. This is an
2502  * internal type used to coordinate the different classes implemented
2503  * by a TLS backend.
2504  *
2505  * Since: 2.28
2506  */
2507
2508
2509 /**
2510  * GTlsCertificate:
2511  *
2512  * Abstract base class for TLS certificate types.
2513  *
2514  * Since: 2.28
2515  */
2516
2517
2518 /**
2519  * GTlsCertificate:certificate:
2520  *
2521  * The DER (binary) encoded representation of the certificate.
2522  * This property and the #GTlsCertificate:certificate-pem property
2523  * represent the same data, just in different forms.
2524  *
2525  * Since: 2.28
2526  */
2527
2528
2529 /**
2530  * GTlsCertificate:certificate-pem:
2531  *
2532  * The PEM (ASCII) encoded representation of the certificate.
2533  * This property and the #GTlsCertificate:certificate
2534  * property represent the same data, just in different forms.
2535  *
2536  * Since: 2.28
2537  */
2538
2539
2540 /**
2541  * GTlsCertificate:issuer:
2542  *
2543  * A #GTlsCertificate representing the entity that issued this
2544  * certificate. If %NULL, this means that the certificate is either
2545  * self-signed, or else the certificate of the issuer is not
2546  * available.
2547  *
2548  * Since: 2.28
2549  */
2550
2551
2552 /**
2553  * GTlsCertificate:private-key:
2554  *
2555  * The DER (binary) encoded representation of the certificate's
2556  * private key, in either PKCS#1 format or unencrypted PKCS#8
2557  * format. This property (or the #GTlsCertificate:private-key-pem
2558  * property) can be set when constructing a key (eg, from a file),
2559  * but cannot be read.
2560  *
2561  * PKCS#8 format is supported since 2.32; earlier releases only
2562  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2563  * tool to convert PKCS#8 keys to PKCS#1.
2564  *
2565  * Since: 2.28
2566  */
2567
2568
2569 /**
2570  * GTlsCertificate:private-key-pem:
2571  *
2572  * The PEM (ASCII) encoded representation of the certificate's
2573  * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2574  * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2575  * PRIVATE KEY</literal>"). This property (or the
2576  * #GTlsCertificate:private-key property) can be set when
2577  * constructing a key (eg, from a file), but cannot be read.
2578  *
2579  * PKCS#8 format is supported since 2.32; earlier releases only
2580  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2581  * tool to convert PKCS#8 keys to PKCS#1.
2582  *
2583  * Since: 2.28
2584  */
2585
2586
2587 /**
2588  * GTlsClientConnection:
2589  *
2590  * Abstract base class for the backend-specific client connection
2591  * type.
2592  *
2593  * Since: 2.28
2594  */
2595
2596
2597 /**
2598  * GTlsClientConnection:accepted-cas:
2599  *
2600  * A list of the distinguished names of the Certificate Authorities
2601  * that the server will accept client certificates signed by. If the
2602  * server requests a client certificate during the handshake, then
2603  * this property will be set after the handshake completes.
2604  *
2605  * Each item in the list is a #GByteArray which contains the complete
2606  * subject DN of the certificate authority.
2607  *
2608  * Since: 2.28
2609  */
2610
2611
2612 /**
2613  * GTlsClientConnection:server-identity:
2614  *
2615  * A #GSocketConnectable describing the identity of the server that
2616  * is expected on the other end of the connection.
2617  *
2618  * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2619  * #GTlsClientConnection:validation-flags, this object will be used
2620  * to determine the expected identify of the remote end of the
2621  * connection; if #GTlsClientConnection:server-identity is not set,
2622  * or does not match the identity presented by the server, then the
2623  * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2624  *
2625  * In addition to its use in verifying the server certificate,
2626  * this is also used to give a hint to the server about what
2627  * certificate we expect, which is useful for servers that serve
2628  * virtual hosts.
2629  *
2630  * Since: 2.28
2631  */
2632
2633
2634 /**
2635  * GTlsClientConnection:use-ssl3:
2636  *
2637  * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2638  * to negotiate the best version of TLS or SSL to use. This can be
2639  * used when talking to servers that don't implement version
2640  * negotiation correctly and therefore refuse to handshake at all with
2641  * a "modern" TLS handshake.
2642  *
2643  * Since: 2.28
2644  */
2645
2646
2647 /**
2648  * GTlsClientConnection:validation-flags:
2649  *
2650  * What steps to perform when validating a certificate received from
2651  * a server. Server certificates that fail to validate in all of the
2652  * ways indicated here will be rejected unless the application
2653  * overrides the default via #GTlsConnection::accept-certificate.
2654  *
2655  * Since: 2.28
2656  */
2657
2658
2659 /**
2660  * GTlsConnection:
2661  *
2662  * Abstract base class for the backend-specific #GTlsClientConnection
2663  * and #GTlsServerConnection types.
2664  *
2665  * Since: 2.28
2666  */
2667
2668
2669 /**
2670  * GTlsConnection::accept-certificate:
2671  * @conn: a #GTlsConnection
2672  * @peer_cert: the peer's #GTlsCertificate
2673  * @errors: the problems with @peer_cert.
2674  *
2675  * Emitted during the TLS handshake after the peer certificate has
2676  * been received. You can examine @peer_cert's certification path by
2677  * calling g_tls_certificate_get_issuer() on it.
2678  *
2679  * For a client-side connection, @peer_cert is the server's
2680  * certificate, and the signal will only be emitted if the
2681  * certificate was not acceptable according to @conn's
2682  * #GTlsClientConnection:validation_flags. If you would like the
2683  * certificate to be accepted despite @errors, return %TRUE from the
2684  * signal handler. Otherwise, if no handler accepts the certificate,
2685  * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2686  *
2687  * For a server-side connection, @peer_cert is the certificate
2688  * presented by the client, if this was requested via the server's
2689  * #GTlsServerConnection:authentication_mode. On the server side,
2690  * the signal is always emitted when the client presents a
2691  * certificate, and the certificate will only be accepted if a
2692  * handler returns %TRUE.
2693  *
2694  * Note that if this signal is emitted as part of asynchronous I/O
2695  * in the main thread, then you should not attempt to interact with
2696  * the user before returning from the signal handler. If you want to
2697  * let the user decide whether or not to accept the certificate, you
2698  * would have to return %FALSE from the signal handler on the first
2699  * attempt, and then after the connection attempt returns a
2700  * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2701  * the user decides to accept the certificate, remember that fact,
2702  * create a new connection, and return %TRUE from the signal handler
2703  * the next time.
2704  *
2705  * If you are doing I/O in another thread, you do not
2706  * need to worry about this, and can simply block in the signal
2707  * handler until the UI thread returns an answer.
2708  *
2709  * 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.
2710  * Since: 2.28
2711  */
2712
2713
2714 /**
2715  * GTlsConnection:base-io-stream:
2716  *
2717  * The #GIOStream that the connection wraps
2718  *
2719  * Since: 2.28
2720  */
2721
2722
2723 /**
2724  * GTlsConnection:certificate:
2725  *
2726  * The connection's certificate; see
2727  * g_tls_connection_set_certificate().
2728  *
2729  * Since: 2.28
2730  */
2731
2732
2733 /**
2734  * GTlsConnection:database:
2735  *
2736  * The certificate database to use when verifying this TLS connection.
2737  * If no cerificate database is set, then the default database will be
2738  * used. See g_tls_backend_get_default_database().
2739  *
2740  * Since: 2.30
2741  */
2742
2743
2744 /**
2745  * GTlsConnection:interaction:
2746  *
2747  * A #GTlsInteraction object to be used when the connection or certificate
2748  * database need to interact with the user. This will be used to prompt the
2749  * user for passwords where necessary.
2750  *
2751  * Since: 2.30
2752  */
2753
2754
2755 /**
2756  * GTlsConnection:peer-certificate:
2757  *
2758  * The connection's peer's certificate, after the TLS handshake has
2759  * completed and the certificate has been accepted. Note in
2760  * particular that this is not yet set during the emission of
2761  * #GTlsConnection::accept-certificate.
2762  *
2763  * (You can watch for a #GObject::notify signal on this property to
2764  * detect when a handshake has occurred.)
2765  *
2766  * Since: 2.28
2767  */
2768
2769
2770 /**
2771  * GTlsConnection:peer-certificate-errors:
2772  *
2773  * The errors noticed-and-ignored while verifying
2774  * #GTlsConnection:peer-certificate. Normally this should be 0, but
2775  * it may not be if #GTlsClientConnection:validation-flags is not
2776  * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2777  * #GTlsConnection::accept-certificate overrode the default
2778  * behavior.
2779  *
2780  * Since: 2.28
2781  */
2782
2783
2784 /**
2785  * GTlsConnection:rehandshake-mode:
2786  *
2787  * The rehandshaking mode. See
2788  * g_tls_connection_set_rehandshake_mode().
2789  *
2790  * Since: 2.28
2791  */
2792
2793
2794 /**
2795  * GTlsConnection:require-close-notify:
2796  *
2797  * Whether or not proper TLS close notification is required.
2798  * See g_tls_connection_set_require_close_notify().
2799  *
2800  * Since: 2.28
2801  */
2802
2803
2804 /**
2805  * GTlsConnection:use-system-certdb:
2806  *
2807  * Whether or not the system certificate database will be used to
2808  * verify peer certificates. See
2809  * g_tls_connection_set_use_system_certdb().
2810  *
2811  * Deprecated: 2.30: Use GTlsConnection:database instead
2812  */
2813
2814
2815 /**
2816  * GTlsDatabase:
2817  *
2818  * Abstract base class for the backend-specific database types.
2819  *
2820  * Since: 2.30
2821  */
2822
2823
2824 /**
2825  * GTlsFileDatabase:
2826  *
2827  * Implemented by a #GTlsDatabase which allows you to load certificates
2828  * from a file.
2829  *
2830  * Since: 2.30
2831  */
2832
2833
2834 /**
2835  * GTlsFileDatabase:anchors:
2836  *
2837  * The path to a file containing PEM encoded certificate authority
2838  * root anchors. The certificates in this file will be treated as
2839  * root authorities for the purpose of verifying other certificates
2840  * via the g_tls_database_verify_chain() operation.
2841  *
2842  * Since: 2.30
2843  */
2844
2845
2846 /**
2847  * GTlsInteraction:
2848  *
2849  * An object representing interaction that the TLS connection and database
2850  * might have with the user.
2851  *
2852  * Since: 2.30
2853  */
2854
2855
2856 /**
2857  * GTlsInteractionClass:
2858  * @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.
2859  * @ask_password_async: ask for a password asynchronously.
2860  * @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.
2861  *
2862  * The class for #GTlsInteraction. Derived classes implement the various
2863  * virtual interaction methods to handle TLS interactions.
2864  *
2865  * Derived classes can choose to implement whichever interactions methods they'd
2866  * like to support by overriding those virtual methods in their class
2867  * initialization function. If a derived class implements an async method,
2868  * it must also implement the corresponding finish method.
2869  *
2870  * The synchronous interaction methods should implement to display modal dialogs,
2871  * and the asynchronous methods to display modeless dialogs.
2872  *
2873  * If the user cancels an interaction, then the result should be
2874  * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2875  * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2876  *
2877  * Since: 2.30
2878  */
2879
2880
2881 /**
2882  * GTlsPassword:
2883  *
2884  * An abstract interface representing a password used in TLS. Often used in
2885  * user interaction such as unlocking a key storage token.
2886  *
2887  * Since: 2.30
2888  */
2889
2890
2891 /**
2892  * GTlsServerConnection:authentication-mode:
2893  *
2894  * The #GTlsAuthenticationMode for the server. This can be changed
2895  * before calling g_tls_connection_handshake() if you want to
2896  * rehandshake with a different mode from the initial handshake.
2897  *
2898  * Since: 2.28
2899  */
2900
2901
2902 /**
2903  * GUnixCredentialsMessage:credentials:
2904  *
2905  * The credentials stored in the message.
2906  *
2907  * Since: 2.26
2908  */
2909
2910
2911 /**
2912  * GUnixInputStream:close-fd:
2913  *
2914  * Whether to close the file descriptor when the stream is closed.
2915  *
2916  * Since: 2.20
2917  */
2918
2919
2920 /**
2921  * GUnixInputStream:fd:
2922  *
2923  * The file descriptor that the stream reads from.
2924  *
2925  * Since: 2.20
2926  */
2927
2928
2929 /**
2930  * GUnixMountMonitor::mountpoints-changed:
2931  * @monitor: the object on which the signal is emitted
2932  *
2933  * Emitted when the unix mount points have changed.
2934  */
2935
2936
2937 /**
2938  * GUnixMountMonitor::mounts-changed:
2939  * @monitor: the object on which the signal is emitted
2940  *
2941  * Emitted when the unix mounts have changed.
2942  */
2943
2944
2945 /**
2946  * GUnixOutputStream:close-fd:
2947  *
2948  * Whether to close the file descriptor when the stream is closed.
2949  *
2950  * Since: 2.20
2951  */
2952
2953
2954 /**
2955  * GUnixOutputStream:fd:
2956  *
2957  * The file descriptor that the stream writes to.
2958  *
2959  * Since: 2.20
2960  */
2961
2962
2963 /**
2964  * GUnixSocketAddress:
2965  *
2966  * A UNIX-domain (local) socket address, corresponding to a
2967  * <type>struct sockaddr_un</type>.
2968  */
2969
2970
2971 /**
2972  * GUnixSocketAddress:abstract:
2973  *
2974  * Whether or not this is an abstract address
2975  *
2976  * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
2977  */
2978
2979
2980 /**
2981  * GVolume::changed:
2982  *
2983  * Emitted when the volume has been changed.
2984  */
2985
2986
2987 /**
2988  * GVolume::removed:
2989  *
2990  * This signal is emitted when the #GVolume have been removed. If
2991  * the recipient is holding references to the object they should
2992  * release them so the object can be finalized.
2993  */
2994
2995
2996 /**
2997  * GVolumeMonitor::drive-changed:
2998  * @volume_monitor: The volume monitor emitting the signal.
2999  * @drive: the drive that changed
3000  *
3001  * Emitted when a drive changes.
3002  */
3003
3004
3005 /**
3006  * GVolumeMonitor::drive-connected:
3007  * @volume_monitor: The volume monitor emitting the signal.
3008  * @drive: a #GDrive that was connected.
3009  *
3010  * Emitted when a drive is connected to the system.
3011  */
3012
3013
3014 /**
3015  * GVolumeMonitor::drive-disconnected:
3016  * @volume_monitor: The volume monitor emitting the signal.
3017  * @drive: a #GDrive that was disconnected.
3018  *
3019  * Emitted when a drive is disconnected from the system.
3020  */
3021
3022
3023 /**
3024  * GVolumeMonitor::drive-eject-button:
3025  * @volume_monitor: The volume monitor emitting the signal.
3026  * @drive: the drive where the eject button was pressed
3027  *
3028  * Emitted when the eject button is pressed on @drive.
3029  *
3030  * Since: 2.18
3031  */
3032
3033
3034 /**
3035  * GVolumeMonitor::drive-stop-button:
3036  * @volume_monitor: The volume monitor emitting the signal.
3037  * @drive: the drive where the stop button was pressed
3038  *
3039  * Emitted when the stop button is pressed on @drive.
3040  *
3041  * Since: 2.22
3042  */
3043
3044
3045 /**
3046  * GVolumeMonitor::mount-added:
3047  * @volume_monitor: The volume monitor emitting the signal.
3048  * @mount: a #GMount that was added.
3049  *
3050  * Emitted when a mount is added.
3051  */
3052
3053
3054 /**
3055  * GVolumeMonitor::mount-changed:
3056  * @volume_monitor: The volume monitor emitting the signal.
3057  * @mount: a #GMount that changed.
3058  *
3059  * Emitted when a mount changes.
3060  */
3061
3062
3063 /**
3064  * GVolumeMonitor::mount-pre-unmount:
3065  * @volume_monitor: The volume monitor emitting the signal.
3066  * @mount: a #GMount that is being unmounted.
3067  *
3068  * Emitted when a mount is about to be removed.
3069  */
3070
3071
3072 /**
3073  * GVolumeMonitor::mount-removed:
3074  * @volume_monitor: The volume monitor emitting the signal.
3075  * @mount: a #GMount that was removed.
3076  *
3077  * Emitted when a mount is removed.
3078  */
3079
3080
3081 /**
3082  * GVolumeMonitor::volume-added:
3083  * @volume_monitor: The volume monitor emitting the signal.
3084  * @volume: a #GVolume that was added.
3085  *
3086  * Emitted when a mountable volume is added to the system.
3087  */
3088
3089
3090 /**
3091  * GVolumeMonitor::volume-changed:
3092  * @volume_monitor: The volume monitor emitting the signal.
3093  * @volume: a #GVolume that changed.
3094  *
3095  * Emitted when mountable volume is changed.
3096  */
3097
3098
3099 /**
3100  * GVolumeMonitor::volume-removed:
3101  * @volume_monitor: The volume monitor emitting the signal.
3102  * @volume: a #GVolume that was removed.
3103  *
3104  * Emitted when a mountable volume is removed from the system.
3105  */
3106
3107
3108 /**
3109  * GWin32InputStream:close-handle:
3110  *
3111  * Whether to close the file handle when the stream is closed.
3112  *
3113  * Since: 2.26
3114  */
3115
3116
3117 /**
3118  * GWin32InputStream:handle:
3119  *
3120  * The handle that the stream reads from.
3121  *
3122  * Since: 2.26
3123  */
3124
3125
3126 /**
3127  * GWin32OutputStream:close-handle:
3128  *
3129  * Whether to close the file handle when the stream is closed.
3130  *
3131  * Since: 2.26
3132  */
3133
3134
3135 /**
3136  * GWin32OutputStream:handle:
3137  *
3138  * The file handle that the stream writes to.
3139  *
3140  * Since: 2.26
3141  */
3142
3143
3144 /**
3145  * GZlibCompressor:
3146  *
3147  * Zlib decompression
3148  */
3149
3150
3151 /**
3152  * GZlibCompressor:file-info:
3153  *
3154  * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3155  * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3156  * and modification time from the file info to the GZIP header.
3157  *
3158  * Since: 2.26
3159  */
3160
3161
3162 /**
3163  * GZlibDecompressor:
3164  *
3165  * Zlib decompression
3166  */
3167
3168
3169 /**
3170  * GZlibDecompressor:file-info:
3171  *
3172  * A #GFileInfo containing the information found in the GZIP header
3173  * of the data stream processed, or %NULL if the header was not yet
3174  * fully processed, is not present at all, or the compressor's
3175  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3176  *
3177  * Since: 2.26
3178  */
3179
3180
3181 /**
3182  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3183  *
3184  * The purpose used to verify the client certificate in a TLS connection.
3185  * Used by TLS servers.
3186  */
3187
3188
3189 /**
3190  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3191  *
3192  * The purpose used to verify the server certificate in a TLS connection. This
3193  * is the most common purpose in use. Used by TLS clients.
3194  */
3195
3196
3197 /**
3198  * G_TYPE_SETTINGS_SCHEMA:
3199  *
3200  * A boxed #GType corresponding to #GSettingsSchema.
3201  *
3202  * Since: 2.32
3203  */
3204
3205
3206 /**
3207  * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3208  *
3209  * A boxed #GType corresponding to #GSettingsSchemaSource.
3210  *
3211  * Since: 2.32
3212  */
3213
3214
3215 /**
3216  * SECTION:_GFreedesktopDBus
3217  * @title: _GFreedesktopDBus
3218  * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface
3219  *
3220  * 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.
3221  */
3222
3223
3224 /**
3225  * SECTION:extensionpoints
3226  * @short_description: Extension Points
3227  * @include: gio.h
3228  * @see_also: <link linkend="extending-gio">Extending GIO</link>
3229  *
3230  * #GIOExtensionPoint provides a mechanism for modules to extend the
3231  * functionality of the library or application that loaded it in an
3232  * organized fashion.
3233  *
3234  * An extension point is identified by a name, and it may optionally
3235  * require that any implementation must by of a certain type (or derived
3236  * thereof). Use g_io_extension_point_register() to register an
3237  * extension point, and g_io_extension_point_set_required_type() to
3238  * set a required type.
3239  *
3240  * A module can implement an extension point by specifying the #GType
3241  * that implements the functionality. Additionally, each implementation
3242  * of an extension point has a name, and a priority. Use
3243  * g_io_extension_point_implement() to implement an extension point.
3244  *
3245  *  |[
3246  *  GIOExtensionPoint *ep;
3247  *
3248  *  /&ast; Register an extension point &ast;/
3249  *  ep = g_io_extension_point_register ("my-extension-point");
3250  *  g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3251  *  ]|
3252  *
3253  *  |[
3254  *  /&ast; Implement an extension point &ast;/
3255  *  G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3256  *  g_io_extension_point_implement ("my-extension-point",
3257  *                                  my_example_impl_get_type (),
3258  *                                  "my-example",
3259  *                                  10);
3260  *  ]|
3261  *
3262  *  It is up to the code that registered the extension point how
3263  *  it uses the implementations that have been associated with it.
3264  *  Depending on the use case, it may use all implementations, or
3265  *  only the one with the highest priority, or pick a specific
3266  *  one by name.
3267  *
3268  *  To avoid opening all modules just to find out what extension
3269  *  points they implement, GIO makes use of a caching mechanism,
3270  *  see <link linkend="gio-querymodules">gio-querymodules</link>.
3271  *  You are expected to run this command after installing a
3272  *  GIO module.
3273  *
3274  *  The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3275  *  used to specify additional directories to automatically load modules
3276  *  from. This environment variable has the same syntax as the
3277  *  <envar>PATH</envar>. If two modules have the same base name in different
3278  *  directories, then the latter one will be ignored. If additional
3279  *  directories are specified GIO will load modules from the built-in
3280  *  directory last.
3281  */
3282
3283
3284 /**
3285  * SECTION:gaction
3286  * @title: GAction
3287  * @short_description: An action interface
3288  *
3289  * #GAction represents a single named action.
3290  *
3291  * The main interface to an action is that it can be activated with
3292  * g_action_activate().  This results in the 'activate' signal being
3293  * emitted.  An activation has a #GVariant parameter (which may be
3294  * %NULL).  The correct type for the parameter is determined by a static
3295  * parameter type (which is given at construction time).
3296  *
3297  * An action may optionally have a state, in which case the state may be
3298  * set with g_action_change_state().  This call takes a #GVariant.  The
3299  * correct type for the state is determined by a static state type
3300  * (which is given at construction time).
3301  *
3302  * The state may have a hint associated with it, specifying its valid
3303  * range.
3304  *
3305  * #GAction is merely the interface to the concept of an action, as
3306  * described above.  Various implementations of actions exist, including
3307  * #GSimpleAction and #GtkAction.
3308  *
3309  * In all cases, the implementing class is responsible for storing the
3310  * name of the action, the parameter type, the enabled state, the
3311  * optional state type and the state and emitting the appropriate
3312  * signals when these change.  The implementor responsible for filtering
3313  * calls to g_action_activate() and g_action_change_state() for type
3314  * safety and for the state being enabled.
3315  *
3316  * Probably the only useful thing to do with a #GAction is to put it
3317  * inside of a #GSimpleActionGroup.
3318  */
3319
3320
3321 /**
3322  * SECTION:gactiongroup
3323  * @title: GActionGroup
3324  * @short_description: A group of actions
3325  * @see_also: #GAction
3326  *
3327  * #GActionGroup represents a group of actions. Actions can be used to
3328  * expose functionality in a structured way, either from one part of a
3329  * program to another, or to the outside world. Action groups are often
3330  * used together with a #GMenuModel that provides additional
3331  * representation data for displaying the actions to the user, e.g. in
3332  * a menu.
3333  *
3334  * The main way to interact with the actions in a GActionGroup is to
3335  * activate them with g_action_group_activate_action(). Activating an
3336  * action may require a #GVariant parameter. The required type of the
3337  * parameter can be inquired with g_action_group_get_action_parameter_type().
3338  * Actions may be disabled, see g_action_group_get_action_enabled().
3339  * Activating a disabled action has no effect.
3340  *
3341  * Actions may optionally have a state in the form of a #GVariant. The
3342  * current state of an action can be inquired with
3343  * g_action_group_get_action_state(). Activating a stateful action may
3344  * change its state, but it is also possible to set the state by calling
3345  * g_action_group_change_action_state().
3346  *
3347  * As typical example, consider a text editing application which has an
3348  * option to change the current font to 'bold'. A good way to represent
3349  * this would be a stateful action, with a boolean state. Activating the
3350  * action would toggle the state.
3351  *
3352  * Each action in the group has a unique name (which is a string).  All
3353  * method calls, except g_action_group_list_actions() take the name of
3354  * an action as an argument.
3355  *
3356  * The #GActionGroup API is meant to be the 'public' API to the action
3357  * group.  The calls here are exactly the interaction that 'external
3358  * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3359  * with actions.  'Internal' APIs (ie: ones meant only to be accessed by
3360  * the action group implementation) are found on subclasses.  This is
3361  * why you will find - for example - g_action_group_get_action_enabled()
3362  * but not an equivalent <function>set()</function> call.
3363  *
3364  * Signals are emitted on the action group in response to state changes
3365  * on individual actions.
3366  *
3367  * Implementations of #GActionGroup should provide implementations for
3368  * the virtual functions g_action_group_list_actions() and
3369  * g_action_group_query_action().  The other virtual functions should
3370  * not be implemented - their "wrappers" are actually implemented with
3371  * calls to g_action_group_query_action().
3372  */
3373
3374
3375 /**
3376  * SECTION:gactiongroupexporter
3377  * @title: GActionGroup exporter
3378  * @short_description: Export GActionGroups on D-Bus
3379  * @see_also: #GActionGroup, #GDBusActionGroup
3380  *
3381  * These functions support exporting a #GActionGroup on D-Bus.
3382  * The D-Bus interface that is used is a private implementation
3383  * detail.
3384  *
3385  * To access an exported #GActionGroup remotely, use
3386  * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3387  */
3388
3389
3390 /**
3391  * SECTION:gactionmap
3392  * @title: GActionMap
3393  * @short_description: Interface for action containers
3394  *
3395  * The GActionMap interface is implemented by #GActionGroup
3396  * implementations that operate by containing a number of
3397  * named #GAction instances, such as #GSimpleActionGroup.
3398  *
3399  * One useful application of this interface is to map the
3400  * names of actions from various action groups to unique,
3401  * prefixed names (e.g. by prepending "app." or "win.").
3402  * This is the motivation for the 'Map' part of the interface
3403  * name.
3404  *
3405  * Since: 2.32
3406  */
3407
3408
3409 /**
3410  * SECTION:gappinfo
3411  * @short_description: Application information and launch contexts
3412  * @include: gio/gio.h
3413  *
3414  * #GAppInfo and #GAppLaunchContext are used for describing and launching
3415  * applications installed on the system.
3416  *
3417  * As of GLib 2.20, URIs will always be converted to POSIX paths
3418  * (using g_file_get_path()) when using g_app_info_launch() even if
3419  * the application requested an URI and not a POSIX path. For example
3420  * for an desktop-file based application with Exec key <literal>totem
3421  * &percnt;U</literal> and a single URI,
3422  * <literal>sftp://foo/file.avi</literal>, then
3423  * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3424  * passed. This will only work if a set of suitable GIO extensions
3425  * (such as gvfs 2.26 compiled with FUSE support), is available and
3426  * operational; if this is not the case, the URI will be passed
3427  * unmodified to the application. Some URIs, such as
3428  * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3429  * path (in gvfs there's no FUSE mount for it); such URIs will be
3430  * passed unmodified to the application.
3431  *
3432  * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3433  * back to the GIO URI in the #GFile constructors (since gvfs
3434  * implements the #GVfs extension point). As such, if the application
3435  * needs to examine the URI, it needs to use g_file_get_uri() or
3436  * similar on #GFile. In other words, an application cannot assume
3437  * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3438  * equal to the result of g_file_get_uri(). The following snippet
3439  * illustrates this:
3440  *
3441  * <programlisting>
3442  * GFile *f;
3443  * char *uri;
3444  *
3445  * file = g_file_new_for_commandline_arg (uri_from_commandline);
3446  *
3447  * uri = g_file_get_uri (file);
3448  * strcmp (uri, uri_from_commandline) == 0; // FALSE
3449  * g_free (uri);
3450  *
3451  * if (g_file_has_uri_scheme (file, "cdda"))
3452  *   {
3453  *     // do something special with uri
3454  *   }
3455  * g_object_unref (file);
3456  * </programlisting>
3457  *
3458  * This code will work when both <literal>cdda://sr0/Track
3459  * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3460  * 1.wav</literal> is passed to the application. It should be noted
3461  * that it's generally not safe for applications to rely on the format
3462  * of a particular URIs. Different launcher applications (e.g. file
3463  * managers) may have different ideas of what a given URI means.
3464  */
3465
3466
3467 /**
3468  * SECTION:gapplication
3469  * @title: GApplication
3470  * @short_description: Core application class
3471  *
3472  * A #GApplication is the foundation of an application.  It wraps some
3473  * low-level platform-specific services and is intended to act as the
3474  * foundation for higher-level application classes such as
3475  * #GtkApplication or #MxApplication.  In general, you should not use
3476  * this class outside of a higher level framework.
3477  *
3478  * GApplication provides convenient life cycle management by maintaining
3479  * a <firstterm>use count</firstterm> for the primary application instance.
3480  * The use count can be changed using g_application_hold() and
3481  * g_application_release(). If it drops to zero, the application exits.
3482  * Higher-level classes such as #GtkApplication employ the use count to
3483  * ensure that the application stays alive as long as it has any opened
3484  * windows.
3485  *
3486  * Another feature that GApplication (optionally) provides is process
3487  * uniqueness.  Applications can make use of this functionality by
3488  * providing a unique application ID.  If given, only one application
3489  * with this ID can be running at a time per session.  The session
3490  * concept is platform-dependent, but corresponds roughly to a graphical
3491  * desktop login.  When your application is launched again, its
3492  * arguments are passed through platform communication to the already
3493  * running program.  The already running instance of the program is
3494  * called the <firstterm>primary instance</firstterm>; for non-unique
3495  * applications this is the always the current instance.
3496  * On Linux, the D-Bus session bus is used for communication.
3497  *
3498  * The use of #GApplication differs from some other commonly-used
3499  * uniqueness libraries (such as libunique) in important ways.  The
3500  * application is not expected to manually register itself and check if
3501  * it is the primary instance.  Instead, the <code>main()</code>
3502  * function of a #GApplication should do very little more than
3503  * instantiating the application instance, possibly connecting signal
3504  * handlers, then calling g_application_run().  All checks for
3505  * uniqueness are done internally.  If the application is the primary
3506  * instance then the startup signal is emitted and the mainloop runs.
3507  * If the application is not the primary instance then a signal is sent
3508  * to the primary instance and g_application_run() promptly returns.
3509  * See the code examples below.
3510  *
3511  * If used, the expected form of an application identifier is very close
3512  * to that of of a
3513  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3514  * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3515  * For details on valid application identifiers, see g_application_id_is_valid().
3516  *
3517  * On Linux, the application identifier is claimed as a well-known bus name
3518  * on the user's session bus.  This means that the uniqueness of your
3519  * application is scoped to the current session.  It also means that your
3520  * application may provide additional services (through registration of other
3521  * object paths) at that bus name.  The registration of these object paths
3522  * should be done with the shared GDBus session bus.  Note that due to the
3523  * internal architecture of GDBus, method calls can be dispatched at any time
3524  * (even if a main loop is not running).  For this reason, you must ensure that
3525  * any object paths that you wish to register are registered before #GApplication
3526  * attempts to acquire the bus name of your application (which happens in
3527  * g_application_register()).  Unfortunately, this means that you cannot use
3528  * g_application_get_is_remote() to decide if you want to register object paths.
3529  *
3530  * GApplication also implements the #GActionGroup and #GActionMap
3531  * interfaces and lets you easily export actions by adding them with
3532  * g_action_map_add_action(). When invoking an action by calling
3533  * g_action_group_activate_action() on the application, it is always
3534  * invoked in the primary instance. The actions are also exported on
3535  * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3536  * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3537  * for remote access to exported #GMenuModels.
3538  *
3539  * There is a number of different entry points into a GApplication:
3540  * <itemizedlist>
3541  * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3542  * <listitem>via 'Open' (i.e. opening some files)</listitem>
3543  * <listitem>by handling a command-line</listitem>
3544  * <listitem>via activating an action</listitem>
3545  * </itemizedlist>
3546  * The #GApplication::startup signal lets you handle the application
3547  * initialization for all of these in a single place.
3548  *
3549  * Regardless of which of these entry points is used to start the application,
3550  * GApplication passes some <firstterm id="platform-data">platform
3551  * data</firstterm> from the launching instance to the primary instance,
3552  * in the form of a #GVariant dictionary mapping strings to variants.
3553  * To use platform data, override the @before_emit or @after_emit virtual
3554  * functions in your #GApplication subclass. When dealing with
3555  * #GApplicationCommandLine objects, the platform data is directly
3556  * available via g_application_command_line_get_cwd(),
3557  * g_application_command_line_get_environ() and
3558  * g_application_command_line_get_platform_data().
3559  *
3560  * As the name indicates, the platform data may vary depending on the
3561  * operating system, but it always includes the current directory (key
3562  * "cwd"), and optionally the environment (ie the set of environment
3563  * variables and their values) of the calling process (key "environ").
3564  * The environment is only added to the platform data if the
3565  * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3566  * can add their own platform data by overriding the @add_platform_data
3567  * virtual function. For instance, #GtkApplication adds startup notification
3568  * data in this way.
3569  *
3570  * To parse commandline arguments you may handle the
3571  * #GApplication::command-line signal or override the local_command_line()
3572  * vfunc, to parse them in either the primary instance or the local instance,
3573  * respectively.
3574  *
3575  * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3576  * <programlisting>
3577  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3578  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3579  * </xi:include>
3580  * </programlisting>
3581  * </example>
3582  *
3583  * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3584  * <programlisting>
3585  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3586  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3587  * </xi:include>
3588  * </programlisting>
3589  * </example>
3590  *
3591  * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3592  * <programlisting>
3593  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3594  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3595  * </xi:include>
3596  * </programlisting>
3597  * </example>
3598  *
3599  * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3600  * <programlisting>
3601  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3602  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3603  * </xi:include>
3604  * </programlisting>
3605  * </example>
3606  */
3607
3608
3609 /**
3610  * SECTION:gapplicationcommandline
3611  * @title: GApplicationCommandLine
3612  * @short_description: A command-line invocation of an application
3613  * @see_also: #GApplication
3614  *
3615  * #GApplicationCommandLine represents a command-line invocation of
3616  * an application.  It is created by #GApplication and emitted
3617  * in the #GApplication::command-line signal and virtual function.
3618  *
3619  * The class contains the list of arguments that the program was invoked
3620  * with.  It is also possible to query if the commandline invocation was
3621  * local (ie: the current process is running in direct response to the
3622  * invocation) or remote (ie: some other process forwarded the
3623  * commandline to this process).
3624  *
3625  * The GApplicationCommandLine object can provide the @argc and @argv
3626  * parameters for use with the #GOptionContext command-line parsing API,
3627  * with the g_application_command_line_get_arguments() function. See
3628  * <xref linkend="gapplication-example-cmdline3"/> for an example.
3629  *
3630  * The exit status of the originally-invoked process may be set and
3631  * messages can be printed to stdout or stderr of that process.  The
3632  * lifecycle of the originally-invoked process is tied to the lifecycle
3633  * of this object (ie: the process exits when the last reference is
3634  * dropped).
3635  *
3636  * The main use for #GApplicationCommandLine (and the
3637  * #GApplication::command-line signal) is 'Emacs server' like use cases:
3638  * You can set the <envar>EDITOR</envar> environment variable to have
3639  * e.g. git use your favourite editor to edit commit messages, and if you
3640  * already have an instance of the editor running, the editing will happen
3641  * in the running instance, instead of opening a new one. An important
3642  * aspect of this use case is that the process that gets started by git
3643  * does not return until the editing is done.
3644  *
3645  * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3646  * <para>
3647  * A simple example where the commandline is completely handled
3648  * in the #GApplication::command-line handler. The launching instance exits
3649  * once the signal handler in the primary instance has returned, and the
3650  * return value of the signal handler becomes the exit status of the launching
3651  * instance.
3652  * </para>
3653  * <programlisting>
3654  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3655  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3656  * </xi:include>
3657  * </programlisting>
3658  * </example>
3659  *
3660  * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3661  * <para>
3662  * An example of split commandline handling. Options that start with
3663  * <literal>--local-</literal> are handled locally, all other options are
3664  * passed to the #GApplication::command-line handler which runs in the primary
3665  * instance.
3666  * </para>
3667  * <programlisting>
3668  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3669  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3670  * </xi:include>
3671  * </programlisting>
3672  * </example>
3673  *
3674  * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3675  * <para>
3676  * An example of deferred commandline handling. Here, the commandline is
3677  * not completely handled before the #GApplication::command-line handler
3678  * returns. Instead, we keep a reference to the GApplicationCommandLine
3679  * object and handle it later(in this example, in an idle). Note that it
3680  * is necessary to hold the application until you are done with the
3681  * commandline.
3682  * </para>
3683  * <para>
3684  * This example also shows how to use #GOptionContext for parsing the
3685  * commandline arguments. Note that it is necessary to disable the
3686  * built-in help-handling of #GOptionContext, since it calls exit()
3687  * after printing help, which is not what you want to happen in
3688  * the primary instance.
3689  * </para>
3690  * <programlisting>
3691  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3692  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3693  * </xi:include>
3694  * </programlisting>
3695  * </example>
3696  */
3697
3698
3699 /**
3700  * SECTION:gasyncinitable
3701  * @short_description: Asynchronously failable object initialization interface
3702  * @include: gio/gio.h
3703  * @see_also: #GInitable
3704  *
3705  * This is the asynchronous version of #GInitable; it behaves the same
3706  * in all ways except that initialization is asynchronous. For more details
3707  * see the descriptions on #GInitable.
3708  *
3709  * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3710  *
3711  * Users of objects implementing this are not intended to use the interface
3712  * method directly; instead it will be used automatically in various ways.
3713  * For C applications you generally just call g_async_initable_new_async()
3714  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3715  * g_async_initable_init_async() under the cover, calling back with %NULL and
3716  * a set %GError on failure.
3717  *
3718  * A typical implementation might look something like this:
3719  *
3720  * |[
3721  * enum {
3722  *    NOT_INITIALIZED,
3723  *    INITIALIZING,
3724  *    INITIALIZED
3725  * };
3726  *
3727  * static void
3728  * _foo_ready_cb (Foo *self)
3729  * {
3730  *   GList *l;
3731  *
3732  *   self->priv->state = INITIALIZED;
3733  *
3734  *   for (l = self->priv->init_results; l != NULL; l = l->next)
3735  *     {
3736  *       GTask *task = l->data;
3737  *
3738  *       if (self->priv->success)
3739  *         g_task_return_boolean (task, TRUE);
3740  *       else
3741  *         g_task_return_new_error (task, ...);
3742  *       g_object_unref (task);
3743  *     }
3744  *
3745  *   g_list_free (self->priv->init_results);
3746  *   self->priv->init_results = NULL;
3747  * }
3748  *
3749  * static void
3750  * foo_init_async (GAsyncInitable       *initable,
3751  *                 int                   io_priority,
3752  *                 GCancellable         *cancellable,
3753  *                 GAsyncReadyCallback   callback,
3754  *                 gpointer              user_data)
3755  * {
3756  *   Foo *self = FOO (initable);
3757  *   GTask *task;
3758  *
3759  *   task = g_task_new (initable, cancellable, callback, user_data);
3760  *
3761  *   switch (self->priv->state)
3762  *     {
3763  *       case NOT_INITIALIZED:
3764  *         _foo_get_ready (self);
3765  *         self->priv->init_results = g_list_append (self->priv->init_results,
3766  *                                                   task);
3767  *         self->priv->state = INITIALIZING;
3768  *         break;
3769  *       case INITIALIZING:
3770  *         self->priv->init_results = g_list_append (self->priv->init_results,
3771  *                                                   task);
3772  *         break;
3773  *       case INITIALIZED:
3774  *         if (!self->priv->success)
3775  *           g_task_return_new_error (task, ...);
3776  *         else
3777  *           g_task_return_boolean (task, TRUE);
3778  *         g_object_unref (task);
3779  *         break;
3780  *     }
3781  * }
3782  *
3783  * static gboolean
3784  * foo_init_finish (GAsyncInitable       *initable,
3785  *                  GAsyncResult         *result,
3786  *                  GError              **error)
3787  * {
3788  *   g_return_val_if_fail (g_task_is_valid (result, initable), FALSE);
3789  *
3790  *   return g_task_propagate_boolean (G_TASK (result), error);
3791  * }
3792  *
3793  * static void
3794  * foo_async_initable_iface_init (gpointer g_iface,
3795  *                                gpointer data)
3796  * {
3797  *   GAsyncInitableIface *iface = g_iface;
3798  *
3799  *   iface->init_async = foo_init_async;
3800  *   iface->init_finish = foo_init_finish;
3801  * }
3802  * ]|
3803  */
3804
3805
3806 /**
3807  * SECTION:gasyncresult
3808  * @short_description: Asynchronous Function Results
3809  * @include: gio/gio.h
3810  * @see_also: #GTask
3811  *
3812  * Provides a base class for implementing asynchronous function results.
3813  *
3814  * Asynchronous operations are broken up into two separate operations
3815  * which are chained together by a #GAsyncReadyCallback. To begin
3816  * an asynchronous operation, provide a #GAsyncReadyCallback to the
3817  * asynchronous function. This callback will be triggered when the
3818  * operation has completed, and will be passed a #GAsyncResult instance
3819  * filled with the details of the operation's success or failure, the
3820  * object the asynchronous function was started for and any error codes
3821  * returned. The asynchronous callback function is then expected to call
3822  * the corresponding "_finish()" function, passing the object the
3823  * function was called for, the #GAsyncResult instance, and (optionally)
3824  * an @error to grab any error conditions that may have occurred.
3825  *
3826  * The "_finish()" function for an operation takes the generic result
3827  * (of type #GAsyncResult) and returns the specific result that the
3828  * operation in question yields (e.g. a #GFileEnumerator for a
3829  * "enumerate children" operation). If the result or error status of the
3830  * operation is not needed, there is no need to call the "_finish()"
3831  * function; GIO will take care of cleaning up the result and error
3832  * information after the #GAsyncReadyCallback returns. You can pass
3833  * %NULL for the #GAsyncReadyCallback if you don't need to take any
3834  * action at all after the operation completes. Applications may also
3835  * take a reference to the #GAsyncResult and call "_finish()" later;
3836  * however, the "_finish()" function may be called at most once.
3837  *
3838  * Example of a typical asynchronous operation flow:
3839  * |[
3840  * void _theoretical_frobnitz_async (Theoretical         *t,
3841  *                                   GCancellable        *c,
3842  *                                   GAsyncReadyCallback *cb,
3843  *                                   gpointer             u);
3844  *
3845  * gboolean _theoretical_frobnitz_finish (Theoretical   *t,
3846  *                                        GAsyncResult  *res,
3847  *                                        GError       **e);
3848  *
3849  * static void
3850  * frobnitz_result_func (GObject      *source_object,
3851  *               GAsyncResult *res,
3852  *               gpointer      user_data)
3853  * {
3854  *   gboolean success = FALSE;
3855  *
3856  *   success = _theoretical_frobnitz_finish (source_object, res, NULL);
3857  *
3858  *   if (success)
3859  *     g_printf ("Hurray!\n");
3860  *   else
3861  *     g_printf ("Uh oh!\n");
3862  *
3863  *   /<!-- -->* ... *<!-- -->/
3864  *
3865  * }
3866  *
3867  * int main (int argc, void *argv[])
3868  * {
3869  *    /<!-- -->* ... *<!-- -->/
3870  *
3871  *    _theoretical_frobnitz_async (theoretical_data,
3872  *                                 NULL,
3873  *                                 frobnitz_result_func,
3874  *                                 NULL);
3875  *
3876  *    /<!-- -->* ... *<!-- -->/
3877  * }
3878  * ]|
3879  *
3880  * The callback for an asynchronous operation is called only once, and is
3881  * always called, even in the case of a cancelled operation. On cancellation
3882  * the result is a %G_IO_ERROR_CANCELLED error.
3883  *
3884  * <para id="io-priority"><indexterm><primary>I/O
3885  * priority</primary></indexterm> Many I/O-related asynchronous
3886  * operations have a priority parameter, which is used in certain
3887  * cases to determine the order in which operations are executed. They
3888  * are <emphasis>not</emphasis> used to determine system-wide I/O
3889  * scheduling. Priorities are integers, with lower numbers indicating
3890  * higher priority. It is recommended to choose priorities between
3891  * %G_PRIORITY_LOW and %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a
3892  * default. </para>
3893  */
3894
3895
3896 /**
3897  * SECTION:gbufferedinputstream
3898  * @short_description: Buffered Input Stream
3899  * @include: gio/gio.h
3900  * @see_also: #GFilterInputStream, #GInputStream
3901  *
3902  * Buffered input stream implements #GFilterInputStream and provides
3903  * for buffered reads.
3904  *
3905  * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3906  *
3907  * To create a buffered input stream, use g_buffered_input_stream_new(),
3908  * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3909  * construction.
3910  *
3911  * To get the size of a buffer within a buffered input stream, use
3912  * g_buffered_input_stream_get_buffer_size(). To change the size of a
3913  * buffered input stream's buffer, use
3914  * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3915  * cannot be reduced below the size of the data within the buffer.
3916  */
3917
3918
3919 /**
3920  * SECTION:gbufferedoutputstream
3921  * @short_description: Buffered Output Stream
3922  * @include: gio/gio.h
3923  * @see_also: #GFilterOutputStream, #GOutputStream
3924  *
3925  * Buffered output stream implements #GFilterOutputStream and provides
3926  * for buffered writes.
3927  *
3928  * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
3929  *
3930  * To create a buffered output stream, use g_buffered_output_stream_new(),
3931  * or g_buffered_output_stream_new_sized() to specify the buffer's size
3932  * at construction.
3933  *
3934  * To get the size of a buffer within a buffered input stream, use
3935  * g_buffered_output_stream_get_buffer_size(). To change the size of a
3936  * buffered output stream's buffer, use
3937  * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
3938  * size cannot be reduced below the size of the data within the buffer.
3939  */
3940
3941
3942 /**
3943  * SECTION:gcancellable
3944  * @short_description: Thread-safe Operation Cancellation Stack
3945  * @include: gio/gio.h
3946  *
3947  * GCancellable is a thread-safe operation cancellation stack used
3948  * throughout GIO to allow for cancellation of synchronous and
3949  * asynchronous operations.
3950  */
3951
3952
3953 /**
3954  * SECTION:gcharsetconverter
3955  * @short_description: Convert between charsets
3956  * @include: gio/gio.h
3957  *
3958  * #GCharsetConverter is an implementation of #GConverter based on
3959  * GIConv.
3960  */
3961
3962
3963 /**
3964  * SECTION:gcontenttype
3965  * @short_description: Platform-specific content typing
3966  * @include: gio/gio.h
3967  *
3968  * A content type is a platform specific string that defines the type
3969  * 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".
3970  * On Win32 it is an extension string like ".doc", ".txt" or a perceived
3971  * string like "audio". Such strings can be looked up in the registry at
3972  * HKEY_CLASSES_ROOT.
3973  */
3974
3975
3976 /**
3977  * SECTION:gconverter
3978  * @short_description: Data conversion interface
3979  * @include: gio/gio.h
3980  * @see_also: #GInputStream, #GOutputStream
3981  *
3982  * #GConverter is implemented by objects that convert
3983  * binary data in various ways. The conversion can be
3984  * stateful and may fail at any place.
3985  *
3986  * Some example conversions are: character set conversion,
3987  * compression, decompression and regular expression
3988  * replace.
3989  *
3990  * Since: 2.24
3991  */
3992
3993
3994 /**
3995  * SECTION:gconverterinputstream
3996  * @short_description: Converter Input Stream
3997  * @include: gio/gio.h
3998  * @see_also: #GInputStream, #GConverter
3999  *
4000  * Converter input stream implements #GInputStream and allows
4001  * conversion of data of various types during reading.
4002  *
4003  * As of GLib 2.34, #GConverterInputStream implements
4004  * #GPollableInputStream.
4005  */
4006
4007
4008 /**
4009  * SECTION:gconverteroutputstream
4010  * @short_description: Converter Output Stream
4011  * @include: gio/gio.h
4012  * @see_also: #GOutputStream, #GConverter
4013  *
4014  * Converter output stream implements #GOutputStream and allows
4015  * conversion of data of various types during reading.
4016  *
4017  * As of GLib 2.34, #GConverterOutputStream implements
4018  * #GPollableOutputStream.
4019  */
4020
4021
4022 /**
4023  * SECTION:gcredentials
4024  * @short_description: An object containing credentials
4025  * @include: gio/gio.h
4026  *
4027  * The #GCredentials type is a reference-counted wrapper for native
4028  * credentials. This information is typically used for identifying,
4029  * authenticating and authorizing other processes.
4030  *
4031  * Some operating systems supports looking up the credentials of the
4032  * remote peer of a communication endpoint - see e.g.
4033  * g_socket_get_credentials().
4034  *
4035  * Some operating systems supports securely sending and receiving
4036  * credentials over a Unix Domain Socket, see
4037  * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
4038  * g_unix_connection_receive_credentials() for details.
4039  *
4040  * On Linux, the native credential type is a <type>struct ucred</type>
4041  * - see the
4042  * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
4043  * man page for details. This corresponds to
4044  * %G_CREDENTIALS_TYPE_LINUX_UCRED.
4045  *
4046  * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
4047  * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
4048  *
4049  * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4050  * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4051  */
4052
4053
4054 /**
4055  * SECTION:gdatainputstream
4056  * @short_description: Data Input Stream
4057  * @include: gio/gio.h
4058  * @see_also: #GInputStream
4059  *
4060  * Data input stream implements #GInputStream and includes functions for
4061  * reading structured data directly from a binary input stream.
4062  */
4063
4064
4065 /**
4066  * SECTION:gdataoutputstream
4067  * @short_description: Data Output Stream
4068  * @include: gio/gio.h
4069  * @see_also: #GOutputStream
4070  *
4071  * Data output stream implements #GOutputStream and includes functions for
4072  * writing data directly to an output stream.
4073  */
4074
4075
4076 /**
4077  * SECTION:gdbusactiongroup
4078  * @title: GDBusActionGroup
4079  * @short_description: A D-Bus GActionGroup implementation
4080  * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4081  *
4082  * #GDBusActionGroup is an implementation of the #GActionGroup
4083  * interface that can be used as a proxy for an action group
4084  * that is exported over D-Bus with g_dbus_connection_export_action_group().
4085  */
4086
4087
4088 /**
4089  * SECTION:gdbusaddress
4090  * @title: D-Bus Addresses
4091  * @short_description: D-Bus connection endpoints
4092  * @include: gio/gio.h
4093  *
4094  * Routines for working with D-Bus addresses. A D-Bus address is a string
4095  * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4096  * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html&num;addresses">D-Bus specification</link>.
4097  */
4098
4099
4100 /**
4101  * SECTION:gdbusauthobserver
4102  * @short_description: Object used for authenticating connections
4103  * @include: gio/gio.h
4104  *
4105  * The #GDBusAuthObserver type provides a mechanism for participating
4106  * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4107  * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4108  * signals you are interested in. Note that new signals may be added
4109  * in the future
4110  *
4111  * For example, if you only want to allow D-Bus connections from
4112  * processes owned by the same uid as the server, you would use a
4113  * signal handler like the following:
4114  * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4115  * static gboolean
4116  * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4117  *                                  GIOStream         *stream,
4118  *                                  GCredentials      *credentials,
4119  *                                  gpointer           user_data)
4120  * {
4121  *   gboolean authorized;
4122  *
4123  *   authorized = FALSE;
4124  *   if (credentials != NULL)
4125  *     {
4126  *       GCredentials *own_credentials;
4127  *       own_credentials = g_credentials_new ();
4128  *       if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4129  *         authorized = TRUE;
4130  *       g_object_unref (own_credentials);
4131  *     }
4132  *
4133  *   return authorized;
4134  * }
4135  * </programlisting></example>
4136  */
4137
4138
4139 /**
4140  * SECTION:gdbusconnection
4141  * @short_description: D-Bus Connections
4142  * @include: gio/gio.h
4143  *
4144  * The #GDBusConnection type is used for D-Bus connections to remote
4145  * peers such as a message buses. It is a low-level API that offers a
4146  * lot of flexibility. For instance, it lets you establish a connection
4147  * over any transport that can by represented as an #GIOStream.
4148  *
4149  * This class is rarely used directly in D-Bus clients. If you are writing
4150  * an D-Bus client, it is often easier to use the g_bus_own_name(),
4151  * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4152  *
4153  * As an exception to the usual GLib rule that a particular object must not be
4154  * used by two threads at the same time, #GDBusConnection's methods may be
4155  * called from any thread<footnote>
4156  * <para>
4157  *   This is so that g_bus_get() and g_bus_get_sync() can safely return the
4158  *   same #GDBusConnection when called from any thread.
4159  * </para>
4160  * </footnote>.
4161  *
4162  * Most of the ways to obtain a #GDBusConnection automatically initialize it
4163  * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4164  * g_bus_get(), and the synchronous versions of those methods, give you an
4165  * initialized connection. Language bindings for GIO should use
4166  * g_initable_new() or g_async_initable_new_async(), which also initialize the
4167  * connection.
4168  *
4169  * If you construct an uninitialized #GDBusConnection, such as via
4170  * g_object_new(), you must initialize it via g_initable_init() or
4171  * g_async_initable_init_async() before using its methods or properties.
4172  * Calling methods or accessing properties on a #GDBusConnection that has not
4173  * completed initialization successfully is considered to be invalid, and leads
4174  * to undefined behaviour. In particular, if initialization fails with a
4175  * #GError, the only valid thing you can do with that #GDBusConnection is to
4176  * free it with g_object_unref().
4177  *
4178  * <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>
4179  *
4180  * <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>
4181  *
4182  * <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>
4183  *
4184  * <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>
4185  */
4186
4187
4188 /**
4189  * SECTION:gdbuserror
4190  * @title: GDBusError
4191  * @short_description: Mapping D-Bus errors to and from GError
4192  * @include: gio/gio.h
4193  *
4194  * All facilities that return errors from remote methods (such as
4195  * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4196  * errors (e.g. errors returned from the other peer) and locally
4197  * in-process generated errors.
4198  *
4199  * To check if a returned #GError is an error from a remote peer, use
4200  * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4201  * use g_dbus_error_get_remote_error(). Before presenting an error,
4202  * always use g_dbus_error_strip_remote_error().
4203  *
4204  * In addition, facilities used to return errors to a remote peer also
4205  * use #GError. See g_dbus_method_invocation_return_error() for
4206  * discussion about how the D-Bus error name is set.
4207  *
4208  * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4209  * automatically map from D-Bus errors to #GError and back. This
4210  * is typically done in the function returning the #GQuark for the
4211  * error domain:
4212  * <example id="error-registration"><title>Error Registration</title><programlisting>
4213  * /<!-- -->* foo-bar-error.h: *<!-- -->/
4214  *
4215  * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4216  * GQuark foo_bar_error_quark (void);
4217  *
4218  * typedef enum
4219  * {
4220  *   FOO_BAR_ERROR_FAILED,
4221  *   FOO_BAR_ERROR_ANOTHER_ERROR,
4222  *   FOO_BAR_ERROR_SOME_THIRD_ERROR,
4223  *   FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4224  * } FooBarError;
4225  *
4226  * /<!-- -->* foo-bar-error.c: *<!-- -->/
4227  *
4228  * static const GDBusErrorEntry foo_bar_error_entries[] =
4229  * {
4230  *   {FOO_BAR_ERROR_FAILED,           "org.project.Foo.Bar.Error.Failed"},
4231  *   {FOO_BAR_ERROR_ANOTHER_ERROR,    "org.project.Foo.Bar.Error.AnotherError"},
4232  *   {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4233  * };
4234  *
4235  * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4236  * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4237  *
4238  * GQuark
4239  * foo_bar_error_quark (void)
4240  * {
4241  *   static volatile gsize quark_volatile = 0;
4242  *   g_dbus_error_register_error_domain ("foo-bar-error-quark",
4243  *                                       &quark_volatile,
4244  *                                       foo_bar_error_entries,
4245  *                                       G_N_ELEMENTS (foo_bar_error_entries));
4246  *   return (GQuark) quark_volatile;
4247  * }
4248  * </programlisting></example>
4249  * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4250  * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4251  *
4252  * If the other peer is using GDBus, and has registered the association with
4253  * g_dbus_error_register_error_domain() in advance (e.g. by invoking the %FOO_BAR_ERROR quark
4254  * generation itself in the previous example) the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4255  * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4256  * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4257  *
4258  * Note that errors in the %G_DBUS_ERROR error domain is intended only
4259  * for returning errors from a remote message bus process. Errors
4260  * generated locally in-process by e.g. #GDBusConnection is from the
4261  * %G_IO_ERROR domain.
4262  */
4263
4264
4265 /**
4266  * SECTION:gdbusinterface
4267  * @short_description: Base type for D-Bus interfaces
4268  * @include: gio/gio.h
4269  *
4270  * The #GDBusInterface type is the base type for D-Bus interfaces both
4271  * on the service side (see #GDBusInterfaceSkeleton) and client side
4272  * (see #GDBusProxy).
4273  */
4274
4275
4276 /**
4277  * SECTION:gdbusinterfaceskeleton
4278  * @short_description: Service-side D-Bus interface
4279  * @include: gio/gio.h
4280  *
4281  * Abstract base class for D-Bus interfaces on the service side.
4282  */
4283
4284
4285 /**
4286  * SECTION:gdbusintrospection
4287  * @title: D-Bus Introspection Data
4288  * @short_description: Node and interface description data structures
4289  * @include: gio/gio.h
4290  *
4291  * Various data structures and convenience routines to parse and
4292  * generate D-Bus introspection XML. Introspection information is
4293  * used when registering objects with g_dbus_connection_register_object().
4294  *
4295  * The format of D-Bus introspection XML is specified in the
4296  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4297  */
4298
4299
4300 /**
4301  * SECTION:gdbusmenumodel
4302  * @title: GDBusMenuModel
4303  * @short_description: A D-Bus GMenuModel implementation
4304  * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4305  *
4306  * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4307  * as a proxy for a menu model that is exported over D-Bus with
4308  * g_dbus_connection_export_menu_model().
4309  */
4310
4311
4312 /**
4313  * SECTION:gdbusmessage
4314  * @short_description: D-Bus Message
4315  * @include: gio/gio.h
4316  *
4317  * A type for representing D-Bus messages that can be sent or received
4318  * on a #GDBusConnection.
4319  */
4320
4321
4322 /**
4323  * SECTION:gdbusmethodinvocation
4324  * @short_description: Object for handling remote calls
4325  * @include: gio/gio.h
4326  *
4327  * Instances of the #GDBusMethodInvocation class are used when
4328  * handling D-Bus method calls. It provides a way to asynchronously
4329  * return results and errors.
4330  *
4331  * The normal way to obtain a #GDBusMethodInvocation object is to receive
4332  * it as an argument to the handle_method_call() function in a
4333  * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4334  */
4335
4336
4337 /**
4338  * SECTION:gdbusnameowning
4339  * @title: Owning Bus Names
4340  * @short_description: Simple API for owning bus names
4341  * @include: gio/gio.h
4342  *
4343  * Convenience API for owning bus names.
4344  *
4345  * <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>
4346  */
4347
4348
4349 /**
4350  * SECTION:gdbusnamewatching
4351  * @title: Watching Bus Names
4352  * @short_description: Simple API for watching bus names
4353  * @include: gio/gio.h
4354  *
4355  * Convenience API for watching bus names.
4356  *
4357  * <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>
4358  */
4359
4360
4361 /**
4362  * SECTION:gdbusobject
4363  * @short_description: Base type for D-Bus objects
4364  * @include: gio/gio.h
4365  *
4366  * The #GDBusObject type is the base type for D-Bus objects on both
4367  * the service side (see #GDBusObjectSkeleton) and the client side
4368  * (see #GDBusObjectProxy). It is essentially just a container of
4369  * interfaces.
4370  */
4371
4372
4373 /**
4374  * SECTION:gdbusobjectmanager
4375  * @short_description: Base type for D-Bus object managers
4376  * @include: gio/gio.h
4377  *
4378  * The #GDBusObjectManager type is the base type for service- and
4379  * client-side implementations of the standardized <ulink
4380  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4381  * interface.
4382  *
4383  * See #GDBusObjectManagerClient for the client-side implementation
4384  * and #GDBusObjectManagerServer for the service-side implementation.
4385  */
4386
4387
4388 /**
4389  * SECTION:gdbusobjectmanagerclient
4390  * @short_description: Client-side object manager
4391  * @include: gio/gio.h
4392  *
4393  * #GDBusObjectManagerClient is used to create, monitor and delete object
4394  * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4395  * code implementing the <ulink
4396  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4397  * interface).
4398  *
4399  * Once an instance of this type has been created, you can connect to
4400  * the #GDBusObjectManager::object-added and
4401  * #GDBusObjectManager::object-removed signals and inspect the
4402  * #GDBusObjectProxy objects returned by
4403  * g_dbus_object_manager_get_objects().
4404  *
4405  * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4406  * object construction time, the default behavior is to request the
4407  * message bus to launch an owner for the name. This behavior can be
4408  * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4409  * flag. It's also worth noting that this only works if the name of
4410  * interest is activatable in the first place. E.g. in some cases it
4411  * is not possible to launch an owner for the requested name. In this
4412  * case, #GDBusObjectManagerClient object construction still succeeds but
4413  * there will be no object proxies
4414  * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4415  * the #GDBusObjectManagerClient:name-owner property is %NULL.
4416  *
4417  * The owner of the requested name can come and go (for example
4418  * consider a system service being restarted) â€“ #GDBusObjectManagerClient
4419  * handles this case too; simply connect to the #GObject::notify
4420  * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4421  * property. When the name owner vanishes, the behavior is that
4422  * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4423  * emission of the #GObject::notify signal) and then
4424  * #GDBusObjectManager::object-removed signals are synthesized
4425  * for all currently existing object proxies. Since
4426  * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4427  * use this information to disambiguate a synthesized signal from a
4428  * genuine signal caused by object removal on the remote
4429  * #GDBusObjectManager. Similarly, when a new name owner appears,
4430  * #GDBusObjectManager::object-added signals are synthesized
4431  * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4432  * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4433  * is set to the new name owner (this includes emission of the
4434  * #GObject::notify signal).  Furthermore, you are guaranteed that
4435  * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4436  * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4437  * the name of interest is atomically replaced
4438  *
4439  * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4440  * instances. All signals (including the
4441  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4442  * signal) delivered to #GDBusProxy instances are guaranteed to
4443  * originate from the name owner. This guarantee along with the
4444  * behavior described above, means that certain race conditions
4445  * including the <emphasis><quote>half the proxy is from the old owner
4446  * and the other half is from the new owner</quote></emphasis> problem
4447  * cannot happen.
4448  *
4449  * To avoid having the application connect to signals on the returned
4450  * #GDBusObjectProxy and #GDBusProxy objects, the
4451  * #GDBusObject::interface-added,
4452  * #GDBusObject::interface-removed,
4453  * #GDBusProxy::g-properties-changed and
4454  * #GDBusProxy::g-signal signals
4455  * are also emitted on the #GDBusObjectManagerClient instance managing these
4456  * objects. The signals emitted are
4457  * #GDBusObjectManager::interface-added,
4458  * #GDBusObjectManager::interface-removed,
4459  * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4460  * #GDBusObjectManagerClient::interface-proxy-signal.
4461  *
4462  * Note that all callbacks and signals are emitted in the
4463  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4464  * that the #GDBusObjectManagerClient object was constructed
4465  * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4466  * originating from the #GDBusObjectManagerClient object will be created in
4467  * the same context and, consequently, will deliver signals in the
4468  * same main loop.
4469  */
4470
4471
4472 /**
4473  * SECTION:gdbusobjectmanagerserver
4474  * @short_description: Service-side object manager
4475  * @include: gio/gio.h
4476  *
4477  * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4478  * the standardized <ulink
4479  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4480  * interface. For example, remote D-Bus clients can get all objects
4481  * and properties in a single call. Additionally, any change in the
4482  * object hierarchy is broadcast using signals. This means that D-Bus
4483  * clients can keep caches up to date by only listening to D-Bus
4484  * signals.
4485  *
4486  * See #GDBusObjectManagerClient for the client-side code that is
4487  * intended to be used with #GDBusObjectManagerServer or any D-Bus
4488  * object implementing the org.freedesktop.DBus.ObjectManager
4489  * interface.
4490  */
4491
4492
4493 /**
4494  * SECTION:gdbusobjectproxy
4495  * @short_description: Client-side D-Bus object
4496  * @include: gio/gio.h
4497  *
4498  * A #GDBusObjectProxy is an object used to represent a remote object
4499  * with one or more D-Bus interfaces. Normally, you don't instantiate
4500  * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4501  * is used to obtain it.
4502  *
4503  * Since: 2.30
4504  */
4505
4506
4507 /**
4508  * SECTION:gdbusobjectskeleton
4509  * @short_description: Service-side D-Bus object
4510  * @include: gio/gio.h
4511  *
4512  * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4513  * interfaces. The set of exported interfaces on the object may be
4514  * dynamic and change at runtime.
4515  *
4516  * This type is intended to be used with #GDBusObjectManager.
4517  */
4518
4519
4520 /**
4521  * SECTION:gdbusproxy
4522  * @short_description: Client-side D-Bus interface proxy
4523  * @include: gio/gio.h
4524  *
4525  * #GDBusProxy is a base class used for proxies to access a D-Bus
4526  * interface on a remote object. A #GDBusProxy can be constructed for
4527  * both well-known and unique names.
4528  *
4529  * By default, #GDBusProxy will cache all properties (and listen to
4530  * changes) of the remote object, and proxy all signals that gets
4531  * emitted. This behaviour can be changed by passing suitable
4532  * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4533  * well-known name, the property cache is flushed when the name owner
4534  * vanishes and reloaded when a name owner appears.
4535  *
4536  * If a #GDBusProxy is used for a well-known name, the owner of the
4537  * name is tracked and can be read from
4538  * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4539  * get notified of changes. Additionally, only signals and property
4540  * changes emitted from the current name owner are considered and
4541  * calls are always sent to the current name owner. This avoids a
4542  * number of race conditions when the name is lost by one owner and
4543  * claimed by another. However, if no name owner currently exists,
4544  * then calls will be sent to the well-known name which may result in
4545  * the message bus launching an owner (unless
4546  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4547  *
4548  * The generic #GDBusProxy::g-properties-changed and
4549  * #GDBusProxy::g-signal signals are not very convenient to work
4550  * with. Therefore, the recommended way of working with proxies is to
4551  * subclass #GDBusProxy, and have more natural properties and signals
4552  * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4553  * for how this can easily be done using the
4554  * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4555  * tool.
4556  *
4557  * A #GDBusProxy instance can be used from multiple threads but note
4558  * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4559  * and #GObject::notify) are emitted in the
4560  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4561  * of the thread where the instance was constructed.
4562  *
4563  * <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>
4564  */
4565
4566
4567 /**
4568  * SECTION:gdbusserver
4569  * @short_description: Helper for accepting connections
4570  * @include: gio/gio.h
4571  *
4572  * #GDBusServer is a helper for listening to and accepting D-Bus
4573  * connections. This can be used to create a new D-Bus server, allowing two
4574  * peers to use the D-Bus protocol for their own specialized communication.
4575  * A server instance provided in this way will not perform message routing or
4576  * implement the org.freedesktop.DBus interface.
4577  *
4578  * To just export an object on a well-known name on a message bus, such as the
4579  * session or system bus, you should instead use g_bus_own_name().
4580  *
4581  * <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>
4582  */
4583
4584
4585 /**
4586  * SECTION:gdbusutils
4587  * @title: D-Bus Utilities
4588  * @short_description: Various utilities related to D-Bus.
4589  * @include: gio/gio.h
4590  *
4591  * Various utility routines related to D-Bus.
4592  */
4593
4594
4595 /**
4596  * SECTION:gdesktopappinfo
4597  * @title: GDesktopAppInfo
4598  * @short_description: Application information from desktop files
4599  * @include: gio/gdesktopappinfo.h
4600  *
4601  * #GDesktopAppInfo is an implementation of #GAppInfo based on
4602  * desktop files.
4603  *
4604  * Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
4605  * the UNIX-specific GIO interfaces, thus you have to use the
4606  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4607  */
4608
4609
4610 /**
4611  * SECTION:gdrive
4612  * @short_description: Drive management
4613  * @include: gio/gio.h
4614  *
4615  * #GDrive - this represent a piece of hardware connected to the machine.
4616  * It's generally only created for removable hardware or hardware with
4617  * removable media.
4618  *
4619  * #GDrive is a container class for #GVolume objects that stem from
4620  * the same piece of media. As such, #GDrive abstracts a drive with
4621  * (or without) removable media and provides operations for querying
4622  * whether media is available, determining whether media change is
4623  * automatically detected and ejecting the media.
4624  *
4625  * If the #GDrive reports that media isn't automatically detected, one
4626  * can poll for media; typically one should not do this periodically
4627  * as a poll for media operation is potententially expensive and may
4628  * spin up the drive creating noise.
4629  *
4630  * #GDrive supports starting and stopping drives with authentication
4631  * support for the former. This can be used to support a diverse set
4632  * of use cases including connecting/disconnecting iSCSI devices,
4633  * powering down external disk enclosures and starting/stopping
4634  * multi-disk devices such as RAID devices. Note that the actual
4635  * semantics and side-effects of starting/stopping a #GDrive may vary
4636  * according to implementation. To choose the correct verbs in e.g. a
4637  * file manager, use g_drive_get_start_stop_type().
4638  *
4639  * For porting from GnomeVFS note that there is no equivalent of
4640  * #GDrive in that API.
4641  */
4642
4643
4644 /**
4645  * SECTION:gemblem
4646  * @short_description: An object for emblems
4647  * @include: gio/gio.h
4648  * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4649  *
4650  * #GEmblem is an implementation of #GIcon that supports
4651  * having an emblem, which is an icon with additional properties.
4652  * It can than be added to a #GEmblemedIcon.
4653  *
4654  * Currently, only metainformation about the emblem's origin is
4655  * supported. More may be added in the future.
4656  */
4657
4658
4659 /**
4660  * SECTION:gemblemedicon
4661  * @short_description: Icon with emblems
4662  * @include: gio/gio.h
4663  * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4664  *
4665  * #GEmblemedIcon is an implementation of #GIcon that supports
4666  * adding an emblem to an icon. Adding multiple emblems to an
4667  * icon is ensured via g_emblemed_icon_add_emblem().
4668  *
4669  * Note that #GEmblemedIcon allows no control over the position
4670  * of the emblems. See also #GEmblem for more information.
4671  */
4672
4673
4674 /**
4675  * SECTION:gfile
4676  * @short_description: File and Directory Handling
4677  * @include: gio/gio.h
4678  * @see_also: #GFileInfo, #GFileEnumerator
4679  *
4680  * #GFile is a high level abstraction for manipulating files on a
4681  * virtual file system. #GFiles are lightweight, immutable objects
4682  * that do no I/O upon creation. It is necessary to understand that
4683  * #GFile objects do not represent files, merely an identifier for a
4684  * file. All file content I/O is implemented as streaming operations
4685  * (see #GInputStream and #GOutputStream).
4686  *
4687  * To construct a #GFile, you can use:
4688  * <simplelist>
4689  * <member>g_file_new_for_path() if you have a path.</member>
4690  * <member>g_file_new_for_uri() if you have a URI.</member>
4691  * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4692  * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4693  * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4694  * </simplelist>
4695  *
4696  * One way to think of a #GFile is as an abstraction of a pathname. For
4697  * normal files the system pathname is what is stored internally, but as
4698  * #GFiles are extensible it could also be something else that corresponds
4699  * to a pathname in a userspace implementation of a filesystem.
4700  *
4701  * #GFiles make up hierarchies of directories and files that correspond to
4702  * the files on a filesystem. You can move through the file system with
4703  * #GFile using g_file_get_parent() to get an identifier for the parent
4704  * directory, g_file_get_child() to get a child within a directory,
4705  * g_file_resolve_relative_path() to resolve a relative path between two
4706  * #GFiles. There can be multiple hierarchies, so you may not end up at
4707  * the same root if you repeatedly call g_file_get_parent() on two different
4708  * files.
4709  *
4710  * All #GFiles have a basename (get with g_file_get_basename()). These names
4711  * are byte strings that are used to identify the file on the filesystem
4712  * (relative to its parent directory) and there is no guarantees that they
4713  * have any particular charset encoding or even make any sense at all. If
4714  * you want to use filenames in a user interface you should use the display
4715  * name that you can get by requesting the
4716  * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4717  * This is guaranteed to be in UTF-8 and can be used in a user interface.
4718  * But always store the real basename or the #GFile to use to actually
4719  * access the file, because there is no way to go from a display name to
4720  * the actual name.
4721  *
4722  * Using #GFile as an identifier has the same weaknesses as using a path
4723  * in that there may be multiple aliases for the same file. For instance,
4724  * hard or soft links may cause two different #GFiles to refer to the same
4725  * file. Other possible causes for aliases are: case insensitive filesystems,
4726  * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4727  * check if two #GFiles point to the same file you can query for the
4728  * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4729  * canonicalization of pathnames passed in, so that trivial differences in
4730  * the path string used at creation (duplicated slashes, slash at end of
4731  * path, "." or ".." path segments, etc) does not create different #GFiles.
4732  *
4733  * Many #GFile operations have both synchronous and asynchronous versions
4734  * to suit your application. Asynchronous versions of synchronous functions
4735  * simply have _async() appended to their function names. The asynchronous
4736  * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4737  * the operation, producing a GAsyncResult which is then passed to the
4738  * function's matching _finish() operation.
4739  *
4740  * Some #GFile operations do not have synchronous analogs, as they may
4741  * take a very long time to finish, and blocking may leave an application
4742  * unusable. Notable cases include:
4743  * <simplelist>
4744  * <member>g_file_mount_mountable() to mount a mountable file.</member>
4745  * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4746  * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4747  * </simplelist>
4748  *
4749  * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4750  * One notable feature of #GFiles are entity tags, or "etags" for
4751  * short. Entity tags are somewhat like a more abstract version of the
4752  * traditional mtime, and can be used to quickly determine if the file has
4753  * been modified from the version on the file system. See the HTTP 1.1
4754  * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4755  * for HTTP Etag headers, which are a very similar concept.
4756  * </para>
4757  */
4758
4759
4760 /**
4761  * SECTION:gfileattribute
4762  * @short_description: Key-Value Paired File Attributes
4763  * @include: gio/gio.h
4764  * @see_also: #GFile, #GFileInfo
4765  *
4766  * File attributes in GIO consist of a list of key-value pairs.
4767  *
4768  * Keys are strings that contain a key namespace and a key name, separated
4769  * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4770  * key-value pairs by namespaces for relevance. Keys can be retrived
4771  * using wildcards, e.g. "standard::*" will return all of the keys in the
4772  * "standard" namespace.
4773  *
4774  * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4775  * available as a #GFileAttributeInfoList. This list is queryable by key names
4776  * as indicated earlier.
4777  *
4778  * Information is stored within the list in #GFileAttributeInfo structures.
4779  * The info structure can store different types, listed in the enum
4780  * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4781  * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4782  *
4783  * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4784  * install default keys and values for their given file system, architecture,
4785  * and other possible implementation details (e.g., on a UNIX system, a file
4786  * attribute key will be registered for the user id for a given file).
4787  *
4788  * <para>
4789  * <table>
4790  * <title>GFileAttributes Default Namespaces</title>
4791  * <tgroup cols='2' align='left'><thead>
4792  * <row><entry>Namspace</entry><entry>Description</entry></row>
4793  * </thead>
4794  * <tbody>
4795  * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4796  * information that any application may need should be put in this namespace.
4797  * Examples include the file's name, type, and size.</entry></row>
4798  * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4799  * namespace. Currently, the only key in this namespace is "value", which contains
4800  * the value of the current entity tag.</entry></row>
4801  * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4802  * namespace is used by file managers and applications that list directories
4803  * to check for loops and to uniquely identify files.</entry></row>
4804  * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4805  * if a user has the proper privilidges to access files and perform
4806  * file operations. Keys in this namespace are made to be generic
4807  * and easily understood, e.g. the "can_read" key is %TRUE if
4808  * the current user has permission to read the file. UNIX permissions and
4809  * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4810  * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4811  * simple boolean keys for checking if a file or path supports mount operations, e.g.
4812  * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4813  * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4814  * access, changed, created times. </entry></row>
4815  * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4816  * information and may not be available for all files. Examples include
4817  * the UNIX "UID", "GID", etc.</entry></row>
4818  * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4819  * information and may not be available for all files. Examples include
4820  * "is_system" for checking if a file is marked as a system file, and "is_archive"
4821  * for checking if a file is marked as an archive file.</entry></row>
4822  * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4823  * about who owns a file. May not be available for all file systems. Examples include
4824  * "user" for getting the user name of the file owner. This information is often mapped from
4825  * some backend specific data such as a unix UID.</entry></row>
4826  * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4827  * information about file thumbnails and their location within the file system. Examples of
4828  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4829  * to check if thumbnailing of the file failed.</entry></row>
4830  * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4831  * about the file system where a file is located, such as its type, how much
4832  * space is left available, and the overall size of the file system.</entry></row>
4833  * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4834  * contain information about the current GVFS backend in use. </entry></row>
4835  * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4836  * about extended user attributes. See attr(5). The "user." prefix of the
4837  * extended user attribute name is stripped away when constructing keys in
4838  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4839  * the name "user.mime_type". Note that this information is only available
4840  * if GLib has been built with extended attribute support.</entry></row>
4841  * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4842  * Gets information about extended attributes which are not user-specific.
4843  * See attr(5). Note that this information is only available if GLib
4844  * has been built with extended attribute support.</entry></row>
4845  * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4846  * information about the SELinux context of files. Note that this information
4847  * is only available if GLib has been built with SELinux support.</entry></row>
4848  * </tbody>
4849  * </tgroup>
4850  * </table>
4851  * </para>
4852  *
4853  * Please note that these are not all of the possible namespaces.
4854  * More namespaces can be added from GIO modules or by individual applications.
4855  * For more information about writing GIO modules, see #GIOModule.
4856  *
4857  * <!-- TODO: Implementation note about using extended attributes on supported
4858  * file systems -->
4859  *
4860  * <para><table>
4861  * <title>GFileAttributes Built-in Keys and Value Types</title>
4862  * <tgroup cols='3' align='left'><thead>
4863  * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4864  * </thead><tbody>
4865  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4866  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4867  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4868  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4869  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4870  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4871  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4872  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4873  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4874  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4875  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4876  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4877  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4878  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4879  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4880  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4881  * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4882  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4883  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4884  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4885  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4886  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4887  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4888  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4889  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4890  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4891  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4892  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4893  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4894  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4895  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4896  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4897  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4898  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4899  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4900  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4901  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4902  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4903  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4904  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4905  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4906  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4907  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4908  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4909  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4910  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4911  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4912  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4913  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4914  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4915  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4916  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4917  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4918  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4919  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4920  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4921  * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4922  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4923  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4924  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4925  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4926  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4927  * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4928  * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4929  * </tbody></tgroup></table></para>
4930  *
4931  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4932  * namespaces. Keys for the "xattr" namespace are constructed by stripping
4933  * away the "user." prefix from the extended user attribute, and prepending
4934  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4935  * concatenating "xattr-sys::" with the extended attribute name. All extended
4936  * attribute values are returned as hex-encoded strings in which bytes outside
4937  * the ASCII range are encoded as hexadecimal escape sequences of the form
4938  * \x<replaceable>nn</replaceable>.
4939  */
4940
4941
4942 /**
4943  * SECTION:gfiledescriptorbased
4944  * @short_description: Interface for file descriptor based IO
4945  * @include: gio/gfiledescriptorbased.h
4946  * @see_also: #GInputStream, #GOutputStream
4947  *
4948  * #GFileDescriptorBased is implemented by streams (implementations of
4949  * #GInputStream or #GOutputStream) that are based on file descriptors.
4950  *
4951  * Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
4952  * the UNIX-specific GIO interfaces, thus you have to use the
4953  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4954  *
4955  * Since: 2.24
4956  */
4957
4958
4959 /**
4960  * SECTION:gfileenumerator
4961  * @short_description: Enumerated Files Routines
4962  * @include: gio/gio.h
4963  *
4964  * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4965  * returning a #GFileInfo structure for each file enumerated (e.g.
4966  * g_file_enumerate_children() will return a #GFileEnumerator for each
4967  * of the children within a directory).
4968  *
4969  * To get the next file's information from a #GFileEnumerator, use
4970  * g_file_enumerator_next_file() or its asynchronous version,
4971  * g_file_enumerator_next_files_async(). Note that the asynchronous
4972  * version will return a list of #GFileInfo<!---->s, whereas the
4973  * synchronous will only return the next file in the enumerator.
4974  *
4975  * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4976  * its asynchronous version, g_file_enumerator_close_async(). Once
4977  * a #GFileEnumerator is closed, no further actions may be performed
4978  * on it, and it should be freed with g_object_unref().
4979  */
4980
4981
4982 /**
4983  * SECTION:gfileicon
4984  * @short_description: Icons pointing to an image file
4985  * @include: gio/gio.h
4986  * @see_also: #GIcon, #GLoadableIcon
4987  *
4988  * #GFileIcon specifies an icon by pointing to an image file
4989  * to be used as icon.
4990  */
4991
4992
4993 /**
4994  * SECTION:gfileinfo
4995  * @short_description: File Information and Attributes
4996  * @include: gio/gio.h
4997  * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4998  *
4999  * Functionality for manipulating basic metadata for files. #GFileInfo
5000  * implements methods for getting information that all files should
5001  * contain, and allows for manipulation of extended attributes.
5002  *
5003  * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
5004  * information on how GIO handles file attributes.
5005  *
5006  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
5007  * async variant). To obtain a #GFileInfo for a file input or output
5008  * stream, use g_file_input_stream_query_info() or
5009  * g_file_output_stream_query_info() (or their async variants).
5010  *
5011  * To change the actual attributes of a file, you should then set the
5012  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
5013  * or g_file_set_attributes_async() on a GFile.
5014  *
5015  * However, not all attributes can be changed in the file. For instance,
5016  * the actual size of a file cannot be changed via g_file_info_set_size().
5017  * You may call g_file_query_settable_attributes() and
5018  * g_file_query_writable_namespaces() to discover the settable attributes
5019  * of a particular file at runtime.
5020  *
5021  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
5022  * attributes.
5023  */
5024
5025
5026 /**
5027  * SECTION:gfileinputstream
5028  * @short_description: File input streaming operations
5029  * @include: gio/gio.h
5030  * @see_also: #GInputStream, #GDataInputStream, #GSeekable
5031  *
5032  * GFileInputStream provides input streams that take their
5033  * content from a file.
5034  *
5035  * GFileInputStream implements #GSeekable, which allows the input
5036  * stream to jump to arbitrary positions in the file, provided the
5037  * filesystem of the file allows it. To find the position of a file
5038  * input stream, use g_seekable_tell(). To find out if a file input
5039  * stream supports seeking, use g_seekable_can_seek().
5040  * To position a file input stream, use g_seekable_seek().
5041  */
5042
5043
5044 /**
5045  * SECTION:gfileiostream
5046  * @short_description: File read and write streaming operations
5047  * @include: gio/gio.h
5048  * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
5049  *
5050  * GFileIOStream provides io streams that both read and write to the same
5051  * file handle.
5052  *
5053  * GFileIOStream implements #GSeekable, which allows the io
5054  * stream to jump to arbitrary positions in the file and to truncate
5055  * the file, provided the filesystem of the file supports these
5056  * operations.
5057  *
5058  * To find the position of a file io stream, use
5059  * g_seekable_tell().
5060  *
5061  * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5062  * To position a file io stream, use g_seekable_seek().
5063  * To find out if a file io stream supports truncating, use
5064  * g_seekable_can_truncate(). To truncate a file io
5065  * stream, use g_seekable_truncate().
5066  *
5067  * The default implementation of all the #GFileIOStream operations
5068  * and the implementation of #GSeekable just call into the same operations
5069  * on the output stream.
5070  *
5071  * Since: 2.22
5072  */
5073
5074
5075 /**
5076  * SECTION:gfilemonitor
5077  * @short_description: File Monitor
5078  * @include: gio/gio.h
5079  *
5080  * Monitors a file or directory for changes.
5081  *
5082  * To obtain a #GFileMonitor for a file or directory, use
5083  * g_file_monitor(), g_file_monitor_file(), or
5084  * g_file_monitor_directory().
5085  *
5086  * To get informed about changes to the file or directory you are
5087  * monitoring, connect to the #GFileMonitor::changed signal. The
5088  * signal will be emitted in the <link
5089  * linkend="g-main-context-push-thread-default">thread-default main
5090  * context</link> of the thread that the monitor was created in
5091  * (though if the global default main context is blocked, this may
5092  * cause notifications to be blocked even if the thread-default
5093  * context is still running).
5094  */
5095
5096
5097 /**
5098  * SECTION:gfilenamecompleter
5099  * @short_description: Filename Completer
5100  * @include: gio/gio.h
5101  *
5102  * Completes partial file and directory names given a partial string by
5103  * looking in the file system for clues. Can return a list of possible
5104  * completion strings for widget implementations.
5105  */
5106
5107
5108 /**
5109  * SECTION:gfileoutputstream
5110  * @short_description: File output streaming operations
5111  * @include: gio/gio.h
5112  * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5113  *
5114  * GFileOutputStream provides output streams that write their
5115  * content to a file.
5116  *
5117  * GFileOutputStream implements #GSeekable, which allows the output
5118  * stream to jump to arbitrary positions in the file and to truncate
5119  * the file, provided the filesystem of the file supports these
5120  * operations.
5121  *
5122  * To find the position of a file output stream, use g_seekable_tell().
5123  * To find out if a file output stream supports seeking, use
5124  * g_seekable_can_seek().To position a file output stream, use
5125  * g_seekable_seek(). To find out if a file output stream supports
5126  * truncating, use g_seekable_can_truncate(). To truncate a file output
5127  * stream, use g_seekable_truncate().
5128  */
5129
5130
5131 /**
5132  * SECTION:gfilterinputstream
5133  * @short_description: Filter Input Stream
5134  * @include: gio/gio.h
5135  *
5136  * Base class for input stream implementations that perform some
5137  * kind of filtering operation on a base stream. Typical examples
5138  * of filtering operations are character set conversion, compression
5139  * and byte order flipping.
5140  */
5141
5142
5143 /**
5144  * SECTION:gfilteroutputstream
5145  * @short_description: Filter Output Stream
5146  * @include: gio/gio.h
5147  *
5148  * Base class for output stream implementations that perform some
5149  * kind of filtering operation on a base stream. Typical examples
5150  * of filtering operations are character set conversion, compression
5151  * and byte order flipping.
5152  */
5153
5154
5155 /**
5156  * SECTION:gicon
5157  * @short_description: Interface for icons
5158  * @include: gio/gio.h
5159  *
5160  * #GIcon is a very minimal interface for icons. It provides functions
5161  * for checking the equality of two icons, hashing of icons and
5162  * serializing an icon to and from strings.
5163  *
5164  * #GIcon does not provide the actual pixmap for the icon as this is out
5165  * of GIO's scope, however implementations of #GIcon may contain the name
5166  * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5167  *
5168  * To obtain a hash of a #GIcon, see g_icon_hash().
5169  *
5170  * To check if two #GIcons are equal, see g_icon_equal().
5171  *
5172  * For serializing a #GIcon, use g_icon_to_string() and
5173  * g_icon_new_for_string().
5174  *
5175  * If your application or library provides one or more #GIcon
5176  * implementations you need to ensure that each #GType is registered
5177  * with the type system prior to calling g_icon_new_for_string().
5178  */
5179
5180
5181 /**
5182  * SECTION:ginetaddress
5183  * @short_description: An IPv4/IPv6 address
5184  *
5185  * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5186  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5187  * look up the #GInetAddress for a hostname. Use
5188  * g_resolver_lookup_by_address() or
5189  * g_resolver_lookup_by_address_async() to look up the hostname for a
5190  * #GInetAddress.
5191  *
5192  * To actually connect to a remote host, you will need a
5193  * #GInetSocketAddress (which includes a #GInetAddress as well as a
5194  * port number).
5195  */
5196
5197
5198 /**
5199  * SECTION:ginetaddressmask
5200  * @short_description: An IPv4/IPv6 address mask
5201  *
5202  * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5203  * described by a base address and a length indicating how many bits
5204  * of the base address are relevant for matching purposes. These are
5205  * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5206  */
5207
5208
5209 /**
5210  * SECTION:ginetsocketaddress
5211  * @short_description: Internet GSocketAddress
5212  *
5213  * An IPv4 or IPv6 socket address; that is, the combination of a
5214  * #GInetAddress and a port number.
5215  */
5216
5217
5218 /**
5219  * SECTION:ginitable
5220  * @short_description: Failable object initialization interface
5221  * @include: gio/gio.h
5222  * @see_also: #GAsyncInitable
5223  *
5224  * #GInitable is implemented by objects that can fail during
5225  * initialization. If an object implements this interface then
5226  * it must be initialized as the first thing after construction,
5227  * either via g_initable_init() or g_async_initable_init_async()
5228  * (the latter is only available if it also implements #GAsyncInitable).
5229  *
5230  * If the object is not initialized, or initialization returns with an
5231  * error, then all operations on the object except g_object_ref() and
5232  * g_object_unref() are considered to be invalid, and have undefined
5233  * behaviour. They will often fail with g_critical() or g_warning(), but
5234  * this must not be relied on.
5235  *
5236  * Users of objects implementing this are not intended to use
5237  * the interface method directly, instead it will be used automatically
5238  * in various ways. For C applications you generally just call
5239  * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5240  * This will call g_initable_init() under the cover, returning %NULL and
5241  * setting a #GError on failure (at which point the instance is
5242  * unreferenced).
5243  *
5244  * For bindings in languages where the native constructor supports
5245  * exceptions the binding could check for objects implemention %GInitable
5246  * during normal construction and automatically initialize them, throwing
5247  * an exception on failure.
5248  */
5249
5250
5251 /**
5252  * SECTION:ginputstream
5253  * @short_description: Base class for implementing streaming input
5254  * @include: gio/gio.h
5255  *
5256  * #GInputStream has functions to read from a stream (g_input_stream_read()),
5257  * to close a stream (g_input_stream_close()) and to skip some content
5258  * (g_input_stream_skip()).
5259  *
5260  * To copy the content of an input stream to an output stream without
5261  * manually handling the reads and writes, use g_output_stream_splice().
5262  *
5263  * All of these functions have async variants too.
5264  */
5265
5266
5267 /**
5268  * SECTION:gioerror
5269  * @short_description: Error helper functions
5270  * @include: gio/gio.h
5271  *
5272  * Contains helper functions for reporting errors to the user.
5273  */
5274
5275
5276 /**
5277  * SECTION:giomodule
5278  * @short_description: Loadable GIO Modules
5279  * @include: gio/gio.h
5280  *
5281  * Provides an interface and default functions for loading and unloading
5282  * modules. This is used internally to make GIO extensible, but can also
5283  * be used by others to implement module loading.
5284  */
5285
5286
5287 /**
5288  * SECTION:gioscheduler
5289  * @short_description: I/O Scheduler
5290  * @include: gio/gio.h
5291  *
5292  * <note><para>
5293  *   As of GLib 2.36, the <literal>g_io_scheduler</literal> methods
5294  *   are deprecated in favor of #GThreadPool and #GTask.
5295  * </para></note>
5296  *
5297  * Schedules asynchronous I/O operations. #GIOScheduler integrates
5298  * into the main event loop (#GMainLoop) and uses threads.
5299  */
5300
5301
5302 /**
5303  * SECTION:giostream
5304  * @short_description: Base class for implementing read/write streams
5305  * @include: gio/gio.h
5306  * @see_also: #GInputStream, #GOutputStream
5307  *
5308  * GIOStream represents an object that has both read and write streams.
5309  * Generally the two streams acts as separate input and output streams,
5310  * but they share some common resources and state. For instance, for
5311  * seekable streams they may use the same position in both streams.
5312  *
5313  * Examples of #GIOStream objects are #GSocketConnection which represents
5314  * a two-way network connection, and #GFileIOStream which represent a
5315  * file handle opened in read-write mode.
5316  *
5317  * To do the actual reading and writing you need to get the substreams
5318  * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5319  *
5320  * The #GIOStream object owns the input and the output streams, not the other
5321  * way around, so keeping the substreams alive will not keep the #GIOStream
5322  * object alive. If the #GIOStream object is freed it will be closed, thus
5323  * closing the substream, so even if the substreams stay alive they will
5324  * always just return a %G_IO_ERROR_CLOSED for all operations.
5325  *
5326  * To close a stream use g_io_stream_close() which will close the common
5327  * stream object and also the individual substreams. You can also close
5328  * the substreams themselves. In most cases this only marks the
5329  * substream as closed, so further I/O on it fails. However, some streams
5330  * may support "half-closed" states where one direction of the stream
5331  * is actually shut down.
5332  *
5333  * Since: 2.22
5334  */
5335
5336
5337 /**
5338  * SECTION:gloadableicon
5339  * @short_description: Loadable Icons
5340  * @include: gio/gio.h
5341  * @see_also: #GIcon, #GThemedIcon
5342  *
5343  * Extends the #GIcon interface and adds the ability to
5344  * load icons from streams.
5345  */
5346
5347
5348 /**
5349  * SECTION:gmemoryinputstream
5350  * @short_description: Streaming input operations on memory chunks
5351  * @include: gio/gio.h
5352  * @see_also: #GMemoryOutputStream
5353  *
5354  * #GMemoryInputStream is a class for using arbitrary
5355  * memory chunks as input for GIO streaming input operations.
5356  *
5357  * As of GLib 2.34, #GMemoryInputStream implements
5358  * #GPollableInputStream.
5359  */
5360
5361
5362 /**
5363  * SECTION:gmemoryoutputstream
5364  * @short_description: Streaming output operations on memory chunks
5365  * @include: gio/gio.h
5366  * @see_also: #GMemoryInputStream
5367  *
5368  * #GMemoryOutputStream is a class for using arbitrary
5369  * memory chunks as output for GIO streaming output operations.
5370  *
5371  * As of GLib 2.34, #GMemoryOutputStream implements
5372  * #GPollableOutputStream.
5373  */
5374
5375
5376 /**
5377  * SECTION:gmenu
5378  * @title: GMenu
5379  * @short_description: A simple implementation of GMenuModel
5380  *
5381  * #GMenu is a simple implementation of #GMenuModel.
5382  * You populate a #GMenu by adding #GMenuItem instances to it.
5383  *
5384  * There are some convenience functions to allow you to directly
5385  * add items (avoiding #GMenuItem) for the common cases. To add
5386  * a regular item, use g_menu_insert(). To add a section, use
5387  * g_menu_insert_section(). To add a submenu, use
5388  * g_menu_insert_submenu().
5389  */
5390
5391
5392 /**
5393  * SECTION:gmenuexporter
5394  * @title: GMenuModel exporter
5395  * @short_description: Export GMenuModels on D-Bus
5396  * @see_also: #GMenuModel, #GDBusMenuModel
5397  *
5398  * These functions support exporting a #GMenuModel on D-Bus.
5399  * The D-Bus interface that is used is a private implementation
5400  * detail.
5401  *
5402  * To access an exported #GMenuModel remotely, use
5403  * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5404  */
5405
5406
5407 /**
5408  * SECTION:gmenumodel
5409  * @title: GMenuModel
5410  * @short_description: An abstract class representing the contents of a menu
5411  * @see_also: #GActionGroup
5412  *
5413  * #GMenuModel represents the contents of a menu -- an ordered list of
5414  * menu items. The items are associated with actions, which can be
5415  * activated through them. Items can be grouped in sections, and may
5416  * have submenus associated with them. Both items and sections usually
5417  * have some representation data, such as labels or icons. The type of
5418  * the associated action (ie whether it is stateful, and what kind of
5419  * state it has) can influence the representation of the item.
5420  *
5421  * The conceptual model of menus in #GMenuModel is hierarchical:
5422  * sections and submenus are again represented by #GMenuModels.
5423  * Menus themselves do not define their own roles. Rather, the role
5424  * of a particular #GMenuModel is defined by the item that references
5425  * it (or, in the case of the 'root' menu, is defined by the context
5426  * in which it is used).
5427  *
5428  * As an example, consider the visible portions of the menu in
5429  * <xref linkend="menu-example"/>.
5430  *
5431  * <figure id="menu-example">
5432  *   <title>An example menu</title>
5433  *   <graphic fileref="menu-example.png" format="PNG"></graphic>
5434  * </figure>
5435  *
5436  * There are 8 "menus" visible in the screenshot: one menubar, two
5437  * submenus and 5 sections:
5438  * <itemizedlist>
5439  * <listitem>the toplevel menubar (containing 4 items)</listitem>
5440  * <listitem>the View submenu (containing 3 sections)</listitem>
5441  * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5442  * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5443  * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5444  * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5445  * <listitem>the Sources section (containing 2 items)</listitem>
5446  * <listitem>the Markup section (containing 2 items)</listitem>
5447  * </itemizedlist>
5448  *
5449  * <xref linkend="menu-model"/> illustrates the conceptual connection between
5450  * these 8 menus. Each large block in the figure represents a menu and the
5451  * smaller blocks within the large block represent items in that menu. Some
5452  * items contain references to other menus.
5453  *
5454  * <figure id="menu-model">
5455  *   <title>A menu model</title>
5456  *   <graphic fileref="menu-model.png" format="PNG"></graphic>
5457  * </figure>
5458  *
5459  * Notice that the separators visible in <xref linkend="menu-example"/>
5460  * appear nowhere in <xref linkend="menu-model"/>. This is because
5461  * separators are not explicitly represented in the menu model. Instead,
5462  * a separator is inserted between any two non-empty sections of a menu.
5463  * Section items can have labels just like any other item. In that case,
5464  * a display system may show a section header instead of a separator.
5465  *
5466  * The motivation for this abstract model of application controls is
5467  * that modern user interfaces tend to make these controls available
5468  * outside the application. Examples include global menus, jumplists,
5469  * dash boards, etc. To support such uses, it is necessary to 'export'
5470  * information about actions and their representation in menus, which
5471  * is exactly what the
5472  * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5473  * and the
5474  * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5475  * do for #GActionGroup and #GMenuModel. The client-side counterparts
5476  * to make use of the exported information are #GDBusActionGroup and
5477  * #GDBusMenuModel.
5478  *
5479  * The API of #GMenuModel is very generic, with iterators for the
5480  * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5481  * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5482  * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5483  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5484  * and %G_MENU_LINK_SUBMENU.
5485  *
5486  * Items in a #GMenuModel represent active controls if they refer to
5487  * an action that can get activated when the user interacts with the
5488  * menu item. The reference to the action is encoded by the string id
5489  * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5490  * identifies an action in an action group. Which action group(s) provide
5491  * actions depends on the context in which the menu model is used.
5492  * E.g. when the model is exported as the application menu of a
5493  * #GtkApplication, actions can be application-wide or window-specific
5494  * (and thus come from two different action groups). By convention, the
5495  * application-wide actions have names that start with "app.", while the
5496  * names of window-specific actions start with "win.".
5497  *
5498  * While a wide variety of stateful actions is possible, the following
5499  * is the minimum that is expected to be supported by all users of exported
5500  * menu information:
5501  * <itemizedlist>
5502  * <listitem>an action with no parameter type and no state</listitem>
5503  * <listitem>an action with no parameter type and boolean state</listitem>
5504  * <listitem>an action with string parameter type and string state</listitem>
5505  * </itemizedlist>
5506  *
5507  * <formalpara><title>Stateless</title>
5508  * <para>
5509  * A stateless action typically corresponds to an ordinary menu item.
5510  * </para>
5511  * <para>
5512  * Selecting such a menu item will activate the action (with no parameter).
5513  * </para>
5514  * </formalpara>
5515  *
5516  * <formalpara><title>Boolean State</title>
5517  * <para>
5518  * An action with a boolean state will most typically be used with a "toggle"
5519  * or "switch" menu item. The state can be set directly, but activating the
5520  * action (with no parameter) results in the state being toggled.
5521  * </para>
5522  * <para>
5523  * Selecting a toggle menu item will activate the action. The menu item should
5524  * be rendered as "checked" when the state is true.
5525  * </para>
5526  * </formalpara>
5527  *
5528  * <formalpara><title>String Parameter and State</title>
5529  * <para>
5530  * Actions with string parameters and state will most typically be used to
5531  * represent an enumerated choice over the items available for a group of
5532  * radio menu items. Activating the action with a string parameter is
5533  * equivalent to setting that parameter as the state.
5534  * </para>
5535  * <para>
5536  * Radio menu items, in addition to being associated with the action, will
5537  * have a target value. Selecting that menu item will result in activation
5538  * of the action with the target value as the parameter. The menu item should
5539  * be rendered as "selected" when the state of the action is equal to the
5540  * target value of the menu item.
5541  * </para>
5542  * </formalpara>
5543  */
5544
5545
5546 /**
5547  * SECTION:gmount
5548  * @short_description: Mount management
5549  * @include: gio/gio.h
5550  * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5551  *
5552  * The #GMount interface represents user-visible mounts. Note, when
5553  * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5554  *
5555  * #GMount is a "mounted" filesystem that you can access. Mounted is in
5556  * quotes because it's not the same as a unix mount, it might be a gvfs
5557  * mount, but you can still access the files on it if you use GIO. Might or
5558  * might not be related to a volume object.
5559  *
5560  * Unmounting a #GMount instance is an asynchronous operation. For
5561  * more information about asynchronous operations, see #GAsyncResult
5562  * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5563  * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5564  * #GAsyncReadyCallback.  The callback will be fired when the
5565  * operation has resolved (either with success or failure), and a
5566  * #GAsyncReady structure will be passed to the callback.  That
5567  * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5568  * and the #GAsyncReady data to see if the operation was completed
5569  * successfully.  If an @error is present when g_mount_unmount_with_operation_finish()
5570  * is called, then it will be filled with any error information.
5571  */
5572
5573
5574 /**
5575  * SECTION:gmountoperation
5576  * @short_description: Object used for authentication and user interaction
5577  * @include: gio/gio.h
5578  *
5579  * #GMountOperation provides a mechanism for interacting with the user.
5580  * It can be used for authenticating mountable operations, such as loop
5581  * mounting files, hard drive partitions or server locations. It can
5582  * also be used to ask the user questions or show a list of applications
5583  * preventing unmount or eject operations from completing.
5584  *
5585  * Note that #GMountOperation is used for more than just #GMount
5586  * objects â€“ for example it is also used in g_drive_start() and
5587  * g_drive_stop().
5588  *
5589  * Users should instantiate a subclass of this that implements all the
5590  * various callbacks to show the required dialogs, such as
5591  * #GtkMountOperation. If no user interaction is desired (for example
5592  * when automounting filesystems at login time), usually %NULL can be
5593  * passed, see each method taking a #GMountOperation for details.
5594  */
5595
5596
5597 /**
5598  * SECTION:gnetworkaddress
5599  * @short_description: A GSocketConnectable for resolving hostnames
5600  * @include: gio/gio.h
5601  *
5602  * #GNetworkAddress provides an easy way to resolve a hostname and
5603  * then attempt to connect to that host, handling the possibility of
5604  * multiple IP addresses and multiple address families.
5605  *
5606  * See #GSocketConnectable for and example of using the connectable
5607  * interface.
5608  */
5609
5610
5611 /**
5612  * SECTION:gnetworkmonitor
5613  * @title: GNetworkMonitor
5614  * @short_description: Network status monitor
5615  * @include: gio/gio.h
5616  *
5617  * #GNetworkMonitor provides an easy-to-use cross-platform API
5618  * for monitoring network connectivity. On Linux, the implementation
5619  * is based on the kernel's netlink interface.
5620  */
5621
5622
5623 /**
5624  * SECTION:gnetworkservice
5625  * @short_description: A GSocketConnectable for resolving SRV records
5626  * @include: gio/gio.h
5627  *
5628  * Like #GNetworkAddress does with hostnames, #GNetworkService
5629  * provides an easy way to resolve a SRV record, and then attempt to
5630  * connect to one of the hosts that implements that service, handling
5631  * service priority/weighting, multiple IP addresses, and multiple
5632  * address families.
5633  *
5634  * See #GSrvTarget for more information about SRV records, and see
5635  * #GSocketConnectable for and example of using the connectable
5636  * interface.
5637  */
5638
5639
5640 /**
5641  * SECTION:goutputstream
5642  * @short_description: Base class for implementing streaming output
5643  * @include: gio/gio.h
5644  *
5645  * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5646  * to close a stream (g_output_stream_close()) and to flush pending writes
5647  * (g_output_stream_flush()).
5648  *
5649  * To copy the content of an input stream to an output stream without
5650  * manually handling the reads and writes, use g_output_stream_splice().
5651  *
5652  * All of these functions have async variants too.
5653  */
5654
5655
5656 /**
5657  * SECTION:gpermission
5658  * @title: GPermission
5659  * @short_description: An object representing the permission to perform a certain action
5660  *
5661  * A #GPermission represents the status of the caller's permission to
5662  * perform a certain action.
5663  *
5664  * You can query if the action is currently allowed and if it is
5665  * possible to acquire the permission so that the action will be allowed
5666  * in the future.
5667  *
5668  * There is also an API to actually acquire the permission and one to
5669  * release it.
5670  *
5671  * As an example, a #GPermission might represent the ability for the
5672  * user to write to a #GSettings object.  This #GPermission object could
5673  * then be used to decide if it is appropriate to show a "Click here to
5674  * unlock" button in a dialog and to provide the mechanism to invoke
5675  * when that button is clicked.
5676  */
5677
5678
5679 /**
5680  * SECTION:gpollableinputstream
5681  * @short_description: Interface for pollable input streams
5682  * @include: gio/gio.h
5683  * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5684  *
5685  * #GPollableInputStream is implemented by #GInputStreams that
5686  * can be polled for readiness to read. This can be used when
5687  * interfacing with a non-GIO API that expects
5688  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5689  *
5690  * Since: 2.28
5691  */
5692
5693
5694 /**
5695  * SECTION:gpollableoutputstream
5696  * @short_description: Interface for pollable output streams
5697  * @include: gio/gio.h
5698  * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5699  *
5700  * #GPollableOutputStream is implemented by #GOutputStreams that
5701  * can be polled for readiness to write. This can be used when
5702  * interfacing with a non-GIO API that expects
5703  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5704  *
5705  * Since: 2.28
5706  */
5707
5708
5709 /**
5710  * SECTION:gpollableutils
5711  * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5712  * @include: gio/gio.h
5713  *
5714  * Utility functions for #GPollableInputStream and
5715  * #GPollableOutputStream implementations.
5716  */
5717
5718
5719 /**
5720  * SECTION:gproxy
5721  * @short_description: Interface for proxy handling
5722  *
5723  * A #GProxy handles connecting to a remote host via a given type of
5724  * proxy server. It is implemented by the 'gio-proxy' extension point.
5725  * The extensions are named after their proxy protocol name. As an
5726  * example, a SOCKS5 proxy implementation can be retrieved with the
5727  * name 'socks5' using the function
5728  * g_io_extension_point_get_extension_by_name().
5729  *
5730  * Since: 2.26
5731  */
5732
5733
5734 /**
5735  * SECTION:gproxyaddress
5736  * @short_description: An internet address with proxy information
5737  *
5738  * Support for proxied #GInetSocketAddress.
5739  */
5740
5741
5742 /**
5743  * SECTION:gproxyresolver
5744  * @short_description: Asynchronous and cancellable network proxy resolver
5745  * @include: gio/gio.h
5746  *
5747  * #GProxyResolver provides synchronous and asynchronous network proxy
5748  * resolution. #GProxyResolver is used within #GSocketClient through
5749  * the method g_socket_connectable_proxy_enumerate().
5750  */
5751
5752
5753 /**
5754  * SECTION:gremoteactiongroup
5755  * @title: GRemoteActionGroup
5756  * @short_description: a #GActionGroup that interacts with other processes
5757  *
5758  * The GRemoteActionGroup interface is implemented by #GActionGroup
5759  * instances that either transmit action invocations to other processes
5760  * or receive action invocations in the local process from other
5761  * processes.
5762  *
5763  * The interface has <literal>_full</literal> variants of the two
5764  * methods on #GActionGroup used to activate actions:
5765  * g_action_group_activate_action() and
5766  * g_action_group_change_action_state().  These variants allow a
5767  * "platform data" #GVariant to be specified: a dictionary providing
5768  * context for the action invocation (for example: timestamps, startup
5769  * notification IDs, etc).
5770  *
5771  * #GDBusActionGroup implements #GRemoteActionGroup.  This provides a
5772  * mechanism to send platform data for action invocations over D-Bus.
5773  *
5774  * Additionally, g_dbus_connection_export_action_group() will check if
5775  * the exported #GActionGroup implements #GRemoteActionGroup and use the
5776  * <literal>_full</literal> variants of the calls if available.  This
5777  * provides a mechanism by which to receive platform data for action
5778  * invocations that arrive by way of D-Bus.
5779  *
5780  * Since: 2.32
5781  */
5782
5783
5784 /**
5785  * SECTION:gresolver
5786  * @short_description: Asynchronous and cancellable DNS resolver
5787  * @include: gio/gio.h
5788  *
5789  * #GResolver provides cancellable synchronous and asynchronous DNS
5790  * resolution, for hostnames (g_resolver_lookup_by_address(),
5791  * g_resolver_lookup_by_name() and their async variants) and SRV
5792  * (service) records (g_resolver_lookup_service()).
5793  *
5794  * #GNetworkAddress and #GNetworkService provide wrappers around
5795  * #GResolver functionality that also implement #GSocketConnectable,
5796  * making it easy to connect to a remote host/service.
5797  */
5798
5799
5800 /**
5801  * SECTION:gresource
5802  * @short_description: Resource framework
5803  * @include: gio/gio.h
5804  *
5805  * Applications and libraries often contain binary or textual data that is really part of the
5806  * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5807  * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5808  * manually included as literal strings in the code.
5809  *
5810  * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5811  * provide a convenient and efficient alternative to this which has some nice properties. You
5812  * maintain the files as normal files, so its easy to edit them, but during the build the files
5813  * are combined into a binary bundle that is linked into the executable. This means that loading
5814  * the resource files are efficient (as they are already in memory, shared with other instances) and
5815  * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5816  * also makes it easier to create relocatable applications.
5817  *
5818  * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5819  * in a compressed form, but will be automatically uncompressed when the resource is used. This
5820  * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5821  *
5822  * Resource files can also be marked to be preprocessed, by setting the value of the
5823  * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5824  * The only options currently supported are:
5825  *
5826  * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5827  * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5828  * environment variable must be set to the full path to the xmllint executable, or xmllint
5829  * must be in the PATH; otherwise the preprocessing step is skipped.
5830  *
5831  * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5832  * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5833  * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5834  * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5835  * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5836  * abort.
5837  *
5838  * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5839  * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5840  * are combined into a binary resource bundle.
5841  *
5842  * <example id="resource-example"><title>Example resource description</title>
5843  * <programlisting><![CDATA[
5844  * <?xml version="1.0" encoding="UTF-8"?>
5845  * <gresources>
5846  *   <gresource prefix="/org/gtk/Example">
5847  *     <file>data/splashscreen.png</file>
5848  *     <file compressed="true">dialog.ui</file>
5849  *     <file preprocess="xml-stripblanks">menumarkup.xml</file>
5850  *   </gresource>
5851  * </gresources>
5852  * ]]></programlisting></example>
5853  *
5854  * This will create a resource bundle with the following files:
5855  * <programlisting><![CDATA[
5856  * /org/gtk/Example/data/splashscreen.png
5857  * /org/gtk/Example/dialog.ui
5858  * /org/gtk/Example/menumarkup.xml
5859  * ]]></programlisting>
5860  *
5861  * Note that all resources in the process share the same namespace, so use java-style
5862  * path prefixes (like in the above example) to avoid conflicts.
5863  *
5864  * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5865  * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5866  * --generate-header arguments to create a source file and header to link directly into your application.
5867  *
5868  * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5869  * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5870  * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5871  * the resource data.
5872  *
5873  * There are two forms of the generated source, the default version uses the compiler support for constructor
5874  * and destructor functions (where available) to automatically create and register the #GResource on startup
5875  * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5876  * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5877  * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5878  *
5879  * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5880  * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5881  * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5882  * is for your own resources, and resource data is often used once, during parsing, and then released.
5883  *
5884  * Since: 2.32
5885  */
5886
5887
5888 /**
5889  * SECTION:gseekable
5890  * @short_description: Stream seeking interface
5891  * @include: gio/gio.h
5892  * @see_also: #GInputStream, #GOutputStream
5893  *
5894  * #GSeekable is implemented by streams (implementations of
5895  * #GInputStream or #GOutputStream) that support seeking.
5896  */
5897
5898
5899 /**
5900  * SECTION:gsettings
5901  * @short_description: High-level API for application settings
5902  *
5903  * The #GSettings class provides a convenient API for storing and retrieving
5904  * application settings.
5905  *
5906  * Reads and writes can be considered to be non-blocking.  Reading
5907  * settings with #GSettings is typically extremely fast: on
5908  * approximately the same order of magnitude (but slower than) a
5909  * #GHashTable lookup.  Writing settings is also extremely fast in terms
5910  * of time to return to your application, but can be extremely expensive
5911  * for other threads and other processes.  Many settings backends
5912  * (including dconf) have lazy initialisation which means in the common
5913  * case of the user using their computer without modifying any settings
5914  * a lot of work can be avoided.  For dconf, the D-Bus service doesn't
5915  * even need to be started in this case.  For this reason, you should
5916  * only ever modify #GSettings keys in response to explicit user action.
5917  * Particular care should be paid to ensure that modifications are not
5918  * made during startup -- for example, when setting the initial value
5919  * of preferences widgets.  The built-in g_settings_bind() functionality
5920  * is careful not to write settings in response to notify signals as a
5921  * result of modifications that it makes to widgets.
5922  *
5923  * When creating a GSettings instance, you have to specify a schema
5924  * that describes the keys in your settings and their types and default
5925  * values, as well as some other information.
5926  *
5927  * Normally, a schema has as fixed path that determines where the settings
5928  * are stored in the conceptual global tree of settings. However, schemas
5929  * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5930  * useful e.g. when the schema describes an 'account', and you want to be
5931  * able to store a arbitrary number of accounts.
5932  *
5933  * Paths must start with and end with a forward slash character ('/')
5934  * and must not contain two sequential slash characters.  Paths should
5935  * be chosen based on a domain name associated with the program or
5936  * library to which the settings belong.  Examples of paths are
5937  * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5938  * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5939  * they often did in GConf.
5940  *
5941  * Unlike other configuration systems (like GConf), GSettings does not
5942  * restrict keys to basic types like strings and numbers. GSettings stores
5943  * values as #GVariant, and allows any #GVariantType for keys. Key names
5944  * are restricted to lowercase characters, numbers and '-'. Furthermore,
5945  * the names must begin with a lowercase character, must not end
5946  * with a '-', and must not contain consecutive dashes.
5947  *
5948  * Similar to GConf, the default values in GSettings schemas can be
5949  * localized, but the localized values are stored in gettext catalogs
5950  * and looked up with the domain that is specified in the
5951  * <tag class="attribute">gettext-domain</tag> attribute of the
5952  * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5953  * elements and the category that is specified in the l10n attribute of the
5954  * <tag class="starttag">key</tag> element.
5955  *
5956  * GSettings uses schemas in a compact binary form that is created
5957  * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5958  * utility. The input is a schema description in an XML format that can be
5959  * described by the following DTD:
5960  * |[<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>]|
5961  *
5962  * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5963  *
5964  * At runtime, schemas are identified by their id (as specified
5965  * in the <tag class="attribute">id</tag> attribute of the
5966  * <tag class="starttag">schema</tag> element). The
5967  * convention for schema ids is to use a dotted name, similar in
5968  * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5969  * if the settings are for a specific service that owns a D-Bus bus name,
5970  * the D-Bus bus name and schema id should match. For schemas which deal
5971  * with settings not associated with one named application, the id should
5972  * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5973  *
5974  * In addition to #GVariant types, keys can have types that have enumerated
5975  * types. These can be described by a <tag class="starttag">choice</tag>,
5976  * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5977  * <xref linkend="schema-enumerated"/>. The underlying type of
5978  * such a key is string, but you can use g_settings_get_enum(),
5979  * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5980  * access the numeric values corresponding to the string value of enum
5981  * and flags keys.
5982  *
5983  * <example id="schema-default-values"><title>Default values</title>
5984  * <programlisting><![CDATA[
5985  * <schemalist>
5986  *   <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5987  *
5988  *     <key name="greeting" type="s">
5989  *       <default l10n="messages">"Hello, earthlings"</default>
5990  *       <summary>A greeting</summary>
5991  *       <description>
5992  *         Greeting of the invading martians
5993  *       </description>
5994  *     </key>
5995  *
5996  *     <key name="box" type="(ii)">
5997  *       <default>(20,30)</default>
5998  *     </key>
5999  *
6000  *   </schema>
6001  * </schemalist>
6002  * ]]></programlisting></example>
6003  *
6004  * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
6005  * <programlisting><![CDATA[
6006  * <schemalist>
6007  *
6008  *   <enum id="org.gtk.Test.myenum">
6009  *     <value nick="first" value="1"/>
6010  *     <value nick="second" value="2"/>
6011  *   </enum>
6012  *
6013  *   <flags id="org.gtk.Test.myflags">
6014  *     <value nick="flag1" value="1"/>
6015  *     <value nick="flag2" value="2"/>
6016  *     <value nick="flag3" value="4"/>
6017  *   </flags>
6018  *
6019  *   <schema id="org.gtk.Test">
6020  *
6021  *     <key name="key-with-range" type="i">
6022  *       <range min="1" max="100"/>
6023  *       <default>10</default>
6024  *     </key>
6025  *
6026  *     <key name="key-with-choices" type="s">
6027  *       <choices>
6028  *         <choice value='Elisabeth'/>
6029  *         <choice value='Annabeth'/>
6030  *         <choice value='Joe'/>
6031  *       </choices>
6032  *       <aliases>
6033  *         <alias value='Anna' target='Annabeth'/>
6034  *         <alias value='Beth' target='Elisabeth'/>
6035  *       </aliases>
6036  *       <default>'Joe'</default>
6037  *     </key>
6038  *
6039  *     <key name='enumerated-key' enum='org.gtk.Test.myenum'>
6040  *       <default>'first'</default>
6041  *     </key>
6042  *
6043  *     <key name='flags-key' flags='org.gtk.Test.myflags'>
6044  *       <default>["flag1",flag2"]</default>
6045  *     </key>
6046  *   </schema>
6047  * </schemalist>
6048  * ]]></programlisting></example>
6049  *
6050  * <refsect2>
6051  *   <title>Vendor overrides</title>
6052  *   <para>
6053  *     Default values are defined in the schemas that get installed by
6054  *     an application. Sometimes, it is necessary for a vendor or distributor
6055  *     to adjust these defaults. Since patching the XML source for the schema
6056  *     is inconvenient and error-prone,
6057  *     <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6058  *     so-called 'vendor override' files. These are keyfiles in the same
6059  *     directory as the XML schema sources which can override default values.
6060  *     The schema id serves as the group name in the key file, and the values
6061  *     are expected in serialized GVariant form, as in the following example:
6062  *     <informalexample><programlisting>
6063  *     [org.gtk.Example]
6064  *     key1='string'
6065  *     key2=1.5
6066  *     </programlisting></informalexample>
6067  *   </para>
6068  *   <para>
6069  *     glib-compile-schemas expects schema files to have the extension
6070  *     <filename>.gschema.override</filename>
6071  *   </para>
6072  * </refsect2>
6073  *
6074  * <refsect2>
6075  *   <title>Binding</title>
6076  *   <para>
6077  *     A very convenient feature of GSettings lets you bind #GObject properties
6078  *     directly to settings, using g_settings_bind(). Once a GObject property
6079  *     has been bound to a setting, changes on either side are automatically
6080  *     propagated to the other side. GSettings handles details like
6081  *     mapping between GObject and GVariant types, and preventing infinite
6082  *     cycles.
6083  *   </para>
6084  *   <para>
6085  *     This makes it very easy to hook up a preferences dialog to the
6086  *     underlying settings. To make this even more convenient, GSettings
6087  *     looks for a boolean property with the name "sensitivity" and
6088  *     automatically binds it to the writability of the bound setting.
6089  *     If this 'magic' gets in the way, it can be suppressed with the
6090  *     #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6091  *   </para>
6092  * </refsect2>
6093  */
6094
6095
6096 /**
6097  * SECTION:gsettingsbackend
6098  * @title: GSettingsBackend
6099  * @short_description: Interface for settings backend implementations
6100  * @include: gio/gsettingsbackend.h
6101  * @see_also: #GSettings, #GIOExtensionPoint
6102  *
6103  * The #GSettingsBackend interface defines a generic interface for
6104  * non-strictly-typed data that is stored in a hierarchy. To implement
6105  * an alternative storage backend for #GSettings, you need to implement
6106  * the #GSettingsBackend interface and then make it implement the
6107  * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6108  *
6109  * The interface defines methods for reading and writing values, a
6110  * method for determining if writing of certain values will fail
6111  * (lockdown) and a change notification mechanism.
6112  *
6113  * The semantics of the interface are very precisely defined and
6114  * implementations must carefully adhere to the expectations of
6115  * callers that are documented on each of the interface methods.
6116  *
6117  * Some of the GSettingsBackend functions accept or return a #GTree.
6118  * These trees always have strings as keys and #GVariant as values.
6119  * g_settings_backend_create_tree() is a convenience function to create
6120  * suitable trees.
6121  *
6122  * <note><para>
6123  * The #GSettingsBackend API is exported to allow third-party
6124  * implementations, but does not carry the same stability guarantees
6125  * as the public GIO API. For this reason, you have to define the
6126  * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6127  * <filename>gio/gsettingsbackend.h</filename>
6128  * </para></note>
6129  */
6130
6131
6132 /**
6133  * SECTION:gsettingsschema
6134  * @short_description: introspecting and controlling the loading of GSettings schemas
6135  *
6136  * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6137  * mechanism for advanced control over the loading of schemas and a
6138  * mechanism for introspecting their content.
6139  *
6140  * Plugin loading systems that wish to provide plugins a way to access
6141  * settings face the problem of how to make the schemas for these
6142  * settings visible to GSettings.  Typically, a plugin will want to ship
6143  * the schema along with itself and it won't be installed into the
6144  * standard system directories for schemas.
6145  *
6146  * #GSettingsSchemaSource provides a mechanism for dealing with this by
6147  * allowing the creation of a new 'schema source' from which schemas can
6148  * be acquired.  This schema source can then become part of the metadata
6149  * associated with the plugin and queried whenever the plugin requires
6150  * access to some settings.
6151  *
6152  * Consider the following example:
6153  *
6154  * |[
6155  * typedef struct
6156  * {
6157  *    ...
6158  *    GSettingsSchemaSource *schema_source;
6159  *    ...
6160  * } Plugin;
6161  *
6162  * Plugin *
6163  * initialise_plugin (const gchar *dir)
6164  * {
6165  *   Plugin *plugin;
6166  *
6167  *   ...
6168  *
6169  *   plugin->schema_source =
6170  *     g_settings_new_schema_source_from_directory (dir,
6171  *       g_settings_schema_source_get_default (), FALSE, NULL);
6172  *
6173  *   ...
6174  *
6175  *   return plugin;
6176  * }
6177  *
6178  * ...
6179  *
6180  * GSettings *
6181  * plugin_get_settings (Plugin      *plugin,
6182  *                      const gchar *schema_id)
6183  * {
6184  *   GSettingsSchema *schema;
6185  *
6186  *   if (schema_id == NULL)
6187  *     schema_id = plugin->identifier;
6188  *
6189  *   schema = g_settings_schema_source_lookup (plugin->schema_source,
6190  *                                             schema_id, FALSE);
6191  *
6192  *   if (schema == NULL)
6193  *     {
6194  *       ... disable the plugin or abort, etc ...
6195  *     }
6196  *
6197  *   return g_settings_new_full (schema, NULL, NULL);
6198  * }
6199  * ]|
6200  *
6201  * The code above shows how hooks should be added to the code that
6202  * initialises (or enables) the plugin to create the schema source and
6203  * how an API can be added to the plugin system to provide a convenient
6204  * way for the plugin to access its settings, using the schemas that it
6205  * ships.
6206  *
6207  * From the standpoint of the plugin, it would need to ensure that it
6208  * ships a gschemas.compiled file as part of itself, and then simply do
6209  * the following:
6210  *
6211  * |[
6212  * {
6213  *   GSettings *settings;
6214  *   gint some_value;
6215  *
6216  *   settings = plugin_get_settings (self, NULL);
6217  *   some_value = g_settings_get_int (settings, "some-value");
6218  *   ...
6219  * }
6220  * ]|
6221  *
6222  * It's also possible that the plugin system expects the schema source
6223  * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6224  * In that case, the plugin loading system must compile the schemas for
6225  * itself before attempting to create the settings source.
6226  *
6227  * Since: 2.32
6228  */
6229
6230
6231 /**
6232  * SECTION:gsimpleaction
6233  * @title: GSimpleAction
6234  * @short_description: A simple GAction implementation
6235  *
6236  * A #GSimpleAction is the obvious simple implementation of the #GAction
6237  * interface. This is the easiest way to create an action for purposes of
6238  * adding it to a #GSimpleActionGroup.
6239  *
6240  * See also #GtkAction.
6241  */
6242
6243
6244 /**
6245  * SECTION:gsimpleactiongroup
6246  * @title: GSimpleActionGroup
6247  * @short_description: A simple GActionGroup implementation
6248  *
6249  * #GSimpleActionGroup is a hash table filled with #GAction objects,
6250  * implementing the #GActionGroup and #GActionMap interfaces.
6251  */
6252
6253
6254 /**
6255  * SECTION:gsimpleasyncresult
6256  * @short_description: Simple asynchronous results implementation
6257  * @include: gio/gio.h
6258  * @see_also: #GAsyncResult
6259  *
6260  * <note><para>
6261  *   As of GLib 2.36, #GSimpleAsyncResult is deprecated in favor of
6262  *   #GTask, which provides a simpler API.
6263  * </para></note>
6264  *
6265  * #GSimpleAsyncResult implements #GAsyncResult.
6266  *
6267  * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6268  * reporting, operation cancellation and the final state of an operation,
6269  * completely transparent to the application. Results can be returned
6270  * as a pointer e.g. for functions that return data that is collected
6271  * asynchronously, a boolean value for checking the success or failure
6272  * of an operation, or a #gssize for operations which return the number
6273  * of bytes modified by the operation; all of the simple return cases
6274  * are covered.
6275  *
6276  * Most of the time, an application will not need to know of the details
6277  * of this API; it is handled transparently, and any necessary operations
6278  * are handled by #GAsyncResult's interface. However, if implementing a
6279  * new GIO module, for writing language bindings, or for complex
6280  * applications that need better control of how asynchronous operations
6281  * are completed, it is important to understand this functionality.
6282  *
6283  * GSimpleAsyncResults are tagged with the calling function to ensure
6284  * that asynchronous functions and their finishing functions are used
6285  * together correctly.
6286  *
6287  * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6288  * If the result needs to be created for a #GError, use
6289  * g_simple_async_result_new_from_error() or
6290  * g_simple_async_result_new_take_error(). If a #GError is not available
6291  * (e.g. the asynchronous operation's doesn't take a #GError argument),
6292  * but the result still needs to be created for an error condition, use
6293  * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6294  * if your application or binding requires passing a variable argument list
6295  * directly), and the error can then be propagated through the use of
6296  * g_simple_async_result_propagate_error().
6297  *
6298  * An asynchronous operation can be made to ignore a cancellation event by
6299  * calling g_simple_async_result_set_handle_cancellation() with a
6300  * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6301  * operations that are dangerous to cancel, such as close (which would
6302  * cause a leak if cancelled before being run).
6303  *
6304  * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6305  * or it can use #GThread<!-- -->s.
6306  * g_simple_async_result_complete() will finish an I/O task directly
6307  * from the point where it is called. g_simple_async_result_complete_in_idle()
6308  * will finish it from an idle handler in the <link
6309  * linkend="g-main-context-push-thread-default">thread-default main
6310  * context</link>. g_simple_async_result_run_in_thread() will run the
6311  * job in a separate thread and then deliver the result to the
6312  * thread-default main context.
6313  *
6314  * To set the results of an asynchronous function,
6315  * g_simple_async_result_set_op_res_gpointer(),
6316  * g_simple_async_result_set_op_res_gboolean(), and
6317  * g_simple_async_result_set_op_res_gssize()
6318  * are provided, setting the operation's result to a gpointer, gboolean, or
6319  * gssize, respectively.
6320  *
6321  * Likewise, to get the result of an asynchronous function,
6322  * g_simple_async_result_get_op_res_gpointer(),
6323  * g_simple_async_result_get_op_res_gboolean(), and
6324  * g_simple_async_result_get_op_res_gssize() are
6325  * provided, getting the operation's result as a gpointer, gboolean, and
6326  * gssize, respectively.
6327  *
6328  * For the details of the requirements implementations must respect, see
6329  * #GAsyncResult.  A typical implementation of an asynchronous operation
6330  * using GSimpleAsyncResult looks something like this:
6331  *
6332  * |[
6333  * static void
6334  * baked_cb (Cake    *cake,
6335  *           gpointer user_data)
6336  * {
6337  *   /&ast; In this example, this callback is not given a reference to the cake, so
6338  *    &ast; the GSimpleAsyncResult has to take a reference to it.
6339  *    &ast;/
6340  *   GSimpleAsyncResult *result = user_data;
6341  *
6342  *   if (cake == NULL)
6343  *     g_simple_async_result_set_error (result,
6344  *                                      BAKER_ERRORS,
6345  *                                      BAKER_ERROR_NO_FLOUR,
6346  *                                      "Go to the supermarket");
6347  *   else
6348  *     g_simple_async_result_set_op_res_gpointer (result,
6349  *                                                g_object_ref (cake),
6350  *                                                g_object_unref);
6351  *
6352  *
6353  *   /&ast; In this example, we assume that baked_cb is called as a callback from
6354  *    &ast; the mainloop, so it's safe to complete the operation synchronously here.
6355  *    &ast; If, however, _baker_prepare_cake () might call its callback without
6356  *    &ast; first returning to the mainloop â€” inadvisable, but some APIs do so â€”
6357  *    &ast; we would need to use g_simple_async_result_complete_in_idle().
6358  *    &ast;/
6359  *   g_simple_async_result_complete (result);
6360  *   g_object_unref (result);
6361  * }
6362  *
6363  * void
6364  * baker_bake_cake_async (Baker              *self,
6365  *                        guint               radius,
6366  *                        GAsyncReadyCallback callback,
6367  *                        gpointer            user_data)
6368  * {
6369  *   GSimpleAsyncResult *simple;
6370  *   Cake               *cake;
6371  *
6372  *   if (radius < 3)
6373  *     {
6374  *       g_simple_async_report_error_in_idle (G_OBJECT (self),
6375  *                                            callback,
6376  *                                            user_data,
6377  *                                            BAKER_ERRORS,
6378  *                                            BAKER_ERROR_TOO_SMALL,
6379  *                                            "%ucm radius cakes are silly",
6380  *                                            radius);
6381  *       return;
6382  *     }
6383  *
6384  *   simple = g_simple_async_result_new (G_OBJECT (self),
6385  *                                       callback,
6386  *                                       user_data,
6387  *                                       baker_bake_cake_async);
6388  *   cake = _baker_get_cached_cake (self, radius);
6389  *
6390  *   if (cake != NULL)
6391  *     {
6392  *       g_simple_async_result_set_op_res_gpointer (simple,
6393  *                                                  g_object_ref (cake),
6394  *                                                  g_object_unref);
6395  *       g_simple_async_result_complete_in_idle (simple);
6396  *       g_object_unref (simple);
6397  *       /&ast; Drop the reference returned by _baker_get_cached_cake(); the
6398  *        &ast; GSimpleAsyncResult has taken its own reference.
6399  *        &ast;/
6400  *       g_object_unref (cake);
6401  *       return;
6402  *     }
6403  *
6404  *   _baker_prepare_cake (self, radius, baked_cb, simple);
6405  * }
6406  *
6407  * Cake *
6408  * baker_bake_cake_finish (Baker        *self,
6409  *                         GAsyncResult *result,
6410  *                         GError      **error)
6411  * {
6412  *   GSimpleAsyncResult *simple;
6413  *   Cake               *cake;
6414  *
6415  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
6416  *                                                         G_OBJECT (self),
6417  *                                                         baker_bake_cake_async),
6418  *                         NULL);
6419  *
6420  *   simple = (GSimpleAsyncResult *) result;
6421  *
6422  *   if (g_simple_async_result_propagate_error (simple, error))
6423  *     return NULL;
6424  *
6425  *   cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6426  *   return g_object_ref (cake);
6427  * }
6428  * ]|
6429  */
6430
6431
6432 /**
6433  * SECTION:gsimplepermission
6434  * @title: GSimplePermission
6435  * @short_description: A GPermission that doesn't change value
6436  *
6437  * #GSimplePermission is a trivial implementation of #GPermission that
6438  * represents a permission that is either always or never allowed.  The
6439  * value is given at construction and doesn't change.
6440  *
6441  * Calling request or release will result in errors.
6442  */
6443
6444
6445 /**
6446  * SECTION:gsocket
6447  * @short_description: Low-level socket object
6448  * @include: gio/gio.h
6449  * @see_also: #GInitable
6450  *
6451  * A #GSocket is a low-level networking primitive. It is a more or less
6452  * direct mapping of the BSD socket API in a portable GObject based API.
6453  * It supports both the UNIX socket implementations and winsock2 on Windows.
6454  *
6455  * #GSocket is the platform independent base upon which the higher level
6456  * network primitives are based. Applications are not typically meant to
6457  * use it directly, but rather through classes like #GSocketClient,
6458  * #GSocketService and #GSocketConnection. However there may be cases where
6459  * direct use of #GSocket is useful.
6460  *
6461  * #GSocket implements the #GInitable interface, so if it is manually constructed
6462  * by e.g. g_object_new() you must call g_initable_init() and check the
6463  * results before using the object. This is done automatically in
6464  * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6465  * %NULL.
6466  *
6467  * Sockets operate in two general modes, blocking or non-blocking. When
6468  * in blocking mode all operations block until the requested operation
6469  * is finished or there is an error. In non-blocking mode all calls that
6470  * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6471  * To know when a call would successfully run you can call g_socket_condition_check(),
6472  * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6473  * attach it to a #GMainContext to get callbacks when I/O is possible.
6474  * Note that all sockets are always set to non blocking mode in the system, and
6475  * blocking mode is emulated in GSocket.
6476  *
6477  * When working in non-blocking mode applications should always be able to
6478  * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6479  * function said that I/O was possible. This can easily happen in case
6480  * of a race condition in the application, but it can also happen for other
6481  * reasons. For instance, on Windows a socket is always seen as writable
6482  * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6483  *
6484  * #GSocket<!-- -->s can be either connection oriented or datagram based.
6485  * For connection oriented types you must first establish a connection by
6486  * either connecting to an address or accepting a connection from another
6487  * address. For connectionless socket types the target/source address is
6488  * specified or received in each I/O operation.
6489  *
6490  * All socket file descriptors are set to be close-on-exec.
6491  *
6492  * Note that creating a #GSocket causes the signal %SIGPIPE to be
6493  * ignored for the remainder of the program. If you are writing a
6494  * command-line utility that uses #GSocket, you may need to take into
6495  * account the fact that your program will not automatically be killed
6496  * if it tries to write to %stdout after it has been closed.
6497  *
6498  * Since: 2.22
6499  */
6500
6501
6502 /**
6503  * SECTION:gsocketaddress
6504  * @short_description: Abstract base class representing endpoints for socket communication
6505  *
6506  * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6507  * in the BSD sockets API. This is an abstract class; use
6508  * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6509  * for UNIX domain sockets.
6510  */
6511
6512
6513 /**
6514  * SECTION:gsocketclient
6515  * @short_description: Helper for connecting to a network service
6516  * @include: gio/gio.h
6517  * @see_also: #GSocketConnection, #GSocketListener
6518  *
6519  * #GSocketClient is a lightweight high-level utility class for connecting to
6520  * a network host using a connection oriented socket type.
6521  *
6522  * You create a #GSocketClient object, set any options you want, and then
6523  * call a sync or async connect operation, which returns a #GSocketConnection
6524  * subclass on success.
6525  *
6526  * The type of the #GSocketConnection object returned depends on the type of
6527  * the underlying socket that is in use. For instance, for a TCP/IP connection
6528  * it will be a #GTcpConnection.
6529  *
6530  * As #GSocketClient is a lightweight object, you don't need to cache it. You
6531  * can just create a new one any time you need one.
6532  *
6533  * Since: 2.22
6534  */
6535
6536
6537 /**
6538  * SECTION:gsocketconnectable
6539  * @short_description: Interface for potential socket endpoints
6540  *
6541  * Objects that describe one or more potential socket endpoints
6542  * implement #GSocketConnectable. Callers can then use
6543  * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6544  * to try out each socket address in turn until one succeeds, as shown
6545  * in the sample code below.
6546  *
6547  * |[
6548  * MyConnectionType *
6549  * connect_to_host (const char    *hostname,
6550  *                  guint16        port,
6551  *                  GCancellable  *cancellable,
6552  *                  GError       **error)
6553  * {
6554  *   MyConnection *conn = NULL;
6555  *   GSocketConnectable *addr;
6556  *   GSocketAddressEnumerator *enumerator;
6557  *   GSocketAddress *sockaddr;
6558  *   GError *conn_error = NULL;
6559  *
6560  *   addr = g_network_address_new ("www.gnome.org", 80);
6561  *   enumerator = g_socket_connectable_enumerate (addr);
6562  *   g_object_unref (addr);
6563  *
6564  *   /<!-- -->* Try each sockaddr until we succeed. Record the first
6565  *    * connection error, but not any further ones (since they'll probably
6566  *    * be basically the same as the first).
6567  *    *<!-- -->/
6568  *   while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6569  *     {
6570  *       conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6571  *       g_object_unref (sockaddr);
6572  *     }
6573  *   g_object_unref (enumerator);
6574  *
6575  *   if (conn)
6576  *     {
6577  *       if (conn_error)
6578  *         {
6579  *           /<!-- -->* We couldn't connect to the first address, but we succeeded
6580  *            * in connecting to a later address.
6581  *            *<!-- -->/
6582  *           g_error_free (conn_error);
6583  *         }
6584  *       return conn;
6585  *     }
6586  *   else if (error)
6587  *     {
6588  *       /<!-- -->* Either the initial lookup failed, or else the caller
6589  *        * cancelled us.
6590  *        *<!-- -->/
6591  *       if (conn_error)
6592  *         g_error_free (conn_error);
6593  *       return NULL;
6594  *     }
6595  *   else
6596  *     {
6597  *       g_error_propagate (error, conn_error);
6598  *       return NULL;
6599  *     }
6600  * }
6601  * ]|
6602  */
6603
6604
6605 /**
6606  * SECTION:gsocketconnection
6607  * @short_description: A socket connection
6608  * @include: gio/gio.h
6609  * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6610  *
6611  * #GSocketConnection is a #GIOStream for a connected socket. They
6612  * can be created either by #GSocketClient when connecting to a host,
6613  * or by #GSocketListener when accepting a new client.
6614  *
6615  * The type of the #GSocketConnection object returned from these calls
6616  * depends on the type of the underlying socket that is in use. For
6617  * instance, for a TCP/IP connection it will be a #GTcpConnection.
6618  *
6619  * Choosing what type of object to construct is done with the socket
6620  * connection factory, and it is possible for 3rd parties to register
6621  * custom socket connection types for specific combination of socket
6622  * family/type/protocol using g_socket_connection_factory_register_type().
6623  *
6624  * Since: 2.22
6625  */
6626
6627
6628 /**
6629  * SECTION:gsocketcontrolmessage
6630  * @title: GSocketControlMessage
6631  * @short_description: A GSocket control message
6632  * @see_also: #GSocket.
6633  *
6634  * A #GSocketControlMessage is a special-purpose utility message that
6635  * can be sent to or received from a #GSocket. These types of
6636  * messages are often called "ancillary data".
6637  *
6638  * The message can represent some sort of special instruction to or
6639  * information from the socket or can represent a special kind of
6640  * transfer to the peer (for example, sending a file description over
6641  * a UNIX socket).
6642  *
6643  * These messages are sent with g_socket_send_message() and received
6644  * with g_socket_receive_message().
6645  *
6646  * To extend the set of control message that can be sent, subclass this
6647  * class and override the get_size, get_level, get_type and serialize
6648  * methods.
6649  *
6650  * To extend the set of control messages that can be received, subclass
6651  * this class and implement the deserialize method. Also, make sure your
6652  * class is registered with the GType typesystem before calling
6653  * g_socket_receive_message() to read such a message.
6654  *
6655  * Since: 2.22
6656  */
6657
6658
6659 /**
6660  * SECTION:gsocketlistener
6661  * @title: GSocketListener
6662  * @short_description: Helper for accepting network client connections
6663  * @see_also: #GThreadedSocketService, #GSocketService.
6664  *
6665  * A #GSocketListener is an object that keeps track of a set
6666  * of server sockets and helps you accept sockets from any of the
6667  * socket, either sync or async.
6668  *
6669  * If you want to implement a network server, also look at #GSocketService
6670  * and #GThreadedSocketService which are subclass of #GSocketListener
6671  * that makes this even easier.
6672  *
6673  * Since: 2.22
6674  */
6675
6676
6677 /**
6678  * SECTION:gsocketservice
6679  * @title: GSocketService
6680  * @short_description: Make it easy to implement a network service
6681  * @see_also: #GThreadedSocketService, #GSocketListener.
6682  *
6683  * A #GSocketService is an object that represents a service that
6684  * is provided to the network or over local sockets.  When a new
6685  * connection is made to the service the #GSocketService::incoming
6686  * signal is emitted.
6687  *
6688  * A #GSocketService is a subclass of #GSocketListener and you need
6689  * to add the addresses you want to accept connections on with the
6690  * #GSocketListener APIs.
6691  *
6692  * There are two options for implementing a network service based on
6693  * #GSocketService. The first is to create the service using
6694  * g_socket_service_new() and to connect to the #GSocketService::incoming
6695  * signal. The second is to subclass #GSocketService and override the
6696  * default signal handler implementation.
6697  *
6698  * In either case, the handler must immediately return, or else it
6699  * will block additional incoming connections from being serviced.
6700  * If you are interested in writing connection handlers that contain
6701  * blocking code then see #GThreadedSocketService.
6702  *
6703  * The socket service runs on the main loop of the <link
6704  * linkend="g-main-context-push-thread-default-context">thread-default
6705  * context</link> of the thread it is created in, and is not
6706  * threadsafe in general. However, the calls to start and stop the
6707  * service are thread-safe so these can be used from threads that
6708  * handle incoming clients.
6709  *
6710  * Since: 2.22
6711  */
6712
6713
6714 /**
6715  * SECTION:gsrvtarget
6716  * @short_description: DNS SRV record target
6717  * @include: gio/gio.h
6718  *
6719  * SRV (service) records are used by some network protocols to provide
6720  * service-specific aliasing and load-balancing. For example, XMPP
6721  * (Jabber) uses SRV records to locate the XMPP server for a domain;
6722  * rather than connecting directly to "example.com" or assuming a
6723  * specific server hostname like "xmpp.example.com", an XMPP client
6724  * would look up the "xmpp-client" SRV record for "example.com", and
6725  * then connect to whatever host was pointed to by that record.
6726  *
6727  * You can use g_resolver_lookup_service() or
6728  * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6729  * for a given service. However, if you are simply planning to connect
6730  * to the remote service, you can use #GNetworkService's
6731  * #GSocketConnectable interface and not need to worry about
6732  * #GSrvTarget at all.
6733  */
6734
6735
6736 /**
6737  * SECTION:gtask
6738  * @short_description: Cancellable synchronous or asynchronous task and result
6739  * @include: gio/gio.h
6740  * @see_also: #GAsyncResult
6741  *
6742  * <para>
6743  *   A #GTask represents and manages a cancellable "task".
6744  * </para>
6745  * <refsect2>
6746  *   <title>Asynchronous operations</title>
6747  *   <para>
6748  *     The most common usage of #GTask is as a #GAsyncResult, to
6749  *     manage data during an asynchronous operation. You call
6750  *     g_task_new() in the "start" method, followed by
6751  *     g_task_set_task_data() and the like if you need to keep some
6752  *     additional data associated with the task, and then pass the
6753  *     task object around through your asynchronous operation.
6754  *     Eventually, you will call a method such as
6755  *     g_task_return_pointer() or g_task_return_error(), which will
6756  *     save the value you give it and then invoke the task's callback
6757  *     function (waiting until the next next iteration of the main
6758  *     loop first, if necessary). The caller will pass the #GTask back
6759  *     to the operation's finish function (as a #GAsyncResult), and
6760  *     you can use g_task_propagate_pointer() or the like to extract
6761  *     the return value.
6762  *   </para>
6763  *   <example id="gtask-async"><title>GTask as a GAsyncResult</title>
6764  *   <programlisting>
6765  *     typedef struct {
6766  *       CakeFrostingType frosting;
6767  *       char *message;
6768  *     } DecorationData;
6769  *
6770  *     static void
6771  *     decoration_data_free (DecorationData *decoration)
6772  *     {
6773  *       g_free (decoration->message);
6774  *       g_slice_free (DecorationData, decoration);
6775  *     }
6776  *
6777  *     static void
6778  *     baked_cb (Cake     *cake,
6779  *               gpointer  user_data)
6780  *     {
6781  *       GTask *task = user_data;
6782  *       DecorationData *decoration = g_task_get_task_data (task);
6783  *       GError *error = NULL;
6784  *
6785  *       if (cake == NULL)
6786  *         {
6787  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6788  *                                    "Go to the supermarket");
6789  *           g_object_unref (task);
6790  *           return;
6791  *         }
6792  *
6793  *       if (!cake_decorate (cake, decoration->frosting, decoration->message, &error))
6794  *         {
6795  *           g_object_unref (cake);
6796  *           /&ast; g_task_return_error() takes ownership of error &ast;/
6797  *           g_task_return_error (task, error);
6798  *           g_object_unref (task);
6799  *           return;
6800  *         }
6801  *
6802  *       g_task_return_pointer (result, cake, g_object_unref);
6803  *       g_object_unref (task);
6804  *     }
6805  *
6806  *     void
6807  *     baker_bake_cake_async (Baker               *self,
6808  *                            guint                radius,
6809  *                            CakeFlavor           flavor,
6810  *                            CakeFrostingType     frosting,
6811  *                            const char          *message,
6812  *                            GCancellable        *cancellable,
6813  *                            GAsyncReadyCallback  callback,
6814  *                            gpointer             user_data)
6815  *     {
6816  *       GTask *task;
6817  *       DecorationData *decoration;
6818  *       Cake  *cake;
6819  *
6820  *       task = g_task_new (self, cancellable, callback, user_data);
6821  *       if (radius < 3)
6822  *         {
6823  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_TOO_SMALL,
6824  *                                    "%ucm radius cakes are silly",
6825  *                                    radius);
6826  *           g_object_unref (task);
6827  *           return;
6828  *         }
6829  *
6830  *       cake = _baker_get_cached_cake (self, radius, flavor, frosting, message);
6831  *       if (cake != NULL)
6832  *         {
6833  *           /&ast; _baker_get_cached_cake() returns a reffed cake &ast;/
6834  *           g_task_return_pointer (task, cake, g_object_unref);
6835  *           g_object_unref (task);
6836  *           return;
6837  *         }
6838  *
6839  *       decoration = g_slice_new (DecorationData);
6840  *       decoration->frosting = frosting;
6841  *       decoration->message = g_strdup (message);
6842  *       g_task_set_task_data (task, decoration, (GDestroyNotify) decoration_data_free);
6843  *
6844  *       _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6845  *     }
6846  *
6847  *     Cake *
6848  *     baker_bake_cake_finish (Baker         *self,
6849  *                             GAsyncResult  *result,
6850  *                             GError       **error)
6851  *     {
6852  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6853  *
6854  *       return g_task_propagate_pointer (G_TASK (result), error);
6855  *     }
6856  *   </programlisting>
6857  *   </example>
6858  * </refsect2>
6859  * <refsect2>
6860  *   <title>Chained asynchronous operations</title>
6861  *   <para>
6862  *     #GTask also tries to simplify asynchronous operations that
6863  *     internally chain together several smaller asynchronous
6864  *     operations. g_task_get_cancellable(), g_task_get_context(), and
6865  *     g_task_get_priority() allow you to get back the task's
6866  *     #GCancellable, #GMainContext, and <link
6867  *     linkend="io-priority">I/O priority</link> when starting a new
6868  *     subtask, so you don't have to keep track of them yourself.
6869  *     g_task_attach_source() simplifies the case of waiting for a
6870  *     source to fire (automatically using the correct #GMainContext
6871  *     and priority).
6872  *   </para>
6873  *   <example id="gtask-chained"><title>Chained asynchronous operations</title>
6874  *   <programlisting>
6875  *     typedef struct {
6876  *       Cake *cake;
6877  *       CakeFrostingType frosting;
6878  *       char *message;
6879  *     } BakingData;
6880  *
6881  *     static void
6882  *     decoration_data_free (BakingData *bd)
6883  *     {
6884  *       if (bd->cake)
6885  *         g_object_unref (bd->cake);
6886  *       g_free (bd->message);
6887  *       g_slice_free (BakingData, bd);
6888  *     }
6889  *
6890  *     static void
6891  *     decorated_cb (Cake         *cake,
6892  *                   GAsyncResult *result,
6893  *                   gpointer      user_data)
6894  *     {
6895  *       GTask *task = user_data;
6896  *       GError *error = NULL;
6897  *
6898  *       if (!cake_decorate_finish (cake, result, &error))
6899  *         {
6900  *           g_object_unref (cake);
6901  *           g_task_return_error (task, error);
6902  *           g_object_unref (task);
6903  *           return;
6904  *         }
6905  *
6906  *       /&ast; baking_data_free() will drop its ref on the cake, so
6907  *        &ast; we have to take another here to give to the caller.
6908  *        &ast;/
6909  *       g_task_return_pointer (result, g_object_ref (cake), g_object_unref);
6910  *       g_object_unref (task);
6911  *     }
6912  *
6913  *     static void
6914  *     decorator_ready (gpointer user_data)
6915  *     {
6916  *       GTask *task = user_data;
6917  *       BakingData *bd = g_task_get_task_data (task);
6918  *
6919  *       cake_decorate_async (bd->cake, bd->frosting, bd->message,
6920  *                            g_task_get_cancellable (task),
6921  *                            decorated_cb, task);
6922  *     }
6923  *
6924  *     static void
6925  *     baked_cb (Cake     *cake,
6926  *               gpointer  user_data)
6927  *     {
6928  *       GTask *task = user_data;
6929  *       BakingData *bd = g_task_get_task_data (task);
6930  *       GError *error = NULL;
6931  *
6932  *       if (cake == NULL)
6933  *         {
6934  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6935  *                                    "Go to the supermarket");
6936  *           g_object_unref (task);
6937  *           return;
6938  *         }
6939  *
6940  *       bd->cake = cake;
6941  *
6942  *       /&ast; Bail out now if the user has already cancelled &ast;/
6943  *       if (g_task_return_error_if_cancelled (g_task_get_cancellable (task)))
6944  *         {
6945  *           g_object_unref (task);
6946  *           return;
6947  *         }
6948  *
6949  *       if (cake_decorator_available (cake))
6950  *         decorator_ready (task);
6951  *       else
6952  *         {
6953  *           GSource *source;
6954  *
6955  *           source = cake_decorator_wait_source_new (cake);
6956  *           /&ast; Attach @source to @task's GMainContext and have it call
6957  *            &ast; decorator_ready() when it is ready.
6958  *            &ast;/
6959  *           g_task_attach_source (task, source,
6960  *                                 G_CALLBACK (decorator_ready));
6961  *           g_source_unref (source);
6962  *         }
6963  *     }
6964  *
6965  *     void
6966  *     baker_bake_cake_async (Baker               *self,
6967  *                            guint                radius,
6968  *                            CakeFlavor           flavor,
6969  *                            CakeFrostingType     frosting,
6970  *                            const char          *message,
6971  *                            gint                 priority,
6972  *                            GCancellable        *cancellable,
6973  *                            GAsyncReadyCallback  callback,
6974  *                            gpointer             user_data)
6975  *     {
6976  *       GTask *task;
6977  *       BakingData *bd;
6978  *
6979  *       task = g_task_new (self, cancellable, callback, user_data);
6980  *       g_task_set_priority (task, priority);
6981  *
6982  *       bd = g_slice_new0 (BakingData);
6983  *       bd->frosting = frosting;
6984  *       bd->message = g_strdup (message);
6985  *       g_task_set_task_data (task, bd, (GDestroyNotify) baking_data_free);
6986  *
6987  *       _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6988  *     }
6989  *
6990  *     Cake *
6991  *     baker_bake_cake_finish (Baker         *self,
6992  *                             GAsyncResult  *result,
6993  *                             GError       **error)
6994  *     {
6995  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6996  *
6997  *       return g_task_propagate_pointer (G_TASK (result), error);
6998  *     }
6999  *   </programlisting>
7000  *   </example>
7001  * </refsect2>
7002  * <refsect2>
7003  *   <title>Asynchronous operations from synchronous ones</title>
7004  *   <para>
7005  *     You can use g_task_run_in_thread() to turn a synchronous
7006  *     operation into an asynchronous one, by running it in a thread
7007  *     which will then dispatch the result back to the caller's
7008  *     #GMainContext when it completes.
7009  *   </para>
7010  *   <example id="gtask-run-in-thread"><title>g_task_run_in_thread()</title>
7011  *   <programlisting>
7012  *     typedef struct {
7013  *       guint radius;
7014  *       CakeFlavor flavor;
7015  *       CakeFrostingType frosting;
7016  *       char *message;
7017  *     } CakeData;
7018  *
7019  *     static void
7020  *     cake_data_free (CakeData *cake_data)
7021  *     {
7022  *       g_free (cake_data->message);
7023  *       g_slice_free (CakeData, cake_data);
7024  *     }
7025  *
7026  *     static void
7027  *     bake_cake_thread (GTask         *task,
7028  *                       gpointer       source_object,
7029  *                       gpointer       task_data,
7030  *                       GCancellable  *cancellable)
7031  *     {
7032  *       Baker *self = source_object;
7033  *       CakeData *cake_data = task_data;
7034  *       Cake *cake;
7035  *       GError *error = NULL;
7036  *
7037  *       cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7038  *                         cake_data->frosting, cake_data->message,
7039  *                         cancellable, &error);
7040  *       if (cake)
7041  *         g_task_return_pointer (task, cake, g_object_unref);
7042  *       else
7043  *         g_task_return_error (task, error);
7044  *     }
7045  *
7046  *     void
7047  *     baker_bake_cake_async (Baker               *self,
7048  *                            guint                radius,
7049  *                            CakeFlavor           flavor,
7050  *                            CakeFrostingType     frosting,
7051  *                            const char          *message,
7052  *                            GCancellable        *cancellable,
7053  *                            GAsyncReadyCallback  callback,
7054  *                            gpointer             user_data)
7055  *     {
7056  *       CakeData *cake_data;
7057  *       GTask *task;
7058  *
7059  *       cake_data = g_slice_new (CakeData);
7060  *       cake_data->radius = radius;
7061  *       cake_data->flavor = flavor;
7062  *       cake_data->frosting = frosting;
7063  *       cake_data->message = g_strdup (message);
7064  *       task = g_task_new (self, cancellable, callback, user_data);
7065  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7066  *       g_task_run_in_thread (task, bake_cake_thread);
7067  *     }
7068  *
7069  *     Cake *
7070  *     baker_bake_cake_finish (Baker         *self,
7071  *                             GAsyncResult  *result,
7072  *                             GError       **error)
7073  *     {
7074  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7075  *
7076  *       return g_task_propagate_pointer (G_TASK (result), error);
7077  *     }
7078  *   </programlisting>
7079  *   </example>
7080  * </refsect2>
7081  * <refsect2>
7082  *   <title>Adding cancellability to uncancellable tasks</title>
7083  *   <para>
7084  *     Finally, g_task_run_in_thread() and g_task_run_in_thread_sync()
7085  *     can be used to turn an uncancellable operation into a
7086  *     cancellable one. If you call g_task_set_return_on_cancel(),
7087  *     passing %TRUE, then if the task's #GCancellable is cancelled,
7088  *     it will return control back to the caller immediately, while
7089  *     allowing the task thread to continue running in the background
7090  *     (and simply discarding its result when it finally does finish).
7091  *     Provided that the task thread is careful about how it uses
7092  *     locks and other externally-visible resources, this allows you
7093  *     to make "GLib-friendly" asynchronous and cancellable
7094  *     synchronous variants of blocking APIs.
7095  *   </para>
7096  *   <example id="gtask-cancellable"><title>g_task_set_return_on_cancel()</title>
7097  *   <programlisting>
7098  *     static void
7099  *     bake_cake_thread (GTask         *task,
7100  *                       gpointer       source_object,
7101  *                       gpointer       task_data,
7102  *                       GCancellable  *cancellable)
7103  *     {
7104  *       Baker *self = source_object;
7105  *       CakeData *cake_data = task_data;
7106  *       Cake *cake;
7107  *       GError *error = NULL;
7108  *
7109  *       cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7110  *                         cake_data->frosting, cake_data->message,
7111  *                         &error);
7112  *       if (error)
7113  *         {
7114  *           g_task_return_error (task, error);
7115  *           return;
7116  *         }
7117  *
7118  *       /&ast; If the task has already been cancelled, then we don't
7119  *        &ast; want to add the cake to the cake cache. Likewise, we don't
7120  *        &ast; want to have the task get cancelled in the middle of
7121  *        &ast; updating the cache. g_task_set_return_on_cancel() will
7122  *        &ast; return %TRUE here if it managed to disable return-on-cancel,
7123  *        &ast; or %FALSE if the task was cancelled before it could.
7124  *        &ast;/
7125  *       if (g_task_set_return_on_cancel (task, FALSE))
7126  *         {
7127  *           /&ast; If the caller cancels at this point, their
7128  *            &ast; GAsyncReadyCallback won't be invoked until we return,
7129  *            &ast; so we don't have to worry that this code will run at
7130  *            &ast; the same time as that code does. But if there were
7131  *            &ast; other functions that might look at the cake cache,
7132  *            &ast; then we'd probably need a GMutex here as well.
7133  *            &ast;/
7134  *           baker_add_cake_to_cache (baker, cake);
7135  *           g_task_return_pointer (task, cake, g_object_unref);
7136  *         }
7137  *     }
7138  *
7139  *     void
7140  *     baker_bake_cake_async (Baker               *self,
7141  *                            guint                radius,
7142  *                            CakeFlavor           flavor,
7143  *                            CakeFrostingType     frosting,
7144  *                            const char          *message,
7145  *                            GCancellable        *cancellable,
7146  *                            GAsyncReadyCallback  callback,
7147  *                            gpointer             user_data)
7148  *     {
7149  *       CakeData *cake_data;
7150  *       GTask *task;
7151  *
7152  *       cake_data = g_slice_new (CakeData);
7153  *       /&ast; ... &ast;/
7154  *
7155  *       task = g_task_new (self, cancellable, callback, user_data);
7156  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7157  *       g_task_set_return_on_cancel (task, TRUE);
7158  *       g_task_run_in_thread (task, bake_cake_thread);
7159  *     }
7160  *
7161  *     Cake *
7162  *     baker_bake_cake_sync (Baker               *self,
7163  *                           guint                radius,
7164  *                           CakeFlavor           flavor,
7165  *                           CakeFrostingType     frosting,
7166  *                           const char          *message,
7167  *                           GCancellable        *cancellable,
7168  *                           GError             **error)
7169  *     {
7170  *       CakeData *cake_data;
7171  *       GTask *task;
7172  *       Cake *cake;
7173  *
7174  *       cake_data = g_slice_new (CakeData);
7175  *       /&ast; ... &ast;/
7176  *
7177  *       task = g_task_new (self, cancellable, NULL, NULL);
7178  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7179  *       g_task_set_return_on_cancel (task, TRUE);
7180  *       g_task_run_in_thread_sync (task, bake_cake_thread);
7181  *
7182  *       cake = g_task_propagate_pointer (task, error);
7183  *       g_object_unref (task);
7184  *       return cake;
7185  *     }
7186  *   </programlisting>
7187  *   </example>
7188  * </refsect2>
7189  * <refsect2>
7190  *   <title>Porting from <literal>GSimpleAsyncResult</literal></title>
7191  *   <para>
7192  *     #GTask's API attempts to be simpler than #GSimpleAsyncResult's
7193  *     in several ways:
7194  *   </para>
7195  *   <itemizedlist>
7196  *     <listitem><para>
7197  *       You can save task-specific data with g_task_set_task_data(), and
7198  *       retrieve it later with g_task_get_task_data(). This replaces the
7199  *       abuse of g_simple_async_result_set_op_res_gpointer() for the same
7200  *       purpose with #GSimpleAsyncResult.
7201  *     </para></listitem>
7202  *     <listitem><para>
7203  *       In addition to the task data, #GTask also keeps track of the
7204  *       <link linkend="io-priority">priority</link>, #GCancellable, and
7205  *       #GMainContext associated with the task, so tasks that consist of
7206  *       a chain of simpler asynchronous operations will have easy access
7207  *       to those values when starting each sub-task.
7208  *     </para></listitem>
7209  *     <listitem><para>
7210  *       g_task_return_error_if_cancelled() provides simplified
7211  *       handling for cancellation. In addition, cancellation
7212  *       overrides any other #GTask return value by default, like
7213  *       #GSimpleAsyncResult does when
7214  *       g_simple_async_result_set_check_cancellable() is called.
7215  *       (You can use g_task_set_check_cancellable() to turn off that
7216  *       behavior.) On the other hand, g_task_run_in_thread()
7217  *       guarantees that it will always run your
7218  *       <literal>task_func</literal>, even if the task's #GCancellable
7219  *       is already cancelled before the task gets a chance to run;
7220  *       you can start your <literal>task_func</literal> with a
7221  *       g_task_return_error_if_cancelled() check if you need the
7222  *       old behavior.
7223  *     </para></listitem>
7224  *     <listitem><para>
7225  *       The "return" methods (eg, g_task_return_pointer())
7226  *       automatically cause the task to be "completed" as well, and
7227  *       there is no need to worry about the "complete" vs "complete
7228  *       in idle" distinction. (#GTask automatically figures out
7229  *       whether the task's callback can be invoked directly, or
7230  *       if it needs to be sent to another #GMainContext, or delayed
7231  *       until the next iteration of the current #GMainContext.)
7232  *     </para></listitem>
7233  *     <listitem><para>
7234  *       The "finish" functions for #GTask-based operations are generally
7235  *       much simpler than #GSimpleAsyncResult ones, normally consisting
7236  *       of only a single call to g_task_propagate_pointer() or the like.
7237  *       Since g_task_propagate_pointer() "steals" the return value from
7238  *       the #GTask, it is not necessary to juggle pointers around to
7239  *       prevent it from being freed twice.
7240  *     </para></listitem>
7241  *     <listitem><para>
7242  *       With #GSimpleAsyncResult, it was common to call
7243  *       g_simple_async_result_propagate_error() from the
7244  *       <literal>_finish()</literal> wrapper function, and have
7245  *       virtual method implementations only deal with successful
7246  *       returns. This behavior is deprecated, because it makes it
7247  *       difficult for a subclass to chain to a parent class's async
7248  *       methods. Instead, the wrapper function should just be a
7249  *       simple wrapper, and the virtual method should call an
7250  *       appropriate <literal>g_task_propagate_</literal> function.
7251  *       Note that wrapper methods can now use
7252  *       g_async_result_legacy_propagate_error() to do old-style
7253  *       #GSimpleAsyncResult error-returning behavior, and
7254  *       g_async_result_is_tagged() to check if a result is tagged as
7255  *       having come from the <literal>_async()</literal> wrapper
7256  *       function (for "short-circuit" results, such as when passing
7257  *       0 to g_input_stream_read_async()).
7258  *     </para></listitem>
7259  *   </itemizedlist>
7260  * </refsect2>
7261  */
7262
7263
7264 /**
7265  * SECTION:gtcpconnection
7266  * @title: GTcpConnection
7267  * @short_description: A TCP GSocketConnection
7268  * @see_also: #GSocketConnection.
7269  *
7270  * This is the subclass of #GSocketConnection that is created
7271  * for TCP/IP sockets.
7272  *
7273  * Since: 2.22
7274  */
7275
7276
7277 /**
7278  * SECTION:gtcpwrapperconnection
7279  * @title: GTcpWrapperConnection
7280  * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
7281  * @see_also: #GSocketConnection.
7282  *
7283  * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
7284  * based on a #GSocket, but which is not actually a
7285  * #GSocketConnection. This is used by #GSocketClient so that it can
7286  * always return a #GSocketConnection, even when the connection it has
7287  * actually created is not directly a #GSocketConnection.
7288  *
7289  * Since: 2.28
7290  */
7291
7292
7293 /**
7294  * SECTION:gtestdbus
7295  * @short_description: D-Bus testing helper
7296  * @include: gio/gio.h
7297  *
7298  * A helper class for testing code which uses D-Bus without touching the user's
7299  * session bus.
7300  */
7301
7302
7303 /**
7304  * SECTION:gthemedicon
7305  * @short_description: Icon theming support
7306  * @include: gio/gio.h
7307  * @see_also: #GIcon, #GLoadableIcon
7308  *
7309  * #GThemedIcon is an implementation of #GIcon that supports icon themes.
7310  * #GThemedIcon contains a list of all of the icons present in an icon
7311  * theme, so that icons can be looked up quickly. #GThemedIcon does
7312  * not provide actual pixmaps for icons, just the icon names.
7313  * Ideally something like gtk_icon_theme_choose_icon() should be used to
7314  * resolve the list of names so that fallback icons work nicely with
7315  * themes that inherit other themes.
7316  */
7317
7318
7319 /**
7320  * SECTION:gthreadedsocketservice
7321  * @title: GThreadedSocketService
7322  * @short_description: A threaded GSocketService
7323  * @see_also: #GSocketService.
7324  *
7325  * A #GThreadedSocketService is a simple subclass of #GSocketService
7326  * that handles incoming connections by creating a worker thread and
7327  * dispatching the connection to it by emitting the
7328  * #GThreadedSocketService::run signal in the new thread.
7329  *
7330  * The signal handler may perform blocking IO and need not return
7331  * until the connection is closed.
7332  *
7333  * The service is implemented using a thread pool, so there is a
7334  * limited amount of threads available to serve incoming requests.
7335  * The service automatically stops the #GSocketService from accepting
7336  * new connections when all threads are busy.
7337  *
7338  * As with #GSocketService, you may connect to #GThreadedSocketService::run,
7339  * or subclass and override the default handler.
7340  */
7341
7342
7343 /**
7344  * SECTION:gtls
7345  * @title: TLS Overview
7346  * @short_description: TLS (aka SSL) support for GSocketConnection
7347  * @include: gio/gio.h
7348  *
7349  * #GTlsConnection and related classes provide TLS (Transport Layer
7350  * Security, previously known as SSL, Secure Sockets Layer) support for
7351  * gio-based network streams.
7352  *
7353  * In the simplest case, for a client connection, you can just set the
7354  * #GSocketClient:tls flag on a #GSocketClient, and then any
7355  * connections created by that client will have TLS negotiated
7356  * automatically, using appropriate default settings, and rejecting
7357  * any invalid or self-signed certificates (unless you change that
7358  * default by setting the #GSocketClient:tls-validation-flags
7359  * property). The returned object will be a #GTcpWrapperConnection,
7360  * which wraps the underlying #GTlsClientConnection.
7361  *
7362  * For greater control, you can create your own #GTlsClientConnection,
7363  * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
7364  * pollable input and output streams) and then connect to its signals,
7365  * such as #GTlsConnection::accept-certificate, before starting the
7366  * handshake.
7367  *
7368  * Server-side TLS is similar, using #GTlsServerConnection. At the
7369  * moment, there is no support for automatically wrapping server-side
7370  * connections in the way #GSocketClient does for client-side
7371  * connections.
7372  */
7373
7374
7375 /**
7376  * SECTION:gtlsbackend
7377  * @title: GTlsBackend
7378  * @short_description: TLS backend implementation
7379  * @include: gio/gio.h
7380  */
7381
7382
7383 /**
7384  * SECTION:gtlscertificate
7385  * @title: GTlsCertificate
7386  * @short_description: TLS certificate
7387  * @see_also: #GTlsConnection
7388  *
7389  * A certificate used for TLS authentication and encryption.
7390  * This can represent either a certificate only (eg, the certificate
7391  * received by a client from a server), or the combination of
7392  * a certificate and a private key (which is needed when acting as a
7393  * #GTlsServerConnection).
7394  *
7395  * Since: 2.28
7396  */
7397
7398
7399 /**
7400  * SECTION:gtlsclientconnection
7401  * @short_description: TLS client-side connection
7402  * @include: gio/gio.h
7403  *
7404  * #GTlsClientConnection is the client-side subclass of
7405  * #GTlsConnection, representing a client-side TLS connection.
7406  */
7407
7408
7409 /**
7410  * SECTION:gtlsconnection
7411  * @short_description: TLS connection type
7412  * @include: gio/gio.h
7413  *
7414  * #GTlsConnection is the base TLS connection class type, which wraps
7415  * a #GIOStream and provides TLS encryption on top of it. Its
7416  * subclasses, #GTlsClientConnection and #GTlsServerConnection,
7417  * implement client-side and server-side TLS, respectively.
7418  *
7419  * Since: 2.28
7420  */
7421
7422
7423 /**
7424  * SECTION:gtlsdatabase
7425  * @short_description: TLS database type
7426  * @include: gio/gio.h
7427  *
7428  * #GTlsDatabase is used to lookup certificates and other information
7429  * from a certificate or key store. It is an abstract base class which
7430  * TLS library specific subtypes override.
7431  *
7432  * Most common client applications will not directly interact with
7433  * #GTlsDatabase. It is used internally by #GTlsConnection.
7434  *
7435  * Since: 2.30
7436  */
7437
7438
7439 /**
7440  * SECTION:gtlsfiledatabase
7441  * @short_description: TLS file based database type
7442  * @include: gio/gio.h
7443  *
7444  * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
7445  * their certificate information from a file. It is in interface which
7446  * TLS library specific subtypes implement.
7447  *
7448  * Since: 2.30
7449  */
7450
7451
7452 /**
7453  * SECTION:gtlsinteraction
7454  * @short_description: Interaction with the user during TLS operations.
7455  * @include: gio/gio.h
7456  *
7457  * #GTlsInteraction provides a mechanism for the TLS connection and database
7458  * code to interact with the user. It can be used to ask the user for passwords.
7459  *
7460  * To use a #GTlsInteraction with a TLS connection use
7461  * g_tls_connection_set_interaction().
7462  *
7463  * Callers should instantiate a derived class that implements the various
7464  * interaction methods to show the required dialogs.
7465  *
7466  * Callers should use the 'invoke' functions like
7467  * g_tls_interaction_invoke_ask_password() to run interaction methods. These
7468  * functions make sure that the interaction is invoked in the main loop
7469  * and not in the current thread, if the current thread is not running the
7470  * main loop.
7471  *
7472  * Derived classes can choose to implement whichever interactions methods they'd
7473  * like to support by overriding those virtual methods in their class
7474  * initialization function. Any interactions not implemented will return
7475  * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
7476  * it must also implement the corresponding finish method.
7477  */
7478
7479
7480 /**
7481  * SECTION:gtlspassword
7482  * @title: GTlsPassword
7483  * @short_description: TLS Passwords for prompting
7484  * @include: gio/gio.h
7485  *
7486  * Holds a password used in TLS.
7487  */
7488
7489
7490 /**
7491  * SECTION:gtlsserverconnection
7492  * @short_description: TLS server-side connection
7493  * @include: gio/gio.h
7494  *
7495  * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
7496  * representing a server-side TLS connection.
7497  *
7498  * Since: 2.28
7499  */
7500
7501
7502 /**
7503  * SECTION:gunixconnection
7504  * @title: GUnixConnection
7505  * @short_description: A UNIX domain GSocketConnection
7506  * @include: gio/gunixconnection.h
7507  * @see_also: #GSocketConnection.
7508  *
7509  * This is the subclass of #GSocketConnection that is created
7510  * for UNIX domain sockets.
7511  *
7512  * It contains functions to do some of the UNIX socket specific
7513  * functionality like passing file descriptors.
7514  *
7515  * Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
7516  * the UNIX-specific GIO interfaces, thus you have to use the
7517  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7518  *
7519  * Since: 2.22
7520  */
7521
7522
7523 /**
7524  * SECTION:gunixcredentialsmessage
7525  * @title: GUnixCredentialsMessage
7526  * @short_description: A GSocketControlMessage containing credentials
7527  * @include: gio/gunixcredentialsmessage.h
7528  * @see_also: #GUnixConnection, #GSocketControlMessage
7529  *
7530  * This #GSocketControlMessage contains a #GCredentials instance.  It
7531  * may be sent using g_socket_send_message() and received using
7532  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7533  * %G_SOCKET_FAMILY_UNIX family).
7534  *
7535  * For an easier way to send and receive credentials over
7536  * stream-oriented UNIX sockets, see
7537  * g_unix_connection_send_credentials() and
7538  * g_unix_connection_receive_credentials(). To receive credentials of
7539  * a foreign process connected to a socket, use
7540  * g_socket_get_credentials().
7541  */
7542
7543
7544 /**
7545  * SECTION:gunixfdlist
7546  * @title: GUnixFDList
7547  * @short_description: An object containing a set of UNIX file descriptors
7548  * @include: gio/gunixfdlist.h
7549  * @see_also: #GUnixFDMessage
7550  *
7551  * A #GUnixFDList contains a list of file descriptors.  It owns the file
7552  * descriptors that it contains, closing them when finalized.
7553  *
7554  * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
7555  * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
7556  * and received using g_socket_receive_message().
7557  *
7558  * Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
7559  * the UNIX-specific GIO interfaces, thus you have to use the
7560  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7561  */
7562
7563
7564 /**
7565  * SECTION:gunixfdmessage
7566  * @title: GUnixFDMessage
7567  * @short_description: A GSocketControlMessage containing a GUnixFDList
7568  * @include: gio/gunixfdmessage.h
7569  * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
7570  *
7571  * This #GSocketControlMessage contains a #GUnixFDList.
7572  * It may be sent using g_socket_send_message() and received using
7573  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7574  * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
7575  * between processes by the kernel.
7576  *
7577  * For an easier way to send and receive file descriptors over
7578  * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7579  * g_unix_connection_receive_fd().
7580  *
7581  * Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
7582  * the UNIX-specific GIO interfaces, thus you have to use the
7583  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7584  */
7585
7586
7587 /**
7588  * SECTION:gunixinputstream
7589  * @short_description: Streaming input operations for UNIX file descriptors
7590  * @include: gio/gunixinputstream.h
7591  * @see_also: #GInputStream
7592  *
7593  * #GUnixInputStream implements #GInputStream for reading from a UNIX
7594  * file descriptor, including asynchronous operations. (If the file
7595  * descriptor refers to a socket or pipe, this will use poll() to do
7596  * asynchronous I/O. If it refers to a regular file, it will fall back
7597  * to doing asynchronous I/O in another thread.)
7598  *
7599  * Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
7600  * to the UNIX-specific GIO interfaces, thus you have to use the
7601  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7602  */
7603
7604
7605 /**
7606  * SECTION:gunixmounts
7607  * @include: gio/gunixmounts.h
7608  * @short_description: UNIX mounts
7609  *
7610  * Routines for managing mounted UNIX mount points and paths.
7611  *
7612  * Note that <filename>&lt;gio/gunixmounts.h&gt;</filename> belongs to the
7613  * UNIX-specific GIO interfaces, thus you have to use the
7614  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7615  */
7616
7617
7618 /**
7619  * SECTION:gunixoutputstream
7620  * @short_description: Streaming output operations for UNIX file descriptors
7621  * @include: gio/gunixoutputstream.h
7622  * @see_also: #GOutputStream
7623  *
7624  * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7625  * file descriptor, including asynchronous operations. (If the file
7626  * descriptor refers to a socket or pipe, this will use poll() to do
7627  * asynchronous I/O. If it refers to a regular file, it will fall back
7628  * to doing asynchronous I/O in another thread.)
7629  *
7630  * Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
7631  * to the UNIX-specific GIO interfaces, thus you have to use the
7632  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7633  */
7634
7635
7636 /**
7637  * SECTION:gunixsocketaddress
7638  * @short_description: UNIX GSocketAddress
7639  * @include: gio/gunixsocketaddress.h
7640  *
7641  * Support for UNIX-domain (also known as local) sockets.
7642  *
7643  * UNIX domain sockets are generally visible in the filesystem.
7644  * However, some systems support abstract socket names which are not
7645  * visible in the filesystem and not affected by the filesystem
7646  * permissions, visibility, etc. Currently this is only supported
7647  * under Linux. If you attempt to use abstract sockets on other
7648  * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7649  * errors. You can use g_unix_socket_address_abstract_names_supported()
7650  * to see if abstract names are supported.
7651  *
7652  * Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
7653  * the UNIX-specific GIO interfaces, thus you have to use the
7654  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7655  */
7656
7657
7658 /**
7659  * SECTION:gvfs
7660  * @short_description: Virtual File System
7661  * @include: gio/gio.h
7662  *
7663  * Entry point for using GIO functionality.
7664  */
7665
7666
7667 /**
7668  * SECTION:gvolume
7669  * @short_description: Volume management
7670  * @include: gio/gio.h
7671  *
7672  * The #GVolume interface represents user-visible objects that can be
7673  * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7674  * equivalent of #GnomeVFSDrive.
7675  *
7676  * Mounting a #GVolume instance is an asynchronous operation. For more
7677  * information about asynchronous operations, see #GAsyncResult and
7678  * #GSimpleAsyncResult. To mount a #GVolume, first call
7679  * g_volume_mount() with (at least) the #GVolume instance, optionally
7680  * a #GMountOperation object and a #GAsyncReadyCallback.
7681  *
7682  * Typically, one will only want to pass %NULL for the
7683  * #GMountOperation if automounting all volumes when a desktop session
7684  * starts since it's not desirable to put up a lot of dialogs asking
7685  * for credentials.
7686  *
7687  * The callback will be fired when the operation has resolved (either
7688  * with success or failure), and a #GAsyncReady structure will be
7689  * passed to the callback.  That callback should then call
7690  * g_volume_mount_finish() with the #GVolume instance and the
7691  * #GAsyncReady data to see if the operation was completed
7692  * successfully.  If an @error is present when g_volume_mount_finish()
7693  * is called, then it will be filled with any error information.
7694  *
7695  * <para id="volume-identifier">
7696  * It is sometimes necessary to directly access the underlying
7697  * operating system object behind a volume (e.g. for passing a volume
7698  * to an application via the commandline). For this purpose, GIO
7699  * allows to obtain an 'identifier' for the volume. There can be
7700  * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7701  * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7702  * uuids. GIO uses predefind strings as names for the different kinds
7703  * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7704  * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7705  * to obtain an identifier for a volume.
7706  * </para>
7707  *
7708  * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7709  * when the gvfs hal volume monitor is in use. Other volume monitors
7710  * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7711  * identifier, which can be used to obtain a hal device by means of
7712  * libhal_manager_find_device_string_match().
7713  */
7714
7715
7716 /**
7717  * SECTION:gvolumemonitor
7718  * @short_description: Volume Monitor
7719  * @include: gio/gio.h
7720  * @see_also: #GFileMonitor
7721  *
7722  * #GVolumeMonitor is for listing the user interesting devices and volumes
7723  * on the computer. In other words, what a file selector or file manager
7724  * would show in a sidebar.
7725  *
7726  * #GVolumeMonitor is not <link
7727  * linkend="g-main-context-push-thread-default">thread-default-context
7728  * aware</link>, and so should not be used other than from the main
7729  * thread, with no thread-default-context active.
7730  */
7731
7732
7733 /**
7734  * SECTION:gwin32inputstream
7735  * @short_description: Streaming input operations for Windows file handles
7736  * @include: gio/gwin32inputstream.h
7737  * @see_also: #GInputStream
7738  *
7739  * #GWin32InputStream implements #GInputStream for reading from a
7740  * Windows file handle.
7741  *
7742  * Note that <filename>&lt;gio/gwin32inputstream.h&gt;</filename> belongs
7743  * to the Windows-specific GIO interfaces, thus you have to use the
7744  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7745  */
7746
7747
7748 /**
7749  * SECTION:gwin32outputstream
7750  * @short_description: Streaming output operations for Windows file handles
7751  * @include: gio/gwin32outputstream.h
7752  * @see_also: #GOutputStream
7753  *
7754  * #GWin32OutputStream implements #GOutputStream for writing to a
7755  * Windows file handle.
7756  *
7757  * Note that <filename>&lt;gio/gwin32outputstream.h&gt;</filename> belongs
7758  * to the Windows-specific GIO interfaces, thus you have to use the
7759  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7760  */
7761
7762
7763 /**
7764  * SECTION:gzcompressor
7765  * @short_description: Zlib compressor
7766  * @include: gio/gio.h
7767  *
7768  * #GZlibCompressor is an implementation of #GConverter that
7769  * compresses data using zlib.
7770  */
7771
7772
7773 /**
7774  * SECTION:gzdecompressor
7775  * @short_description: Zlib decompressor
7776  * @include: gio/gio.h
7777  *
7778  * #GZlibDecompressor is an implementation of #GConverter that
7779  * decompresses data compressed with zlib.
7780  */
7781
7782
7783 /**
7784  * _GFreedesktopDBus:
7785  *
7786  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7787  */
7788
7789
7790 /**
7791  * _GFreedesktopDBus::handle-add-match:
7792  * @object: A #_GFreedesktopDBus.
7793  * @invocation: A #GDBusMethodInvocation.
7794  * @arg_rule: Argument passed by remote caller.
7795  *
7796  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method.
7797  *
7798  * 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.
7799  *
7800  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7801  */
7802
7803
7804 /**
7805  * _GFreedesktopDBus::handle-get-connection-selinux-security-context:
7806  * @object: A #_GFreedesktopDBus.
7807  * @invocation: A #GDBusMethodInvocation.
7808  * @arg_name: Argument passed by remote caller.
7809  *
7810  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method.
7811  *
7812  * 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.
7813  *
7814  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7815  */
7816
7817
7818 /**
7819  * _GFreedesktopDBus::handle-get-connection-unix-process-id:
7820  * @object: A #_GFreedesktopDBus.
7821  * @invocation: A #GDBusMethodInvocation.
7822  * @arg_name: Argument passed by remote caller.
7823  *
7824  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method.
7825  *
7826  * 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.
7827  *
7828  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7829  */
7830
7831
7832 /**
7833  * _GFreedesktopDBus::handle-get-connection-unix-user:
7834  * @object: A #_GFreedesktopDBus.
7835  * @invocation: A #GDBusMethodInvocation.
7836  * @arg_name: Argument passed by remote caller.
7837  *
7838  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method.
7839  *
7840  * 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.
7841  *
7842  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7843  */
7844
7845
7846 /**
7847  * _GFreedesktopDBus::handle-get-id:
7848  * @object: A #_GFreedesktopDBus.
7849  * @invocation: A #GDBusMethodInvocation.
7850  *
7851  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method.
7852  *
7853  * 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.
7854  *
7855  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7856  */
7857
7858
7859 /**
7860  * _GFreedesktopDBus::handle-get-name-owner:
7861  * @object: A #_GFreedesktopDBus.
7862  * @invocation: A #GDBusMethodInvocation.
7863  * @arg_name: Argument passed by remote caller.
7864  *
7865  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method.
7866  *
7867  * 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.
7868  *
7869  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7870  */
7871
7872
7873 /**
7874  * _GFreedesktopDBus::handle-hello:
7875  * @object: A #_GFreedesktopDBus.
7876  * @invocation: A #GDBusMethodInvocation.
7877  *
7878  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method.
7879  *
7880  * 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.
7881  *
7882  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7883  */
7884
7885
7886 /**
7887  * _GFreedesktopDBus::handle-list-activatable-names:
7888  * @object: A #_GFreedesktopDBus.
7889  * @invocation: A #GDBusMethodInvocation.
7890  *
7891  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method.
7892  *
7893  * 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.
7894  *
7895  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7896  */
7897
7898
7899 /**
7900  * _GFreedesktopDBus::handle-list-names:
7901  * @object: A #_GFreedesktopDBus.
7902  * @invocation: A #GDBusMethodInvocation.
7903  *
7904  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method.
7905  *
7906  * 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.
7907  *
7908  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7909  */
7910
7911
7912 /**
7913  * _GFreedesktopDBus::handle-list-queued-owners:
7914  * @object: A #_GFreedesktopDBus.
7915  * @invocation: A #GDBusMethodInvocation.
7916  * @arg_name: Argument passed by remote caller.
7917  *
7918  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method.
7919  *
7920  * 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.
7921  *
7922  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7923  */
7924
7925
7926 /**
7927  * _GFreedesktopDBus::handle-name-has-owner:
7928  * @object: A #_GFreedesktopDBus.
7929  * @invocation: A #GDBusMethodInvocation.
7930  * @arg_name: Argument passed by remote caller.
7931  *
7932  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method.
7933  *
7934  * 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.
7935  *
7936  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7937  */
7938
7939
7940 /**
7941  * _GFreedesktopDBus::handle-release-name:
7942  * @object: A #_GFreedesktopDBus.
7943  * @invocation: A #GDBusMethodInvocation.
7944  * @arg_name: Argument passed by remote caller.
7945  *
7946  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method.
7947  *
7948  * 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.
7949  *
7950  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7951  */
7952
7953
7954 /**
7955  * _GFreedesktopDBus::handle-reload-config:
7956  * @object: A #_GFreedesktopDBus.
7957  * @invocation: A #GDBusMethodInvocation.
7958  *
7959  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method.
7960  *
7961  * 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.
7962  *
7963  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7964  */
7965
7966
7967 /**
7968  * _GFreedesktopDBus::handle-remove-match:
7969  * @object: A #_GFreedesktopDBus.
7970  * @invocation: A #GDBusMethodInvocation.
7971  * @arg_rule: Argument passed by remote caller.
7972  *
7973  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method.
7974  *
7975  * 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.
7976  *
7977  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7978  */
7979
7980
7981 /**
7982  * _GFreedesktopDBus::handle-request-name:
7983  * @object: A #_GFreedesktopDBus.
7984  * @invocation: A #GDBusMethodInvocation.
7985  * @arg_name: Argument passed by remote caller.
7986  * @arg_flags: Argument passed by remote caller.
7987  *
7988  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method.
7989  *
7990  * 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.
7991  *
7992  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7993  */
7994
7995
7996 /**
7997  * _GFreedesktopDBus::handle-start-service-by-name:
7998  * @object: A #_GFreedesktopDBus.
7999  * @invocation: A #GDBusMethodInvocation.
8000  * @arg_name: Argument passed by remote caller.
8001  * @arg_flags: Argument passed by remote caller.
8002  *
8003  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method.
8004  *
8005  * 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.
8006  *
8007  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
8008  */
8009
8010
8011 /**
8012  * _GFreedesktopDBus::handle-update-activation-environment:
8013  * @object: A #_GFreedesktopDBus.
8014  * @invocation: A #GDBusMethodInvocation.
8015  * @arg_environment: Argument passed by remote caller.
8016  *
8017  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method.
8018  *
8019  * 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.
8020  *
8021  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
8022  */
8023
8024
8025 /**
8026  * _GFreedesktopDBus::name-acquired:
8027  * @object: A #_GFreedesktopDBus.
8028  * @arg_name: Argument.
8029  *
8030  * 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.
8031  *
8032  * 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.
8033  */
8034
8035
8036 /**
8037  * _GFreedesktopDBus::name-lost:
8038  * @object: A #_GFreedesktopDBus.
8039  * @arg_name: Argument.
8040  *
8041  * 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.
8042  *
8043  * 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.
8044  */
8045
8046
8047 /**
8048  * _GFreedesktopDBus::name-owner-changed:
8049  * @object: A #_GFreedesktopDBus.
8050  * @arg_name: Argument.
8051  * @arg_old_owner: Argument.
8052  * @arg_new_owner: Argument.
8053  *
8054  * 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.
8055  *
8056  * 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.
8057  */
8058
8059
8060 /**
8061  * _GFreedesktopDBusIface:
8062  * @parent_iface: The parent interface.
8063  * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal.
8064  * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal.
8065  * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal.
8066  * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal.
8067  * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal.
8068  * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal.
8069  * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal.
8070  * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal.
8071  * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal.
8072  * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal.
8073  * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal.
8074  * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal.
8075  * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal.
8076  * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal.
8077  * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal.
8078  * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal.
8079  * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal.
8080  * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal.
8081  * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal.
8082  * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal.
8083  *
8084  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
8085  */
8086
8087
8088 /**
8089  * _GFreedesktopDBusProxy:
8090  *
8091  * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API.
8092  */
8093
8094
8095 /**
8096  * _GFreedesktopDBusProxyClass:
8097  * @parent_class: The parent class.
8098  *
8099  * Class structure for #_GFreedesktopDBusProxy.
8100  */
8101
8102
8103 /**
8104  * _GFreedesktopDBusSkeleton:
8105  *
8106  * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API.
8107  */
8108
8109
8110 /**
8111  * _GFreedesktopDBusSkeletonClass:
8112  * @parent_class: The parent class.
8113  *
8114  * Class structure for #_GFreedesktopDBusSkeleton.
8115  */
8116
8117
8118 /**
8119  * _g_freedesktop_dbus_call_add_match:
8120  * @proxy: A #_GFreedesktopDBusProxy.
8121  * @arg_rule: 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.AddMatch">AddMatch()</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_add_match_finish() to get the result of the operation.
8129  *
8130  * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method.
8131  */
8132
8133
8134 /**
8135  * _g_freedesktop_dbus_call_add_match_finish:
8136  * @proxy: A #_GFreedesktopDBusProxy.
8137  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match().
8138  * @error: Return location for error or %NULL.
8139  *
8140  * Finishes an operation started with _g_freedesktop_dbus_call_add_match().
8141  *
8142  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8143  */
8144
8145
8146 /**
8147  * _g_freedesktop_dbus_call_add_match_sync:
8148  * @proxy: A #_GFreedesktopDBusProxy.
8149  * @arg_rule: Argument to pass with the method invocation.
8150  * @cancellable: (allow-none): A #GCancellable or %NULL.
8151  * @error: Return location for error or %NULL.
8152  *
8153  * 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.
8154  *
8155  * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method.
8156  *
8157  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8158  */
8159
8160
8161 /**
8162  * _g_freedesktop_dbus_call_get_connection_selinux_security_context:
8163  * @proxy: A #_GFreedesktopDBusProxy.
8164  * @arg_name: Argument to pass with the method invocation.
8165  * @cancellable: (allow-none): A #GCancellable or %NULL.
8166  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8167  * @user_data: User data to pass to @callback.
8168  *
8169  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy.
8170  * 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.
8171  * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation.
8172  *
8173  * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method.
8174  */
8175
8176
8177 /**
8178  * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish:
8179  * @proxy: A #_GFreedesktopDBusProxy.
8180  * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
8181  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context().
8182  * @error: Return location for error or %NULL.
8183  *
8184  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context().
8185  *
8186  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8187  */
8188
8189
8190 /**
8191  * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync:
8192  * @proxy: A #_GFreedesktopDBusProxy.
8193  * @arg_name: Argument to pass with the method invocation.
8194  * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
8195  * @cancellable: (allow-none): A #GCancellable or %NULL.
8196  * @error: Return location for error or %NULL.
8197  *
8198  * 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.
8199  *
8200  * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method.
8201  *
8202  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8203  */
8204
8205
8206 /**
8207  * _g_freedesktop_dbus_call_get_connection_unix_process_id:
8208  * @proxy: A #_GFreedesktopDBusProxy.
8209  * @arg_name: Argument to pass with the method invocation.
8210  * @cancellable: (allow-none): A #GCancellable or %NULL.
8211  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8212  * @user_data: User data to pass to @callback.
8213  *
8214  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy.
8215  * 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.
8216  * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation.
8217  *
8218  * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method.
8219  */
8220
8221
8222 /**
8223  * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish:
8224  * @proxy: A #_GFreedesktopDBusProxy.
8225  * @out_pid: (out): Return location for return parameter or %NULL to ignore.
8226  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id().
8227  * @error: Return location for error or %NULL.
8228  *
8229  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id().
8230  *
8231  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8232  */
8233
8234
8235 /**
8236  * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync:
8237  * @proxy: A #_GFreedesktopDBusProxy.
8238  * @arg_name: Argument to pass with the method invocation.
8239  * @out_pid: (out): Return location for return parameter or %NULL to ignore.
8240  * @cancellable: (allow-none): A #GCancellable or %NULL.
8241  * @error: Return location for error or %NULL.
8242  *
8243  * 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.
8244  *
8245  * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method.
8246  *
8247  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8248  */
8249
8250
8251 /**
8252  * _g_freedesktop_dbus_call_get_connection_unix_user:
8253  * @proxy: A #_GFreedesktopDBusProxy.
8254  * @arg_name: Argument to pass with the method invocation.
8255  * @cancellable: (allow-none): A #GCancellable or %NULL.
8256  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8257  * @user_data: User data to pass to @callback.
8258  *
8259  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy.
8260  * 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.
8261  * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation.
8262  *
8263  * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method.
8264  */
8265
8266
8267 /**
8268  * _g_freedesktop_dbus_call_get_connection_unix_user_finish:
8269  * @proxy: A #_GFreedesktopDBusProxy.
8270  * @out_uid: (out): Return location for return parameter or %NULL to ignore.
8271  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user().
8272  * @error: Return location for error or %NULL.
8273  *
8274  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user().
8275  *
8276  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8277  */
8278
8279
8280 /**
8281  * _g_freedesktop_dbus_call_get_connection_unix_user_sync:
8282  * @proxy: A #_GFreedesktopDBusProxy.
8283  * @arg_name: Argument to pass with the method invocation.
8284  * @out_uid: (out): Return location for return parameter or %NULL to ignore.
8285  * @cancellable: (allow-none): A #GCancellable or %NULL.
8286  * @error: Return location for error or %NULL.
8287  *
8288  * 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.
8289  *
8290  * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method.
8291  *
8292  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8293  */
8294
8295
8296 /**
8297  * _g_freedesktop_dbus_call_get_id:
8298  * @proxy: A #_GFreedesktopDBusProxy.
8299  * @cancellable: (allow-none): A #GCancellable or %NULL.
8300  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8301  * @user_data: User data to pass to @callback.
8302  *
8303  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy.
8304  * 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.
8305  * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation.
8306  *
8307  * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method.
8308  */
8309
8310
8311 /**
8312  * _g_freedesktop_dbus_call_get_id_finish:
8313  * @proxy: A #_GFreedesktopDBusProxy.
8314  * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
8315  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id().
8316  * @error: Return location for error or %NULL.
8317  *
8318  * Finishes an operation started with _g_freedesktop_dbus_call_get_id().
8319  *
8320  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8321  */
8322
8323
8324 /**
8325  * _g_freedesktop_dbus_call_get_id_sync:
8326  * @proxy: A #_GFreedesktopDBusProxy.
8327  * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
8328  * @cancellable: (allow-none): A #GCancellable or %NULL.
8329  * @error: Return location for error or %NULL.
8330  *
8331  * 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.
8332  *
8333  * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method.
8334  *
8335  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8336  */
8337
8338
8339 /**
8340  * _g_freedesktop_dbus_call_get_name_owner:
8341  * @proxy: A #_GFreedesktopDBusProxy.
8342  * @arg_name: Argument to pass with the method invocation.
8343  * @cancellable: (allow-none): A #GCancellable or %NULL.
8344  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8345  * @user_data: User data to pass to @callback.
8346  *
8347  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy.
8348  * 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.
8349  * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation.
8350  *
8351  * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method.
8352  */
8353
8354
8355 /**
8356  * _g_freedesktop_dbus_call_get_name_owner_finish:
8357  * @proxy: A #_GFreedesktopDBusProxy.
8358  * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
8359  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner().
8360  * @error: Return location for error or %NULL.
8361  *
8362  * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner().
8363  *
8364  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8365  */
8366
8367
8368 /**
8369  * _g_freedesktop_dbus_call_get_name_owner_sync:
8370  * @proxy: A #_GFreedesktopDBusProxy.
8371  * @arg_name: Argument to pass with the method invocation.
8372  * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
8373  * @cancellable: (allow-none): A #GCancellable or %NULL.
8374  * @error: Return location for error or %NULL.
8375  *
8376  * 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.
8377  *
8378  * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method.
8379  *
8380  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8381  */
8382
8383
8384 /**
8385  * _g_freedesktop_dbus_call_hello:
8386  * @proxy: A #_GFreedesktopDBusProxy.
8387  * @cancellable: (allow-none): A #GCancellable or %NULL.
8388  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8389  * @user_data: User data to pass to @callback.
8390  *
8391  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy.
8392  * 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.
8393  * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation.
8394  *
8395  * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method.
8396  */
8397
8398
8399 /**
8400  * _g_freedesktop_dbus_call_hello_finish:
8401  * @proxy: A #_GFreedesktopDBusProxy.
8402  * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
8403  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello().
8404  * @error: Return location for error or %NULL.
8405  *
8406  * Finishes an operation started with _g_freedesktop_dbus_call_hello().
8407  *
8408  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8409  */
8410
8411
8412 /**
8413  * _g_freedesktop_dbus_call_hello_sync:
8414  * @proxy: A #_GFreedesktopDBusProxy.
8415  * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
8416  * @cancellable: (allow-none): A #GCancellable or %NULL.
8417  * @error: Return location for error or %NULL.
8418  *
8419  * 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.
8420  *
8421  * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method.
8422  *
8423  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8424  */
8425
8426
8427 /**
8428  * _g_freedesktop_dbus_call_list_activatable_names:
8429  * @proxy: A #_GFreedesktopDBusProxy.
8430  * @cancellable: (allow-none): A #GCancellable or %NULL.
8431  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8432  * @user_data: User data to pass to @callback.
8433  *
8434  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy.
8435  * 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.
8436  * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation.
8437  *
8438  * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method.
8439  */
8440
8441
8442 /**
8443  * _g_freedesktop_dbus_call_list_activatable_names_finish:
8444  * @proxy: A #_GFreedesktopDBusProxy.
8445  * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
8446  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names().
8447  * @error: Return location for error or %NULL.
8448  *
8449  * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names().
8450  *
8451  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8452  */
8453
8454
8455 /**
8456  * _g_freedesktop_dbus_call_list_activatable_names_sync:
8457  * @proxy: A #_GFreedesktopDBusProxy.
8458  * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
8459  * @cancellable: (allow-none): A #GCancellable or %NULL.
8460  * @error: Return location for error or %NULL.
8461  *
8462  * 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.
8463  *
8464  * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method.
8465  *
8466  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8467  */
8468
8469
8470 /**
8471  * _g_freedesktop_dbus_call_list_names:
8472  * @proxy: A #_GFreedesktopDBusProxy.
8473  * @cancellable: (allow-none): A #GCancellable or %NULL.
8474  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8475  * @user_data: User data to pass to @callback.
8476  *
8477  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy.
8478  * 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.
8479  * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation.
8480  *
8481  * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method.
8482  */
8483
8484
8485 /**
8486  * _g_freedesktop_dbus_call_list_names_finish:
8487  * @proxy: A #_GFreedesktopDBusProxy.
8488  * @out_names: (out): Return location for return parameter or %NULL to ignore.
8489  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names().
8490  * @error: Return location for error or %NULL.
8491  *
8492  * Finishes an operation started with _g_freedesktop_dbus_call_list_names().
8493  *
8494  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8495  */
8496
8497
8498 /**
8499  * _g_freedesktop_dbus_call_list_names_sync:
8500  * @proxy: A #_GFreedesktopDBusProxy.
8501  * @out_names: (out): Return location for return parameter or %NULL to ignore.
8502  * @cancellable: (allow-none): A #GCancellable or %NULL.
8503  * @error: Return location for error or %NULL.
8504  *
8505  * 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.
8506  *
8507  * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method.
8508  *
8509  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8510  */
8511
8512
8513 /**
8514  * _g_freedesktop_dbus_call_list_queued_owners:
8515  * @proxy: A #_GFreedesktopDBusProxy.
8516  * @arg_name: Argument to pass with the method invocation.
8517  * @cancellable: (allow-none): A #GCancellable or %NULL.
8518  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8519  * @user_data: User data to pass to @callback.
8520  *
8521  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy.
8522  * 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.
8523  * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation.
8524  *
8525  * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method.
8526  */
8527
8528
8529 /**
8530  * _g_freedesktop_dbus_call_list_queued_owners_finish:
8531  * @proxy: A #_GFreedesktopDBusProxy.
8532  * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
8533  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners().
8534  * @error: Return location for error or %NULL.
8535  *
8536  * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners().
8537  *
8538  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8539  */
8540
8541
8542 /**
8543  * _g_freedesktop_dbus_call_list_queued_owners_sync:
8544  * @proxy: A #_GFreedesktopDBusProxy.
8545  * @arg_name: Argument to pass with the method invocation.
8546  * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
8547  * @cancellable: (allow-none): A #GCancellable or %NULL.
8548  * @error: Return location for error or %NULL.
8549  *
8550  * 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.
8551  *
8552  * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method.
8553  *
8554  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8555  */
8556
8557
8558 /**
8559  * _g_freedesktop_dbus_call_name_has_owner:
8560  * @proxy: A #_GFreedesktopDBusProxy.
8561  * @arg_name: Argument to pass with the method invocation.
8562  * @cancellable: (allow-none): A #GCancellable or %NULL.
8563  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8564  * @user_data: User data to pass to @callback.
8565  *
8566  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy.
8567  * 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.
8568  * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation.
8569  *
8570  * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method.
8571  */
8572
8573
8574 /**
8575  * _g_freedesktop_dbus_call_name_has_owner_finish:
8576  * @proxy: A #_GFreedesktopDBusProxy.
8577  * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8578  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner().
8579  * @error: Return location for error or %NULL.
8580  *
8581  * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner().
8582  *
8583  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8584  */
8585
8586
8587 /**
8588  * _g_freedesktop_dbus_call_name_has_owner_sync:
8589  * @proxy: A #_GFreedesktopDBusProxy.
8590  * @arg_name: Argument to pass with the method invocation.
8591  * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8592  * @cancellable: (allow-none): A #GCancellable or %NULL.
8593  * @error: Return location for error or %NULL.
8594  *
8595  * 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.
8596  *
8597  * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method.
8598  *
8599  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8600  */
8601
8602
8603 /**
8604  * _g_freedesktop_dbus_call_release_name:
8605  * @proxy: A #_GFreedesktopDBusProxy.
8606  * @arg_name: Argument to pass with the method invocation.
8607  * @cancellable: (allow-none): A #GCancellable or %NULL.
8608  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8609  * @user_data: User data to pass to @callback.
8610  *
8611  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy.
8612  * 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.
8613  * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation.
8614  *
8615  * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method.
8616  */
8617
8618
8619 /**
8620  * _g_freedesktop_dbus_call_release_name_finish:
8621  * @proxy: A #_GFreedesktopDBusProxy.
8622  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8623  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name().
8624  * @error: Return location for error or %NULL.
8625  *
8626  * Finishes an operation started with _g_freedesktop_dbus_call_release_name().
8627  *
8628  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8629  */
8630
8631
8632 /**
8633  * _g_freedesktop_dbus_call_release_name_sync:
8634  * @proxy: A #_GFreedesktopDBusProxy.
8635  * @arg_name: Argument to pass with the method invocation.
8636  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8637  * @cancellable: (allow-none): A #GCancellable or %NULL.
8638  * @error: Return location for error or %NULL.
8639  *
8640  * 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.
8641  *
8642  * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method.
8643  *
8644  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8645  */
8646
8647
8648 /**
8649  * _g_freedesktop_dbus_call_reload_config:
8650  * @proxy: A #_GFreedesktopDBusProxy.
8651  * @cancellable: (allow-none): A #GCancellable or %NULL.
8652  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8653  * @user_data: User data to pass to @callback.
8654  *
8655  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy.
8656  * 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.
8657  * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation.
8658  *
8659  * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method.
8660  */
8661
8662
8663 /**
8664  * _g_freedesktop_dbus_call_reload_config_finish:
8665  * @proxy: A #_GFreedesktopDBusProxy.
8666  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config().
8667  * @error: Return location for error or %NULL.
8668  *
8669  * Finishes an operation started with _g_freedesktop_dbus_call_reload_config().
8670  *
8671  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8672  */
8673
8674
8675 /**
8676  * _g_freedesktop_dbus_call_reload_config_sync:
8677  * @proxy: A #_GFreedesktopDBusProxy.
8678  * @cancellable: (allow-none): A #GCancellable or %NULL.
8679  * @error: Return location for error or %NULL.
8680  *
8681  * 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.
8682  *
8683  * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method.
8684  *
8685  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8686  */
8687
8688
8689 /**
8690  * _g_freedesktop_dbus_call_remove_match:
8691  * @proxy: A #_GFreedesktopDBusProxy.
8692  * @arg_rule: Argument to pass with the method invocation.
8693  * @cancellable: (allow-none): A #GCancellable or %NULL.
8694  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8695  * @user_data: User data to pass to @callback.
8696  *
8697  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy.
8698  * 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.
8699  * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation.
8700  *
8701  * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method.
8702  */
8703
8704
8705 /**
8706  * _g_freedesktop_dbus_call_remove_match_finish:
8707  * @proxy: A #_GFreedesktopDBusProxy.
8708  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match().
8709  * @error: Return location for error or %NULL.
8710  *
8711  * Finishes an operation started with _g_freedesktop_dbus_call_remove_match().
8712  *
8713  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8714  */
8715
8716
8717 /**
8718  * _g_freedesktop_dbus_call_remove_match_sync:
8719  * @proxy: A #_GFreedesktopDBusProxy.
8720  * @arg_rule: Argument to pass with the method invocation.
8721  * @cancellable: (allow-none): A #GCancellable or %NULL.
8722  * @error: Return location for error or %NULL.
8723  *
8724  * 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.
8725  *
8726  * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method.
8727  *
8728  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8729  */
8730
8731
8732 /**
8733  * _g_freedesktop_dbus_call_request_name:
8734  * @proxy: A #_GFreedesktopDBusProxy.
8735  * @arg_name: Argument to pass with the method invocation.
8736  * @arg_flags: Argument to pass with the method invocation.
8737  * @cancellable: (allow-none): A #GCancellable or %NULL.
8738  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8739  * @user_data: User data to pass to @callback.
8740  *
8741  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy.
8742  * 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.
8743  * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation.
8744  *
8745  * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method.
8746  */
8747
8748
8749 /**
8750  * _g_freedesktop_dbus_call_request_name_finish:
8751  * @proxy: A #_GFreedesktopDBusProxy.
8752  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8753  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name().
8754  * @error: Return location for error or %NULL.
8755  *
8756  * Finishes an operation started with _g_freedesktop_dbus_call_request_name().
8757  *
8758  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8759  */
8760
8761
8762 /**
8763  * _g_freedesktop_dbus_call_request_name_sync:
8764  * @proxy: A #_GFreedesktopDBusProxy.
8765  * @arg_name: Argument to pass with the method invocation.
8766  * @arg_flags: Argument to pass with the method invocation.
8767  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8768  * @cancellable: (allow-none): A #GCancellable or %NULL.
8769  * @error: Return location for error or %NULL.
8770  *
8771  * 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.
8772  *
8773  * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method.
8774  *
8775  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8776  */
8777
8778
8779 /**
8780  * _g_freedesktop_dbus_call_start_service_by_name:
8781  * @proxy: A #_GFreedesktopDBusProxy.
8782  * @arg_name: Argument to pass with the method invocation.
8783  * @arg_flags: Argument to pass with the method invocation.
8784  * @cancellable: (allow-none): A #GCancellable or %NULL.
8785  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8786  * @user_data: User data to pass to @callback.
8787  *
8788  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy.
8789  * 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.
8790  * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation.
8791  *
8792  * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method.
8793  */
8794
8795
8796 /**
8797  * _g_freedesktop_dbus_call_start_service_by_name_finish:
8798  * @proxy: A #_GFreedesktopDBusProxy.
8799  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8800  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name().
8801  * @error: Return location for error or %NULL.
8802  *
8803  * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name().
8804  *
8805  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8806  */
8807
8808
8809 /**
8810  * _g_freedesktop_dbus_call_start_service_by_name_sync:
8811  * @proxy: A #_GFreedesktopDBusProxy.
8812  * @arg_name: Argument to pass with the method invocation.
8813  * @arg_flags: Argument to pass with the method invocation.
8814  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8815  * @cancellable: (allow-none): A #GCancellable or %NULL.
8816  * @error: Return location for error or %NULL.
8817  *
8818  * 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.
8819  *
8820  * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method.
8821  *
8822  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8823  */
8824
8825
8826 /**
8827  * _g_freedesktop_dbus_call_update_activation_environment:
8828  * @proxy: A #_GFreedesktopDBusProxy.
8829  * @arg_environment: Argument to pass with the method invocation.
8830  * @cancellable: (allow-none): A #GCancellable or %NULL.
8831  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8832  * @user_data: User data to pass to @callback.
8833  *
8834  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy.
8835  * 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.
8836  * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation.
8837  *
8838  * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method.
8839  */
8840
8841
8842 /**
8843  * _g_freedesktop_dbus_call_update_activation_environment_finish:
8844  * @proxy: A #_GFreedesktopDBusProxy.
8845  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment().
8846  * @error: Return location for error or %NULL.
8847  *
8848  * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment().
8849  *
8850  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8851  */
8852
8853
8854 /**
8855  * _g_freedesktop_dbus_call_update_activation_environment_sync:
8856  * @proxy: A #_GFreedesktopDBusProxy.
8857  * @arg_environment: Argument to pass with the method invocation.
8858  * @cancellable: (allow-none): A #GCancellable or %NULL.
8859  * @error: Return location for error or %NULL.
8860  *
8861  * 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.
8862  *
8863  * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method.
8864  *
8865  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8866  */
8867
8868
8869 /**
8870  * _g_freedesktop_dbus_complete_add_match:
8871  * @object: A #_GFreedesktopDBus.
8872  * @invocation: (transfer full): A #GDBusMethodInvocation.
8873  *
8874  * 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.
8875  *
8876  * This method will free @invocation, you cannot use it afterwards.
8877  */
8878
8879
8880 /**
8881  * _g_freedesktop_dbus_complete_get_connection_selinux_security_context:
8882  * @object: A #_GFreedesktopDBus.
8883  * @invocation: (transfer full): A #GDBusMethodInvocation.
8884  * @security_context: Parameter to return.
8885  *
8886  * 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.
8887  *
8888  * This method will free @invocation, you cannot use it afterwards.
8889  */
8890
8891
8892 /**
8893  * _g_freedesktop_dbus_complete_get_connection_unix_process_id:
8894  * @object: A #_GFreedesktopDBus.
8895  * @invocation: (transfer full): A #GDBusMethodInvocation.
8896  * @pid: Parameter to return.
8897  *
8898  * 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.
8899  *
8900  * This method will free @invocation, you cannot use it afterwards.
8901  */
8902
8903
8904 /**
8905  * _g_freedesktop_dbus_complete_get_connection_unix_user:
8906  * @object: A #_GFreedesktopDBus.
8907  * @invocation: (transfer full): A #GDBusMethodInvocation.
8908  * @uid: Parameter to return.
8909  *
8910  * 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.
8911  *
8912  * This method will free @invocation, you cannot use it afterwards.
8913  */
8914
8915
8916 /**
8917  * _g_freedesktop_dbus_complete_get_id:
8918  * @object: A #_GFreedesktopDBus.
8919  * @invocation: (transfer full): A #GDBusMethodInvocation.
8920  * @unique_id: Parameter to return.
8921  *
8922  * 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.
8923  *
8924  * This method will free @invocation, you cannot use it afterwards.
8925  */
8926
8927
8928 /**
8929  * _g_freedesktop_dbus_complete_get_name_owner:
8930  * @object: A #_GFreedesktopDBus.
8931  * @invocation: (transfer full): A #GDBusMethodInvocation.
8932  * @unique_name: Parameter to return.
8933  *
8934  * 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.
8935  *
8936  * This method will free @invocation, you cannot use it afterwards.
8937  */
8938
8939
8940 /**
8941  * _g_freedesktop_dbus_complete_hello:
8942  * @object: A #_GFreedesktopDBus.
8943  * @invocation: (transfer full): A #GDBusMethodInvocation.
8944  * @assigned_name: Parameter to return.
8945  *
8946  * 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.
8947  *
8948  * This method will free @invocation, you cannot use it afterwards.
8949  */
8950
8951
8952 /**
8953  * _g_freedesktop_dbus_complete_list_activatable_names:
8954  * @object: A #_GFreedesktopDBus.
8955  * @invocation: (transfer full): A #GDBusMethodInvocation.
8956  * @activatable_names: Parameter to return.
8957  *
8958  * 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.
8959  *
8960  * This method will free @invocation, you cannot use it afterwards.
8961  */
8962
8963
8964 /**
8965  * _g_freedesktop_dbus_complete_list_names:
8966  * @object: A #_GFreedesktopDBus.
8967  * @invocation: (transfer full): A #GDBusMethodInvocation.
8968  * @names: Parameter to return.
8969  *
8970  * 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.
8971  *
8972  * This method will free @invocation, you cannot use it afterwards.
8973  */
8974
8975
8976 /**
8977  * _g_freedesktop_dbus_complete_list_queued_owners:
8978  * @object: A #_GFreedesktopDBus.
8979  * @invocation: (transfer full): A #GDBusMethodInvocation.
8980  * @queued_owners: Parameter to return.
8981  *
8982  * 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.
8983  *
8984  * This method will free @invocation, you cannot use it afterwards.
8985  */
8986
8987
8988 /**
8989  * _g_freedesktop_dbus_complete_name_has_owner:
8990  * @object: A #_GFreedesktopDBus.
8991  * @invocation: (transfer full): A #GDBusMethodInvocation.
8992  * @has_owner: Parameter to return.
8993  *
8994  * 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.
8995  *
8996  * This method will free @invocation, you cannot use it afterwards.
8997  */
8998
8999
9000 /**
9001  * _g_freedesktop_dbus_complete_release_name:
9002  * @object: A #_GFreedesktopDBus.
9003  * @invocation: (transfer full): A #GDBusMethodInvocation.
9004  * @value: Parameter to return.
9005  *
9006  * 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.
9007  *
9008  * This method will free @invocation, you cannot use it afterwards.
9009  */
9010
9011
9012 /**
9013  * _g_freedesktop_dbus_complete_reload_config:
9014  * @object: A #_GFreedesktopDBus.
9015  * @invocation: (transfer full): A #GDBusMethodInvocation.
9016  *
9017  * 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.
9018  *
9019  * This method will free @invocation, you cannot use it afterwards.
9020  */
9021
9022
9023 /**
9024  * _g_freedesktop_dbus_complete_remove_match:
9025  * @object: A #_GFreedesktopDBus.
9026  * @invocation: (transfer full): A #GDBusMethodInvocation.
9027  *
9028  * 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.
9029  *
9030  * This method will free @invocation, you cannot use it afterwards.
9031  */
9032
9033
9034 /**
9035  * _g_freedesktop_dbus_complete_request_name:
9036  * @object: A #_GFreedesktopDBus.
9037  * @invocation: (transfer full): A #GDBusMethodInvocation.
9038  * @value: Parameter to return.
9039  *
9040  * 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.
9041  *
9042  * This method will free @invocation, you cannot use it afterwards.
9043  */
9044
9045
9046 /**
9047  * _g_freedesktop_dbus_complete_start_service_by_name:
9048  * @object: A #_GFreedesktopDBus.
9049  * @invocation: (transfer full): A #GDBusMethodInvocation.
9050  * @value: Parameter to return.
9051  *
9052  * 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.
9053  *
9054  * This method will free @invocation, you cannot use it afterwards.
9055  */
9056
9057
9058 /**
9059  * _g_freedesktop_dbus_complete_update_activation_environment:
9060  * @object: A #_GFreedesktopDBus.
9061  * @invocation: (transfer full): A #GDBusMethodInvocation.
9062  *
9063  * 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.
9064  *
9065  * This method will free @invocation, you cannot use it afterwards.
9066  */
9067
9068
9069 /**
9070  * _g_freedesktop_dbus_emit_name_acquired:
9071  * @object: A #_GFreedesktopDBus.
9072  * @arg_name: Argument to pass with the signal.
9073  *
9074  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> D-Bus signal.
9075  */
9076
9077
9078 /**
9079  * _g_freedesktop_dbus_emit_name_lost:
9080  * @object: A #_GFreedesktopDBus.
9081  * @arg_name: Argument to pass with the signal.
9082  *
9083  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> D-Bus signal.
9084  */
9085
9086
9087 /**
9088  * _g_freedesktop_dbus_emit_name_owner_changed:
9089  * @object: A #_GFreedesktopDBus.
9090  * @arg_name: Argument to pass with the signal.
9091  * @arg_old_owner: Argument to pass with the signal.
9092  * @arg_new_owner: Argument to pass with the signal.
9093  *
9094  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> D-Bus signal.
9095  */
9096
9097
9098 /**
9099  * _g_freedesktop_dbus_interface_info:
9100  *
9101  * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface.
9102  *
9103  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
9104  */
9105
9106
9107 /**
9108  * _g_freedesktop_dbus_override_properties:
9109  * @klass: The class structure for a #GObject<!-- -->-derived class.
9110  * @property_id_begin: The property id to assign to the first overridden property.
9111  *
9112  * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class.
9113  * The properties are overridden in the order they are defined.
9114  *
9115  * Returns: The last property id.
9116  */
9117
9118
9119 /**
9120  * _g_freedesktop_dbus_proxy_new:
9121  * @connection: A #GDBusConnection.
9122  * @flags: Flags from the #GDBusProxyFlags enumeration.
9123  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
9124  * @object_path: An object path.
9125  * @cancellable: (allow-none): A #GCancellable or %NULL.
9126  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
9127  * @user_data: User data to pass to @callback.
9128  *
9129  * 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.
9130  *
9131  * 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.
9132  * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation.
9133  *
9134  * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
9135  */
9136
9137
9138 /**
9139  * _g_freedesktop_dbus_proxy_new_finish:
9140  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new().
9141  * @error: Return location for error or %NULL
9142  *
9143  * Finishes an operation started with _g_freedesktop_dbus_proxy_new().
9144  *
9145  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9146  */
9147
9148
9149 /**
9150  * _g_freedesktop_dbus_proxy_new_for_bus:
9151  * @bus_type: A #GBusType.
9152  * @flags: Flags from the #GDBusProxyFlags enumeration.
9153  * @name: A bus name (well-known or unique).
9154  * @object_path: An object path.
9155  * @cancellable: (allow-none): A #GCancellable or %NULL.
9156  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
9157  * @user_data: User data to pass to @callback.
9158  *
9159  * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
9160  *
9161  * 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.
9162  * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation.
9163  *
9164  * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
9165  */
9166
9167
9168 /**
9169  * _g_freedesktop_dbus_proxy_new_for_bus_finish:
9170  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus().
9171  * @error: Return location for error or %NULL
9172  *
9173  * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus().
9174  *
9175  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9176  */
9177
9178
9179 /**
9180  * _g_freedesktop_dbus_proxy_new_for_bus_sync:
9181  * @bus_type: A #GBusType.
9182  * @flags: Flags from the #GDBusProxyFlags enumeration.
9183  * @name: A bus name (well-known or unique).
9184  * @object_path: An object path.
9185  * @cancellable: (allow-none): A #GCancellable or %NULL.
9186  * @error: Return location for error or %NULL
9187  *
9188  * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
9189  *
9190  * The calling thread is blocked until a reply is received.
9191  *
9192  * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
9193  *
9194  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9195  */
9196
9197
9198 /**
9199  * _g_freedesktop_dbus_proxy_new_sync:
9200  * @connection: A #GDBusConnection.
9201  * @flags: Flags from the #GDBusProxyFlags enumeration.
9202  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
9203  * @object_path: An object path.
9204  * @cancellable: (allow-none): A #GCancellable or %NULL.
9205  * @error: Return location for error or %NULL
9206  *
9207  * 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.
9208  *
9209  * The calling thread is blocked until a reply is received.
9210  *
9211  * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor.
9212  *
9213  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9214  */
9215
9216
9217 /**
9218  * _g_freedesktop_dbus_skeleton_new:
9219  *
9220  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
9221  *
9222  * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object.
9223  */
9224
9225
9226 /**
9227  * _g_io_module_get_default:
9228  * @extension_point: the name of an extension point
9229  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
9230  * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
9231  *
9232  * Retrieves the default object implementing @extension_point.
9233  *
9234  * If @envvar is not %NULL, and the environment variable with that
9235  * name is set, then the implementation it specifies will be tried
9236  * first. After that, or if @envvar is not set, all other
9237  * implementations will be tried in order of decreasing priority.
9238  *
9239  * If an extension point implementation implements #GInitable, then
9240  * that implementation will only be used if it initializes
9241  * successfully. Otherwise, if @verify_func is not %NULL, then it will
9242  * be called on each candidate implementation after construction, to
9243  * check if it is actually usable or not.
9244  *
9245  * The result is cached after it is generated the first time, and
9246  * the function is thread-safe.
9247  *
9248  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
9249  */
9250
9251
9252 /**
9253  * g_action_activate:
9254  * @action: a #GAction
9255  * @parameter: (allow-none): the parameter to the activation
9256  *
9257  * Activates the action.
9258  *
9259  * @parameter must be the correct type of parameter for the action (ie:
9260  * the parameter type given at construction time).  If the parameter
9261  * type was %NULL then @parameter must also be %NULL.
9262  *
9263  * Since: 2.28
9264  */
9265
9266
9267 /**
9268  * g_action_change_state:
9269  * @action: a #GAction
9270  * @value: the new state
9271  *
9272  * Request for the state of @action to be changed to @value.
9273  *
9274  * The action must be stateful and @value must be of the correct type.
9275  * See g_action_get_state_type().
9276  *
9277  * This call merely requests a change.  The action may refuse to change
9278  * its state or may change its state to something other than @value.
9279  * See g_action_get_state_hint().
9280  *
9281  * If the @value GVariant is floating, it is consumed.
9282  *
9283  * Since: 2.30
9284  */
9285
9286
9287 /**
9288  * g_action_get_enabled:
9289  * @action: a #GAction
9290  *
9291  * Checks if @action is currently enabled.
9292  *
9293  * An action must be enabled in order to be activated or in order to
9294  * have its state changed from outside callers.
9295  *
9296  * Returns: whether the action is enabled
9297  * Since: 2.28
9298  */
9299
9300
9301 /**
9302  * g_action_get_name:
9303  * @action: a #GAction
9304  *
9305  * Queries the name of @action.
9306  *
9307  * Returns: the name of the action
9308  * Since: 2.28
9309  */
9310
9311
9312 /**
9313  * g_action_get_parameter_type:
9314  * @action: a #GAction
9315  *
9316  * Queries the type of the parameter that must be given when activating
9317  * @action.
9318  *
9319  * When activating the action using g_action_activate(), the #GVariant
9320  * given to that function must be of the type returned by this function.
9321  *
9322  * In the case that this function returns %NULL, you must not give any
9323  * #GVariant, but %NULL instead.
9324  *
9325  * Returns: (allow-none): the parameter type
9326  * Since: 2.28
9327  */
9328
9329
9330 /**
9331  * g_action_get_state:
9332  * @action: a #GAction
9333  *
9334  * Queries the current state of @action.
9335  *
9336  * If the action is not stateful then %NULL will be returned.  If the
9337  * action is stateful then the type of the return value is the type
9338  * given by g_action_get_state_type().
9339  *
9340  * The return value (if non-%NULL) should be freed with
9341  * g_variant_unref() when it is no longer required.
9342  *
9343  * Returns: (transfer full): the current state of the action
9344  * Since: 2.28
9345  */
9346
9347
9348 /**
9349  * g_action_get_state_hint:
9350  * @action: a #GAction
9351  *
9352  * Requests a hint about the valid range of values for the state of
9353  * @action.
9354  *
9355  * If %NULL is returned it either means that the action is not stateful
9356  * or that there is no hint about the valid range of values for the
9357  * state of the action.
9358  *
9359  * If a #GVariant array is returned then each item in the array is a
9360  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
9361  * returned then the tuple specifies the inclusive lower and upper bound
9362  * of valid values for the state.
9363  *
9364  * In any case, the information is merely a hint.  It may be possible to
9365  * have a state value outside of the hinted range and setting a value
9366  * within the range may fail.
9367  *
9368  * The return value (if non-%NULL) should be freed with
9369  * g_variant_unref() when it is no longer required.
9370  *
9371  * Returns: (transfer full): the state range hint
9372  * Since: 2.28
9373  */
9374
9375
9376 /**
9377  * g_action_get_state_type:
9378  * @action: a #GAction
9379  *
9380  * Queries the type of the state of @action.
9381  *
9382  * If the action is stateful (e.g. created with
9383  * g_simple_action_new_stateful()) then this function returns the
9384  * #GVariantType of the state.  This is the type of the initial value
9385  * given as the state. All calls to g_action_change_state() must give a
9386  * #GVariant of this type and g_action_get_state() will return a
9387  * #GVariant of the same type.
9388  *
9389  * If the action is not stateful (e.g. created with g_simple_action_new())
9390  * then this function will return %NULL. In that case, g_action_get_state()
9391  * will return %NULL and you must not call g_action_change_state().
9392  *
9393  * Returns: (allow-none): the state type, if the action is stateful
9394  * Since: 2.28
9395  */
9396
9397
9398 /**
9399  * g_action_group_action_added:
9400  * @action_group: a #GActionGroup
9401  * @action_name: the name of an action in the group
9402  *
9403  * Emits the #GActionGroup::action-added signal on @action_group.
9404  *
9405  * This function should only be called by #GActionGroup implementations.
9406  *
9407  * Since: 2.28
9408  */
9409
9410
9411 /**
9412  * g_action_group_action_enabled_changed:
9413  * @action_group: a #GActionGroup
9414  * @action_name: the name of an action in the group
9415  * @enabled: whether or not the action is now enabled
9416  *
9417  * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
9418  *
9419  * This function should only be called by #GActionGroup implementations.
9420  *
9421  * Since: 2.28
9422  */
9423
9424
9425 /**
9426  * g_action_group_action_removed:
9427  * @action_group: a #GActionGroup
9428  * @action_name: the name of an action in the group
9429  *
9430  * Emits the #GActionGroup::action-removed signal on @action_group.
9431  *
9432  * This function should only be called by #GActionGroup implementations.
9433  *
9434  * Since: 2.28
9435  */
9436
9437
9438 /**
9439  * g_action_group_action_state_changed:
9440  * @action_group: a #GActionGroup
9441  * @action_name: the name of an action in the group
9442  * @state: the new state of the named action
9443  *
9444  * Emits the #GActionGroup::action-state-changed signal on @action_group.
9445  *
9446  * This function should only be called by #GActionGroup implementations.
9447  *
9448  * Since: 2.28
9449  */
9450
9451
9452 /**
9453  * g_action_group_activate_action:
9454  * @action_group: a #GActionGroup
9455  * @action_name: the name of the action to activate
9456  * @parameter: (allow-none): parameters to the activation
9457  *
9458  * Activate the named action within @action_group.
9459  *
9460  * If the action is expecting a parameter, then the correct type of
9461  * parameter must be given as @parameter.  If the action is expecting no
9462  * parameters then @parameter must be %NULL.  See
9463  * g_action_group_get_action_parameter_type().
9464  *
9465  * Since: 2.28
9466  */
9467
9468
9469 /**
9470  * g_action_group_change_action_state:
9471  * @action_group: a #GActionGroup
9472  * @action_name: the name of the action to request the change on
9473  * @value: the new state
9474  *
9475  * Request for the state of the named action within @action_group to be
9476  * changed to @value.
9477  *
9478  * The action must be stateful and @value must be of the correct type.
9479  * See g_action_group_get_action_state_type().
9480  *
9481  * This call merely requests a change.  The action may refuse to change
9482  * its state or may change its state to something other than @value.
9483  * See g_action_group_get_action_state_hint().
9484  *
9485  * If the @value GVariant is floating, it is consumed.
9486  *
9487  * Since: 2.28
9488  */
9489
9490
9491 /**
9492  * g_action_group_get_action_enabled:
9493  * @action_group: a #GActionGroup
9494  * @action_name: the name of the action to query
9495  *
9496  * Checks if the named action within @action_group is currently enabled.
9497  *
9498  * An action must be enabled in order to be activated or in order to
9499  * have its state changed from outside callers.
9500  *
9501  * Returns: whether or not the action is currently enabled
9502  * Since: 2.28
9503  */
9504
9505
9506 /**
9507  * g_action_group_get_action_parameter_type:
9508  * @action_group: a #GActionGroup
9509  * @action_name: the name of the action to query
9510  *
9511  * Queries the type of the parameter that must be given when activating
9512  * the named action within @action_group.
9513  *
9514  * When activating the action using g_action_group_activate_action(),
9515  * the #GVariant given to that function must be of the type returned
9516  * by this function.
9517  *
9518  * In the case that this function returns %NULL, you must not give any
9519  * #GVariant, but %NULL instead.
9520  *
9521  * The parameter type of a particular action will never change but it is
9522  * possible for an action to be removed and for a new action to be added
9523  * with the same name but a different parameter type.
9524  *
9525  * Returns: the parameter type
9526  * Since: 2.28
9527  */
9528
9529
9530 /**
9531  * g_action_group_get_action_state:
9532  * @action_group: a #GActionGroup
9533  * @action_name: the name of the action to query
9534  *
9535  * Queries the current state of the named action within @action_group.
9536  *
9537  * If the action is not stateful then %NULL will be returned.  If the
9538  * action is stateful then the type of the return value is the type
9539  * given by g_action_group_get_action_state_type().
9540  *
9541  * The return value (if non-%NULL) should be freed with
9542  * g_variant_unref() when it is no longer required.
9543  *
9544  * Returns: (allow-none): the current state of the action
9545  * Since: 2.28
9546  */
9547
9548
9549 /**
9550  * g_action_group_get_action_state_hint:
9551  * @action_group: a #GActionGroup
9552  * @action_name: the name of the action to query
9553  *
9554  * Requests a hint about the valid range of values for the state of the
9555  * named action within @action_group.
9556  *
9557  * If %NULL is returned it either means that the action is not stateful
9558  * or that there is no hint about the valid range of values for the
9559  * state of the action.
9560  *
9561  * If a #GVariant array is returned then each item in the array is a
9562  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
9563  * returned then the tuple specifies the inclusive lower and upper bound
9564  * of valid values for the state.
9565  *
9566  * In any case, the information is merely a hint.  It may be possible to
9567  * have a state value outside of the hinted range and setting a value
9568  * within the range may fail.
9569  *
9570  * The return value (if non-%NULL) should be freed with
9571  * g_variant_unref() when it is no longer required.
9572  *
9573  * Returns: (transfer full): the state range hint
9574  * Since: 2.28
9575  */
9576
9577
9578 /**
9579  * g_action_group_get_action_state_type:
9580  * @action_group: a #GActionGroup
9581  * @action_name: the name of the action to query
9582  *
9583  * Queries the type of the state of the named action within
9584  * @action_group.
9585  *
9586  * If the action is stateful then this function returns the
9587  * #GVariantType of the state.  All calls to
9588  * g_action_group_change_action_state() must give a #GVariant of this
9589  * type and g_action_group_get_action_state() will return a #GVariant
9590  * of the same type.
9591  *
9592  * If the action is not stateful then this function will return %NULL.
9593  * In that case, g_action_group_get_action_state() will return %NULL
9594  * and you must not call g_action_group_change_action_state().
9595  *
9596  * The state type of a particular action will never change but it is
9597  * possible for an action to be removed and for a new action to be added
9598  * with the same name but a different state type.
9599  *
9600  * Returns: (transfer full): the state type, if the action is stateful
9601  * Since: 2.28
9602  */
9603
9604
9605 /**
9606  * g_action_group_has_action:
9607  * @action_group: a #GActionGroup
9608  * @action_name: the name of the action to check for
9609  *
9610  * Checks if the named action exists within @action_group.
9611  *
9612  * Returns: whether the named action exists
9613  * Since: 2.28
9614  */
9615
9616
9617 /**
9618  * g_action_group_list_actions:
9619  * @action_group: a #GActionGroup
9620  *
9621  * Lists the actions contained within @action_group.
9622  *
9623  * The caller is responsible for freeing the list with g_strfreev() when
9624  * it is no longer required.
9625  *
9626  * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
9627  * Since: 2.28
9628  */
9629
9630
9631 /**
9632  * g_action_group_query_action:
9633  * @action_group: a #GActionGroup
9634  * @action_name: the name of an action in the group
9635  * @enabled: (out): if the action is presently enabled
9636  * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
9637  * @state_type: (out) (allow-none): the state type, or %NULL if stateless
9638  * @state_hint: (out) (allow-none): the state hint, or %NULL if none
9639  * @state: (out) (allow-none): the current state, or %NULL if stateless
9640  *
9641  * Queries all aspects of the named action within an @action_group.
9642  *
9643  * This function acquires the information available from
9644  * g_action_group_has_action(), g_action_group_get_action_enabled(),
9645  * g_action_group_get_action_parameter_type(),
9646  * g_action_group_get_action_state_type(),
9647  * g_action_group_get_action_state_hint() and
9648  * g_action_group_get_action_state() with a single function call.
9649  *
9650  * This provides two main benefits.
9651  *
9652  * The first is the improvement in efficiency that comes with not having
9653  * to perform repeated lookups of the action in order to discover
9654  * different things about it.  The second is that implementing
9655  * #GActionGroup can now be done by only overriding this one virtual
9656  * function.
9657  *
9658  * The interface provides a default implementation of this function that
9659  * calls the individual functions, as required, to fetch the
9660  * information.  The interface also provides default implementations of
9661  * those functions that call this function.  All implementations,
9662  * therefore, must override either this function or all of the others.
9663  *
9664  * If the action exists, %TRUE is returned and any of the requested
9665  * fields (as indicated by having a non-%NULL reference passed in) are
9666  * filled.  If the action doesn't exist, %FALSE is returned and the
9667  * fields may or may not have been modified.
9668  *
9669  * Returns: %TRUE if the action exists, else %FALSE
9670  * Since: 2.32
9671  */
9672
9673
9674 /**
9675  * g_action_map_add_action:
9676  * @action_map: a #GActionMap
9677  * @action: a #GAction
9678  *
9679  * Adds an action to the @action_map.
9680  *
9681  * If the action map already contains an action with the same name
9682  * as @action then the old action is dropped from the action map.
9683  *
9684  * The action map takes its own reference on @action.
9685  *
9686  * Since: 2.32
9687  */
9688
9689
9690 /**
9691  * g_action_map_add_action_entries:
9692  * @action_map: a #GActionMap
9693  * @entries: a pointer to the first item in an array of #GActionEntry structs
9694  * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
9695  * @user_data: the user data for signal connections
9696  *
9697  * A convenience function for creating multiple #GSimpleAction instances
9698  * and adding them to a #GActionMap.
9699  *
9700  * Each action is constructed as per one #GActionEntry.
9701  *
9702  * <example>
9703  * <title>Using g_action_map_add_action_entries()</title>
9704  * <programlisting>
9705  * static void
9706  * activate_quit (GSimpleAction *simple,
9707  *                GVariant      *parameter,
9708  *                gpointer       user_data)
9709  * {
9710  *   exit (0);
9711  * }
9712  *
9713  * static void
9714  * activate_print_string (GSimpleAction *simple,
9715  *                        GVariant      *parameter,
9716  *                        gpointer       user_data)
9717  * {
9718  *   g_print ("%s\n", g_variant_get_string (parameter, NULL));
9719  * }
9720  *
9721  * static GActionGroup *
9722  * create_action_group (void)
9723  * {
9724  *   const GActionEntry entries[] = {
9725  *     { "quit",         activate_quit              },
9726  *     { "print-string", activate_print_string, "s" }
9727  *   };
9728  *   GSimpleActionGroup *group;
9729  *
9730  *   group = g_simple_action_group_new ();
9731  *   g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
9732  *
9733  *   return G_ACTION_GROUP (group);
9734  * }
9735  * </programlisting>
9736  * </example>
9737  *
9738  * Since: 2.32
9739  */
9740
9741
9742 /**
9743  * g_action_map_lookup_action:
9744  * @action_map: a #GActionMap
9745  * @action_name: the name of an action
9746  *
9747  * Looks up the action with the name @action_name in @action_map.
9748  *
9749  * If no such action exists, returns %NULL.
9750  *
9751  * Returns: (transfer none): a #GAction, or %NULL
9752  * Since: 2.32
9753  */
9754
9755
9756 /**
9757  * g_action_map_remove_action:
9758  * @action_map: a #GActionMap
9759  * @action_name: the name of the action
9760  *
9761  * Removes the named action from the action map.
9762  *
9763  * If no action of this name is in the map then nothing happens.
9764  *
9765  * Since: 2.32
9766  */
9767
9768
9769 /**
9770  * g_app_info_add_supports_type:
9771  * @appinfo: a #GAppInfo.
9772  * @content_type: a string.
9773  * @error: a #GError.
9774  *
9775  * Adds a content type to the application information to indicate the
9776  * application is capable of opening files with the given content type.
9777  *
9778  * Returns: %TRUE on success, %FALSE on error.
9779  */
9780
9781
9782 /**
9783  * g_app_info_can_delete:
9784  * @appinfo: a #GAppInfo
9785  *
9786  * Obtains the information whether the #GAppInfo can be deleted.
9787  * See g_app_info_delete().
9788  *
9789  * Returns: %TRUE if @appinfo can be deleted
9790  * Since: 2.20
9791  */
9792
9793
9794 /**
9795  * g_app_info_can_remove_supports_type:
9796  * @appinfo: a #GAppInfo.
9797  *
9798  * Checks if a supported content type can be removed from an application.
9799  *
9800  * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
9801  */
9802
9803
9804 /**
9805  * g_app_info_create_from_commandline:
9806  * @commandline: the commandline to use
9807  * @application_name: (allow-none): the application name, or %NULL to use @commandline
9808  * @flags: flags that can specify details of the created #GAppInfo
9809  * @error: a #GError location to store the error occurring, %NULL to ignore.
9810  *
9811  * Creates a new #GAppInfo from the given information.
9812  *
9813  * Note that for @commandline, the quoting rules of the Exec key of the
9814  * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
9815  * Entry Specification</ulink> are applied. For example, if the @commandline contains
9816  * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
9817  * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
9818  *
9819  * Returns: (transfer full): new #GAppInfo for given command.
9820  */
9821
9822
9823 /**
9824  * g_app_info_delete:
9825  * @appinfo: a #GAppInfo
9826  *
9827  * Tries to delete a #GAppInfo.
9828  *
9829  * On some platforms, there may be a difference between user-defined
9830  * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
9831  * cannot. See g_app_info_can_delete().
9832  *
9833  * Virtual: do_delete
9834  * Returns: %TRUE if @appinfo has been deleted
9835  * Since: 2.20
9836  */
9837
9838
9839 /**
9840  * g_app_info_dup:
9841  * @appinfo: a #GAppInfo.
9842  *
9843  * Creates a duplicate of a #GAppInfo.
9844  *
9845  * Returns: (transfer full): a duplicate of @appinfo.
9846  */
9847
9848
9849 /**
9850  * g_app_info_equal:
9851  * @appinfo1: the first #GAppInfo.
9852  * @appinfo2: the second #GAppInfo.
9853  *
9854  * Checks if two #GAppInfo<!-- -->s are equal.
9855  *
9856  * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
9857  */
9858
9859
9860 /**
9861  * g_app_info_get_all:
9862  *
9863  * Gets a list of all of the applications currently registered
9864  * on this system.
9865  *
9866  * For desktop files, this includes applications that have
9867  * <literal>NoDisplay=true</literal> set or are excluded from
9868  * display by means of <literal>OnlyShowIn</literal> or
9869  * <literal>NotShowIn</literal>. See g_app_info_should_show().
9870  * The returned list does not include applications which have
9871  * the <literal>Hidden</literal> key set.
9872  *
9873  * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
9874  */
9875
9876
9877 /**
9878  * g_app_info_get_all_for_type:
9879  * @content_type: the content type to find a #GAppInfo for
9880  *
9881  * Gets a list of all #GAppInfos for a given content type,
9882  * including the recommended and fallback #GAppInfos. See
9883  * g_app_info_get_recommended_for_type() and
9884  * g_app_info_get_fallback_for_type().
9885  *
9886  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9887  */
9888
9889
9890 /**
9891  * g_app_info_get_commandline:
9892  * @appinfo: a #GAppInfo
9893  *
9894  * Gets the commandline with which the application will be
9895  * started.
9896  *
9897  * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
9898  * Since: 2.20
9899  */
9900
9901
9902 /**
9903  * g_app_info_get_default_for_type:
9904  * @content_type: the content type to find a #GAppInfo for
9905  * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
9906  *
9907  * Gets the default #GAppInfo for a given content type.
9908  *
9909  * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
9910  */
9911
9912
9913 /**
9914  * g_app_info_get_default_for_uri_scheme:
9915  * @uri_scheme: a string containing a URI scheme.
9916  *
9917  * Gets the default application for handling URIs with
9918  * the given URI scheme. A URI scheme is the initial part
9919  * of the URI, up to but not including the ':', e.g. "http",
9920  * "ftp" or "sip".
9921  *
9922  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
9923  */
9924
9925
9926 /**
9927  * g_app_info_get_description:
9928  * @appinfo: a #GAppInfo.
9929  *
9930  * Gets a human-readable description of an installed application.
9931  *
9932  * Returns: a string containing a description of the application @appinfo, or %NULL if none.
9933  */
9934
9935
9936 /**
9937  * g_app_info_get_display_name:
9938  * @appinfo: a #GAppInfo.
9939  *
9940  * Gets the display name of the application. The display name is often more
9941  * descriptive to the user than the name itself.
9942  *
9943  * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9944  * Since: 2.24
9945  */
9946
9947
9948 /**
9949  * g_app_info_get_executable:
9950  * @appinfo: a #GAppInfo
9951  *
9952  * Gets the executable's name for the installed application.
9953  *
9954  * Returns: a string containing the @appinfo's application binaries name
9955  */
9956
9957
9958 /**
9959  * g_app_info_get_fallback_for_type:
9960  * @content_type: the content type to find a #GAppInfo for
9961  *
9962  * Gets a list of fallback #GAppInfos for a given content type, i.e.
9963  * those applications which claim to support the given content type
9964  * by MIME type subclassing and not directly.
9965  *
9966  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9967  * Since: 2.28
9968  */
9969
9970
9971 /**
9972  * g_app_info_get_icon:
9973  * @appinfo: a #GAppInfo.
9974  *
9975  * Gets the icon for the application.
9976  *
9977  * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9978  */
9979
9980
9981 /**
9982  * g_app_info_get_id:
9983  * @appinfo: a #GAppInfo.
9984  *
9985  * Gets the ID of an application. An id is a string that
9986  * identifies the application. The exact format of the id is
9987  * platform dependent. For instance, on Unix this is the
9988  * desktop file id from the xdg menu specification.
9989  *
9990  * Note that the returned ID may be %NULL, depending on how
9991  * the @appinfo has been constructed.
9992  *
9993  * Returns: a string containing the application's ID.
9994  */
9995
9996
9997 /**
9998  * g_app_info_get_name:
9999  * @appinfo: a #GAppInfo.
10000  *
10001  * Gets the installed name of the application.
10002  *
10003  * Returns: the name of the application for @appinfo.
10004  */
10005
10006
10007 /**
10008  * g_app_info_get_recommended_for_type:
10009  * @content_type: the content type to find a #GAppInfo for
10010  *
10011  * Gets a list of recommended #GAppInfos for a given content type, i.e.
10012  * those applications which claim to support the given content type exactly,
10013  * and not by MIME type subclassing.
10014  * Note that the first application of the list is the last used one, i.e.
10015  * the last one for which g_app_info_set_as_last_used_for_type() has been
10016  * called.
10017  *
10018  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
10019  * Since: 2.28
10020  */
10021
10022
10023 /**
10024  * g_app_info_get_supported_types:
10025  * @appinfo: a #GAppInfo that can handle files
10026  *
10027  * Retrieves the list of content types that @app_info claims to support.
10028  * If this information is not provided by the environment, this function
10029  * will return %NULL.
10030  * This function does not take in consideration associations added with
10031  * g_app_info_add_supports_type(), but only those exported directly by
10032  * the application.
10033  *
10034  * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
10035  * Since: 2.34
10036  */
10037
10038
10039 /**
10040  * g_app_info_launch:
10041  * @appinfo: a #GAppInfo
10042  * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
10043  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
10044  * @error: a #GError
10045  *
10046  * Launches the application. Passes @files to the launched application
10047  * as arguments, using the optional @launch_context to get information
10048  * about the details of the launcher (like what screen it is on).
10049  * On error, @error will be set accordingly.
10050  *
10051  * To launch the application without arguments pass a %NULL @files list.
10052  *
10053  * Note that even if the launch is successful the application launched
10054  * can fail to start if it runs into problems during startup. There is
10055  * no way to detect this.
10056  *
10057  * Some URIs can be changed when passed through a GFile (for instance
10058  * unsupported URIs with strange formats like mailto:), so if you have
10059  * a textual URI you want to pass in as argument, consider using
10060  * g_app_info_launch_uris() instead.
10061  *
10062  * The launched application inherits the environment of the launching
10063  * process, but it can be modified with g_app_launch_context_setenv() and
10064  * g_app_launch_context_unsetenv().
10065  *
10066  * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
10067  * environment variable with the path of the launched desktop file and
10068  * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
10069  * id of the launched process. This can be used to ignore
10070  * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
10071  * by further processes. The <envar>DISPLAY</envar> and
10072  * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
10073  * set, based on information provided in @launch_context.
10074  *
10075  * Returns: %TRUE on successful launch, %FALSE otherwise.
10076  */
10077
10078
10079 /**
10080  * g_app_info_launch_default_for_uri:
10081  * @uri: the uri to show
10082  * @launch_context: (allow-none): an optional #GAppLaunchContext.
10083  * @error: a #GError.
10084  *
10085  * Utility function that launches the default application
10086  * registered to handle the specified uri. Synchronous I/O
10087  * is done on the uri to detect the type of the file if
10088  * required.
10089  *
10090  * Returns: %TRUE on success, %FALSE on error.
10091  */
10092
10093
10094 /**
10095  * g_app_info_launch_uris:
10096  * @appinfo: a #GAppInfo
10097  * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
10098  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
10099  * @error: a #GError
10100  *
10101  * Launches the application. This passes the @uris to the launched application
10102  * as arguments, using the optional @launch_context to get information
10103  * about the details of the launcher (like what screen it is on).
10104  * On error, @error will be set accordingly.
10105  *
10106  * To launch the application without arguments pass a %NULL @uris list.
10107  *
10108  * Note that even if the launch is successful the application launched
10109  * can fail to start if it runs into problems during startup. There is
10110  * no way to detect this.
10111  *
10112  * Returns: %TRUE on successful launch, %FALSE otherwise.
10113  */
10114
10115
10116 /**
10117  * g_app_info_remove_supports_type:
10118  * @appinfo: a #GAppInfo.
10119  * @content_type: a string.
10120  * @error: a #GError.
10121  *
10122  * Removes a supported type from an application, if possible.
10123  *
10124  * Returns: %TRUE on success, %FALSE on error.
10125  */
10126
10127
10128 /**
10129  * g_app_info_reset_type_associations:
10130  * @content_type: a content type
10131  *
10132  * Removes all changes to the type associations done by
10133  * g_app_info_set_as_default_for_type(),
10134  * g_app_info_set_as_default_for_extension(),
10135  * g_app_info_add_supports_type() or
10136  * g_app_info_remove_supports_type().
10137  *
10138  * Since: 2.20
10139  */
10140
10141
10142 /**
10143  * g_app_info_set_as_default_for_extension:
10144  * @appinfo: a #GAppInfo.
10145  * @extension: a string containing the file extension (without the dot).
10146  * @error: a #GError.
10147  *
10148  * Sets the application as the default handler for the given file extension.
10149  *
10150  * Returns: %TRUE on success, %FALSE on error.
10151  */
10152
10153
10154 /**
10155  * g_app_info_set_as_default_for_type:
10156  * @appinfo: a #GAppInfo.
10157  * @content_type: the content type.
10158  * @error: a #GError.
10159  *
10160  * Sets the application as the default handler for a given type.
10161  *
10162  * Returns: %TRUE on success, %FALSE on error.
10163  */
10164
10165
10166 /**
10167  * g_app_info_set_as_last_used_for_type:
10168  * @appinfo: a #GAppInfo.
10169  * @content_type: the content type.
10170  * @error: a #GError.
10171  *
10172  * Sets the application as the last used application for a given type.
10173  * This will make the application appear as first in the list returned
10174  * by g_app_info_get_recommended_for_type(), regardless of the default
10175  * application for that content type.
10176  *
10177  * Returns: %TRUE on success, %FALSE on error.
10178  */
10179
10180
10181 /**
10182  * g_app_info_should_show:
10183  * @appinfo: a #GAppInfo.
10184  *
10185  * Checks if the application info should be shown in menus that
10186  * list available applications.
10187  *
10188  * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
10189  */
10190
10191
10192 /**
10193  * g_app_info_supports_files:
10194  * @appinfo: a #GAppInfo.
10195  *
10196  * Checks if the application accepts files as arguments.
10197  *
10198  * Returns: %TRUE if the @appinfo supports files.
10199  */
10200
10201
10202 /**
10203  * g_app_info_supports_uris:
10204  * @appinfo: a #GAppInfo.
10205  *
10206  * Checks if the application supports reading files and directories from URIs.
10207  *
10208  * Returns: %TRUE if the @appinfo supports URIs.
10209  */
10210
10211
10212 /**
10213  * g_app_launch_context_get_display:
10214  * @context: a #GAppLaunchContext
10215  * @info: a #GAppInfo
10216  * @files: (element-type GFile): a #GList of #GFile objects
10217  *
10218  * Gets the display string for the @context. This is used to ensure new
10219  * applications are started on the same display as the launching
10220  * application, by setting the <envar>DISPLAY</envar> environment variable.
10221  *
10222  * Returns: a display string for the display.
10223  */
10224
10225
10226 /**
10227  * g_app_launch_context_get_environment:
10228  * @context: a #GAppLaunchContext
10229  *
10230  * Gets the complete environment variable list to be passed to
10231  * the child process when @context is used to launch an application.
10232  * This is a %NULL-terminated array of strings, where each string has
10233  * the form <literal>KEY=VALUE</literal>.
10234  *
10235  * Returns: (array zero-terminated=1) (transfer full): the child's environment
10236  * Since: 2.32
10237  */
10238
10239
10240 /**
10241  * g_app_launch_context_get_startup_notify_id:
10242  * @context: a #GAppLaunchContext
10243  * @info: a #GAppInfo
10244  * @files: (element-type GFile): a #GList of of #GFile objects
10245  *
10246  * Initiates startup notification for the application and returns the
10247  * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
10248  * if supported.
10249  *
10250  * Startup notification IDs are defined in the <ulink
10251  * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
10252  * FreeDesktop.Org Startup Notifications standard</ulink>.
10253  *
10254  * Returns: a startup notification ID for the application, or %NULL if not supported.
10255  */
10256
10257
10258 /**
10259  * g_app_launch_context_launch_failed:
10260  * @context: a #GAppLaunchContext.
10261  * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
10262  *
10263  * Called when an application has failed to launch, so that it can cancel
10264  * the application startup notification started in g_app_launch_context_get_startup_notify_id().
10265  */
10266
10267
10268 /**
10269  * g_app_launch_context_new:
10270  *
10271  * Creates a new application launch context. This is not normally used,
10272  * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
10273  *
10274  * Returns: a #GAppLaunchContext.
10275  */
10276
10277
10278 /**
10279  * g_app_launch_context_setenv:
10280  * @context: a #GAppLaunchContext
10281  * @variable: the environment variable to set
10282  * @value: the value for to set the variable to.
10283  *
10284  * Arranges for @variable to be set to @value in the child's
10285  * environment when @context is used to launch an application.
10286  *
10287  * Since: 2.32
10288  */
10289
10290
10291 /**
10292  * g_app_launch_context_unsetenv:
10293  * @context: a #GAppLaunchContext
10294  * @variable: the environment variable to remove
10295  *
10296  * Arranges for @variable to be unset in the child's environment
10297  * when @context is used to launch an application.
10298  *
10299  * Since: 2.32
10300  */
10301
10302
10303 /**
10304  * g_application_activate:
10305  * @application: a #GApplication
10306  *
10307  * Activates the application.
10308  *
10309  * In essence, this results in the #GApplication::activate signal being
10310  * emitted in the primary instance.
10311  *
10312  * The application must be registered before calling this function.
10313  *
10314  * Since: 2.28
10315  */
10316
10317
10318 /**
10319  * g_application_command_line_get_arguments:
10320  * @cmdline: a #GApplicationCommandLine
10321  * @argc: (out) (allow-none): the length of the arguments array, or %NULL
10322  *
10323  * Gets the list of arguments that was passed on the command line.
10324  *
10325  * The strings in the array may contain non-utf8 data.
10326  *
10327  * The return value is %NULL-terminated and should be freed using
10328  * g_strfreev().
10329  *
10330  * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
10331  * Since: 2.28
10332  */
10333
10334
10335 /**
10336  * g_application_command_line_get_cwd:
10337  * @cmdline: a #GApplicationCommandLine
10338  *
10339  * Gets the working directory of the command line invocation.
10340  * The string may contain non-utf8 data.
10341  *
10342  * It is possible that the remote application did not send a working
10343  * directory, so this may be %NULL.
10344  *
10345  * The return value should not be modified or freed and is valid for as
10346  * long as @cmdline exists.
10347  *
10348  * Returns: the current directory, or %NULL
10349  * Since: 2.28
10350  */
10351
10352
10353 /**
10354  * g_application_command_line_get_environ:
10355  * @cmdline: a #GApplicationCommandLine
10356  *
10357  * Gets the contents of the 'environ' variable of the command line
10358  * invocation, as would be returned by g_get_environ(), ie as a
10359  * %NULL-terminated list of strings in the form 'NAME=VALUE'.
10360  * The strings may contain non-utf8 data.
10361  *
10362  * The remote application usually does not send an environment.  Use
10363  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
10364  * set it is possible that the environment is still not available (due
10365  * to invocation messages from other applications).
10366  *
10367  * The return value should not be modified or freed and is valid for as
10368  * long as @cmdline exists.
10369  *
10370  * See g_application_command_line_getenv() if you are only interested
10371  * in the value of a single environment variable.
10372  *
10373  * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
10374  * Since: 2.28
10375  */
10376
10377
10378 /**
10379  * g_application_command_line_get_exit_status:
10380  * @cmdline: a #GApplicationCommandLine
10381  *
10382  * Gets the exit status of @cmdline.  See
10383  * g_application_command_line_set_exit_status() for more information.
10384  *
10385  * Returns: the exit status
10386  * Since: 2.28
10387  */
10388
10389
10390 /**
10391  * g_application_command_line_get_is_remote:
10392  * @cmdline: a #GApplicationCommandLine
10393  *
10394  * Determines if @cmdline represents a remote invocation.
10395  *
10396  * Returns: %TRUE if the invocation was remote
10397  * Since: 2.28
10398  */
10399
10400
10401 /**
10402  * g_application_command_line_get_platform_data:
10403  * @cmdline: #GApplicationCommandLine
10404  *
10405  * Gets the platform data associated with the invocation of @cmdline.
10406  *
10407  * This is a #GVariant dictionary containing information about the
10408  * context in which the invocation occurred.  It typically contains
10409  * information like the current working directory and the startup
10410  * notification ID.
10411  *
10412  * For local invocation, it will be %NULL.
10413  *
10414  * Returns: (allow-none): the platform data, or %NULL
10415  * Since: 2.28
10416  */
10417
10418
10419 /**
10420  * g_application_command_line_getenv:
10421  * @cmdline: a #GApplicationCommandLine
10422  * @name: the environment variable to get
10423  *
10424  * Gets the value of a particular environment variable of the command
10425  * line invocation, as would be returned by g_getenv().  The strings may
10426  * contain non-utf8 data.
10427  *
10428  * The remote application usually does not send an environment.  Use
10429  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
10430  * set it is possible that the environment is still not available (due
10431  * to invocation messages from other applications).
10432  *
10433  * The return value should not be modified or freed and is valid for as
10434  * long as @cmdline exists.
10435  *
10436  * Returns: the value of the variable, or %NULL if unset or unsent
10437  * Since: 2.28
10438  */
10439
10440
10441 /**
10442  * g_application_command_line_print:
10443  * @cmdline: a #GApplicationCommandLine
10444  * @format: a printf-style format string
10445  * @...: arguments, as per @format
10446  *
10447  * Formats a message and prints it using the stdout print handler in the
10448  * invoking process.
10449  *
10450  * If @cmdline is a local invocation then this is exactly equivalent to
10451  * g_print().  If @cmdline is remote then this is equivalent to calling
10452  * g_print() in the invoking process.
10453  *
10454  * Since: 2.28
10455  */
10456
10457
10458 /**
10459  * g_application_command_line_printerr:
10460  * @cmdline: a #GApplicationCommandLine
10461  * @format: a printf-style format string
10462  * @...: arguments, as per @format
10463  *
10464  * Formats a message and prints it using the stderr print handler in the
10465  * invoking process.
10466  *
10467  * If @cmdline is a local invocation then this is exactly equivalent to
10468  * g_printerr().  If @cmdline is remote then this is equivalent to
10469  * calling g_printerr() in the invoking process.
10470  *
10471  * Since: 2.28
10472  */
10473
10474
10475 /**
10476  * g_application_command_line_set_exit_status:
10477  * @cmdline: a #GApplicationCommandLine
10478  * @exit_status: the exit status
10479  *
10480  * Sets the exit status that will be used when the invoking process
10481  * exits.
10482  *
10483  * The return value of the #GApplication::command-line signal is
10484  * passed to this function when the handler returns.  This is the usual
10485  * way of setting the exit status.
10486  *
10487  * In the event that you want the remote invocation to continue running
10488  * and want to decide on the exit status in the future, you can use this
10489  * call.  For the case of a remote invocation, the remote process will
10490  * typically exit when the last reference is dropped on @cmdline.  The
10491  * exit status of the remote process will be equal to the last value
10492  * that was set with this function.
10493  *
10494  * In the case that the commandline invocation is local, the situation
10495  * is slightly more complicated.  If the commandline invocation results
10496  * in the mainloop running (ie: because the use-count of the application
10497  * increased to a non-zero value) then the application is considered to
10498  * have been 'successful' in a certain sense, and the exit status is
10499  * always zero.  If the application use count is zero, though, the exit
10500  * status of the local #GApplicationCommandLine is used.
10501  *
10502  * Since: 2.28
10503  */
10504
10505
10506 /**
10507  * g_application_get_application_id:
10508  * @application: a #GApplication
10509  *
10510  * Gets the unique identifier for @application.
10511  *
10512  * Returns: the identifier for @application, owned by @application
10513  * Since: 2.28
10514  */
10515
10516
10517 /**
10518  * g_application_get_dbus_connection:
10519  * @application: a #GApplication
10520  *
10521  * Gets the #GDBusConnection being used by the application, or %NULL.
10522  *
10523  * If #GApplication is using its D-Bus backend then this function will
10524  * return the #GDBusConnection being used for uniqueness and
10525  * communication with the desktop environment and other instances of the
10526  * application.
10527  *
10528  * If #GApplication is not using D-Bus then this function will return
10529  * %NULL.  This includes the situation where the D-Bus backend would
10530  * normally be in use but we were unable to connect to the bus.
10531  *
10532  * This function must not be called before the application has been
10533  * registered.  See g_application_get_is_registered().
10534  *
10535  * Returns: (transfer none): a #GDBusConnection, or %NULL
10536  * Since: 2.34
10537  */
10538
10539
10540 /**
10541  * g_application_get_dbus_object_path:
10542  * @application: a #GApplication
10543  *
10544  * Gets the D-Bus object path being used by the application, or %NULL.
10545  *
10546  * If #GApplication is using its D-Bus backend then this function will
10547  * return the D-Bus object path that #GApplication is using.  If the
10548  * application is the primary instance then there is an object published
10549  * at this path.  If the application is not the primary instance then
10550  * the result of this function is undefined.
10551  *
10552  * If #GApplication is not using D-Bus then this function will return
10553  * %NULL.  This includes the situation where the D-Bus backend would
10554  * normally be in use but we were unable to connect to the bus.
10555  *
10556  * This function must not be called before the application has been
10557  * registered.  See g_application_get_is_registered().
10558  *
10559  * Returns: the object path, or %NULL
10560  * Since: 2.34
10561  */
10562
10563
10564 /**
10565  * g_application_get_default:
10566  *
10567  * Returns the default #GApplication instance for this process.
10568  *
10569  * Normally there is only one #GApplication per process and it becomes
10570  * the default when it is created.  You can exercise more control over
10571  * this by using g_application_set_default().
10572  *
10573  * If there is no default application then %NULL is returned.
10574  *
10575  * Returns: (transfer none): the default application for this process, or %NULL
10576  * Since: 2.32
10577  */
10578
10579
10580 /**
10581  * g_application_get_flags:
10582  * @application: a #GApplication
10583  *
10584  * Gets the flags for @application.
10585  *
10586  * See #GApplicationFlags.
10587  *
10588  * Returns: the flags for @application
10589  * Since: 2.28
10590  */
10591
10592
10593 /**
10594  * g_application_get_inactivity_timeout:
10595  * @application: a #GApplication
10596  *
10597  * Gets the current inactivity timeout for the application.
10598  *
10599  * This is the amount of time (in milliseconds) after the last call to
10600  * g_application_release() before the application stops running.
10601  *
10602  * Returns: the timeout, in milliseconds
10603  * Since: 2.28
10604  */
10605
10606
10607 /**
10608  * g_application_get_is_registered:
10609  * @application: a #GApplication
10610  *
10611  * Checks if @application is registered.
10612  *
10613  * An application is registered if g_application_register() has been
10614  * successfully called.
10615  *
10616  * Returns: %TRUE if @application is registered
10617  * Since: 2.28
10618  */
10619
10620
10621 /**
10622  * g_application_get_is_remote:
10623  * @application: a #GApplication
10624  *
10625  * Checks if @application is remote.
10626  *
10627  * If @application is remote then it means that another instance of
10628  * application already exists (the 'primary' instance).  Calls to
10629  * perform actions on @application will result in the actions being
10630  * performed by the primary instance.
10631  *
10632  * The value of this property cannot be accessed before
10633  * g_application_register() has been called.  See
10634  * g_application_get_is_registered().
10635  *
10636  * Returns: %TRUE if @application is remote
10637  * Since: 2.28
10638  */
10639
10640
10641 /**
10642  * g_application_hold:
10643  * @application: a #GApplication
10644  *
10645  * Increases the use count of @application.
10646  *
10647  * Use this function to indicate that the application has a reason to
10648  * continue to run.  For example, g_application_hold() is called by GTK+
10649  * when a toplevel window is on the screen.
10650  *
10651  * To cancel the hold, call g_application_release().
10652  */
10653
10654
10655 /**
10656  * g_application_id_is_valid:
10657  * @application_id: a potential application identifier
10658  *
10659  * Checks if @application_id is a valid application identifier.
10660  *
10661  * A valid ID is required for calls to g_application_new() and
10662  * g_application_set_application_id().
10663  *
10664  * For convenience, the restrictions on application identifiers are
10665  * reproduced here:
10666  * <itemizedlist>
10667  *   <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
10668  *   <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
10669  *   <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
10670  *   <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
10671  *   <listitem>Application identifiers must not exceed 255 characters.</listitem>
10672  * </itemizedlist>
10673  *
10674  * Returns: %TRUE if @application_id is valid
10675  */
10676
10677
10678 /**
10679  * g_application_new:
10680  * @application_id: (allow-none): the application id
10681  * @flags: the application flags
10682  *
10683  * Creates a new #GApplication instance.
10684  *
10685  * If non-%NULL, the application id must be valid.  See
10686  * g_application_id_is_valid().
10687  *
10688  * If no application ID is given then some features of #GApplication
10689  * (most notably application uniqueness) will be disabled.
10690  *
10691  * Returns: a new #GApplication instance
10692  */
10693
10694
10695 /**
10696  * g_application_open:
10697  * @application: a #GApplication
10698  * @files: (array length=n_files): an array of #GFiles to open
10699  * @n_files: the length of the @files array
10700  * @hint: a hint (or ""), but never %NULL
10701  *
10702  * Opens the given files.
10703  *
10704  * In essence, this results in the #GApplication::open signal being emitted
10705  * in the primary instance.
10706  *
10707  * @n_files must be greater than zero.
10708  *
10709  * @hint is simply passed through to the ::open signal.  It is
10710  * intended to be used by applications that have multiple modes for
10711  * opening files (eg: "view" vs "edit", etc).  Unless you have a need
10712  * for this functionality, you should use "".
10713  *
10714  * The application must be registered before calling this function
10715  * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
10716  *
10717  * Since: 2.28
10718  */
10719
10720
10721 /**
10722  * g_application_quit:
10723  * @application: a #GApplication
10724  *
10725  * Immediately quits the application.
10726  *
10727  * Upon return to the mainloop, g_application_run() will return,
10728  * calling only the 'shutdown' function before doing so.
10729  *
10730  * The hold count is ignored.
10731  *
10732  * The result of calling g_application_run() again after it returns is
10733  * unspecified.
10734  *
10735  * Since: 2.32
10736  */
10737
10738
10739 /**
10740  * g_application_register:
10741  * @application: a #GApplication
10742  * @cancellable: (allow-none): a #GCancellable, or %NULL
10743  * @error: a pointer to a NULL #GError, or %NULL
10744  *
10745  * Attempts registration of the application.
10746  *
10747  * This is the point at which the application discovers if it is the
10748  * primary instance or merely acting as a remote for an already-existing
10749  * primary instance.  This is implemented by attempting to acquire the
10750  * application identifier as a unique bus name on the session bus using
10751  * GDBus.
10752  *
10753  * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
10754  * given, then this process will always become the primary instance.
10755  *
10756  * Due to the internal architecture of GDBus, method calls can be
10757  * dispatched at any time (even if a main loop is not running).  For
10758  * this reason, you must ensure that any object paths that you wish to
10759  * register are registered before calling this function.
10760  *
10761  * If the application has already been registered then %TRUE is
10762  * returned with no work performed.
10763  *
10764  * The #GApplication::startup signal is emitted if registration succeeds
10765  * and @application is the primary instance (including the non-unique
10766  * case).
10767  *
10768  * In the event of an error (such as @cancellable being cancelled, or a
10769  * failure to connect to the session bus), %FALSE is returned and @error
10770  * is set appropriately.
10771  *
10772  * Note: the return value of this function is not an indicator that this
10773  * instance is or is not the primary instance of the application.  See
10774  * g_application_get_is_remote() for that.
10775  *
10776  * Returns: %TRUE if registration succeeded
10777  * Since: 2.28
10778  */
10779
10780
10781 /**
10782  * g_application_release:
10783  * @application: a #GApplication
10784  *
10785  * Decrease the use count of @application.
10786  *
10787  * When the use count reaches zero, the application will stop running.
10788  *
10789  * Never call this function except to cancel the effect of a previous
10790  * call to g_application_hold().
10791  */
10792
10793
10794 /**
10795  * g_application_run:
10796  * @application: a #GApplication
10797  * @argc: the argc from main() (or 0 if @argv is %NULL)
10798  * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
10799  *
10800  * Runs the application.
10801  *
10802  * This function is intended to be run from main() and its return value
10803  * is intended to be returned by main(). Although you are expected to pass
10804  * the @argc, @argv parameters from main() to this function, it is possible
10805  * to pass %NULL if @argv is not available or commandline handling is not
10806  * required.
10807  *
10808  * First, the local_command_line() virtual function is invoked.
10809  * This function always runs on the local instance. It gets passed a pointer
10810  * to a %NULL-terminated copy of @argv and is expected to remove the arguments
10811  * that it handled (shifting up remaining arguments). See
10812  * <xref linkend="gapplication-example-cmdline2"/> for an example of
10813  * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
10814  * after setting <literal>argc = g_strv_length (argv);</literal>.
10815  *
10816  * The last argument to local_command_line() is a pointer to the @status
10817  * variable which can used to set the exit status that is returned from
10818  * g_application_run().
10819  *
10820  * If local_command_line() returns %TRUE, the command line is expected
10821  * to be completely handled, including possibly registering as the primary
10822  * instance, calling g_application_activate() or g_application_open(), etc.
10823  *
10824  * If local_command_line() returns %FALSE then the application is registered
10825  * and the #GApplication::command-line signal is emitted in the primary
10826  * instance (which may or may not be this instance). The signal handler
10827  * gets passed a #GApplicationCommandLine object that (among other things)
10828  * contains the remaining commandline arguments that have not been handled
10829  * by local_command_line().
10830  *
10831  * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
10832  * flag set then the default implementation of local_command_line()
10833  * always returns %FALSE immediately, resulting in the commandline
10834  * always being handled in the primary instance.
10835  *
10836  * Otherwise, the default implementation of local_command_line() tries
10837  * to do a couple of things that are probably reasonable for most
10838  * applications.  First, g_application_register() is called to attempt
10839  * to register the application.  If that works, then the command line
10840  * arguments are inspected.  If no commandline arguments are given, then
10841  * g_application_activate() is called.  If commandline arguments are
10842  * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
10843  * are assumed to be filenames and g_application_open() is called.
10844  *
10845  * If you need to handle commandline arguments that are not filenames,
10846  * and you don't mind commandline handling to happen in the primary
10847  * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
10848  * process the commandline arguments in your #GApplication::command-line
10849  * signal handler, either manually or using the #GOptionContext API.
10850  *
10851  * If you are interested in doing more complicated local handling of the
10852  * commandline then you should implement your own #GApplication subclass
10853  * and override local_command_line(). In this case, you most likely want
10854  * to return %TRUE from your local_command_line() implementation to
10855  * suppress the default handling. See
10856  * <xref linkend="gapplication-example-cmdline2"/> for an example.
10857  *
10858  * If, after the above is done, the use count of the application is zero
10859  * then the exit status is returned immediately.  If the use count is
10860  * non-zero then the default main context is iterated until the use count
10861  * falls to zero, at which point 0 is returned.
10862  *
10863  * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
10864  * use count of zero is delayed for a while (ie: the instance stays
10865  * around to provide its <emphasis>service</emphasis> to others).
10866  *
10867  * Returns: the exit status
10868  * Since: 2.28
10869  */
10870
10871
10872 /**
10873  * g_application_set_action_group:
10874  * @application: a #GApplication
10875  * @action_group: (allow-none): a #GActionGroup, or %NULL
10876  *
10877  * This used to be how actions were associated with a #GApplication.
10878  * Now there is #GActionMap for that.
10879  *
10880  * Since: 2.28
10881  * 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.
10882  */
10883
10884
10885 /**
10886  * g_application_set_application_id:
10887  * @application: a #GApplication
10888  * @application_id: (allow-none): the identifier for @application
10889  *
10890  * Sets the unique identifier for @application.
10891  *
10892  * The application id can only be modified if @application has not yet
10893  * been registered.
10894  *
10895  * If non-%NULL, the application id must be valid.  See
10896  * g_application_id_is_valid().
10897  *
10898  * Since: 2.28
10899  */
10900
10901
10902 /**
10903  * g_application_set_default:
10904  * @application: (allow-none): the application to set as default, or %NULL
10905  *
10906  * Sets or unsets the default application for the process, as returned
10907  * by g_application_get_default().
10908  *
10909  * This function does not take its own reference on @application.  If
10910  * @application is destroyed then the default application will revert
10911  * back to %NULL.
10912  *
10913  * Since: 2.32
10914  */
10915
10916
10917 /**
10918  * g_application_set_flags:
10919  * @application: a #GApplication
10920  * @flags: the flags for @application
10921  *
10922  * Sets the flags for @application.
10923  *
10924  * The flags can only be modified if @application has not yet been
10925  * registered.
10926  *
10927  * See #GApplicationFlags.
10928  *
10929  * Since: 2.28
10930  */
10931
10932
10933 /**
10934  * g_application_set_inactivity_timeout:
10935  * @application: a #GApplication
10936  * @inactivity_timeout: the timeout, in milliseconds
10937  *
10938  * Sets the current inactivity timeout for the application.
10939  *
10940  * This is the amount of time (in milliseconds) after the last call to
10941  * g_application_release() before the application stops running.
10942  *
10943  * This call has no side effects of its own.  The value set here is only
10944  * used for next time g_application_release() drops the use count to
10945  * zero.  Any timeouts currently in progress are not impacted.
10946  *
10947  * Since: 2.28
10948  */
10949
10950
10951 /**
10952  * g_async_initable_init_async:
10953  * @initable: a #GAsyncInitable.
10954  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10955  * @cancellable: optional #GCancellable object, %NULL to ignore.
10956  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10957  * @user_data: the data to pass to callback function
10958  *
10959  * Starts asynchronous initialization of the object implementing the
10960  * interface. This must be done before any real use of the object after
10961  * initial construction. If the object also implements #GInitable you can
10962  * optionally call g_initable_init() instead.
10963  *
10964  * When the initialization is finished, @callback will be called. You can
10965  * then call g_async_initable_init_finish() to get the result of the
10966  * initialization.
10967  *
10968  * Implementations may also support cancellation. If @cancellable is not
10969  * %NULL, then initialization can be cancelled by triggering the cancellable
10970  * object from another thread. If the operation was cancelled, the error
10971  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10972  * the object doesn't support cancellable initialization, the error
10973  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10974  *
10975  * As with #GInitable, if the object is not initialized, or initialization
10976  * returns with an error, then all operations on the object except
10977  * g_object_ref() and g_object_unref() are considered to be invalid, and
10978  * have undefined behaviour. They will often fail with g_critical() or
10979  * g_warning(), but this must not be relied on.
10980  *
10981  * Implementations of this method must be idempotent: i.e. multiple calls
10982  * to this function with the same argument should return the same results.
10983  * Only the first call initializes the object; further calls return the result
10984  * of the first call. This is so that it's safe to implement the singleton
10985  * pattern in the GObject constructor function.
10986  *
10987  * For classes that also support the #GInitable interface, the default
10988  * implementation of this method will run the g_initable_init() function
10989  * in a thread, so if you want to support asynchronous initialization via
10990  * threads, just implement the #GAsyncInitable interface without overriding
10991  * any interface methods.
10992  *
10993  * Since: 2.22
10994  */
10995
10996
10997 /**
10998  * g_async_initable_init_finish:
10999  * @initable: a #GAsyncInitable.
11000  * @res: a #GAsyncResult.
11001  * @error: a #GError location to store the error occurring, or %NULL to ignore.
11002  *
11003  * Finishes asynchronous initialization and returns the result.
11004  * See g_async_initable_init_async().
11005  *
11006  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
11007  * Since: 2.22
11008  */
11009
11010
11011 /**
11012  * g_async_initable_new_async:
11013  * @object_type: a #GType supporting #GAsyncInitable.
11014  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11015  * @cancellable: optional #GCancellable object, %NULL to ignore.
11016  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11017  * @user_data: the data to pass to callback function
11018  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
11019  * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
11020  *
11021  * Helper function for constructing #GAsyncInitable object. This is
11022  * similar to g_object_new() but also initializes the object asynchronously.
11023  *
11024  * When the initialization is finished, @callback will be called. You can
11025  * then call g_async_initable_new_finish() to get the new object and check
11026  * for any errors.
11027  *
11028  * Since: 2.22
11029  */
11030
11031
11032 /**
11033  * g_async_initable_new_finish:
11034  * @initable: the #GAsyncInitable from the callback
11035  * @res: the #GAsyncResult from the callback
11036  * @error: return location for errors, or %NULL to ignore
11037  *
11038  * Finishes the async construction for the various g_async_initable_new
11039  * calls, returning the created object or %NULL on error.
11040  *
11041  * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
11042  * Since: 2.22
11043  */
11044
11045
11046 /**
11047  * g_async_initable_new_valist_async:
11048  * @object_type: a #GType supporting #GAsyncInitable.
11049  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
11050  * @var_args: The var args list generated from @first_property_name.
11051  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11052  * @cancellable: optional #GCancellable object, %NULL to ignore.
11053  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11054  * @user_data: the data to pass to callback function
11055  *
11056  * Helper function for constructing #GAsyncInitable object. This is
11057  * similar to g_object_new_valist() but also initializes the object
11058  * asynchronously.
11059  *
11060  * When the initialization is finished, @callback will be called. You can
11061  * then call g_async_initable_new_finish() to get the new object and check
11062  * for any errors.
11063  *
11064  * Since: 2.22
11065  */
11066
11067
11068 /**
11069  * g_async_initable_newv_async:
11070  * @object_type: a #GType supporting #GAsyncInitable.
11071  * @n_parameters: the number of parameters in @parameters
11072  * @parameters: the parameters to use to construct the object
11073  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11074  * @cancellable: optional #GCancellable object, %NULL to ignore.
11075  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11076  * @user_data: the data to pass to callback function
11077  *
11078  * Helper function for constructing #GAsyncInitable object. This is
11079  * similar to g_object_newv() but also initializes the object asynchronously.
11080  *
11081  * When the initialization is finished, @callback will be called. You can
11082  * then call g_async_initable_new_finish() to get the new object and check
11083  * for any errors.
11084  *
11085  * Since: 2.22
11086  */
11087
11088
11089 /**
11090  * g_async_result_get_source_object:
11091  * @res: a #GAsyncResult
11092  *
11093  * Gets the source object from a #GAsyncResult.
11094  *
11095  * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
11096  */
11097
11098
11099 /**
11100  * g_async_result_get_user_data:
11101  * @res: a #GAsyncResult.
11102  *
11103  * Gets the user data from a #GAsyncResult.
11104  *
11105  * Returns: (transfer full): the user data for @res.
11106  */
11107
11108
11109 /**
11110  * g_async_result_is_tagged:
11111  * @res: a #GAsyncResult
11112  * @source_tag: an application-defined tag
11113  *
11114  * Checks if @res has the given @source_tag (generally a function
11115  * pointer indicating the function @res was created by).
11116  *
11117  * Returns: %TRUE if @res has the indicated @source_tag, %FALSE if not.
11118  * Since: 2.34
11119  */
11120
11121
11122 /**
11123  * g_async_result_legacy_propagate_error:
11124  * @res: a #GAsyncResult
11125  * @error: (out): a location to propagate the error to.
11126  *
11127  * If @res is a #GSimpleAsyncResult, this is equivalent to
11128  * g_simple_async_result_propagate_error(). Otherwise it returns
11129  * %FALSE.
11130  *
11131  * This can be used for legacy error handling in async
11132  * <literal>_finish ()</literal> wrapper functions that traditionally
11133  * handled #GSimpleAsyncResult error returns themselves rather than
11134  * calling into the virtual method. This should not be used in new
11135  * code; #GAsyncResult errors that are set by virtual methods should
11136  * also be extracted by virtual methods, to enable subclasses to chain
11137  * up correctly.
11138  *
11139  * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
11140  * Since: 2.34
11141  */
11142
11143
11144 /**
11145  * g_buffered_input_stream_fill:
11146  * @stream: a #GBufferedInputStream
11147  * @count: the number of bytes that will be read from the stream
11148  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11149  * @error: location to store the error occurring, or %NULL to ignore
11150  *
11151  * Tries to read @count bytes from the stream into the buffer.
11152  * Will block during this read.
11153  *
11154  * If @count is zero, returns zero and does nothing. A value of @count
11155  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
11156  *
11157  * On success, the number of bytes read into the buffer is returned.
11158  * It is not an error if this is not the same as the requested size, as it
11159  * can happen e.g. near the end of a file. Zero is returned on end of file
11160  * (or if @count is zero),  but never otherwise.
11161  *
11162  * If @count is -1 then the attempted read size is equal to the number of
11163  * bytes that are required to fill the buffer.
11164  *
11165  * If @cancellable is not %NULL, then the operation can be cancelled by
11166  * triggering the cancellable object from another thread. If the operation
11167  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
11168  * operation was partially finished when the operation was cancelled the
11169  * partial result will be returned, without an error.
11170  *
11171  * On error -1 is returned and @error is set accordingly.
11172  *
11173  * For the asynchronous, non-blocking, version of this function, see
11174  * g_buffered_input_stream_fill_async().
11175  *
11176  * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
11177  */
11178
11179
11180 /**
11181  * g_buffered_input_stream_fill_async:
11182  * @stream: a #GBufferedInputStream
11183  * @count: the number of bytes that will be read from the stream
11184  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
11185  * @cancellable: (allow-none): optional #GCancellable object
11186  * @callback: (scope async): a #GAsyncReadyCallback
11187  * @user_data: (closure): a #gpointer
11188  *
11189  * Reads data into @stream's buffer asynchronously, up to @count size.
11190  * @io_priority can be used to prioritize reads. For the synchronous
11191  * version of this function, see g_buffered_input_stream_fill().
11192  *
11193  * If @count is -1 then the attempted read size is equal to the number
11194  * of bytes that are required to fill the buffer.
11195  */
11196
11197
11198 /**
11199  * g_buffered_input_stream_fill_finish:
11200  * @stream: a #GBufferedInputStream
11201  * @result: a #GAsyncResult
11202  * @error: a #GError
11203  *
11204  * Finishes an asynchronous read.
11205  *
11206  * Returns: a #gssize of the read stream, or %-1 on an error.
11207  */
11208
11209
11210 /**
11211  * g_buffered_input_stream_get_available:
11212  * @stream: #GBufferedInputStream
11213  *
11214  * Gets the size of the available data within the stream.
11215  *
11216  * Returns: size of the available stream.
11217  */
11218
11219
11220 /**
11221  * g_buffered_input_stream_get_buffer_size:
11222  * @stream: a #GBufferedInputStream
11223  *
11224  * Gets the size of the input buffer.
11225  *
11226  * Returns: the current buffer size.
11227  */
11228
11229
11230 /**
11231  * g_buffered_input_stream_new:
11232  * @base_stream: a #GInputStream
11233  *
11234  * Creates a new #GInputStream from the given @base_stream, with
11235  * a buffer set to the default size (4 kilobytes).
11236  *
11237  * Returns: a #GInputStream for the given @base_stream.
11238  */
11239
11240
11241 /**
11242  * g_buffered_input_stream_new_sized:
11243  * @base_stream: a #GInputStream
11244  * @size: a #gsize
11245  *
11246  * Creates a new #GBufferedInputStream from the given @base_stream,
11247  * with a buffer set to @size.
11248  *
11249  * Returns: a #GInputStream.
11250  */
11251
11252
11253 /**
11254  * g_buffered_input_stream_peek:
11255  * @stream: a #GBufferedInputStream
11256  * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
11257  * @offset: a #gsize
11258  * @count: a #gsize
11259  *
11260  * Peeks in the buffer, copying data of size @count into @buffer,
11261  * offset @offset bytes.
11262  *
11263  * Returns: a #gsize of the number of bytes peeked, or -1 on error.
11264  */
11265
11266
11267 /**
11268  * g_buffered_input_stream_peek_buffer:
11269  * @stream: a #GBufferedInputStream
11270  * @count: (out): a #gsize to get the number of bytes available in the buffer
11271  *
11272  * Returns the buffer with the currently available bytes. The returned
11273  * buffer must not be modified and will become invalid when reading from
11274  * the stream or filling the buffer.
11275  *
11276  * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
11277  */
11278
11279
11280 /**
11281  * g_buffered_input_stream_read_byte:
11282  * @stream: a #GBufferedInputStream
11283  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11284  * @error: location to store the error occurring, or %NULL to ignore
11285  *
11286  * Tries to read a single byte from the stream or the buffer. Will block
11287  * during this read.
11288  *
11289  * On success, the byte read from the stream is returned. On end of stream
11290  * -1 is returned but it's not an exceptional error and @error is not set.
11291  *
11292  * If @cancellable is not %NULL, then the operation can be cancelled by
11293  * triggering the cancellable object from another thread. If the operation
11294  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
11295  * operation was partially finished when the operation was cancelled the
11296  * partial result will be returned, without an error.
11297  *
11298  * On error -1 is returned and @error is set accordingly.
11299  *
11300  * Returns: the byte read from the @stream, or -1 on end of stream or error.
11301  */
11302
11303
11304 /**
11305  * g_buffered_input_stream_set_buffer_size:
11306  * @stream: a #GBufferedInputStream
11307  * @size: a #gsize
11308  *
11309  * Sets the size of the internal buffer of @stream to @size, or to the
11310  * size of the contents of the buffer. The buffer can never be resized
11311  * smaller than its current contents.
11312  */
11313
11314
11315 /**
11316  * g_buffered_output_stream_get_auto_grow:
11317  * @stream: a #GBufferedOutputStream.
11318  *
11319  * Checks if the buffer automatically grows as data is added.
11320  *
11321  * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
11322  */
11323
11324
11325 /**
11326  * g_buffered_output_stream_get_buffer_size:
11327  * @stream: a #GBufferedOutputStream.
11328  *
11329  * Gets the size of the buffer in the @stream.
11330  *
11331  * Returns: the current size of the buffer.
11332  */
11333
11334
11335 /**
11336  * g_buffered_output_stream_new:
11337  * @base_stream: a #GOutputStream.
11338  *
11339  * Creates a new buffered output stream for a base stream.
11340  *
11341  * Returns: a #GOutputStream for the given @base_stream.
11342  */
11343
11344
11345 /**
11346  * g_buffered_output_stream_new_sized:
11347  * @base_stream: a #GOutputStream.
11348  * @size: a #gsize.
11349  *
11350  * Creates a new buffered output stream with a given buffer size.
11351  *
11352  * Returns: a #GOutputStream with an internal buffer set to @size.
11353  */
11354
11355
11356 /**
11357  * g_buffered_output_stream_set_auto_grow:
11358  * @stream: a #GBufferedOutputStream.
11359  * @auto_grow: a #gboolean.
11360  *
11361  * Sets whether or not the @stream's buffer should automatically grow.
11362  * If @auto_grow is true, then each write will just make the buffer
11363  * larger, and you must manually flush the buffer to actually write out
11364  * the data to the underlying stream.
11365  */
11366
11367
11368 /**
11369  * g_buffered_output_stream_set_buffer_size:
11370  * @stream: a #GBufferedOutputStream.
11371  * @size: a #gsize.
11372  *
11373  * Sets the size of the internal buffer to @size.
11374  */
11375
11376
11377 /**
11378  * g_bus_get:
11379  * @bus_type: A #GBusType.
11380  * @cancellable: (allow-none): A #GCancellable or %NULL.
11381  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
11382  * @user_data: The data to pass to @callback.
11383  *
11384  * Asynchronously connects to the message bus specified by @bus_type.
11385  *
11386  * When the operation is finished, @callback will be invoked. You can
11387  * then call g_bus_get_finish() to get the result of the operation.
11388  *
11389  * This is a asynchronous failable function. See g_bus_get_sync() for
11390  * the synchronous version.
11391  *
11392  * Since: 2.26
11393  */
11394
11395
11396 /**
11397  * g_bus_get_finish:
11398  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
11399  * @error: Return location for error or %NULL.
11400  *
11401  * Finishes an operation started with g_bus_get().
11402  *
11403  * The returned object is a singleton, that is, shared with other
11404  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
11405  * event that you need a private message bus connection, use
11406  * g_dbus_address_get_for_bus_sync() and
11407  * g_dbus_connection_new_for_address().
11408  *
11409  * Note that the returned #GDBusConnection object will (usually) have
11410  * the #GDBusConnection:exit-on-close property set to %TRUE.
11411  *
11412  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11413  * Since: 2.26
11414  */
11415
11416
11417 /**
11418  * g_bus_get_sync:
11419  * @bus_type: A #GBusType.
11420  * @cancellable: (allow-none): A #GCancellable or %NULL.
11421  * @error: Return location for error or %NULL.
11422  *
11423  * Synchronously connects to the message bus specified by @bus_type.
11424  * Note that the returned object may shared with other callers,
11425  * e.g. if two separate parts of a process calls this function with
11426  * the same @bus_type, they will share the same object.
11427  *
11428  * This is a synchronous failable function. See g_bus_get() and
11429  * g_bus_get_finish() for the asynchronous version.
11430  *
11431  * The returned object is a singleton, that is, shared with other
11432  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
11433  * event that you need a private message bus connection, use
11434  * g_dbus_address_get_for_bus_sync() and
11435  * g_dbus_connection_new_for_address().
11436  *
11437  * Note that the returned #GDBusConnection object will (usually) have
11438  * the #GDBusConnection:exit-on-close property set to %TRUE.
11439  *
11440  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11441  * Since: 2.26
11442  */
11443
11444
11445 /**
11446  * g_bus_own_name:
11447  * @bus_type: The type of bus to own a name on.
11448  * @name: The well-known name to own.
11449  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11450  * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
11451  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
11452  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
11453  * @user_data: User data to pass to handlers.
11454  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11455  *
11456  * Starts acquiring @name on the bus specified by @bus_type and calls
11457  * @name_acquired_handler and @name_lost_handler when the name is
11458  * acquired respectively lost. Callbacks will be invoked in the <link
11459  * linkend="g-main-context-push-thread-default">thread-default main
11460  * loop</link> of the thread you are calling this function from.
11461  *
11462  * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
11463  * callbacks will be invoked after calling this function - there are three
11464  * possible cases:
11465  * <itemizedlist>
11466  *   <listitem><para>
11467  *     @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
11468  *   </para></listitem>
11469  *   <listitem><para>
11470  *     @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
11471  *   </para></listitem>
11472  *   <listitem><para>
11473  *     @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
11474  *   </para></listitem>
11475  * </itemizedlist>
11476  * When you are done owning the name, just call g_bus_unown_name()
11477  * with the owner id this function returns.
11478  *
11479  * If the name is acquired or lost (for example another application
11480  * could acquire the name if you allow replacement or the application
11481  * currently owning the name exits), the handlers are also invoked. If the
11482  * #GDBusConnection that is used for attempting to own the name
11483  * closes, then @name_lost_handler is invoked since it is no
11484  * longer possible for other processes to access the process.
11485  *
11486  * You cannot use g_bus_own_name() several times for the same name (unless
11487  * interleaved with calls to g_bus_unown_name()) - only the first call
11488  * will work.
11489  *
11490  * Another guarantee is that invocations of @name_acquired_handler
11491  * and @name_lost_handler are guaranteed to alternate; that
11492  * is, if @name_acquired_handler is invoked then you are
11493  * guaranteed that the next time one of the handlers is invoked, it
11494  * will be @name_lost_handler. The reverse is also true.
11495  *
11496  * If you plan on exporting objects (using e.g.
11497  * g_dbus_connection_register_object()), note that it is generally too late
11498  * to export the objects in @name_acquired_handler. Instead, you can do this
11499  * in @bus_acquired_handler since you are guaranteed that this will run
11500  * before @name is requested from the bus.
11501  *
11502  * This behavior makes it very simple to write applications that wants
11503  * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
11504  * Simply register objects to be exported in @bus_acquired_handler and
11505  * unregister the objects (if any) in @name_lost_handler.
11506  *
11507  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11508  * Since: 2.26
11509  */
11510
11511
11512 /**
11513  * g_bus_own_name_on_connection:
11514  * @connection: A #GDBusConnection.
11515  * @name: The well-known name to own.
11516  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11517  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
11518  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
11519  * @user_data: User data to pass to handlers.
11520  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11521  *
11522  * Like g_bus_own_name() but takes a #GDBusConnection instead of a
11523  * #GBusType.
11524  *
11525  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11526  * Since: 2.26
11527  */
11528
11529
11530 /**
11531  * g_bus_own_name_on_connection_with_closures:
11532  * @connection: A #GDBusConnection.
11533  * @name: The well-known name to own.
11534  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11535  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
11536  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
11537  *
11538  * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
11539  * easier binding in other languages.
11540  *
11541  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11542  * Rename to: g_bus_own_name_on_connection
11543  * Since: 2.26
11544  */
11545
11546
11547 /**
11548  * g_bus_own_name_with_closures:
11549  * @bus_type: The type of bus to own a name on.
11550  * @name: The well-known name to own.
11551  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11552  * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
11553  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
11554  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
11555  *
11556  * Version of g_bus_own_name() using closures instead of callbacks for
11557  * easier binding in other languages.
11558  *
11559  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11560  * Rename to: g_bus_own_name
11561  * Since: 2.26
11562  */
11563
11564
11565 /**
11566  * g_bus_unown_name:
11567  * @owner_id: An identifier obtained from g_bus_own_name()
11568  *
11569  * Stops owning a name.
11570  *
11571  * Since: 2.26
11572  */
11573
11574
11575 /**
11576  * g_bus_unwatch_name:
11577  * @watcher_id: An identifier obtained from g_bus_watch_name()
11578  *
11579  * Stops watching a name.
11580  *
11581  * Since: 2.26
11582  */
11583
11584
11585 /**
11586  * g_bus_watch_name:
11587  * @bus_type: The type of bus to watch a name on.
11588  * @name: The name (well-known or unique) to watch.
11589  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11590  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11591  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11592  * @user_data: User data to pass to handlers.
11593  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11594  *
11595  * Starts watching @name on the bus specified by @bus_type and calls
11596  * @name_appeared_handler and @name_vanished_handler when the name is
11597  * known to have a owner respectively known to lose its
11598  * owner. Callbacks will be invoked in the <link
11599  * linkend="g-main-context-push-thread-default">thread-default main
11600  * loop</link> of the thread you are calling this function from.
11601  *
11602  * You are guaranteed that one of the handlers will be invoked after
11603  * calling this function. When you are done watching the name, just
11604  * call g_bus_unwatch_name() with the watcher id this function
11605  * returns.
11606  *
11607  * If the name vanishes or appears (for example the application owning
11608  * the name could restart), the handlers are also invoked. If the
11609  * #GDBusConnection that is used for watching the name disconnects, then
11610  * @name_vanished_handler is invoked since it is no longer
11611  * possible to access the name.
11612  *
11613  * Another guarantee is that invocations of @name_appeared_handler
11614  * and @name_vanished_handler are guaranteed to alternate; that
11615  * is, if @name_appeared_handler is invoked then you are
11616  * guaranteed that the next time one of the handlers is invoked, it
11617  * will be @name_vanished_handler. The reverse is also true.
11618  *
11619  * This behavior makes it very simple to write applications that wants
11620  * to take action when a certain name exists, see <xref
11621  * linkend="gdbus-watching-names"/>. Basically, the application
11622  * should create object proxies in @name_appeared_handler and destroy
11623  * them again (if any) in @name_vanished_handler.
11624  *
11625  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11626  * Since: 2.26
11627  */
11628
11629
11630 /**
11631  * g_bus_watch_name_on_connection:
11632  * @connection: A #GDBusConnection.
11633  * @name: The name (well-known or unique) to watch.
11634  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11635  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11636  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11637  * @user_data: User data to pass to handlers.
11638  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11639  *
11640  * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
11641  * #GBusType.
11642  *
11643  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11644  * Since: 2.26
11645  */
11646
11647
11648 /**
11649  * g_bus_watch_name_on_connection_with_closures:
11650  * @connection: A #GDBusConnection.
11651  * @name: The name (well-known or unique) to watch.
11652  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11653  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11654  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11655  *
11656  * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
11657  * easier binding in other languages.
11658  *
11659  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11660  * Rename to: g_bus_watch_name_on_connection
11661  * Since: 2.26
11662  */
11663
11664
11665 /**
11666  * g_bus_watch_name_with_closures:
11667  * @bus_type: The type of bus to watch a name on.
11668  * @name: The name (well-known or unique) to watch.
11669  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11670  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11671  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11672  *
11673  * Version of g_bus_watch_name() using closures instead of callbacks for
11674  * easier binding in other languages.
11675  *
11676  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11677  * Rename to: g_bus_watch_name
11678  * Since: 2.26
11679  */
11680
11681
11682 /**
11683  * g_cancellable_cancel:
11684  * @cancellable: a #GCancellable object.
11685  *
11686  * Will set @cancellable to cancelled, and will emit the
11687  * #GCancellable::cancelled signal. (However, see the warning about
11688  * race conditions in the documentation for that signal if you are
11689  * planning to connect to it.)
11690  *
11691  * This function is thread-safe. In other words, you can safely call
11692  * it from a thread other than the one running the operation that was
11693  * passed the @cancellable.
11694  *
11695  * The convention within gio is that cancelling an asynchronous
11696  * operation causes it to complete asynchronously. That is, if you
11697  * cancel the operation from the same thread in which it is running,
11698  * then the operation's #GAsyncReadyCallback will not be invoked until
11699  * the application returns to the main loop.
11700  */
11701
11702
11703 /**
11704  * g_cancellable_connect:
11705  * @cancellable: A #GCancellable.
11706  * @callback: The #GCallback to connect.
11707  * @data: Data to pass to @callback.
11708  * @data_destroy_func: (allow-none): Free function for @data or %NULL.
11709  *
11710  * Convenience function to connect to the #GCancellable::cancelled
11711  * signal. Also handles the race condition that may happen
11712  * if the cancellable is cancelled right before connecting.
11713  *
11714  * @callback is called at most once, either directly at the
11715  * time of the connect if @cancellable is already cancelled,
11716  * or when @cancellable is cancelled in some thread.
11717  *
11718  * @data_destroy_func will be called when the handler is
11719  * disconnected, or immediately if the cancellable is already
11720  * cancelled.
11721  *
11722  * See #GCancellable::cancelled for details on how to use this.
11723  *
11724  * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
11725  * Since: 2.22
11726  */
11727
11728
11729 /**
11730  * g_cancellable_disconnect:
11731  * @cancellable: (allow-none): A #GCancellable or %NULL.
11732  * @handler_id: Handler id of the handler to be disconnected, or %0.
11733  *
11734  * Disconnects a handler from a cancellable instance similar to
11735  * g_signal_handler_disconnect().  Additionally, in the event that a
11736  * signal handler is currently running, this call will block until the
11737  * handler has finished.  Calling this function from a
11738  * #GCancellable::cancelled signal handler will therefore result in a
11739  * deadlock.
11740  *
11741  * This avoids a race condition where a thread cancels at the
11742  * same time as the cancellable operation is finished and the
11743  * signal handler is removed. See #GCancellable::cancelled for
11744  * details on how to use this.
11745  *
11746  * If @cancellable is %NULL or @handler_id is %0 this function does
11747  * nothing.
11748  *
11749  * Since: 2.22
11750  */
11751
11752
11753 /**
11754  * g_cancellable_get_current:
11755  *
11756  * Gets the top cancellable from the stack.
11757  *
11758  * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
11759  */
11760
11761
11762 /**
11763  * g_cancellable_get_fd:
11764  * @cancellable: a #GCancellable.
11765  *
11766  * Gets the file descriptor for a cancellable job. This can be used to
11767  * implement cancellable operations on Unix systems. The returned fd will
11768  * turn readable when @cancellable is cancelled.
11769  *
11770  * You are not supposed to read from the fd yourself, just check for
11771  * readable status. Reading to unset the readable status is done
11772  * with g_cancellable_reset().
11773  *
11774  * After a successful return from this function, you should use
11775  * g_cancellable_release_fd() to free up resources allocated for
11776  * the returned file descriptor.
11777  *
11778  * See also g_cancellable_make_pollfd().
11779  *
11780  * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
11781  */
11782
11783
11784 /**
11785  * g_cancellable_is_cancelled:
11786  * @cancellable: (allow-none): a #GCancellable or %NULL
11787  *
11788  * Checks if a cancellable job has been cancelled.
11789  *
11790  * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
11791  */
11792
11793
11794 /**
11795  * g_cancellable_make_pollfd:
11796  * @cancellable: (allow-none): a #GCancellable or %NULL
11797  * @pollfd: a pointer to a #GPollFD
11798  *
11799  * Creates a #GPollFD corresponding to @cancellable; this can be passed
11800  * to g_poll() and used to poll for cancellation. This is useful both
11801  * for unix systems without a native poll and for portability to
11802  * windows.
11803  *
11804  * When this function returns %TRUE, you should use
11805  * g_cancellable_release_fd() to free up resources allocated for the
11806  * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
11807  *
11808  * If this function returns %FALSE, either no @cancellable was given or
11809  * resource limits prevent this function from allocating the necessary
11810  * structures for polling. (On Linux, you will likely have reached
11811  * the maximum number of file descriptors.) The suggested way to handle
11812  * these cases is to ignore the @cancellable.
11813  *
11814  * You are not supposed to read from the fd yourself, just check for
11815  * readable status. Reading to unset the readable status is done
11816  * with g_cancellable_reset().
11817  *
11818  * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
11819  * Since: 2.22
11820  */
11821
11822
11823 /**
11824  * g_cancellable_new:
11825  *
11826  * Creates a new #GCancellable object.
11827  *
11828  * Applications that want to start one or more operations
11829  * that should be cancellable should create a #GCancellable
11830  * and pass it to the operations.
11831  *
11832  * One #GCancellable can be used in multiple consecutive
11833  * operations or in multiple concurrent operations.
11834  *
11835  * Returns: a #GCancellable.
11836  */
11837
11838
11839 /**
11840  * g_cancellable_pop_current:
11841  * @cancellable: a #GCancellable object
11842  *
11843  * Pops @cancellable off the cancellable stack (verifying that @cancellable
11844  * is on the top of the stack).
11845  */
11846
11847
11848 /**
11849  * g_cancellable_push_current:
11850  * @cancellable: a #GCancellable object
11851  *
11852  * Pushes @cancellable onto the cancellable stack. The current
11853  * cancellable can then be received using g_cancellable_get_current().
11854  *
11855  * This is useful when implementing cancellable operations in
11856  * code that does not allow you to pass down the cancellable object.
11857  *
11858  * This is typically called automatically by e.g. #GFile operations,
11859  * so you rarely have to call this yourself.
11860  */
11861
11862
11863 /**
11864  * g_cancellable_release_fd:
11865  * @cancellable: a #GCancellable
11866  *
11867  * Releases a resources previously allocated by g_cancellable_get_fd()
11868  * or g_cancellable_make_pollfd().
11869  *
11870  * For compatibility reasons with older releases, calling this function
11871  * is not strictly required, the resources will be automatically freed
11872  * when the @cancellable is finalized. However, the @cancellable will
11873  * block scarce file descriptors until it is finalized if this function
11874  * is not called. This can cause the application to run out of file
11875  * descriptors when many #GCancellables are used at the same time.
11876  *
11877  * Since: 2.22
11878  */
11879
11880
11881 /**
11882  * g_cancellable_reset:
11883  * @cancellable: a #GCancellable object.
11884  *
11885  * Resets @cancellable to its uncancelled state.
11886  *
11887  * If cancellable is currently in use by any cancellable operation
11888  * then the behavior of this function is undefined.
11889  */
11890
11891
11892 /**
11893  * g_cancellable_set_error_if_cancelled:
11894  * @cancellable: (allow-none): a #GCancellable or %NULL
11895  * @error: #GError to append error state to
11896  *
11897  * If the @cancellable is cancelled, sets the error to notify
11898  * that the operation was cancelled.
11899  *
11900  * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11901  */
11902
11903
11904 /**
11905  * g_cancellable_source_new: (skip)
11906  * @cancellable: (allow-none): a #GCancellable, or %NULL
11907  *
11908  * Creates a source that triggers if @cancellable is cancelled and
11909  * calls its callback of type #GCancellableSourceFunc. This is
11910  * primarily useful for attaching to another (non-cancellable) source
11911  * with g_source_add_child_source() to add cancellability to it.
11912  *
11913  * For convenience, you can call this with a %NULL #GCancellable,
11914  * in which case the source will never trigger.
11915  *
11916  * Returns: (transfer full): the new #GSource.
11917  * Since: 2.28
11918  */
11919
11920
11921 /**
11922  * g_charset_converter_get_num_fallbacks:
11923  * @converter: a #GCharsetConverter
11924  *
11925  * Gets the number of fallbacks that @converter has applied so far.
11926  *
11927  * Returns: the number of fallbacks that @converter has applied
11928  * Since: 2.24
11929  */
11930
11931
11932 /**
11933  * g_charset_converter_get_use_fallback:
11934  * @converter: a #GCharsetConverter
11935  *
11936  * Gets the #GCharsetConverter:use-fallback property.
11937  *
11938  * Returns: %TRUE if fallbacks are used by @converter
11939  * Since: 2.24
11940  */
11941
11942
11943 /**
11944  * g_charset_converter_new:
11945  * @to_charset: destination charset
11946  * @from_charset: source charset
11947  * @error: #GError for error reporting, or %NULL to ignore.
11948  *
11949  * Creates a new #GCharsetConverter.
11950  *
11951  * Returns: a new #GCharsetConverter or %NULL on error.
11952  * Since: 2.24
11953  */
11954
11955
11956 /**
11957  * g_charset_converter_set_use_fallback:
11958  * @converter: a #GCharsetConverter
11959  * @use_fallback: %TRUE to use fallbacks
11960  *
11961  * Sets the #GCharsetConverter:use-fallback property.
11962  *
11963  * Since: 2.24
11964  */
11965
11966
11967 /**
11968  * g_content_type_can_be_executable:
11969  * @type: a content type string
11970  *
11971  * Checks if a content type can be executable. Note that for instance
11972  * things like text files can be executables (i.e. scripts and batch files).
11973  *
11974  * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11975  */
11976
11977
11978 /**
11979  * g_content_type_equals:
11980  * @type1: a content type string
11981  * @type2: a content type string
11982  *
11983  * Compares two content types for equality.
11984  *
11985  * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11986  */
11987
11988
11989 /**
11990  * g_content_type_from_mime_type:
11991  * @mime_type: a mime type string
11992  *
11993  * Tries to find a content type based on the mime type name.
11994  *
11995  * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
11996  * Since: 2.18
11997  */
11998
11999
12000 /**
12001  * g_content_type_get_description:
12002  * @type: a content type string
12003  *
12004  * Gets the human readable description of the content type.
12005  *
12006  * Returns: a short description of the content type @type. Free the returned string with g_free()
12007  */
12008
12009
12010 /**
12011  * g_content_type_get_generic_icon_name:
12012  * @type: a content type string
12013  *
12014  * Gets the generic icon name for a content type.
12015  *
12016  * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
12017  * specification for more on the generic icon name.
12018  *
12019  * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
12020  * Since: 2.34
12021  */
12022
12023
12024 /**
12025  * g_content_type_get_icon:
12026  * @type: a content type string
12027  *
12028  * Gets the icon for a content type.
12029  *
12030  * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
12031  */
12032
12033
12034 /**
12035  * g_content_type_get_mime_type:
12036  * @type: a content type string
12037  *
12038  * Gets the mime type for the content type, if one is registered.
12039  *
12040  * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
12041  */
12042
12043
12044 /**
12045  * g_content_type_get_symbolic_icon:
12046  * @type: a content type string
12047  *
12048  * Gets the symbolic icon for a content type.
12049  *
12050  * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
12051  * Since: 2.34
12052  */
12053
12054
12055 /**
12056  * g_content_type_guess:
12057  * @filename: (allow-none): a string, or %NULL
12058  * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
12059  * @data_size: the size of @data
12060  * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
12061  *
12062  * Guesses the content type based on example data. If the function is
12063  * uncertain, @result_uncertain will be set to %TRUE. Either @filename
12064  * or @data may be %NULL, in which case the guess will be based solely
12065  * on the other argument.
12066  *
12067  * Returns: a string indicating a guessed content type for the given data. Free with g_free()
12068  */
12069
12070
12071 /**
12072  * g_content_type_guess_for_tree:
12073  * @root: the root of the tree to guess a type for
12074  *
12075  * Tries to guess the type of the tree with root @root, by
12076  * looking at the files it contains. The result is an array
12077  * of content types, with the best guess coming first.
12078  *
12079  * The types returned all have the form x-content/foo, e.g.
12080  * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
12081  * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
12082  * specification for more on x-content types.
12083  *
12084  * This function is useful in the implementation of
12085  * g_mount_guess_content_type().
12086  *
12087  * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
12088  * Since: 2.18
12089  */
12090
12091
12092 /**
12093  * g_content_type_is_a:
12094  * @type: a content type string
12095  * @supertype: a content type string
12096  *
12097  * Determines if @type is a subset of @supertype.
12098  *
12099  * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
12100  */
12101
12102
12103 /**
12104  * g_content_type_is_unknown:
12105  * @type: a content type string
12106  *
12107  * Checks if the content type is the generic "unknown" type.
12108  * On UNIX this is the "application/octet-stream" mimetype,
12109  * while on win32 it is "*".
12110  *
12111  * Returns: %TRUE if the type is the unknown type.
12112  */
12113
12114
12115 /**
12116  * g_content_types_get_registered:
12117  *
12118  * Gets a list of strings containing all the registered content types
12119  * known to the system. The list and its data should be freed using
12120  * <programlisting>
12121  * g_list_free_full (list, g_free);
12122  * </programlisting>
12123  *
12124  * Returns: (element-type utf8) (transfer full): #GList of the registered content types
12125  */
12126
12127
12128 /**
12129  * g_converter_convert:
12130  * @converter: a #GConverter.
12131  * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
12132  * @inbuf_size: the number of bytes in @inbuf
12133  * @outbuf: a buffer to write converted data in.
12134  * @outbuf_size: the number of bytes in @outbuf, must be at least one
12135  * @flags: a #GConverterFlags controlling the conversion details
12136  * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
12137  * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
12138  * @error: location to store the error occurring, or %NULL to ignore
12139  *
12140  * This is the main operation used when converting data. It is to be called
12141  * multiple times in a loop, and each time it will do some work, i.e.
12142  * producing some output (in @outbuf) or consuming some input (from @inbuf) or
12143  * both. If its not possible to do any work an error is returned.
12144  *
12145  * Note that a single call may not consume all input (or any input at all).
12146  * Also a call may produce output even if given no input, due to state stored
12147  * in the converter producing output.
12148  *
12149  * If any data was either produced or consumed, and then an error happens, then
12150  * only the successful conversion is reported and the error is returned on the
12151  * next call.
12152  *
12153  * A full conversion loop involves calling this method repeatedly, each time
12154  * giving it new input and space output space. When there is no more input
12155  * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
12156  * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
12157  * each time until all data is consumed and all output is produced, then
12158  * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
12159  * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
12160  * in a decompression converter where the end of data is detectable from the
12161  * data (and there might even be other data after the end of the compressed data).
12162  *
12163  * When some data has successfully been converted @bytes_read and is set to
12164  * the number of bytes read from @inbuf, and @bytes_written is set to indicate
12165  * how many bytes was written to @outbuf. If there are more data to output
12166  * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
12167  * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
12168  * then %G_CONVERTER_FINISHED is returned.
12169  *
12170  * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
12171  * Some errors need special handling:
12172  *
12173  * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
12174  * to write the resulting converted data, the application should
12175  * call the function again with a larger @outbuf to continue.
12176  *
12177  * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
12178  * input to fully determine what the conversion should produce,
12179  * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
12180  * example with an incomplete multibyte sequence when converting text,
12181  * or when a regexp matches up to the end of the input (and may match
12182  * further input). It may also happen when @inbuf_size is zero and
12183  * there is no more data to produce.
12184  *
12185  * When this happens the application should read more input and then
12186  * call the function again. If further input shows that there is no
12187  * more data call the function again with the same data but with
12188  * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
12189  * to finish as e.g. in the regexp match case (or, to fail again with
12190  * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
12191  * input is actually partial).
12192  *
12193  * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
12194  * converter object is in an invalid state where its not allowed
12195  * to call g_converter_convert() anymore. At this time you can only
12196  * free the object or call g_converter_reset() to reset it to the
12197  * initial state.
12198  *
12199  * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
12200  * to try to write out all internal state to the output. The application
12201  * has to call the function multiple times with the flag set, and when
12202  * the available input has been consumed and all internal state has
12203  * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
12204  * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
12205  * This is somewhat similar to what happens at the end of the input stream,
12206  * but done in the middle of the data.
12207  *
12208  * This has different meanings for different conversions. For instance
12209  * in a compression converter it would mean that we flush all the
12210  * compression state into output such that if you uncompress the
12211  * compressed data you get back all the input data. Doing this may
12212  * make the final file larger due to padding though. Another example
12213  * is a regexp conversion, where if you at the end of the flushed data
12214  * have a match, but there is also a potential longer match. In the
12215  * non-flushed case we would ask for more input, but when flushing we
12216  * treat this as the end of input and do the match.
12217  *
12218  * Flushing is not always possible (like if a charset converter flushes
12219  * at a partial multibyte sequence). Converters are supposed to try
12220  * to produce as much output as possible and then return an error
12221  * (typically %G_IO_ERROR_PARTIAL_INPUT).
12222  *
12223  * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
12224  * Since: 2.24
12225  */
12226
12227
12228 /**
12229  * g_converter_input_stream_get_converter:
12230  * @converter_stream: a #GConverterInputStream
12231  *
12232  * Gets the #GConverter that is used by @converter_stream.
12233  *
12234  * Returns: (transfer none): the converter of the converter input stream
12235  * Since: 2.24
12236  */
12237
12238
12239 /**
12240  * g_converter_input_stream_new:
12241  * @base_stream: a #GInputStream
12242  * @converter: a #GConverter
12243  *
12244  * Creates a new converter input stream for the @base_stream.
12245  *
12246  * Returns: a new #GInputStream.
12247  */
12248
12249
12250 /**
12251  * g_converter_output_stream_get_converter:
12252  * @converter_stream: a #GConverterOutputStream
12253  *
12254  * Gets the #GConverter that is used by @converter_stream.
12255  *
12256  * Returns: (transfer none): the converter of the converter output stream
12257  * Since: 2.24
12258  */
12259
12260
12261 /**
12262  * g_converter_output_stream_new:
12263  * @base_stream: a #GOutputStream
12264  * @converter: a #GConverter
12265  *
12266  * Creates a new converter output stream for the @base_stream.
12267  *
12268  * Returns: a new #GOutputStream.
12269  */
12270
12271
12272 /**
12273  * g_converter_reset:
12274  * @converter: a #GConverter.
12275  *
12276  * Resets all internal state in the converter, making it behave
12277  * as if it was just created. If the converter has any internal
12278  * state that would produce output then that output is lost.
12279  *
12280  * Since: 2.24
12281  */
12282
12283
12284 /**
12285  * g_credentials_get_native: (skip)
12286  * @credentials: A #GCredentials.
12287  * @native_type: The type of native credentials to get.
12288  *
12289  * Gets a pointer to native credentials of type @native_type from
12290  * @credentials.
12291  *
12292  * It is a programming error (which will cause an warning to be
12293  * logged) to use this method if there is no #GCredentials support for
12294  * the OS or if @native_type isn't supported by the OS.
12295  *
12296  * 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.
12297  * Since: 2.26
12298  */
12299
12300
12301 /**
12302  * g_credentials_get_unix_user:
12303  * @credentials: A #GCredentials
12304  * @error: Return location for error or %NULL.
12305  *
12306  * Tries to get the UNIX user identifier from @credentials. This
12307  * method is only available on UNIX platforms.
12308  *
12309  * This operation can fail if #GCredentials is not supported on the
12310  * OS or if the native credentials type does not contain information
12311  * about the UNIX user.
12312  *
12313  * Returns: The UNIX user identifier or -1 if @error is set.
12314  * Since: 2.26
12315  */
12316
12317
12318 /**
12319  * g_credentials_is_same_user:
12320  * @credentials: A #GCredentials.
12321  * @other_credentials: A #GCredentials.
12322  * @error: Return location for error or %NULL.
12323  *
12324  * Checks if @credentials and @other_credentials is the same user.
12325  *
12326  * This operation can fail if #GCredentials is not supported on the
12327  * the OS.
12328  *
12329  * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
12330  * Since: 2.26
12331  */
12332
12333
12334 /**
12335  * g_credentials_new:
12336  *
12337  * Creates a new #GCredentials object with credentials matching the
12338  * the current process.
12339  *
12340  * Returns: A #GCredentials. Free with g_object_unref().
12341  * Since: 2.26
12342  */
12343
12344
12345 /**
12346  * g_credentials_set_native:
12347  * @credentials: A #GCredentials.
12348  * @native_type: The type of native credentials to set.
12349  * @native: A pointer to native credentials.
12350  *
12351  * Copies the native credentials of type @native_type from @native
12352  * into @credentials.
12353  *
12354  * It is a programming error (which will cause an warning to be
12355  * logged) to use this method if there is no #GCredentials support for
12356  * the OS or if @native_type isn't supported by the OS.
12357  *
12358  * Since: 2.26
12359  */
12360
12361
12362 /**
12363  * g_credentials_set_unix_user:
12364  * @credentials: A #GCredentials.
12365  * @uid: The UNIX user identifier to set.
12366  * @error: Return location for error or %NULL.
12367  *
12368  * Tries to set the UNIX user identifier on @credentials. This method
12369  * is only available on UNIX platforms.
12370  *
12371  * This operation can fail if #GCredentials is not supported on the
12372  * OS or if the native credentials type does not contain information
12373  * about the UNIX user.
12374  *
12375  * Returns: %TRUE if @uid was set, %FALSE if error is set.
12376  * Since: 2.26
12377  */
12378
12379
12380 /**
12381  * g_credentials_to_string:
12382  * @credentials: A #GCredentials object.
12383  *
12384  * Creates a human-readable textual representation of @credentials
12385  * that can be used in logging and debug messages. The format of the
12386  * returned string may change in future GLib release.
12387  *
12388  * Returns: A string that should be freed with g_free().
12389  * Since: 2.26
12390  */
12391
12392
12393 /**
12394  * g_data_input_stream_get_byte_order:
12395  * @stream: a given #GDataInputStream.
12396  *
12397  * Gets the byte order for the data input stream.
12398  *
12399  * Returns: the @stream's current #GDataStreamByteOrder.
12400  */
12401
12402
12403 /**
12404  * g_data_input_stream_get_newline_type:
12405  * @stream: a given #GDataInputStream.
12406  *
12407  * Gets the current newline type for the @stream.
12408  *
12409  * Returns: #GDataStreamNewlineType for the given @stream.
12410  */
12411
12412
12413 /**
12414  * g_data_input_stream_new:
12415  * @base_stream: a #GInputStream.
12416  *
12417  * Creates a new data input stream for the @base_stream.
12418  *
12419  * Returns: a new #GDataInputStream.
12420  */
12421
12422
12423 /**
12424  * g_data_input_stream_read_byte:
12425  * @stream: a given #GDataInputStream.
12426  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12427  * @error: #GError for error reporting.
12428  *
12429  * Reads an unsigned 8-bit/1-byte value from @stream.
12430  *
12431  * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
12432  */
12433
12434
12435 /**
12436  * g_data_input_stream_read_int16:
12437  * @stream: a given #GDataInputStream.
12438  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12439  * @error: #GError for error reporting.
12440  *
12441  * Reads a 16-bit/2-byte value from @stream.
12442  *
12443  * In order to get the correct byte order for this read operation,
12444  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12445  *
12446  * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
12447  */
12448
12449
12450 /**
12451  * g_data_input_stream_read_int32:
12452  * @stream: a given #GDataInputStream.
12453  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12454  * @error: #GError for error reporting.
12455  *
12456  * Reads a signed 32-bit/4-byte value from @stream.
12457  *
12458  * In order to get the correct byte order for this read operation,
12459  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12460  *
12461  * If @cancellable is not %NULL, then the operation can be cancelled by
12462  * triggering the cancellable object from another thread. If the operation
12463  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12464  *
12465  * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12466  */
12467
12468
12469 /**
12470  * g_data_input_stream_read_int64:
12471  * @stream: a given #GDataInputStream.
12472  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12473  * @error: #GError for error reporting.
12474  *
12475  * Reads a 64-bit/8-byte value from @stream.
12476  *
12477  * In order to get the correct byte order for this read operation,
12478  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12479  *
12480  * If @cancellable is not %NULL, then the operation can be cancelled by
12481  * triggering the cancellable object from another thread. If the operation
12482  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12483  *
12484  * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
12485  */
12486
12487
12488 /**
12489  * g_data_input_stream_read_line:
12490  * @stream: a given #GDataInputStream.
12491  * @length: (out): a #gsize to get the length of the data read in.
12492  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12493  * @error: #GError for error reporting.
12494  *
12495  * Reads a line from the data input stream.  Note that no encoding
12496  * checks or conversion is performed; the input is not guaranteed to
12497  * be UTF-8, and may in fact have embedded NUL characters.
12498  *
12499  * If @cancellable is not %NULL, then the operation can be cancelled by
12500  * triggering the cancellable object from another thread. If the operation
12501  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12502  *
12503  * 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.
12504  */
12505
12506
12507 /**
12508  * g_data_input_stream_read_line_async:
12509  * @stream: a given #GDataInputStream.
12510  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12511  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12512  * @callback: (scope async): callback to call when the request is satisfied.
12513  * @user_data: (closure): the data to pass to callback function.
12514  *
12515  * The asynchronous version of g_data_input_stream_read_line().  It is
12516  * an error to have two outstanding calls to this function.
12517  *
12518  * When the operation is finished, @callback will be called. You
12519  * can then call g_data_input_stream_read_line_finish() to get
12520  * the result of the operation.
12521  *
12522  * Since: 2.20
12523  */
12524
12525
12526 /**
12527  * g_data_input_stream_read_line_finish:
12528  * @stream: a given #GDataInputStream.
12529  * @result: the #GAsyncResult that was provided to the callback.
12530  * @length: (out): a #gsize to get the length of the data read in.
12531  * @error: #GError for error reporting.
12532  *
12533  * Finish an asynchronous call started by
12534  * g_data_input_stream_read_line_async().  Note the warning about
12535  * string encoding in g_data_input_stream_read_line() applies here as
12536  * well.
12537  *
12538  * 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.
12539  * Since: 2.20
12540  */
12541
12542
12543 /**
12544  * g_data_input_stream_read_line_finish_utf8:
12545  * @stream: a given #GDataInputStream.
12546  * @result: the #GAsyncResult that was provided to the callback.
12547  * @length: (out): a #gsize to get the length of the data read in.
12548  * @error: #GError for error reporting.
12549  *
12550  * Finish an asynchronous call started by
12551  * g_data_input_stream_read_line_async().
12552  *
12553  * 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.
12554  * Since: 2.30
12555  */
12556
12557
12558 /**
12559  * g_data_input_stream_read_line_utf8:
12560  * @stream: a given #GDataInputStream.
12561  * @length: (out): a #gsize to get the length of the data read in.
12562  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12563  * @error: #GError for error reporting.
12564  *
12565  * Reads a UTF-8 encoded line from the data input stream.
12566  *
12567  * If @cancellable is not %NULL, then the operation can be cancelled by
12568  * triggering the cancellable object from another thread. If the operation
12569  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12570  *
12571  * 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.
12572  * Since: 2.30
12573  */
12574
12575
12576 /**
12577  * g_data_input_stream_read_uint16:
12578  * @stream: a given #GDataInputStream.
12579  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12580  * @error: #GError for error reporting.
12581  *
12582  * Reads an unsigned 16-bit/2-byte value from @stream.
12583  *
12584  * In order to get the correct byte order for this read operation,
12585  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12586  *
12587  * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
12588  */
12589
12590
12591 /**
12592  * g_data_input_stream_read_uint32:
12593  * @stream: a given #GDataInputStream.
12594  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12595  * @error: #GError for error reporting.
12596  *
12597  * Reads an unsigned 32-bit/4-byte value from @stream.
12598  *
12599  * In order to get the correct byte order for this read operation,
12600  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12601  *
12602  * If @cancellable is not %NULL, then the operation can be cancelled by
12603  * triggering the cancellable object from another thread. If the operation
12604  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12605  *
12606  * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12607  */
12608
12609
12610 /**
12611  * g_data_input_stream_read_uint64:
12612  * @stream: a given #GDataInputStream.
12613  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12614  * @error: #GError for error reporting.
12615  *
12616  * Reads an unsigned 64-bit/8-byte value from @stream.
12617  *
12618  * In order to get the correct byte order for this read operation,
12619  * see g_data_input_stream_get_byte_order().
12620  *
12621  * If @cancellable is not %NULL, then the operation can be cancelled by
12622  * triggering the cancellable object from another thread. If the operation
12623  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12624  *
12625  * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
12626  */
12627
12628
12629 /**
12630  * g_data_input_stream_read_until:
12631  * @stream: a given #GDataInputStream.
12632  * @stop_chars: characters to terminate the read.
12633  * @length: (out): a #gsize to get the length of the data read in.
12634  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12635  * @error: #GError for error reporting.
12636  *
12637  * Reads a string from the data input stream, up to the first
12638  * occurrence of any of the stop characters.
12639  *
12640  * Note that, in contrast to g_data_input_stream_read_until_async(),
12641  * this function consumes the stop character that it finds.
12642  *
12643  * Don't use this function in new code.  Its functionality is
12644  * inconsistent with g_data_input_stream_read_until_async().  Both
12645  * functions will be marked as deprecated in a future release.  Use
12646  * g_data_input_stream_read_upto() instead, but note that that function
12647  * does not consume the stop character.
12648  *
12649  * 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.
12650  */
12651
12652
12653 /**
12654  * g_data_input_stream_read_until_async:
12655  * @stream: a given #GDataInputStream.
12656  * @stop_chars: characters to terminate the read.
12657  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12658  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12659  * @callback: (scope async): callback to call when the request is satisfied.
12660  * @user_data: (closure): the data to pass to callback function.
12661  *
12662  * The asynchronous version of g_data_input_stream_read_until().
12663  * It is an error to have two outstanding calls to this function.
12664  *
12665  * Note that, in contrast to g_data_input_stream_read_until(),
12666  * this function does not consume the stop character that it finds.  You
12667  * must read it for yourself.
12668  *
12669  * When the operation is finished, @callback will be called. You
12670  * can then call g_data_input_stream_read_until_finish() to get
12671  * the result of the operation.
12672  *
12673  * Don't use this function in new code.  Its functionality is
12674  * inconsistent with g_data_input_stream_read_until().  Both functions
12675  * will be marked as deprecated in a future release.  Use
12676  * g_data_input_stream_read_upto_async() instead.
12677  *
12678  * Since: 2.20
12679  */
12680
12681
12682 /**
12683  * g_data_input_stream_read_until_finish:
12684  * @stream: a given #GDataInputStream.
12685  * @result: the #GAsyncResult that was provided to the callback.
12686  * @length: (out): a #gsize to get the length of the data read in.
12687  * @error: #GError for error reporting.
12688  *
12689  * Finish an asynchronous call started by
12690  * g_data_input_stream_read_until_async().
12691  *
12692  * Since: 2.20
12693  * 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.
12694  */
12695
12696
12697 /**
12698  * g_data_input_stream_read_upto:
12699  * @stream: a #GDataInputStream
12700  * @stop_chars: characters to terminate the read
12701  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12702  * @length: (out): a #gsize to get the length of the data read in
12703  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12704  * @error: #GError for error reporting
12705  *
12706  * Reads a string from the data input stream, up to the first
12707  * occurrence of any of the stop characters.
12708  *
12709  * In contrast to g_data_input_stream_read_until(), this function
12710  * does <emphasis>not</emphasis> consume the stop character. You have
12711  * to use g_data_input_stream_read_byte() to get it before calling
12712  * g_data_input_stream_read_upto() again.
12713  *
12714  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12715  * specified.
12716  *
12717  * 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
12718  * Since: 2.26
12719  */
12720
12721
12722 /**
12723  * g_data_input_stream_read_upto_async:
12724  * @stream: a #GDataInputStream
12725  * @stop_chars: characters to terminate the read
12726  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12727  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12728  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12729  * @callback: (scope async): callback to call when the request is satisfied
12730  * @user_data: (closure): the data to pass to callback function
12731  *
12732  * The asynchronous version of g_data_input_stream_read_upto().
12733  * It is an error to have two outstanding calls to this function.
12734  *
12735  * In contrast to g_data_input_stream_read_until(), this function
12736  * does <emphasis>not</emphasis> consume the stop character. You have
12737  * to use g_data_input_stream_read_byte() to get it before calling
12738  * g_data_input_stream_read_upto() again.
12739  *
12740  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12741  * specified.
12742  *
12743  * When the operation is finished, @callback will be called. You
12744  * can then call g_data_input_stream_read_upto_finish() to get
12745  * the result of the operation.
12746  *
12747  * Since: 2.26
12748  */
12749
12750
12751 /**
12752  * g_data_input_stream_read_upto_finish:
12753  * @stream: a #GDataInputStream
12754  * @result: the #GAsyncResult that was provided to the callback
12755  * @length: (out): a #gsize to get the length of the data read in
12756  * @error: #GError for error reporting
12757  *
12758  * Finish an asynchronous call started by
12759  * g_data_input_stream_read_upto_async().
12760  *
12761  * Note that this function does <emphasis>not</emphasis> consume the
12762  * stop character. You have to use g_data_input_stream_read_byte() to
12763  * get it before calling g_data_input_stream_read_upto_async() again.
12764  *
12765  * 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.
12766  * Since: 2.24
12767  */
12768
12769
12770 /**
12771  * g_data_input_stream_set_byte_order:
12772  * @stream: a given #GDataInputStream.
12773  * @order: a #GDataStreamByteOrder to set.
12774  *
12775  * This function sets the byte order for the given @stream. All subsequent
12776  * reads from the @stream will be read in the given @order.
12777  */
12778
12779
12780 /**
12781  * g_data_input_stream_set_newline_type:
12782  * @stream: a #GDataInputStream.
12783  * @type: the type of new line return as #GDataStreamNewlineType.
12784  *
12785  * Sets the newline type for the @stream.
12786  *
12787  * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12788  * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12789  * "CR LF", and this might block if there is no more data available.
12790  */
12791
12792
12793 /**
12794  * g_data_output_stream_get_byte_order:
12795  * @stream: a #GDataOutputStream.
12796  *
12797  * Gets the byte order for the stream.
12798  *
12799  * Returns: the #GDataStreamByteOrder for the @stream.
12800  */
12801
12802
12803 /**
12804  * g_data_output_stream_new:
12805  * @base_stream: a #GOutputStream.
12806  *
12807  * Creates a new data output stream for @base_stream.
12808  *
12809  * Returns: #GDataOutputStream.
12810  */
12811
12812
12813 /**
12814  * g_data_output_stream_put_byte:
12815  * @stream: a #GDataOutputStream.
12816  * @data: a #guchar.
12817  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12818  * @error: a #GError, %NULL to ignore.
12819  *
12820  * Puts a byte into the output stream.
12821  *
12822  * Returns: %TRUE if @data was successfully added to the @stream.
12823  */
12824
12825
12826 /**
12827  * g_data_output_stream_put_int16:
12828  * @stream: a #GDataOutputStream.
12829  * @data: a #gint16.
12830  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12831  * @error: a #GError, %NULL to ignore.
12832  *
12833  * Puts a signed 16-bit integer into the output stream.
12834  *
12835  * Returns: %TRUE if @data was successfully added to the @stream.
12836  */
12837
12838
12839 /**
12840  * g_data_output_stream_put_int32:
12841  * @stream: a #GDataOutputStream.
12842  * @data: a #gint32.
12843  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12844  * @error: a #GError, %NULL to ignore.
12845  *
12846  * Puts a signed 32-bit integer into the output stream.
12847  *
12848  * Returns: %TRUE if @data was successfully added to the @stream.
12849  */
12850
12851
12852 /**
12853  * g_data_output_stream_put_int64:
12854  * @stream: a #GDataOutputStream.
12855  * @data: a #gint64.
12856  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12857  * @error: a #GError, %NULL to ignore.
12858  *
12859  * Puts a signed 64-bit integer into the stream.
12860  *
12861  * Returns: %TRUE if @data was successfully added to the @stream.
12862  */
12863
12864
12865 /**
12866  * g_data_output_stream_put_string:
12867  * @stream: a #GDataOutputStream.
12868  * @str: a string.
12869  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12870  * @error: a #GError, %NULL to ignore.
12871  *
12872  * Puts a string into the output stream.
12873  *
12874  * Returns: %TRUE if @string was successfully added to the @stream.
12875  */
12876
12877
12878 /**
12879  * g_data_output_stream_put_uint16:
12880  * @stream: a #GDataOutputStream.
12881  * @data: a #guint16.
12882  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12883  * @error: a #GError, %NULL to ignore.
12884  *
12885  * Puts an unsigned 16-bit integer into the output stream.
12886  *
12887  * Returns: %TRUE if @data was successfully added to the @stream.
12888  */
12889
12890
12891 /**
12892  * g_data_output_stream_put_uint32:
12893  * @stream: a #GDataOutputStream.
12894  * @data: a #guint32.
12895  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12896  * @error: a #GError, %NULL to ignore.
12897  *
12898  * Puts an unsigned 32-bit integer into the stream.
12899  *
12900  * Returns: %TRUE if @data was successfully added to the @stream.
12901  */
12902
12903
12904 /**
12905  * g_data_output_stream_put_uint64:
12906  * @stream: a #GDataOutputStream.
12907  * @data: a #guint64.
12908  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12909  * @error: a #GError, %NULL to ignore.
12910  *
12911  * Puts an unsigned 64-bit integer into the stream.
12912  *
12913  * Returns: %TRUE if @data was successfully added to the @stream.
12914  */
12915
12916
12917 /**
12918  * g_data_output_stream_set_byte_order:
12919  * @stream: a #GDataOutputStream.
12920  * @order: a %GDataStreamByteOrder.
12921  *
12922  * Sets the byte order of the data output stream to @order.
12923  */
12924
12925
12926 /**
12927  * g_dbus_action_group_get:
12928  * @connection: A #GDBusConnection
12929  * @bus_name: the bus name which exports the action group
12930  * @object_path: the object path at which the action group is exported
12931  *
12932  * Obtains a #GDBusActionGroup for the action group which is exported at
12933  * the given @bus_name and @object_path.
12934  *
12935  * The thread default main context is taken at the time of this call.
12936  * All signals on the menu model (and any linked models) are reported
12937  * with respect to this context.  All calls on the returned menu model
12938  * (and linked models) must also originate from this same context, with
12939  * the thread default main context unchanged.
12940  *
12941  * This call is non-blocking.  The returned action group may or may not
12942  * already be filled in.  The correct thing to do is connect the signals
12943  * for the action group to monitor for changes and then to call
12944  * g_action_group_list_actions() to get the initial list.
12945  *
12946  * Returns: (transfer full): a #GDBusActionGroup
12947  * Since: 2.32
12948  */
12949
12950
12951 /**
12952  * g_dbus_address_get_for_bus_sync:
12953  * @bus_type: A #GBusType.
12954  * @cancellable: (allow-none): A #GCancellable or %NULL.
12955  * @error: Return location for error or %NULL.
12956  *
12957  * Synchronously looks up the D-Bus address for the well-known message
12958  * bus instance specified by @bus_type. This may involve using various
12959  * platform specific mechanisms.
12960  *
12961  * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12962  * Since: 2.26
12963  */
12964
12965
12966 /**
12967  * g_dbus_address_get_stream:
12968  * @address: A valid D-Bus address.
12969  * @cancellable: (allow-none): A #GCancellable or %NULL.
12970  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12971  * @user_data: Data to pass to @callback.
12972  *
12973  * Asynchronously connects to an endpoint specified by @address and
12974  * sets up the connection so it is in a state to run the client-side
12975  * of the D-Bus authentication conversation.
12976  *
12977  * When the operation is finished, @callback will be invoked. You can
12978  * then call g_dbus_address_get_stream_finish() to get the result of
12979  * the operation.
12980  *
12981  * This is an asynchronous failable function. See
12982  * g_dbus_address_get_stream_sync() for the synchronous version.
12983  *
12984  * Since: 2.26
12985  */
12986
12987
12988 /**
12989  * g_dbus_address_get_stream_finish:
12990  * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12991  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12992  * @error: Return location for error or %NULL.
12993  *
12994  * Finishes an operation started with g_dbus_address_get_stream().
12995  *
12996  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12997  * Since: 2.26
12998  */
12999
13000
13001 /**
13002  * g_dbus_address_get_stream_sync:
13003  * @address: A valid D-Bus address.
13004  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
13005  * @cancellable: (allow-none): A #GCancellable or %NULL.
13006  * @error: Return location for error or %NULL.
13007  *
13008  * Synchronously connects to an endpoint specified by @address and
13009  * sets up the connection so it is in a state to run the client-side
13010  * of the D-Bus authentication conversation.
13011  *
13012  * This is a synchronous failable function. See
13013  * g_dbus_address_get_stream() for the asynchronous version.
13014  *
13015  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
13016  * Since: 2.26
13017  */
13018
13019
13020 /**
13021  * g_dbus_annotation_info_lookup:
13022  * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
13023  * @name: The name of the annotation to look up.
13024  *
13025  * Looks up the value of an annotation.
13026  *
13027  * The cost of this function is O(n) in number of annotations.
13028  *
13029  * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
13030  * Since: 2.26
13031  */
13032
13033
13034 /**
13035  * g_dbus_annotation_info_ref:
13036  * @info: A #GDBusNodeInfo
13037  *
13038  * If @info is statically allocated does nothing. Otherwise increases
13039  * the reference count.
13040  *
13041  * Returns: The same @info.
13042  * Since: 2.26
13043  */
13044
13045
13046 /**
13047  * g_dbus_annotation_info_unref:
13048  * @info: A #GDBusAnnotationInfo.
13049  *
13050  * If @info is statically allocated, does nothing. Otherwise decreases
13051  * the reference count of @info. When its reference count drops to 0,
13052  * the memory used is freed.
13053  *
13054  * Since: 2.26
13055  */
13056
13057
13058 /**
13059  * g_dbus_arg_info_ref:
13060  * @info: A #GDBusArgInfo
13061  *
13062  * If @info is statically allocated does nothing. Otherwise increases
13063  * the reference count.
13064  *
13065  * Returns: The same @info.
13066  * Since: 2.26
13067  */
13068
13069
13070 /**
13071  * g_dbus_arg_info_unref:
13072  * @info: A #GDBusArgInfo.
13073  *
13074  * If @info is statically allocated, does nothing. Otherwise decreases
13075  * the reference count of @info. When its reference count drops to 0,
13076  * the memory used is freed.
13077  *
13078  * Since: 2.26
13079  */
13080
13081
13082 /**
13083  * g_dbus_auth_observer_allow_mechanism:
13084  * @observer: A #GDBusAuthObserver.
13085  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
13086  *
13087  * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
13088  *
13089  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
13090  * Since: 2.34
13091  */
13092
13093
13094 /**
13095  * g_dbus_auth_observer_authorize_authenticated_peer:
13096  * @observer: A #GDBusAuthObserver.
13097  * @stream: A #GIOStream for the #GDBusConnection.
13098  * @credentials: (allow-none): Credentials received from the peer or %NULL.
13099  *
13100  * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
13101  *
13102  * Returns: %TRUE if the peer is authorized, %FALSE if not.
13103  * Since: 2.26
13104  */
13105
13106
13107 /**
13108  * g_dbus_auth_observer_new:
13109  *
13110  * Creates a new #GDBusAuthObserver object.
13111  *
13112  * Returns: A #GDBusAuthObserver. Free with g_object_unref().
13113  * Since: 2.26
13114  */
13115
13116
13117 /**
13118  * g_dbus_connection_add_filter:
13119  * @connection: A #GDBusConnection.
13120  * @filter_function: A filter function.
13121  * @user_data: User data to pass to @filter_function.
13122  * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
13123  *
13124  * Adds a message filter. Filters are handlers that are run on all
13125  * incoming and outgoing messages, prior to standard dispatch. Filters
13126  * are run in the order that they were added.  The same handler can be
13127  * added as a filter more than once, in which case it will be run more
13128  * than once.  Filters added during a filter callback won't be run on
13129  * the message being processed. Filter functions are allowed to modify
13130  * and even drop messages.
13131  *
13132  * Note that filters are run in a dedicated message handling thread so
13133  * they can't block and, generally, can't do anything but signal a
13134  * worker thread. Also note that filters are rarely needed - use API
13135  * such as g_dbus_connection_send_message_with_reply(),
13136  * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
13137  *
13138  * If a filter consumes an incoming message the message is not
13139  * dispatched anywhere else - not even the standard dispatch machinery
13140  * (that API such as g_dbus_connection_signal_subscribe() and
13141  * g_dbus_connection_send_message_with_reply() relies on) will see the
13142  * message. Similary, if a filter consumes an outgoing message, the
13143  * message will not be sent to the other peer.
13144  *
13145  * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
13146  * Since: 2.26
13147  */
13148
13149
13150 /**
13151  * g_dbus_connection_call:
13152  * @connection: A #GDBusConnection.
13153  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13154  * @object_path: Path of remote object.
13155  * @interface_name: D-Bus interface to invoke method on.
13156  * @method_name: The name of the method to invoke.
13157  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13158  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13159  * @flags: Flags from the #GDBusCallFlags enumeration.
13160  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13161  * @cancellable: (allow-none): A #GCancellable or %NULL.
13162  * @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.
13163  * @user_data: The data to pass to @callback.
13164  *
13165  * Asynchronously invokes the @method_name method on the
13166  * @interface_name D-Bus interface on the remote object at
13167  * @object_path owned by @bus_name.
13168  *
13169  * If @connection is closed then the operation will fail with
13170  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13171  * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
13172  * not compatible with the D-Bus protocol, the operation fails with
13173  * %G_IO_ERROR_INVALID_ARGUMENT.
13174  *
13175  * If @reply_type is non-%NULL then the reply will be checked for having this type and an
13176  * error will be raised if it does not match.  Said another way, if you give a @reply_type
13177  * then any non-%NULL return value will be of this type.
13178  *
13179  * If the @parameters #GVariant is floating, it is consumed. This allows
13180  * convenient 'inline' use of g_variant_new(), e.g.:
13181  * |[
13182  *  g_dbus_connection_call (connection,
13183  *                          "org.freedesktop.StringThings",
13184  *                          "/org/freedesktop/StringThings",
13185  *                          "org.freedesktop.StringThings",
13186  *                          "TwoStrings",
13187  *                          g_variant_new ("(ss)",
13188  *                                         "Thing One",
13189  *                                         "Thing Two"),
13190  *                          NULL,
13191  *                          G_DBUS_CALL_FLAGS_NONE,
13192  *                          -1,
13193  *                          NULL,
13194  *                          (GAsyncReadyCallback) two_strings_done,
13195  *                          NULL);
13196  * ]|
13197  *
13198  * This is an asynchronous method. When the operation is finished, @callback will be invoked
13199  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13200  * of the thread you are calling this method from. You can then call
13201  * g_dbus_connection_call_finish() to get the result of the operation.
13202  * See g_dbus_connection_call_sync() for the synchronous version of this
13203  * function.
13204  *
13205  * If @callback is %NULL then the D-Bus method call message will be sent with
13206  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
13207  *
13208  * Since: 2.26
13209  */
13210
13211
13212 /**
13213  * g_dbus_connection_call_finish:
13214  * @connection: A #GDBusConnection.
13215  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
13216  * @error: Return location for error or %NULL.
13217  *
13218  * Finishes an operation started with g_dbus_connection_call().
13219  *
13220  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13221  * Since: 2.26
13222  */
13223
13224
13225 /**
13226  * g_dbus_connection_call_sync:
13227  * @connection: A #GDBusConnection.
13228  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13229  * @object_path: Path of remote object.
13230  * @interface_name: D-Bus interface to invoke method on.
13231  * @method_name: The name of the method to invoke.
13232  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13233  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13234  * @flags: Flags from the #GDBusCallFlags enumeration.
13235  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13236  * @cancellable: (allow-none): A #GCancellable or %NULL.
13237  * @error: Return location for error or %NULL.
13238  *
13239  * Synchronously invokes the @method_name method on the
13240  * @interface_name D-Bus interface on the remote object at
13241  * @object_path owned by @bus_name.
13242  *
13243  * If @connection is closed then the operation will fail with
13244  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
13245  * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
13246  * contains a value not compatible with the D-Bus protocol, the operation
13247  * fails with %G_IO_ERROR_INVALID_ARGUMENT.
13248  *
13249  * If @reply_type is non-%NULL then the reply will be checked for having
13250  * this type and an error will be raised if it does not match.  Said
13251  * another way, if you give a @reply_type then any non-%NULL return
13252  * value will be of this type.
13253  *
13254  * If the @parameters #GVariant is floating, it is consumed.
13255  * This allows convenient 'inline' use of g_variant_new(), e.g.:
13256  * |[
13257  *  g_dbus_connection_call_sync (connection,
13258  *                               "org.freedesktop.StringThings",
13259  *                               "/org/freedesktop/StringThings",
13260  *                               "org.freedesktop.StringThings",
13261  *                               "TwoStrings",
13262  *                               g_variant_new ("(ss)",
13263  *                                              "Thing One",
13264  *                                              "Thing Two"),
13265  *                               NULL,
13266  *                               G_DBUS_CALL_FLAGS_NONE,
13267  *                               -1,
13268  *                               NULL,
13269  *                               &amp;error);
13270  * ]|
13271  *
13272  * The calling thread is blocked until a reply is received. See
13273  * g_dbus_connection_call() for the asynchronous version of
13274  * this method.
13275  *
13276  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13277  * Since: 2.26
13278  */
13279
13280
13281 /**
13282  * g_dbus_connection_call_with_unix_fd_list:
13283  * @connection: A #GDBusConnection.
13284  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13285  * @object_path: Path of remote object.
13286  * @interface_name: D-Bus interface to invoke method on.
13287  * @method_name: The name of the method to invoke.
13288  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13289  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13290  * @flags: Flags from the #GDBusCallFlags enumeration.
13291  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13292  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13293  * @cancellable: (allow-none): A #GCancellable or %NULL.
13294  * @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.
13295  * @user_data: The data to pass to @callback.
13296  *
13297  * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
13298  *
13299  * This method is only available on UNIX.
13300  *
13301  * Since: 2.30
13302  */
13303
13304
13305 /**
13306  * g_dbus_connection_call_with_unix_fd_list_finish:
13307  * @connection: A #GDBusConnection.
13308  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
13309  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
13310  * @error: Return location for error or %NULL.
13311  *
13312  * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
13313  *
13314  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13315  * Since: 2.30
13316  */
13317
13318
13319 /**
13320  * g_dbus_connection_call_with_unix_fd_list_sync:
13321  * @connection: A #GDBusConnection.
13322  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13323  * @object_path: Path of remote object.
13324  * @interface_name: D-Bus interface to invoke method on.
13325  * @method_name: The name of the method to invoke.
13326  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13327  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13328  * @flags: Flags from the #GDBusCallFlags enumeration.
13329  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13330  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13331  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
13332  * @cancellable: (allow-none): A #GCancellable or %NULL.
13333  * @error: Return location for error or %NULL.
13334  *
13335  * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
13336  *
13337  * This method is only available on UNIX.
13338  *
13339  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13340  * Since: 2.30
13341  */
13342
13343
13344 /**
13345  * g_dbus_connection_close:
13346  * @connection: A #GDBusConnection.
13347  * @cancellable: (allow-none): A #GCancellable or %NULL.
13348  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13349  * @user_data: The data to pass to @callback.
13350  *
13351  * Closes @connection. Note that this never causes the process to
13352  * exit (this might only happen if the other end of a shared message
13353  * bus connection disconnects, see #GDBusConnection:exit-on-close).
13354  *
13355  * Once the connection is closed, operations such as sending a message
13356  * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
13357  * will not automatically flush the connection so queued messages may
13358  * be lost. Use g_dbus_connection_flush() if you need such guarantees.
13359  *
13360  * If @connection is already closed, this method fails with
13361  * %G_IO_ERROR_CLOSED.
13362  *
13363  * When @connection has been closed, the #GDBusConnection::closed
13364  * signal is emitted in the <link
13365  * linkend="g-main-context-push-thread-default">thread-default main
13366  * loop</link> of the thread that @connection was constructed in.
13367  *
13368  * This is an asynchronous method. When the operation is finished,
13369  * @callback will be invoked in the <link
13370  * linkend="g-main-context-push-thread-default">thread-default main
13371  * loop</link> of the thread you are calling this method from. You can
13372  * then call g_dbus_connection_close_finish() to get the result of the
13373  * operation.  See g_dbus_connection_close_sync() for the synchronous
13374  * version.
13375  *
13376  * Since: 2.26
13377  */
13378
13379
13380 /**
13381  * g_dbus_connection_close_finish:
13382  * @connection: A #GDBusConnection.
13383  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
13384  * @error: Return location for error or %NULL.
13385  *
13386  * Finishes an operation started with g_dbus_connection_close().
13387  *
13388  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13389  * Since: 2.26
13390  */
13391
13392
13393 /**
13394  * g_dbus_connection_close_sync:
13395  * @connection: A #GDBusConnection.
13396  * @cancellable: (allow-none): A #GCancellable or %NULL.
13397  * @error: Return location for error or %NULL.
13398  *
13399  * Synchronously closees @connection. The calling thread is blocked
13400  * until this is done. See g_dbus_connection_close() for the
13401  * asynchronous version of this method and more details about what it
13402  * does.
13403  *
13404  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13405  * Since: 2.26
13406  */
13407
13408
13409 /**
13410  * g_dbus_connection_emit_signal:
13411  * @connection: A #GDBusConnection.
13412  * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
13413  * @object_path: Path of remote object.
13414  * @interface_name: D-Bus interface to emit a signal on.
13415  * @signal_name: The name of the signal to emit.
13416  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
13417  * @error: Return location for error or %NULL.
13418  *
13419  * Emits a signal.
13420  *
13421  * If the parameters GVariant is floating, it is consumed.
13422  *
13423  * This can only fail if @parameters is not compatible with the D-Bus protocol.
13424  *
13425  * Returns: %TRUE unless @error is set.
13426  * Since: 2.26
13427  */
13428
13429
13430 /**
13431  * g_dbus_connection_export_action_group:
13432  * @connection: a #GDBusConnection
13433  * @object_path: a D-Bus object path
13434  * @action_group: a #GActionGroup
13435  * @error: a pointer to a %NULL #GError, or %NULL
13436  *
13437  * Exports @action_group on @connection at @object_path.
13438  *
13439  * The implemented D-Bus API should be considered private.  It is
13440  * subject to change in the future.
13441  *
13442  * A given object path can only have one action group exported on it.
13443  * If this constraint is violated, the export will fail and 0 will be
13444  * returned (with @error set accordingly).
13445  *
13446  * You can unexport the action group using
13447  * g_dbus_connection_unexport_action_group() with the return value of
13448  * this function.
13449  *
13450  * The thread default main context is taken at the time of this call.
13451  * All incoming action activations and state change requests are
13452  * reported from this context.  Any changes on the action group that
13453  * cause it to emit signals must also come from this same context.
13454  * Since incoming action activations and state change requests are
13455  * rather likely to cause changes on the action group, this effectively
13456  * limits a given action group to being exported from only one main
13457  * context.
13458  *
13459  * Returns: the ID of the export (never zero), or 0 in case of failure
13460  * Since: 2.32
13461  */
13462
13463
13464 /**
13465  * g_dbus_connection_export_menu_model:
13466  * @connection: a #GDBusConnection
13467  * @object_path: a D-Bus object path
13468  * @menu: a #GMenuModel
13469  * @error: return location for an error, or %NULL
13470  *
13471  * Exports @menu on @connection at @object_path.
13472  *
13473  * The implemented D-Bus API should be considered private.
13474  * It is subject to change in the future.
13475  *
13476  * An object path can only have one action group exported on it. If this
13477  * constraint is violated, the export will fail and 0 will be
13478  * returned (with @error set accordingly).
13479  *
13480  * You can unexport the menu model using
13481  * g_dbus_connection_unexport_menu_model() with the return value of
13482  * this function.
13483  *
13484  * Returns: the ID of the export (never zero), or 0 in case of failure
13485  * Since: 2.32
13486  */
13487
13488
13489 /**
13490  * g_dbus_connection_flush:
13491  * @connection: A #GDBusConnection.
13492  * @cancellable: (allow-none): A #GCancellable or %NULL.
13493  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13494  * @user_data: The data to pass to @callback.
13495  *
13496  * Asynchronously flushes @connection, that is, writes all queued
13497  * outgoing message to the transport and then flushes the transport
13498  * (using g_output_stream_flush_async()). This is useful in programs
13499  * that wants to emit a D-Bus signal and then exit
13500  * immediately. Without flushing the connection, there is no guarantee
13501  * that the message has been sent to the networking buffers in the OS
13502  * kernel.
13503  *
13504  * This is an asynchronous method. When the operation is finished,
13505  * @callback will be invoked in the <link
13506  * linkend="g-main-context-push-thread-default">thread-default main
13507  * loop</link> of the thread you are calling this method from. You can
13508  * then call g_dbus_connection_flush_finish() to get the result of the
13509  * operation.  See g_dbus_connection_flush_sync() for the synchronous
13510  * version.
13511  *
13512  * Since: 2.26
13513  */
13514
13515
13516 /**
13517  * g_dbus_connection_flush_finish:
13518  * @connection: A #GDBusConnection.
13519  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
13520  * @error: Return location for error or %NULL.
13521  *
13522  * Finishes an operation started with g_dbus_connection_flush().
13523  *
13524  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13525  * Since: 2.26
13526  */
13527
13528
13529 /**
13530  * g_dbus_connection_flush_sync:
13531  * @connection: A #GDBusConnection.
13532  * @cancellable: (allow-none): A #GCancellable or %NULL.
13533  * @error: Return location for error or %NULL.
13534  *
13535  * Synchronously flushes @connection. The calling thread is blocked
13536  * until this is done. See g_dbus_connection_flush() for the
13537  * asynchronous version of this method and more details about what it
13538  * does.
13539  *
13540  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13541  * Since: 2.26
13542  */
13543
13544
13545 /**
13546  * g_dbus_connection_get_capabilities:
13547  * @connection: A #GDBusConnection.
13548  *
13549  * Gets the capabilities negotiated with the remote peer
13550  *
13551  * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
13552  * Since: 2.26
13553  */
13554
13555
13556 /**
13557  * g_dbus_connection_get_exit_on_close:
13558  * @connection: A #GDBusConnection.
13559  *
13560  * Gets whether the process is terminated when @connection is
13561  * closed by the remote peer. See
13562  * #GDBusConnection:exit-on-close for more details.
13563  *
13564  * Returns: Whether the process is terminated when @connection is closed by the remote peer.
13565  * Since: 2.26
13566  */
13567
13568
13569 /**
13570  * g_dbus_connection_get_guid:
13571  * @connection: A #GDBusConnection.
13572  *
13573  * The GUID of the peer performing the role of server when
13574  * authenticating. See #GDBusConnection:guid for more details.
13575  *
13576  * Returns: The GUID. Do not free this string, it is owned by @connection.
13577  * Since: 2.26
13578  */
13579
13580
13581 /**
13582  * g_dbus_connection_get_last_serial:
13583  * @connection: A #GDBusConnection.
13584  *
13585  * Retrieves the last serial number assigned to a #GDBusMessage on
13586  * the current thread. This includes messages sent via both low-level
13587  * API such as g_dbus_connection_send_message() as well as
13588  * high-level API such as g_dbus_connection_emit_signal(),
13589  * g_dbus_connection_call() or g_dbus_proxy_call().
13590  *
13591  * Returns: the last used serial or zero when no message has been sent within the current thread.
13592  * Since: 2.34
13593  */
13594
13595
13596 /**
13597  * g_dbus_connection_get_peer_credentials:
13598  * @connection: A #GDBusConnection.
13599  *
13600  * Gets the credentials of the authenticated peer. This will always
13601  * return %NULL unless @connection acted as a server
13602  * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
13603  * when set up and the client passed credentials as part of the
13604  * authentication process.
13605  *
13606  * In a message bus setup, the message bus is always the server and
13607  * each application is a client. So this method will always return
13608  * %NULL for message bus clients.
13609  *
13610  * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
13611  * Since: 2.26
13612  */
13613
13614
13615 /**
13616  * g_dbus_connection_get_stream:
13617  * @connection: a #GDBusConnection
13618  *
13619  * Gets the underlying stream used for IO.
13620  *
13621  * While the #GDBusConnection is active, it will interact with this
13622  * stream from a worker thread, so it is not safe to interact with
13623  * the stream directly.
13624  *
13625  * Returns: (transfer none): the stream used for IO
13626  * Since: 2.26
13627  */
13628
13629
13630 /**
13631  * g_dbus_connection_get_unique_name:
13632  * @connection: A #GDBusConnection.
13633  *
13634  * Gets the unique name of @connection as assigned by the message
13635  * bus. This can also be used to figure out if @connection is a
13636  * message bus connection.
13637  *
13638  * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
13639  * Since: 2.26
13640  */
13641
13642
13643 /**
13644  * g_dbus_connection_is_closed:
13645  * @connection: A #GDBusConnection.
13646  *
13647  * Gets whether @connection is closed.
13648  *
13649  * Returns: %TRUE if the connection is closed, %FALSE otherwise.
13650  * Since: 2.26
13651  */
13652
13653
13654 /**
13655  * g_dbus_connection_new:
13656  * @stream: A #GIOStream.
13657  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13658  * @flags: Flags describing how to make the connection.
13659  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13660  * @cancellable: (allow-none): A #GCancellable or %NULL.
13661  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13662  * @user_data: The data to pass to @callback.
13663  *
13664  * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
13665  * with the end represented by @stream.
13666  *
13667  * If @stream is a #GSocketConnection, then the corresponding #GSocket
13668  * will be put into non-blocking mode.
13669  *
13670  * The D-Bus connection will interact with @stream from a worker thread.
13671  * As a result, the caller should not interact with @stream after this
13672  * method has been called, except by calling g_object_unref() on it.
13673  *
13674  * If @observer is not %NULL it may be used to control the
13675  * authentication process.
13676  *
13677  * When the operation is finished, @callback will be invoked. You can
13678  * then call g_dbus_connection_new_finish() to get the result of the
13679  * operation.
13680  *
13681  * This is a asynchronous failable constructor. See
13682  * g_dbus_connection_new_sync() for the synchronous
13683  * version.
13684  *
13685  * Since: 2.26
13686  */
13687
13688
13689 /**
13690  * g_dbus_connection_new_finish:
13691  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13692  * @error: Return location for error or %NULL.
13693  *
13694  * Finishes an operation started with g_dbus_connection_new().
13695  *
13696  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13697  * Since: 2.26
13698  */
13699
13700
13701 /**
13702  * g_dbus_connection_new_for_address:
13703  * @address: A D-Bus address.
13704  * @flags: Flags describing how to make the connection.
13705  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13706  * @cancellable: (allow-none): A #GCancellable or %NULL.
13707  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13708  * @user_data: The data to pass to @callback.
13709  *
13710  * Asynchronously connects and sets up a D-Bus client connection for
13711  * exchanging D-Bus messages with an endpoint specified by @address
13712  * which must be in the D-Bus address format.
13713  *
13714  * This constructor can only be used to initiate client-side
13715  * connections - use g_dbus_connection_new() if you need to act as the
13716  * server. In particular, @flags cannot contain the
13717  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13718  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13719  *
13720  * When the operation is finished, @callback will be invoked. You can
13721  * then call g_dbus_connection_new_finish() to get the result of the
13722  * operation.
13723  *
13724  * If @observer is not %NULL it may be used to control the
13725  * authentication process.
13726  *
13727  * This is a asynchronous failable constructor. See
13728  * g_dbus_connection_new_for_address_sync() for the synchronous
13729  * version.
13730  *
13731  * Since: 2.26
13732  */
13733
13734
13735 /**
13736  * g_dbus_connection_new_for_address_finish:
13737  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13738  * @error: Return location for error or %NULL.
13739  *
13740  * Finishes an operation started with g_dbus_connection_new_for_address().
13741  *
13742  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13743  * Since: 2.26
13744  */
13745
13746
13747 /**
13748  * g_dbus_connection_new_for_address_sync:
13749  * @address: A D-Bus address.
13750  * @flags: Flags describing how to make the connection.
13751  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13752  * @cancellable: (allow-none): A #GCancellable or %NULL.
13753  * @error: Return location for error or %NULL.
13754  *
13755  * Synchronously connects and sets up a D-Bus client connection for
13756  * exchanging D-Bus messages with an endpoint specified by @address
13757  * which must be in the D-Bus address format.
13758  *
13759  * This constructor can only be used to initiate client-side
13760  * connections - use g_dbus_connection_new_sync() if you need to act
13761  * as the server. In particular, @flags cannot contain the
13762  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13763  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13764  *
13765  * This is a synchronous failable constructor. See
13766  * g_dbus_connection_new_for_address() for the asynchronous version.
13767  *
13768  * If @observer is not %NULL it may be used to control the
13769  * authentication process.
13770  *
13771  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13772  * Since: 2.26
13773  */
13774
13775
13776 /**
13777  * g_dbus_connection_new_sync:
13778  * @stream: A #GIOStream.
13779  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13780  * @flags: Flags describing how to make the connection.
13781  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13782  * @cancellable: (allow-none): A #GCancellable or %NULL.
13783  * @error: Return location for error or %NULL.
13784  *
13785  * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13786  * with the end represented by @stream.
13787  *
13788  * If @stream is a #GSocketConnection, then the corresponding #GSocket
13789  * will be put into non-blocking mode.
13790  *
13791  * The D-Bus connection will interact with @stream from a worker thread.
13792  * As a result, the caller should not interact with @stream after this
13793  * method has been called, except by calling g_object_unref() on it.
13794  *
13795  * If @observer is not %NULL it may be used to control the
13796  * authentication process.
13797  *
13798  * This is a synchronous failable constructor. See
13799  * g_dbus_connection_new() for the asynchronous version.
13800  *
13801  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13802  * Since: 2.26
13803  */
13804
13805
13806 /**
13807  * g_dbus_connection_register_object:
13808  * @connection: A #GDBusConnection.
13809  * @object_path: The object path to register at.
13810  * @interface_info: Introspection data for the interface.
13811  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13812  * @user_data: (allow-none): Data to pass to functions in @vtable.
13813  * @user_data_free_func: Function to call when the object path is unregistered.
13814  * @error: Return location for error or %NULL.
13815  *
13816  * Registers callbacks for exported objects at @object_path with the
13817  * D-Bus interface that is described in @interface_info.
13818  *
13819  * Calls to functions in @vtable (and @user_data_free_func) will
13820  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13821  * loop</link> of the thread you are calling this method from.
13822  *
13823  * Note that all #GVariant values passed to functions in @vtable will match
13824  * the signature given in @interface_info - if a remote caller passes
13825  * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13826  * is returned to the remote caller.
13827  *
13828  * Additionally, if the remote caller attempts to invoke methods or
13829  * access properties not mentioned in @interface_info the
13830  * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13831  * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13832  * are returned to the caller.
13833  *
13834  * It is considered a programming error if the
13835  * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13836  * #GVariant of incorrect type.
13837  *
13838  * If an existing callback is already registered at @object_path and
13839  * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13840  *
13841  * GDBus automatically implements the standard D-Bus interfaces
13842  * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13843  * and org.freedesktop.Peer, so you don't have to implement those for
13844  * the objects you export. You <emphasis>can</emphasis> implement
13845  * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13846  * and setting of properties asynchronously.
13847  *
13848  * Note that the reference count on @interface_info will be
13849  * incremented by 1 (unless allocated statically, e.g. if the
13850  * reference count is -1, see g_dbus_interface_info_ref()) for as long
13851  * as the object is exported. Also note that @vtable will be copied.
13852  *
13853  * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13854  *
13855  * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13856  * Since: 2.26
13857  */
13858
13859
13860 /**
13861  * g_dbus_connection_register_subtree:
13862  * @connection: A #GDBusConnection.
13863  * @object_path: The object path to register the subtree at.
13864  * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13865  * @flags: Flags used to fine tune the behavior of the subtree.
13866  * @user_data: Data to pass to functions in @vtable.
13867  * @user_data_free_func: Function to call when the subtree is unregistered.
13868  * @error: Return location for error or %NULL.
13869  *
13870  * Registers a whole subtree of <quote>dynamic</quote> objects.
13871  *
13872  * The @enumerate and @introspection functions in @vtable are used to
13873  * convey, to remote callers, what nodes exist in the subtree rooted
13874  * by @object_path.
13875  *
13876  * When handling remote calls into any node in the subtree, first the
13877  * @enumerate function is used to check if the node exists. If the node exists
13878  * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13879  * the @introspection function is used to check if the node supports the
13880  * requested method. If so, the @dispatch function is used to determine
13881  * where to dispatch the call. The collected #GDBusInterfaceVTable and
13882  * #gpointer will be used to call into the interface vtable for processing
13883  * the request.
13884  *
13885  * All calls into user-provided code will be invoked in the <link
13886  * linkend="g-main-context-push-thread-default">thread-default main
13887  * loop</link> of the thread you are calling this method from.
13888  *
13889  * If an existing subtree is already registered at @object_path or
13890  * then @error is set to #G_IO_ERROR_EXISTS.
13891  *
13892  * Note that it is valid to register regular objects (using
13893  * g_dbus_connection_register_object()) in a subtree registered with
13894  * g_dbus_connection_register_subtree() - if so, the subtree handler
13895  * is tried as the last resort. One way to think about a subtree
13896  * handler is to consider it a <quote>fallback handler</quote>
13897  * for object paths not registered via g_dbus_connection_register_object()
13898  * or other bindings.
13899  *
13900  * Note that @vtable will be copied so you cannot change it after
13901  * registration.
13902  *
13903  * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13904  *
13905  * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13906  * Since: 2.26
13907  */
13908
13909
13910 /**
13911  * g_dbus_connection_remove_filter:
13912  * @connection: a #GDBusConnection
13913  * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13914  *
13915  * Removes a filter.
13916  *
13917  * Since: 2.26
13918  */
13919
13920
13921 /**
13922  * g_dbus_connection_send_message:
13923  * @connection: A #GDBusConnection.
13924  * @message: A #GDBusMessage
13925  * @flags: Flags affecting how the message is sent.
13926  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13927  * @error: Return location for error or %NULL.
13928  *
13929  * Asynchronously sends @message to the peer represented by @connection.
13930  *
13931  * Unless @flags contain the
13932  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13933  * will be assigned by @connection and set on @message via
13934  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13935  * serial number used will be written to this location prior to
13936  * submitting the message to the underlying transport.
13937  *
13938  * If @connection is closed then the operation will fail with
13939  * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13940  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13941  *
13942  * See <xref linkend="gdbus-server"/> and <xref
13943  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13944  * low-level API to send and receive UNIX file descriptors.
13945  *
13946  * Note that @message must be unlocked, unless @flags contain the
13947  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13948  *
13949  * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13950  * Since: 2.26
13951  */
13952
13953
13954 /**
13955  * g_dbus_connection_send_message_with_reply:
13956  * @connection: A #GDBusConnection.
13957  * @message: A #GDBusMessage.
13958  * @flags: Flags affecting how the message is sent.
13959  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13960  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13961  * @cancellable: (allow-none): A #GCancellable or %NULL.
13962  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13963  * @user_data: The data to pass to @callback.
13964  *
13965  * Asynchronously sends @message to the peer represented by @connection.
13966  *
13967  * Unless @flags contain the
13968  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13969  * will be assigned by @connection and set on @message via
13970  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13971  * serial number used will be written to this location prior to
13972  * submitting the message to the underlying transport.
13973  *
13974  * If @connection is closed then the operation will fail with
13975  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13976  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13977  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13978  *
13979  * This is an asynchronous method. When the operation is finished, @callback will be invoked
13980  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13981  * of the thread you are calling this method from. You can then call
13982  * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13983  * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13984  *
13985  * Note that @message must be unlocked, unless @flags contain the
13986  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13987  *
13988  * See <xref linkend="gdbus-server"/> and <xref
13989  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13990  * low-level API to send and receive UNIX file descriptors.
13991  *
13992  * Since: 2.26
13993  */
13994
13995
13996 /**
13997  * g_dbus_connection_send_message_with_reply_finish:
13998  * @connection: a #GDBusConnection
13999  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
14000  * @error: Return location for error or %NULL.
14001  *
14002  * Finishes an operation started with g_dbus_connection_send_message_with_reply().
14003  *
14004  * Note that @error is only set if a local in-process error
14005  * occurred. That is to say that the returned #GDBusMessage object may
14006  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
14007  * g_dbus_message_to_gerror() to transcode this to a #GError.
14008  *
14009  * See <xref linkend="gdbus-server"/> and <xref
14010  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14011  * low-level API to send and receive UNIX file descriptors.
14012  *
14013  * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
14014  * Since: 2.26
14015  */
14016
14017
14018 /**
14019  * g_dbus_connection_send_message_with_reply_sync:
14020  * @connection: A #GDBusConnection.
14021  * @message: A #GDBusMessage.
14022  * @flags: Flags affecting how the message is sent.
14023  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
14024  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
14025  * @cancellable: (allow-none): A #GCancellable or %NULL.
14026  * @error: Return location for error or %NULL.
14027  *
14028  * Synchronously sends @message to the peer represented by @connection
14029  * and blocks the calling thread until a reply is received or the
14030  * timeout is reached. See g_dbus_connection_send_message_with_reply()
14031  * for the asynchronous version of this method.
14032  *
14033  * Unless @flags contain the
14034  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
14035  * will be assigned by @connection and set on @message via
14036  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
14037  * serial number used will be written to this location prior to
14038  * submitting the message to the underlying transport.
14039  *
14040  * If @connection is closed then the operation will fail with
14041  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
14042  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
14043  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
14044  *
14045  * Note that @error is only set if a local in-process error
14046  * occurred. That is to say that the returned #GDBusMessage object may
14047  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
14048  * g_dbus_message_to_gerror() to transcode this to a #GError.
14049  *
14050  * See <xref linkend="gdbus-server"/> and <xref
14051  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14052  * low-level API to send and receive UNIX file descriptors.
14053  *
14054  * Note that @message must be unlocked, unless @flags contain the
14055  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
14056  *
14057  * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
14058  * Since: 2.26
14059  */
14060
14061
14062 /**
14063  * g_dbus_connection_set_exit_on_close:
14064  * @connection: A #GDBusConnection.
14065  * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
14066  *
14067  * Sets whether the process should be terminated when @connection is
14068  * closed by the remote peer. See #GDBusConnection:exit-on-close for
14069  * more details.
14070  *
14071  * Note that this function should be used with care. Most modern UNIX
14072  * desktops tie the notion of a user session the session bus, and expect
14073  * all of a users applications to quit when their bus connection goes away.
14074  * If you are setting @exit_on_close to %FALSE for the shared session
14075  * bus connection, you should make sure that your application exits
14076  * when the user session ends.
14077  *
14078  * Since: 2.26
14079  */
14080
14081
14082 /**
14083  * g_dbus_connection_signal_subscribe:
14084  * @connection: A #GDBusConnection.
14085  * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
14086  * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
14087  * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
14088  * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
14089  * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
14090  * @flags: Flags describing how to subscribe to the signal (currently unused).
14091  * @callback: Callback to invoke when there is a signal matching the requested data.
14092  * @user_data: User data to pass to @callback.
14093  * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
14094  *
14095  * Subscribes to signals on @connection and invokes @callback with a
14096  * whenever the signal is received. Note that @callback
14097  * will be invoked in the <link
14098  * linkend="g-main-context-push-thread-default">thread-default main
14099  * loop</link> of the thread you are calling this method from.
14100  *
14101  * If @connection is not a message bus connection, @sender must be
14102  * %NULL.
14103  *
14104  * If @sender is a well-known name note that @callback is invoked with
14105  * the unique name for the owner of @sender, not the well-known name
14106  * as one would expect. This is because the message bus rewrites the
14107  * name. As such, to avoid certain race conditions, users should be
14108  * tracking the name owner of the well-known name and use that when
14109  * processing the received signal.
14110  *
14111  * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
14112  * Since: 2.26
14113  */
14114
14115
14116 /**
14117  * g_dbus_connection_signal_unsubscribe:
14118  * @connection: A #GDBusConnection.
14119  * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
14120  *
14121  * Unsubscribes from signals.
14122  *
14123  * Since: 2.26
14124  */
14125
14126
14127 /**
14128  * g_dbus_connection_start_message_processing:
14129  * @connection: A #GDBusConnection.
14130  *
14131  * If @connection was created with
14132  * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
14133  * starts processing messages. Does nothing on if @connection wasn't
14134  * created with this flag or if the method has already been called.
14135  *
14136  * Since: 2.26
14137  */
14138
14139
14140 /**
14141  * g_dbus_connection_unexport_action_group:
14142  * @connection: a #GDBusConnection
14143  * @export_id: the ID from g_dbus_connection_export_action_group()
14144  *
14145  * Reverses the effect of a previous call to
14146  * g_dbus_connection_export_action_group().
14147  *
14148  * It is an error to call this function with an ID that wasn't returned
14149  * from g_dbus_connection_export_action_group() or to call it with the
14150  * same ID more than once.
14151  *
14152  * Since: 2.32
14153  */
14154
14155
14156 /**
14157  * g_dbus_connection_unexport_menu_model:
14158  * @connection: a #GDBusConnection
14159  * @export_id: the ID from g_dbus_connection_export_menu_model()
14160  *
14161  * Reverses the effect of a previous call to
14162  * g_dbus_connection_export_menu_model().
14163  *
14164  * It is an error to call this function with an ID that wasn't returned
14165  * from g_dbus_connection_export_menu_model() or to call it with the
14166  * same ID more than once.
14167  *
14168  * Since: 2.32
14169  */
14170
14171
14172 /**
14173  * g_dbus_connection_unregister_object:
14174  * @connection: A #GDBusConnection.
14175  * @registration_id: A registration id obtained from g_dbus_connection_register_object().
14176  *
14177  * Unregisters an object.
14178  *
14179  * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
14180  * Since: 2.26
14181  */
14182
14183
14184 /**
14185  * g_dbus_connection_unregister_subtree:
14186  * @connection: A #GDBusConnection.
14187  * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
14188  *
14189  * Unregisters a subtree.
14190  *
14191  * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
14192  * Since: 2.26
14193  */
14194
14195
14196 /**
14197  * g_dbus_error_encode_gerror:
14198  * @error: A #GError.
14199  *
14200  * Creates a D-Bus error name to use for @error. If @error matches
14201  * a registered error (cf. g_dbus_error_register_error()), the corresponding
14202  * D-Bus error name will be returned.
14203  *
14204  * Otherwise the a name of the form
14205  * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
14206  * will be used. This allows other GDBus applications to map the error
14207  * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
14208  *
14209  * This function is typically only used in object mappings to put a
14210  * #GError on the wire. Regular applications should not use it.
14211  *
14212  * Returns: A D-Bus error name (never %NULL). Free with g_free().
14213  * Since: 2.26
14214  */
14215
14216
14217 /**
14218  * g_dbus_error_get_remote_error:
14219  * @error: A #GError.
14220  *
14221  * Gets the D-Bus error name used for @error, if any.
14222  *
14223  * This function is guaranteed to return a D-Bus error name for all
14224  * #GError<!-- -->s returned from functions handling remote method
14225  * calls (e.g. g_dbus_connection_call_finish()) unless
14226  * g_dbus_error_strip_remote_error() has been used on @error.
14227  *
14228  * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
14229  * Since: 2.26
14230  */
14231
14232
14233 /**
14234  * g_dbus_error_is_remote_error:
14235  * @error: A #GError.
14236  *
14237  * Checks if @error represents an error received via D-Bus from a remote peer. If so,
14238  * use g_dbus_error_get_remote_error() to get the name of the error.
14239  *
14240  * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
14241  * Since: 2.26
14242  */
14243
14244
14245 /**
14246  * g_dbus_error_new_for_dbus_error:
14247  * @dbus_error_name: D-Bus error name.
14248  * @dbus_error_message: D-Bus error message.
14249  *
14250  * Creates a #GError based on the contents of @dbus_error_name and
14251  * @dbus_error_message.
14252  *
14253  * Errors registered with g_dbus_error_register_error() will be looked
14254  * up using @dbus_error_name and if a match is found, the error domain
14255  * and code is used. Applications can use g_dbus_error_get_remote_error()
14256  * to recover @dbus_error_name.
14257  *
14258  * If a match against a registered error is not found and the D-Bus
14259  * error name is in a form as returned by g_dbus_error_encode_gerror()
14260  * the error domain and code encoded in the name is used to
14261  * create the #GError. Also, @dbus_error_name is added to the error message
14262  * such that it can be recovered with g_dbus_error_get_remote_error().
14263  *
14264  * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
14265  * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
14266  * added to the error message such that it can be recovered with
14267  * g_dbus_error_get_remote_error().
14268  *
14269  * In all three cases, @dbus_error_name can always be recovered from the
14270  * returned #GError using the g_dbus_error_get_remote_error() function
14271  * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
14272  *
14273  * This function is typically only used in object mappings to prepare
14274  * #GError instances for applications. Regular applications should not use
14275  * it.
14276  *
14277  * Returns: An allocated #GError. Free with g_error_free().
14278  * Since: 2.26
14279  */
14280
14281
14282 /**
14283  * g_dbus_error_register_error:
14284  * @error_domain: A #GQuark for a error domain.
14285  * @error_code: An error code.
14286  * @dbus_error_name: A D-Bus error name.
14287  *
14288  * Creates an association to map between @dbus_error_name and
14289  * #GError<!-- -->s specified by @error_domain and @error_code.
14290  *
14291  * This is typically done in the routine that returns the #GQuark for
14292  * an error domain.
14293  *
14294  * Returns: %TRUE if the association was created, %FALSE if it already exists.
14295  * Since: 2.26
14296  */
14297
14298
14299 /**
14300  * g_dbus_error_register_error_domain:
14301  * @error_domain_quark_name: The error domain name.
14302  * @quark_volatile: A pointer where to store the #GQuark.
14303  * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
14304  * @num_entries: Number of items to register.
14305  *
14306  * Helper function for associating a #GError error domain with D-Bus error names.
14307  *
14308  * Since: 2.26
14309  */
14310
14311
14312 /**
14313  * g_dbus_error_set_dbus_error:
14314  * @error: A pointer to a #GError or %NULL.
14315  * @dbus_error_name: D-Bus error name.
14316  * @dbus_error_message: D-Bus error message.
14317  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
14318  * @...: Arguments for @format.
14319  *
14320  * Does nothing if @error is %NULL. Otherwise sets *@error to
14321  * a new #GError created with g_dbus_error_new_for_dbus_error()
14322  * with @dbus_error_message prepend with @format (unless %NULL).
14323  *
14324  * Since: 2.26
14325  */
14326
14327
14328 /**
14329  * g_dbus_error_set_dbus_error_valist:
14330  * @error: A pointer to a #GError or %NULL.
14331  * @dbus_error_name: D-Bus error name.
14332  * @dbus_error_message: D-Bus error message.
14333  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
14334  * @var_args: Arguments for @format.
14335  *
14336  * Like g_dbus_error_set_dbus_error() but intended for language bindings.
14337  *
14338  * Since: 2.26
14339  */
14340
14341
14342 /**
14343  * g_dbus_error_strip_remote_error:
14344  * @error: A #GError.
14345  *
14346  * Looks for extra information in the error message used to recover
14347  * the D-Bus error name and strips it if found. If stripped, the
14348  * message field in @error will correspond exactly to what was
14349  * received on the wire.
14350  *
14351  * This is typically used when presenting errors to the end user.
14352  *
14353  * Returns: %TRUE if information was stripped, %FALSE otherwise.
14354  * Since: 2.26
14355  */
14356
14357
14358 /**
14359  * g_dbus_error_unregister_error:
14360  * @error_domain: A #GQuark for a error domain.
14361  * @error_code: An error code.
14362  * @dbus_error_name: A D-Bus error name.
14363  *
14364  * Destroys an association previously set up with g_dbus_error_register_error().
14365  *
14366  * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
14367  * Since: 2.26
14368  */
14369
14370
14371 /**
14372  * g_dbus_generate_guid:
14373  *
14374  * Generate a D-Bus GUID that can be used with
14375  * e.g. g_dbus_connection_new().
14376  *
14377  * See the D-Bus specification regarding what strings are valid D-Bus
14378  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14379  *
14380  * Returns: A valid D-Bus GUID. Free with g_free().
14381  * Since: 2.26
14382  */
14383
14384
14385 /**
14386  * g_dbus_gvalue_to_gvariant:
14387  * @gvalue: A #GValue to convert to a #GVariant.
14388  * @type: A #GVariantType.
14389  *
14390  * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
14391  *
14392  * The conversion is using the following rules:
14393  * <table frame='all'>
14394  *   <title>#GValue / #GVariant conversion rules</title>
14395  *   <tgroup cols='2' align='left' colsep='1' rowsep='1'>
14396  *     <thead>
14397  *       <row>
14398  *         <entry>If the #GType for @gvalue is...</entry>
14399  *         <entry>... then @type must be</entry>
14400  *       </row>
14401  *     </thead>
14402  *     <tbody>
14403  *       <row>
14404  *         <entry>#G_TYPE_STRING</entry>
14405  *         <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>
14406  *       </row>
14407  *       <row>
14408  *         <entry>#G_TYPE_STRV</entry>
14409  *         <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>
14410  *       </row>
14411  *       <row>
14412  *         <entry>#G_TYPE_BOOLEAN</entry>
14413  *         <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
14414  *       </row>
14415  *       <row>
14416  *         <entry>#G_TYPE_UCHAR</entry>
14417  *         <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
14418  *       </row>
14419  *       <row>
14420  *         <entry>#G_TYPE_INT</entry>
14421  *         <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
14422  *       </row>
14423  *       <row>
14424  *         <entry>#G_TYPE_UINT</entry>
14425  *         <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
14426  *       </row>
14427  *       <row>
14428  *         <entry>#G_TYPE_INT64</entry>
14429  *         <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
14430  *       </row>
14431  *       <row>
14432  *         <entry>#G_TYPE_UINT64</entry>
14433  *         <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
14434  *       </row>
14435  *       <row>
14436  *         <entry>#G_TYPE_DOUBLE</entry>
14437  *         <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
14438  *       </row>
14439  *       <row>
14440  *         <entry>#G_TYPE_VARIANT</entry>
14441  *         <entry>Any #GVariantType</entry>
14442  *       </row>
14443  *     </tbody>
14444  *   </tgroup>
14445  * </table>
14446  * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
14447  * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
14448  * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
14449  * #G_TYPE_BOXED derived-types) not in the table above.
14450  *
14451  * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
14452  * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
14453  * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
14454  * string for string types, <literal>'/'</literal> for object path
14455  * types, the empty array for any array type and so on).
14456  *
14457  * See the g_dbus_gvariant_to_gvalue() function for how to convert a
14458  * #GVariant to a #GValue.
14459  *
14460  * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
14461  * Since: 2.30
14462  */
14463
14464
14465 /**
14466  * g_dbus_gvariant_to_gvalue:
14467  * @value: A #GVariant.
14468  * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
14469  *
14470  * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
14471  *
14472  * The rules specified in the g_dbus_gvalue_to_gvariant() function are
14473  * used - this function is essentially its reverse form.
14474  *
14475  * The conversion never fails - a valid #GValue is always returned in
14476  * @out_gvalue.
14477  *
14478  * Since: 2.30
14479  */
14480
14481
14482 /**
14483  * g_dbus_interface_dup_object:
14484  * @interface_: An exported D-Bus interface.
14485  *
14486  * Gets the #GDBusObject that @interface_ belongs to, if any.
14487  *
14488  * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
14489  * Since: 2.32
14490  * Rename to: g_dbus_interface_get_object
14491  */
14492
14493
14494 /**
14495  * g_dbus_interface_get_info:
14496  * @interface_: An exported D-Bus interface.
14497  *
14498  * Gets D-Bus introspection information for the D-Bus interface
14499  * implemented by @interface_.
14500  *
14501  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
14502  * Since: 2.30
14503  */
14504
14505
14506 /**
14507  * g_dbus_interface_get_object: (skip)
14508  * @interface_: An exported D-Bus interface.
14509  *
14510  * Gets the #GDBusObject that @interface_ belongs to, if any.
14511  *
14512  * <warning>It is not safe to use the returned object if @interface_
14513  * or the returned object is being used from other threads. See
14514  * g_dbus_interface_dup_object() for a thread-safe
14515  * alternative.</warning>
14516  *
14517  * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
14518  * Since: 2.30
14519  */
14520
14521
14522 /**
14523  * g_dbus_interface_info_cache_build:
14524  * @info: A #GDBusInterfaceInfo.
14525  *
14526  * Builds a lookup-cache to speed up
14527  * g_dbus_interface_info_lookup_method(),
14528  * g_dbus_interface_info_lookup_signal() and
14529  * g_dbus_interface_info_lookup_property().
14530  *
14531  * If this has already been called with @info, the existing cache is
14532  * used and its use count is increased.
14533  *
14534  * Note that @info cannot be modified until
14535  * g_dbus_interface_info_cache_release() is called.
14536  *
14537  * Since: 2.30
14538  */
14539
14540
14541 /**
14542  * g_dbus_interface_info_cache_release:
14543  * @info: A GDBusInterfaceInfo
14544  *
14545  * Decrements the usage count for the cache for @info built by
14546  * g_dbus_interface_info_cache_build() (if any) and frees the
14547  * resources used by the cache if the usage count drops to zero.
14548  *
14549  * Since: 2.30
14550  */
14551
14552
14553 /**
14554  * g_dbus_interface_info_generate_xml:
14555  * @info: A #GDBusNodeInfo
14556  * @indent: Indentation level.
14557  * @string_builder: (out): A #GString to to append XML data to.
14558  *
14559  * Appends an XML representation of @info (and its children) to @string_builder.
14560  *
14561  * This function is typically used for generating introspection XML
14562  * documents at run-time for handling the
14563  * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
14564  * method.
14565  *
14566  * Since: 2.26
14567  */
14568
14569
14570 /**
14571  * g_dbus_interface_info_lookup_method:
14572  * @info: A #GDBusInterfaceInfo.
14573  * @name: A D-Bus method name (typically in CamelCase)
14574  *
14575  * Looks up information about a method.
14576  *
14577  * The cost of this function is O(n) in number of methods unless
14578  * g_dbus_interface_info_cache_build() has been used on @info.
14579  *
14580  * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
14581  * Since: 2.26
14582  */
14583
14584
14585 /**
14586  * g_dbus_interface_info_lookup_property:
14587  * @info: A #GDBusInterfaceInfo.
14588  * @name: A D-Bus property name (typically in CamelCase).
14589  *
14590  * Looks up information about a property.
14591  *
14592  * The cost of this function is O(n) in number of properties unless
14593  * g_dbus_interface_info_cache_build() has been used on @info.
14594  *
14595  * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
14596  * Since: 2.26
14597  */
14598
14599
14600 /**
14601  * g_dbus_interface_info_lookup_signal:
14602  * @info: A #GDBusInterfaceInfo.
14603  * @name: A D-Bus signal name (typically in CamelCase)
14604  *
14605  * Looks up information about a signal.
14606  *
14607  * The cost of this function is O(n) in number of signals unless
14608  * g_dbus_interface_info_cache_build() has been used on @info.
14609  *
14610  * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
14611  * Since: 2.26
14612  */
14613
14614
14615 /**
14616  * g_dbus_interface_info_ref:
14617  * @info: A #GDBusInterfaceInfo
14618  *
14619  * If @info is statically allocated does nothing. Otherwise increases
14620  * the reference count.
14621  *
14622  * Returns: The same @info.
14623  * Since: 2.26
14624  */
14625
14626
14627 /**
14628  * g_dbus_interface_info_unref:
14629  * @info: A #GDBusInterfaceInfo.
14630  *
14631  * If @info is statically allocated, does nothing. Otherwise decreases
14632  * the reference count of @info. When its reference count drops to 0,
14633  * the memory used is freed.
14634  *
14635  * Since: 2.26
14636  */
14637
14638
14639 /**
14640  * g_dbus_interface_set_object:
14641  * @interface_: An exported D-Bus interface.
14642  * @object: (allow-none): A #GDBusObject or %NULL.
14643  *
14644  * Sets the #GDBusObject for @interface_ to @object.
14645  *
14646  * Note that @interface_ will hold a weak reference to @object.
14647  *
14648  * Since: 2.30
14649  */
14650
14651
14652 /**
14653  * g_dbus_interface_skeleton_export:
14654  * @interface_: The D-Bus interface to export.
14655  * @connection: A #GDBusConnection to export @interface_ on.
14656  * @object_path: The path to export the interface at.
14657  * @error: Return location for error or %NULL.
14658  *
14659  * Exports @interface_ at @object_path on @connection.
14660  *
14661  * This can be called multiple times to export the same @interface_
14662  * onto multiple connections however the @object_path provided must be
14663  * the same for all connections.
14664  *
14665  * Use g_dbus_interface_skeleton_unexport() to unexport the object.
14666  *
14667  * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14668  * Since: 2.30
14669  */
14670
14671
14672 /**
14673  * g_dbus_interface_skeleton_flush:
14674  * @interface_: A #GDBusInterfaceSkeleton.
14675  *
14676  * If @interface_ has outstanding changes, request for these changes to be
14677  * emitted immediately.
14678  *
14679  * For example, an exported D-Bus interface may queue up property
14680  * changes and emit the
14681  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14682  * signal later (e.g. in an idle handler). This technique is useful
14683  * for collapsing multiple property changes into one.
14684  *
14685  * Since: 2.30
14686  */
14687
14688
14689 /**
14690  * g_dbus_interface_skeleton_get_connection:
14691  * @interface_: A #GDBusInterfaceSkeleton.
14692  *
14693  * Gets the first connection that @interface_ is exported on, if any.
14694  *
14695  * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14696  * Since: 2.30
14697  */
14698
14699
14700 /**
14701  * g_dbus_interface_skeleton_get_connections:
14702  * @interface_: A #GDBusInterfaceSkeleton.
14703  *
14704  * Gets a list of the connections that @interface_ is exported on.
14705  *
14706  * 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().
14707  * Since: 2.32
14708  */
14709
14710
14711 /**
14712  * g_dbus_interface_skeleton_get_flags:
14713  * @interface_: A #GDBusInterfaceSkeleton.
14714  *
14715  * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14716  * of @interface_
14717  *
14718  * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14719  * Since: 2.30
14720  */
14721
14722
14723 /**
14724  * g_dbus_interface_skeleton_get_info:
14725  * @interface_: A #GDBusInterfaceSkeleton.
14726  *
14727  * Gets D-Bus introspection information for the D-Bus interface
14728  * implemented by @interface_.
14729  *
14730  * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14731  * Since: 2.30
14732  */
14733
14734
14735 /**
14736  * g_dbus_interface_skeleton_get_object_path:
14737  * @interface_: A #GDBusInterfaceSkeleton.
14738  *
14739  * Gets the object path that @interface_ is exported on, if any.
14740  *
14741  * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14742  * Since: 2.30
14743  */
14744
14745
14746 /**
14747  * g_dbus_interface_skeleton_get_properties:
14748  * @interface_: A #GDBusInterfaceSkeleton.
14749  *
14750  * Gets all D-Bus properties for @interface_.
14751  *
14752  * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14753  * Since: 2.30
14754  */
14755
14756
14757 /**
14758  * g_dbus_interface_skeleton_get_vtable: (skip)
14759  * @interface_: A #GDBusInterfaceSkeleton.
14760  *
14761  * Gets the interface vtable for the D-Bus interface implemented by
14762  * @interface_. The returned function pointers should expect @interface_
14763  * itself to be passed as @user_data.
14764  *
14765  * Returns: A #GDBusInterfaceVTable (never %NULL).
14766  * Since: 2.30
14767  */
14768
14769
14770 /**
14771  * g_dbus_interface_skeleton_has_connection:
14772  * @interface_: A #GDBusInterfaceSkeleton.
14773  * @connection: A #GDBusConnection.
14774  *
14775  * Checks if @interface_ is exported on @connection.
14776  *
14777  * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14778  * Since: 2.32
14779  */
14780
14781
14782 /**
14783  * g_dbus_interface_skeleton_set_flags:
14784  * @interface_: A #GDBusInterfaceSkeleton.
14785  * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14786  *
14787  * Sets flags describing what the behavior of @skeleton should be.
14788  *
14789  * Since: 2.30
14790  */
14791
14792
14793 /**
14794  * g_dbus_interface_skeleton_unexport:
14795  * @interface_: A #GDBusInterfaceSkeleton.
14796  *
14797  * Stops exporting @interface_ on all connections it is exported on.
14798  *
14799  * To unexport @interface_ from only a single connection, use
14800  * g_dbus_interface_skeleton_unexport_from_connection()
14801  *
14802  * Since: 2.30
14803  */
14804
14805
14806 /**
14807  * g_dbus_interface_skeleton_unexport_from_connection:
14808  * @interface_: A #GDBusInterfaceSkeleton.
14809  * @connection: A #GDBusConnection.
14810  *
14811  * Stops exporting @interface_ on @connection.
14812  *
14813  * To stop exporting on all connections the interface is exported on,
14814  * use g_dbus_interface_skeleton_unexport().
14815  *
14816  * Since: 2.32
14817  */
14818
14819
14820 /**
14821  * g_dbus_is_address:
14822  * @string: A string.
14823  *
14824  * Checks if @string is a D-Bus address.
14825  *
14826  * This doesn't check if @string is actually supported by #GDBusServer
14827  * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14828  * checks.
14829  *
14830  * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14831  * Since: 2.26
14832  */
14833
14834
14835 /**
14836  * g_dbus_is_guid:
14837  * @string: The string to check.
14838  *
14839  * Checks if @string is a D-Bus GUID.
14840  *
14841  * See the D-Bus specification regarding what strings are valid D-Bus
14842  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14843  *
14844  * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14845  * Since: 2.26
14846  */
14847
14848
14849 /**
14850  * g_dbus_is_interface_name:
14851  * @string: The string to check.
14852  *
14853  * Checks if @string is a valid D-Bus interface name.
14854  *
14855  * Returns: %TRUE if valid, %FALSE otherwise.
14856  * Since: 2.26
14857  */
14858
14859
14860 /**
14861  * g_dbus_is_member_name:
14862  * @string: The string to check.
14863  *
14864  * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14865  *
14866  * Returns: %TRUE if valid, %FALSE otherwise.
14867  * Since: 2.26
14868  */
14869
14870
14871 /**
14872  * g_dbus_is_name:
14873  * @string: The string to check.
14874  *
14875  * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14876  *
14877  * Returns: %TRUE if valid, %FALSE otherwise.
14878  * Since: 2.26
14879  */
14880
14881
14882 /**
14883  * g_dbus_is_supported_address:
14884  * @string: A string.
14885  * @error: Return location for error or %NULL.
14886  *
14887  * Like g_dbus_is_address() but also checks if the library suppors the
14888  * transports in @string and that key/value pairs for each transport
14889  * are valid.
14890  *
14891  * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14892  * Since: 2.26
14893  */
14894
14895
14896 /**
14897  * g_dbus_is_unique_name:
14898  * @string: The string to check.
14899  *
14900  * Checks if @string is a valid D-Bus unique bus name.
14901  *
14902  * Returns: %TRUE if valid, %FALSE otherwise.
14903  * Since: 2.26
14904  */
14905
14906
14907 /**
14908  * g_dbus_menu_model_get:
14909  * @connection: a #GDBusConnection
14910  * @bus_name: the bus name which exports the menu model
14911  * @object_path: the object path at which the menu model is exported
14912  *
14913  * Obtains a #GDBusMenuModel for the menu model which is exported
14914  * at the given @bus_name and @object_path.
14915  *
14916  * The thread default main context is taken at the time of this call.
14917  * All signals on the menu model (and any linked models) are reported
14918  * with respect to this context.  All calls on the returned menu model
14919  * (and linked models) must also originate from this same context, with
14920  * the thread default main context unchanged.
14921  *
14922  * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14923  * Since: 2.32
14924  */
14925
14926
14927 /**
14928  * g_dbus_message_bytes_needed:
14929  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14930  * @blob_len: The length of @blob (must be at least 16).
14931  * @error: Return location for error or %NULL.
14932  *
14933  * Utility function to calculate how many bytes are needed to
14934  * completely deserialize the D-Bus message stored at @blob.
14935  *
14936  * 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).
14937  * Since: 2.26
14938  */
14939
14940
14941 /**
14942  * g_dbus_message_copy:
14943  * @message: A #GDBusMessage.
14944  * @error: Return location for error or %NULL.
14945  *
14946  * Copies @message. The copy is a deep copy and the returned
14947  * #GDBusMessage is completely identical except that it is guaranteed
14948  * to not be locked.
14949  *
14950  * This operation can fail if e.g. @message contains file descriptors
14951  * and the per-process or system-wide open files limit is reached.
14952  *
14953  * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14954  * Since: 2.26
14955  */
14956
14957
14958 /**
14959  * g_dbus_message_get_arg0:
14960  * @message: A #GDBusMessage.
14961  *
14962  * Convenience to get the first item in the body of @message.
14963  *
14964  * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14965  * Since: 2.26
14966  */
14967
14968
14969 /**
14970  * g_dbus_message_get_body:
14971  * @message: A #GDBusMessage.
14972  *
14973  * Gets the body of a message.
14974  *
14975  * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14976  * Since: 2.26
14977  */
14978
14979
14980 /**
14981  * g_dbus_message_get_byte_order:
14982  * @message: A #GDBusMessage.
14983  *
14984  * Gets the byte order of @message.
14985  *
14986  * Returns: The byte order.
14987  */
14988
14989
14990 /**
14991  * g_dbus_message_get_destination:
14992  * @message: A #GDBusMessage.
14993  *
14994  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14995  *
14996  * Returns: The value.
14997  * Since: 2.26
14998  */
14999
15000
15001 /**
15002  * g_dbus_message_get_error_name:
15003  * @message: A #GDBusMessage.
15004  *
15005  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
15006  *
15007  * Returns: The value.
15008  * Since: 2.26
15009  */
15010
15011
15012 /**
15013  * g_dbus_message_get_flags:
15014  * @message: A #GDBusMessage.
15015  *
15016  * Gets the flags for @message.
15017  *
15018  * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
15019  * Since: 2.26
15020  */
15021
15022
15023 /**
15024  * g_dbus_message_get_header:
15025  * @message: A #GDBusMessage.
15026  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
15027  *
15028  * Gets a header field on @message.
15029  *
15030  * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
15031  * Since: 2.26
15032  */
15033
15034
15035 /**
15036  * g_dbus_message_get_header_fields:
15037  * @message: A #GDBusMessage.
15038  *
15039  * Gets an array of all header fields on @message that are set.
15040  *
15041  * 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().
15042  * Since: 2.26
15043  */
15044
15045
15046 /**
15047  * g_dbus_message_get_interface:
15048  * @message: A #GDBusMessage.
15049  *
15050  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
15051  *
15052  * Returns: The value.
15053  * Since: 2.26
15054  */
15055
15056
15057 /**
15058  * g_dbus_message_get_locked:
15059  * @message: A #GDBusMessage.
15060  *
15061  * Checks whether @message is locked. To monitor changes to this
15062  * value, conncet to the #GObject::notify signal to listen for changes
15063  * on the #GDBusMessage:locked property.
15064  *
15065  * Returns: %TRUE if @message is locked, %FALSE otherwise.
15066  * Since: 2.26
15067  */
15068
15069
15070 /**
15071  * g_dbus_message_get_member:
15072  * @message: A #GDBusMessage.
15073  *
15074  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
15075  *
15076  * Returns: The value.
15077  * Since: 2.26
15078  */
15079
15080
15081 /**
15082  * g_dbus_message_get_message_type:
15083  * @message: A #GDBusMessage.
15084  *
15085  * Gets the type of @message.
15086  *
15087  * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
15088  * Since: 2.26
15089  */
15090
15091
15092 /**
15093  * g_dbus_message_get_num_unix_fds:
15094  * @message: A #GDBusMessage.
15095  *
15096  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
15097  *
15098  * Returns: The value.
15099  * Since: 2.26
15100  */
15101
15102
15103 /**
15104  * g_dbus_message_get_path:
15105  * @message: A #GDBusMessage.
15106  *
15107  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
15108  *
15109  * Returns: The value.
15110  * Since: 2.26
15111  */
15112
15113
15114 /**
15115  * g_dbus_message_get_reply_serial:
15116  * @message: A #GDBusMessage.
15117  *
15118  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
15119  *
15120  * Returns: The value.
15121  * Since: 2.26
15122  */
15123
15124
15125 /**
15126  * g_dbus_message_get_sender:
15127  * @message: A #GDBusMessage.
15128  *
15129  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
15130  *
15131  * Returns: The value.
15132  * Since: 2.26
15133  */
15134
15135
15136 /**
15137  * g_dbus_message_get_serial:
15138  * @message: A #GDBusMessage.
15139  *
15140  * Gets the serial for @message.
15141  *
15142  * Returns: A #guint32.
15143  * Since: 2.26
15144  */
15145
15146
15147 /**
15148  * g_dbus_message_get_signature:
15149  * @message: A #GDBusMessage.
15150  *
15151  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
15152  *
15153  * Returns: The value.
15154  * Since: 2.26
15155  */
15156
15157
15158 /**
15159  * g_dbus_message_get_unix_fd_list:
15160  * @message: A #GDBusMessage.
15161  *
15162  * Gets the UNIX file descriptors associated with @message, if any.
15163  *
15164  * This method is only available on UNIX.
15165  *
15166  * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
15167  * Since: 2.26
15168  */
15169
15170
15171 /**
15172  * g_dbus_message_lock:
15173  * @message: A #GDBusMessage.
15174  *
15175  * If @message is locked, does nothing. Otherwise locks the message.
15176  *
15177  * Since: 2.26
15178  */
15179
15180
15181 /**
15182  * g_dbus_message_new:
15183  *
15184  * Creates a new empty #GDBusMessage.
15185  *
15186  * Returns: A #GDBusMessage. Free with g_object_unref().
15187  * Since: 2.26
15188  */
15189
15190
15191 /**
15192  * g_dbus_message_new_from_blob:
15193  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
15194  * @blob_len: The length of @blob.
15195  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
15196  * @error: Return location for error or %NULL.
15197  *
15198  * Creates a new #GDBusMessage from the data stored at @blob. The byte
15199  * order that the message was in can be retrieved using
15200  * g_dbus_message_get_byte_order().
15201  *
15202  * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
15203  * Since: 2.26
15204  */
15205
15206
15207 /**
15208  * g_dbus_message_new_method_call:
15209  * @name: (allow-none): A valid D-Bus name or %NULL.
15210  * @path: A valid object path.
15211  * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
15212  * @method: A valid method name.
15213  *
15214  * Creates a new #GDBusMessage for a method call.
15215  *
15216  * Returns: A #GDBusMessage. Free with g_object_unref().
15217  * Since: 2.26
15218  */
15219
15220
15221 /**
15222  * g_dbus_message_new_method_error:
15223  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15224  * @error_name: A valid D-Bus error name.
15225  * @error_message_format: The D-Bus error message in a printf() format.
15226  * @...: Arguments for @error_message_format.
15227  *
15228  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
15229  *
15230  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15231  * Since: 2.26
15232  */
15233
15234
15235 /**
15236  * g_dbus_message_new_method_error_literal:
15237  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15238  * @error_name: A valid D-Bus error name.
15239  * @error_message: The D-Bus error message.
15240  *
15241  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
15242  *
15243  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15244  * Since: 2.26
15245  */
15246
15247
15248 /**
15249  * g_dbus_message_new_method_error_valist:
15250  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15251  * @error_name: A valid D-Bus error name.
15252  * @error_message_format: The D-Bus error message in a printf() format.
15253  * @var_args: Arguments for @error_message_format.
15254  *
15255  * Like g_dbus_message_new_method_error() but intended for language bindings.
15256  *
15257  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15258  * Since: 2.26
15259  */
15260
15261
15262 /**
15263  * g_dbus_message_new_method_reply:
15264  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15265  *
15266  * Creates a new #GDBusMessage that is a reply to @method_call_message.
15267  *
15268  * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
15269  * Since: 2.26
15270  */
15271
15272
15273 /**
15274  * g_dbus_message_new_signal:
15275  * @path: A valid object path.
15276  * @interface_: A valid D-Bus interface name.
15277  * @signal: A valid signal name.
15278  *
15279  * Creates a new #GDBusMessage for a signal emission.
15280  *
15281  * Returns: A #GDBusMessage. Free with g_object_unref().
15282  * Since: 2.26
15283  */
15284
15285
15286 /**
15287  * g_dbus_message_print:
15288  * @message: A #GDBusMessage.
15289  * @indent: Indentation level.
15290  *
15291  * Produces a human-readable multi-line description of @message.
15292  *
15293  * The contents of the description has no ABI guarantees, the contents
15294  * and formatting is subject to change at any time. Typical output
15295  * looks something like this:
15296  * <programlisting>
15297  * Type&colon;    method-call
15298  * Flags&colon;   none
15299  * Version&colon; 0
15300  * Serial&colon;  4
15301  * Headers&colon;
15302  *   path -> objectpath '/org/gtk/GDBus/TestObject'
15303  *   interface -> 'org.gtk.GDBus.TestInterface'
15304  *   member -> 'GimmeStdout'
15305  *   destination -> ':1.146'
15306  * Body&colon; ()
15307  * UNIX File Descriptors:
15308  *   (none)
15309  * </programlisting>
15310  * or
15311  * <programlisting>
15312  * Type&colon;    method-return
15313  * Flags&colon;   no-reply-expected
15314  * Version&colon; 0
15315  * Serial&colon;  477
15316  * Headers&colon;
15317  *   reply-serial -> uint32 4
15318  *   destination -> ':1.159'
15319  *   sender -> ':1.146'
15320  *   num-unix-fds -> uint32 1
15321  * Body&colon; ()
15322  * UNIX File Descriptors&colon;
15323  *   fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
15324  * </programlisting>
15325  *
15326  * Returns: A string that should be freed with g_free().
15327  * Since: 2.26
15328  */
15329
15330
15331 /**
15332  * g_dbus_message_set_body:
15333  * @message: A #GDBusMessage.
15334  * @body: Either %NULL or a #GVariant that is a tuple.
15335  *
15336  * Sets the body @message. As a side-effect the
15337  * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
15338  * type string of @body (or cleared if @body is %NULL).
15339  *
15340  * If @body is floating, @message assumes ownership of @body.
15341  *
15342  * Since: 2.26
15343  */
15344
15345
15346 /**
15347  * g_dbus_message_set_byte_order:
15348  * @message: A #GDBusMessage.
15349  * @byte_order: The byte order.
15350  *
15351  * Sets the byte order of @message.
15352  */
15353
15354
15355 /**
15356  * g_dbus_message_set_destination:
15357  * @message: A #GDBusMessage.
15358  * @value: The value to set.
15359  *
15360  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
15361  *
15362  * Since: 2.26
15363  */
15364
15365
15366 /**
15367  * g_dbus_message_set_error_name:
15368  * @message: A #GDBusMessage.
15369  * @value: The value to set.
15370  *
15371  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
15372  *
15373  * Since: 2.26
15374  */
15375
15376
15377 /**
15378  * g_dbus_message_set_flags:
15379  * @message: A #GDBusMessage.
15380  * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
15381  *
15382  * Sets the flags to set on @message.
15383  *
15384  * Since: 2.26
15385  */
15386
15387
15388 /**
15389  * g_dbus_message_set_header:
15390  * @message: A #GDBusMessage.
15391  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
15392  * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
15393  *
15394  * Sets a header field on @message.
15395  *
15396  * If @value is floating, @message assumes ownership of @value.
15397  *
15398  * Since: 2.26
15399  */
15400
15401
15402 /**
15403  * g_dbus_message_set_interface:
15404  * @message: A #GDBusMessage.
15405  * @value: The value to set.
15406  *
15407  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
15408  *
15409  * Since: 2.26
15410  */
15411
15412
15413 /**
15414  * g_dbus_message_set_member:
15415  * @message: A #GDBusMessage.
15416  * @value: The value to set.
15417  *
15418  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
15419  *
15420  * Since: 2.26
15421  */
15422
15423
15424 /**
15425  * g_dbus_message_set_message_type:
15426  * @message: A #GDBusMessage.
15427  * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
15428  *
15429  * Sets @message to be of @type.
15430  *
15431  * Since: 2.26
15432  */
15433
15434
15435 /**
15436  * g_dbus_message_set_num_unix_fds:
15437  * @message: A #GDBusMessage.
15438  * @value: The value to set.
15439  *
15440  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
15441  *
15442  * Since: 2.26
15443  */
15444
15445
15446 /**
15447  * g_dbus_message_set_path:
15448  * @message: A #GDBusMessage.
15449  * @value: The value to set.
15450  *
15451  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
15452  *
15453  * Since: 2.26
15454  */
15455
15456
15457 /**
15458  * g_dbus_message_set_reply_serial:
15459  * @message: A #GDBusMessage.
15460  * @value: The value to set.
15461  *
15462  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
15463  *
15464  * Since: 2.26
15465  */
15466
15467
15468 /**
15469  * g_dbus_message_set_sender:
15470  * @message: A #GDBusMessage.
15471  * @value: The value to set.
15472  *
15473  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
15474  *
15475  * Since: 2.26
15476  */
15477
15478
15479 /**
15480  * g_dbus_message_set_serial:
15481  * @message: A #GDBusMessage.
15482  * @serial: A #guint32.
15483  *
15484  * Sets the serial for @message.
15485  *
15486  * Since: 2.26
15487  */
15488
15489
15490 /**
15491  * g_dbus_message_set_signature:
15492  * @message: A #GDBusMessage.
15493  * @value: The value to set.
15494  *
15495  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
15496  *
15497  * Since: 2.26
15498  */
15499
15500
15501 /**
15502  * g_dbus_message_set_unix_fd_list:
15503  * @message: A #GDBusMessage.
15504  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15505  *
15506  * Sets the UNIX file descriptors associated with @message. As a
15507  * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
15508  * field is set to the number of fds in @fd_list (or cleared if
15509  * @fd_list is %NULL).
15510  *
15511  * This method is only available on UNIX.
15512  *
15513  * Since: 2.26
15514  */
15515
15516
15517 /**
15518  * g_dbus_message_to_blob:
15519  * @message: A #GDBusMessage.
15520  * @out_size: Return location for size of generated blob.
15521  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
15522  * @error: Return location for error.
15523  *
15524  * Serializes @message to a blob. The byte order returned by
15525  * g_dbus_message_get_byte_order() will be used.
15526  *
15527  * 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().
15528  * Since: 2.26
15529  */
15530
15531
15532 /**
15533  * g_dbus_message_to_gerror:
15534  * @message: A #GDBusMessage.
15535  * @error: The #GError to set.
15536  *
15537  * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
15538  * nothing and returns %FALSE.
15539  *
15540  * Otherwise this method encodes the error in @message as a #GError
15541  * using g_dbus_error_set_dbus_error() using the information in the
15542  * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
15543  * well as the first string item in @message's body.
15544  *
15545  * Returns: %TRUE if @error was set, %FALSE otherwise.
15546  * Since: 2.26
15547  */
15548
15549
15550 /**
15551  * g_dbus_method_info_ref:
15552  * @info: A #GDBusMethodInfo
15553  *
15554  * If @info is statically allocated does nothing. Otherwise increases
15555  * the reference count.
15556  *
15557  * Returns: The same @info.
15558  * Since: 2.26
15559  */
15560
15561
15562 /**
15563  * g_dbus_method_info_unref:
15564  * @info: A #GDBusMethodInfo.
15565  *
15566  * If @info is statically allocated, does nothing. Otherwise decreases
15567  * the reference count of @info. When its reference count drops to 0,
15568  * the memory used is freed.
15569  *
15570  * Since: 2.26
15571  */
15572
15573
15574 /**
15575  * g_dbus_method_invocation_get_connection:
15576  * @invocation: A #GDBusMethodInvocation.
15577  *
15578  * Gets the #GDBusConnection the method was invoked on.
15579  *
15580  * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
15581  * Since: 2.26
15582  */
15583
15584
15585 /**
15586  * g_dbus_method_invocation_get_interface_name:
15587  * @invocation: A #GDBusMethodInvocation.
15588  *
15589  * Gets the name of the D-Bus interface the method was invoked on.
15590  *
15591  * Returns: A string. Do not free, it is owned by @invocation.
15592  * Since: 2.26
15593  */
15594
15595
15596 /**
15597  * g_dbus_method_invocation_get_message:
15598  * @invocation: A #GDBusMethodInvocation.
15599  *
15600  * Gets the #GDBusMessage for the method invocation. This is useful if
15601  * you need to use low-level protocol features, such as UNIX file
15602  * descriptor passing, that cannot be properly expressed in the
15603  * #GVariant API.
15604  *
15605  * See <xref linkend="gdbus-server"/> and <xref
15606  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
15607  * low-level API to send and receive UNIX file descriptors.
15608  *
15609  * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
15610  * Since: 2.26
15611  */
15612
15613
15614 /**
15615  * g_dbus_method_invocation_get_method_info:
15616  * @invocation: A #GDBusMethodInvocation.
15617  *
15618  * Gets information about the method call, if any.
15619  *
15620  * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
15621  * Since: 2.26
15622  */
15623
15624
15625 /**
15626  * g_dbus_method_invocation_get_method_name:
15627  * @invocation: A #GDBusMethodInvocation.
15628  *
15629  * Gets the name of the method that was invoked.
15630  *
15631  * Returns: A string. Do not free, it is owned by @invocation.
15632  * Since: 2.26
15633  */
15634
15635
15636 /**
15637  * g_dbus_method_invocation_get_object_path:
15638  * @invocation: A #GDBusMethodInvocation.
15639  *
15640  * Gets the object path the method was invoked on.
15641  *
15642  * Returns: A string. Do not free, it is owned by @invocation.
15643  * Since: 2.26
15644  */
15645
15646
15647 /**
15648  * g_dbus_method_invocation_get_parameters:
15649  * @invocation: A #GDBusMethodInvocation.
15650  *
15651  * Gets the parameters of the method invocation. If there are no input
15652  * parameters then this will return a GVariant with 0 children rather than NULL.
15653  *
15654  * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
15655  * Since: 2.26
15656  */
15657
15658
15659 /**
15660  * g_dbus_method_invocation_get_sender:
15661  * @invocation: A #GDBusMethodInvocation.
15662  *
15663  * Gets the bus name that invoked the method.
15664  *
15665  * Returns: A string. Do not free, it is owned by @invocation.
15666  * Since: 2.26
15667  */
15668
15669
15670 /**
15671  * g_dbus_method_invocation_get_user_data: (skip)
15672  * @invocation: A #GDBusMethodInvocation.
15673  *
15674  * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15675  *
15676  * Returns: A #gpointer.
15677  * Since: 2.26
15678  */
15679
15680
15681 /**
15682  * g_dbus_method_invocation_return_dbus_error:
15683  * @invocation: (transfer full): A #GDBusMethodInvocation.
15684  * @error_name: A valid D-Bus error name.
15685  * @error_message: A valid D-Bus error message.
15686  *
15687  * Finishes handling a D-Bus method call by returning an error.
15688  *
15689  * This method will free @invocation, you cannot use it afterwards.
15690  *
15691  * Since: 2.26
15692  */
15693
15694
15695 /**
15696  * g_dbus_method_invocation_return_error:
15697  * @invocation: (transfer full): A #GDBusMethodInvocation.
15698  * @domain: A #GQuark for the #GError error domain.
15699  * @code: The error code.
15700  * @format: printf()-style format.
15701  * @...: Parameters for @format.
15702  *
15703  * Finishes handling a D-Bus method call by returning an error.
15704  *
15705  * See g_dbus_error_encode_gerror() for details about what error name
15706  * will be returned on the wire. In a nutshell, if the given error is
15707  * registered using g_dbus_error_register_error() the name given
15708  * during registration is used. Otherwise, a name of the form
15709  * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15710  * used. This provides transparent mapping of #GError between
15711  * applications using GDBus.
15712  *
15713  * If you are writing an application intended to be portable,
15714  * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15715  * or use g_dbus_method_invocation_return_dbus_error().
15716  *
15717  * This method will free @invocation, you cannot use it afterwards.
15718  *
15719  * Since: 2.26
15720  */
15721
15722
15723 /**
15724  * g_dbus_method_invocation_return_error_literal:
15725  * @invocation: (transfer full): A #GDBusMethodInvocation.
15726  * @domain: A #GQuark for the #GError error domain.
15727  * @code: The error code.
15728  * @message: The error message.
15729  *
15730  * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15731  *
15732  * This method will free @invocation, you cannot use it afterwards.
15733  *
15734  * Since: 2.26
15735  */
15736
15737
15738 /**
15739  * g_dbus_method_invocation_return_error_valist:
15740  * @invocation: (transfer full): A #GDBusMethodInvocation.
15741  * @domain: A #GQuark for the #GError error domain.
15742  * @code: The error code.
15743  * @format: printf()-style format.
15744  * @var_args: #va_list of parameters for @format.
15745  *
15746  * Like g_dbus_method_invocation_return_error() but intended for
15747  * language bindings.
15748  *
15749  * This method will free @invocation, you cannot use it afterwards.
15750  *
15751  * Since: 2.26
15752  */
15753
15754
15755 /**
15756  * g_dbus_method_invocation_return_gerror:
15757  * @invocation: (transfer full): A #GDBusMethodInvocation.
15758  * @error: A #GError.
15759  *
15760  * Like g_dbus_method_invocation_return_error() but takes a #GError
15761  * instead of the error domain, error code and message.
15762  *
15763  * This method will free @invocation, you cannot use it afterwards.
15764  *
15765  * Since: 2.26
15766  */
15767
15768
15769 /**
15770  * g_dbus_method_invocation_return_value:
15771  * @invocation: (transfer full): A #GDBusMethodInvocation.
15772  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15773  *
15774  * Finishes handling a D-Bus method call by returning @parameters.
15775  * If the @parameters GVariant is floating, it is consumed.
15776  *
15777  * It is an error if @parameters is not of the right format.
15778  *
15779  * This method will free @invocation, you cannot use it afterwards.
15780  *
15781  * Since: 2.26
15782  */
15783
15784
15785 /**
15786  * g_dbus_method_invocation_return_value_with_unix_fd_list:
15787  * @invocation: (transfer full): A #GDBusMethodInvocation.
15788  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15789  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15790  *
15791  * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15792  *
15793  * This method is only available on UNIX.
15794  *
15795  * This method will free @invocation, you cannot use it afterwards.
15796  *
15797  * Since: 2.30
15798  */
15799
15800
15801 /**
15802  * g_dbus_method_invocation_take_error: (skip)
15803  * @invocation: (transfer full): A #GDBusMethodInvocation.
15804  * @error: (transfer full): A #GError.
15805  *
15806  * Like g_dbus_method_invocation_return_gerror() but takes ownership
15807  * of @error so the caller does not need to free it.
15808  *
15809  * This method will free @invocation, you cannot use it afterwards.
15810  *
15811  * Since: 2.30
15812  */
15813
15814
15815 /**
15816  * g_dbus_node_info_generate_xml:
15817  * @info: A #GDBusNodeInfo.
15818  * @indent: Indentation level.
15819  * @string_builder: (out): A #GString to to append XML data to.
15820  *
15821  * Appends an XML representation of @info (and its children) to @string_builder.
15822  *
15823  * This function is typically used for generating introspection XML documents at run-time for
15824  * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15825  *
15826  * Since: 2.26
15827  */
15828
15829
15830 /**
15831  * g_dbus_node_info_lookup_interface:
15832  * @info: A #GDBusNodeInfo.
15833  * @name: A D-Bus interface name.
15834  *
15835  * Looks up information about an interface.
15836  *
15837  * The cost of this function is O(n) in number of interfaces.
15838  *
15839  * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15840  * Since: 2.26
15841  */
15842
15843
15844 /**
15845  * g_dbus_node_info_new_for_xml:
15846  * @xml_data: Valid D-Bus introspection XML.
15847  * @error: Return location for error.
15848  *
15849  * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15850  *
15851  * The introspection XML must contain exactly one top-level
15852  * <tag class="starttag">node</tag> element.
15853  *
15854  * Note that this routine is using a
15855  * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15856  * parser that only accepts a subset of valid XML documents.
15857  *
15858  * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15859  * Since: 2.26
15860  */
15861
15862
15863 /**
15864  * g_dbus_node_info_ref:
15865  * @info: A #GDBusNodeInfo
15866  *
15867  * If @info is statically allocated does nothing. Otherwise increases
15868  * the reference count.
15869  *
15870  * Returns: The same @info.
15871  * Since: 2.26
15872  */
15873
15874
15875 /**
15876  * g_dbus_node_info_unref:
15877  * @info: A #GDBusNodeInfo.
15878  *
15879  * If @info is statically allocated, does nothing. Otherwise decreases
15880  * the reference count of @info. When its reference count drops to 0,
15881  * the memory used is freed.
15882  *
15883  * Since: 2.26
15884  */
15885
15886
15887 /**
15888  * g_dbus_object_get_interface:
15889  * @object: A #GDBusObject.
15890  * @interface_name: A D-Bus interface name.
15891  *
15892  * Gets the D-Bus interface with name @interface_name associated with
15893  * @object, if any.
15894  *
15895  * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15896  * Since: 2.30
15897  */
15898
15899
15900 /**
15901  * g_dbus_object_get_interfaces:
15902  * @object: A #GDBusObject.
15903  *
15904  * Gets the D-Bus interfaces associated with @object.
15905  *
15906  * 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().
15907  * Since: 2.30
15908  */
15909
15910
15911 /**
15912  * g_dbus_object_get_object_path:
15913  * @object: A #GDBusObject.
15914  *
15915  * Gets the object path for @object.
15916  *
15917  * Returns: A string owned by @object. Do not free.
15918  * Since: 2.30
15919  */
15920
15921
15922 /**
15923  * g_dbus_object_manager_client_get_connection:
15924  * @manager: A #GDBusObjectManagerClient
15925  *
15926  * Gets the #GDBusConnection used by @manager.
15927  *
15928  * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15929  * Since: 2.30
15930  */
15931
15932
15933 /**
15934  * g_dbus_object_manager_client_get_flags:
15935  * @manager: A #GDBusObjectManagerClient
15936  *
15937  * Gets the flags that @manager was constructed with.
15938  *
15939  * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15940  * Since: 2.30
15941  */
15942
15943
15944 /**
15945  * g_dbus_object_manager_client_get_name:
15946  * @manager: A #GDBusObjectManagerClient
15947  *
15948  * Gets the name that @manager is for, or %NULL if not a message bus
15949  * connection.
15950  *
15951  * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15952  * Since: 2.30
15953  */
15954
15955
15956 /**
15957  * g_dbus_object_manager_client_get_name_owner:
15958  * @manager: A #GDBusObjectManagerClient.
15959  *
15960  * The unique name that owns the name that @manager is for or %NULL if
15961  * no-one currently owns that name. You can connect to the
15962  * #GObject::notify signal to track changes to the
15963  * #GDBusObjectManagerClient:name-owner property.
15964  *
15965  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15966  * Since: 2.30
15967  */
15968
15969
15970 /**
15971  * g_dbus_object_manager_client_new:
15972  * @connection: A #GDBusConnection.
15973  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15974  * @name: The owner of the control object (unique or well-known name).
15975  * @object_path: The object path of the control object.
15976  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15977  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15978  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15979  * @cancellable: (allow-none): A #GCancellable or %NULL
15980  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15981  * @user_data: The data to pass to @callback.
15982  *
15983  * Asynchronously creates a new #GDBusObjectManagerClient object.
15984  *
15985  * This is an asynchronous failable constructor. When the result is
15986  * ready, @callback will be invoked in the
15987  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15988  * of the thread you are calling this method from. You can
15989  * then call g_dbus_object_manager_client_new_finish() to get the result. See
15990  * g_dbus_object_manager_client_new_sync() for the synchronous version.
15991  *
15992  * Since: 2.30
15993  */
15994
15995
15996 /**
15997  * g_dbus_object_manager_client_new_finish:
15998  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15999  * @error: Return location for error or %NULL.
16000  *
16001  * Finishes an operation started with g_dbus_object_manager_client_new().
16002  *
16003  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16004  * Since: 2.30
16005  */
16006
16007
16008 /**
16009  * g_dbus_object_manager_client_new_for_bus:
16010  * @bus_type: A #GBusType.
16011  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16012  * @name: The owner of the control object (unique or well-known name).
16013  * @object_path: The object path of the control object.
16014  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16015  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16016  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16017  * @cancellable: (allow-none): A #GCancellable or %NULL
16018  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
16019  * @user_data: The data to pass to @callback.
16020  *
16021  * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
16022  * #GDBusConnection.
16023  *
16024  * This is an asynchronous failable constructor. When the result is
16025  * ready, @callback will be invoked in the
16026  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
16027  * of the thread you are calling this method from. You can
16028  * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
16029  * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
16030  *
16031  * Since: 2.30
16032  */
16033
16034
16035 /**
16036  * g_dbus_object_manager_client_new_for_bus_finish:
16037  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
16038  * @error: Return location for error or %NULL.
16039  *
16040  * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
16041  *
16042  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16043  * Since: 2.30
16044  */
16045
16046
16047 /**
16048  * g_dbus_object_manager_client_new_for_bus_sync:
16049  * @bus_type: A #GBusType.
16050  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16051  * @name: The owner of the control object (unique or well-known name).
16052  * @object_path: The object path of the control object.
16053  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16054  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16055  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16056  * @cancellable: (allow-none): A #GCancellable or %NULL
16057  * @error: Return location for error or %NULL.
16058  *
16059  * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
16060  * of a #GDBusConnection.
16061  *
16062  * This is a synchronous failable constructor - the calling thread is
16063  * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
16064  * for the asynchronous version.
16065  *
16066  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16067  * Since: 2.30
16068  */
16069
16070
16071 /**
16072  * g_dbus_object_manager_client_new_sync:
16073  * @connection: A #GDBusConnection.
16074  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16075  * @name: (allow-none): The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.
16076  * @object_path: The object path of the control object.
16077  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16078  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16079  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16080  * @cancellable: (allow-none): A #GCancellable or %NULL
16081  * @error: Return location for error or %NULL.
16082  *
16083  * Creates a new #GDBusObjectManagerClient object.
16084  *
16085  * This is a synchronous failable constructor - the calling thread is
16086  * blocked until a reply is received. See g_dbus_object_manager_client_new()
16087  * for the asynchronous version.
16088  *
16089  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16090  * Since: 2.30
16091  */
16092
16093
16094 /**
16095  * g_dbus_object_manager_get_interface:
16096  * @manager: A #GDBusObjectManager.
16097  * @object_path: Object path to lookup.
16098  * @interface_name: D-Bus interface name to lookup.
16099  *
16100  * Gets the interface proxy for @interface_name at @object_path, if
16101  * any.
16102  *
16103  * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
16104  * Since: 2.30
16105  */
16106
16107
16108 /**
16109  * g_dbus_object_manager_get_object:
16110  * @manager: A #GDBusObjectManager.
16111  * @object_path: Object path to lookup.
16112  *
16113  * Gets the #GDBusObjectProxy at @object_path, if any.
16114  *
16115  * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
16116  * Since: 2.30
16117  */
16118
16119
16120 /**
16121  * g_dbus_object_manager_get_object_path:
16122  * @manager: A #GDBusObjectManager.
16123  *
16124  * Gets the object path that @manager is for.
16125  *
16126  * Returns: A string owned by @manager. Do not free.
16127  * Since: 2.30
16128  */
16129
16130
16131 /**
16132  * g_dbus_object_manager_get_objects:
16133  * @manager: A #GDBusObjectManager.
16134  *
16135  * Gets all #GDBusObject objects known to @manager.
16136  *
16137  * 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().
16138  * Since: 2.30
16139  */
16140
16141
16142 /**
16143  * g_dbus_object_manager_server_export:
16144  * @manager: A #GDBusObjectManagerServer.
16145  * @object: A #GDBusObjectSkeleton.
16146  *
16147  * Exports @object on @manager.
16148  *
16149  * If there is already a #GDBusObject exported at the object path,
16150  * then the old object is removed.
16151  *
16152  * The object path for @object must be in the hierarchy rooted by the
16153  * object path for @manager.
16154  *
16155  * Note that @manager will take a reference on @object for as long as
16156  * it is exported.
16157  *
16158  * Since: 2.30
16159  */
16160
16161
16162 /**
16163  * g_dbus_object_manager_server_export_uniquely:
16164  * @manager: A #GDBusObjectManagerServer.
16165  * @object: An object.
16166  *
16167  * Like g_dbus_object_manager_server_export() but appends a string of
16168  * the form <literal>_N</literal> (with N being a natural number) to
16169  * @object<!-- -->'s object path if an object with the given path
16170  * already exists. As such, the #GDBusObjectProxy:g-object-path property
16171  * of @object may be modified.
16172  *
16173  * Since: 2.30
16174  */
16175
16176
16177 /**
16178  * g_dbus_object_manager_server_get_connection:
16179  * @manager: A #GDBusObjectManagerServer
16180  *
16181  * Gets the #GDBusConnection used by @manager.
16182  *
16183  * 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().
16184  * Since: 2.30
16185  */
16186
16187
16188 /**
16189  * g_dbus_object_manager_server_is_exported:
16190  * @manager: A #GDBusObjectManagerServer.
16191  * @object: An object.
16192  *
16193  * Returns whether @object is currently exported on @manager.
16194  *
16195  * Returns: %TRUE if @object is exported
16196  * Since: 2.34
16197  */
16198
16199
16200 /**
16201  * g_dbus_object_manager_server_new:
16202  * @object_path: The object path to export the manager object at.
16203  *
16204  * Creates a new #GDBusObjectManagerServer object.
16205  *
16206  * The returned server isn't yet exported on any connection. To do so,
16207  * use g_dbus_object_manager_server_set_connection(). Normally you
16208  * want to export all of your objects before doing so to avoid <ulink
16209  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
16210  * signals being emitted.
16211  *
16212  * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
16213  * Since: 2.30
16214  */
16215
16216
16217 /**
16218  * g_dbus_object_manager_server_set_connection:
16219  * @manager: A #GDBusObjectManagerServer.
16220  * @connection: (allow-none): A #GDBusConnection or %NULL.
16221  *
16222  * Exports all objects managed by @manager on @connection. If
16223  * @connection is %NULL, stops exporting objects.
16224  */
16225
16226
16227 /**
16228  * g_dbus_object_manager_server_unexport:
16229  * @manager: A #GDBusObjectManagerServer.
16230  * @object_path: An object path.
16231  *
16232  * If @manager has an object at @path, removes the object. Otherwise
16233  * does nothing.
16234  *
16235  * Note that @object_path must be in the hierarchy rooted by the
16236  * object path for @manager.
16237  *
16238  * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
16239  * Since: 2.30
16240  */
16241
16242
16243 /**
16244  * g_dbus_object_proxy_get_connection:
16245  * @proxy: a #GDBusObjectProxy
16246  *
16247  * Gets the connection that @proxy is for.
16248  *
16249  * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
16250  * Since: 2.30
16251  */
16252
16253
16254 /**
16255  * g_dbus_object_proxy_new:
16256  * @connection: a #GDBusConnection
16257  * @object_path: the object path
16258  *
16259  * Creates a new #GDBusObjectProxy for the given connection and
16260  * object path.
16261  *
16262  * Returns: a new #GDBusObjectProxy
16263  * Since: 2.30
16264  */
16265
16266
16267 /**
16268  * g_dbus_object_skeleton_add_interface:
16269  * @object: A #GDBusObjectSkeleton.
16270  * @interface_: A #GDBusInterfaceSkeleton.
16271  *
16272  * Adds @interface_ to @object.
16273  *
16274  * If @object already contains a #GDBusInterfaceSkeleton with the same
16275  * interface name, it is removed before @interface_ is added.
16276  *
16277  * Note that @object takes its own reference on @interface_ and holds
16278  * it until removed.
16279  *
16280  * Since: 2.30
16281  */
16282
16283
16284 /**
16285  * g_dbus_object_skeleton_flush:
16286  * @object: A #GDBusObjectSkeleton.
16287  *
16288  * This method simply calls g_dbus_interface_skeleton_flush() on all
16289  * interfaces belonging to @object. See that method for when flushing
16290  * is useful.
16291  *
16292  * Since: 2.30
16293  */
16294
16295
16296 /**
16297  * g_dbus_object_skeleton_new:
16298  * @object_path: An object path.
16299  *
16300  * Creates a new #GDBusObjectSkeleton.
16301  *
16302  * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
16303  * Since: 2.30
16304  */
16305
16306
16307 /**
16308  * g_dbus_object_skeleton_remove_interface:
16309  * @object: A #GDBusObjectSkeleton.
16310  * @interface_: A #GDBusInterfaceSkeleton.
16311  *
16312  * Removes @interface_ from @object.
16313  *
16314  * Since: 2.30
16315  */
16316
16317
16318 /**
16319  * g_dbus_object_skeleton_remove_interface_by_name:
16320  * @object: A #GDBusObjectSkeleton.
16321  * @interface_name: A D-Bus interface name.
16322  *
16323  * Removes the #GDBusInterface with @interface_name from @object.
16324  *
16325  * If no D-Bus interface of the given interface exists, this function
16326  * does nothing.
16327  *
16328  * Since: 2.30
16329  */
16330
16331
16332 /**
16333  * g_dbus_object_skeleton_set_object_path:
16334  * @object: A #GDBusObjectSkeleton.
16335  * @object_path: A valid D-Bus object path.
16336  *
16337  * Sets the object path for @object.
16338  *
16339  * Since: 2.30
16340  */
16341
16342
16343 /**
16344  * g_dbus_property_info_ref:
16345  * @info: A #GDBusPropertyInfo
16346  *
16347  * If @info is statically allocated does nothing. Otherwise increases
16348  * the reference count.
16349  *
16350  * Returns: The same @info.
16351  * Since: 2.26
16352  */
16353
16354
16355 /**
16356  * g_dbus_property_info_unref:
16357  * @info: A #GDBusPropertyInfo.
16358  *
16359  * If @info is statically allocated, does nothing. Otherwise decreases
16360  * the reference count of @info. When its reference count drops to 0,
16361  * the memory used is freed.
16362  *
16363  * Since: 2.26
16364  */
16365
16366
16367 /**
16368  * g_dbus_proxy_call:
16369  * @proxy: A #GDBusProxy.
16370  * @method_name: Name of method to invoke.
16371  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16372  * @flags: Flags from the #GDBusCallFlags enumeration.
16373  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16374  * @cancellable: (allow-none): A #GCancellable or %NULL.
16375  * @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.
16376  * @user_data: The data to pass to @callback.
16377  *
16378  * Asynchronously invokes the @method_name method on @proxy.
16379  *
16380  * If @method_name contains any dots, then @name is split into interface and
16381  * method name parts. This allows using @proxy for invoking methods on
16382  * other interfaces.
16383  *
16384  * If the #GDBusConnection associated with @proxy is closed then
16385  * the operation will fail with %G_IO_ERROR_CLOSED. If
16386  * @cancellable is canceled, the operation will fail with
16387  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
16388  * compatible with the D-Bus protocol, the operation fails with
16389  * %G_IO_ERROR_INVALID_ARGUMENT.
16390  *
16391  * If the @parameters #GVariant is floating, it is consumed. This allows
16392  * convenient 'inline' use of g_variant_new(), e.g.:
16393  * |[
16394  *  g_dbus_proxy_call (proxy,
16395  *                     "TwoStrings",
16396  *                     g_variant_new ("(ss)",
16397  *                                    "Thing One",
16398  *                                    "Thing Two"),
16399  *                     G_DBUS_CALL_FLAGS_NONE,
16400  *                     -1,
16401  *                     NULL,
16402  *                     (GAsyncReadyCallback) two_strings_done,
16403  *                     &amp;data);
16404  * ]|
16405  *
16406  * If @proxy has an expected interface (see
16407  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
16408  * then the return value is checked against the return type.
16409  *
16410  * This is an asynchronous method. When the operation is finished,
16411  * @callback will be invoked in the
16412  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
16413  * of the thread you are calling this method from.
16414  * You can then call g_dbus_proxy_call_finish() to get the result of
16415  * the operation. See g_dbus_proxy_call_sync() for the synchronous
16416  * version of this method.
16417  *
16418  * If @callback is %NULL then the D-Bus method call message will be sent with
16419  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
16420  *
16421  * Since: 2.26
16422  */
16423
16424
16425 /**
16426  * g_dbus_proxy_call_finish:
16427  * @proxy: A #GDBusProxy.
16428  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
16429  * @error: Return location for error or %NULL.
16430  *
16431  * Finishes an operation started with g_dbus_proxy_call().
16432  *
16433  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16434  * Since: 2.26
16435  */
16436
16437
16438 /**
16439  * g_dbus_proxy_call_sync:
16440  * @proxy: A #GDBusProxy.
16441  * @method_name: Name of method to invoke.
16442  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16443  * @flags: Flags from the #GDBusCallFlags enumeration.
16444  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16445  * @cancellable: (allow-none): A #GCancellable or %NULL.
16446  * @error: Return location for error or %NULL.
16447  *
16448  * Synchronously invokes the @method_name method on @proxy.
16449  *
16450  * If @method_name contains any dots, then @name is split into interface and
16451  * method name parts. This allows using @proxy for invoking methods on
16452  * other interfaces.
16453  *
16454  * If the #GDBusConnection associated with @proxy is disconnected then
16455  * the operation will fail with %G_IO_ERROR_CLOSED. If
16456  * @cancellable is canceled, the operation will fail with
16457  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
16458  * compatible with the D-Bus protocol, the operation fails with
16459  * %G_IO_ERROR_INVALID_ARGUMENT.
16460  *
16461  * If the @parameters #GVariant is floating, it is consumed. This allows
16462  * convenient 'inline' use of g_variant_new(), e.g.:
16463  * |[
16464  *  g_dbus_proxy_call_sync (proxy,
16465  *                          "TwoStrings",
16466  *                          g_variant_new ("(ss)",
16467  *                                         "Thing One",
16468  *                                         "Thing Two"),
16469  *                          G_DBUS_CALL_FLAGS_NONE,
16470  *                          -1,
16471  *                          NULL,
16472  *                          &amp;error);
16473  * ]|
16474  *
16475  * The calling thread is blocked until a reply is received. See
16476  * g_dbus_proxy_call() for the asynchronous version of this
16477  * method.
16478  *
16479  * If @proxy has an expected interface (see
16480  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
16481  * then the return value is checked against the return type.
16482  *
16483  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16484  * Since: 2.26
16485  */
16486
16487
16488 /**
16489  * g_dbus_proxy_call_with_unix_fd_list:
16490  * @proxy: A #GDBusProxy.
16491  * @method_name: Name of method to invoke.
16492  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16493  * @flags: Flags from the #GDBusCallFlags enumeration.
16494  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16495  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
16496  * @cancellable: (allow-none): A #GCancellable or %NULL.
16497  * @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.
16498  * @user_data: The data to pass to @callback.
16499  *
16500  * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
16501  *
16502  * This method is only available on UNIX.
16503  *
16504  * Since: 2.30
16505  */
16506
16507
16508 /**
16509  * g_dbus_proxy_call_with_unix_fd_list_finish:
16510  * @proxy: A #GDBusProxy.
16511  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
16512  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
16513  * @error: Return location for error or %NULL.
16514  *
16515  * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
16516  *
16517  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16518  * Since: 2.30
16519  */
16520
16521
16522 /**
16523  * g_dbus_proxy_call_with_unix_fd_list_sync:
16524  * @proxy: A #GDBusProxy.
16525  * @method_name: Name of method to invoke.
16526  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16527  * @flags: Flags from the #GDBusCallFlags enumeration.
16528  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16529  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
16530  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
16531  * @cancellable: (allow-none): A #GCancellable or %NULL.
16532  * @error: Return location for error or %NULL.
16533  *
16534  * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
16535  *
16536  * This method is only available on UNIX.
16537  *
16538  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16539  * Since: 2.30
16540  */
16541
16542
16543 /**
16544  * g_dbus_proxy_get_cached_property:
16545  * @proxy: A #GDBusProxy.
16546  * @property_name: Property name.
16547  *
16548  * Looks up the value for a property from the cache. This call does no
16549  * blocking IO.
16550  *
16551  * If @proxy has an expected interface (see
16552  * #GDBusProxy:g-interface-info) and @property_name is referenced by
16553  * it, then @value is checked against the type of the property.
16554  *
16555  * 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().
16556  * Since: 2.26
16557  */
16558
16559
16560 /**
16561  * g_dbus_proxy_get_cached_property_names:
16562  * @proxy: A #GDBusProxy.
16563  *
16564  * Gets the names of all cached properties on @proxy.
16565  *
16566  * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
16567  * Since: 2.26
16568  */
16569
16570
16571 /**
16572  * g_dbus_proxy_get_connection:
16573  * @proxy: A #GDBusProxy.
16574  *
16575  * Gets the connection @proxy is for.
16576  *
16577  * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
16578  * Since: 2.26
16579  */
16580
16581
16582 /**
16583  * g_dbus_proxy_get_default_timeout:
16584  * @proxy: A #GDBusProxy.
16585  *
16586  * Gets the timeout to use if -1 (specifying default timeout) is
16587  * passed as @timeout_msec in the g_dbus_proxy_call() and
16588  * g_dbus_proxy_call_sync() functions.
16589  *
16590  * See the #GDBusProxy:g-default-timeout property for more details.
16591  *
16592  * Returns: Timeout to use for @proxy.
16593  * Since: 2.26
16594  */
16595
16596
16597 /**
16598  * g_dbus_proxy_get_flags:
16599  * @proxy: A #GDBusProxy.
16600  *
16601  * Gets the flags that @proxy was constructed with.
16602  *
16603  * Returns: Flags from the #GDBusProxyFlags enumeration.
16604  * Since: 2.26
16605  */
16606
16607
16608 /**
16609  * g_dbus_proxy_get_interface_info:
16610  * @proxy: A #GDBusProxy
16611  *
16612  * Returns the #GDBusInterfaceInfo, if any, specifying the interface
16613  * that @proxy conforms to. See the #GDBusProxy:g-interface-info
16614  * property for more details.
16615  *
16616  * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
16617  * Since: 2.26
16618  */
16619
16620
16621 /**
16622  * g_dbus_proxy_get_interface_name:
16623  * @proxy: A #GDBusProxy.
16624  *
16625  * Gets the D-Bus interface name @proxy is for.
16626  *
16627  * Returns: A string owned by @proxy. Do not free.
16628  * Since: 2.26
16629  */
16630
16631
16632 /**
16633  * g_dbus_proxy_get_name:
16634  * @proxy: A #GDBusProxy.
16635  *
16636  * Gets the name that @proxy was constructed for.
16637  *
16638  * Returns: A string owned by @proxy. Do not free.
16639  * Since: 2.26
16640  */
16641
16642
16643 /**
16644  * g_dbus_proxy_get_name_owner:
16645  * @proxy: A #GDBusProxy.
16646  *
16647  * The unique name that owns the name that @proxy is for or %NULL if
16648  * no-one currently owns that name. You may connect to the
16649  * #GObject::notify signal to track changes to the
16650  * #GDBusProxy:g-name-owner property.
16651  *
16652  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
16653  * Since: 2.26
16654  */
16655
16656
16657 /**
16658  * g_dbus_proxy_get_object_path:
16659  * @proxy: A #GDBusProxy.
16660  *
16661  * Gets the object path @proxy is for.
16662  *
16663  * Returns: A string owned by @proxy. Do not free.
16664  * Since: 2.26
16665  */
16666
16667
16668 /**
16669  * g_dbus_proxy_new:
16670  * @connection: A #GDBusConnection.
16671  * @flags: Flags used when constructing the proxy.
16672  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16673  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16674  * @object_path: An object path.
16675  * @interface_name: A D-Bus interface name.
16676  * @cancellable: (allow-none): A #GCancellable or %NULL.
16677  * @callback: Callback function to invoke when the proxy is ready.
16678  * @user_data: User data to pass to @callback.
16679  *
16680  * Creates a proxy for accessing @interface_name on the remote object
16681  * at @object_path owned by @name at @connection and asynchronously
16682  * loads D-Bus properties unless the
16683  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16684  * the #GDBusProxy::g-properties-changed signal to get notified about
16685  * property changes.
16686  *
16687  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16688  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16689  * to handle signals from the remote object.
16690  *
16691  * If @name is a well-known name and the
16692  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16693  * owner currently exists, the message bus will be requested to launch
16694  * a name owner for the name.
16695  *
16696  * This is a failable asynchronous constructor - when the proxy is
16697  * ready, @callback will be invoked and you can use
16698  * g_dbus_proxy_new_finish() to get the result.
16699  *
16700  * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16701  *
16702  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16703  *
16704  * Since: 2.26
16705  */
16706
16707
16708 /**
16709  * g_dbus_proxy_new_finish:
16710  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16711  * @error: Return location for error or %NULL.
16712  *
16713  * Finishes creating a #GDBusProxy.
16714  *
16715  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16716  * Since: 2.26
16717  */
16718
16719
16720 /**
16721  * g_dbus_proxy_new_for_bus:
16722  * @bus_type: A #GBusType.
16723  * @flags: Flags used when constructing the proxy.
16724  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16725  * @name: A bus name (well-known or unique).
16726  * @object_path: An object path.
16727  * @interface_name: A D-Bus interface name.
16728  * @cancellable: (allow-none): A #GCancellable or %NULL.
16729  * @callback: Callback function to invoke when the proxy is ready.
16730  * @user_data: User data to pass to @callback.
16731  *
16732  * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16733  *
16734  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16735  *
16736  * Since: 2.26
16737  */
16738
16739
16740 /**
16741  * g_dbus_proxy_new_for_bus_finish:
16742  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16743  * @error: Return location for error or %NULL.
16744  *
16745  * Finishes creating a #GDBusProxy.
16746  *
16747  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16748  * Since: 2.26
16749  */
16750
16751
16752 /**
16753  * g_dbus_proxy_new_for_bus_sync:
16754  * @bus_type: A #GBusType.
16755  * @flags: Flags used when constructing the proxy.
16756  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16757  * @name: A bus name (well-known or unique).
16758  * @object_path: An object path.
16759  * @interface_name: A D-Bus interface name.
16760  * @cancellable: (allow-none): A #GCancellable or %NULL.
16761  * @error: Return location for error or %NULL.
16762  *
16763  * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16764  *
16765  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16766  *
16767  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16768  * Since: 2.26
16769  */
16770
16771
16772 /**
16773  * g_dbus_proxy_new_sync:
16774  * @connection: A #GDBusConnection.
16775  * @flags: Flags used when constructing the proxy.
16776  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16777  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16778  * @object_path: An object path.
16779  * @interface_name: A D-Bus interface name.
16780  * @cancellable: (allow-none): A #GCancellable or %NULL.
16781  * @error: (allow-none): Return location for error or %NULL.
16782  *
16783  * Creates a proxy for accessing @interface_name on the remote object
16784  * at @object_path owned by @name at @connection and synchronously
16785  * loads D-Bus properties unless the
16786  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16787  *
16788  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16789  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16790  * to handle signals from the remote object.
16791  *
16792  * If @name is a well-known name and the
16793  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16794  * owner currently exists, the message bus will be requested to launch
16795  * a name owner for the name.
16796  *
16797  * This is a synchronous failable constructor. See g_dbus_proxy_new()
16798  * and g_dbus_proxy_new_finish() for the asynchronous version.
16799  *
16800  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16801  *
16802  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16803  * Since: 2.26
16804  */
16805
16806
16807 /**
16808  * g_dbus_proxy_set_cached_property:
16809  * @proxy: A #GDBusProxy
16810  * @property_name: Property name.
16811  * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16812  *
16813  * If @value is not %NULL, sets the cached value for the property with
16814  * name @property_name to the value in @value.
16815  *
16816  * If @value is %NULL, then the cached value is removed from the
16817  * property cache.
16818  *
16819  * If @proxy has an expected interface (see
16820  * #GDBusProxy:g-interface-info) and @property_name is referenced by
16821  * it, then @value is checked against the type of the property.
16822  *
16823  * If the @value #GVariant is floating, it is consumed. This allows
16824  * convenient 'inline' use of g_variant_new(), e.g.
16825  * |[
16826  *  g_dbus_proxy_set_cached_property (proxy,
16827  *                                    "SomeProperty",
16828  *                                    g_variant_new ("(si)",
16829  *                                                  "A String",
16830  *                                                  42));
16831  * ]|
16832  *
16833  * Normally you will not need to use this method since @proxy is
16834  * tracking changes using the
16835  * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16836  * D-Bus signal. However, for performance reasons an object may decide
16837  * to not use this signal for some properties and instead use a
16838  * proprietary out-of-band mechanism to transmit changes.
16839  *
16840  * As a concrete example, consider an object with a property
16841  * <literal>ChatroomParticipants</literal> which is an array of
16842  * strings. Instead of transmitting the same (long) array every time
16843  * the property changes, it is more efficient to only transmit the
16844  * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16845  * name)</literal> and <literal>ChatroomParticipantParted(String
16846  * name)</literal>.
16847  *
16848  * Since: 2.26
16849  */
16850
16851
16852 /**
16853  * g_dbus_proxy_set_default_timeout:
16854  * @proxy: A #GDBusProxy.
16855  * @timeout_msec: Timeout in milliseconds.
16856  *
16857  * Sets the timeout to use if -1 (specifying default timeout) is
16858  * passed as @timeout_msec in the g_dbus_proxy_call() and
16859  * g_dbus_proxy_call_sync() functions.
16860  *
16861  * See the #GDBusProxy:g-default-timeout property for more details.
16862  *
16863  * Since: 2.26
16864  */
16865
16866
16867 /**
16868  * g_dbus_proxy_set_interface_info:
16869  * @proxy: A #GDBusProxy
16870  * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16871  *
16872  * Ensure that interactions with @proxy conform to the given
16873  * interface. See the #GDBusProxy:g-interface-info property for more
16874  * details.
16875  *
16876  * Since: 2.26
16877  */
16878
16879
16880 /**
16881  * g_dbus_server_get_client_address:
16882  * @server: A #GDBusServer.
16883  *
16884  * Gets a D-Bus address string that can be used by clients to connect
16885  * to @server.
16886  *
16887  * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16888  * Since: 2.26
16889  */
16890
16891
16892 /**
16893  * g_dbus_server_get_flags:
16894  * @server: A #GDBusServer.
16895  *
16896  * Gets the flags for @server.
16897  *
16898  * Returns: A set of flags from the #GDBusServerFlags enumeration.
16899  * Since: 2.26
16900  */
16901
16902
16903 /**
16904  * g_dbus_server_get_guid:
16905  * @server: A #GDBusServer.
16906  *
16907  * Gets the GUID for @server.
16908  *
16909  * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16910  * Since: 2.26
16911  */
16912
16913
16914 /**
16915  * g_dbus_server_is_active:
16916  * @server: A #GDBusServer.
16917  *
16918  * Gets whether @server is active.
16919  *
16920  * Returns: %TRUE if server is active, %FALSE otherwise.
16921  * Since: 2.26
16922  */
16923
16924
16925 /**
16926  * g_dbus_server_new_sync:
16927  * @address: A D-Bus address.
16928  * @flags: Flags from the #GDBusServerFlags enumeration.
16929  * @guid: A D-Bus GUID.
16930  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16931  * @cancellable: (allow-none): A #GCancellable or %NULL.
16932  * @error: Return location for server or %NULL.
16933  *
16934  * Creates a new D-Bus server that listens on the first address in
16935  * @address that works.
16936  *
16937  * Once constructed, you can use g_dbus_server_get_client_address() to
16938  * get a D-Bus address string that clients can use to connect.
16939  *
16940  * Connect to the #GDBusServer::new-connection signal to handle
16941  * incoming connections.
16942  *
16943  * The returned #GDBusServer isn't active - you have to start it with
16944  * g_dbus_server_start().
16945  *
16946  * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16947  * be used.
16948  *
16949  * This is a synchronous failable constructor. See
16950  * g_dbus_server_new() for the asynchronous version.
16951  *
16952  * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16953  * Since: 2.26
16954  */
16955
16956
16957 /**
16958  * g_dbus_server_start:
16959  * @server: A #GDBusServer.
16960  *
16961  * Starts @server.
16962  *
16963  * Since: 2.26
16964  */
16965
16966
16967 /**
16968  * g_dbus_server_stop:
16969  * @server: A #GDBusServer.
16970  *
16971  * Stops @server.
16972  *
16973  * Since: 2.26
16974  */
16975
16976
16977 /**
16978  * g_dbus_signal_info_ref:
16979  * @info: A #GDBusSignalInfo
16980  *
16981  * If @info is statically allocated does nothing. Otherwise increases
16982  * the reference count.
16983  *
16984  * Returns: The same @info.
16985  * Since: 2.26
16986  */
16987
16988
16989 /**
16990  * g_dbus_signal_info_unref:
16991  * @info: A #GDBusSignalInfo.
16992  *
16993  * If @info is statically allocated, does nothing. Otherwise decreases
16994  * the reference count of @info. When its reference count drops to 0,
16995  * the memory used is freed.
16996  *
16997  * Since: 2.26
16998  */
16999
17000
17001 /**
17002  * g_desktop_app_info_get_categories:
17003  * @info: a #GDesktopAppInfo
17004  *
17005  * Gets the categories from the desktop file.
17006  *
17007  * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
17008  */
17009
17010
17011 /**
17012  * g_desktop_app_info_get_filename:
17013  * @info: a #GDesktopAppInfo
17014  *
17015  * When @info was created from a known filename, return it.  In some
17016  * situations such as the #GDesktopAppInfo returned from
17017  * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
17018  *
17019  * Returns: The full path to the file for @info, or %NULL if not known.
17020  * Since: 2.24
17021  */
17022
17023
17024 /**
17025  * g_desktop_app_info_get_generic_name:
17026  * @info: a #GDesktopAppInfo
17027  *
17028  * Gets the generic name from the destkop file.
17029  *
17030  * Returns: The value of the GenericName key
17031  */
17032
17033
17034 /**
17035  * g_desktop_app_info_get_is_hidden:
17036  * @info: a #GDesktopAppInfo.
17037  *
17038  * A desktop file is hidden if the Hidden key in it is
17039  * set to True.
17040  *
17041  * Returns: %TRUE if hidden, %FALSE otherwise.
17042  */
17043
17044
17045 /**
17046  * g_desktop_app_info_get_keywords:
17047  * @info: a #GDesktopAppInfo
17048  *
17049  * Gets the keywords from the desktop file.
17050  *
17051  * Returns: (transfer none): The value of the Keywords key
17052  * Since: 2.32
17053  */
17054
17055
17056 /**
17057  * g_desktop_app_info_get_nodisplay:
17058  * @info: a #GDesktopAppInfo
17059  *
17060  * Gets the value of the NoDisplay key, which helps determine if the
17061  * application info should be shown in menus. See
17062  * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
17063  *
17064  * Returns: The value of the NoDisplay key
17065  * Since: 2.30
17066  */
17067
17068
17069 /**
17070  * g_desktop_app_info_get_show_in:
17071  * @info: a #GDesktopAppInfo
17072  * @desktop_env: a string specifying a desktop name
17073  *
17074  * Checks if the application info should be shown in menus that list available
17075  * applications for a specific name of the desktop, based on the
17076  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
17077  *
17078  * If @desktop_env is %NULL, then the name of the desktop set with
17079  * g_desktop_app_info_set_desktop_env() is used.
17080  *
17081  * Note that g_app_info_should_show() for @info will include this check (with
17082  * %NULL for @desktop_env) as well as additional checks.
17083  *
17084  * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
17085  * Since: 2.30
17086  */
17087
17088
17089 /**
17090  * g_desktop_app_info_get_startup_wm_class:
17091  * @info: a #GDesktopAppInfo that supports startup notify
17092  *
17093  * Retrieves the StartupWMClass field from @info. This represents the
17094  * WM_CLASS property of the main window of the application, if launched
17095  * through @info.
17096  *
17097  * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
17098  * Since: 2.34
17099  */
17100
17101
17102 /**
17103  * g_desktop_app_info_launch_uris_as_manager:
17104  * @appinfo: a #GDesktopAppInfo
17105  * @uris: (element-type utf8): List of URIs
17106  * @launch_context: a #GAppLaunchContext
17107  * @spawn_flags: #GSpawnFlags, used for each process
17108  * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
17109  * @user_setup_data: (closure user_setup): User data for @user_setup
17110  * @pid_callback: (scope call): Callback for child processes
17111  * @pid_callback_data: (closure pid_callback): User data for @callback
17112  * @error: return location for a #GError, or %NULL
17113  *
17114  * This function performs the equivalent of g_app_info_launch_uris(),
17115  * but is intended primarily for operating system components that
17116  * launch applications.  Ordinary applications should use
17117  * g_app_info_launch_uris().
17118  *
17119  * In contrast to g_app_info_launch_uris(), all processes created will
17120  * always be run directly as children as if by the UNIX fork()/exec()
17121  * calls.
17122  *
17123  * This guarantee allows additional control over the exact environment
17124  * of the child processes, which is provided via a setup function
17125  * @user_setup, as well as the process identifier of each child process
17126  * via @pid_callback. See g_spawn_async() for more information about the
17127  * semantics of the @user_setup function.
17128  *
17129  * Returns: %TRUE on successful launch, %FALSE otherwise.
17130  */
17131
17132
17133 /**
17134  * g_desktop_app_info_lookup_get_default_for_uri_scheme:
17135  * @lookup: a #GDesktopAppInfoLookup
17136  * @uri_scheme: a string containing a URI scheme.
17137  *
17138  * Gets the default application for launching applications
17139  * using this URI scheme for a particular GDesktopAppInfoLookup
17140  * implementation.
17141  *
17142  * The GDesktopAppInfoLookup interface and this function is used
17143  * to implement g_app_info_get_default_for_uri_scheme() backends
17144  * in a GIO module. There is no reason for applications to use it
17145  * directly. Applications should use g_app_info_get_default_for_uri_scheme().
17146  *
17147  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
17148  * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
17149  */
17150
17151
17152 /**
17153  * g_desktop_app_info_new:
17154  * @desktop_id: the desktop file id
17155  *
17156  * Creates a new #GDesktopAppInfo based on a desktop file id.
17157  *
17158  * A desktop file id is the basename of the desktop file, including the
17159  * .desktop extension. GIO is looking for a desktop file with this name
17160  * in the <filename>applications</filename> subdirectories of the XDG data
17161  * directories (i.e. the directories specified in the
17162  * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
17163  * variables). GIO also supports the prefix-to-subdirectory mapping that is
17164  * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
17165  * (i.e. a desktop id of kde-foo.desktop will match
17166  * <filename>/usr/share/applications/kde/foo.desktop</filename>).
17167  *
17168  * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
17169  */
17170
17171
17172 /**
17173  * g_desktop_app_info_new_from_filename:
17174  * @filename: the path of a desktop file, in the GLib filename encoding
17175  *
17176  * Creates a new #GDesktopAppInfo.
17177  *
17178  * Returns: a new #GDesktopAppInfo or %NULL on error.
17179  */
17180
17181
17182 /**
17183  * g_desktop_app_info_new_from_keyfile:
17184  * @key_file: an opened #GKeyFile
17185  *
17186  * Creates a new #GDesktopAppInfo.
17187  *
17188  * Returns: a new #GDesktopAppInfo or %NULL on error.
17189  * Since: 2.18
17190  */
17191
17192
17193 /**
17194  * g_desktop_app_info_set_desktop_env:
17195  * @desktop_env: a string specifying what desktop this is
17196  *
17197  * Sets the name of the desktop that the application is running in.
17198  * This is used by g_app_info_should_show() and
17199  * g_desktop_app_info_get_show_in() to evaluate the
17200  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
17201  * desktop entry fields.
17202  *
17203  * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
17204  * Menu specification</ulink> recognizes the following:
17205  * <simplelist>
17206  *   <member>GNOME</member>
17207  *   <member>KDE</member>
17208  *   <member>ROX</member>
17209  *   <member>XFCE</member>
17210  *   <member>LXDE</member>
17211  *   <member>Unity</member>
17212  *   <member>Old</member>
17213  * </simplelist>
17214  *
17215  * Should be called only once; subsequent calls are ignored.
17216  */
17217
17218
17219 /**
17220  * g_drive_can_eject:
17221  * @drive: a #GDrive.
17222  *
17223  * Checks if a drive can be ejected.
17224  *
17225  * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
17226  */
17227
17228
17229 /**
17230  * g_drive_can_poll_for_media:
17231  * @drive: a #GDrive.
17232  *
17233  * Checks if a drive can be polled for media changes.
17234  *
17235  * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
17236  */
17237
17238
17239 /**
17240  * g_drive_can_start:
17241  * @drive: a #GDrive.
17242  *
17243  * Checks if a drive can be started.
17244  *
17245  * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
17246  * Since: 2.22
17247  */
17248
17249
17250 /**
17251  * g_drive_can_start_degraded:
17252  * @drive: a #GDrive.
17253  *
17254  * Checks if a drive can be started degraded.
17255  *
17256  * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
17257  * Since: 2.22
17258  */
17259
17260
17261 /**
17262  * g_drive_can_stop:
17263  * @drive: a #GDrive.
17264  *
17265  * Checks if a drive can be stopped.
17266  *
17267  * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
17268  * Since: 2.22
17269  */
17270
17271
17272 /**
17273  * g_drive_eject:
17274  * @drive: a #GDrive.
17275  * @flags: flags affecting the unmount if required for eject
17276  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17277  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17278  * @user_data: user data to pass to @callback
17279  *
17280  * Asynchronously ejects a drive.
17281  *
17282  * When the operation is finished, @callback will be called.
17283  * You can then call g_drive_eject_finish() to obtain the
17284  * result of the operation.
17285  *
17286  * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
17287  */
17288
17289
17290 /**
17291  * g_drive_eject_finish:
17292  * @drive: a #GDrive.
17293  * @result: a #GAsyncResult.
17294  * @error: a #GError, or %NULL
17295  *
17296  * Finishes ejecting a drive.
17297  *
17298  * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
17299  * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
17300  */
17301
17302
17303 /**
17304  * g_drive_eject_with_operation:
17305  * @drive: a #GDrive.
17306  * @flags: flags affecting the unmount if required for eject
17307  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17308  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17309  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17310  * @user_data: user data passed to @callback.
17311  *
17312  * Ejects a drive. This is an asynchronous operation, and is
17313  * finished by calling g_drive_eject_with_operation_finish() with the @drive
17314  * and #GAsyncResult data returned in the @callback.
17315  *
17316  * Since: 2.22
17317  */
17318
17319
17320 /**
17321  * g_drive_eject_with_operation_finish:
17322  * @drive: a #GDrive.
17323  * @result: a #GAsyncResult.
17324  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17325  *
17326  * Finishes ejecting a drive. If any errors occurred during the operation,
17327  * @error will be set to contain the errors and %FALSE will be returned.
17328  *
17329  * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
17330  * Since: 2.22
17331  */
17332
17333
17334 /**
17335  * g_drive_enumerate_identifiers:
17336  * @drive: a #GDrive
17337  *
17338  * Gets the kinds of identifiers that @drive has.
17339  * Use g_drive_get_identifier() to obtain the identifiers
17340  * themselves.
17341  *
17342  * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
17343  */
17344
17345
17346 /**
17347  * g_drive_get_icon:
17348  * @drive: a #GDrive.
17349  *
17350  * Gets the icon for @drive.
17351  *
17352  * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
17353  */
17354
17355
17356 /**
17357  * g_drive_get_identifier:
17358  * @drive: a #GDrive
17359  * @kind: the kind of identifier to return
17360  *
17361  * Gets the identifier of the given kind for @drive.
17362  *
17363  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
17364  */
17365
17366
17367 /**
17368  * g_drive_get_name:
17369  * @drive: a #GDrive.
17370  *
17371  * Gets the name of @drive.
17372  *
17373  * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
17374  */
17375
17376
17377 /**
17378  * g_drive_get_sort_key:
17379  * @drive: A #GDrive.
17380  *
17381  * Gets the sort key for @drive, if any.
17382  *
17383  * Returns: Sorting key for @drive or %NULL if no such key is available.
17384  * Since: 2.32
17385  */
17386
17387
17388 /**
17389  * g_drive_get_start_stop_type:
17390  * @drive: a #GDrive.
17391  *
17392  * Gets a hint about how a drive can be started/stopped.
17393  *
17394  * Returns: A value from the #GDriveStartStopType enumeration.
17395  * Since: 2.22
17396  */
17397
17398
17399 /**
17400  * g_drive_get_symbolic_icon:
17401  * @drive: a #GDrive.
17402  *
17403  * Gets the icon for @drive.
17404  *
17405  * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
17406  * Since: 2.34
17407  */
17408
17409
17410 /**
17411  * g_drive_get_volumes:
17412  * @drive: a #GDrive.
17413  *
17414  * Get a list of mountable volumes for @drive.
17415  *
17416  * The returned list should be freed with g_list_free(), after
17417  * its elements have been unreffed with g_object_unref().
17418  *
17419  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
17420  */
17421
17422
17423 /**
17424  * g_drive_has_media:
17425  * @drive: a #GDrive.
17426  *
17427  * Checks if the @drive has media. Note that the OS may not be polling
17428  * the drive for media changes; see g_drive_is_media_check_automatic()
17429  * for more details.
17430  *
17431  * Returns: %TRUE if @drive has media, %FALSE otherwise.
17432  */
17433
17434
17435 /**
17436  * g_drive_has_volumes:
17437  * @drive: a #GDrive.
17438  *
17439  * Check if @drive has any mountable volumes.
17440  *
17441  * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
17442  */
17443
17444
17445 /**
17446  * g_drive_is_media_check_automatic:
17447  * @drive: a #GDrive.
17448  *
17449  * Checks if @drive is capabable of automatically detecting media changes.
17450  *
17451  * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
17452  */
17453
17454
17455 /**
17456  * g_drive_is_media_removable:
17457  * @drive: a #GDrive.
17458  *
17459  * Checks if the @drive supports removable media.
17460  *
17461  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
17462  */
17463
17464
17465 /**
17466  * g_drive_poll_for_media:
17467  * @drive: a #GDrive.
17468  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17469  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17470  * @user_data: user data to pass to @callback
17471  *
17472  * Asynchronously polls @drive to see if media has been inserted or removed.
17473  *
17474  * When the operation is finished, @callback will be called.
17475  * You can then call g_drive_poll_for_media_finish() to obtain the
17476  * result of the operation.
17477  */
17478
17479
17480 /**
17481  * g_drive_poll_for_media_finish:
17482  * @drive: a #GDrive.
17483  * @result: a #GAsyncResult.
17484  * @error: a #GError, or %NULL
17485  *
17486  * Finishes an operation started with g_drive_poll_for_media() on a drive.
17487  *
17488  * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
17489  */
17490
17491
17492 /**
17493  * g_drive_start:
17494  * @drive: a #GDrive.
17495  * @flags: flags affecting the start operation.
17496  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17497  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17498  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17499  * @user_data: user data to pass to @callback
17500  *
17501  * Asynchronously starts a drive.
17502  *
17503  * When the operation is finished, @callback will be called.
17504  * You can then call g_drive_start_finish() to obtain the
17505  * result of the operation.
17506  *
17507  * Since: 2.22
17508  */
17509
17510
17511 /**
17512  * g_drive_start_finish:
17513  * @drive: a #GDrive.
17514  * @result: a #GAsyncResult.
17515  * @error: a #GError, or %NULL
17516  *
17517  * Finishes starting a drive.
17518  *
17519  * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
17520  * Since: 2.22
17521  */
17522
17523
17524 /**
17525  * g_drive_stop:
17526  * @drive: a #GDrive.
17527  * @flags: flags affecting the unmount if required for stopping.
17528  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17529  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17530  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17531  * @user_data: user data to pass to @callback
17532  *
17533  * Asynchronously stops a drive.
17534  *
17535  * When the operation is finished, @callback will be called.
17536  * You can then call g_drive_stop_finish() to obtain the
17537  * result of the operation.
17538  *
17539  * Since: 2.22
17540  */
17541
17542
17543 /**
17544  * g_drive_stop_finish:
17545  * @drive: a #GDrive.
17546  * @result: a #GAsyncResult.
17547  * @error: a #GError, or %NULL
17548  *
17549  * Finishes stopping a drive.
17550  *
17551  * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
17552  * Since: 2.22
17553  */
17554
17555
17556 /**
17557  * g_emblem_get_icon:
17558  * @emblem: a #GEmblem from which the icon should be extracted.
17559  *
17560  * Gives back the icon from @emblem.
17561  *
17562  * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
17563  * Since: 2.18
17564  */
17565
17566
17567 /**
17568  * g_emblem_get_origin:
17569  * @emblem: a #GEmblem
17570  *
17571  * Gets the origin of the emblem.
17572  *
17573  * Returns: (transfer none): the origin of the emblem
17574  * Since: 2.18
17575  */
17576
17577
17578 /**
17579  * g_emblem_new:
17580  * @icon: a GIcon containing the icon.
17581  *
17582  * Creates a new emblem for @icon.
17583  *
17584  * Returns: a new #GEmblem.
17585  * Since: 2.18
17586  */
17587
17588
17589 /**
17590  * g_emblem_new_with_origin:
17591  * @icon: a GIcon containing the icon.
17592  * @origin: a GEmblemOrigin enum defining the emblem's origin
17593  *
17594  * Creates a new emblem for @icon.
17595  *
17596  * Returns: a new #GEmblem.
17597  * Since: 2.18
17598  */
17599
17600
17601 /**
17602  * g_emblemed_icon_add_emblem:
17603  * @emblemed: a #GEmblemedIcon
17604  * @emblem: a #GEmblem
17605  *
17606  * Adds @emblem to the #GList of #GEmblem <!-- -->s.
17607  *
17608  * Since: 2.18
17609  */
17610
17611
17612 /**
17613  * g_emblemed_icon_clear_emblems:
17614  * @emblemed: a #GEmblemedIcon
17615  *
17616  * Removes all the emblems from @icon.
17617  *
17618  * Since: 2.28
17619  */
17620
17621
17622 /**
17623  * g_emblemed_icon_get_emblems:
17624  * @emblemed: a #GEmblemedIcon
17625  *
17626  * Gets the list of emblems for the @icon.
17627  *
17628  * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
17629  * Since: 2.18
17630  */
17631
17632
17633 /**
17634  * g_emblemed_icon_get_icon:
17635  * @emblemed: a #GEmblemedIcon
17636  *
17637  * Gets the main icon for @emblemed.
17638  *
17639  * Returns: (transfer none): a #GIcon that is owned by @emblemed
17640  * Since: 2.18
17641  */
17642
17643
17644 /**
17645  * g_emblemed_icon_new:
17646  * @icon: a #GIcon
17647  * @emblem: (allow-none): a #GEmblem, or %NULL
17648  *
17649  * Creates a new emblemed icon for @icon with the emblem @emblem.
17650  *
17651  * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
17652  * Since: 2.18
17653  */
17654
17655
17656 /**
17657  * g_file_append_to:
17658  * @file: input #GFile
17659  * @flags: a set of #GFileCreateFlags
17660  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17661  * @error: a #GError, or %NULL
17662  *
17663  * Gets an output stream for appending data to the file.
17664  * If the file doesn't already exist it is created.
17665  *
17666  * By default files created are generally readable by everyone,
17667  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17668  * will be made readable only to the current user, to the level that
17669  * is supported on the target filesystem.
17670  *
17671  * If @cancellable is not %NULL, then the operation can be cancelled
17672  * by triggering the cancellable object from another thread. If the
17673  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17674  * returned.
17675  *
17676  * Some file systems don't allow all file names, and may return an
17677  * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17678  * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17679  * possible too, and depend on what kind of filesystem the file is on.
17680  *
17681  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17682  */
17683
17684
17685 /**
17686  * g_file_append_to_async:
17687  * @file: input #GFile
17688  * @flags: a set of #GFileCreateFlags
17689  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17690  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17691  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17692  * @user_data: (closure): the data to pass to callback function
17693  *
17694  * Asynchronously opens @file for appending.
17695  *
17696  * For more details, see g_file_append_to() which is
17697  * the synchronous version of this call.
17698  *
17699  * When the operation is finished, @callback will be called.
17700  * You can then call g_file_append_to_finish() to get the result
17701  * of the operation.
17702  */
17703
17704
17705 /**
17706  * g_file_append_to_finish:
17707  * @file: input #GFile
17708  * @res: #GAsyncResult
17709  * @error: a #GError, or %NULL
17710  *
17711  * Finishes an asynchronous file append operation started with
17712  * g_file_append_to_async().
17713  *
17714  * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17715  */
17716
17717
17718 /**
17719  * g_file_attribute_info_list_add:
17720  * @list: a #GFileAttributeInfoList.
17721  * @name: the name of the attribute to add.
17722  * @type: the #GFileAttributeType for the attribute.
17723  * @flags: #GFileAttributeInfoFlags for the attribute.
17724  *
17725  * Adds a new attribute with @name to the @list, setting
17726  * its @type and @flags.
17727  */
17728
17729
17730 /**
17731  * g_file_attribute_info_list_dup:
17732  * @list: a #GFileAttributeInfoList to duplicate.
17733  *
17734  * Makes a duplicate of a file attribute info list.
17735  *
17736  * Returns: a copy of the given @list.
17737  */
17738
17739
17740 /**
17741  * g_file_attribute_info_list_lookup:
17742  * @list: a #GFileAttributeInfoList.
17743  * @name: the name of the attribute to lookup.
17744  *
17745  * Gets the file attribute with the name @name from @list.
17746  *
17747  * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17748  */
17749
17750
17751 /**
17752  * g_file_attribute_info_list_new:
17753  *
17754  * Creates a new file attribute info list.
17755  *
17756  * Returns: a #GFileAttributeInfoList.
17757  */
17758
17759
17760 /**
17761  * g_file_attribute_info_list_ref:
17762  * @list: a #GFileAttributeInfoList to reference.
17763  *
17764  * References a file attribute info list.
17765  *
17766  * Returns: #GFileAttributeInfoList or %NULL on error.
17767  */
17768
17769
17770 /**
17771  * g_file_attribute_info_list_unref:
17772  * @list: The #GFileAttributeInfoList to unreference.
17773  *
17774  * Removes a reference from the given @list. If the reference count
17775  * falls to zero, the @list is deleted.
17776  */
17777
17778
17779 /**
17780  * g_file_attribute_matcher_enumerate_namespace:
17781  * @matcher: a #GFileAttributeMatcher.
17782  * @ns: a string containing a file attribute namespace.
17783  *
17784  * Checks if the matcher will match all of the keys in a given namespace.
17785  * This will always return %TRUE if a wildcard character is in use (e.g. if
17786  * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17787  * using "*" and namespace is anything.)
17788  *
17789  * TODO: this is awkwardly worded.
17790  *
17791  * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17792  */
17793
17794
17795 /**
17796  * g_file_attribute_matcher_enumerate_next:
17797  * @matcher: a #GFileAttributeMatcher.
17798  *
17799  * Gets the next matched attribute from a #GFileAttributeMatcher.
17800  *
17801  * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17802  */
17803
17804
17805 /**
17806  * g_file_attribute_matcher_matches:
17807  * @matcher: a #GFileAttributeMatcher.
17808  * @attribute: a file attribute key.
17809  *
17810  * Checks if an attribute will be matched by an attribute matcher. If
17811  * the matcher was created with the "*" matching string, this function
17812  * will always return %TRUE.
17813  *
17814  * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17815  */
17816
17817
17818 /**
17819  * g_file_attribute_matcher_matches_only:
17820  * @matcher: a #GFileAttributeMatcher.
17821  * @attribute: a file attribute key.
17822  *
17823  * Checks if a attribute matcher only matches a given attribute. Always
17824  * returns %FALSE if "*" was used when creating the matcher.
17825  *
17826  * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17827  */
17828
17829
17830 /**
17831  * g_file_attribute_matcher_new:
17832  * @attributes: an attribute string to match.
17833  *
17834  * Creates a new file attribute matcher, which matches attributes
17835  * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17836  * counted structures, and are created with a reference count of 1. If
17837  * the number of references falls to 0, the #GFileAttributeMatcher is
17838  * automatically destroyed.
17839  *
17840  * The @attribute string should be formatted with specific keys separated
17841  * from namespaces with a double colon. Several "namespace::key" strings may be
17842  * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17843  * The wildcard "*" may be used to match all keys and namespaces, or
17844  * "namespace::*" will match all keys in a given namespace.
17845  *
17846  * Examples of strings to use:
17847  * <table>
17848  * <title>File Attribute Matcher strings and results</title>
17849  * <tgroup cols='2' align='left'><thead>
17850  * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17851  * <tbody>
17852  * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17853  * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17854  * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17855  * all keys in the unix namespace.</entry></row>
17856  * </tbody></tgroup>
17857  * </table>
17858  *
17859  * Returns: a #GFileAttributeMatcher.
17860  */
17861
17862
17863 /**
17864  * g_file_attribute_matcher_ref:
17865  * @matcher: a #GFileAttributeMatcher.
17866  *
17867  * References a file attribute matcher.
17868  *
17869  * Returns: a #GFileAttributeMatcher.
17870  */
17871
17872
17873 /**
17874  * g_file_attribute_matcher_subtract:
17875  * @matcher: Matcher to subtract from
17876  * @subtract: The matcher to subtract
17877  *
17878  * Subtracts all attributes of @subtract from @matcher and returns
17879  * a matcher that supports those attributes.
17880  *
17881  * Note that currently it is not possible to remove a single
17882  * attribute when the @matcher matches the whole namespace - or remove
17883  * a namespace or attribute when the matcher matches everything. This
17884  * is a limitation of the current implementation, but may be fixed
17885  * in the future.
17886  *
17887  * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17888  */
17889
17890
17891 /**
17892  * g_file_attribute_matcher_to_string:
17893  * @matcher: (allow-none): a #GFileAttributeMatcher.
17894  *
17895  * Prints what the matcher is matching against. The format will be
17896  * equal to the format passed to g_file_attribute_matcher_new().
17897  * The output however, might not be identical, as the matcher may
17898  * decide to use a different order or omit needless parts.
17899  *
17900  * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17901  * Since: 2.32
17902  */
17903
17904
17905 /**
17906  * g_file_attribute_matcher_unref:
17907  * @matcher: a #GFileAttributeMatcher.
17908  *
17909  * Unreferences @matcher. If the reference count falls below 1,
17910  * the @matcher is automatically freed.
17911  */
17912
17913
17914 /**
17915  * g_file_copy:
17916  * @source: input #GFile
17917  * @destination: destination #GFile
17918  * @flags: set of #GFileCopyFlags
17919  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17920  * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17921  * @progress_callback_data: (closure): user data to pass to @progress_callback
17922  * @error: #GError to set on error, or %NULL
17923  *
17924  * Copies the file @source to the location specified by @destination.
17925  * Can not handle recursive copies of directories.
17926  *
17927  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17928  * existing @destination file is overwritten.
17929  *
17930  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17931  * will be copied as symlinks, otherwise the target of the
17932  * @source symlink will be copied.
17933  *
17934  * If @cancellable is not %NULL, then the operation can be cancelled by
17935  * triggering the cancellable object from another thread. If the operation
17936  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17937  *
17938  * If @progress_callback is not %NULL, then the operation can be monitored
17939  * by setting this to a #GFileProgressCallback function.
17940  * @progress_callback_data will be passed to this function. It is guaranteed
17941  * that this callback will be called after all data has been transferred with
17942  * the total number of bytes copied during the operation.
17943  *
17944  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17945  * is returned, independent on the status of the @destination.
17946  *
17947  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17948  * the error %G_IO_ERROR_EXISTS is returned.
17949  *
17950  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17951  * error is returned. If trying to overwrite a directory with a directory the
17952  * %G_IO_ERROR_WOULD_MERGE error is returned.
17953  *
17954  * If the source is a directory and the target does not exist, or
17955  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17956  * %G_IO_ERROR_WOULD_RECURSE error is returned.
17957  *
17958  * If you are interested in copying the #GFile object itself (not the on-disk
17959  * file), see g_file_dup().
17960  *
17961  * Returns: %TRUE on success, %FALSE otherwise.
17962  */
17963
17964
17965 /**
17966  * g_file_copy_async: (skip)
17967  * @source: input #GFile
17968  * @destination: destination #GFile
17969  * @flags: set of #GFileCopyFlags
17970  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17971  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17972  * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17973  * @progress_callback_data: (closure): user data to pass to @progress_callback
17974  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17975  * @user_data: the data to pass to callback function
17976  *
17977  * Copies the file @source to the location specified by @destination
17978  * asynchronously. For details of the behaviour, see g_file_copy().
17979  *
17980  * If @progress_callback is not %NULL, then that function that will be called
17981  * just like in g_file_copy(), however the callback will run in the main loop,
17982  * not in the thread that is doing the I/O operation.
17983  *
17984  * When the operation is finished, @callback will be called. You can then call
17985  * g_file_copy_finish() to get the result of the operation.
17986  */
17987
17988
17989 /**
17990  * g_file_copy_attributes:
17991  * @source: a #GFile with attributes
17992  * @destination: a #GFile to copy attributes to
17993  * @flags: a set of #GFileCopyFlags
17994  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17995  * @error: a #GError, %NULL to ignore
17996  *
17997  * Copies the file attributes from @source to @destination.
17998  *
17999  * Normally only a subset of the file attributes are copied,
18000  * those that are copies in a normal file copy operation
18001  * (which for instance does not include e.g. owner). However
18002  * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
18003  * all the metadata that is possible to copy is copied. This
18004  * is useful when implementing move by copy + delete source.
18005  *
18006  * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
18007  */
18008
18009
18010 /**
18011  * g_file_copy_finish:
18012  * @file: input #GFile
18013  * @res: a #GAsyncResult
18014  * @error: a #GError, or %NULL
18015  *
18016  * Finishes copying the file started with g_file_copy_async().
18017  *
18018  * Returns: a %TRUE on success, %FALSE on error.
18019  */
18020
18021
18022 /**
18023  * g_file_create:
18024  * @file: input #GFile
18025  * @flags: a set of #GFileCreateFlags
18026  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18027  * @error: a #GError, or %NULL
18028  *
18029  * Creates a new file and returns an output stream for writing to it.
18030  * The file must not already exist.
18031  *
18032  * By default files created are generally readable by everyone,
18033  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
18034  * will be made readable only to the current user, to the level
18035  * that is supported on the target filesystem.
18036  *
18037  * If @cancellable is not %NULL, then the operation can be cancelled
18038  * by triggering the cancellable object from another thread. If the
18039  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18040  * returned.
18041  *
18042  * If a file or directory with this name already exists the
18043  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
18044  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
18045  * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
18046  * be returned. Other errors are possible too, and depend on what kind
18047  * of filesystem the file is on.
18048  *
18049  * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
18050  */
18051
18052
18053 /**
18054  * g_file_create_async:
18055  * @file: input #GFile
18056  * @flags: a set of #GFileCreateFlags
18057  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18058  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18059  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18060  * @user_data: (closure): the data to pass to callback function
18061  *
18062  * Asynchronously creates a new file and returns an output stream
18063  * for writing to it. The file must not already exist.
18064  *
18065  * For more details, see g_file_create() which is
18066  * the synchronous version of this call.
18067  *
18068  * When the operation is finished, @callback will be called.
18069  * You can then call g_file_create_finish() to get the result
18070  * of the operation.
18071  */
18072
18073
18074 /**
18075  * g_file_create_finish:
18076  * @file: input #GFile
18077  * @res: a #GAsyncResult
18078  * @error: a #GError, or %NULL
18079  *
18080  * Finishes an asynchronous file create operation started with
18081  * g_file_create_async().
18082  *
18083  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
18084  */
18085
18086
18087 /**
18088  * g_file_create_readwrite:
18089  * @file: a #GFile
18090  * @flags: a set of #GFileCreateFlags
18091  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18092  * @error: return location for a #GError, or %NULL
18093  *
18094  * Creates a new file and returns a stream for reading and
18095  * writing to it. The file must not already exist.
18096  *
18097  * By default files created are generally readable by everyone,
18098  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
18099  * will be made readable only to the current user, to the level
18100  * that is supported on the target filesystem.
18101  *
18102  * If @cancellable is not %NULL, then the operation can be cancelled
18103  * by triggering the cancellable object from another thread. If the
18104  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18105  * returned.
18106  *
18107  * If a file or directory with this name already exists, the
18108  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
18109  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
18110  * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
18111  * will be returned. Other errors are possible too, and depend on what
18112  * kind of filesystem the file is on.
18113  *
18114  * Note that in many non-local file cases read and write streams are
18115  * not supported, so make sure you really need to do read and write
18116  * streaming, rather than just opening for reading or writing.
18117  *
18118  * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
18119  * Since: 2.22
18120  */
18121
18122
18123 /**
18124  * g_file_create_readwrite_async:
18125  * @file: input #GFile
18126  * @flags: a set of #GFileCreateFlags
18127  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18128  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18129  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18130  * @user_data: (closure): the data to pass to callback function
18131  *
18132  * Asynchronously creates a new file and returns a stream
18133  * for reading and writing to it. The file must not already exist.
18134  *
18135  * For more details, see g_file_create_readwrite() which is
18136  * the synchronous version of this call.
18137  *
18138  * When the operation is finished, @callback will be called.
18139  * You can then call g_file_create_readwrite_finish() to get
18140  * the result of the operation.
18141  *
18142  * Since: 2.22
18143  */
18144
18145
18146 /**
18147  * g_file_create_readwrite_finish:
18148  * @file: input #GFile
18149  * @res: a #GAsyncResult
18150  * @error: a #GError, or %NULL
18151  *
18152  * Finishes an asynchronous file create operation started with
18153  * g_file_create_readwrite_async().
18154  *
18155  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
18156  * Since: 2.22
18157  */
18158
18159
18160 /**
18161  * g_file_delete:
18162  * @file: input #GFile
18163  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18164  * @error: a #GError, or %NULL
18165  *
18166  * Deletes a file. If the @file is a directory, it will only be
18167  * deleted if it is empty. This has the same semantics as g_unlink().
18168  *
18169  * If @cancellable is not %NULL, then the operation can be cancelled by
18170  * triggering the cancellable object from another thread. If the operation
18171  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18172  *
18173  * Virtual: delete_file
18174  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
18175  */
18176
18177
18178 /**
18179  * g_file_delete_async:
18180  * @file: input #GFile
18181  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18182  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18183  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18184  * @user_data: the data to pass to callback function
18185  *
18186  * Asynchronously delete a file. If the @file is a directory, it will
18187  * only be deleted if it is empty.  This has the same semantics as
18188  * g_unlink().
18189  *
18190  * Virtual: delete_file_async
18191  * Since: 2.34
18192  */
18193
18194
18195 /**
18196  * g_file_delete_finish:
18197  * @file: input #GFile
18198  * @result: a #GAsyncResult
18199  * @error: a #GError, or %NULL
18200  *
18201  * Finishes deleting a file started with g_file_delete_async().
18202  *
18203  * Virtual: delete_file_finish
18204  * Since: 2.34
18205  */
18206
18207
18208 /**
18209  * g_file_descriptor_based_get_fd:
18210  * @fd_based: a #GFileDescriptorBased.
18211  *
18212  * Gets the underlying file descriptor.
18213  *
18214  * Returns: The file descriptor
18215  * Since: 2.24
18216  */
18217
18218
18219 /**
18220  * g_file_dup:
18221  * @file: input #GFile
18222  *
18223  * Duplicates a #GFile handle. This operation does not duplicate
18224  * the actual file or directory represented by the #GFile; see
18225  * g_file_copy() if attempting to copy a file.
18226  *
18227  * This call does no blocking I/O.
18228  *
18229  * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
18230  */
18231
18232
18233 /**
18234  * g_file_eject_mountable:
18235  * @file: input #GFile
18236  * @flags: flags affecting the operation
18237  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18238  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18239  * @user_data: (closure): the data to pass to callback function
18240  *
18241  * Starts an asynchronous eject on a mountable.
18242  * When this operation has completed, @callback will be called with
18243  * @user_user data, and the operation can be finalized with
18244  * g_file_eject_mountable_finish().
18245  *
18246  * If @cancellable is not %NULL, then the operation can be cancelled by
18247  * triggering the cancellable object from another thread. If the operation
18248  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18249  *
18250  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
18251  */
18252
18253
18254 /**
18255  * g_file_eject_mountable_finish:
18256  * @file: input #GFile
18257  * @result: a #GAsyncResult
18258  * @error: a #GError, or %NULL
18259  *
18260  * Finishes an asynchronous eject operation started by
18261  * g_file_eject_mountable().
18262  *
18263  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
18264  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
18265  */
18266
18267
18268 /**
18269  * g_file_eject_mountable_with_operation:
18270  * @file: input #GFile
18271  * @flags: flags affecting the operation
18272  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
18273  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18274  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18275  * @user_data: (closure): the data to pass to callback function
18276  *
18277  * Starts an asynchronous eject on a mountable.
18278  * When this operation has completed, @callback will be called with
18279  * @user_user data, and the operation can be finalized with
18280  * g_file_eject_mountable_with_operation_finish().
18281  *
18282  * If @cancellable is not %NULL, then the operation can be cancelled by
18283  * triggering the cancellable object from another thread. If the operation
18284  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18285  *
18286  * Since: 2.22
18287  */
18288
18289
18290 /**
18291  * g_file_eject_mountable_with_operation_finish:
18292  * @file: input #GFile
18293  * @result: a #GAsyncResult
18294  * @error: a #GError, or %NULL
18295  *
18296  * Finishes an asynchronous eject operation started by
18297  * g_file_eject_mountable_with_operation().
18298  *
18299  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
18300  * Since: 2.22
18301  */
18302
18303
18304 /**
18305  * g_file_enumerate_children:
18306  * @file: input #GFile
18307  * @attributes: an attribute query string
18308  * @flags: a set of #GFileQueryInfoFlags
18309  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18310  * @error: #GError for error reporting
18311  *
18312  * Gets the requested information about the files in a directory.
18313  * The result is a #GFileEnumerator object that will give out
18314  * #GFileInfo objects for all the files in the directory.
18315  *
18316  * The @attributes value is a string that specifies the file
18317  * attributes that should be gathered. It is not an error if
18318  * it's not possible to read a particular requested attribute
18319  * from a file - it just won't be set. @attributes should
18320  * be a comma-separated list of attributes or attribute wildcards.
18321  * The wildcard "*" means all attributes, and a wildcard like
18322  * "standard::*" means all attributes in the standard namespace.
18323  * An example attribute query be "standard::*,owner::user".
18324  * The standard attributes are available as defines, like
18325  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
18326  *
18327  * If @cancellable is not %NULL, then the operation can be cancelled
18328  * by triggering the cancellable object from another thread. If the
18329  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18330  * returned.
18331  *
18332  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
18333  * be returned. If the file is not a directory, the %G_FILE_ERROR_NOTDIR
18334  * error will be returned. Other errors are possible too.
18335  *
18336  * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
18337  */
18338
18339
18340 /**
18341  * g_file_enumerate_children_async:
18342  * @file: input #GFile
18343  * @attributes: an attribute query string
18344  * @flags: a set of #GFileQueryInfoFlags
18345  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18346  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18347  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18348  * @user_data: (closure): the data to pass to callback function
18349  *
18350  * Asynchronously gets the requested information about the files
18351  * in a directory. The result is a #GFileEnumerator object that will
18352  * give out #GFileInfo objects for all the files in the directory.
18353  *
18354  * For more details, see g_file_enumerate_children() which is
18355  * the synchronous version of this call.
18356  *
18357  * When the operation is finished, @callback will be called. You can
18358  * then call g_file_enumerate_children_finish() to get the result of
18359  * the operation.
18360  */
18361
18362
18363 /**
18364  * g_file_enumerate_children_finish:
18365  * @file: input #GFile
18366  * @res: a #GAsyncResult
18367  * @error: a #GError
18368  *
18369  * Finishes an async enumerate children operation.
18370  * See g_file_enumerate_children_async().
18371  *
18372  * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
18373  */
18374
18375
18376 /**
18377  * g_file_enumerator_close:
18378  * @enumerator: a #GFileEnumerator.
18379  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18380  * @error: location to store the error occurring, or %NULL to ignore
18381  *
18382  * Releases all resources used by this enumerator, making the
18383  * enumerator return %G_IO_ERROR_CLOSED on all calls.
18384  *
18385  * This will be automatically called when the last reference
18386  * is dropped, but you might want to call this function to make
18387  * sure resources are released as early as possible.
18388  *
18389  * Returns: #TRUE on success or #FALSE on error.
18390  */
18391
18392
18393 /**
18394  * g_file_enumerator_close_async:
18395  * @enumerator: a #GFileEnumerator.
18396  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18397  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18398  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18399  * @user_data: (closure): the data to pass to callback function
18400  *
18401  * Asynchronously closes the file enumerator.
18402  *
18403  * If @cancellable is not %NULL, then the operation can be cancelled by
18404  * triggering the cancellable object from another thread. If the operation
18405  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
18406  * g_file_enumerator_close_finish().
18407  */
18408
18409
18410 /**
18411  * g_file_enumerator_close_finish:
18412  * @enumerator: a #GFileEnumerator.
18413  * @result: a #GAsyncResult.
18414  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18415  *
18416  * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
18417  *
18418  * If the file enumerator was already closed when g_file_enumerator_close_async()
18419  * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
18420  * return %FALSE. If the file enumerator had pending operation when the close
18421  * operation was started, then this function will report %G_IO_ERROR_PENDING, and
18422  * return %FALSE.  If @cancellable was not %NULL, then the operation may have been
18423  * cancelled by triggering the cancellable object from another thread. If the operation
18424  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
18425  * returned.
18426  *
18427  * Returns: %TRUE if the close operation has finished successfully.
18428  */
18429
18430
18431 /**
18432  * g_file_enumerator_get_container:
18433  * @enumerator: a #GFileEnumerator
18434  *
18435  * Get the #GFile container which is being enumerated.
18436  *
18437  * Returns: (transfer none): the #GFile which is being enumerated.
18438  * Since: 2.18
18439  */
18440
18441
18442 /**
18443  * g_file_enumerator_has_pending:
18444  * @enumerator: a #GFileEnumerator.
18445  *
18446  * Checks if the file enumerator has pending operations.
18447  *
18448  * Returns: %TRUE if the @enumerator has pending operations.
18449  */
18450
18451
18452 /**
18453  * g_file_enumerator_is_closed:
18454  * @enumerator: a #GFileEnumerator.
18455  *
18456  * Checks if the file enumerator has been closed.
18457  *
18458  * Returns: %TRUE if the @enumerator is closed.
18459  */
18460
18461
18462 /**
18463  * g_file_enumerator_next_file:
18464  * @enumerator: a #GFileEnumerator.
18465  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18466  * @error: location to store the error occurring, or %NULL to ignore
18467  *
18468  * Returns information for the next file in the enumerated object.
18469  * Will block until the information is available. The #GFileInfo
18470  * returned from this function will contain attributes that match the
18471  * attribute string that was passed when the #GFileEnumerator was created.
18472  *
18473  * On error, returns %NULL and sets @error to the error. If the
18474  * enumerator is at the end, %NULL will be returned and @error will
18475  * be unset.
18476  *
18477  * 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.
18478  */
18479
18480
18481 /**
18482  * g_file_enumerator_next_files_async:
18483  * @enumerator: a #GFileEnumerator.
18484  * @num_files: the number of file info objects to request
18485  * @io_priority: the <link linkend="io-priority">io priority</link> of the request.
18486  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18487  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18488  * @user_data: (closure): the data to pass to callback function
18489  *
18490  * Request information for a number of files from the enumerator asynchronously.
18491  * When all i/o for the operation is finished the @callback will be called with
18492  * the requested information.
18493  *
18494  * The callback can be called with less than @num_files files in case of error
18495  * or at the end of the enumerator. In case of a partial error the callback will
18496  * be called with any succeeding items and no error, and on the next request the
18497  * error will be reported. If a request is cancelled the callback will be called
18498  * with %G_IO_ERROR_CANCELLED.
18499  *
18500  * During an async request no other sync and async calls are allowed, and will
18501  * result in %G_IO_ERROR_PENDING errors.
18502  *
18503  * Any outstanding i/o request with higher priority (lower numerical value) will
18504  * be executed before an outstanding request with lower priority. Default
18505  * priority is %G_PRIORITY_DEFAULT.
18506  */
18507
18508
18509 /**
18510  * g_file_enumerator_next_files_finish:
18511  * @enumerator: a #GFileEnumerator.
18512  * @result: a #GAsyncResult.
18513  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18514  *
18515  * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
18516  *
18517  * 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.
18518  */
18519
18520
18521 /**
18522  * g_file_enumerator_set_pending:
18523  * @enumerator: a #GFileEnumerator.
18524  * @pending: a boolean value.
18525  *
18526  * Sets the file enumerator as having pending operations.
18527  */
18528
18529
18530 /**
18531  * g_file_equal:
18532  * @file1: the first #GFile
18533  * @file2: the second #GFile
18534  *
18535  * Checks equality of two given #GFiles.
18536  *
18537  * Note that two #GFiles that differ can still refer to the same
18538  * file on the filesystem due to various forms of filename
18539  * aliasing.
18540  *
18541  * This call does no blocking I/O.
18542  *
18543  * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
18544  */
18545
18546
18547 /**
18548  * g_file_find_enclosing_mount:
18549  * @file: input #GFile
18550  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18551  * @error: a #GError
18552  *
18553  * Gets a #GMount for the #GFile.
18554  *
18555  * If the #GFileIface for @file does not have a mount (e.g.
18556  * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
18557  * and %NULL will be returned.
18558  *
18559  * If @cancellable is not %NULL, then the operation can be cancelled by
18560  * triggering the cancellable object from another thread. If the operation
18561  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18562  *
18563  * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
18564  */
18565
18566
18567 /**
18568  * g_file_find_enclosing_mount_async:
18569  * @file: a #GFile
18570  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18571  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18572  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18573  * @user_data: (closure): the data to pass to callback function
18574  *
18575  * Asynchronously gets the mount for the file.
18576  *
18577  * For more details, see g_file_find_enclosing_mount() which is
18578  * the synchronous version of this call.
18579  *
18580  * When the operation is finished, @callback will be called.
18581  * You can then call g_file_find_enclosing_mount_finish() to
18582  * get the result of the operation.
18583  */
18584
18585
18586 /**
18587  * g_file_find_enclosing_mount_finish:
18588  * @file: a #GFile
18589  * @res: a #GAsyncResult
18590  * @error: a #GError
18591  *
18592  * Finishes an asynchronous find mount request.
18593  * See g_file_find_enclosing_mount_async().
18594  *
18595  * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
18596  */
18597
18598
18599 /**
18600  * g_file_get_basename:
18601  * @file: input #GFile
18602  *
18603  * Gets the base name (the last component of the path) for a given #GFile.
18604  *
18605  * If called for the top level of a system (such as the filesystem root
18606  * or a uri like sftp://host/) it will return a single directory separator
18607  * (and on Windows, possibly a drive letter).
18608  *
18609  * The base name is a byte string (not UTF-8). It has no defined encoding
18610  * or rules other than it may not contain zero bytes.  If you want to use
18611  * filenames in a user interface you should use the display name that you
18612  * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
18613  * attribute with g_file_query_info().
18614  *
18615  * This call does no blocking I/O.
18616  *
18617  * 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.
18618  */
18619
18620
18621 /**
18622  * g_file_get_child:
18623  * @file: input #GFile
18624  * @name: string containing the child's basename
18625  *
18626  * Gets a child of @file with basename equal to @name.
18627  *
18628  * Note that the file with that specific name might not exist, but
18629  * you can still have a #GFile that points to it. You can use this
18630  * for instance to create that file.
18631  *
18632  * This call does no blocking I/O.
18633  *
18634  * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
18635  */
18636
18637
18638 /**
18639  * g_file_get_child_for_display_name:
18640  * @file: input #GFile
18641  * @display_name: string to a possible child
18642  * @error: return location for an error
18643  *
18644  * Gets the child of @file for a given @display_name (i.e. a UTF-8
18645  * version of the name). If this function fails, it returns %NULL
18646  * and @error will be set. This is very useful when constructing a
18647  * #GFile for a new file and the user entered the filename in the
18648  * user interface, for instance when you select a directory and
18649  * type a filename in the file selector.
18650  *
18651  * This call does no blocking I/O.
18652  *
18653  * 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().
18654  */
18655
18656
18657 /**
18658  * g_file_get_parent:
18659  * @file: input #GFile
18660  *
18661  * Gets the parent directory for the @file.
18662  * If the @file represents the root directory of the
18663  * file system, then %NULL will be returned.
18664  *
18665  * This call does no blocking I/O.
18666  *
18667  * 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().
18668  */
18669
18670
18671 /**
18672  * g_file_get_parse_name:
18673  * @file: input #GFile
18674  *
18675  * Gets the parse name of the @file.
18676  * A parse name is a UTF-8 string that describes the
18677  * file such that one can get the #GFile back using
18678  * g_file_parse_name().
18679  *
18680  * This is generally used to show the #GFile as a nice
18681  * full-pathname kind of string in a user interface,
18682  * like in a location entry.
18683  *
18684  * For local files with names that can safely be converted
18685  * to UTF-8 the pathname is used, otherwise the IRI is used
18686  * (a form of URI that allows UTF-8 characters unescaped).
18687  *
18688  * This call does no blocking I/O.
18689  *
18690  * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18691  */
18692
18693
18694 /**
18695  * g_file_get_path:
18696  * @file: input #GFile
18697  *
18698  * Gets the local pathname for #GFile, if one exists.
18699  *
18700  * This call does no blocking I/O.
18701  *
18702  * 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.
18703  */
18704
18705
18706 /**
18707  * g_file_get_relative_path:
18708  * @parent: input #GFile
18709  * @descendant: input #GFile
18710  *
18711  * Gets the path for @descendant relative to @parent.
18712  *
18713  * This call does no blocking I/O.
18714  *
18715  * 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.
18716  */
18717
18718
18719 /**
18720  * g_file_get_uri:
18721  * @file: input #GFile
18722  *
18723  * Gets the URI for the @file.
18724  *
18725  * This call does no blocking I/O.
18726  *
18727  * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18728  */
18729
18730
18731 /**
18732  * g_file_get_uri_scheme:
18733  * @file: input #GFile
18734  *
18735  * Gets the URI scheme for a #GFile.
18736  * RFC 3986 decodes the scheme as:
18737  * <programlisting>
18738  * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18739  * </programlisting>
18740  * Common schemes include "file", "http", "ftp", etc.
18741  *
18742  * This call does no blocking I/O.
18743  *
18744  * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18745  */
18746
18747
18748 /**
18749  * g_file_has_parent:
18750  * @file: input #GFile
18751  * @parent: (allow-none): the parent to check for, or %NULL
18752  *
18753  * Checks if @file has a parent, and optionally, if it is @parent.
18754  *
18755  * If @parent is %NULL then this function returns %TRUE if @file has any
18756  * parent at all.  If @parent is non-%NULL then %TRUE is only returned
18757  * if @file is a child of @parent.
18758  *
18759  * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18760  * Since: 2.24
18761  */
18762
18763
18764 /**
18765  * g_file_has_prefix:
18766  * @file: input #GFile
18767  * @prefix: input #GFile
18768  *
18769  * Checks whether @file has the prefix specified by @prefix.
18770  *
18771  * In other words, if the names of initial elements of @file's
18772  * pathname match @prefix. Only full pathname elements are matched,
18773  * so a path like /foo is not considered a prefix of /foobar, only
18774  * of /foo/bar.
18775  *
18776  * This call does no I/O, as it works purely on names. As such it can
18777  * sometimes return %FALSE even if @file is inside a @prefix (from a
18778  * filesystem point of view), because the prefix of @file is an alias
18779  * of @prefix.
18780  *
18781  * Virtual: prefix_matches
18782  * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18783  */
18784
18785
18786 /**
18787  * g_file_has_uri_scheme:
18788  * @file: input #GFile
18789  * @uri_scheme: a string containing a URI scheme
18790  *
18791  * Checks to see if a #GFile has a given URI scheme.
18792  *
18793  * This call does no blocking I/O.
18794  *
18795  * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18796  */
18797
18798
18799 /**
18800  * g_file_hash:
18801  * @file: (type GFile): #gconstpointer to a #GFile
18802  *
18803  * Creates a hash value for a #GFile.
18804  *
18805  * This call does no blocking I/O.
18806  *
18807  * Virtual: hash
18808  * 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.
18809  */
18810
18811
18812 /**
18813  * g_file_icon_get_file:
18814  * @icon: a #GIcon.
18815  *
18816  * Gets the #GFile associated with the given @icon.
18817  *
18818  * Returns: (transfer none): a #GFile, or %NULL.
18819  */
18820
18821
18822 /**
18823  * g_file_icon_new:
18824  * @file: a #GFile.
18825  *
18826  * Creates a new icon for a file.
18827  *
18828  * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18829  */
18830
18831
18832 /**
18833  * g_file_info_clear_status:
18834  * @info: a #GFileInfo.
18835  *
18836  * Clears the status information from @info.
18837  */
18838
18839
18840 /**
18841  * g_file_info_copy_into:
18842  * @src_info: source to copy attributes from.
18843  * @dest_info: destination to copy attributes to.
18844  *
18845  * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18846  * from @src_info to @dest_info.
18847  */
18848
18849
18850 /**
18851  * g_file_info_dup:
18852  * @other: a #GFileInfo.
18853  *
18854  * Duplicates a file info structure.
18855  *
18856  * Returns: (transfer full): a duplicate #GFileInfo of @other.
18857  */
18858
18859
18860 /**
18861  * g_file_info_get_attribute_as_string:
18862  * @info: a #GFileInfo.
18863  * @attribute: a file attribute key.
18864  *
18865  * Gets the value of a attribute, formated as a string.
18866  * This escapes things as needed to make the string valid
18867  * utf8.
18868  *
18869  * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18870  */
18871
18872
18873 /**
18874  * g_file_info_get_attribute_boolean:
18875  * @info: a #GFileInfo.
18876  * @attribute: a file attribute key.
18877  *
18878  * Gets the value of a boolean attribute. If the attribute does not
18879  * contain a boolean value, %FALSE will be returned.
18880  *
18881  * Returns: the boolean value contained within the attribute.
18882  */
18883
18884
18885 /**
18886  * g_file_info_get_attribute_byte_string:
18887  * @info: a #GFileInfo.
18888  * @attribute: a file attribute key.
18889  *
18890  * Gets the value of a byte string attribute. If the attribute does
18891  * not contain a byte string, %NULL will be returned.
18892  *
18893  * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18894  */
18895
18896
18897 /**
18898  * g_file_info_get_attribute_data:
18899  * @info: a #GFileInfo
18900  * @attribute: a file attribute key
18901  * @type: (out) (allow-none): return location for the attribute type, or %NULL
18902  * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18903  * @status: (out) (allow-none): return location for the attribute status, or %NULL
18904  *
18905  * Gets the attribute type, value and status for an attribute key.
18906  *
18907  * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18908  */
18909
18910
18911 /**
18912  * g_file_info_get_attribute_int32:
18913  * @info: a #GFileInfo.
18914  * @attribute: a file attribute key.
18915  *
18916  * Gets a signed 32-bit integer contained within the attribute. If the
18917  * attribute does not contain a signed 32-bit integer, or is invalid,
18918  * 0 will be returned.
18919  *
18920  * Returns: a signed 32-bit integer from the attribute.
18921  */
18922
18923
18924 /**
18925  * g_file_info_get_attribute_int64:
18926  * @info: a #GFileInfo.
18927  * @attribute: a file attribute key.
18928  *
18929  * Gets a signed 64-bit integer contained within the attribute. If the
18930  * attribute does not contain an signed 64-bit integer, or is invalid,
18931  * 0 will be returned.
18932  *
18933  * Returns: a signed 64-bit integer from the attribute.
18934  */
18935
18936
18937 /**
18938  * g_file_info_get_attribute_object:
18939  * @info: a #GFileInfo.
18940  * @attribute: a file attribute key.
18941  *
18942  * Gets the value of a #GObject attribute. If the attribute does
18943  * not contain a #GObject, %NULL will be returned.
18944  *
18945  * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18946  */
18947
18948
18949 /**
18950  * g_file_info_get_attribute_status:
18951  * @info: a #GFileInfo
18952  * @attribute: a file attribute key
18953  *
18954  * Gets the attribute status for an attribute key.
18955  *
18956  * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18957  */
18958
18959
18960 /**
18961  * g_file_info_get_attribute_string:
18962  * @info: a #GFileInfo.
18963  * @attribute: a file attribute key.
18964  *
18965  * Gets the value of a string attribute. If the attribute does
18966  * not contain a string, %NULL will be returned.
18967  *
18968  * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18969  */
18970
18971
18972 /**
18973  * g_file_info_get_attribute_stringv:
18974  * @info: a #GFileInfo.
18975  * @attribute: a file attribute key.
18976  *
18977  * Gets the value of a stringv attribute. If the attribute does
18978  * not contain a stringv, %NULL will be returned.
18979  *
18980  * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18981  * Since: 2.22
18982  */
18983
18984
18985 /**
18986  * g_file_info_get_attribute_type:
18987  * @info: a #GFileInfo.
18988  * @attribute: a file attribute key.
18989  *
18990  * Gets the attribute type for an attribute key.
18991  *
18992  * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18993  */
18994
18995
18996 /**
18997  * g_file_info_get_attribute_uint32:
18998  * @info: a #GFileInfo.
18999  * @attribute: a file attribute key.
19000  *
19001  * Gets an unsigned 32-bit integer contained within the attribute. If the
19002  * attribute does not contain an unsigned 32-bit integer, or is invalid,
19003  * 0 will be returned.
19004  *
19005  * Returns: an unsigned 32-bit integer from the attribute.
19006  */
19007
19008
19009 /**
19010  * g_file_info_get_attribute_uint64:
19011  * @info: a #GFileInfo.
19012  * @attribute: a file attribute key.
19013  *
19014  * Gets a unsigned 64-bit integer contained within the attribute. If the
19015  * attribute does not contain an unsigned 64-bit integer, or is invalid,
19016  * 0 will be returned.
19017  *
19018  * Returns: a unsigned 64-bit integer from the attribute.
19019  */
19020
19021
19022 /**
19023  * g_file_info_get_content_type:
19024  * @info: a #GFileInfo.
19025  *
19026  * Gets the file's content type.
19027  *
19028  * Returns: a string containing the file's content type.
19029  */
19030
19031
19032 /**
19033  * g_file_info_get_display_name:
19034  * @info: a #GFileInfo.
19035  *
19036  * Gets a display name for a file.
19037  *
19038  * Returns: a string containing the display name.
19039  */
19040
19041
19042 /**
19043  * g_file_info_get_edit_name:
19044  * @info: a #GFileInfo.
19045  *
19046  * Gets the edit name for a file.
19047  *
19048  * Returns: a string containing the edit name.
19049  */
19050
19051
19052 /**
19053  * g_file_info_get_etag:
19054  * @info: a #GFileInfo.
19055  *
19056  * Gets the <link linkend="gfile-etag">entity tag</link> for a given
19057  * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
19058  *
19059  * Returns: a string containing the value of the "etag:value" attribute.
19060  */
19061
19062
19063 /**
19064  * g_file_info_get_file_type:
19065  * @info: a #GFileInfo.
19066  *
19067  * Gets a file's type (whether it is a regular file, symlink, etc).
19068  * This is different from the file's content type, see g_file_info_get_content_type().
19069  *
19070  * Returns: a #GFileType for the given file.
19071  */
19072
19073
19074 /**
19075  * g_file_info_get_icon:
19076  * @info: a #GFileInfo.
19077  *
19078  * Gets the icon for a file.
19079  *
19080  * Returns: (transfer none): #GIcon for the given @info.
19081  */
19082
19083
19084 /**
19085  * g_file_info_get_is_backup:
19086  * @info: a #GFileInfo.
19087  *
19088  * Checks if a file is a backup file.
19089  *
19090  * Returns: %TRUE if file is a backup file, %FALSE otherwise.
19091  */
19092
19093
19094 /**
19095  * g_file_info_get_is_hidden:
19096  * @info: a #GFileInfo.
19097  *
19098  * Checks if a file is hidden.
19099  *
19100  * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
19101  */
19102
19103
19104 /**
19105  * g_file_info_get_is_symlink:
19106  * @info: a #GFileInfo.
19107  *
19108  * Checks if a file is a symlink.
19109  *
19110  * Returns: %TRUE if the given @info is a symlink.
19111  */
19112
19113
19114 /**
19115  * g_file_info_get_modification_time:
19116  * @info: a #GFileInfo.
19117  * @result: (out caller-allocates): a #GTimeVal.
19118  *
19119  * Gets the modification time of the current @info and sets it
19120  * in @result.
19121  */
19122
19123
19124 /**
19125  * g_file_info_get_name:
19126  * @info: a #GFileInfo.
19127  *
19128  * Gets the name for a file.
19129  *
19130  * Returns: a string containing the file name.
19131  */
19132
19133
19134 /**
19135  * g_file_info_get_size:
19136  * @info: a #GFileInfo.
19137  *
19138  * Gets the file's size.
19139  *
19140  * Returns: a #goffset containing the file's size.
19141  */
19142
19143
19144 /**
19145  * g_file_info_get_sort_order:
19146  * @info: a #GFileInfo.
19147  *
19148  * Gets the value of the sort_order attribute from the #GFileInfo.
19149  * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
19150  *
19151  * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
19152  */
19153
19154
19155 /**
19156  * g_file_info_get_symbolic_icon:
19157  * @info: a #GFileInfo.
19158  *
19159  * Gets the symbolic icon for a file.
19160  *
19161  * Returns: (transfer none): #GIcon for the given @info.
19162  * Since: 2.34
19163  */
19164
19165
19166 /**
19167  * g_file_info_get_symlink_target:
19168  * @info: a #GFileInfo.
19169  *
19170  * Gets the symlink target for a given #GFileInfo.
19171  *
19172  * Returns: a string containing the symlink target.
19173  */
19174
19175
19176 /**
19177  * g_file_info_has_attribute:
19178  * @info: a #GFileInfo.
19179  * @attribute: a file attribute key.
19180  *
19181  * Checks if a file info structure has an attribute named @attribute.
19182  *
19183  * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
19184  */
19185
19186
19187 /**
19188  * g_file_info_has_namespace:
19189  * @info: a #GFileInfo.
19190  * @name_space: a file attribute namespace.
19191  *
19192  * Checks if a file info structure has an attribute in the
19193  * specified @name_space.
19194  *
19195  * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
19196  * Since: 2.22
19197  */
19198
19199
19200 /**
19201  * g_file_info_list_attributes:
19202  * @info: a #GFileInfo.
19203  * @name_space: a file attribute key's namespace.
19204  *
19205  * Lists the file info structure's attributes.
19206  *
19207  * 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.
19208  */
19209
19210
19211 /**
19212  * g_file_info_new:
19213  *
19214  * Creates a new file info structure.
19215  *
19216  * Returns: a #GFileInfo.
19217  */
19218
19219
19220 /**
19221  * g_file_info_remove_attribute:
19222  * @info: a #GFileInfo.
19223  * @attribute: a file attribute key.
19224  *
19225  * Removes all cases of @attribute from @info if it exists.
19226  */
19227
19228
19229 /**
19230  * g_file_info_set_attribute:
19231  * @info: a #GFileInfo.
19232  * @attribute: a file attribute key.
19233  * @type: a #GFileAttributeType
19234  * @value_p: pointer to the value
19235  *
19236  * Sets the @attribute to contain the given value, if possible. To unset the
19237  * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
19238  */
19239
19240
19241 /**
19242  * g_file_info_set_attribute_boolean:
19243  * @info: a #GFileInfo.
19244  * @attribute: a file attribute key.
19245  * @attr_value: a boolean value.
19246  *
19247  * Sets the @attribute to contain the given @attr_value,
19248  * if possible.
19249  */
19250
19251
19252 /**
19253  * g_file_info_set_attribute_byte_string:
19254  * @info: a #GFileInfo.
19255  * @attribute: a file attribute key.
19256  * @attr_value: a byte string.
19257  *
19258  * Sets the @attribute to contain the given @attr_value,
19259  * if possible.
19260  */
19261
19262
19263 /**
19264  * g_file_info_set_attribute_int32:
19265  * @info: a #GFileInfo.
19266  * @attribute: a file attribute key.
19267  * @attr_value: a signed 32-bit integer
19268  *
19269  * Sets the @attribute to contain the given @attr_value,
19270  * if possible.
19271  */
19272
19273
19274 /**
19275  * g_file_info_set_attribute_int64:
19276  * @info: a #GFileInfo.
19277  * @attribute: attribute name to set.
19278  * @attr_value: int64 value to set attribute to.
19279  *
19280  * Sets the @attribute to contain the given @attr_value,
19281  * if possible.
19282  */
19283
19284
19285 /**
19286  * g_file_info_set_attribute_mask:
19287  * @info: a #GFileInfo.
19288  * @mask: a #GFileAttributeMatcher.
19289  *
19290  * Sets @mask on @info to match specific attribute types.
19291  */
19292
19293
19294 /**
19295  * g_file_info_set_attribute_object:
19296  * @info: a #GFileInfo.
19297  * @attribute: a file attribute key.
19298  * @attr_value: a #GObject.
19299  *
19300  * Sets the @attribute to contain the given @attr_value,
19301  * if possible.
19302  */
19303
19304
19305 /**
19306  * g_file_info_set_attribute_status:
19307  * @info: a #GFileInfo
19308  * @attribute: a file attribute key
19309  * @status: a #GFileAttributeStatus
19310  *
19311  * Sets the attribute status for an attribute key. This is only
19312  * needed by external code that implement g_file_set_attributes_from_info()
19313  * or similar functions.
19314  *
19315  * The attribute must exist in @info for this to work. Otherwise %FALSE
19316  * is returned and @info is unchanged.
19317  *
19318  * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
19319  * Since: 2.22
19320  */
19321
19322
19323 /**
19324  * g_file_info_set_attribute_string:
19325  * @info: a #GFileInfo.
19326  * @attribute: a file attribute key.
19327  * @attr_value: a UTF-8 string.
19328  *
19329  * Sets the @attribute to contain the given @attr_value,
19330  * if possible.
19331  */
19332
19333
19334 /**
19335  * g_file_info_set_attribute_stringv:
19336  * @info: a #GFileInfo.
19337  * @attribute: a file attribute key
19338  * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
19339  *
19340  * Sets the @attribute to contain the given @attr_value,
19341  * if possible.
19342  *
19343  * Sinze: 2.22
19344  */
19345
19346
19347 /**
19348  * g_file_info_set_attribute_uint32:
19349  * @info: a #GFileInfo.
19350  * @attribute: a file attribute key.
19351  * @attr_value: an unsigned 32-bit integer.
19352  *
19353  * Sets the @attribute to contain the given @attr_value,
19354  * if possible.
19355  */
19356
19357
19358 /**
19359  * g_file_info_set_attribute_uint64:
19360  * @info: a #GFileInfo.
19361  * @attribute: a file attribute key.
19362  * @attr_value: an unsigned 64-bit integer.
19363  *
19364  * Sets the @attribute to contain the given @attr_value,
19365  * if possible.
19366  */
19367
19368
19369 /**
19370  * g_file_info_set_content_type:
19371  * @info: a #GFileInfo.
19372  * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
19373  *
19374  * Sets the content type attribute for a given #GFileInfo.
19375  * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
19376  */
19377
19378
19379 /**
19380  * g_file_info_set_display_name:
19381  * @info: a #GFileInfo.
19382  * @display_name: a string containing a display name.
19383  *
19384  * Sets the display name for the current #GFileInfo.
19385  * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
19386  */
19387
19388
19389 /**
19390  * g_file_info_set_edit_name:
19391  * @info: a #GFileInfo.
19392  * @edit_name: a string containing an edit name.
19393  *
19394  * Sets the edit name for the current file.
19395  * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
19396  */
19397
19398
19399 /**
19400  * g_file_info_set_file_type:
19401  * @info: a #GFileInfo.
19402  * @type: a #GFileType.
19403  *
19404  * Sets the file type in a #GFileInfo to @type.
19405  * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
19406  */
19407
19408
19409 /**
19410  * g_file_info_set_icon:
19411  * @info: a #GFileInfo.
19412  * @icon: a #GIcon.
19413  *
19414  * Sets the icon for a given #GFileInfo.
19415  * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
19416  */
19417
19418
19419 /**
19420  * g_file_info_set_is_hidden:
19421  * @info: a #GFileInfo.
19422  * @is_hidden: a #gboolean.
19423  *
19424  * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
19425  * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
19426  */
19427
19428
19429 /**
19430  * g_file_info_set_is_symlink:
19431  * @info: a #GFileInfo.
19432  * @is_symlink: a #gboolean.
19433  *
19434  * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
19435  * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
19436  */
19437
19438
19439 /**
19440  * g_file_info_set_modification_time:
19441  * @info: a #GFileInfo.
19442  * @mtime: a #GTimeVal.
19443  *
19444  * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
19445  * info to the given time value.
19446  */
19447
19448
19449 /**
19450  * g_file_info_set_name:
19451  * @info: a #GFileInfo.
19452  * @name: a string containing a name.
19453  *
19454  * Sets the name attribute for the current #GFileInfo.
19455  * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
19456  */
19457
19458
19459 /**
19460  * g_file_info_set_size:
19461  * @info: a #GFileInfo.
19462  * @size: a #goffset containing the file's size.
19463  *
19464  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
19465  * to the given size.
19466  */
19467
19468
19469 /**
19470  * g_file_info_set_sort_order:
19471  * @info: a #GFileInfo.
19472  * @sort_order: a sort order integer.
19473  *
19474  * Sets the sort order attribute in the file info structure. See
19475  * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
19476  */
19477
19478
19479 /**
19480  * g_file_info_set_symbolic_icon:
19481  * @info: a #GFileInfo.
19482  * @icon: a #GIcon.
19483  *
19484  * Sets the symbolic icon for a given #GFileInfo.
19485  * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
19486  *
19487  * Since: 2.34
19488  */
19489
19490
19491 /**
19492  * g_file_info_set_symlink_target:
19493  * @info: a #GFileInfo.
19494  * @symlink_target: a static string containing a path to a symlink target.
19495  *
19496  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
19497  * to the given symlink target.
19498  */
19499
19500
19501 /**
19502  * g_file_info_unset_attribute_mask:
19503  * @info: #GFileInfo.
19504  *
19505  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
19506  * is set.
19507  */
19508
19509
19510 /**
19511  * g_file_input_stream_query_info:
19512  * @stream: a #GFileInputStream.
19513  * @attributes: a file attribute query string.
19514  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19515  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19516  *
19517  * Queries a file input stream the given @attributes. This function blocks
19518  * while querying the stream. For the asynchronous (non-blocking) version
19519  * of this function, see g_file_input_stream_query_info_async(). While the
19520  * stream is blocked, the stream will set the pending flag internally, and
19521  * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
19522  *
19523  * Returns: (transfer full): a #GFileInfo, or %NULL on error.
19524  */
19525
19526
19527 /**
19528  * g_file_input_stream_query_info_async:
19529  * @stream: a #GFileInputStream.
19530  * @attributes: a file attribute query string.
19531  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19532  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19533  * @callback: (scope async): callback to call when the request is satisfied
19534  * @user_data: (closure): the data to pass to callback function
19535  *
19536  * Queries the stream information asynchronously.
19537  * When the operation is finished @callback will be called.
19538  * You can then call g_file_input_stream_query_info_finish()
19539  * to get the result of the operation.
19540  *
19541  * For the synchronous version of this function,
19542  * see g_file_input_stream_query_info().
19543  *
19544  * If @cancellable is not %NULL, then the operation can be cancelled by
19545  * triggering the cancellable object from another thread. If the operation
19546  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
19547  */
19548
19549
19550 /**
19551  * g_file_input_stream_query_info_finish:
19552  * @stream: a #GFileInputStream.
19553  * @result: a #GAsyncResult.
19554  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19555  *
19556  * Finishes an asynchronous info query operation.
19557  *
19558  * Returns: (transfer full): #GFileInfo.
19559  */
19560
19561
19562 /**
19563  * g_file_io_stream_get_etag:
19564  * @stream: a #GFileIOStream.
19565  *
19566  * Gets the entity tag for the file when it has been written.
19567  * This must be called after the stream has been written
19568  * and closed, as the etag can change while writing.
19569  *
19570  * Returns: the entity tag for the stream.
19571  * Since: 2.22
19572  */
19573
19574
19575 /**
19576  * g_file_io_stream_query_info:
19577  * @stream: a #GFileIOStream.
19578  * @attributes: a file attribute query string.
19579  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19580  * @error: a #GError, %NULL to ignore.
19581  *
19582  * Queries a file io stream for the given @attributes.
19583  * This function blocks while querying the stream. For the asynchronous
19584  * version of this function, see g_file_io_stream_query_info_async().
19585  * While the stream is blocked, the stream will set the pending flag
19586  * internally, and any other operations on the stream will fail with
19587  * %G_IO_ERROR_PENDING.
19588  *
19589  * Can fail if the stream was already closed (with @error being set to
19590  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19591  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19592  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
19593  * all cases of failure, %NULL will be returned.
19594  *
19595  * If @cancellable is not %NULL, then the operation can be cancelled by
19596  * triggering the cancellable object from another thread. If the operation
19597  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19598  * be returned.
19599  *
19600  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19601  * Since: 2.22
19602  */
19603
19604
19605 /**
19606  * g_file_io_stream_query_info_async:
19607  * @stream: a #GFileIOStream.
19608  * @attributes: a file attribute query string.
19609  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19610  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19611  * @callback: (scope async): callback to call when the request is satisfied
19612  * @user_data: (closure): the data to pass to callback function
19613  *
19614  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19615  * @callback will be called with a #GAsyncResult which can be used to
19616  * finish the operation with g_file_io_stream_query_info_finish().
19617  *
19618  * For the synchronous version of this function, see
19619  * g_file_io_stream_query_info().
19620  *
19621  * Since: 2.22
19622  */
19623
19624
19625 /**
19626  * g_file_io_stream_query_info_finish:
19627  * @stream: a #GFileIOStream.
19628  * @result: a #GAsyncResult.
19629  * @error: a #GError, %NULL to ignore.
19630  *
19631  * Finalizes the asynchronous query started
19632  * by g_file_io_stream_query_info_async().
19633  *
19634  * Returns: (transfer full): A #GFileInfo for the finished query.
19635  * Since: 2.22
19636  */
19637
19638
19639 /**
19640  * g_file_is_native:
19641  * @file: input #GFile
19642  *
19643  * Checks to see if a file is native to the platform.
19644  *
19645  * A native file s one expressed in the platform-native filename format,
19646  * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19647  * as it might be on a locally mounted remote filesystem.
19648  *
19649  * On some systems non-native files may be available using the native
19650  * filesystem via a userspace filesystem (FUSE), in these cases this call
19651  * will return %FALSE, but g_file_get_path() will still return a native path.
19652  *
19653  * This call does no blocking I/O.
19654  *
19655  * Returns: %TRUE if @file is native
19656  */
19657
19658
19659 /**
19660  * g_file_load_contents:
19661  * @file: input #GFile
19662  * @cancellable: optional #GCancellable object, %NULL to ignore
19663  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19664  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19665  * @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
19666  * @error: a #GError, or %NULL
19667  *
19668  * Loads the content of the file into memory. The data is always
19669  * zero-terminated, but this is not included in the resultant @length.
19670  * The returned @content should be freed with g_free() when no longer
19671  * needed.
19672  *
19673  * If @cancellable is not %NULL, then the operation can be cancelled by
19674  * triggering the cancellable object from another thread. If the operation
19675  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19676  *
19677  * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19678  */
19679
19680
19681 /**
19682  * g_file_load_contents_async:
19683  * @file: input #GFile
19684  * @cancellable: optional #GCancellable object, %NULL to ignore
19685  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19686  * @user_data: the data to pass to callback function
19687  *
19688  * Starts an asynchronous load of the @file's contents.
19689  *
19690  * For more details, see g_file_load_contents() which is
19691  * the synchronous version of this call.
19692  *
19693  * When the load operation has completed, @callback will be called
19694  * with @user data. To finish the operation, call
19695  * g_file_load_contents_finish() with the #GAsyncResult returned by
19696  * the @callback.
19697  *
19698  * If @cancellable is not %NULL, then the operation can be cancelled by
19699  * triggering the cancellable object from another thread. If the operation
19700  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19701  */
19702
19703
19704 /**
19705  * g_file_load_contents_finish:
19706  * @file: input #GFile
19707  * @res: a #GAsyncResult
19708  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19709  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19710  * @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
19711  * @error: a #GError, or %NULL
19712  *
19713  * Finishes an asynchronous load of the @file's contents.
19714  * The contents are placed in @contents, and @length is set to the
19715  * size of the @contents string. The @content should be freed with
19716  * g_free() when no longer needed. If @etag_out is present, it will be
19717  * set to the new entity tag for the @file.
19718  *
19719  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19720  */
19721
19722
19723 /**
19724  * g_file_load_partial_contents_async: (skip)
19725  * @file: input #GFile
19726  * @cancellable: optional #GCancellable object, %NULL to ignore
19727  * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19728  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19729  * @user_data: the data to pass to the callback functions
19730  *
19731  * Reads the partial contents of a file. A #GFileReadMoreCallback should
19732  * be used to stop reading from the file when appropriate, else this
19733  * function will behave exactly as g_file_load_contents_async(). This
19734  * operation can be finished by g_file_load_partial_contents_finish().
19735  *
19736  * Users of this function should be aware that @user_data is passed to
19737  * both the @read_more_callback and the @callback.
19738  *
19739  * If @cancellable is not %NULL, then the operation can be cancelled by
19740  * triggering the cancellable object from another thread. If the operation
19741  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19742  */
19743
19744
19745 /**
19746  * g_file_load_partial_contents_finish:
19747  * @file: input #GFile
19748  * @res: a #GAsyncResult
19749  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19750  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19751  * @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
19752  * @error: a #GError, or %NULL
19753  *
19754  * Finishes an asynchronous partial load operation that was started
19755  * with g_file_load_partial_contents_async(). The data is always
19756  * zero-terminated, but this is not included in the resultant @length.
19757  * The returned @content should be freed with g_free() when no longer
19758  * needed.
19759  *
19760  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19761  */
19762
19763
19764 /**
19765  * g_file_make_directory:
19766  * @file: input #GFile
19767  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19768  * @error: a #GError, or %NULL
19769  *
19770  * Creates a directory. Note that this will only create a child directory
19771  * of the immediate parent directory of the path or URI given by the #GFile.
19772  * To recursively create directories, see g_file_make_directory_with_parents().
19773  * This function will fail if the parent directory does not exist, setting
19774  * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19775  * creating directories, this function will fail, setting @error to
19776  * %G_IO_ERROR_NOT_SUPPORTED.
19777  *
19778  * For a local #GFile the newly created directory will have the default
19779  * (current) ownership and permissions of the current process.
19780  *
19781  * If @cancellable is not %NULL, then the operation can be cancelled by
19782  * triggering the cancellable object from another thread. If the operation
19783  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19784  *
19785  * Returns: %TRUE on successful creation, %FALSE otherwise.
19786  */
19787
19788
19789 /**
19790  * g_file_make_directory_with_parents:
19791  * @file: input #GFile
19792  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19793  * @error: a #GError, or %NULL
19794  *
19795  * Creates a directory and any parent directories that may not
19796  * exist similar to 'mkdir -p'. If the file system does not support
19797  * creating directories, this function will fail, setting @error to
19798  * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19799  * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19800  * the similar g_mkdir_with_parents().
19801  *
19802  * For a local #GFile the newly created directories will have the default
19803  * (current) ownership and permissions of the current process.
19804  *
19805  * If @cancellable is not %NULL, then the operation can be cancelled by
19806  * triggering the cancellable object from another thread. If the operation
19807  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19808  *
19809  * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19810  * Since: 2.18
19811  */
19812
19813
19814 /**
19815  * g_file_make_symbolic_link:
19816  * @file: a #GFile with the name of the symlink to create
19817  * @symlink_value: a string with the path for the target of the new symlink
19818  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19819  * @error: a #GError
19820  *
19821  * Creates a symbolic link named @file which contains the string
19822  * @symlink_value.
19823  *
19824  * If @cancellable is not %NULL, then the operation can be cancelled by
19825  * triggering the cancellable object from another thread. If the operation
19826  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19827  *
19828  * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19829  */
19830
19831
19832 /**
19833  * g_file_monitor:
19834  * @file: input #GFile
19835  * @flags: a set of #GFileMonitorFlags
19836  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19837  * @error: a #GError, or %NULL
19838  *
19839  * Obtains a file or directory monitor for the given file,
19840  * depending on the type of the file.
19841  *
19842  * If @cancellable is not %NULL, then the operation can be cancelled by
19843  * triggering the cancellable object from another thread. If the operation
19844  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19845  *
19846  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19847  * Since: 2.18
19848  */
19849
19850
19851 /**
19852  * g_file_monitor_cancel:
19853  * @monitor: a #GFileMonitor.
19854  *
19855  * Cancels a file monitor.
19856  *
19857  * Returns: %TRUE if monitor was cancelled.
19858  */
19859
19860
19861 /**
19862  * g_file_monitor_directory:
19863  * @file: input #GFile
19864  * @flags: a set of #GFileMonitorFlags
19865  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19866  * @error: a #GError, or %NULL
19867  *
19868  * Obtains a directory monitor for the given file.
19869  * This may fail if directory monitoring is not supported.
19870  *
19871  * If @cancellable is not %NULL, then the operation can be cancelled by
19872  * triggering the cancellable object from another thread. If the operation
19873  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19874  *
19875  * Virtual: monitor_dir
19876  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19877  */
19878
19879
19880 /**
19881  * g_file_monitor_emit_event:
19882  * @monitor: a #GFileMonitor.
19883  * @child: a #GFile.
19884  * @other_file: a #GFile.
19885  * @event_type: a set of #GFileMonitorEvent flags.
19886  *
19887  * Emits the #GFileMonitor::changed signal if a change
19888  * has taken place. Should be called from file monitor
19889  * implementations only.
19890  *
19891  * The signal will be emitted from an idle handler (in the <link
19892  * linkend="g-main-context-push-thread-default">thread-default main
19893  * context</link>).
19894  */
19895
19896
19897 /**
19898  * g_file_monitor_file:
19899  * @file: input #GFile
19900  * @flags: a set of #GFileMonitorFlags
19901  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19902  * @error: a #GError, or %NULL
19903  *
19904  * Obtains a file monitor for the given file. If no file notification
19905  * mechanism exists, then regular polling of the file is used.
19906  *
19907  * If @cancellable is not %NULL, then the operation can be cancelled by
19908  * triggering the cancellable object from another thread. If the operation
19909  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19910  *
19911  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19912  */
19913
19914
19915 /**
19916  * g_file_monitor_is_cancelled:
19917  * @monitor: a #GFileMonitor
19918  *
19919  * Returns whether the monitor is canceled.
19920  *
19921  * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19922  */
19923
19924
19925 /**
19926  * g_file_monitor_set_rate_limit:
19927  * @monitor: a #GFileMonitor.
19928  * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19929  *
19930  * Sets the rate limit to which the @monitor will report
19931  * consecutive change events to the same file.
19932  */
19933
19934
19935 /**
19936  * g_file_mount_enclosing_volume:
19937  * @location: input #GFile
19938  * @flags: flags affecting the operation
19939  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19940  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19941  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19942  * @user_data: the data to pass to callback function
19943  *
19944  * Starts a @mount_operation, mounting the volume that contains
19945  * the file @location.
19946  *
19947  * When this operation has completed, @callback will be called with
19948  * @user_user data, and the operation can be finalized with
19949  * g_file_mount_enclosing_volume_finish().
19950  *
19951  * If @cancellable is not %NULL, then the operation can be cancelled by
19952  * triggering the cancellable object from another thread. If the operation
19953  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19954  */
19955
19956
19957 /**
19958  * g_file_mount_enclosing_volume_finish:
19959  * @location: input #GFile
19960  * @result: a #GAsyncResult
19961  * @error: a #GError, or %NULL
19962  *
19963  * Finishes a mount operation started by g_file_mount_enclosing_volume().
19964  *
19965  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19966  */
19967
19968
19969 /**
19970  * g_file_mount_mountable:
19971  * @file: input #GFile
19972  * @flags: flags affecting the operation
19973  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19974  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19975  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19976  * @user_data: (closure): the data to pass to callback function
19977  *
19978  * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19979  * Using @mount_operation, you can request callbacks when, for instance,
19980  * passwords are needed during authentication.
19981  *
19982  * If @cancellable is not %NULL, then the operation can be cancelled by
19983  * triggering the cancellable object from another thread. If the operation
19984  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19985  *
19986  * When the operation is finished, @callback will be called.
19987  * You can then call g_file_mount_mountable_finish() to get
19988  * the result of the operation.
19989  */
19990
19991
19992 /**
19993  * g_file_mount_mountable_finish:
19994  * @file: input #GFile
19995  * @result: a #GAsyncResult
19996  * @error: a #GError, or %NULL
19997  *
19998  * Finishes a mount operation. See g_file_mount_mountable() for details.
19999  *
20000  * Finish an asynchronous mount operation that was started
20001  * with g_file_mount_mountable().
20002  *
20003  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20004  */
20005
20006
20007 /**
20008  * g_file_move:
20009  * @source: #GFile pointing to the source location
20010  * @destination: #GFile pointing to the destination location
20011  * @flags: set of #GFileCopyFlags
20012  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20013  * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
20014  * @progress_callback_data: (closure): gpointer to user data for the callback function
20015  * @error: #GError for returning error conditions, or %NULL
20016  *
20017  * Tries to move the file or directory @source to the location specified
20018  * by @destination. If native move operations are supported then this is
20019  * used, otherwise a copy + delete fallback is used. The native
20020  * implementation may support moving directories (for instance on moves
20021  * inside the same filesystem), but the fallback code does not.
20022  *
20023  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
20024  * existing @destination file is overwritten.
20025  *
20026  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
20027  * will be copied as symlinks, otherwise the target of the
20028  * @source symlink will be copied.
20029  *
20030  * If @cancellable is not %NULL, then the operation can be cancelled by
20031  * triggering the cancellable object from another thread. If the operation
20032  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20033  *
20034  * If @progress_callback is not %NULL, then the operation can be monitored
20035  * by setting this to a #GFileProgressCallback function.
20036  * @progress_callback_data will be passed to this function. It is
20037  * guaranteed that this callback will be called after all data has been
20038  * transferred with the total number of bytes copied during the operation.
20039  *
20040  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
20041  * error is returned, independent on the status of the @destination.
20042  *
20043  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
20044  * then the error %G_IO_ERROR_EXISTS is returned.
20045  *
20046  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
20047  * error is returned. If trying to overwrite a directory with a directory the
20048  * %G_IO_ERROR_WOULD_MERGE error is returned.
20049  *
20050  * If the source is a directory and the target does not exist, or
20051  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
20052  * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
20053  * move operation isn't available).
20054  *
20055  * Returns: %TRUE on successful move, %FALSE otherwise.
20056  */
20057
20058
20059 /**
20060  * g_file_new_for_commandline_arg:
20061  * @arg: a command line string
20062  *
20063  * Creates a #GFile with the given argument from the command line.
20064  * The value of @arg can be either a URI, an absolute path or a
20065  * relative path resolved relative to the current working directory.
20066  * This operation never fails, but the returned object might not
20067  * support any I/O operation if @arg points to a malformed path.
20068  *
20069  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
20070  */
20071
20072
20073 /**
20074  * g_file_new_for_path:
20075  * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
20076  *
20077  * Constructs a #GFile for a given path. This operation never
20078  * fails, but the returned object might not support any I/O
20079  * operation if @path is malformed.
20080  *
20081  * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
20082  */
20083
20084
20085 /**
20086  * g_file_new_for_uri:
20087  * @uri: a UTF-8 string containing a URI
20088  *
20089  * Constructs a #GFile for a given URI. This operation never
20090  * fails, but the returned object might not support any I/O
20091  * operation if @uri is malformed or if the uri type is
20092  * not supported.
20093  *
20094  * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
20095  */
20096
20097
20098 /**
20099  * g_file_new_tmp:
20100  * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
20101  * @iostream: (out): on return, a #GFileIOStream for the created file
20102  * @error: a #GError, or %NULL
20103  *
20104  * Opens a file in the preferred directory for temporary files (as
20105  * returned by g_get_tmp_dir()) and returns a #GFile and
20106  * #GFileIOStream pointing to it.
20107  *
20108  * @tmpl should be a string in the GLib file name encoding
20109  * containing a sequence of six 'X' characters, and containing no
20110  * directory components. If it is %NULL, a default template is used.
20111  *
20112  * Unlike the other #GFile constructors, this will return %NULL if
20113  * a temporary file could not be created.
20114  *
20115  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
20116  * Since: 2.32
20117  */
20118
20119
20120 /**
20121  * g_file_open_readwrite:
20122  * @file: #GFile to open
20123  * @cancellable: (allow-none): a #GCancellable
20124  * @error: a #GError, or %NULL
20125  *
20126  * Opens an existing file for reading and writing. The result is
20127  * a #GFileIOStream that can be used to read and write the contents
20128  * of the file.
20129  *
20130  * If @cancellable is not %NULL, then the operation can be cancelled
20131  * by triggering the cancellable object from another thread. If the
20132  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20133  * returned.
20134  *
20135  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
20136  * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20137  * error will be returned. Other errors are possible too, and depend on
20138  * what kind of filesystem the file is on. Note that in many non-local
20139  * file cases read and write streams are not supported, so make sure you
20140  * really need to do read and write streaming, rather than just opening
20141  * for reading or writing.
20142  *
20143  * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20144  * Since: 2.22
20145  */
20146
20147
20148 /**
20149  * g_file_open_readwrite_async:
20150  * @file: input #GFile
20151  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20152  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20153  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20154  * @user_data: (closure): the data to pass to callback function
20155  *
20156  * Asynchronously opens @file for reading and writing.
20157  *
20158  * For more details, see g_file_open_readwrite() which is
20159  * the synchronous version of this call.
20160  *
20161  * When the operation is finished, @callback will be called.
20162  * You can then call g_file_open_readwrite_finish() to get
20163  * the result of the operation.
20164  *
20165  * Since: 2.22
20166  */
20167
20168
20169 /**
20170  * g_file_open_readwrite_finish:
20171  * @file: input #GFile
20172  * @res: a #GAsyncResult
20173  * @error: a #GError, or %NULL
20174  *
20175  * Finishes an asynchronous file read operation started with
20176  * g_file_open_readwrite_async().
20177  *
20178  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20179  * Since: 2.22
20180  */
20181
20182
20183 /**
20184  * g_file_output_stream_get_etag:
20185  * @stream: a #GFileOutputStream.
20186  *
20187  * Gets the entity tag for the file when it has been written.
20188  * This must be called after the stream has been written
20189  * and closed, as the etag can change while writing.
20190  *
20191  * Returns: the entity tag for the stream.
20192  */
20193
20194
20195 /**
20196  * g_file_output_stream_query_info:
20197  * @stream: a #GFileOutputStream.
20198  * @attributes: a file attribute query string.
20199  * @cancellable: optional #GCancellable object, %NULL to ignore.
20200  * @error: a #GError, %NULL to ignore.
20201  *
20202  * Queries a file output stream for the given @attributes.
20203  * This function blocks while querying the stream. For the asynchronous
20204  * version of this function, see g_file_output_stream_query_info_async().
20205  * While the stream is blocked, the stream will set the pending flag
20206  * internally, and any other operations on the stream will fail with
20207  * %G_IO_ERROR_PENDING.
20208  *
20209  * Can fail if the stream was already closed (with @error being set to
20210  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
20211  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
20212  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
20213  * all cases of failure, %NULL will be returned.
20214  *
20215  * If @cancellable is not %NULL, then the operation can be cancelled by
20216  * triggering the cancellable object from another thread. If the operation
20217  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
20218  * be returned.
20219  *
20220  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
20221  */
20222
20223
20224 /**
20225  * g_file_output_stream_query_info_async:
20226  * @stream: a #GFileOutputStream.
20227  * @attributes: a file attribute query string.
20228  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
20229  * @cancellable: optional #GCancellable object, %NULL to ignore.
20230  * @callback: callback to call when the request is satisfied
20231  * @user_data: the data to pass to callback function
20232  *
20233  * Asynchronously queries the @stream for a #GFileInfo. When completed,
20234  * @callback will be called with a #GAsyncResult which can be used to
20235  * finish the operation with g_file_output_stream_query_info_finish().
20236  *
20237  * For the synchronous version of this function, see
20238  * g_file_output_stream_query_info().
20239  */
20240
20241
20242 /**
20243  * g_file_output_stream_query_info_finish:
20244  * @stream: a #GFileOutputStream.
20245  * @result: a #GAsyncResult.
20246  * @error: a #GError, %NULL to ignore.
20247  *
20248  * Finalizes the asynchronous query started
20249  * by g_file_output_stream_query_info_async().
20250  *
20251  * Returns: (transfer full): A #GFileInfo for the finished query.
20252  */
20253
20254
20255 /**
20256  * g_file_parse_name:
20257  * @parse_name: a file name or path to be parsed
20258  *
20259  * Constructs a #GFile with the given @parse_name (i.e. something
20260  * given by g_file_get_parse_name()). This operation never fails,
20261  * but the returned object might not support any I/O operation if
20262  * the @parse_name cannot be parsed.
20263  *
20264  * Returns: (transfer full): a new #GFile.
20265  */
20266
20267
20268 /**
20269  * g_file_poll_mountable:
20270  * @file: input #GFile
20271  * @cancellable: optional #GCancellable object, %NULL to ignore
20272  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20273  * @user_data: the data to pass to callback function
20274  *
20275  * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
20276  *
20277  * If @cancellable is not %NULL, then the operation can be cancelled by
20278  * triggering the cancellable object from another thread. If the operation
20279  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20280  *
20281  * When the operation is finished, @callback will be called.
20282  * You can then call g_file_mount_mountable_finish() to get
20283  * the result of the operation.
20284  *
20285  * Since: 2.22
20286  */
20287
20288
20289 /**
20290  * g_file_poll_mountable_finish:
20291  * @file: input #GFile
20292  * @result: a #GAsyncResult
20293  * @error: a #GError, or %NULL
20294  *
20295  * Finishes a poll operation. See g_file_poll_mountable() for details.
20296  *
20297  * Finish an asynchronous poll operation that was polled
20298  * with g_file_poll_mountable().
20299  *
20300  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20301  * Since: 2.22
20302  */
20303
20304
20305 /**
20306  * g_file_query_default_handler:
20307  * @file: a #GFile to open
20308  * @cancellable: optional #GCancellable object, %NULL to ignore
20309  * @error: a #GError, or %NULL
20310  *
20311  * Returns the #GAppInfo that is registered as the default
20312  * application to handle the file specified by @file.
20313  *
20314  * If @cancellable is not %NULL, then the operation can be cancelled by
20315  * triggering the cancellable object from another thread. If the operation
20316  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20317  *
20318  * 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()
20319  */
20320
20321
20322 /**
20323  * g_file_query_exists:
20324  * @file: input #GFile
20325  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20326  *
20327  * Utility function to check if a particular file exists. This is
20328  * implemented using g_file_query_info() and as such does blocking I/O.
20329  *
20330  * Note that in many cases it is racy to first check for file existence
20331  * and then execute something based on the outcome of that, because the
20332  * file might have been created or removed in between the operations. The
20333  * general approach to handling that is to not check, but just do the
20334  * operation and handle the errors as they come.
20335  *
20336  * As an example of race-free checking, take the case of reading a file,
20337  * and if it doesn't exist, creating it. There are two racy versions: read
20338  * it, and on error create it; and: check if it exists, if not create it.
20339  * These can both result in two processes creating the file (with perhaps
20340  * a partially written file as the result). The correct approach is to
20341  * always try to create the file with g_file_create() which will either
20342  * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
20343  *
20344  * However, in many cases an existence check is useful in a user interface,
20345  * for instance to make a menu item sensitive/insensitive, so that you don't
20346  * have to fool users that something is possible and then just show an error
20347  * dialog. If you do this, you should make sure to also handle the errors
20348  * that can happen due to races when you execute the operation.
20349  *
20350  * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
20351  */
20352
20353
20354 /**
20355  * g_file_query_file_type:
20356  * @file: input #GFile
20357  * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
20358  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20359  *
20360  * Utility function to inspect the #GFileType of a file. This is
20361  * implemented using g_file_query_info() and as such does blocking I/O.
20362  *
20363  * The primary use case of this method is to check if a file is
20364  * a regular file, directory, or symlink.
20365  *
20366  * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
20367  * Since: 2.18
20368  */
20369
20370
20371 /**
20372  * g_file_query_filesystem_info:
20373  * @file: input #GFile
20374  * @attributes: an attribute query string
20375  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20376  * @error: a #GError
20377  *
20378  * Similar to g_file_query_info(), but obtains information
20379  * about the filesystem the @file is on, rather than the file itself.
20380  * For instance the amount of space available and the type of
20381  * the filesystem.
20382  *
20383  * The @attributes value is a string that specifies the attributes
20384  * that should be gathered. It is not an error if it's not possible
20385  * to read a particular requested attribute from a file - it just
20386  * won't be set. @attributes should be a comma-separated list of
20387  * attributes or attribute wildcards. The wildcard "*" means all
20388  * attributes, and a wildcard like "filesystem::*" means all attributes
20389  * in the filesystem namespace. The standard namespace for filesystem
20390  * attributes is "filesystem". Common attributes of interest are
20391  * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
20392  * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
20393  * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
20394  *
20395  * If @cancellable is not %NULL, then the operation can be cancelled
20396  * by triggering the cancellable object from another thread. If the
20397  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20398  * returned.
20399  *
20400  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
20401  * be returned. Other errors are possible too, and depend on what
20402  * kind of filesystem the file is on.
20403  *
20404  * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
20405  */
20406
20407
20408 /**
20409  * g_file_query_filesystem_info_async:
20410  * @file: input #GFile
20411  * @attributes: an attribute query string
20412  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20413  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20414  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20415  * @user_data: (closure): the data to pass to callback function
20416  *
20417  * Asynchronously gets the requested information about the filesystem
20418  * that the specified @file is on. The result is a #GFileInfo object
20419  * that contains key-value attributes (such as type or size for the
20420  * file).
20421  *
20422  * For more details, see g_file_query_filesystem_info() which is the
20423  * synchronous version of this call.
20424  *
20425  * When the operation is finished, @callback will be called. You can
20426  * then call g_file_query_info_finish() to get the result of the
20427  * operation.
20428  */
20429
20430
20431 /**
20432  * g_file_query_filesystem_info_finish:
20433  * @file: input #GFile
20434  * @res: a #GAsyncResult
20435  * @error: a #GError
20436  *
20437  * Finishes an asynchronous filesystem info query.
20438  * See g_file_query_filesystem_info_async().
20439  *
20440  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20441  */
20442
20443
20444 /**
20445  * g_file_query_info:
20446  * @file: input #GFile
20447  * @attributes: an attribute query string
20448  * @flags: a set of #GFileQueryInfoFlags
20449  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20450  * @error: a #GError
20451  *
20452  * Gets the requested information about specified @file.
20453  * The result is a #GFileInfo object that contains key-value
20454  * attributes (such as the type or size of the file).
20455  *
20456  * The @attributes value is a string that specifies the file
20457  * attributes that should be gathered. It is not an error if
20458  * it's not possible to read a particular requested attribute
20459  * from a file - it just won't be set. @attributes should be a
20460  * comma-separated list of attributes or attribute wildcards.
20461  * The wildcard "*" means all attributes, and a wildcard like
20462  * "standard::*" means all attributes in the standard namespace.
20463  * An example attribute query be "standard::*,owner::user".
20464  * The standard attributes are available as defines, like
20465  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
20466  *
20467  * If @cancellable is not %NULL, then the operation can be cancelled
20468  * by triggering the cancellable object from another thread. If the
20469  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20470  * returned.
20471  *
20472  * For symlinks, normally the information about the target of the
20473  * symlink is returned, rather than information about the symlink
20474  * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
20475  * in @flags the information about the symlink itself will be returned.
20476  * Also, for symlinks that point to non-existing files the information
20477  * about the symlink itself will be returned.
20478  *
20479  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20480  * returned. Other errors are possible too, and depend on what kind of
20481  * filesystem the file is on.
20482  *
20483  * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
20484  */
20485
20486
20487 /**
20488  * g_file_query_info_async:
20489  * @file: input #GFile
20490  * @attributes: an attribute query string
20491  * @flags: a set of #GFileQueryInfoFlags
20492  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20493  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20494  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20495  * @user_data: (closure): the data to pass to callback function
20496  *
20497  * Asynchronously gets the requested information about specified @file.
20498  * The result is a #GFileInfo object that contains key-value attributes
20499  * (such as type or size for the file).
20500  *
20501  * For more details, see g_file_query_info() which is the synchronous
20502  * version of this call.
20503  *
20504  * When the operation is finished, @callback will be called. You can
20505  * then call g_file_query_info_finish() to get the result of the operation.
20506  */
20507
20508
20509 /**
20510  * g_file_query_info_finish:
20511  * @file: input #GFile
20512  * @res: a #GAsyncResult
20513  * @error: a #GError
20514  *
20515  * Finishes an asynchronous file info query.
20516  * See g_file_query_info_async().
20517  *
20518  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20519  */
20520
20521
20522 /**
20523  * g_file_query_settable_attributes:
20524  * @file: input #GFile
20525  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20526  * @error: a #GError, or %NULL
20527  *
20528  * Obtain the list of settable attributes for the file.
20529  *
20530  * Returns the type and full attribute name of all the attributes
20531  * that can be set on this file. This doesn't mean setting it will
20532  * always succeed though, you might get an access failure, or some
20533  * specific file may not support a specific attribute.
20534  *
20535  * If @cancellable is not %NULL, then the operation can be cancelled by
20536  * triggering the cancellable object from another thread. If the operation
20537  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20538  *
20539  * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
20540  */
20541
20542
20543 /**
20544  * g_file_query_writable_namespaces:
20545  * @file: input #GFile
20546  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20547  * @error: a #GError, or %NULL
20548  *
20549  * Obtain the list of attribute namespaces where new attributes
20550  * can be created by a user. An example of this is extended
20551  * attributes (in the "xattr" namespace).
20552  *
20553  * If @cancellable is not %NULL, then the operation can be cancelled by
20554  * triggering the cancellable object from another thread. If the operation
20555  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20556  *
20557  * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
20558  */
20559
20560
20561 /**
20562  * g_file_read:
20563  * @file: #GFile to read
20564  * @cancellable: (allow-none): a #GCancellable
20565  * @error: a #GError, or %NULL
20566  *
20567  * Opens a file for reading. The result is a #GFileInputStream that
20568  * can be used to read the contents of the file.
20569  *
20570  * If @cancellable is not %NULL, then the operation can be cancelled by
20571  * triggering the cancellable object from another thread. If the operation
20572  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20573  *
20574  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20575  * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20576  * error will be returned. Other errors are possible too, and depend
20577  * on what kind of filesystem the file is on.
20578  *
20579  * Virtual: read_fn
20580  * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20581  */
20582
20583
20584 /**
20585  * g_file_read_async:
20586  * @file: input #GFile
20587  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20588  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20589  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20590  * @user_data: (closure): the data to pass to callback function
20591  *
20592  * Asynchronously opens @file for reading.
20593  *
20594  * For more details, see g_file_read() which is
20595  * the synchronous version of this call.
20596  *
20597  * When the operation is finished, @callback will be called.
20598  * You can then call g_file_read_finish() to get the result
20599  * of the operation.
20600  */
20601
20602
20603 /**
20604  * g_file_read_finish:
20605  * @file: input #GFile
20606  * @res: a #GAsyncResult
20607  * @error: a #GError, or %NULL
20608  *
20609  * Finishes an asynchronous file read operation started with
20610  * g_file_read_async().
20611  *
20612  * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20613  */
20614
20615
20616 /**
20617  * g_file_replace:
20618  * @file: input #GFile
20619  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20620  * @make_backup: %TRUE if a backup should be created
20621  * @flags: a set of #GFileCreateFlags
20622  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20623  * @error: a #GError, or %NULL
20624  *
20625  * Returns an output stream for overwriting the file, possibly
20626  * creating a backup copy of the file first. If the file doesn't exist,
20627  * it will be created.
20628  *
20629  * This will try to replace the file in the safest way possible so
20630  * that any errors during the writing will not affect an already
20631  * existing copy of the file. For instance, for local files it
20632  * may write to a temporary file and then atomically rename over
20633  * the destination when the stream is closed.
20634  *
20635  * By default files created are generally readable by everyone,
20636  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20637  * will be made readable only to the current user, to the level that
20638  * is supported on the target filesystem.
20639  *
20640  * If @cancellable is not %NULL, then the operation can be cancelled
20641  * by triggering the cancellable object from another thread. If the
20642  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20643  * returned.
20644  *
20645  * If you pass in a non-%NULL @etag value, then this value is
20646  * compared to the current entity tag of the file, and if they differ
20647  * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20648  * that the file has been changed since you last read it. You can get
20649  * the new etag from g_file_output_stream_get_etag() after you've
20650  * finished writing and closed the #GFileOutputStream. When you load
20651  * a new file you can use g_file_input_stream_query_info() to get
20652  * the etag of the file.
20653  *
20654  * If @make_backup is %TRUE, this function will attempt to make a
20655  * backup of the current file before overwriting it. If this fails
20656  * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20657  * want to replace anyway, try again with @make_backup set to %FALSE.
20658  *
20659  * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20660  * be returned, and if the file is some other form of non-regular file
20661  * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20662  * file systems don't allow all file names, and may return an
20663  * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20664  * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20665  * possible too, and depend on what kind of filesystem the file is on.
20666  *
20667  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20668  */
20669
20670
20671 /**
20672  * g_file_replace_async:
20673  * @file: input #GFile
20674  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20675  * @make_backup: %TRUE if a backup should be created
20676  * @flags: a set of #GFileCreateFlags
20677  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20678  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20679  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20680  * @user_data: (closure): the data to pass to callback function
20681  *
20682  * Asynchronously overwrites the file, replacing the contents,
20683  * possibly creating a backup copy of the file first.
20684  *
20685  * For more details, see g_file_replace() which is
20686  * the synchronous version of this call.
20687  *
20688  * When the operation is finished, @callback will be called.
20689  * You can then call g_file_replace_finish() to get the result
20690  * of the operation.
20691  */
20692
20693
20694 /**
20695  * g_file_replace_contents:
20696  * @file: input #GFile
20697  * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20698  * @length: the length of @contents in bytes
20699  * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20700  * @make_backup: %TRUE if a backup should be created
20701  * @flags: a set of #GFileCreateFlags
20702  * @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
20703  * @cancellable: optional #GCancellable object, %NULL to ignore
20704  * @error: a #GError, or %NULL
20705  *
20706  * Replaces the contents of @file with @contents of @length bytes.
20707  *
20708  * If @etag is specified (not %NULL), any existing file must have that etag,
20709  * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20710  *
20711  * If @make_backup is %TRUE, this function will attempt to make a backup
20712  * of @file.
20713  *
20714  * If @cancellable is not %NULL, then the operation can be cancelled by
20715  * triggering the cancellable object from another thread. If the operation
20716  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20717  *
20718  * The returned @new_etag can be used to verify that the file hasn't
20719  * changed the next time it is saved over.
20720  *
20721  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20722  */
20723
20724
20725 /**
20726  * g_file_replace_contents_async:
20727  * @file: input #GFile
20728  * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20729  * @length: the length of @contents in bytes
20730  * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20731  * @make_backup: %TRUE if a backup should be created
20732  * @flags: a set of #GFileCreateFlags
20733  * @cancellable: optional #GCancellable object, %NULL to ignore
20734  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20735  * @user_data: the data to pass to callback function
20736  *
20737  * Starts an asynchronous replacement of @file with the given
20738  * @contents of @length bytes. @etag will replace the document's
20739  * current entity tag.
20740  *
20741  * When this operation has completed, @callback will be called with
20742  * @user_user data, and the operation can be finalized with
20743  * g_file_replace_contents_finish().
20744  *
20745  * If @cancellable is not %NULL, then the operation can be cancelled by
20746  * triggering the cancellable object from another thread. If the operation
20747  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20748  *
20749  * If @make_backup is %TRUE, this function will attempt to
20750  * make a backup of @file.
20751  */
20752
20753
20754 /**
20755  * g_file_replace_contents_finish:
20756  * @file: input #GFile
20757  * @res: a #GAsyncResult
20758  * @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
20759  * @error: a #GError, or %NULL
20760  *
20761  * Finishes an asynchronous replace of the given @file. See
20762  * g_file_replace_contents_async(). Sets @new_etag to the new entity
20763  * tag for the document, if present.
20764  *
20765  * Returns: %TRUE on success, %FALSE on failure.
20766  */
20767
20768
20769 /**
20770  * g_file_replace_finish:
20771  * @file: input #GFile
20772  * @res: a #GAsyncResult
20773  * @error: a #GError, or %NULL
20774  *
20775  * Finishes an asynchronous file replace operation started with
20776  * g_file_replace_async().
20777  *
20778  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20779  */
20780
20781
20782 /**
20783  * g_file_replace_readwrite:
20784  * @file: a #GFile
20785  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20786  * @make_backup: %TRUE if a backup should be created
20787  * @flags: a set of #GFileCreateFlags
20788  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20789  * @error: return location for a #GError, or %NULL
20790  *
20791  * Returns an output stream for overwriting the file in readwrite mode,
20792  * possibly creating a backup copy of the file first. If the file doesn't
20793  * exist, it will be created.
20794  *
20795  * For details about the behaviour, see g_file_replace() which does the
20796  * same thing but returns an output stream only.
20797  *
20798  * Note that in many non-local file cases read and write streams are not
20799  * supported, so make sure you really need to do read and write streaming,
20800  * rather than just opening for reading or writing.
20801  *
20802  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20803  * Since: 2.22
20804  */
20805
20806
20807 /**
20808  * g_file_replace_readwrite_async:
20809  * @file: input #GFile
20810  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20811  * @make_backup: %TRUE if a backup should be created
20812  * @flags: a set of #GFileCreateFlags
20813  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20814  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20815  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20816  * @user_data: (closure): the data to pass to callback function
20817  *
20818  * Asynchronously overwrites the file in read-write mode,
20819  * replacing the contents, possibly creating a backup copy
20820  * of the file first.
20821  *
20822  * For more details, see g_file_replace_readwrite() which is
20823  * the synchronous version of this call.
20824  *
20825  * When the operation is finished, @callback will be called.
20826  * You can then call g_file_replace_readwrite_finish() to get
20827  * the result of the operation.
20828  *
20829  * Since: 2.22
20830  */
20831
20832
20833 /**
20834  * g_file_replace_readwrite_finish:
20835  * @file: input #GFile
20836  * @res: a #GAsyncResult
20837  * @error: a #GError, or %NULL
20838  *
20839  * Finishes an asynchronous file replace operation started with
20840  * g_file_replace_readwrite_async().
20841  *
20842  * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20843  * Since: 2.22
20844  */
20845
20846
20847 /**
20848  * g_file_resolve_relative_path:
20849  * @file: input #GFile
20850  * @relative_path: a given relative path string
20851  *
20852  * Resolves a relative path for @file to an absolute path.
20853  *
20854  * This call does no blocking I/O.
20855  *
20856  * 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().
20857  */
20858
20859
20860 /**
20861  * g_file_set_attribute:
20862  * @file: input #GFile
20863  * @attribute: a string containing the attribute's name
20864  * @type: The type of the attribute
20865  * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20866  * @flags: a set of #GFileQueryInfoFlags
20867  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20868  * @error: a #GError, or %NULL
20869  *
20870  * Sets an attribute in the file with attribute name @attribute to @value.
20871  *
20872  * Some attributes can be unset by setting @attribute to
20873  * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20874  *
20875  * If @cancellable is not %NULL, then the operation can be cancelled by
20876  * triggering the cancellable object from another thread. If the operation
20877  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20878  *
20879  * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20880  */
20881
20882
20883 /**
20884  * g_file_set_attribute_byte_string:
20885  * @file: input #GFile
20886  * @attribute: a string containing the attribute's name
20887  * @value: a string containing the attribute's new value
20888  * @flags: a #GFileQueryInfoFlags
20889  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20890  * @error: a #GError, or %NULL
20891  *
20892  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20893  * If @attribute is of a different type, this operation will fail,
20894  * returning %FALSE.
20895  *
20896  * If @cancellable is not %NULL, then the operation can be cancelled by
20897  * triggering the cancellable object from another thread. If the operation
20898  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20899  *
20900  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20901  */
20902
20903
20904 /**
20905  * g_file_set_attribute_int32:
20906  * @file: input #GFile
20907  * @attribute: a string containing the attribute's name
20908  * @value: a #gint32 containing the attribute's new value
20909  * @flags: a #GFileQueryInfoFlags
20910  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20911  * @error: a #GError, or %NULL
20912  *
20913  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20914  * If @attribute is of a different type, this operation will fail.
20915  *
20916  * If @cancellable is not %NULL, then the operation can be cancelled by
20917  * triggering the cancellable object from another thread. If the operation
20918  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20919  *
20920  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20921  */
20922
20923
20924 /**
20925  * g_file_set_attribute_int64:
20926  * @file: input #GFile
20927  * @attribute: a string containing the attribute's name
20928  * @value: a #guint64 containing the attribute's new value
20929  * @flags: a #GFileQueryInfoFlags
20930  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20931  * @error: a #GError, or %NULL
20932  *
20933  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20934  * If @attribute is of a different type, this operation will fail.
20935  *
20936  * If @cancellable is not %NULL, then the operation can be cancelled by
20937  * triggering the cancellable object from another thread. If the operation
20938  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20939  *
20940  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20941  */
20942
20943
20944 /**
20945  * g_file_set_attribute_string:
20946  * @file: input #GFile
20947  * @attribute: a string containing the attribute's name
20948  * @value: a string containing the attribute's value
20949  * @flags: #GFileQueryInfoFlags
20950  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20951  * @error: a #GError, or %NULL
20952  *
20953  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20954  * If @attribute is of a different type, this operation will fail.
20955  *
20956  * If @cancellable is not %NULL, then the operation can be cancelled by
20957  * triggering the cancellable object from another thread. If the operation
20958  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20959  *
20960  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20961  */
20962
20963
20964 /**
20965  * g_file_set_attribute_uint32:
20966  * @file: input #GFile
20967  * @attribute: a string containing the attribute's name
20968  * @value: a #guint32 containing the attribute's new value
20969  * @flags: a #GFileQueryInfoFlags
20970  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20971  * @error: a #GError, or %NULL
20972  *
20973  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20974  * If @attribute is of a different type, this operation will fail.
20975  *
20976  * If @cancellable is not %NULL, then the operation can be cancelled by
20977  * triggering the cancellable object from another thread. If the operation
20978  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20979  *
20980  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20981  */
20982
20983
20984 /**
20985  * g_file_set_attribute_uint64:
20986  * @file: input #GFile
20987  * @attribute: a string containing the attribute's name
20988  * @value: a #guint64 containing the attribute's new value
20989  * @flags: a #GFileQueryInfoFlags
20990  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20991  * @error: a #GError, or %NULL
20992  *
20993  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20994  * If @attribute is of a different type, this operation will fail.
20995  *
20996  * If @cancellable is not %NULL, then the operation can be cancelled by
20997  * triggering the cancellable object from another thread. If the operation
20998  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20999  *
21000  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
21001  */
21002
21003
21004 /**
21005  * g_file_set_attributes_async:
21006  * @file: input #GFile
21007  * @info: a #GFileInfo
21008  * @flags: a #GFileQueryInfoFlags
21009  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
21010  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21011  * @callback: (scope async): a #GAsyncReadyCallback
21012  * @user_data: (closure): a #gpointer
21013  *
21014  * Asynchronously sets the attributes of @file with @info.
21015  *
21016  * For more details, see g_file_set_attributes_from_info(),
21017  * which is the synchronous version of this call.
21018  *
21019  * When the operation is finished, @callback will be called.
21020  * You can then call g_file_set_attributes_finish() to get
21021  * the result of the operation.
21022  */
21023
21024
21025 /**
21026  * g_file_set_attributes_finish:
21027  * @file: input #GFile
21028  * @result: a #GAsyncResult
21029  * @info: (out) (transfer full): a #GFileInfo
21030  * @error: a #GError, or %NULL
21031  *
21032  * Finishes setting an attribute started in g_file_set_attributes_async().
21033  *
21034  * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
21035  */
21036
21037
21038 /**
21039  * g_file_set_attributes_from_info:
21040  * @file: input #GFile
21041  * @info: a #GFileInfo
21042  * @flags: #GFileQueryInfoFlags
21043  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21044  * @error: a #GError, or %NULL
21045  *
21046  * Tries to set all attributes in the #GFileInfo on the target
21047  * values, not stopping on the first error.
21048  *
21049  * If there is any error during this operation then @error will
21050  * be set to the first error. Error on particular fields are flagged
21051  * by setting the "status" field in the attribute value to
21052  * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
21053  * also detect further errors.
21054  *
21055  * If @cancellable is not %NULL, then the operation can be cancelled by
21056  * triggering the cancellable object from another thread. If the operation
21057  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21058  *
21059  * Returns: %TRUE if there was any error, %FALSE otherwise.
21060  */
21061
21062
21063 /**
21064  * g_file_set_display_name:
21065  * @file: input #GFile
21066  * @display_name: a string
21067  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21068  * @error: a #GError, or %NULL
21069  *
21070  * Renames @file to the specified display name.
21071  *
21072  * The display name is converted from UTF-8 to the correct encoding
21073  * for the target filesystem if possible and the @file is renamed to this.
21074  *
21075  * If you want to implement a rename operation in the user interface the
21076  * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
21077  * initial value in the rename widget, and then the result after editing
21078  * should be passed to g_file_set_display_name().
21079  *
21080  * On success the resulting converted filename is returned.
21081  *
21082  * If @cancellable is not %NULL, then the operation can be cancelled by
21083  * triggering the cancellable object from another thread. If the operation
21084  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21085  *
21086  * 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().
21087  */
21088
21089
21090 /**
21091  * g_file_set_display_name_async:
21092  * @file: input #GFile
21093  * @display_name: a string
21094  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
21095  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21096  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
21097  * @user_data: (closure): the data to pass to callback function
21098  *
21099  * Asynchronously sets the display name for a given #GFile.
21100  *
21101  * For more details, see g_file_set_display_name() which is
21102  * the synchronous version of this call.
21103  *
21104  * When the operation is finished, @callback will be called.
21105  * You can then call g_file_set_display_name_finish() to get
21106  * the result of the operation.
21107  */
21108
21109
21110 /**
21111  * g_file_set_display_name_finish:
21112  * @file: input #GFile
21113  * @res: a #GAsyncResult
21114  * @error: a #GError, or %NULL
21115  *
21116  * Finishes setting a display name started with
21117  * g_file_set_display_name_async().
21118  *
21119  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
21120  */
21121
21122
21123 /**
21124  * g_file_start_mountable:
21125  * @file: input #GFile
21126  * @flags: flags affecting the operation
21127  * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
21128  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21129  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21130  * @user_data: the data to pass to callback function
21131  *
21132  * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
21133  * Using @start_operation, you can request callbacks when, for instance,
21134  * passwords are needed during authentication.
21135  *
21136  * If @cancellable is not %NULL, then the operation can be cancelled by
21137  * triggering the cancellable object from another thread. If the operation
21138  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21139  *
21140  * When the operation is finished, @callback will be called.
21141  * You can then call g_file_mount_mountable_finish() to get
21142  * the result of the operation.
21143  *
21144  * Since: 2.22
21145  */
21146
21147
21148 /**
21149  * g_file_start_mountable_finish:
21150  * @file: input #GFile
21151  * @result: a #GAsyncResult
21152  * @error: a #GError, or %NULL
21153  *
21154  * Finishes a start operation. See g_file_start_mountable() for details.
21155  *
21156  * Finish an asynchronous start operation that was started
21157  * with g_file_start_mountable().
21158  *
21159  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21160  * Since: 2.22
21161  */
21162
21163
21164 /**
21165  * g_file_stop_mountable:
21166  * @file: input #GFile
21167  * @flags: flags affecting the operation
21168  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
21169  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21170  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21171  * @user_data: the data to pass to callback function
21172  *
21173  * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
21174  *
21175  * If @cancellable is not %NULL, then the operation can be cancelled by
21176  * triggering the cancellable object from another thread. If the operation
21177  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21178  *
21179  * When the operation is finished, @callback will be called.
21180  * You can then call g_file_stop_mountable_finish() to get
21181  * the result of the operation.
21182  *
21183  * Since: 2.22
21184  */
21185
21186
21187 /**
21188  * g_file_stop_mountable_finish:
21189  * @file: input #GFile
21190  * @result: a #GAsyncResult
21191  * @error: a #GError, or %NULL
21192  *
21193  * Finishes an stop operation, see g_file_stop_mountable() for details.
21194  *
21195  * Finish an asynchronous stop operation that was started
21196  * with g_file_stop_mountable().
21197  *
21198  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21199  * Since: 2.22
21200  */
21201
21202
21203 /**
21204  * g_file_supports_thread_contexts:
21205  * @file: a #GFile
21206  *
21207  * Checks if @file supports <link
21208  * linkend="g-main-context-push-thread-default-context">thread-default
21209  * contexts</link>. If this returns %FALSE, you cannot perform
21210  * asynchronous operations on @file in a thread that has a
21211  * thread-default context.
21212  *
21213  * Returns: Whether or not @file supports thread-default contexts.
21214  * Since: 2.22
21215  */
21216
21217
21218 /**
21219  * g_file_trash:
21220  * @file: #GFile to send to trash
21221  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21222  * @error: a #GError, or %NULL
21223  *
21224  * Sends @file to the "Trashcan", if possible. This is similar to
21225  * deleting it, but the user can recover it before emptying the trashcan.
21226  * Not all file systems support trashing, so this call can return the
21227  * %G_IO_ERROR_NOT_SUPPORTED error.
21228  *
21229  * If @cancellable is not %NULL, then the operation can be cancelled by
21230  * triggering the cancellable object from another thread. If the operation
21231  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21232  *
21233  * Returns: %TRUE on successful trash, %FALSE otherwise.
21234  */
21235
21236
21237 /**
21238  * g_file_unmount_mountable:
21239  * @file: input #GFile
21240  * @flags: flags affecting the operation
21241  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21242  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21243  * @user_data: (closure): the data to pass to callback function
21244  *
21245  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
21246  *
21247  * If @cancellable is not %NULL, then the operation can be cancelled by
21248  * triggering the cancellable object from another thread. If the operation
21249  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21250  *
21251  * When the operation is finished, @callback will be called.
21252  * You can then call g_file_unmount_mountable_finish() to get
21253  * the result of the operation.
21254  *
21255  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
21256  */
21257
21258
21259 /**
21260  * g_file_unmount_mountable_finish:
21261  * @file: input #GFile
21262  * @result: a #GAsyncResult
21263  * @error: a #GError, or %NULL
21264  *
21265  * Finishes an unmount operation, see g_file_unmount_mountable() for details.
21266  *
21267  * Finish an asynchronous unmount operation that was started
21268  * with g_file_unmount_mountable().
21269  *
21270  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21271  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
21272  */
21273
21274
21275 /**
21276  * g_file_unmount_mountable_with_operation:
21277  * @file: input #GFile
21278  * @flags: flags affecting the operation
21279  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
21280  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21281  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21282  * @user_data: (closure): the data to pass to callback function
21283  *
21284  * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
21285  *
21286  * If @cancellable is not %NULL, then the operation can be cancelled by
21287  * triggering the cancellable object from another thread. If the operation
21288  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21289  *
21290  * When the operation is finished, @callback will be called.
21291  * You can then call g_file_unmount_mountable_finish() to get
21292  * the result of the operation.
21293  *
21294  * Since: 2.22
21295  */
21296
21297
21298 /**
21299  * g_file_unmount_mountable_with_operation_finish:
21300  * @file: input #GFile
21301  * @result: a #GAsyncResult
21302  * @error: a #GError, or %NULL
21303  *
21304  * Finishes an unmount operation,
21305  * see g_file_unmount_mountable_with_operation() for details.
21306  *
21307  * Finish an asynchronous unmount operation that was started
21308  * with g_file_unmount_mountable_with_operation().
21309  *
21310  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21311  * Since: 2.22
21312  */
21313
21314
21315 /**
21316  * g_filename_completer_get_completion_suffix:
21317  * @completer: the filename completer.
21318  * @initial_text: text to be completed.
21319  *
21320  * Obtains a completion for @initial_text from @completer.
21321  *
21322  * 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.
21323  */
21324
21325
21326 /**
21327  * g_filename_completer_get_completions:
21328  * @completer: the filename completer.
21329  * @initial_text: text to be completed.
21330  *
21331  * Gets an array of completion strings for a given initial text.
21332  *
21333  * 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.
21334  */
21335
21336
21337 /**
21338  * g_filename_completer_new:
21339  *
21340  * Creates a new filename completer.
21341  *
21342  * Returns: a #GFilenameCompleter.
21343  */
21344
21345
21346 /**
21347  * g_filename_completer_set_dirs_only:
21348  * @completer: the filename completer.
21349  * @dirs_only: a #gboolean.
21350  *
21351  * If @dirs_only is %TRUE, @completer will only
21352  * complete directory names, and not file names.
21353  */
21354
21355
21356 /**
21357  * g_filter_input_stream_get_base_stream:
21358  * @stream: a #GFilterInputStream.
21359  *
21360  * Gets the base stream for the filter stream.
21361  *
21362  * Returns: (transfer none): a #GInputStream.
21363  */
21364
21365
21366 /**
21367  * g_filter_input_stream_get_close_base_stream:
21368  * @stream: a #GFilterInputStream.
21369  *
21370  * Returns whether the base stream will be closed when @stream is
21371  * closed.
21372  *
21373  * Returns: %TRUE if the base stream will be closed.
21374  */
21375
21376
21377 /**
21378  * g_filter_input_stream_set_close_base_stream:
21379  * @stream: a #GFilterInputStream.
21380  * @close_base: %TRUE to close the base stream.
21381  *
21382  * Sets whether the base stream will be closed when @stream is closed.
21383  */
21384
21385
21386 /**
21387  * g_filter_output_stream_get_base_stream:
21388  * @stream: a #GFilterOutputStream.
21389  *
21390  * Gets the base stream for the filter stream.
21391  *
21392  * Returns: (transfer none): a #GOutputStream.
21393  */
21394
21395
21396 /**
21397  * g_filter_output_stream_get_close_base_stream:
21398  * @stream: a #GFilterOutputStream.
21399  *
21400  * Returns whether the base stream will be closed when @stream is
21401  * closed.
21402  *
21403  * Returns: %TRUE if the base stream will be closed.
21404  */
21405
21406
21407 /**
21408  * g_filter_output_stream_set_close_base_stream:
21409  * @stream: a #GFilterOutputStream.
21410  * @close_base: %TRUE to close the base stream.
21411  *
21412  * Sets whether the base stream will be closed when @stream is closed.
21413  */
21414
21415
21416 /**
21417  * g_icon_equal:
21418  * @icon1: (allow-none): pointer to the first #GIcon.
21419  * @icon2: (allow-none): pointer to the second #GIcon.
21420  *
21421  * Checks if two icons are equal.
21422  *
21423  * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
21424  */
21425
21426
21427 /**
21428  * g_icon_hash:
21429  * @icon: #gconstpointer to an icon object.
21430  *
21431  * Gets a hash for an icon.
21432  *
21433  * Virtual: hash
21434  * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
21435  */
21436
21437
21438 /**
21439  * g_icon_new_for_string:
21440  * @str: A string obtained via g_icon_to_string().
21441  * @error: Return location for error.
21442  *
21443  * Generate a #GIcon instance from @str. This function can fail if
21444  * @str is not valid - see g_icon_to_string() for discussion.
21445  *
21446  * If your application or library provides one or more #GIcon
21447  * implementations you need to ensure that each #GType is registered
21448  * with the type system prior to calling g_icon_new_for_string().
21449  *
21450  * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
21451  * Since: 2.20
21452  */
21453
21454
21455 /**
21456  * g_icon_to_string:
21457  * @icon: a #GIcon.
21458  *
21459  * Generates a textual representation of @icon that can be used for
21460  * serialization such as when passing @icon to a different process or
21461  * saving it to persistent storage. Use g_icon_new_for_string() to
21462  * get @icon back from the returned string.
21463  *
21464  * The encoding of the returned string is proprietary to #GIcon except
21465  * in the following two cases
21466  *
21467  * <itemizedlist>
21468  * <listitem><para>
21469  *     If @icon is a #GFileIcon, the returned string is a native path
21470  *     (such as <literal>/path/to/my icon.png</literal>) without escaping
21471  *     if the #GFile for @icon is a native file.  If the file is not
21472  *     native, the returned string is the result of g_file_get_uri()
21473  *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
21474  * </para></listitem>
21475  * <listitem><para>
21476  *    If @icon is a #GThemedIcon with exactly one name, the encoding is
21477  *    simply the name (such as <literal>network-server</literal>).
21478  * </para></listitem>
21479  * </itemizedlist>
21480  *
21481  * Virtual: to_tokens
21482  * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
21483  * Since: 2.20
21484  */
21485
21486
21487 /**
21488  * g_inet_address_equal:
21489  * @address: A #GInetAddress.
21490  * @other_address: Another #GInetAddress.
21491  *
21492  * Checks if two #GInetAddress instances are equal, e.g. the same address.
21493  *
21494  * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
21495  * Since: 2.30
21496  */
21497
21498
21499 /**
21500  * g_inet_address_get_family:
21501  * @address: a #GInetAddress
21502  *
21503  * Gets @address's family
21504  *
21505  * Returns: @address's family
21506  * Since: 2.22
21507  */
21508
21509
21510 /**
21511  * g_inet_address_get_is_any:
21512  * @address: a #GInetAddress
21513  *
21514  * Tests whether @address is the "any" address for its family.
21515  *
21516  * Returns: %TRUE if @address is the "any" address for its family.
21517  * Since: 2.22
21518  */
21519
21520
21521 /**
21522  * g_inet_address_get_is_link_local:
21523  * @address: a #GInetAddress
21524  *
21525  * Tests whether @address is a link-local address (that is, if it
21526  * identifies a host on a local network that is not connected to the
21527  * Internet).
21528  *
21529  * Returns: %TRUE if @address is a link-local address.
21530  * Since: 2.22
21531  */
21532
21533
21534 /**
21535  * g_inet_address_get_is_loopback:
21536  * @address: a #GInetAddress
21537  *
21538  * Tests whether @address is the loopback address for its family.
21539  *
21540  * Returns: %TRUE if @address is the loopback address for its family.
21541  * Since: 2.22
21542  */
21543
21544
21545 /**
21546  * g_inet_address_get_is_mc_global:
21547  * @address: a #GInetAddress
21548  *
21549  * Tests whether @address is a global multicast address.
21550  *
21551  * Returns: %TRUE if @address is a global multicast address.
21552  * Since: 2.22
21553  */
21554
21555
21556 /**
21557  * g_inet_address_get_is_mc_link_local:
21558  * @address: a #GInetAddress
21559  *
21560  * Tests whether @address is a link-local multicast address.
21561  *
21562  * Returns: %TRUE if @address is a link-local multicast address.
21563  * Since: 2.22
21564  */
21565
21566
21567 /**
21568  * g_inet_address_get_is_mc_node_local:
21569  * @address: a #GInetAddress
21570  *
21571  * Tests whether @address is a node-local multicast address.
21572  *
21573  * Returns: %TRUE if @address is a node-local multicast address.
21574  * Since: 2.22
21575  */
21576
21577
21578 /**
21579  * g_inet_address_get_is_mc_org_local:
21580  * @address: a #GInetAddress
21581  *
21582  * Tests whether @address is an organization-local multicast address.
21583  *
21584  * Returns: %TRUE if @address is an organization-local multicast address.
21585  * Since: 2.22
21586  */
21587
21588
21589 /**
21590  * g_inet_address_get_is_mc_site_local:
21591  * @address: a #GInetAddress
21592  *
21593  * Tests whether @address is a site-local multicast address.
21594  *
21595  * Returns: %TRUE if @address is a site-local multicast address.
21596  * Since: 2.22
21597  */
21598
21599
21600 /**
21601  * g_inet_address_get_is_multicast:
21602  * @address: a #GInetAddress
21603  *
21604  * Tests whether @address is a multicast address.
21605  *
21606  * Returns: %TRUE if @address is a multicast address.
21607  * Since: 2.22
21608  */
21609
21610
21611 /**
21612  * g_inet_address_get_is_site_local:
21613  * @address: a #GInetAddress
21614  *
21615  * Tests whether @address is a site-local address such as 10.0.0.1
21616  * (that is, the address identifies a host on a local network that can
21617  * not be reached directly from the Internet, but which may have
21618  * outgoing Internet connectivity via a NAT or firewall).
21619  *
21620  * Returns: %TRUE if @address is a site-local address.
21621  * Since: 2.22
21622  */
21623
21624
21625 /**
21626  * g_inet_address_get_native_size:
21627  * @address: a #GInetAddress
21628  *
21629  * Gets the size of the native raw binary address for @address. This
21630  * is the size of the data that you get from g_inet_address_to_bytes().
21631  *
21632  * Returns: the number of bytes used for the native version of @address.
21633  * Since: 2.22
21634  */
21635
21636
21637 /**
21638  * g_inet_address_mask_equal:
21639  * @mask: a #GInetAddressMask
21640  * @mask2: another #GInetAddressMask
21641  *
21642  * Tests if @mask and @mask2 are the same mask.
21643  *
21644  * Returns: whether @mask and @mask2 are the same mask
21645  * Since: 2.32
21646  */
21647
21648
21649 /**
21650  * g_inet_address_mask_get_address:
21651  * @mask: a #GInetAddressMask
21652  *
21653  * Gets @mask's base address
21654  *
21655  * Returns: (transfer none): @mask's base address
21656  * Since: 2.32
21657  */
21658
21659
21660 /**
21661  * g_inet_address_mask_get_family:
21662  * @mask: a #GInetAddressMask
21663  *
21664  * Gets the #GSocketFamily of @mask's address
21665  *
21666  * Returns: the #GSocketFamily of @mask's address
21667  * Since: 2.32
21668  */
21669
21670
21671 /**
21672  * g_inet_address_mask_get_length:
21673  * @mask: a #GInetAddressMask
21674  *
21675  * Gets @mask's length
21676  *
21677  * Returns: @mask's length
21678  * Since: 2.32
21679  */
21680
21681
21682 /**
21683  * g_inet_address_mask_matches:
21684  * @mask: a #GInetAddressMask
21685  * @address: a #GInetAddress
21686  *
21687  * Tests if @address falls within the range described by @mask.
21688  *
21689  * Returns: whether @address falls within the range described by @mask.
21690  * Since: 2.32
21691  */
21692
21693
21694 /**
21695  * g_inet_address_mask_new:
21696  * @addr: a #GInetAddress
21697  * @length: number of bits of @addr to use
21698  * @error: return location for #GError, or %NULL
21699  *
21700  * Creates a new #GInetAddressMask representing all addresses whose
21701  * first @length bits match @addr.
21702  *
21703  * Returns: a new #GInetAddressMask, or %NULL on error
21704  * Since: 2.32
21705  */
21706
21707
21708 /**
21709  * g_inet_address_mask_new_from_string:
21710  * @mask_string: an IP address or address/length string
21711  * @error: return location for #GError, or %NULL
21712  *
21713  * Parses @mask_string as an IP address and (optional) length, and
21714  * creates a new #GInetAddressMask. The length, if present, is
21715  * delimited by a "/". If it is not present, then the length is
21716  * assumed to be the full length of the address.
21717  *
21718  * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21719  * Since: 2.32
21720  */
21721
21722
21723 /**
21724  * g_inet_address_mask_to_string:
21725  * @mask: a #GInetAddressMask
21726  *
21727  * Converts @mask back to its corresponding string form.
21728  *
21729  * Returns: a string corresponding to @mask.
21730  * Since: 2.32
21731  */
21732
21733
21734 /**
21735  * g_inet_address_new_any:
21736  * @family: the address family
21737  *
21738  * Creates a #GInetAddress for the "any" address (unassigned/"don't
21739  * care") for @family.
21740  *
21741  * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21742  * Since: 2.22
21743  */
21744
21745
21746 /**
21747  * g_inet_address_new_from_bytes:
21748  * @bytes: (array) (element-type guint8): raw address data
21749  * @family: the address family of @bytes
21750  *
21751  * Creates a new #GInetAddress from the given @family and @bytes.
21752  * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21753  * %G_SOCKET_FAMILY_IPV6.
21754  *
21755  * Returns: a new #GInetAddress corresponding to @family and @bytes.
21756  * Since: 2.22
21757  */
21758
21759
21760 /**
21761  * g_inet_address_new_from_string:
21762  * @string: a string representation of an IP address
21763  *
21764  * Parses @string as an IP address and creates a new #GInetAddress.
21765  *
21766  * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21767  * Since: 2.22
21768  */
21769
21770
21771 /**
21772  * g_inet_address_new_loopback:
21773  * @family: the address family
21774  *
21775  * Creates a #GInetAddress for the loopback address for @family.
21776  *
21777  * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21778  * Since: 2.22
21779  */
21780
21781
21782 /**
21783  * g_inet_address_to_bytes: (skip)
21784  * @address: a #GInetAddress
21785  *
21786  * Gets the raw binary address data from @address.
21787  *
21788  * 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().
21789  * Since: 2.22
21790  */
21791
21792
21793 /**
21794  * g_inet_address_to_string:
21795  * @address: a #GInetAddress
21796  *
21797  * Converts @address to string form.
21798  *
21799  * Returns: a representation of @address as a string, which should be freed after use.
21800  * Since: 2.22
21801  */
21802
21803
21804 /**
21805  * g_inet_socket_address_get_address:
21806  * @address: a #GInetSocketAddress
21807  *
21808  * Gets @address's #GInetAddress.
21809  *
21810  * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21811  * Since: 2.22
21812  */
21813
21814
21815 /**
21816  * g_inet_socket_address_get_flowinfo:
21817  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21818  *
21819  * Gets the <literal>sin6_flowinfo</literal> field from @address,
21820  * which must be an IPv6 address.
21821  *
21822  * Returns: the flowinfo field
21823  * Since: 2.32
21824  */
21825
21826
21827 /**
21828  * g_inet_socket_address_get_port:
21829  * @address: a #GInetSocketAddress
21830  *
21831  * Gets @address's port.
21832  *
21833  * Returns: the port for @address
21834  * Since: 2.22
21835  */
21836
21837
21838 /**
21839  * g_inet_socket_address_get_scope_id:
21840  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21841  *
21842  * Gets the <literal>sin6_scope_id</literal> field from @address,
21843  * which must be an IPv6 address.
21844  *
21845  * Returns: the scope id field
21846  * Since: 2.32
21847  */
21848
21849
21850 /**
21851  * g_inet_socket_address_new:
21852  * @address: a #GInetAddress
21853  * @port: a port number
21854  *
21855  * Creates a new #GInetSocketAddress for @address and @port.
21856  *
21857  * Returns: a new #GInetSocketAddress
21858  * Since: 2.22
21859  */
21860
21861
21862 /**
21863  * g_initable_init:
21864  * @initable: a #GInitable.
21865  * @cancellable: optional #GCancellable object, %NULL to ignore.
21866  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21867  *
21868  * Initializes the object implementing the interface.
21869  *
21870  * The object must be initialized before any real use after initial
21871  * construction, either with this function or g_async_initable_init_async().
21872  *
21873  * Implementations may also support cancellation. If @cancellable is not %NULL,
21874  * then initialization can be cancelled by triggering the cancellable object
21875  * from another thread. If the operation was cancelled, the error
21876  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21877  * the object doesn't support cancellable initialization the error
21878  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21879  *
21880  * If the object is not initialized, or initialization returns with an
21881  * error, then all operations on the object except g_object_ref() and
21882  * g_object_unref() are considered to be invalid, and have undefined
21883  * behaviour. See the <xref linkend="ginitable"/> section introduction
21884  * for more details.
21885  *
21886  * Implementations of this method must be idempotent, i.e. multiple calls
21887  * to this function with the same argument should return the same results.
21888  * Only the first call initializes the object, further calls return the result
21889  * of the first call. This is so that it's safe to implement the singleton
21890  * pattern in the GObject constructor function.
21891  *
21892  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21893  * Since: 2.22
21894  */
21895
21896
21897 /**
21898  * g_initable_new:
21899  * @object_type: a #GType supporting #GInitable.
21900  * @cancellable: optional #GCancellable object, %NULL to ignore.
21901  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21902  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21903  * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21904  *
21905  * Helper function for constructing #GInitable object. This is
21906  * similar to g_object_new() but also initializes the object
21907  * and returns %NULL, setting an error on failure.
21908  *
21909  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21910  * Since: 2.22
21911  */
21912
21913
21914 /**
21915  * g_initable_new_valist:
21916  * @object_type: a #GType supporting #GInitable.
21917  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21918  * @var_args: The var args list generated from @first_property_name.
21919  * @cancellable: optional #GCancellable object, %NULL to ignore.
21920  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21921  *
21922  * Helper function for constructing #GInitable object. This is
21923  * similar to g_object_new_valist() but also initializes the object
21924  * and returns %NULL, setting an error on failure.
21925  *
21926  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21927  * Since: 2.22
21928  */
21929
21930
21931 /**
21932  * g_initable_newv:
21933  * @object_type: a #GType supporting #GInitable.
21934  * @n_parameters: the number of parameters in @parameters
21935  * @parameters: (array length=n_parameters): the parameters to use to construct the object
21936  * @cancellable: optional #GCancellable object, %NULL to ignore.
21937  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21938  *
21939  * Helper function for constructing #GInitable object. This is
21940  * similar to g_object_newv() but also initializes the object
21941  * and returns %NULL, setting an error on failure.
21942  *
21943  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21944  * Since: 2.22
21945  */
21946
21947
21948 /**
21949  * g_input_stream_clear_pending:
21950  * @stream: input stream
21951  *
21952  * Clears the pending flag on @stream.
21953  */
21954
21955
21956 /**
21957  * g_input_stream_close:
21958  * @stream: A #GInputStream.
21959  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21960  * @error: location to store the error occurring, or %NULL to ignore
21961  *
21962  * Closes the stream, releasing resources related to it.
21963  *
21964  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21965  * Closing a stream multiple times will not return an error.
21966  *
21967  * Streams will be automatically closed when the last reference
21968  * is dropped, but you might want to call this function to make sure
21969  * resources are released as early as possible.
21970  *
21971  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21972  * open after the stream is closed. See the documentation for the individual
21973  * stream for details.
21974  *
21975  * On failure the first error that happened will be reported, but the close
21976  * operation will finish as much as possible. A stream that failed to
21977  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21978  * is important to check and report the error to the user.
21979  *
21980  * If @cancellable is not %NULL, then the operation can be cancelled by
21981  * triggering the cancellable object from another thread. If the operation
21982  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21983  * Cancelling a close will still leave the stream closed, but some streams
21984  * can use a faster close that doesn't block to e.g. check errors.
21985  *
21986  * Returns: %TRUE on success, %FALSE on failure
21987  */
21988
21989
21990 /**
21991  * g_input_stream_close_async:
21992  * @stream: A #GInputStream.
21993  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21994  * @cancellable: (allow-none): optional cancellable object
21995  * @callback: (scope async): callback to call when the request is satisfied
21996  * @user_data: (closure): the data to pass to callback function
21997  *
21998  * Requests an asynchronous closes of the stream, releasing resources related to it.
21999  * When the operation is finished @callback will be called.
22000  * You can then call g_input_stream_close_finish() to get the result of the
22001  * operation.
22002  *
22003  * For behaviour details see g_input_stream_close().
22004  *
22005  * The asyncronous methods have a default fallback that uses threads to implement
22006  * asynchronicity, so they are optional for inheriting classes. However, if you
22007  * override one you must override all.
22008  */
22009
22010
22011 /**
22012  * g_input_stream_close_finish:
22013  * @stream: a #GInputStream.
22014  * @result: a #GAsyncResult.
22015  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22016  *
22017  * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
22018  *
22019  * Returns: %TRUE if the stream was closed successfully.
22020  */
22021
22022
22023 /**
22024  * g_input_stream_has_pending:
22025  * @stream: input stream.
22026  *
22027  * Checks if an input stream has pending actions.
22028  *
22029  * Returns: %TRUE if @stream has pending actions.
22030  */
22031
22032
22033 /**
22034  * g_input_stream_is_closed:
22035  * @stream: input stream.
22036  *
22037  * Checks if an input stream is closed.
22038  *
22039  * Returns: %TRUE if the stream is closed.
22040  */
22041
22042
22043 /**
22044  * g_input_stream_read:
22045  * @stream: a #GInputStream.
22046  * @buffer: a buffer to read data into (which should be at least count bytes long).
22047  * @count: the number of bytes that will be read from the stream
22048  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22049  * @error: location to store the error occurring, or %NULL to ignore
22050  *
22051  * Tries to read @count bytes from the stream into the buffer starting at
22052  * @buffer. Will block during this read.
22053  *
22054  * If count is zero returns zero and does nothing. A value of @count
22055  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22056  *
22057  * On success, the number of bytes read into the buffer is returned.
22058  * It is not an error if this is not the same as the requested size, as it
22059  * can happen e.g. near the end of a file. Zero is returned on end of file
22060  * (or if @count is zero),  but never otherwise.
22061  *
22062  * If @cancellable is not %NULL, then the operation can be cancelled by
22063  * triggering the cancellable object from another thread. If the operation
22064  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22065  * operation was partially finished when the operation was cancelled the
22066  * partial result will be returned, without an error.
22067  *
22068  * On error -1 is returned and @error is set accordingly.
22069  *
22070  * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
22071  */
22072
22073
22074 /**
22075  * g_input_stream_read_all:
22076  * @stream: a #GInputStream.
22077  * @buffer: a buffer to read data into (which should be at least count bytes long).
22078  * @count: the number of bytes that will be read from the stream
22079  * @bytes_read: (out): location to store the number of bytes that was read from the stream
22080  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22081  * @error: location to store the error occurring, or %NULL to ignore
22082  *
22083  * Tries to read @count bytes from the stream into the buffer starting at
22084  * @buffer. Will block during this read.
22085  *
22086  * This function is similar to g_input_stream_read(), except it tries to
22087  * read as many bytes as requested, only stopping on an error or end of stream.
22088  *
22089  * On a successful read of @count bytes, or if we reached the end of the
22090  * stream,  %TRUE is returned, and @bytes_read is set to the number of bytes
22091  * read into @buffer.
22092  *
22093  * If there is an error during the operation %FALSE is returned and @error
22094  * is set to indicate the error status, @bytes_read is updated to contain
22095  * the number of bytes read into @buffer before the error occurred.
22096  *
22097  * Returns: %TRUE on success, %FALSE if there was an error
22098  */
22099
22100
22101 /**
22102  * g_input_stream_read_async:
22103  * @stream: A #GInputStream.
22104  * @buffer: a buffer to read data into (which should be at least count bytes long).
22105  * @count: the number of bytes that will be read from the stream
22106  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22107  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22108  * @callback: (scope async): callback to call when the request is satisfied
22109  * @user_data: (closure): the data to pass to callback function
22110  *
22111  * Request an asynchronous read of @count bytes from the stream into the buffer
22112  * starting at @buffer. When the operation is finished @callback will be called.
22113  * You can then call g_input_stream_read_finish() to get the result of the
22114  * operation.
22115  *
22116  * During an async request no other sync and async calls are allowed on @stream, and will
22117  * result in %G_IO_ERROR_PENDING errors.
22118  *
22119  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22120  *
22121  * On success, the number of bytes read into the buffer will be passed to the
22122  * callback. It is not an error if this is not the same as the requested size, as it
22123  * can happen e.g. near the end of a file, but generally we try to read
22124  * as many bytes as requested. Zero is returned on end of file
22125  * (or if @count is zero),  but never otherwise.
22126  *
22127  * Any outstanding i/o request with higher priority (lower numerical value) will
22128  * be executed before an outstanding request with lower priority. Default
22129  * priority is %G_PRIORITY_DEFAULT.
22130  *
22131  * The asyncronous methods have a default fallback that uses threads to implement
22132  * asynchronicity, so they are optional for inheriting classes. However, if you
22133  * override one you must override all.
22134  */
22135
22136
22137 /**
22138  * g_input_stream_read_bytes:
22139  * @stream: a #GInputStream.
22140  * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
22141  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22142  * @error: location to store the error occurring, or %NULL to ignore
22143  *
22144  * Like g_input_stream_read(), this tries to read @count bytes from
22145  * the stream in a blocking fashion. However, rather than reading into
22146  * a user-supplied buffer, this will create a new #GBytes containing
22147  * the data that was read. This may be easier to use from language
22148  * bindings.
22149  *
22150  * If count is zero, returns a zero-length #GBytes and does nothing. A
22151  * value of @count larger than %G_MAXSSIZE will cause a
22152  * %G_IO_ERROR_INVALID_ARGUMENT error.
22153  *
22154  * On success, a new #GBytes is returned. It is not an error if the
22155  * size of this object is not the same as the requested size, as it
22156  * can happen e.g. near the end of a file. A zero-length #GBytes is
22157  * returned on end of file (or if @count is zero), but never
22158  * otherwise.
22159  *
22160  * If @cancellable is not %NULL, then the operation can be cancelled by
22161  * triggering the cancellable object from another thread. If the operation
22162  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22163  * operation was partially finished when the operation was cancelled the
22164  * partial result will be returned, without an error.
22165  *
22166  * On error %NULL is returned and @error is set accordingly.
22167  *
22168  * Returns: a new #GBytes, or %NULL on error
22169  */
22170
22171
22172 /**
22173  * g_input_stream_read_bytes_async:
22174  * @stream: A #GInputStream.
22175  * @count: the number of bytes that will be read from the stream
22176  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22177  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22178  * @callback: (scope async): callback to call when the request is satisfied
22179  * @user_data: (closure): the data to pass to callback function
22180  *
22181  * Request an asynchronous read of @count bytes from the stream into a
22182  * new #GBytes. When the operation is finished @callback will be
22183  * called. You can then call g_input_stream_read_bytes_finish() to get the
22184  * result of the operation.
22185  *
22186  * During an async request no other sync and async calls are allowed
22187  * on @stream, and will result in %G_IO_ERROR_PENDING errors.
22188  *
22189  * A value of @count larger than %G_MAXSSIZE will cause a
22190  * %G_IO_ERROR_INVALID_ARGUMENT error.
22191  *
22192  * On success, the new #GBytes will be passed to the callback. It is
22193  * not an error if this is smaller than the requested size, as it can
22194  * happen e.g. near the end of a file, but generally we try to read as
22195  * many bytes as requested. Zero is returned on end of file (or if
22196  * @count is zero), but never otherwise.
22197  *
22198  * Any outstanding I/O request with higher priority (lower numerical
22199  * value) will be executed before an outstanding request with lower
22200  * priority. Default priority is %G_PRIORITY_DEFAULT.
22201  */
22202
22203
22204 /**
22205  * g_input_stream_read_bytes_finish:
22206  * @stream: a #GInputStream.
22207  * @result: a #GAsyncResult.
22208  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22209  *
22210  * Finishes an asynchronous stream read-into-#GBytes operation.
22211  *
22212  * Returns: the newly-allocated #GBytes, or %NULL on error
22213  */
22214
22215
22216 /**
22217  * g_input_stream_read_finish:
22218  * @stream: a #GInputStream.
22219  * @result: a #GAsyncResult.
22220  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22221  *
22222  * Finishes an asynchronous stream read operation.
22223  *
22224  * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
22225  */
22226
22227
22228 /**
22229  * g_input_stream_set_pending:
22230  * @stream: input stream
22231  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22232  *
22233  * Sets @stream to have actions pending. If the pending flag is
22234  * already set or @stream is closed, it will return %FALSE and set
22235  * @error.
22236  *
22237  * Returns: %TRUE if pending was previously unset and is now set.
22238  */
22239
22240
22241 /**
22242  * g_input_stream_skip:
22243  * @stream: a #GInputStream.
22244  * @count: the number of bytes that will be skipped from the stream
22245  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22246  * @error: location to store the error occurring, or %NULL to ignore
22247  *
22248  * Tries to skip @count bytes from the stream. Will block during the operation.
22249  *
22250  * This is identical to g_input_stream_read(), from a behaviour standpoint,
22251  * but the bytes that are skipped are not returned to the user. Some
22252  * streams have an implementation that is more efficient than reading the data.
22253  *
22254  * This function is optional for inherited classes, as the default implementation
22255  * emulates it using read.
22256  *
22257  * If @cancellable is not %NULL, then the operation can be cancelled by
22258  * triggering the cancellable object from another thread. If the operation
22259  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22260  * operation was partially finished when the operation was cancelled the
22261  * partial result will be returned, without an error.
22262  *
22263  * Returns: Number of bytes skipped, or -1 on error
22264  */
22265
22266
22267 /**
22268  * g_input_stream_skip_async:
22269  * @stream: A #GInputStream.
22270  * @count: the number of bytes that will be skipped from the stream
22271  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22272  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22273  * @callback: (scope async): callback to call when the request is satisfied
22274  * @user_data: (closure): the data to pass to callback function
22275  *
22276  * Request an asynchronous skip of @count bytes from the stream.
22277  * When the operation is finished @callback will be called.
22278  * You can then call g_input_stream_skip_finish() to get the result
22279  * of the operation.
22280  *
22281  * During an async request no other sync and async calls are allowed,
22282  * and will result in %G_IO_ERROR_PENDING errors.
22283  *
22284  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22285  *
22286  * On success, the number of bytes skipped will be passed to the callback.
22287  * It is not an error if this is not the same as the requested size, as it
22288  * can happen e.g. near the end of a file, but generally we try to skip
22289  * as many bytes as requested. Zero is returned on end of file
22290  * (or if @count is zero), but never otherwise.
22291  *
22292  * Any outstanding i/o request with higher priority (lower numerical value)
22293  * will be executed before an outstanding request with lower priority.
22294  * Default priority is %G_PRIORITY_DEFAULT.
22295  *
22296  * The asynchronous methods have a default fallback that uses threads to
22297  * implement asynchronicity, so they are optional for inheriting classes.
22298  * However, if you override one, you must override all.
22299  */
22300
22301
22302 /**
22303  * g_input_stream_skip_finish:
22304  * @stream: a #GInputStream.
22305  * @result: a #GAsyncResult.
22306  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22307  *
22308  * Finishes a stream skip operation.
22309  *
22310  * Returns: the size of the bytes skipped, or %-1 on error.
22311  */
22312
22313
22314 /**
22315  * g_io_error_from_errno:
22316  * @err_no: Error number as defined in errno.h.
22317  *
22318  * Converts errno.h error codes into GIO error codes.
22319  *
22320  * Returns: #GIOErrorEnum value for the given errno.h error number.
22321  */
22322
22323
22324 /**
22325  * g_io_error_from_win32_error:
22326  * @error_code: Windows error number.
22327  *
22328  * Converts some common error codes into GIO error codes. The
22329  * fallback value G_IO_ERROR_FAILED is returned for error codes not
22330  * handled.
22331  *
22332  * Returns: #GIOErrorEnum value for the given error number.
22333  * Since: 2.26
22334  */
22335
22336
22337 /**
22338  * g_io_error_quark:
22339  *
22340  * Gets the GIO Error Quark.
22341  *
22342  * Returns: a #GQuark.
22343  */
22344
22345
22346 /**
22347  * g_io_extension_get_name:
22348  * @extension: a #GIOExtension
22349  *
22350  * Gets the name under which @extension was registered.
22351  *
22352  * Note that the same type may be registered as extension
22353  * for multiple extension points, under different names.
22354  *
22355  * Returns: the name of @extension.
22356  */
22357
22358
22359 /**
22360  * g_io_extension_get_priority:
22361  * @extension: a #GIOExtension
22362  *
22363  * Gets the priority with which @extension was registered.
22364  *
22365  * Returns: the priority of @extension
22366  */
22367
22368
22369 /**
22370  * g_io_extension_get_type:
22371  * @extension: a #GIOExtension
22372  *
22373  * Gets the type associated with @extension.
22374  *
22375  * Returns: the type of @extension
22376  */
22377
22378
22379 /**
22380  * g_io_extension_point_get_extension_by_name:
22381  * @extension_point: a #GIOExtensionPoint
22382  * @name: the name of the extension to get
22383  *
22384  * Finds a #GIOExtension for an extension point by name.
22385  *
22386  * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
22387  */
22388
22389
22390 /**
22391  * g_io_extension_point_get_extensions:
22392  * @extension_point: a #GIOExtensionPoint
22393  *
22394  * Gets a list of all extensions that implement this extension point.
22395  * The list is sorted by priority, beginning with the highest priority.
22396  *
22397  * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
22398  */
22399
22400
22401 /**
22402  * g_io_extension_point_get_required_type:
22403  * @extension_point: a #GIOExtensionPoint
22404  *
22405  * Gets the required type for @extension_point.
22406  *
22407  * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
22408  */
22409
22410
22411 /**
22412  * g_io_extension_point_implement:
22413  * @extension_point_name: the name of the extension point
22414  * @type: the #GType to register as extension
22415  * @extension_name: the name for the extension
22416  * @priority: the priority for the extension
22417  *
22418  * Registers @type as extension for the extension point with name
22419  * @extension_point_name.
22420  *
22421  * If @type has already been registered as an extension for this
22422  * extension point, the existing #GIOExtension object is returned.
22423  *
22424  * Returns: (transfer none): a #GIOExtension object for #GType
22425  */
22426
22427
22428 /**
22429  * g_io_extension_point_lookup:
22430  * @name: the name of the extension point
22431  *
22432  * Looks up an existing extension point.
22433  *
22434  * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
22435  */
22436
22437
22438 /**
22439  * g_io_extension_point_register:
22440  * @name: The name of the extension point
22441  *
22442  * Registers an extension point.
22443  *
22444  * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
22445  */
22446
22447
22448 /**
22449  * g_io_extension_point_set_required_type:
22450  * @extension_point: a #GIOExtensionPoint
22451  * @type: the #GType to require
22452  *
22453  * Sets the required type for @extension_point to @type.
22454  * All implementations must henceforth have this type.
22455  */
22456
22457
22458 /**
22459  * g_io_extension_ref_class:
22460  * @extension: a #GIOExtension
22461  *
22462  * Gets a reference to the class for the type that is
22463  * associated with @extension.
22464  *
22465  * Returns: (transfer full): the #GTypeClass for the type of @extension
22466  */
22467
22468
22469 /**
22470  * g_io_module_new:
22471  * @filename: filename of the shared library module.
22472  *
22473  * Creates a new GIOModule that will load the specific
22474  * shared library when in use.
22475  *
22476  * Returns: a #GIOModule from given @filename, or %NULL on error.
22477  */
22478
22479
22480 /**
22481  * g_io_module_scope_block:
22482  * @scope: a module loading scope
22483  * @basename: the basename to block
22484  *
22485  * Block modules with the given @basename from being loaded when
22486  * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
22487  * or g_io_modules_load_all_in_directory_with_scope().
22488  *
22489  * Since: 2.30
22490  */
22491
22492
22493 /**
22494  * g_io_module_scope_free:
22495  * @scope: a module loading scope
22496  *
22497  * Free a module scope.
22498  *
22499  * Since: 2.30
22500  */
22501
22502
22503 /**
22504  * g_io_module_scope_new:
22505  * @flags: flags for the new scope
22506  *
22507  * Create a new scope for loading of IO modules. A scope can be used for
22508  * blocking duplicate modules, or blocking a module you don't want to load.
22509  *
22510  * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
22511  * which have the same base name as a module that has already been seen
22512  * in this scope.
22513  *
22514  * Returns: (transfer full): the new module scope
22515  * Since: 2.30
22516  */
22517
22518
22519 /**
22520  * g_io_modules_load_all_in_directory:
22521  * @dirname: pathname for a directory containing modules to load.
22522  *
22523  * Loads all the modules in the specified directory.
22524  *
22525  * If don't require all modules to be initialized (and thus registering
22526  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22527  * which allows delayed/lazy loading of modules.
22528  *
22529  * 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().
22530  */
22531
22532
22533 /**
22534  * g_io_modules_load_all_in_directory_with_scope:
22535  * @dirname: pathname for a directory containing modules to load.
22536  * @scope: a scope to use when scanning the modules.
22537  *
22538  * Loads all the modules in the specified directory.
22539  *
22540  * If don't require all modules to be initialized (and thus registering
22541  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22542  * which allows delayed/lazy loading of modules.
22543  *
22544  * 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().
22545  * Since: 2.30
22546  */
22547
22548
22549 /**
22550  * g_io_modules_scan_all_in_directory:
22551  * @dirname: pathname for a directory containing modules to scan.
22552  *
22553  * Scans all the modules in the specified directory, ensuring that
22554  * any extension point implemented by a module is registered.
22555  *
22556  * This may not actually load and initialize all the types in each
22557  * module, some modules may be lazily loaded and initialized when
22558  * an extension point it implementes is used with e.g.
22559  * g_io_extension_point_get_extensions() or
22560  * g_io_extension_point_get_extension_by_name().
22561  *
22562  * If you need to guarantee that all types are loaded in all the modules,
22563  * use g_io_modules_load_all_in_directory().
22564  *
22565  * Since: 2.24
22566  */
22567
22568
22569 /**
22570  * g_io_modules_scan_all_in_directory_with_scope:
22571  * @dirname: pathname for a directory containing modules to scan.
22572  * @scope: a scope to use when scanning the modules
22573  *
22574  * Scans all the modules in the specified directory, ensuring that
22575  * any extension point implemented by a module is registered.
22576  *
22577  * This may not actually load and initialize all the types in each
22578  * module, some modules may be lazily loaded and initialized when
22579  * an extension point it implementes is used with e.g.
22580  * g_io_extension_point_get_extensions() or
22581  * g_io_extension_point_get_extension_by_name().
22582  *
22583  * If you need to guarantee that all types are loaded in all the modules,
22584  * use g_io_modules_load_all_in_directory().
22585  *
22586  * Since: 2.30
22587  */
22588
22589
22590 /**
22591  * g_io_scheduler_cancel_all_jobs:
22592  *
22593  * Cancels all cancellable I/O jobs.
22594  *
22595  * A job is cancellable if a #GCancellable was passed into
22596  * g_io_scheduler_push_job().
22597  *
22598  * Deprecated: You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler.
22599  */
22600
22601
22602 /**
22603  * g_io_scheduler_job_send_to_mainloop:
22604  * @job: a #GIOSchedulerJob
22605  * @func: a #GSourceFunc callback that will be called in the original thread
22606  * @user_data: data to pass to @func
22607  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22608  *
22609  * Used from an I/O job to send a callback to be run in the thread
22610  * that the job was started from, waiting for the result (and thus
22611  * blocking the I/O job).
22612  *
22613  * Returns: The return value of @func
22614  * Deprecated: Use g_main_context_invoke().
22615  */
22616
22617
22618 /**
22619  * g_io_scheduler_job_send_to_mainloop_async:
22620  * @job: a #GIOSchedulerJob
22621  * @func: a #GSourceFunc callback that will be called in the original thread
22622  * @user_data: data to pass to @func
22623  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22624  *
22625  * Used from an I/O job to send a callback to be run asynchronously in
22626  * the thread that the job was started from. The callback will be run
22627  * when the main loop is available, but at that time the I/O job might
22628  * have finished. The return value from the callback is ignored.
22629  *
22630  * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22631  * on to this function you have to ensure that it is not freed before
22632  * @func is called, either by passing %NULL as @notify to
22633  * g_io_scheduler_push_job() or by using refcounting for @user_data.
22634  *
22635  * Deprecated: Use g_main_context_invoke().
22636  */
22637
22638
22639 /**
22640  * g_io_scheduler_push_job:
22641  * @job_func: a #GIOSchedulerJobFunc.
22642  * @user_data: data to pass to @job_func
22643  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22644  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22645  * @cancellable: optional #GCancellable object, %NULL to ignore.
22646  *
22647  * Schedules the I/O job to run in another thread.
22648  *
22649  * @notify will be called on @user_data after @job_func has returned,
22650  * regardless whether the job was cancelled or has run to completion.
22651  *
22652  * If @cancellable is not %NULL, it can be used to cancel the I/O job
22653  * by calling g_cancellable_cancel() or by calling
22654  * g_io_scheduler_cancel_all_jobs().
22655  *
22656  * Deprecated: use #GThreadPool or g_task_run_in_thread()
22657  */
22658
22659
22660 /**
22661  * g_io_stream_clear_pending:
22662  * @stream: a #GIOStream
22663  *
22664  * Clears the pending flag on @stream.
22665  *
22666  * Since: 2.22
22667  */
22668
22669
22670 /**
22671  * g_io_stream_close:
22672  * @stream: a #GIOStream
22673  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22674  * @error: location to store the error occurring, or %NULL to ignore
22675  *
22676  * Closes the stream, releasing resources related to it. This will also
22677  * closes the individual input and output streams, if they are not already
22678  * closed.
22679  *
22680  * Once the stream is closed, all other operations will return
22681  * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22682  * return an error.
22683  *
22684  * Closing a stream will automatically flush any outstanding buffers
22685  * in the stream.
22686  *
22687  * Streams will be automatically closed when the last reference
22688  * is dropped, but you might want to call this function to make sure
22689  * resources are released as early as possible.
22690  *
22691  * Some streams might keep the backing store of the stream (e.g. a file
22692  * descriptor) open after the stream is closed. See the documentation for
22693  * the individual stream for details.
22694  *
22695  * On failure the first error that happened will be reported, but the
22696  * close operation will finish as much as possible. A stream that failed
22697  * to close will still return %G_IO_ERROR_CLOSED for all operations.
22698  * Still, it is important to check and report the error to the user,
22699  * otherwise there might be a loss of data as all data might not be written.
22700  *
22701  * If @cancellable is not NULL, then the operation can be cancelled by
22702  * triggering the cancellable object from another thread. If the operation
22703  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22704  * Cancelling a close will still leave the stream closed, but some streams
22705  * can use a faster close that doesn't block to e.g. check errors.
22706  *
22707  * The default implementation of this method just calls close on the
22708  * individual input/output streams.
22709  *
22710  * Returns: %TRUE on success, %FALSE on failure
22711  * Since: 2.22
22712  */
22713
22714
22715 /**
22716  * g_io_stream_close_async:
22717  * @stream: a #GIOStream
22718  * @io_priority: the io priority of the request
22719  * @cancellable: (allow-none): optional cancellable object
22720  * @callback: (scope async): callback to call when the request is satisfied
22721  * @user_data: (closure): the data to pass to callback function
22722  *
22723  * Requests an asynchronous close of the stream, releasing resources
22724  * related to it. When the operation is finished @callback will be
22725  * called. You can then call g_io_stream_close_finish() to get
22726  * the result of the operation.
22727  *
22728  * For behaviour details see g_io_stream_close().
22729  *
22730  * The asynchronous methods have a default fallback that uses threads
22731  * to implement asynchronicity, so they are optional for inheriting
22732  * classes. However, if you override one you must override all.
22733  *
22734  * Since: 2.22
22735  */
22736
22737
22738 /**
22739  * g_io_stream_close_finish:
22740  * @stream: a #GIOStream
22741  * @result: a #GAsyncResult
22742  * @error: a #GError location to store the error occurring, or %NULL to ignore
22743  *
22744  * Closes a stream.
22745  *
22746  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22747  * Since: 2.22
22748  */
22749
22750
22751 /**
22752  * g_io_stream_get_input_stream:
22753  * @stream: a #GIOStream
22754  *
22755  * Gets the input stream for this object. This is used
22756  * for reading.
22757  *
22758  * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22759  * Since: 2.22
22760  */
22761
22762
22763 /**
22764  * g_io_stream_get_output_stream:
22765  * @stream: a #GIOStream
22766  *
22767  * Gets the output stream for this object. This is used for
22768  * writing.
22769  *
22770  * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22771  * Since: 2.22
22772  */
22773
22774
22775 /**
22776  * g_io_stream_has_pending:
22777  * @stream: a #GIOStream
22778  *
22779  * Checks if a stream has pending actions.
22780  *
22781  * Returns: %TRUE if @stream has pending actions.
22782  * Since: 2.22
22783  */
22784
22785
22786 /**
22787  * g_io_stream_is_closed:
22788  * @stream: a #GIOStream
22789  *
22790  * Checks if a stream is closed.
22791  *
22792  * Returns: %TRUE if the stream is closed.
22793  * Since: 2.22
22794  */
22795
22796
22797 /**
22798  * g_io_stream_set_pending:
22799  * @stream: a #GIOStream
22800  * @error: a #GError location to store the error occurring, or %NULL to ignore
22801  *
22802  * Sets @stream to have actions pending. If the pending flag is
22803  * already set or @stream is closed, it will return %FALSE and set
22804  * @error.
22805  *
22806  * Returns: %TRUE if pending was previously unset and is now set.
22807  * Since: 2.22
22808  */
22809
22810
22811 /**
22812  * g_io_stream_splice_async:
22813  * @stream1: a #GIOStream.
22814  * @stream2: a #GIOStream.
22815  * @flags: a set of #GIOStreamSpliceFlags.
22816  * @io_priority: the io priority of the request.
22817  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22818  * @callback: (scope async): a #GAsyncReadyCallback.
22819  * @user_data: (closure): user data passed to @callback.
22820  *
22821  * Asyncronously splice the output stream of @stream1 to the input stream of
22822  * @stream2, and splice the output stream of @stream2 to the input stream of
22823  * @stream1.
22824  *
22825  * When the operation is finished @callback will be called.
22826  * You can then call g_io_stream_splice_finish() to get the
22827  * result of the operation.
22828  *
22829  * Since: 2.28
22830  */
22831
22832
22833 /**
22834  * g_io_stream_splice_finish:
22835  * @result: a #GAsyncResult.
22836  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22837  *
22838  * Finishes an asynchronous io stream splice operation.
22839  *
22840  * Returns: %TRUE on success, %FALSE otherwise.
22841  * Since: 2.28
22842  */
22843
22844
22845 /**
22846  * g_keyfile_settings_backend_new:
22847  * @filename: the filename of the keyfile
22848  * @root_path: the path under which all settings keys appear
22849  * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22850  *
22851  * Creates a keyfile-backed #GSettingsBackend.
22852  *
22853  * The filename of the keyfile to use is given by @filename.
22854  *
22855  * All settings read to or written from the backend must fall under the
22856  * path given in @root_path (which must start and end with a slash and
22857  * not contain two consecutive slashes).  @root_path may be "/".
22858  *
22859  * If @root_group is non-%NULL then it specifies the name of the keyfile
22860  * group used for keys that are written directly below @root_path.  For
22861  * example, if @root_path is "/apps/example/" and @root_group is
22862  * "toplevel", then settings the key "/apps/example/enabled" to a value
22863  * of %TRUE will cause the following to appear in the keyfile:
22864  *
22865  * |[
22866  *   [toplevel]
22867  *   enabled=true
22868  * ]|
22869  *
22870  * If @root_group is %NULL then it is not permitted to store keys
22871  * directly below the @root_path.
22872  *
22873  * For keys not stored directly below @root_path (ie: in a sub-path),
22874  * the name of the subpath (with the final slash stripped) is used as
22875  * the name of the keyfile group.  To continue the example, if
22876  * "/apps/example/profiles/default/font-size" were set to
22877  * 12 then the following would appear in the keyfile:
22878  *
22879  * |[
22880  *   [profiles/default]
22881  *   font-size=12
22882  * ]|
22883  *
22884  * The backend will refuse writes (and return writability as being
22885  * %FALSE) for keys outside of @root_path and, in the event that
22886  * @root_group is %NULL, also for keys directly under @root_path.
22887  * Writes will also be refused if the backend detects that it has the
22888  * inability to rewrite the keyfile (ie: the containing directory is not
22889  * writable).
22890  *
22891  * There is no checking done for your key namespace clashing with the
22892  * syntax of the key file format.  For example, if you have '[' or ']'
22893  * characters in your path names or '=' in your key names you may be in
22894  * trouble.
22895  *
22896  * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22897  */
22898
22899
22900 /**
22901  * g_loadable_icon_load:
22902  * @icon: a #GLoadableIcon.
22903  * @size: an integer.
22904  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22905  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22906  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22907  *
22908  * Loads a loadable icon. For the asynchronous version of this function,
22909  * see g_loadable_icon_load_async().
22910  *
22911  * Returns: (transfer full): a #GInputStream to read the icon from.
22912  */
22913
22914
22915 /**
22916  * g_loadable_icon_load_async:
22917  * @icon: a #GLoadableIcon.
22918  * @size: an integer.
22919  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22920  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22921  * @user_data: (closure): the data to pass to callback function
22922  *
22923  * Loads an icon asynchronously. To finish this function, see
22924  * g_loadable_icon_load_finish(). For the synchronous, blocking
22925  * version of this function, see g_loadable_icon_load().
22926  */
22927
22928
22929 /**
22930  * g_loadable_icon_load_finish:
22931  * @icon: a #GLoadableIcon.
22932  * @res: a #GAsyncResult.
22933  * @type: a location to store the type of the loaded icon, %NULL to ignore.
22934  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22935  *
22936  * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22937  *
22938  * Returns: (transfer full): a #GInputStream to read the icon from.
22939  */
22940
22941
22942 /**
22943  * g_local_vfs_new:
22944  *
22945  * Returns a new #GVfs handle for a local vfs.
22946  *
22947  * Returns: a new #GVfs handle.
22948  */
22949
22950
22951 /**
22952  * g_memory_input_stream_add_bytes:
22953  * @stream: a #GMemoryInputStream
22954  * @bytes: input data
22955  *
22956  * Appends @bytes to data that can be read from the input stream.
22957  *
22958  * Since: 2.34
22959  */
22960
22961
22962 /**
22963  * g_memory_input_stream_add_data:
22964  * @stream: a #GMemoryInputStream
22965  * @data: (array length=len) (element-type guint8) (transfer full): input data
22966  * @len: length of the data, may be -1 if @data is a nul-terminated string
22967  * @destroy: (allow-none): function that is called to free @data, or %NULL
22968  *
22969  * Appends @data to data that can be read from the input stream
22970  */
22971
22972
22973 /**
22974  * g_memory_input_stream_new:
22975  *
22976  * Creates a new empty #GMemoryInputStream.
22977  *
22978  * Returns: a new #GInputStream
22979  */
22980
22981
22982 /**
22983  * g_memory_input_stream_new_from_bytes:
22984  * @bytes: a #GBytes
22985  *
22986  * Creates a new #GMemoryInputStream with data from the given @bytes.
22987  *
22988  * Returns: new #GInputStream read from @bytes
22989  * Since: 2.34
22990  */
22991
22992
22993 /**
22994  * g_memory_input_stream_new_from_data:
22995  * @data: (array length=len) (element-type guint8) (transfer full): input data
22996  * @len: length of the data, may be -1 if @data is a nul-terminated string
22997  * @destroy: (allow-none): function that is called to free @data, or %NULL
22998  *
22999  * Creates a new #GMemoryInputStream with data in memory of a given size.
23000  *
23001  * Returns: new #GInputStream read from @data of @len bytes.
23002  */
23003
23004
23005 /**
23006  * g_memory_output_stream_get_data:
23007  * @ostream: a #GMemoryOutputStream
23008  *
23009  * Gets any loaded data from the @ostream.
23010  *
23011  * Note that the returned pointer may become invalid on the next
23012  * write or truncate operation on the stream.
23013  *
23014  * Returns: (transfer none): pointer to the stream's data
23015  */
23016
23017
23018 /**
23019  * g_memory_output_stream_get_data_size:
23020  * @ostream: a #GMemoryOutputStream
23021  *
23022  * Returns the number of bytes from the start up
23023  * to including the last byte written in the stream
23024  * that has not been truncated away.
23025  *
23026  * Returns: the number of bytes written to the stream
23027  * Since: 2.18
23028  */
23029
23030
23031 /**
23032  * g_memory_output_stream_get_size:
23033  * @ostream: a #GMemoryOutputStream
23034  *
23035  * Gets the size of the currently allocated data area (available from
23036  * g_memory_output_stream_get_data()). If the stream isn't
23037  * growable (no realloc was passed to g_memory_output_stream_new()) then
23038  * this is the maximum size of the stream and further writes
23039  * will return %G_IO_ERROR_NO_SPACE.
23040  *
23041  * Note that for growable streams the returned size may become invalid on
23042  * the next write or truncate operation on the stream.
23043  *
23044  * If you want the number of bytes currently written to the stream, use
23045  * g_memory_output_stream_get_data_size().
23046  *
23047  * Returns: the number of bytes allocated for the data buffer
23048  */
23049
23050
23051 /**
23052  * g_memory_output_stream_new: (skip)
23053  * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
23054  * @size: the size of @data
23055  * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
23056  * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
23057  *
23058  * Creates a new #GMemoryOutputStream.
23059  *
23060  * If @data is non-%NULL, the stream  will use that for its internal storage.
23061  * If @realloc_fn is non-%NULL, it will be used for resizing the internal
23062  * storage when necessary. To construct a fixed-size output stream,
23063  * pass %NULL as @realloc_fn.
23064  *
23065  * |[
23066  * /&ast; a stream that can grow &ast;/
23067  * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
23068  *
23069  * /&ast; another stream that can grow &ast;/
23070  * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
23071  *
23072  * /&ast; a fixed-size stream &ast;/
23073  * data = malloc (200);
23074  * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
23075  * ]|
23076  *
23077  * Returns: A newly created #GMemoryOutputStream object.
23078  */
23079
23080
23081 /**
23082  * g_memory_output_stream_steal_as_bytes:
23083  * @ostream: a #GMemoryOutputStream
23084  *
23085  * Returns data from the @ostream as a #GBytes. @ostream must be
23086  * closed before calling this function.
23087  *
23088  * Returns: (transfer full): the stream's data
23089  * Since: 2.34
23090  */
23091
23092
23093 /**
23094  * g_memory_output_stream_steal_data:
23095  * @ostream: a #GMemoryOutputStream
23096  *
23097  * Gets any loaded data from the @ostream. Ownership of the data
23098  * is transferred to the caller; when no longer needed it must be
23099  * freed using the free function set in @ostream's
23100  * #GMemoryOutputStream:destroy-function property.
23101  *
23102  * @ostream must be closed before calling this function.
23103  *
23104  * Returns: (transfer full): the stream's data
23105  * Since: 2.26
23106  */
23107
23108
23109 /**
23110  * g_memory_settings_backend_new:
23111  *
23112  * Creates a memory-backed #GSettingsBackend.
23113  *
23114  * This backend allows changes to settings, but does not write them
23115  * to any backing storage, so the next time you run your application,
23116  * the memory backend will start out with the default values again.
23117  *
23118  * Returns: (transfer full): a newly created #GSettingsBackend
23119  * Since: 2.28
23120  */
23121
23122
23123 /**
23124  * g_menu_append:
23125  * @menu: a #GMenu
23126  * @label: (allow-none): the section label, or %NULL
23127  * @detailed_action: (allow-none): the detailed action string, or %NULL
23128  *
23129  * Convenience function for appending a normal menu item to the end of
23130  * @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
23131  * flexible alternative.
23132  *
23133  * Since: 2.32
23134  */
23135
23136
23137 /**
23138  * g_menu_append_item:
23139  * @menu: a #GMenu
23140  * @item: a #GMenuItem to append
23141  *
23142  * Appends @item to the end of @menu.
23143  *
23144  * See g_menu_insert_item() for more information.
23145  *
23146  * Since: 2.32
23147  */
23148
23149
23150 /**
23151  * g_menu_append_section:
23152  * @menu: a #GMenu
23153  * @label: (allow-none): the section label, or %NULL
23154  * @section: a #GMenuModel with the items of the section
23155  *
23156  * Convenience function for appending a section menu item to the end of
23157  * @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for a
23158  * more flexible alternative.
23159  *
23160  * Since: 2.32
23161  */
23162
23163
23164 /**
23165  * g_menu_append_submenu:
23166  * @menu: a #GMenu
23167  * @label: (allow-none): the section label, or %NULL
23168  * @submenu: a #GMenuModel with the items of the submenu
23169  *
23170  * Convenience function for appending a submenu menu item to the end of
23171  * @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
23172  * more flexible alternative.
23173  *
23174  * Since: 2.32
23175  */
23176
23177
23178 /**
23179  * g_menu_attribute_iter_get_name:
23180  * @iter: a #GMenuAttributeIter
23181  *
23182  * Gets the name of the attribute at the current iterator position, as
23183  * a string.
23184  *
23185  * The iterator is not advanced.
23186  *
23187  * Returns: the name of the attribute
23188  * Since: 2.32
23189  */
23190
23191
23192 /**
23193  * g_menu_attribute_iter_get_next:
23194  * @iter: a #GMenuAttributeIter
23195  * @out_name: (out) (allow-none) (transfer none): the type of the attribute
23196  * @value: (out) (allow-none) (transfer full): the attribute value
23197  *
23198  * This function combines g_menu_attribute_iter_next() with
23199  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
23200  *
23201  * First the iterator is advanced to the next (possibly first) attribute.
23202  * If that fails, then %FALSE is returned and there are no other
23203  * effects.
23204  *
23205  * If successful, @name and @value are set to the name and value of the
23206  * attribute that has just been advanced to.  At this point,
23207  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
23208  * return the same values again.
23209  *
23210  * The value returned in @name remains valid for as long as the iterator
23211  * remains at the current position.  The value returned in @value must
23212  * be unreffed using g_variant_unref() when it is no longer in use.
23213  *
23214  * Returns: %TRUE on success, or %FALSE if there is no additional attribute
23215  * Since: 2.32
23216  */
23217
23218
23219 /**
23220  * g_menu_attribute_iter_get_value:
23221  * @iter: a #GMenuAttributeIter
23222  *
23223  * Gets the value of the attribute at the current iterator position.
23224  *
23225  * The iterator is not advanced.
23226  *
23227  * Returns: (transfer full): the value of the current attribute
23228  * Since: 2.32
23229  */
23230
23231
23232 /**
23233  * g_menu_attribute_iter_next:
23234  * @iter: a #GMenuAttributeIter
23235  *
23236  * Attempts to advance the iterator to the next (possibly first)
23237  * attribute.
23238  *
23239  * %TRUE is returned on success, or %FALSE if there are no more
23240  * attributes.
23241  *
23242  * You must call this function when you first acquire the iterator
23243  * to advance it to the first attribute (and determine if the first
23244  * attribute exists at all).
23245  *
23246  * Returns: %TRUE on success, or %FALSE when there are no more attributes
23247  * Since: 2.32
23248  */
23249
23250
23251 /**
23252  * g_menu_freeze:
23253  * @menu: a #GMenu
23254  *
23255  * Marks @menu as frozen.
23256  *
23257  * After the menu is frozen, it is an error to attempt to make any
23258  * changes to it.  In effect this means that the #GMenu API must no
23259  * longer be used.
23260  *
23261  * This function causes g_menu_model_is_mutable() to begin returning
23262  * %FALSE, which has some positive performance implications.
23263  *
23264  * Since: 2.32
23265  */
23266
23267
23268 /**
23269  * g_menu_insert:
23270  * @menu: a #GMenu
23271  * @position: the position at which to insert the item
23272  * @label: (allow-none): the section label, or %NULL
23273  * @detailed_action: (allow-none): the detailed action string, or %NULL
23274  *
23275  * Convenience function for inserting a normal menu item into @menu.
23276  * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
23277  * alternative.
23278  *
23279  * Since: 2.32
23280  */
23281
23282
23283 /**
23284  * g_menu_insert_item:
23285  * @menu: a #GMenu
23286  * @position: the position at which to insert the item
23287  * @item: the #GMenuItem to insert
23288  *
23289  * Inserts @item into @menu.
23290  *
23291  * The "insertion" is actually done by copying all of the attribute and
23292  * link values of @item and using them to form a new item within @menu.
23293  * As such, @item itself is not really inserted, but rather, a menu item
23294  * that is exactly the same as the one presently described by @item.
23295  *
23296  * This means that @item is essentially useless after the insertion
23297  * occurs.  Any changes you make to it are ignored unless it is inserted
23298  * again (at which point its updated values will be copied).
23299  *
23300  * You should probably just free @item once you're done.
23301  *
23302  * There are many convenience functions to take care of common cases.
23303  * See g_menu_insert(), g_menu_insert_section() and
23304  * g_menu_insert_submenu() as well as "prepend" and "append" variants of
23305  * each of these functions.
23306  *
23307  * Since: 2.32
23308  */
23309
23310
23311 /**
23312  * g_menu_insert_section:
23313  * @menu: a #GMenu
23314  * @position: the position at which to insert the item
23315  * @label: (allow-none): the section label, or %NULL
23316  * @section: a #GMenuModel with the items of the section
23317  *
23318  * Convenience function for inserting a section menu item into @menu.
23319  * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
23320  * flexible alternative.
23321  *
23322  * Since: 2.32
23323  */
23324
23325
23326 /**
23327  * g_menu_insert_submenu:
23328  * @menu: a #GMenu
23329  * @position: the position at which to insert the item
23330  * @label: (allow-none): the section label, or %NULL
23331  * @submenu: a #GMenuModel with the items of the submenu
23332  *
23333  * Convenience function for inserting a submenu menu item into @menu.
23334  * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
23335  * flexible alternative.
23336  *
23337  * Since: 2.32
23338  */
23339
23340
23341 /**
23342  * g_menu_item_get_attribute:
23343  * @menu_item: a #GMenuItem
23344  * @attribute: the attribute name to query
23345  * @format_string: a #GVariant format string
23346  * @...: positional parameters, as per @format_string
23347  *
23348  * Queries the named @attribute on @menu_item.
23349  *
23350  * If the attribute exists and matches the #GVariantType corresponding
23351  * to @format_string then @format_string is used to deconstruct the
23352  * value into the positional parameters and %TRUE is returned.
23353  *
23354  * If the attribute does not exist, or it does exist but has the wrong
23355  * type, then the positional parameters are ignored and %FALSE is
23356  * returned.
23357  *
23358  * Returns: %TRUE if the named attribute was found with the expected type
23359  * Since: 2.34
23360  */
23361
23362
23363 /**
23364  * g_menu_item_get_attribute_value:
23365  * @menu_item: a #GMenuItem
23366  * @attribute: the attribute name to query
23367  * @expected_type: (allow-none): the expected type of the attribute
23368  *
23369  * Queries the named @attribute on @menu_item.
23370  *
23371  * If @expected_type is specified and the attribute does not have this
23372  * type, %NULL is returned.  %NULL is also returned if the attribute
23373  * simply does not exist.
23374  *
23375  * Returns: (transfer full): the attribute value, or %NULL
23376  * Since: 2.34
23377  */
23378
23379
23380 /**
23381  * g_menu_item_get_link:
23382  * @menu_item: a #GMenuItem
23383  * @link: the link name to query
23384  *
23385  * Queries the named @link on @menu_item.
23386  *
23387  * Returns: (transfer full): the link, or %NULL
23388  * Since: 2.34
23389  */
23390
23391
23392 /**
23393  * g_menu_item_new:
23394  * @label: (allow-none): the section label, or %NULL
23395  * @detailed_action: (allow-none): the detailed action string, or %NULL
23396  *
23397  * Creates a new #GMenuItem.
23398  *
23399  * If @label is non-%NULL it is used to set the "label" attribute of the
23400  * new item.
23401  *
23402  * If @detailed_action is non-%NULL it is used to set the "action" and
23403  * possibly the "target" attribute of the new item.  See
23404  * g_menu_item_set_detailed_action() for more information.
23405  *
23406  * Returns: a new #GMenuItem
23407  * Since: 2.32
23408  */
23409
23410
23411 /**
23412  * g_menu_item_new_from_model:
23413  * @model: a #GMenuModel
23414  * @item_index: the index of an item in @model
23415  *
23416  * Creates a #GMenuItem as an exact copy of an existing menu item in a
23417  * #GMenuModel.
23418  *
23419  * @item_index must be valid (ie: be sure to call
23420  * g_menu_model_get_n_items() first).
23421  *
23422  * Returns: a new #GMenuItem.
23423  * Since: 2.34
23424  */
23425
23426
23427 /**
23428  * g_menu_item_new_section:
23429  * @label: (allow-none): the section label, or %NULL
23430  * @section: a #GMenuModel with the items of the section
23431  *
23432  * Creates a new #GMenuItem representing a section.
23433  *
23434  * This is a convenience API around g_menu_item_new() and
23435  * g_menu_item_set_section().
23436  *
23437  * The effect of having one menu appear as a section of another is
23438  * exactly as it sounds: the items from @section become a direct part of
23439  * the menu that @menu_item is added to.
23440  *
23441  * Visual separation is typically displayed between two non-empty
23442  * sections.  If @label is non-%NULL then it will be encorporated into
23443  * this visual indication.  This allows for labeled subsections of a
23444  * menu.
23445  *
23446  * As a simple example, consider a typical "Edit" menu from a simple
23447  * program.  It probably contains an "Undo" and "Redo" item, followed by
23448  * a separator, followed by "Cut", "Copy" and "Paste".
23449  *
23450  * This would be accomplished by creating three #GMenu instances.  The
23451  * first would be populated with the "Undo" and "Redo" items, and the
23452  * second with the "Cut", "Copy" and "Paste" items.  The first and
23453  * second menus would then be added as submenus of the third.  In XML
23454  * format, this would look something like the following:
23455  *
23456  * <informalexample><programlisting><![CDATA[
23457  * <menu id='edit-menu'>
23458  *   <section>
23459  *     <item label='Undo'/>
23460  *     <item label='Redo'/>
23461  *   </section>
23462  *   <section>
23463  *     <item label='Cut'/>
23464  *     <item label='Copy'/>
23465  *     <item label='Paste'/>
23466  *   </section>
23467  * </menu>
23468  * ]]></programlisting></informalexample>
23469  *
23470  * The following example is exactly equivalent.  It is more illustrative
23471  * of the exact relationship between the menus and items (keeping in
23472  * mind that the 'link' element defines a new menu that is linked to the
23473  * containing one).  The style of the second example is more verbose and
23474  * difficult to read (and therefore not recommended except for the
23475  * purpose of understanding what is really going on).
23476  *
23477  * <informalexample><programlisting><![CDATA[
23478  * <menu id='edit-menu'>
23479  *   <item>
23480  *     <link name='section'>
23481  *       <item label='Undo'/>
23482  *       <item label='Redo'/>
23483  *     </link>
23484  *   </item>
23485  *   <item>
23486  *     <link name='section'>
23487  *       <item label='Cut'/>
23488  *       <item label='Copy'/>
23489  *       <item label='Paste'/>
23490  *     </link>
23491  *   </item>
23492  * </menu>
23493  * ]]></programlisting></informalexample>
23494  *
23495  * Returns: a new #GMenuItem
23496  * Since: 2.32
23497  */
23498
23499
23500 /**
23501  * g_menu_item_new_submenu:
23502  * @label: (allow-none): the section label, or %NULL
23503  * @submenu: a #GMenuModel with the items of the submenu
23504  *
23505  * Creates a new #GMenuItem representing a submenu.
23506  *
23507  * This is a convenience API around g_menu_item_new() and
23508  * g_menu_item_set_submenu().
23509  *
23510  * Returns: a new #GMenuItem
23511  * Since: 2.32
23512  */
23513
23514
23515 /**
23516  * g_menu_item_set_action_and_target:
23517  * @menu_item: a #GMenuItem
23518  * @action: (allow-none): the name of the action for this item
23519  * @format_string: (allow-none): a GVariant format string
23520  * @...: positional parameters, as per @format_string
23521  *
23522  * Sets or unsets the "action" and "target" attributes of @menu_item.
23523  *
23524  * If @action is %NULL then both the "action" and "target" attributes
23525  * are unset (and @format_string is ignored along with the positional
23526  * parameters).
23527  *
23528  * If @action is non-%NULL then the "action" attribute is set.
23529  * @format_string is then inspected.  If it is non-%NULL then the proper
23530  * position parameters are collected to create a #GVariant instance to
23531  * use as the target value.  If it is %NULL then the positional
23532  * parameters are ignored and the "target" attribute is unset.
23533  *
23534  * See also g_menu_item_set_action_and_target_value() for an equivalent
23535  * call that directly accepts a #GVariant.  See
23536  * g_menu_item_set_detailed_action() for a more convenient version that
23537  * works with string-typed targets.
23538  *
23539  * See also g_menu_item_set_action_and_target_value() for a
23540  * description of the semantics of the action and target attributes.
23541  *
23542  * Since: 2.32
23543  */
23544
23545
23546 /**
23547  * g_menu_item_set_action_and_target_value:
23548  * @menu_item: a #GMenuItem
23549  * @action: (allow-none): the name of the action for this item
23550  * @target_value: (allow-none): a #GVariant to use as the action target
23551  *
23552  * Sets or unsets the "action" and "target" attributes of @menu_item.
23553  *
23554  * If @action is %NULL then both the "action" and "target" attributes
23555  * are unset (and @target_value is ignored).
23556  *
23557  * If @action is non-%NULL then the "action" attribute is set.  The
23558  * "target" attribute is then set to the value of @target_value if it is
23559  * non-%NULL or unset otherwise.
23560  *
23561  * Normal menu items (ie: not submenu, section or other custom item
23562  * types) are expected to have the "action" attribute set to identify
23563  * the action that they are associated with.  The state type of the
23564  * action help to determine the disposition of the menu item.  See
23565  * #GAction and #GActionGroup for an overview of actions.
23566  *
23567  * In general, clicking on the menu item will result in activation of
23568  * the named action with the "target" attribute given as the parameter
23569  * to the action invocation.  If the "target" attribute is not set then
23570  * the action is invoked with no parameter.
23571  *
23572  * If the action has no state then the menu item is usually drawn as a
23573  * plain menu item (ie: with no additional decoration).
23574  *
23575  * If the action has a boolean state then the menu item is usually drawn
23576  * as a toggle menu item (ie: with a checkmark or equivalent
23577  * indication).  The item should be marked as 'toggled' or 'checked'
23578  * when the boolean state is %TRUE.
23579  *
23580  * If the action has a string state then the menu item is usually drawn
23581  * as a radio menu item (ie: with a radio bullet or equivalent
23582  * indication).  The item should be marked as 'selected' when the string
23583  * state is equal to the value of the @target property.
23584  *
23585  * See g_menu_item_set_action_and_target() or
23586  * g_menu_item_set_detailed_action() for two equivalent calls that are
23587  * probably more convenient for most uses.
23588  *
23589  * Since: 2.32
23590  */
23591
23592
23593 /**
23594  * g_menu_item_set_attribute:
23595  * @menu_item: a #GMenuItem
23596  * @attribute: the attribute to set
23597  * @format_string: (allow-none): a #GVariant format string, or %NULL
23598  * @...: positional parameters, as per @format_string
23599  *
23600  * Sets or unsets an attribute on @menu_item.
23601  *
23602  * The attribute to set or unset is specified by @attribute. This
23603  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23604  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23605  * attribute name.
23606  * Attribute names are restricted to lowercase characters, numbers
23607  * and '-'. Furthermore, the names must begin with a lowercase character,
23608  * must not end with a '-', and must not contain consecutive dashes.
23609  *
23610  * If @format_string is non-%NULL then the proper position parameters
23611  * are collected to create a #GVariant instance to use as the attribute
23612  * value.  If it is %NULL then the positional parameterrs are ignored
23613  * and the named attribute is unset.
23614  *
23615  * See also g_menu_item_set_attribute_value() for an equivalent call
23616  * that directly accepts a #GVariant.
23617  *
23618  * Since: 2.32
23619  */
23620
23621
23622 /**
23623  * g_menu_item_set_attribute_value:
23624  * @menu_item: a #GMenuItem
23625  * @attribute: the attribute to set
23626  * @value: (allow-none): a #GVariant to use as the value, or %NULL
23627  *
23628  * Sets or unsets an attribute on @menu_item.
23629  *
23630  * The attribute to set or unset is specified by @attribute. This
23631  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23632  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23633  * attribute name.
23634  * Attribute names are restricted to lowercase characters, numbers
23635  * and '-'. Furthermore, the names must begin with a lowercase character,
23636  * must not end with a '-', and must not contain consecutive dashes.
23637  *
23638  * must consist only of lowercase
23639  * ASCII characters, digits and '-'.
23640  *
23641  * If @value is non-%NULL then it is used as the new value for the
23642  * attribute.  If @value is %NULL then the attribute is unset. If
23643  * the @value #GVariant is floating, it is consumed.
23644  *
23645  * See also g_menu_item_set_attribute() for a more convenient way to do
23646  * the same.
23647  *
23648  * Since: 2.32
23649  */
23650
23651
23652 /**
23653  * g_menu_item_set_detailed_action:
23654  * @menu_item: a #GMenuItem
23655  * @detailed_action: the "detailed" action string
23656  *
23657  * Sets the "action" and possibly the "target" attribute of @menu_item.
23658  *
23659  * If @detailed_action contains a double colon ("::") then it is used as
23660  * a separator between an action name and a target string.  In this
23661  * case, this call is equivalent to calling
23662  * g_menu_item_set_action_and_target() with the part before the "::" and
23663  * with a string-type #GVariant containing the part following the "::".
23664  *
23665  * If @detailed_action doesn't contain "::" then the action is set to
23666  * the given string (verbatim) and the target value is unset.
23667  *
23668  * See g_menu_item_set_action_and_target() or
23669  * g_menu_item_set_action_and_target_value() for more flexible (but
23670  * slightly less convenient) alternatives.
23671  *
23672  * See also g_menu_item_set_action_and_target_value() for a description of
23673  * the semantics of the action and target attributes.
23674  *
23675  * Since: 2.32
23676  */
23677
23678
23679 /**
23680  * g_menu_item_set_label:
23681  * @menu_item: a #GMenuItem
23682  * @label: (allow-none): the label to set, or %NULL to unset
23683  *
23684  * Sets or unsets the "label" attribute of @menu_item.
23685  *
23686  * If @label is non-%NULL it is used as the label for the menu item.  If
23687  * it is %NULL then the label attribute is unset.
23688  *
23689  * Since: 2.32
23690  */
23691
23692
23693 /**
23694  * g_menu_item_set_link:
23695  * @menu_item: a #GMenuItem
23696  * @link: type of link to establish or unset
23697  * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23698  *
23699  * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23700  *
23701  * Links are used to establish a relationship between a particular menu
23702  * item and another menu.  For example, %G_MENU_LINK_SUBMENU is used to
23703  * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23704  * is used to create a section. Other types of link can be used, but there
23705  * is no guarantee that clients will be able to make sense of them.
23706  * Link types are restricted to lowercase characters, numbers
23707  * and '-'. Furthermore, the names must begin with a lowercase character,
23708  * must not end with a '-', and must not contain consecutive dashes.
23709  *
23710  * Since: 2.32
23711  */
23712
23713
23714 /**
23715  * g_menu_item_set_section:
23716  * @menu_item: a #GMenuItem
23717  * @section: (allow-none): a #GMenuModel, or %NULL
23718  *
23719  * Sets or unsets the "section" link of @menu_item to @section.
23720  *
23721  * The effect of having one menu appear as a section of another is
23722  * exactly as it sounds: the items from @section become a direct part of
23723  * the menu that @menu_item is added to.  See g_menu_item_new_section()
23724  * for more information about what it means for a menu item to be a
23725  * section.
23726  *
23727  * Since: 2.32
23728  */
23729
23730
23731 /**
23732  * g_menu_item_set_submenu:
23733  * @menu_item: a #GMenuItem
23734  * @submenu: (allow-none): a #GMenuModel, or %NULL
23735  *
23736  * Sets or unsets the "submenu" link of @menu_item to @submenu.
23737  *
23738  * If @submenu is non-%NULL, it is linked to.  If it is %NULL then the
23739  * link is unset.
23740  *
23741  * The effect of having one menu appear as a submenu of another is
23742  * exactly as it sounds.
23743  *
23744  * Since: 2.32
23745  */
23746
23747
23748 /**
23749  * g_menu_link_iter_get_name:
23750  * @iter: a #GMenuLinkIter
23751  *
23752  * Gets the name of the link at the current iterator position.
23753  *
23754  * The iterator is not advanced.
23755  *
23756  * Returns: the type of the link
23757  * Since: 2.32
23758  */
23759
23760
23761 /**
23762  * g_menu_link_iter_get_next:
23763  * @iter: a #GMenuLinkIter
23764  * @out_link: (out) (allow-none) (transfer none): the name of the link
23765  * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23766  *
23767  * This function combines g_menu_link_iter_next() with
23768  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23769  *
23770  * First the iterator is advanced to the next (possibly first) link.
23771  * If that fails, then %FALSE is returned and there are no other effects.
23772  *
23773  * If successful, @out_link and @value are set to the name and #GMenuModel
23774  * of the link that has just been advanced to.  At this point,
23775  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23776  * same values again.
23777  *
23778  * The value returned in @out_link remains valid for as long as the iterator
23779  * remains at the current position.  The value returned in @value must
23780  * be unreffed using g_object_unref() when it is no longer in use.
23781  *
23782  * Returns: %TRUE on success, or %FALSE if there is no additional link
23783  * Since: 2.32
23784  */
23785
23786
23787 /**
23788  * g_menu_link_iter_get_value:
23789  * @iter: a #GMenuLinkIter
23790  *
23791  * Gets the linked #GMenuModel at the current iterator position.
23792  *
23793  * The iterator is not advanced.
23794  *
23795  * Returns: (transfer full): the #GMenuModel that is linked to
23796  * Since: 2.32
23797  */
23798
23799
23800 /**
23801  * g_menu_link_iter_next:
23802  * @iter: a #GMenuLinkIter
23803  *
23804  * Attempts to advance the iterator to the next (possibly first)
23805  * link.
23806  *
23807  * %TRUE is returned on success, or %FALSE if there are no more links.
23808  *
23809  * You must call this function when you first acquire the iterator to
23810  * advance it to the first link (and determine if the first link exists
23811  * at all).
23812  *
23813  * Returns: %TRUE on success, or %FALSE when there are no more links
23814  * Since: 2.32
23815  */
23816
23817
23818 /**
23819  * g_menu_model_get_item_attribute:
23820  * @model: a #GMenuModel
23821  * @item_index: the index of the item
23822  * @attribute: the attribute to query
23823  * @format_string: a #GVariant format string
23824  * @...: positional parameters, as per @format_string
23825  *
23826  * Queries item at position @item_index in @model for the attribute
23827  * specified by @attribute.
23828  *
23829  * If the attribute exists and matches the #GVariantType corresponding
23830  * to @format_string then @format_string is used to deconstruct the
23831  * value into the positional parameters and %TRUE is returned.
23832  *
23833  * If the attribute does not exist, or it does exist but has the wrong
23834  * type, then the positional parameters are ignored and %FALSE is
23835  * returned.
23836  *
23837  * This function is a mix of g_menu_model_get_item_attribute_value() and
23838  * g_variant_get(), followed by a g_variant_unref().  As such,
23839  * @format_string must make a complete copy of the data (since the
23840  * #GVariant may go away after the call to g_variant_unref()).  In
23841  * particular, no '&amp;' characters are allowed in @format_string.
23842  *
23843  * Returns: %TRUE if the named attribute was found with the expected type
23844  * Since: 2.32
23845  */
23846
23847
23848 /**
23849  * g_menu_model_get_item_attribute_value:
23850  * @model: a #GMenuModel
23851  * @item_index: the index of the item
23852  * @attribute: the attribute to query
23853  * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23854  *
23855  * Queries the item at position @item_index in @model for the attribute
23856  * specified by @attribute.
23857  *
23858  * If @expected_type is non-%NULL then it specifies the expected type of
23859  * the attribute.  If it is %NULL then any type will be accepted.
23860  *
23861  * If the attribute exists and matches @expected_type (or if the
23862  * expected type is unspecified) then the value is returned.
23863  *
23864  * If the attribute does not exist, or does not match the expected type
23865  * then %NULL is returned.
23866  *
23867  * Returns: (transfer full): the value of the attribute
23868  * Since: 2.32
23869  */
23870
23871
23872 /**
23873  * g_menu_model_get_item_link:
23874  * @model: a #GMenuModel
23875  * @item_index: the index of the item
23876  * @link: the link to query
23877  *
23878  * Queries the item at position @item_index in @model for the link
23879  * specified by @link.
23880  *
23881  * If the link exists, the linked #GMenuModel is returned.  If the link
23882  * does not exist, %NULL is returned.
23883  *
23884  * Returns: (transfer full): the linked #GMenuModel, or %NULL
23885  * Since: 2.32
23886  */
23887
23888
23889 /**
23890  * g_menu_model_get_n_items:
23891  * @model: a #GMenuModel
23892  *
23893  * Query the number of items in @model.
23894  *
23895  * Returns: the number of items
23896  * Since: 2.32
23897  */
23898
23899
23900 /**
23901  * g_menu_model_is_mutable:
23902  * @model: a #GMenuModel
23903  *
23904  * Queries if @model is mutable.
23905  *
23906  * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23907  * signal. Consumers of the model may make optimisations accordingly.
23908  *
23909  * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23910  * Since: 2.32
23911  */
23912
23913
23914 /**
23915  * g_menu_model_items_changed:
23916  * @model: a #GMenuModel
23917  * @position: the position of the change
23918  * @removed: the number of items removed
23919  * @added: the number of items added
23920  *
23921  * Requests emission of the #GMenuModel::items-changed signal on @model.
23922  *
23923  * This function should never be called except by #GMenuModel
23924  * subclasses.  Any other calls to this function will very likely lead
23925  * to a violation of the interface of the model.
23926  *
23927  * The implementation should update its internal representation of the
23928  * menu before emitting the signal.  The implementation should further
23929  * expect to receive queries about the new state of the menu (and
23930  * particularly added menu items) while signal handlers are running.
23931  *
23932  * The implementation must dispatch this call directly from a mainloop
23933  * entry and not in response to calls -- particularly those from the
23934  * #GMenuModel API.  Said another way: the menu must not change while
23935  * user code is running without returning to the mainloop.
23936  *
23937  * Since: 2.32
23938  */
23939
23940
23941 /**
23942  * g_menu_model_iterate_item_attributes:
23943  * @model: a #GMenuModel
23944  * @item_index: the index of the item
23945  *
23946  * Creates a #GMenuAttributeIter to iterate over the attributes of
23947  * the item at position @item_index in @model.
23948  *
23949  * You must free the iterator with g_object_unref() when you are done.
23950  *
23951  * Returns: (transfer full): a new #GMenuAttributeIter
23952  * Since: 2.32
23953  */
23954
23955
23956 /**
23957  * g_menu_model_iterate_item_links:
23958  * @model: a #GMenuModel
23959  * @item_index: the index of the item
23960  *
23961  * Creates a #GMenuLinkIter to iterate over the links of the item at
23962  * position @item_index in @model.
23963  *
23964  * You must free the iterator with g_object_unref() when you are done.
23965  *
23966  * Returns: (transfer full): a new #GMenuLinkIter
23967  * Since: 2.32
23968  */
23969
23970
23971 /**
23972  * g_menu_new:
23973  *
23974  * Creates a new #GMenu.
23975  *
23976  * The new menu has no items.
23977  *
23978  * Returns: a new #GMenu
23979  * Since: 2.32
23980  */
23981
23982
23983 /**
23984  * g_menu_prepend:
23985  * @menu: a #GMenu
23986  * @label: (allow-none): the section label, or %NULL
23987  * @detailed_action: (allow-none): the detailed action string, or %NULL
23988  *
23989  * Convenience function for prepending a normal menu item to the start
23990  * of @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
23991  * flexible alternative.
23992  *
23993  * Since: 2.32
23994  */
23995
23996
23997 /**
23998  * g_menu_prepend_item:
23999  * @menu: a #GMenu
24000  * @item: a #GMenuItem to prepend
24001  *
24002  * Prepends @item to the start of @menu.
24003  *
24004  * See g_menu_insert_item() for more information.
24005  *
24006  * Since: 2.32
24007  */
24008
24009
24010 /**
24011  * g_menu_prepend_section:
24012  * @menu: a #GMenu
24013  * @label: (allow-none): the section label, or %NULL
24014  * @section: a #GMenuModel with the items of the section
24015  *
24016  * Convenience function for prepending a section menu item to the start
24017  * of @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for
24018  * a more flexible alternative.
24019  *
24020  * Since: 2.32
24021  */
24022
24023
24024 /**
24025  * g_menu_prepend_submenu:
24026  * @menu: a #GMenu
24027  * @label: (allow-none): the section label, or %NULL
24028  * @submenu: a #GMenuModel with the items of the submenu
24029  *
24030  * Convenience function for prepending a submenu menu item to the start
24031  * of @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for
24032  * a more flexible alternative.
24033  *
24034  * Since: 2.32
24035  */
24036
24037
24038 /**
24039  * g_menu_remove:
24040  * @menu: a #GMenu
24041  * @position: the position of the item to remove
24042  *
24043  * Removes an item from the menu.
24044  *
24045  * @position gives the index of the item to remove.
24046  *
24047  * It is an error if position is not in range the range from 0 to one
24048  * less than the number of items in the menu.
24049  *
24050  * It is not possible to remove items by identity since items are added
24051  * to the menu simply by copying their links and attributes (ie:
24052  * identity of the item itself is not preserved).
24053  *
24054  * Since: 2.32
24055  */
24056
24057
24058 /**
24059  * g_mount_can_eject:
24060  * @mount: a #GMount.
24061  *
24062  * Checks if @mount can be eject.
24063  *
24064  * Returns: %TRUE if the @mount can be ejected.
24065  */
24066
24067
24068 /**
24069  * g_mount_can_unmount:
24070  * @mount: a #GMount.
24071  *
24072  * Checks if @mount can be mounted.
24073  *
24074  * Returns: %TRUE if the @mount can be unmounted.
24075  */
24076
24077
24078 /**
24079  * g_mount_eject:
24080  * @mount: a #GMount.
24081  * @flags: flags affecting the unmount if required for eject
24082  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24083  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24084  * @user_data: user data passed to @callback.
24085  *
24086  * Ejects a mount. This is an asynchronous operation, and is
24087  * finished by calling g_mount_eject_finish() with the @mount
24088  * and #GAsyncResult data returned in the @callback.
24089  *
24090  * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
24091  */
24092
24093
24094 /**
24095  * g_mount_eject_finish:
24096  * @mount: a #GMount.
24097  * @result: a #GAsyncResult.
24098  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24099  *
24100  * Finishes ejecting a mount. If any errors occurred during the operation,
24101  * @error will be set to contain the errors and %FALSE will be returned.
24102  *
24103  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
24104  * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
24105  */
24106
24107
24108 /**
24109  * g_mount_eject_with_operation:
24110  * @mount: a #GMount.
24111  * @flags: flags affecting the unmount if required for eject
24112  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24113  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24114  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24115  * @user_data: user data passed to @callback.
24116  *
24117  * Ejects a mount. This is an asynchronous operation, and is
24118  * finished by calling g_mount_eject_with_operation_finish() with the @mount
24119  * and #GAsyncResult data returned in the @callback.
24120  *
24121  * Since: 2.22
24122  */
24123
24124
24125 /**
24126  * g_mount_eject_with_operation_finish:
24127  * @mount: a #GMount.
24128  * @result: a #GAsyncResult.
24129  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24130  *
24131  * Finishes ejecting a mount. If any errors occurred during the operation,
24132  * @error will be set to contain the errors and %FALSE will be returned.
24133  *
24134  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
24135  * Since: 2.22
24136  */
24137
24138
24139 /**
24140  * g_mount_get_default_location:
24141  * @mount: a #GMount.
24142  *
24143  * Gets the default location of @mount. The default location of the given
24144  * @mount is a path that reflects the main entry point for the user (e.g.
24145  * the home directory, or the root of the volume).
24146  *
24147  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
24148  */
24149
24150
24151 /**
24152  * g_mount_get_drive:
24153  * @mount: a #GMount.
24154  *
24155  * Gets the drive for the @mount.
24156  *
24157  * This is a convenience method for getting the #GVolume and then
24158  * using that object to get the #GDrive.
24159  *
24160  * 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.
24161  */
24162
24163
24164 /**
24165  * g_mount_get_icon:
24166  * @mount: a #GMount.
24167  *
24168  * Gets the icon for @mount.
24169  *
24170  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
24171  */
24172
24173
24174 /**
24175  * g_mount_get_name:
24176  * @mount: a #GMount.
24177  *
24178  * Gets the name of @mount.
24179  *
24180  * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
24181  */
24182
24183
24184 /**
24185  * g_mount_get_root:
24186  * @mount: a #GMount.
24187  *
24188  * Gets the root directory on @mount.
24189  *
24190  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
24191  */
24192
24193
24194 /**
24195  * g_mount_get_sort_key:
24196  * @mount: A #GMount.
24197  *
24198  * Gets the sort key for @mount, if any.
24199  *
24200  * Returns: Sorting key for @mount or %NULL if no such key is available.
24201  * Since: 2.32
24202  */
24203
24204
24205 /**
24206  * g_mount_get_symbolic_icon:
24207  * @mount: a #GMount.
24208  *
24209  * Gets the symbolic icon for @mount.
24210  *
24211  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
24212  * Since: 2.34
24213  */
24214
24215
24216 /**
24217  * g_mount_get_uuid:
24218  * @mount: a #GMount.
24219  *
24220  * Gets the UUID for the @mount. The reference is typically based on
24221  * the file system UUID for the mount in question and should be
24222  * considered an opaque string. Returns %NULL if there is no UUID
24223  * available.
24224  *
24225  * 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.
24226  */
24227
24228
24229 /**
24230  * g_mount_get_volume:
24231  * @mount: a #GMount.
24232  *
24233  * Gets the volume for the @mount.
24234  *
24235  * 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.
24236  */
24237
24238
24239 /**
24240  * g_mount_guess_content_type:
24241  * @mount: a #GMount
24242  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
24243  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
24244  * @callback: a #GAsyncReadyCallback
24245  * @user_data: user data passed to @callback
24246  *
24247  * Tries to guess the type of content stored on @mount. Returns one or
24248  * more textual identifiers of well-known content types (typically
24249  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
24250  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
24251  * specification for more on x-content types.
24252  *
24253  * This is an asynchronous operation (see
24254  * g_mount_guess_content_type_sync() for the synchronous version), and
24255  * is finished by calling g_mount_guess_content_type_finish() with the
24256  * @mount and #GAsyncResult data returned in the @callback.
24257  *
24258  * Since: 2.18
24259  */
24260
24261
24262 /**
24263  * g_mount_guess_content_type_finish:
24264  * @mount: a #GMount
24265  * @result: a #GAsyncResult
24266  * @error: a #GError location to store the error occurring, or %NULL to ignore
24267  *
24268  * Finishes guessing content types of @mount. If any errors occurred
24269  * during the operation, @error will be set to contain the errors and
24270  * %FALSE will be returned. In particular, you may get an
24271  * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
24272  * guessing.
24273  *
24274  * 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.
24275  * Since: 2.18
24276  */
24277
24278
24279 /**
24280  * g_mount_guess_content_type_sync:
24281  * @mount: a #GMount
24282  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
24283  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
24284  * @error: a #GError location to store the error occurring, or %NULL to ignore
24285  *
24286  * Tries to guess the type of content stored on @mount. Returns one or
24287  * more textual identifiers of well-known content types (typically
24288  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
24289  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
24290  * specification for more on x-content types.
24291  *
24292  * This is an synchronous operation and as such may block doing IO;
24293  * see g_mount_guess_content_type() for the asynchronous version.
24294  *
24295  * 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.
24296  * Since: 2.18
24297  */
24298
24299
24300 /**
24301  * g_mount_is_shadowed:
24302  * @mount: A #GMount.
24303  *
24304  * Determines if @mount is shadowed. Applications or libraries should
24305  * avoid displaying @mount in the user interface if it is shadowed.
24306  *
24307  * A mount is said to be shadowed if there exists one or more user
24308  * visible objects (currently #GMount objects) with a root that is
24309  * inside the root of @mount.
24310  *
24311  * One application of shadow mounts is when exposing a single file
24312  * system that is used to address several logical volumes. In this
24313  * situation, a #GVolumeMonitor implementation would create two
24314  * #GVolume objects (for example, one for the camera functionality of
24315  * the device and one for a SD card reader on the device) with
24316  * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
24317  * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
24318  * underlying mount (with root
24319  * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
24320  * #GVolumeMonitor implementation would create two #GMount objects
24321  * (each with their root matching the corresponding volume activation
24322  * root) that would shadow the original mount.
24323  *
24324  * The proxy monitor in GVfs 2.26 and later, automatically creates and
24325  * manage shadow mounts (and shadows the underlying mount) if the
24326  * activation root on a #GVolume is set.
24327  *
24328  * Returns: %TRUE if @mount is shadowed.
24329  * Since: 2.20
24330  */
24331
24332
24333 /**
24334  * g_mount_operation_get_anonymous:
24335  * @op: a #GMountOperation.
24336  *
24337  * Check to see whether the mount operation is being used
24338  * for an anonymous user.
24339  *
24340  * Returns: %TRUE if mount operation is anonymous.
24341  */
24342
24343
24344 /**
24345  * g_mount_operation_get_choice:
24346  * @op: a #GMountOperation.
24347  *
24348  * Gets a choice from the mount operation.
24349  *
24350  * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
24351  */
24352
24353
24354 /**
24355  * g_mount_operation_get_domain:
24356  * @op: a #GMountOperation.
24357  *
24358  * Gets the domain of the mount operation.
24359  *
24360  * Returns: a string set to the domain.
24361  */
24362
24363
24364 /**
24365  * g_mount_operation_get_password:
24366  * @op: a #GMountOperation.
24367  *
24368  * Gets a password from the mount operation.
24369  *
24370  * Returns: a string containing the password within @op.
24371  */
24372
24373
24374 /**
24375  * g_mount_operation_get_password_save:
24376  * @op: a #GMountOperation.
24377  *
24378  * Gets the state of saving passwords for the mount operation.
24379  *
24380  * Returns: a #GPasswordSave flag.
24381  */
24382
24383
24384 /**
24385  * g_mount_operation_get_username:
24386  * @op: a #GMountOperation.
24387  *
24388  * Get the user name from the mount operation.
24389  *
24390  * Returns: a string containing the user name.
24391  */
24392
24393
24394 /**
24395  * g_mount_operation_new:
24396  *
24397  * Creates a new mount operation.
24398  *
24399  * Returns: a #GMountOperation.
24400  */
24401
24402
24403 /**
24404  * g_mount_operation_reply:
24405  * @op: a #GMountOperation
24406  * @result: a #GMountOperationResult
24407  *
24408  * Emits the #GMountOperation::reply signal.
24409  */
24410
24411
24412 /**
24413  * g_mount_operation_set_anonymous:
24414  * @op: a #GMountOperation.
24415  * @anonymous: boolean value.
24416  *
24417  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
24418  */
24419
24420
24421 /**
24422  * g_mount_operation_set_choice:
24423  * @op: a #GMountOperation.
24424  * @choice: an integer.
24425  *
24426  * Sets a default choice for the mount operation.
24427  */
24428
24429
24430 /**
24431  * g_mount_operation_set_domain:
24432  * @op: a #GMountOperation.
24433  * @domain: the domain to set.
24434  *
24435  * Sets the mount operation's domain.
24436  */
24437
24438
24439 /**
24440  * g_mount_operation_set_password:
24441  * @op: a #GMountOperation.
24442  * @password: password to set.
24443  *
24444  * Sets the mount operation's password to @password.
24445  */
24446
24447
24448 /**
24449  * g_mount_operation_set_password_save:
24450  * @op: a #GMountOperation.
24451  * @save: a set of #GPasswordSave flags.
24452  *
24453  * Sets the state of saving passwords for the mount operation.
24454  */
24455
24456
24457 /**
24458  * g_mount_operation_set_username:
24459  * @op: a #GMountOperation.
24460  * @username: input username.
24461  *
24462  * Sets the user name within @op to @username.
24463  */
24464
24465
24466 /**
24467  * g_mount_remount:
24468  * @mount: a #GMount.
24469  * @flags: flags affecting the operation
24470  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24471  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24472  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24473  * @user_data: user data passed to @callback.
24474  *
24475  * Remounts a mount. This is an asynchronous operation, and is
24476  * finished by calling g_mount_remount_finish() with the @mount
24477  * and #GAsyncResults data returned in the @callback.
24478  *
24479  * Remounting is useful when some setting affecting the operation
24480  * of the volume has been changed, as these may need a remount to
24481  * take affect. While this is semantically equivalent with unmounting
24482  * and then remounting not all backends might need to actually be
24483  * unmounted.
24484  */
24485
24486
24487 /**
24488  * g_mount_remount_finish:
24489  * @mount: a #GMount.
24490  * @result: a #GAsyncResult.
24491  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24492  *
24493  * Finishes remounting a mount. If any errors occurred during the operation,
24494  * @error will be set to contain the errors and %FALSE will be returned.
24495  *
24496  * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
24497  */
24498
24499
24500 /**
24501  * g_mount_shadow:
24502  * @mount: A #GMount.
24503  *
24504  * Increments the shadow count on @mount. Usually used by
24505  * #GVolumeMonitor implementations when creating a shadow mount for
24506  * @mount, see g_mount_is_shadowed() for more information. The caller
24507  * will need to emit the #GMount::changed signal on @mount manually.
24508  *
24509  * Since: 2.20
24510  */
24511
24512
24513 /**
24514  * g_mount_unmount:
24515  * @mount: a #GMount.
24516  * @flags: flags affecting the operation
24517  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24518  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24519  * @user_data: user data passed to @callback.
24520  *
24521  * Unmounts a mount. This is an asynchronous operation, and is
24522  * finished by calling g_mount_unmount_finish() with the @mount
24523  * and #GAsyncResult data returned in the @callback.
24524  *
24525  * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
24526  */
24527
24528
24529 /**
24530  * g_mount_unmount_finish:
24531  * @mount: a #GMount.
24532  * @result: a #GAsyncResult.
24533  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24534  *
24535  * Finishes unmounting a mount. If any errors occurred during the operation,
24536  * @error will be set to contain the errors and %FALSE will be returned.
24537  *
24538  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24539  * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
24540  */
24541
24542
24543 /**
24544  * g_mount_unmount_with_operation:
24545  * @mount: a #GMount.
24546  * @flags: flags affecting the operation
24547  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24548  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24549  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24550  * @user_data: user data passed to @callback.
24551  *
24552  * Unmounts a mount. This is an asynchronous operation, and is
24553  * finished by calling g_mount_unmount_with_operation_finish() with the @mount
24554  * and #GAsyncResult data returned in the @callback.
24555  *
24556  * Since: 2.22
24557  */
24558
24559
24560 /**
24561  * g_mount_unmount_with_operation_finish:
24562  * @mount: a #GMount.
24563  * @result: a #GAsyncResult.
24564  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24565  *
24566  * Finishes unmounting a mount. If any errors occurred during the operation,
24567  * @error will be set to contain the errors and %FALSE will be returned.
24568  *
24569  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24570  * Since: 2.22
24571  */
24572
24573
24574 /**
24575  * g_mount_unshadow:
24576  * @mount: A #GMount.
24577  *
24578  * Decrements the shadow count on @mount. Usually used by
24579  * #GVolumeMonitor implementations when destroying a shadow mount for
24580  * @mount, see g_mount_is_shadowed() for more information. The caller
24581  * will need to emit the #GMount::changed signal on @mount manually.
24582  *
24583  * Since: 2.20
24584  */
24585
24586
24587 /**
24588  * g_network_address_get_hostname:
24589  * @addr: a #GNetworkAddress
24590  *
24591  * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
24592  * depending on what @addr was created with.
24593  *
24594  * Returns: @addr's hostname
24595  * Since: 2.22
24596  */
24597
24598
24599 /**
24600  * g_network_address_get_port:
24601  * @addr: a #GNetworkAddress
24602  *
24603  * Gets @addr's port number
24604  *
24605  * Returns: @addr's port (which may be 0)
24606  * Since: 2.22
24607  */
24608
24609
24610 /**
24611  * g_network_address_get_scheme:
24612  * @addr: a #GNetworkAddress
24613  *
24614  * Gets @addr's scheme
24615  *
24616  * Returns: @addr's scheme (%NULL if not built from URI)
24617  * Since: 2.26
24618  */
24619
24620
24621 /**
24622  * g_network_address_new:
24623  * @hostname: the hostname
24624  * @port: the port
24625  *
24626  * Creates a new #GSocketConnectable for connecting to the given
24627  * @hostname and @port.
24628  *
24629  * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24630  * Since: 2.22
24631  */
24632
24633
24634 /**
24635  * g_network_address_parse:
24636  * @host_and_port: the hostname and optionally a port
24637  * @default_port: the default port if not in @host_and_port
24638  * @error: a pointer to a #GError, or %NULL
24639  *
24640  * Creates a new #GSocketConnectable for connecting to the given
24641  * @hostname and @port. May fail and return %NULL in case
24642  * parsing @host_and_port fails.
24643  *
24644  * @host_and_port may be in any of a number of recognised formats; an IPv6
24645  * address, an IPv4 address, or a domain name (in which case a DNS
24646  * lookup is performed). Quoting with [] is supported for all address
24647  * types. A port override may be specified in the usual way with a
24648  * colon.
24649  *
24650  * If no port is specified in @host_and_port then @default_port will be
24651  * used as the port number to connect to.
24652  *
24653  * In general, @host_and_port is expected to be provided by the user
24654  * (allowing them to give the hostname, and a port overide if necessary)
24655  * and @default_port is expected to be provided by the application.
24656  *
24657  * (The port component of @host_and_port can also be specified as a
24658  * service name rather than as a numeric port, but this functionality
24659  * is deprecated, because it depends on the contents of /etc/services,
24660  * which is generally quite sparse on platforms other than Linux.)
24661  *
24662  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24663  * Since: 2.22
24664  */
24665
24666
24667 /**
24668  * g_network_address_parse_uri:
24669  * @uri: the hostname and optionally a port
24670  * @default_port: The default port if none is found in the URI
24671  * @error: a pointer to a #GError, or %NULL
24672  *
24673  * Creates a new #GSocketConnectable for connecting to the given
24674  * @uri. May fail and return %NULL in case parsing @uri fails.
24675  *
24676  * Using this rather than g_network_address_new() or
24677  * g_network_address_parse() allows #GSocketClient to determine
24678  * when to use application-specific proxy protocols.
24679  *
24680  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24681  * Since: 2.26
24682  */
24683
24684
24685 /**
24686  * g_network_monitor_base_add_network:
24687  * @monitor: the #GNetworkMonitorBase
24688  * @network: a #GInetAddressMask
24689  *
24690  * Adds @network to @monitor's list of available networks.
24691  *
24692  * Since: 2.32
24693  */
24694
24695
24696 /**
24697  * g_network_monitor_base_remove_network:
24698  * @monitor: the #GNetworkMonitorBase
24699  * @network: a #GInetAddressMask
24700  *
24701  * Removes @network from @monitor's list of available networks.
24702  *
24703  * Since: 2.32
24704  */
24705
24706
24707 /**
24708  * g_network_monitor_base_set_networks:
24709  * @monitor: the #GNetworkMonitorBase
24710  * @networks: (array length=length): an array of #GInetAddressMask
24711  * @length: length of @networks
24712  *
24713  * Drops @monitor's current list of available networks and replaces
24714  * it with @networks.
24715  */
24716
24717
24718 /**
24719  * g_network_monitor_can_reach:
24720  * @monitor: a #GNetworkMonitor
24721  * @connectable: a #GSocketConnectable
24722  * @cancellable: (allow-none): a #GCancellable, or %NULL
24723  * @error: return location for a #GError, or %NULL
24724  *
24725  * Attempts to determine whether or not the host pointed to by
24726  * @connectable can be reached, without actually trying to connect to
24727  * it.
24728  *
24729  * This may return %TRUE even when #GNetworkMonitor:network-available
24730  * is %FALSE, if, for example, @monitor can determine that
24731  * @connectable refers to a host on a local network.
24732  *
24733  * If @monitor believes that an attempt to connect to @connectable
24734  * will succeed, it will return %TRUE. Otherwise, it will return
24735  * %FALSE and set @error to an appropriate error (such as
24736  * %G_IO_ERROR_HOST_UNREACHABLE).
24737  *
24738  * Note that although this does not attempt to connect to
24739  * @connectable, it may still block for a brief period of time (eg,
24740  * trying to do multicast DNS on the local network), so if you do not
24741  * want to block, you should use g_network_monitor_can_reach_async().
24742  *
24743  * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24744  * Since: 2.32
24745  */
24746
24747
24748 /**
24749  * g_network_monitor_can_reach_async:
24750  * @monitor: a #GNetworkMonitor
24751  * @connectable: a #GSocketConnectable
24752  * @cancellable: (allow-none): a #GCancellable, or %NULL
24753  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24754  * @user_data: (closure): the data to pass to callback function
24755  *
24756  * Asynchronously attempts to determine whether or not the host
24757  * pointed to by @connectable can be reached, without actually
24758  * trying to connect to it.
24759  *
24760  * For more details, see g_network_monitor_can_reach().
24761  *
24762  * When the operation is finished, @callback will be called.
24763  * You can then call g_network_monitor_can_reach_finish()
24764  * to get the result of the operation.
24765  */
24766
24767
24768 /**
24769  * g_network_monitor_can_reach_finish:
24770  * @monitor: a #GNetworkMonitor
24771  * @result: a #GAsyncResult
24772  * @error: return location for errors, or %NULL
24773  *
24774  * Finishes an async network connectivity test.
24775  * See g_network_monitor_can_reach_async().
24776  *
24777  * Returns: %TRUE if network is reachable, %FALSE if not.
24778  */
24779
24780
24781 /**
24782  * g_network_monitor_get_default:
24783  *
24784  * Gets the default #GNetworkMonitor for the system.
24785  *
24786  * Returns: (transfer none): a #GNetworkMonitor
24787  * Since: 2.32
24788  */
24789
24790
24791 /**
24792  * g_network_monitor_get_network_available:
24793  * @monitor: the #GNetworkMonitor
24794  *
24795  * Checks if the network is available. "Available" here means that the
24796  * system has a default route available for at least one of IPv4 or
24797  * IPv6. It does not necessarily imply that the public Internet is
24798  * reachable. See #GNetworkMonitor:network-available for more details.
24799  *
24800  * Returns: whether the network is available
24801  * Since: 2.32
24802  */
24803
24804
24805 /**
24806  * g_network_service_get_domain:
24807  * @srv: a #GNetworkService
24808  *
24809  * Gets the domain that @srv serves. This might be either UTF-8 or
24810  * ASCII-encoded, depending on what @srv was created with.
24811  *
24812  * Returns: @srv's domain name
24813  * Since: 2.22
24814  */
24815
24816
24817 /**
24818  * g_network_service_get_protocol:
24819  * @srv: a #GNetworkService
24820  *
24821  * Gets @srv's protocol name (eg, "tcp").
24822  *
24823  * Returns: @srv's protocol name
24824  * Since: 2.22
24825  */
24826
24827
24828 /**
24829  * g_network_service_get_scheme:
24830  * @srv: a #GNetworkService
24831  *
24832  * Get's the URI scheme used to resolve proxies. By default, the service name
24833  * is used as scheme.
24834  *
24835  * Returns: @srv's scheme name
24836  * Since: 2.26
24837  */
24838
24839
24840 /**
24841  * g_network_service_get_service:
24842  * @srv: a #GNetworkService
24843  *
24844  * Gets @srv's service name (eg, "ldap").
24845  *
24846  * Returns: @srv's service name
24847  * Since: 2.22
24848  */
24849
24850
24851 /**
24852  * g_network_service_new:
24853  * @service: the service type to look up (eg, "ldap")
24854  * @protocol: the networking protocol to use for @service (eg, "tcp")
24855  * @domain: the DNS domain to look up the service in
24856  *
24857  * Creates a new #GNetworkService representing the given @service,
24858  * @protocol, and @domain. This will initially be unresolved; use the
24859  * #GSocketConnectable interface to resolve it.
24860  *
24861  * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24862  * Since: 2.22
24863  */
24864
24865
24866 /**
24867  * g_network_service_set_scheme:
24868  * @srv: a #GNetworkService
24869  * @scheme: a URI scheme
24870  *
24871  * Set's the URI scheme used to resolve proxies. By default, the service name
24872  * is used as scheme.
24873  *
24874  * Since: 2.26
24875  */
24876
24877
24878 /**
24879  * g_null_settings_backend_new:
24880  *
24881  * Creates a readonly #GSettingsBackend.
24882  *
24883  * This backend does not allow changes to settings, so all settings
24884  * will always have their default values.
24885  *
24886  * Returns: (transfer full): a newly created #GSettingsBackend
24887  * Since: 2.28
24888  */
24889
24890
24891 /**
24892  * g_output_stream_clear_pending:
24893  * @stream: output stream
24894  *
24895  * Clears the pending flag on @stream.
24896  */
24897
24898
24899 /**
24900  * g_output_stream_close:
24901  * @stream: A #GOutputStream.
24902  * @cancellable: (allow-none): optional cancellable object
24903  * @error: location to store the error occurring, or %NULL to ignore
24904  *
24905  * Closes the stream, releasing resources related to it.
24906  *
24907  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24908  * Closing a stream multiple times will not return an error.
24909  *
24910  * Closing a stream will automatically flush any outstanding buffers in the
24911  * stream.
24912  *
24913  * Streams will be automatically closed when the last reference
24914  * is dropped, but you might want to call this function to make sure
24915  * resources are released as early as possible.
24916  *
24917  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24918  * open after the stream is closed. See the documentation for the individual
24919  * stream for details.
24920  *
24921  * On failure the first error that happened will be reported, but the close
24922  * operation will finish as much as possible. A stream that failed to
24923  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24924  * is important to check and report the error to the user, otherwise
24925  * there might be a loss of data as all data might not be written.
24926  *
24927  * If @cancellable is not %NULL, then the operation can be cancelled by
24928  * triggering the cancellable object from another thread. If the operation
24929  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24930  * Cancelling a close will still leave the stream closed, but there some streams
24931  * can use a faster close that doesn't block to e.g. check errors. On
24932  * cancellation (as with any error) there is no guarantee that all written
24933  * data will reach the target.
24934  *
24935  * Returns: %TRUE on success, %FALSE on failure
24936  */
24937
24938
24939 /**
24940  * g_output_stream_close_async:
24941  * @stream: A #GOutputStream.
24942  * @io_priority: the io priority of the request.
24943  * @cancellable: (allow-none): optional cancellable object
24944  * @callback: (scope async): callback to call when the request is satisfied
24945  * @user_data: (closure): the data to pass to callback function
24946  *
24947  * Requests an asynchronous close of the stream, releasing resources
24948  * related to it. When the operation is finished @callback will be
24949  * called. You can then call g_output_stream_close_finish() to get
24950  * the result of the operation.
24951  *
24952  * For behaviour details see g_output_stream_close().
24953  *
24954  * The asyncronous methods have a default fallback that uses threads
24955  * to implement asynchronicity, so they are optional for inheriting
24956  * classes. However, if you override one you must override all.
24957  */
24958
24959
24960 /**
24961  * g_output_stream_close_finish:
24962  * @stream: a #GOutputStream.
24963  * @result: a #GAsyncResult.
24964  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24965  *
24966  * Closes an output stream.
24967  *
24968  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24969  */
24970
24971
24972 /**
24973  * g_output_stream_flush:
24974  * @stream: a #GOutputStream.
24975  * @cancellable: (allow-none): optional cancellable object
24976  * @error: location to store the error occurring, or %NULL to ignore
24977  *
24978  * Forces a write of all user-space buffered data for the given
24979  * @stream. Will block during the operation. Closing the stream will
24980  * implicitly cause a flush.
24981  *
24982  * This function is optional for inherited classes.
24983  *
24984  * If @cancellable is not %NULL, then the operation can be cancelled by
24985  * triggering the cancellable object from another thread. If the operation
24986  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24987  *
24988  * Returns: %TRUE on success, %FALSE on error
24989  */
24990
24991
24992 /**
24993  * g_output_stream_flush_async:
24994  * @stream: a #GOutputStream.
24995  * @io_priority: the io priority of the request.
24996  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24997  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24998  * @user_data: (closure): the data to pass to callback function
24999  *
25000  * Forces an asynchronous write of all user-space buffered data for
25001  * the given @stream.
25002  * For behaviour details see g_output_stream_flush().
25003  *
25004  * When the operation is finished @callback will be
25005  * called. You can then call g_output_stream_flush_finish() to get the
25006  * result of the operation.
25007  */
25008
25009
25010 /**
25011  * g_output_stream_flush_finish:
25012  * @stream: a #GOutputStream.
25013  * @result: a GAsyncResult.
25014  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25015  *
25016  * Finishes flushing an output stream.
25017  *
25018  * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
25019  */
25020
25021
25022 /**
25023  * g_output_stream_has_pending:
25024  * @stream: a #GOutputStream.
25025  *
25026  * Checks if an ouput stream has pending actions.
25027  *
25028  * Returns: %TRUE if @stream has pending actions.
25029  */
25030
25031
25032 /**
25033  * g_output_stream_is_closed:
25034  * @stream: a #GOutputStream.
25035  *
25036  * Checks if an output stream has already been closed.
25037  *
25038  * Returns: %TRUE if @stream is closed. %FALSE otherwise.
25039  */
25040
25041
25042 /**
25043  * g_output_stream_is_closing:
25044  * @stream: a #GOutputStream.
25045  *
25046  * Checks if an output stream is being closed. This can be
25047  * used inside e.g. a flush implementation to see if the
25048  * flush (or other i/o operation) is called from within
25049  * the closing operation.
25050  *
25051  * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
25052  * Since: 2.24
25053  */
25054
25055
25056 /**
25057  * g_output_stream_set_pending:
25058  * @stream: a #GOutputStream.
25059  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25060  *
25061  * Sets @stream to have actions pending. If the pending flag is
25062  * already set or @stream is closed, it will return %FALSE and set
25063  * @error.
25064  *
25065  * Returns: %TRUE if pending was previously unset and is now set.
25066  */
25067
25068
25069 /**
25070  * g_output_stream_splice:
25071  * @stream: a #GOutputStream.
25072  * @source: a #GInputStream.
25073  * @flags: a set of #GOutputStreamSpliceFlags.
25074  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25075  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25076  *
25077  * Splices an input stream into an output stream.
25078  *
25079  * 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.
25080  */
25081
25082
25083 /**
25084  * g_output_stream_splice_async:
25085  * @stream: a #GOutputStream.
25086  * @source: a #GInputStream.
25087  * @flags: a set of #GOutputStreamSpliceFlags.
25088  * @io_priority: the io priority of the request.
25089  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25090  * @callback: (scope async): a #GAsyncReadyCallback.
25091  * @user_data: (closure): user data passed to @callback.
25092  *
25093  * Splices a stream asynchronously.
25094  * When the operation is finished @callback will be called.
25095  * You can then call g_output_stream_splice_finish() to get the
25096  * result of the operation.
25097  *
25098  * For the synchronous, blocking version of this function, see
25099  * g_output_stream_splice().
25100  */
25101
25102
25103 /**
25104  * g_output_stream_splice_finish:
25105  * @stream: a #GOutputStream.
25106  * @result: a #GAsyncResult.
25107  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25108  *
25109  * Finishes an asynchronous stream splice operation.
25110  *
25111  * 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.
25112  */
25113
25114
25115 /**
25116  * g_output_stream_write:
25117  * @stream: a #GOutputStream.
25118  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25119  * @count: the number of bytes to write
25120  * @cancellable: (allow-none): optional cancellable object
25121  * @error: location to store the error occurring, or %NULL to ignore
25122  *
25123  * Tries to write @count bytes from @buffer into the stream. Will block
25124  * during the operation.
25125  *
25126  * If count is 0, returns 0 and does nothing. A value of @count
25127  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
25128  *
25129  * On success, the number of bytes written to the stream is returned.
25130  * It is not an error if this is not the same as the requested size, as it
25131  * can happen e.g. on a partial I/O error, or if there is not enough
25132  * storage in the stream. All writes block until at least one byte
25133  * is written or an error occurs; 0 is never returned (unless
25134  * @count is 0).
25135  *
25136  * If @cancellable is not %NULL, then the operation can be cancelled by
25137  * triggering the cancellable object from another thread. If the operation
25138  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25139  * operation was partially finished when the operation was cancelled the
25140  * partial result will be returned, without an error.
25141  *
25142  * On error -1 is returned and @error is set accordingly.
25143  *
25144  * Virtual: write_fn
25145  * Returns: Number of bytes written, or -1 on error
25146  */
25147
25148
25149 /**
25150  * g_output_stream_write_all:
25151  * @stream: a #GOutputStream.
25152  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25153  * @count: the number of bytes to write
25154  * @bytes_written: (out): location to store the number of bytes that was written to the stream
25155  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25156  * @error: location to store the error occurring, or %NULL to ignore
25157  *
25158  * Tries to write @count bytes from @buffer into the stream. Will block
25159  * during the operation.
25160  *
25161  * This function is similar to g_output_stream_write(), except it tries to
25162  * write as many bytes as requested, only stopping on an error.
25163  *
25164  * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
25165  * is set to @count.
25166  *
25167  * If there is an error during the operation %FALSE is returned and @error
25168  * is set to indicate the error status, @bytes_written is updated to contain
25169  * the number of bytes written into the stream before the error occurred.
25170  *
25171  * Returns: %TRUE on success, %FALSE if there was an error
25172  */
25173
25174
25175 /**
25176  * g_output_stream_write_async:
25177  * @stream: A #GOutputStream.
25178  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25179  * @count: the number of bytes to write
25180  * @io_priority: the io priority of the request.
25181  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25182  * @callback: (scope async): callback to call when the request is satisfied
25183  * @user_data: (closure): the data to pass to callback function
25184  *
25185  * Request an asynchronous write of @count bytes from @buffer into
25186  * the stream. When the operation is finished @callback will be called.
25187  * You can then call g_output_stream_write_finish() to get the result of the
25188  * operation.
25189  *
25190  * During an async request no other sync and async calls are allowed,
25191  * and will result in %G_IO_ERROR_PENDING errors.
25192  *
25193  * A value of @count larger than %G_MAXSSIZE will cause a
25194  * %G_IO_ERROR_INVALID_ARGUMENT error.
25195  *
25196  * On success, the number of bytes written will be passed to the
25197  * @callback. It is not an error if this is not the same as the
25198  * requested size, as it can happen e.g. on a partial I/O error,
25199  * but generally we try to write as many bytes as requested.
25200  *
25201  * You are guaranteed that this method will never fail with
25202  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
25203  * method will just wait until this changes.
25204  *
25205  * Any outstanding I/O request with higher priority (lower numerical
25206  * value) will be executed before an outstanding request with lower
25207  * priority. Default priority is %G_PRIORITY_DEFAULT.
25208  *
25209  * The asyncronous methods have a default fallback that uses threads
25210  * to implement asynchronicity, so they are optional for inheriting
25211  * classes. However, if you override one you must override all.
25212  *
25213  * For the synchronous, blocking version of this function, see
25214  * g_output_stream_write().
25215  */
25216
25217
25218 /**
25219  * g_output_stream_write_bytes:
25220  * @stream: a #GOutputStream.
25221  * @bytes: the #GBytes to write
25222  * @cancellable: (allow-none): optional cancellable object
25223  * @error: location to store the error occurring, or %NULL to ignore
25224  *
25225  * Tries to write the data from @bytes into the stream. Will block
25226  * during the operation.
25227  *
25228  * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
25229  * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
25230  *
25231  * On success, the number of bytes written to the stream is returned.
25232  * It is not an error if this is not the same as the requested size, as it
25233  * can happen e.g. on a partial I/O error, or if there is not enough
25234  * storage in the stream. All writes block until at least one byte
25235  * is written or an error occurs; 0 is never returned (unless
25236  * the size of @bytes is 0).
25237  *
25238  * If @cancellable is not %NULL, then the operation can be cancelled by
25239  * triggering the cancellable object from another thread. If the operation
25240  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25241  * operation was partially finished when the operation was cancelled the
25242  * partial result will be returned, without an error.
25243  *
25244  * On error -1 is returned and @error is set accordingly.
25245  *
25246  * Returns: Number of bytes written, or -1 on error
25247  */
25248
25249
25250 /**
25251  * g_output_stream_write_bytes_async:
25252  * @stream: A #GOutputStream.
25253  * @bytes: The bytes to write
25254  * @io_priority: the io priority of the request.
25255  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25256  * @callback: (scope async): callback to call when the request is satisfied
25257  * @user_data: (closure): the data to pass to callback function
25258  *
25259  * Request an asynchronous write of the data in @bytes to the stream.
25260  * When the operation is finished @callback will be called. You can
25261  * then call g_output_stream_write_bytes_finish() to get the result of
25262  * the operation.
25263  *
25264  * During an async request no other sync and async calls are allowed,
25265  * and will result in %G_IO_ERROR_PENDING errors.
25266  *
25267  * A #GBytes larger than %G_MAXSSIZE will cause a
25268  * %G_IO_ERROR_INVALID_ARGUMENT error.
25269  *
25270  * On success, the number of bytes written will be passed to the
25271  * @callback. It is not an error if this is not the same as the
25272  * requested size, as it can happen e.g. on a partial I/O error,
25273  * but generally we try to write as many bytes as requested.
25274  *
25275  * You are guaranteed that this method will never fail with
25276  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
25277  * method will just wait until this changes.
25278  *
25279  * Any outstanding I/O request with higher priority (lower numerical
25280  * value) will be executed before an outstanding request with lower
25281  * priority. Default priority is %G_PRIORITY_DEFAULT.
25282  *
25283  * For the synchronous, blocking version of this function, see
25284  * g_output_stream_write_bytes().
25285  */
25286
25287
25288 /**
25289  * g_output_stream_write_bytes_finish:
25290  * @stream: a #GOutputStream.
25291  * @result: a #GAsyncResult.
25292  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25293  *
25294  * Finishes a stream write-from-#GBytes operation.
25295  *
25296  * Returns: a #gssize containing the number of bytes written to the stream.
25297  */
25298
25299
25300 /**
25301  * g_output_stream_write_finish:
25302  * @stream: a #GOutputStream.
25303  * @result: a #GAsyncResult.
25304  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25305  *
25306  * Finishes a stream write operation.
25307  *
25308  * Returns: a #gssize containing the number of bytes written to the stream.
25309  */
25310
25311
25312 /**
25313  * g_permission_acquire:
25314  * @permission: a #GPermission instance
25315  * @cancellable: (allow-none): a #GCancellable, or %NULL
25316  * @error: a pointer to a %NULL #GError, or %NULL
25317  *
25318  * Attempts to acquire the permission represented by @permission.
25319  *
25320  * The precise method by which this happens depends on the permission
25321  * and the underlying authentication mechanism.  A simple example is
25322  * that a dialog may appear asking the user to enter their password.
25323  *
25324  * You should check with g_permission_get_can_acquire() before calling
25325  * this function.
25326  *
25327  * If the permission is acquired then %TRUE is returned.  Otherwise,
25328  * %FALSE is returned and @error is set appropriately.
25329  *
25330  * This call is blocking, likely for a very long time (in the case that
25331  * user interaction is required).  See g_permission_acquire_async() for
25332  * the non-blocking version.
25333  *
25334  * Returns: %TRUE if the permission was successfully acquired
25335  * Since: 2.26
25336  */
25337
25338
25339 /**
25340  * g_permission_acquire_async:
25341  * @permission: a #GPermission instance
25342  * @cancellable: (allow-none): a #GCancellable, or %NULL
25343  * @callback: the #GAsyncReadyCallback to call when done
25344  * @user_data: the user data to pass to @callback
25345  *
25346  * Attempts to acquire the permission represented by @permission.
25347  *
25348  * This is the first half of the asynchronous version of
25349  * g_permission_acquire().
25350  *
25351  * Since: 2.26
25352  */
25353
25354
25355 /**
25356  * g_permission_acquire_finish:
25357  * @permission: a #GPermission instance
25358  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25359  * @error: a pointer to a %NULL #GError, or %NULL
25360  *
25361  * Collects the result of attempting to acquire the permission
25362  * represented by @permission.
25363  *
25364  * This is the second half of the asynchronous version of
25365  * g_permission_acquire().
25366  *
25367  * Returns: %TRUE if the permission was successfully acquired
25368  * Since: 2.26
25369  */
25370
25371
25372 /**
25373  * g_permission_get_allowed:
25374  * @permission: a #GPermission instance
25375  *
25376  * Gets the value of the 'allowed' property.  This property is %TRUE if
25377  * the caller currently has permission to perform the action that
25378  * @permission represents the permission to perform.
25379  *
25380  * Returns: the value of the 'allowed' property
25381  * Since: 2.26
25382  */
25383
25384
25385 /**
25386  * g_permission_get_can_acquire:
25387  * @permission: a #GPermission instance
25388  *
25389  * Gets the value of the 'can-acquire' property.  This property is %TRUE
25390  * if it is generally possible to acquire the permission by calling
25391  * g_permission_acquire().
25392  *
25393  * Returns: the value of the 'can-acquire' property
25394  * Since: 2.26
25395  */
25396
25397
25398 /**
25399  * g_permission_get_can_release:
25400  * @permission: a #GPermission instance
25401  *
25402  * Gets the value of the 'can-release' property.  This property is %TRUE
25403  * if it is generally possible to release the permission by calling
25404  * g_permission_release().
25405  *
25406  * Returns: the value of the 'can-release' property
25407  * Since: 2.26
25408  */
25409
25410
25411 /**
25412  * g_permission_impl_update:
25413  * @permission: a #GPermission instance
25414  * @allowed: the new value for the 'allowed' property
25415  * @can_acquire: the new value for the 'can-acquire' property
25416  * @can_release: the new value for the 'can-release' property
25417  *
25418  * This function is called by the #GPermission implementation to update
25419  * the properties of the permission.  You should never call this
25420  * function except from a #GPermission implementation.
25421  *
25422  * GObject notify signals are generated, as appropriate.
25423  *
25424  * Since: 2.26
25425  */
25426
25427
25428 /**
25429  * g_permission_release:
25430  * @permission: a #GPermission instance
25431  * @cancellable: (allow-none): a #GCancellable, or %NULL
25432  * @error: a pointer to a %NULL #GError, or %NULL
25433  *
25434  * Attempts to release the permission represented by @permission.
25435  *
25436  * The precise method by which this happens depends on the permission
25437  * and the underlying authentication mechanism.  In most cases the
25438  * permission will be dropped immediately without further action.
25439  *
25440  * You should check with g_permission_get_can_release() before calling
25441  * this function.
25442  *
25443  * If the permission is released then %TRUE is returned.  Otherwise,
25444  * %FALSE is returned and @error is set appropriately.
25445  *
25446  * This call is blocking, likely for a very long time (in the case that
25447  * user interaction is required).  See g_permission_release_async() for
25448  * the non-blocking version.
25449  *
25450  * Returns: %TRUE if the permission was successfully released
25451  * Since: 2.26
25452  */
25453
25454
25455 /**
25456  * g_permission_release_async:
25457  * @permission: a #GPermission instance
25458  * @cancellable: (allow-none): a #GCancellable, or %NULL
25459  * @callback: the #GAsyncReadyCallback to call when done
25460  * @user_data: the user data to pass to @callback
25461  *
25462  * Attempts to release the permission represented by @permission.
25463  *
25464  * This is the first half of the asynchronous version of
25465  * g_permission_release().
25466  *
25467  * Since: 2.26
25468  */
25469
25470
25471 /**
25472  * g_permission_release_finish:
25473  * @permission: a #GPermission instance
25474  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25475  * @error: a pointer to a %NULL #GError, or %NULL
25476  *
25477  * Collects the result of attempting to release the permission
25478  * represented by @permission.
25479  *
25480  * This is the second half of the asynchronous version of
25481  * g_permission_release().
25482  *
25483  * Returns: %TRUE if the permission was successfully released
25484  * Since: 2.26
25485  */
25486
25487
25488 /**
25489  * g_poll_file_monitor_new:
25490  * @file: a #GFile.
25491  *
25492  * Polls @file for changes.
25493  *
25494  * Returns: a new #GFileMonitor for the given #GFile.
25495  */
25496
25497
25498 /**
25499  * g_pollable_input_stream_can_poll:
25500  * @stream: a #GPollableInputStream.
25501  *
25502  * Checks if @stream is actually pollable. Some classes may implement
25503  * #GPollableInputStream but have only certain instances of that class
25504  * be pollable. If this method returns %FALSE, then the behavior of
25505  * other #GPollableInputStream methods is undefined.
25506  *
25507  * For any given stream, the value returned by this method is constant;
25508  * a stream cannot switch from pollable to non-pollable or vice versa.
25509  *
25510  * Returns: %TRUE if @stream is pollable, %FALSE if not.
25511  * Since: 2.28
25512  */
25513
25514
25515 /**
25516  * g_pollable_input_stream_create_source:
25517  * @stream: a #GPollableInputStream.
25518  * @cancellable: (allow-none): a #GCancellable, or %NULL
25519  *
25520  * Creates a #GSource that triggers when @stream can be read, or
25521  * @cancellable is triggered or an error occurs. The callback on the
25522  * source is of the #GPollableSourceFunc type.
25523  *
25524  * As with g_pollable_input_stream_is_readable(), it is possible that
25525  * the stream may not actually be readable even after the source
25526  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
25527  * rather than g_input_stream_read() from the callback.
25528  *
25529  * Returns: (transfer full): a new #GSource
25530  * Since: 2.28
25531  */
25532
25533
25534 /**
25535  * g_pollable_input_stream_is_readable:
25536  * @stream: a #GPollableInputStream.
25537  *
25538  * Checks if @stream can be read.
25539  *
25540  * Note that some stream types may not be able to implement this 100%
25541  * reliably, and it is possible that a call to g_input_stream_read()
25542  * after this returns %TRUE would still block. To guarantee
25543  * non-blocking behavior, you should always use
25544  * g_pollable_input_stream_read_nonblocking(), which will return a
25545  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25546  *
25547  * 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.
25548  * Since: 2.28
25549  */
25550
25551
25552 /**
25553  * g_pollable_input_stream_read_nonblocking:
25554  * @stream: a #GPollableInputStream
25555  * @buffer: a buffer to read data into (which should be at least @count bytes long).
25556  * @count: the number of bytes you want to read
25557  * @cancellable: (allow-none): a #GCancellable, or %NULL
25558  * @error: #GError for error reporting, or %NULL to ignore.
25559  *
25560  * Attempts to read up to @count bytes from @stream into @buffer, as
25561  * with g_input_stream_read(). If @stream is not currently readable,
25562  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25563  * use g_pollable_input_stream_create_source() to create a #GSource
25564  * that will be triggered when @stream is readable.
25565  *
25566  * Note that since this method never blocks, you cannot actually
25567  * use @cancellable to cancel it. However, it will return an error
25568  * if @cancellable has already been cancelled when you call, which
25569  * may happen if you call this method after a source triggers due
25570  * to having been cancelled.
25571  *
25572  * Virtual: read_nonblocking
25573  * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25574  */
25575
25576
25577 /**
25578  * g_pollable_output_stream_can_poll:
25579  * @stream: a #GPollableOutputStream.
25580  *
25581  * Checks if @stream is actually pollable. Some classes may implement
25582  * #GPollableOutputStream but have only certain instances of that
25583  * class be pollable. If this method returns %FALSE, then the behavior
25584  * of other #GPollableOutputStream methods is undefined.
25585  *
25586  * For any given stream, the value returned by this method is constant;
25587  * a stream cannot switch from pollable to non-pollable or vice versa.
25588  *
25589  * Returns: %TRUE if @stream is pollable, %FALSE if not.
25590  * Since: 2.28
25591  */
25592
25593
25594 /**
25595  * g_pollable_output_stream_create_source:
25596  * @stream: a #GPollableOutputStream.
25597  * @cancellable: (allow-none): a #GCancellable, or %NULL
25598  *
25599  * Creates a #GSource that triggers when @stream can be written, or
25600  * @cancellable is triggered or an error occurs. The callback on the
25601  * source is of the #GPollableSourceFunc type.
25602  *
25603  * As with g_pollable_output_stream_is_writable(), it is possible that
25604  * the stream may not actually be writable even after the source
25605  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25606  * rather than g_output_stream_write() from the callback.
25607  *
25608  * Returns: (transfer full): a new #GSource
25609  * Since: 2.28
25610  */
25611
25612
25613 /**
25614  * g_pollable_output_stream_is_writable:
25615  * @stream: a #GPollableOutputStream.
25616  *
25617  * Checks if @stream can be written.
25618  *
25619  * Note that some stream types may not be able to implement this 100%
25620  * reliably, and it is possible that a call to g_output_stream_write()
25621  * after this returns %TRUE would still block. To guarantee
25622  * non-blocking behavior, you should always use
25623  * g_pollable_output_stream_write_nonblocking(), which will return a
25624  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25625  *
25626  * 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.
25627  * Since: 2.28
25628  */
25629
25630
25631 /**
25632  * g_pollable_output_stream_write_nonblocking:
25633  * @stream: a #GPollableOutputStream
25634  * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25635  * @count: the number of bytes you want to write
25636  * @cancellable: (allow-none): a #GCancellable, or %NULL
25637  * @error: #GError for error reporting, or %NULL to ignore.
25638  *
25639  * Attempts to write up to @count bytes from @buffer to @stream, as
25640  * with g_output_stream_write(). If @stream is not currently writable,
25641  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25642  * use g_pollable_output_stream_create_source() to create a #GSource
25643  * that will be triggered when @stream is writable.
25644  *
25645  * Note that since this method never blocks, you cannot actually
25646  * use @cancellable to cancel it. However, it will return an error
25647  * if @cancellable has already been cancelled when you call, which
25648  * may happen if you call this method after a source triggers due
25649  * to having been cancelled.
25650  *
25651  * Virtual: write_nonblocking
25652  * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25653  */
25654
25655
25656 /**
25657  * g_pollable_source_new:
25658  * @pollable_stream: the stream associated with the new source
25659  *
25660  * Utility method for #GPollableInputStream and #GPollableOutputStream
25661  * implementations. Creates a new #GSource that expects a callback of
25662  * type #GPollableSourceFunc. The new source does not actually do
25663  * anything on its own; use g_source_add_child_source() to add other
25664  * sources to it to cause it to trigger.
25665  *
25666  * Returns: (transfer full): the new #GSource.
25667  * Since: 2.28
25668  */
25669
25670
25671 /**
25672  * g_pollable_source_new_full:
25673  * @pollable_stream: (type GObject): the stream associated with the new source
25674  * @child_source: (allow-none): optional child source to attach
25675  * @cancellable: (allow-none): optional #GCancellable to attach
25676  *
25677  * Utility method for #GPollableInputStream and #GPollableOutputStream
25678  * implementations. Creates a new #GSource, as with
25679  * g_pollable_source_new(), but also attaching @child_source (with a
25680  * dummy callback), and @cancellable, if they are non-%NULL.
25681  *
25682  * Returns: (transfer full): the new #GSource.
25683  * Since: 2.34
25684  */
25685
25686
25687 /**
25688  * g_pollable_stream_read:
25689  * @stream: a #GInputStream
25690  * @buffer: a buffer to read data into
25691  * @count: the number of bytes to read
25692  * @blocking: whether to do blocking I/O
25693  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25694  * @error: location to store the error occurring, or %NULL to ignore
25695  *
25696  * Tries to read from @stream, as with g_input_stream_read() (if
25697  * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25698  * (if @blocking is %FALSE). This can be used to more easily share
25699  * code between blocking and non-blocking implementations of a method.
25700  *
25701  * If @blocking is %FALSE, then @stream must be a
25702  * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25703  * returns %TRUE, or else the behavior is undefined. If @blocking is
25704  * %TRUE, then @stream does not need to be a #GPollableInputStream.
25705  *
25706  * Returns: the number of bytes read, or -1 on error.
25707  * Since: 2.34
25708  */
25709
25710
25711 /**
25712  * g_pollable_stream_write:
25713  * @stream: a #GOutputStream.
25714  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25715  * @count: the number of bytes to write
25716  * @blocking: whether to do blocking I/O
25717  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25718  * @error: location to store the error occurring, or %NULL to ignore
25719  *
25720  * Tries to write to @stream, as with g_output_stream_write() (if
25721  * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25722  * (if @blocking is %FALSE). This can be used to more easily share
25723  * code between blocking and non-blocking implementations of a method.
25724  *
25725  * If @blocking is %FALSE, then @stream must be a
25726  * #GPollableOutputStream for which
25727  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25728  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25729  * need to be a #GPollableOutputStream.
25730  *
25731  * Returns: the number of bytes written, or -1 on error.
25732  * Since: 2.34
25733  */
25734
25735
25736 /**
25737  * g_pollable_stream_write_all:
25738  * @stream: a #GOutputStream.
25739  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25740  * @count: the number of bytes to write
25741  * @blocking: whether to do blocking I/O
25742  * @bytes_written: (out): location to store the number of bytes that was written to the stream
25743  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25744  * @error: location to store the error occurring, or %NULL to ignore
25745  *
25746  * Tries to write @count bytes to @stream, as with
25747  * g_output_stream_write_all(), but using g_pollable_stream_write()
25748  * rather than g_output_stream_write().
25749  *
25750  * On a successful write of @count bytes, %TRUE is returned, and
25751  * @bytes_written is set to @count.
25752  *
25753  * If there is an error during the operation (including
25754  * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25755  * returned and @error is set to indicate the error status,
25756  * @bytes_written is updated to contain the number of bytes written
25757  * into the stream before the error occurred.
25758  *
25759  * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25760  * @stream must be a #GPollableOutputStream for which
25761  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25762  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25763  * need to be a #GPollableOutputStream.
25764  *
25765  * Returns: %TRUE on success, %FALSE if there was an error
25766  * Since: 2.34
25767  */
25768
25769
25770 /**
25771  * g_proxy_address_get_destination_hostname:
25772  * @proxy: a #GProxyAddress
25773  *
25774  * Gets @proxy's destination hostname; that is, the name of the host
25775  * that will be connected to via the proxy, not the name of the proxy
25776  * itself.
25777  *
25778  * Returns: the @proxy's destination hostname
25779  * Since: 2.26
25780  */
25781
25782
25783 /**
25784  * g_proxy_address_get_destination_port:
25785  * @proxy: a #GProxyAddress
25786  *
25787  * Gets @proxy's destination port; that is, the port on the
25788  * destination host that will be connected to via the proxy, not the
25789  * port number of the proxy itself.
25790  *
25791  * Returns: the @proxy's destination port
25792  * Since: 2.26
25793  */
25794
25795
25796 /**
25797  * g_proxy_address_get_destination_protocol:
25798  * @proxy: a #GProxyAddress
25799  *
25800  * Gets the protocol that is being spoken to the destination
25801  * server; eg, "http" or "ftp".
25802  *
25803  * Returns: the @proxy's destination protocol
25804  * Since: 2.34
25805  */
25806
25807
25808 /**
25809  * g_proxy_address_get_password:
25810  * @proxy: a #GProxyAddress
25811  *
25812  * Gets @proxy's password.
25813  *
25814  * Returns: the @proxy's password
25815  * Since: 2.26
25816  */
25817
25818
25819 /**
25820  * g_proxy_address_get_protocol:
25821  * @proxy: a #GProxyAddress
25822  *
25823  * Gets @proxy's protocol. eg, "socks" or "http"
25824  *
25825  * Returns: the @proxy's protocol
25826  * Since: 2.26
25827  */
25828
25829
25830 /**
25831  * g_proxy_address_get_uri:
25832  * @proxy: a #GProxyAddress
25833  *
25834  * Gets the proxy URI that @proxy was constructed from.
25835  *
25836  * Returns: the @proxy's URI, or %NULL if unknown
25837  * Since: 2.34
25838  */
25839
25840
25841 /**
25842  * g_proxy_address_get_username:
25843  * @proxy: a #GProxyAddress
25844  *
25845  * Gets @proxy's username.
25846  *
25847  * Returns: the @proxy's username
25848  * Since: 2.26
25849  */
25850
25851
25852 /**
25853  * g_proxy_address_new:
25854  * @inetaddr: The proxy server #GInetAddress.
25855  * @port: The proxy server port.
25856  * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25857  * @dest_hostname: The destination hostname the proxy should tunnel to.
25858  * @dest_port: The destination port to tunnel to.
25859  * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25860  * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25861  *
25862  * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25863  * tunnel through @dest_hostname and @dest_port.
25864  *
25865  * (Note that this method doesn't set the #GProxyAddress:uri or
25866  * #GProxyAddress:destination-protocol fields; use g_object_new()
25867  * directly if you want to set those.)
25868  *
25869  * Returns: a new #GProxyAddress
25870  * Since: 2.26
25871  */
25872
25873
25874 /**
25875  * g_proxy_connect:
25876  * @proxy: a #GProxy
25877  * @connection: a #GIOStream
25878  * @proxy_address: a #GProxyAddress
25879  * @cancellable: (allow-none): a #GCancellable
25880  * @error: return #GError
25881  *
25882  * Given @connection to communicate with a proxy (eg, a
25883  * #GSocketConnection that is connected to the proxy server), this
25884  * does the necessary handshake to connect to @proxy_address, and if
25885  * required, wraps the #GIOStream to handle proxy payload.
25886  *
25887  * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25888  * Since: 2.26
25889  */
25890
25891
25892 /**
25893  * g_proxy_connect_async:
25894  * @proxy: a #GProxy
25895  * @connection: a #GIOStream
25896  * @proxy_address: a #GProxyAddress
25897  * @cancellable: (allow-none): a #GCancellable
25898  * @callback: (scope async): a #GAsyncReadyCallback
25899  * @user_data: (closure): callback data
25900  *
25901  * Asynchronous version of g_proxy_connect().
25902  *
25903  * Since: 2.26
25904  */
25905
25906
25907 /**
25908  * g_proxy_connect_finish:
25909  * @proxy: a #GProxy
25910  * @result: a #GAsyncResult
25911  * @error: return #GError
25912  *
25913  * See g_proxy_connect().
25914  *
25915  * Returns: (transfer full): a #GIOStream.
25916  * Since: 2.26
25917  */
25918
25919
25920 /**
25921  * g_proxy_get_default_for_protocol:
25922  * @protocol: the proxy protocol name (e.g. http, socks, etc)
25923  *
25924  * Lookup "gio-proxy" extension point for a proxy implementation that supports
25925  * specified protocol.
25926  *
25927  * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25928  * Since: 2.26
25929  */
25930
25931
25932 /**
25933  * g_proxy_resolver_get_default:
25934  *
25935  * Gets the default #GProxyResolver for the system.
25936  *
25937  * Returns: (transfer none): the default #GProxyResolver.
25938  * Since: 2.26
25939  */
25940
25941
25942 /**
25943  * g_proxy_resolver_is_supported:
25944  * @resolver: a #GProxyResolver
25945  *
25946  * Checks if @resolver can be used on this system. (This is used
25947  * internally; g_proxy_resolver_get_default() will only return a proxy
25948  * resolver that returns %TRUE for this method.)
25949  *
25950  * Returns: %TRUE if @resolver is supported.
25951  * Since: 2.26
25952  */
25953
25954
25955 /**
25956  * g_proxy_resolver_lookup:
25957  * @resolver: a #GProxyResolver
25958  * @uri: a URI representing the destination to connect to
25959  * @cancellable: (allow-none): a #GCancellable, or %NULL
25960  * @error: return location for a #GError, or %NULL
25961  *
25962  * Looks into the system proxy configuration to determine what proxy,
25963  * if any, to use to connect to @uri. The returned proxy URIs are of the
25964  * form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
25965  * or <literal>direct://</literal>, where &lt;protocol&gt; could be
25966  * http, rtsp, socks or other proxying protocol.
25967  *
25968  * If you don't know what network protocol is being used on the
25969  * socket, you should use <literal>none</literal> as the URI protocol.
25970  * In this case, the resolver might still return a generic proxy type
25971  * (such as SOCKS), but would not return protocol-specific proxy types
25972  * (such as http).
25973  *
25974  * <literal>direct://</literal> is used when no proxy is needed.
25975  * Direct connection should not be attempted unless it is part of the
25976  * returned array of proxies.
25977  *
25978  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25979  * Since: 2.26
25980  */
25981
25982
25983 /**
25984  * g_proxy_resolver_lookup_async:
25985  * @resolver: a #GProxyResolver
25986  * @uri: a URI representing the destination to connect to
25987  * @cancellable: (allow-none): a #GCancellable, or %NULL
25988  * @callback: (scope async): callback to call after resolution completes
25989  * @user_data: (closure): data for @callback
25990  *
25991  * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25992  * details.
25993  *
25994  * Since: 2.26
25995  */
25996
25997
25998 /**
25999  * g_proxy_resolver_lookup_finish:
26000  * @resolver: a #GProxyResolver
26001  * @result: the result passed to your #GAsyncReadyCallback
26002  * @error: return location for a #GError, or %NULL
26003  *
26004  * Call this function to obtain the array of proxy URIs when
26005  * g_proxy_resolver_lookup_async() is complete. See
26006  * g_proxy_resolver_lookup() for more details.
26007  *
26008  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
26009  * Since: 2.26
26010  */
26011
26012
26013 /**
26014  * g_proxy_supports_hostname:
26015  * @proxy: a #GProxy
26016  *
26017  * Some proxy protocols expect to be passed a hostname, which they
26018  * will resolve to an IP address themselves. Others, like SOCKS4, do
26019  * not allow this. This function will return %FALSE if @proxy is
26020  * implementing such a protocol. When %FALSE is returned, the caller
26021  * should resolve the destination hostname first, and then pass a
26022  * #GProxyAddress containing the stringified IP address to
26023  * g_proxy_connect() or g_proxy_connect_async().
26024  *
26025  * Returns: %TRUE if hostname resolution is supported.
26026  * Since: 2.26
26027  */
26028
26029
26030 /**
26031  * g_remote_action_group_activate_action_full:
26032  * @remote: a #GDBusActionGroup
26033  * @action_name: the name of the action to activate
26034  * @parameter: (allow-none): the optional parameter to the activation
26035  * @platform_data: the platform data to send
26036  *
26037  * Activates the remote action.
26038  *
26039  * This is the same as g_action_group_activate_action() except that it
26040  * allows for provision of "platform data" to be sent along with the
26041  * activation request.  This typically contains details such as the user
26042  * interaction timestamp or startup notification information.
26043  *
26044  * @platform_data must be non-%NULL and must have the type
26045  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
26046  *
26047  * Since: 2.32
26048  */
26049
26050
26051 /**
26052  * g_remote_action_group_change_action_state_full:
26053  * @remote: a #GRemoteActionGroup
26054  * @action_name: the name of the action to change the state of
26055  * @value: the new requested value for the state
26056  * @platform_data: the platform data to send
26057  *
26058  * Changes the state of a remote action.
26059  *
26060  * This is the same as g_action_group_change_action_state() except that
26061  * it allows for provision of "platform data" to be sent along with the
26062  * state change request.  This typically contains details such as the
26063  * user interaction timestamp or startup notification information.
26064  *
26065  * @platform_data must be non-%NULL and must have the type
26066  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
26067  *
26068  * Since: 2.32
26069  */
26070
26071
26072 /**
26073  * g_resolver_error_quark:
26074  *
26075  * Gets the #GResolver Error Quark.
26076  *
26077  * Returns: a #GQuark.
26078  * Since: 2.22
26079  */
26080
26081
26082 /**
26083  * g_resolver_free_addresses: (skip)
26084  * @addresses: a #GList of #GInetAddress
26085  *
26086  * Frees @addresses (which should be the return value from
26087  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
26088  * (This is a convenience method; you can also simply free the results
26089  * by hand.)
26090  *
26091  * Since: 2.22
26092  */
26093
26094
26095 /**
26096  * g_resolver_free_targets: (skip)
26097  * @targets: a #GList of #GSrvTarget
26098  *
26099  * Frees @targets (which should be the return value from
26100  * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
26101  * (This is a convenience method; you can also simply free the
26102  * results by hand.)
26103  *
26104  * Since: 2.22
26105  */
26106
26107
26108 /**
26109  * g_resolver_get_default:
26110  *
26111  * Gets the default #GResolver. You should unref it when you are done
26112  * with it. #GResolver may use its reference count as a hint about how
26113  * many threads it should allocate for concurrent DNS resolutions.
26114  *
26115  * Returns: (transfer full): the default #GResolver.
26116  * Since: 2.22
26117  */
26118
26119
26120 /**
26121  * g_resolver_lookup_by_address:
26122  * @resolver: a #GResolver
26123  * @address: the address to reverse-resolve
26124  * @cancellable: (allow-none): a #GCancellable, or %NULL
26125  * @error: return location for a #GError, or %NULL
26126  *
26127  * Synchronously reverse-resolves @address to determine its
26128  * associated hostname.
26129  *
26130  * If the DNS resolution fails, @error (if non-%NULL) will be set to
26131  * a value from #GResolverError.
26132  *
26133  * If @cancellable is non-%NULL, it can be used to cancel the
26134  * operation, in which case @error (if non-%NULL) will be set to
26135  * %G_IO_ERROR_CANCELLED.
26136  *
26137  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
26138  * Since: 2.22
26139  */
26140
26141
26142 /**
26143  * g_resolver_lookup_by_address_async:
26144  * @resolver: a #GResolver
26145  * @address: the address to reverse-resolve
26146  * @cancellable: (allow-none): a #GCancellable, or %NULL
26147  * @callback: (scope async): callback to call after resolution completes
26148  * @user_data: (closure): data for @callback
26149  *
26150  * Begins asynchronously reverse-resolving @address to determine its
26151  * associated hostname, and eventually calls @callback, which must
26152  * call g_resolver_lookup_by_address_finish() to get the final result.
26153  *
26154  * Since: 2.22
26155  */
26156
26157
26158 /**
26159  * g_resolver_lookup_by_address_finish:
26160  * @resolver: a #GResolver
26161  * @result: the result passed to your #GAsyncReadyCallback
26162  * @error: return location for a #GError, or %NULL
26163  *
26164  * Retrieves the result of a previous call to
26165  * g_resolver_lookup_by_address_async().
26166  *
26167  * If the DNS resolution failed, @error (if non-%NULL) will be set to
26168  * a value from #GResolverError. If the operation was cancelled,
26169  * @error will be set to %G_IO_ERROR_CANCELLED.
26170  *
26171  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
26172  * Since: 2.22
26173  */
26174
26175
26176 /**
26177  * g_resolver_lookup_by_name:
26178  * @resolver: a #GResolver
26179  * @hostname: the hostname to look up
26180  * @cancellable: (allow-none): a #GCancellable, or %NULL
26181  * @error: return location for a #GError, or %NULL
26182  *
26183  * Synchronously resolves @hostname to determine its associated IP
26184  * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
26185  * the textual form of an IP address (in which case this just becomes
26186  * a wrapper around g_inet_address_new_from_string()).
26187  *
26188  * On success, g_resolver_lookup_by_name() will return a #GList of
26189  * #GInetAddress, sorted in order of preference and guaranteed to not
26190  * contain duplicates. That is, if using the result to connect to
26191  * @hostname, you should attempt to connect to the first address
26192  * first, then the second if the first fails, etc. If you are using
26193  * the result to listen on a socket, it is appropriate to add each
26194  * result using e.g. g_socket_listener_add_address().
26195  *
26196  * If the DNS resolution fails, @error (if non-%NULL) will be set to a
26197  * value from #GResolverError.
26198  *
26199  * If @cancellable is non-%NULL, it can be used to cancel the
26200  * operation, in which case @error (if non-%NULL) will be set to
26201  * %G_IO_ERROR_CANCELLED.
26202  *
26203  * If you are planning to connect to a socket on the resolved IP
26204  * address, it may be easier to create a #GNetworkAddress and use its
26205  * #GSocketConnectable interface.
26206  *
26207  * 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.)
26208  * Since: 2.22
26209  */
26210
26211
26212 /**
26213  * g_resolver_lookup_by_name_async:
26214  * @resolver: a #GResolver
26215  * @hostname: the hostname to look up the address of
26216  * @cancellable: (allow-none): a #GCancellable, or %NULL
26217  * @callback: (scope async): callback to call after resolution completes
26218  * @user_data: (closure): data for @callback
26219  *
26220  * Begins asynchronously resolving @hostname to determine its
26221  * associated IP address(es), and eventually calls @callback, which
26222  * must call g_resolver_lookup_by_name_finish() to get the result.
26223  * See g_resolver_lookup_by_name() for more details.
26224  *
26225  * Since: 2.22
26226  */
26227
26228
26229 /**
26230  * g_resolver_lookup_by_name_finish:
26231  * @resolver: a #GResolver
26232  * @result: the result passed to your #GAsyncReadyCallback
26233  * @error: return location for a #GError, or %NULL
26234  *
26235  * Retrieves the result of a call to
26236  * g_resolver_lookup_by_name_async().
26237  *
26238  * If the DNS resolution failed, @error (if non-%NULL) will be set to
26239  * a value from #GResolverError. If the operation was cancelled,
26240  * @error will be set to %G_IO_ERROR_CANCELLED.
26241  *
26242  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
26243  * Since: 2.22
26244  */
26245
26246
26247 /**
26248  * g_resolver_lookup_records:
26249  * @resolver: a #GResolver
26250  * @rrname: the DNS name to lookup the record for
26251  * @record_type: the type of DNS record to lookup
26252  * @cancellable: (allow-none): a #GCancellable, or %NULL
26253  * @error: return location for a #GError, or %NULL
26254  *
26255  * Synchronously performs a DNS record lookup for the given @rrname and returns
26256  * a list of records as #GVariant tuples. See #GResolverRecordType for
26257  * information on what the records contain for each @record_type.
26258  *
26259  * If the DNS resolution fails, @error (if non-%NULL) will be set to
26260  * a value from #GResolverError.
26261  *
26262  * If @cancellable is non-%NULL, it can be used to cancel the
26263  * operation, in which case @error (if non-%NULL) will be set to
26264  * %G_IO_ERROR_CANCELLED.
26265  *
26266  * 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.)
26267  * Since: 2.34
26268  */
26269
26270
26271 /**
26272  * g_resolver_lookup_records_async:
26273  * @resolver: a #GResolver
26274  * @rrname: the DNS name to lookup the record for
26275  * @record_type: the type of DNS record to lookup
26276  * @cancellable: (allow-none): a #GCancellable, or %NULL
26277  * @callback: (scope async): callback to call after resolution completes
26278  * @user_data: (closure): data for @callback
26279  *
26280  * Begins asynchronously performing a DNS lookup for the given
26281  * @rrname, and eventually calls @callback, which must call
26282  * g_resolver_lookup_records_finish() to get the final result. See
26283  * g_resolver_lookup_records() for more details.
26284  *
26285  * Since: 2.34
26286  */
26287
26288
26289 /**
26290  * g_resolver_lookup_records_finish:
26291  * @resolver: a #GResolver
26292  * @result: the result passed to your #GAsyncReadyCallback
26293  * @error: return location for a #GError, or %NULL
26294  *
26295  * Retrieves the result of a previous call to
26296  * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
26297  * tuples. See #GResolverRecordType for information on what the records contain.
26298  *
26299  * If the DNS resolution failed, @error (if non-%NULL) will be set to
26300  * a value from #GResolverError. If the operation was cancelled,
26301  * @error will be set to %G_IO_ERROR_CANCELLED.
26302  *
26303  * 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.)
26304  * Since: 2.34
26305  */
26306
26307
26308 /**
26309  * g_resolver_lookup_service:
26310  * @resolver: a #GResolver
26311  * @service: the service type to look up (eg, "ldap")
26312  * @protocol: the networking protocol to use for @service (eg, "tcp")
26313  * @domain: the DNS domain to look up the service in
26314  * @cancellable: (allow-none): a #GCancellable, or %NULL
26315  * @error: return location for a #GError, or %NULL
26316  *
26317  * Synchronously performs a DNS SRV lookup for the given @service and
26318  * @protocol in the given @domain and returns an array of #GSrvTarget.
26319  * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
26320  * @service and @protocol arguments <emphasis>do not</emphasis>
26321  * include the leading underscore that appears in the actual DNS
26322  * entry.
26323  *
26324  * On success, g_resolver_lookup_service() will return a #GList of
26325  * #GSrvTarget, sorted in order of preference. (That is, you should
26326  * attempt to connect to the first target first, then the second if
26327  * the first fails, etc.)
26328  *
26329  * If the DNS resolution fails, @error (if non-%NULL) will be set to
26330  * a value from #GResolverError.
26331  *
26332  * If @cancellable is non-%NULL, it can be used to cancel the
26333  * operation, in which case @error (if non-%NULL) will be set to
26334  * %G_IO_ERROR_CANCELLED.
26335  *
26336  * If you are planning to connect to the service, it is usually easier
26337  * to create a #GNetworkService and use its #GSocketConnectable
26338  * interface.
26339  *
26340  * 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.)
26341  * Since: 2.22
26342  */
26343
26344
26345 /**
26346  * g_resolver_lookup_service_async:
26347  * @resolver: a #GResolver
26348  * @service: the service type to look up (eg, "ldap")
26349  * @protocol: the networking protocol to use for @service (eg, "tcp")
26350  * @domain: the DNS domain to look up the service in
26351  * @cancellable: (allow-none): a #GCancellable, or %NULL
26352  * @callback: (scope async): callback to call after resolution completes
26353  * @user_data: (closure): data for @callback
26354  *
26355  * Begins asynchronously performing a DNS SRV lookup for the given
26356  * @service and @protocol in the given @domain, and eventually calls
26357  * @callback, which must call g_resolver_lookup_service_finish() to
26358  * get the final result. See g_resolver_lookup_service() for more
26359  * details.
26360  *
26361  * Since: 2.22
26362  */
26363
26364
26365 /**
26366  * g_resolver_lookup_service_finish:
26367  * @resolver: a #GResolver
26368  * @result: the result passed to your #GAsyncReadyCallback
26369  * @error: return location for a #GError, or %NULL
26370  *
26371  * Retrieves the result of a previous call to
26372  * g_resolver_lookup_service_async().
26373  *
26374  * If the DNS resolution failed, @error (if non-%NULL) will be set to
26375  * a value from #GResolverError. If the operation was cancelled,
26376  * @error will be set to %G_IO_ERROR_CANCELLED.
26377  *
26378  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
26379  * Since: 2.22
26380  */
26381
26382
26383 /**
26384  * g_resolver_set_default:
26385  * @resolver: the new default #GResolver
26386  *
26387  * Sets @resolver to be the application's default resolver (reffing
26388  * @resolver, and unreffing the previous default resolver, if any).
26389  * Future calls to g_resolver_get_default() will return this resolver.
26390  *
26391  * This can be used if an application wants to perform any sort of DNS
26392  * caching or "pinning"; it can implement its own #GResolver that
26393  * calls the original default resolver for DNS operations, and
26394  * implements its own cache policies on top of that, and then set
26395  * itself as the default resolver for all later code to use.
26396  *
26397  * Since: 2.22
26398  */
26399
26400
26401 /**
26402  * g_resource_enumerate_children:
26403  * @resource: A #GResource
26404  * @path: A pathname inside the resource
26405  * @lookup_flags: A #GResourceLookupFlags
26406  * @error: return location for a #GError, or %NULL
26407  *
26408  * Returns all the names of children at the specified @path in the resource.
26409  * The return result is a %NULL terminated list of strings which should
26410  * be released with g_strfreev().
26411  *
26412  * @lookup_flags controls the behaviour of the lookup.
26413  *
26414  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26415  * Since: 2.32
26416  */
26417
26418
26419 /**
26420  * g_resource_error_quark:
26421  *
26422  * Gets the #GResource Error Quark.
26423  *
26424  * Returns: a #GQuark
26425  * Since: 2.32
26426  */
26427
26428
26429 /**
26430  * g_resource_get_info:
26431  * @resource: A #GResource
26432  * @path: A pathname inside the resource
26433  * @lookup_flags: A #GResourceLookupFlags
26434  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26435  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26436  * @error: return location for a #GError, or %NULL
26437  *
26438  * Looks for a file at the specified @path in the resource and
26439  * if found returns information about it.
26440  *
26441  * @lookup_flags controls the behaviour of the lookup.
26442  *
26443  * Returns: %TRUE if the file was found. %FALSE if there were errors
26444  * Since: 2.32
26445  */
26446
26447
26448 /**
26449  * g_resource_load:
26450  * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
26451  * @error: return location for a #GError, or %NULL
26452  *
26453  * Loads a binary resource bundle and creates a #GResource representation of it, allowing
26454  * you to query it for data.
26455  *
26456  * If you want to use this resource in the global resource namespace you need
26457  * to register it with g_resources_register().
26458  *
26459  * Returns: (transfer full): a new #GResource, or %NULL on error
26460  * Since: 2.32
26461  */
26462
26463
26464 /**
26465  * g_resource_lookup_data:
26466  * @resource: A #GResource
26467  * @path: A pathname inside the resource
26468  * @lookup_flags: A #GResourceLookupFlags
26469  * @error: return location for a #GError, or %NULL
26470  *
26471  * Looks for a file at the specified @path in the resource and
26472  * returns a #GBytes that lets you directly access the data in
26473  * memory.
26474  *
26475  * The data is always followed by a zero byte, so you
26476  * can safely use the data as a C string. However, that byte
26477  * is not included in the size of the GBytes.
26478  *
26479  * For uncompressed resource files this is a pointer directly into
26480  * the resource bundle, which is typically in some readonly data section
26481  * in the program binary. For compressed files we allocate memory on
26482  * the heap and automatically uncompress the data.
26483  *
26484  * @lookup_flags controls the behaviour of the lookup.
26485  *
26486  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26487  * Since: 2.32
26488  */
26489
26490
26491 /**
26492  * g_resource_new_from_data:
26493  * @data: A #GBytes
26494  * @error: return location for a #GError, or %NULL
26495  *
26496  * Creates a GResource from a reference to the binary resource bundle.
26497  * This will keep a reference to @data while the resource lives, so
26498  * the data should not be modified or freed.
26499  *
26500  * If you want to use this resource in the global resource namespace you need
26501  * to register it with g_resources_register().
26502  *
26503  * Returns: (transfer full): a new #GResource, or %NULL on error
26504  * Since: 2.32
26505  */
26506
26507
26508 /**
26509  * g_resource_open_stream:
26510  * @resource: A #GResource
26511  * @path: A pathname inside the resource
26512  * @lookup_flags: A #GResourceLookupFlags
26513  * @error: return location for a #GError, or %NULL
26514  *
26515  * Looks for a file at the specified @path in the resource and
26516  * returns a #GInputStream that lets you read the data.
26517  *
26518  * @lookup_flags controls the behaviour of the lookup.
26519  *
26520  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26521  * Since: 2.32
26522  */
26523
26524
26525 /**
26526  * g_resource_ref:
26527  * @resource: A #GResource
26528  *
26529  * Atomically increments the reference count of @array by one. This
26530  * function is MT-safe and may be called from any thread.
26531  *
26532  * Returns: The passed in #GResource
26533  * Since: 2.32
26534  */
26535
26536
26537 /**
26538  * g_resource_unref:
26539  * @resource: A #GResource
26540  *
26541  * Atomically decrements the reference count of @resource by one. If the
26542  * reference count drops to 0, all memory allocated by the array is
26543  * released. This function is MT-safe and may be called from any
26544  * thread.
26545  *
26546  * Since: 2.32
26547  */
26548
26549
26550 /**
26551  * g_resources_enumerate_children:
26552  * @path: A pathname inside the resource
26553  * @lookup_flags: A #GResourceLookupFlags
26554  * @error: return location for a #GError, or %NULL
26555  *
26556  * Returns all the names of children at the specified @path in the set of
26557  * globally registered resources.
26558  * The return result is a %NULL terminated list of strings which should
26559  * be released with g_strfreev().
26560  *
26561  * @lookup_flags controls the behaviour of the lookup.
26562  *
26563  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26564  * Since: 2.32
26565  */
26566
26567
26568 /**
26569  * g_resources_get_info:
26570  * @path: A pathname inside the resource
26571  * @lookup_flags: A #GResourceLookupFlags
26572  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26573  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26574  * @error: return location for a #GError, or %NULL
26575  *
26576  * Looks for a file at the specified @path in the set of
26577  * globally registered resources and if found returns information about it.
26578  *
26579  * @lookup_flags controls the behaviour of the lookup.
26580  *
26581  * Returns: %TRUE if the file was found. %FALSE if there were errors
26582  * Since: 2.32
26583  */
26584
26585
26586 /**
26587  * g_resources_lookup_data:
26588  * @path: A pathname inside the resource
26589  * @lookup_flags: A #GResourceLookupFlags
26590  * @error: return location for a #GError, or %NULL
26591  *
26592  * Looks for a file at the specified @path in the set of
26593  * globally registered resources and returns a #GBytes that
26594  * lets you directly access the data in memory.
26595  *
26596  * The data is always followed by a zero byte, so you
26597  * can safely use the data as a C string. However, that byte
26598  * is not included in the size of the GBytes.
26599  *
26600  * For uncompressed resource files this is a pointer directly into
26601  * the resource bundle, which is typically in some readonly data section
26602  * in the program binary. For compressed files we allocate memory on
26603  * the heap and automatically uncompress the data.
26604  *
26605  * @lookup_flags controls the behaviour of the lookup.
26606  *
26607  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26608  * Since: 2.32
26609  */
26610
26611
26612 /**
26613  * g_resources_open_stream:
26614  * @path: A pathname inside the resource
26615  * @lookup_flags: A #GResourceLookupFlags
26616  * @error: return location for a #GError, or %NULL
26617  *
26618  * Looks for a file at the specified @path in the set of
26619  * globally registered resources and returns a #GInputStream
26620  * that lets you read the data.
26621  *
26622  * @lookup_flags controls the behaviour of the lookup.
26623  *
26624  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26625  * Since: 2.32
26626  */
26627
26628
26629 /**
26630  * g_resources_register:
26631  * @resource: A #GResource
26632  *
26633  * Registers the resource with the process-global set of resources.
26634  * Once a resource is registered the files in it can be accessed
26635  * with the global resource lookup functions like g_resources_lookup_data().
26636  *
26637  * Since: 2.32
26638  */
26639
26640
26641 /**
26642  * g_resources_unregister:
26643  * @resource: A #GResource
26644  *
26645  * Unregisters the resource from the process-global set of resources.
26646  *
26647  * Since: 2.32
26648  */
26649
26650
26651 /**
26652  * g_seekable_can_seek:
26653  * @seekable: a #GSeekable.
26654  *
26655  * Tests if the stream supports the #GSeekableIface.
26656  *
26657  * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26658  */
26659
26660
26661 /**
26662  * g_seekable_can_truncate:
26663  * @seekable: a #GSeekable.
26664  *
26665  * Tests if the stream can be truncated.
26666  *
26667  * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26668  */
26669
26670
26671 /**
26672  * g_seekable_seek:
26673  * @seekable: a #GSeekable.
26674  * @offset: a #goffset.
26675  * @type: a #GSeekType.
26676  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26677  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26678  *
26679  * Seeks in the stream by the given @offset, modified by @type.
26680  *
26681  * If @cancellable is not %NULL, then the operation can be cancelled by
26682  * triggering the cancellable object from another thread. If the operation
26683  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26684  *
26685  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26686  */
26687
26688
26689 /**
26690  * g_seekable_tell:
26691  * @seekable: a #GSeekable.
26692  *
26693  * Tells the current position within the stream.
26694  *
26695  * Returns: the offset from the beginning of the buffer.
26696  */
26697
26698
26699 /**
26700  * g_seekable_truncate:
26701  * @seekable: a #GSeekable.
26702  * @offset: a #goffset.
26703  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26704  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26705  *
26706  * Truncates a stream with a given #offset.
26707  *
26708  * If @cancellable is not %NULL, then the operation can be cancelled by
26709  * triggering the cancellable object from another thread. If the operation
26710  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26711  * operation was partially finished when the operation was cancelled the
26712  * partial result will be returned, without an error.
26713  *
26714  * Virtual: truncate_fn
26715  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26716  */
26717
26718
26719 /**
26720  * g_settings_apply:
26721  * @settings: a #GSettings instance
26722  *
26723  * Applies any changes that have been made to the settings.  This
26724  * function does nothing unless @settings is in 'delay-apply' mode;
26725  * see g_settings_delay().  In the normal case settings are always
26726  * applied immediately.
26727  */
26728
26729
26730 /**
26731  * g_settings_backend_changed:
26732  * @backend: a #GSettingsBackend implementation
26733  * @key: the name of the key
26734  * @origin_tag: the origin tag
26735  *
26736  * Signals that a single key has possibly changed.  Backend
26737  * implementations should call this if a key has possibly changed its
26738  * value.
26739  *
26740  * @key must be a valid key (ie starting with a slash, not containing
26741  * '//', and not ending with a slash).
26742  *
26743  * The implementation must call this function during any call to
26744  * g_settings_backend_write(), before the call returns (except in the
26745  * case that no keys are actually changed and it cares to detect this
26746  * fact).  It may not rely on the existence of a mainloop for
26747  * dispatching the signal later.
26748  *
26749  * The implementation may call this function at any other time it likes
26750  * in response to other events (such as changes occurring outside of the
26751  * program).  These calls may originate from a mainloop or may originate
26752  * in response to any other action (including from calls to
26753  * g_settings_backend_write()).
26754  *
26755  * In the case that this call is in response to a call to
26756  * g_settings_backend_write() then @origin_tag must be set to the same
26757  * value that was passed to that call.
26758  *
26759  * Since: 2.26
26760  */
26761
26762
26763 /**
26764  * g_settings_backend_changed_tree:
26765  * @backend: a #GSettingsBackend implementation
26766  * @tree: a #GTree containing the changes
26767  * @origin_tag: the origin tag
26768  *
26769  * This call is a convenience wrapper.  It gets the list of changes from
26770  * @tree, computes the longest common prefix and calls
26771  * g_settings_backend_changed().
26772  *
26773  * Since: 2.26
26774  */
26775
26776
26777 /**
26778  * g_settings_backend_flatten_tree:
26779  * @tree: a #GTree containing the changes
26780  * @path: (out): the location to save the path
26781  * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26782  * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26783  *
26784  * Calculate the longest common prefix of all keys in a tree and write
26785  * out an array of the key names relative to that prefix and,
26786  * optionally, the value to store at each of those keys.
26787  *
26788  * You must free the value returned in @path, @keys and @values using
26789  * g_free().  You should not attempt to free or unref the contents of
26790  * @keys or @values.
26791  *
26792  * Since: 2.26
26793  */
26794
26795
26796 /**
26797  * g_settings_backend_get_default:
26798  *
26799  * Returns the default #GSettingsBackend. It is possible to override
26800  * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26801  * environment variable to the name of a settings backend.
26802  *
26803  * The user gets a reference to the backend.
26804  *
26805  * Returns: (transfer full): the default #GSettingsBackend
26806  * Since: 2.28
26807  */
26808
26809
26810 /**
26811  * g_settings_backend_keys_changed:
26812  * @backend: a #GSettingsBackend implementation
26813  * @path: the path containing the changes
26814  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26815  * @origin_tag: the origin tag
26816  *
26817  * Signals that a list of keys have possibly changed.  Backend
26818  * implementations should call this if keys have possibly changed their
26819  * values.
26820  *
26821  * @path must be a valid path (ie starting and ending with a slash and
26822  * not containing '//').  Each string in @items must form a valid key
26823  * name when @path is prefixed to it (ie: each item must not start or
26824  * end with '/' and must not contain '//').
26825  *
26826  * The meaning of this signal is that any of the key names resulting
26827  * from the contatenation of @path with each item in @items may have
26828  * changed.
26829  *
26830  * The same rules for when notifications must occur apply as per
26831  * g_settings_backend_changed().  These two calls can be used
26832  * interchangeably if exactly one item has changed (although in that
26833  * case g_settings_backend_changed() is definitely preferred).
26834  *
26835  * For efficiency reasons, the implementation should strive for @path to
26836  * be as long as possible (ie: the longest common prefix of all of the
26837  * keys that were changed) but this is not strictly required.
26838  *
26839  * Since: 2.26
26840  */
26841
26842
26843 /**
26844  * g_settings_backend_path_changed:
26845  * @backend: a #GSettingsBackend implementation
26846  * @path: the path containing the changes
26847  * @origin_tag: the origin tag
26848  *
26849  * Signals that all keys below a given path may have possibly changed.
26850  * Backend implementations should call this if an entire path of keys
26851  * have possibly changed their values.
26852  *
26853  * @path must be a valid path (ie starting and ending with a slash and
26854  * not containing '//').
26855  *
26856  * The meaning of this signal is that any of the key which has a name
26857  * starting with @path may have changed.
26858  *
26859  * The same rules for when notifications must occur apply as per
26860  * g_settings_backend_changed().  This call might be an appropriate
26861  * reasponse to a 'reset' call but implementations are also free to
26862  * explicitly list the keys that were affected by that call if they can
26863  * easily do so.
26864  *
26865  * For efficiency reasons, the implementation should strive for @path to
26866  * be as long as possible (ie: the longest common prefix of all of the
26867  * keys that were changed) but this is not strictly required.  As an
26868  * example, if this function is called with the path of "/" then every
26869  * single key in the application will be notified of a possible change.
26870  *
26871  * Since: 2.26
26872  */
26873
26874
26875 /**
26876  * g_settings_backend_path_writable_changed:
26877  * @backend: a #GSettingsBackend implementation
26878  * @path: the name of the path
26879  *
26880  * Signals that the writability of all keys below a given path may have
26881  * changed.
26882  *
26883  * Since GSettings performs no locking operations for itself, this call
26884  * will always be made in response to external events.
26885  *
26886  * Since: 2.26
26887  */
26888
26889
26890 /**
26891  * g_settings_backend_writable_changed:
26892  * @backend: a #GSettingsBackend implementation
26893  * @key: the name of the key
26894  *
26895  * Signals that the writability of a single key has possibly changed.
26896  *
26897  * Since GSettings performs no locking operations for itself, this call
26898  * will always be made in response to external events.
26899  *
26900  * Since: 2.26
26901  */
26902
26903
26904 /**
26905  * g_settings_bind:
26906  * @settings: a #GSettings object
26907  * @key: the key to bind
26908  * @object: (type GObject.Object): a #GObject
26909  * @property: the name of the property to bind
26910  * @flags: flags for the binding
26911  *
26912  * Create a binding between the @key in the @settings object
26913  * and the property @property of @object.
26914  *
26915  * The binding uses the default GIO mapping functions to map
26916  * between the settings and property values. These functions
26917  * handle booleans, numeric types and string types in a
26918  * straightforward way. Use g_settings_bind_with_mapping() if
26919  * you need a custom mapping, or map between types that are not
26920  * supported by the default mapping functions.
26921  *
26922  * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26923  * function also establishes a binding between the writability of
26924  * @key and the "sensitive" property of @object (if @object has
26925  * a boolean property by that name). See g_settings_bind_writable()
26926  * for more details about writable bindings.
26927  *
26928  * Note that the lifecycle of the binding is tied to the object,
26929  * and that you can have only one binding per object property.
26930  * If you bind the same property twice on the same object, the second
26931  * binding overrides the first one.
26932  *
26933  * Since: 2.26
26934  */
26935
26936
26937 /**
26938  * g_settings_bind_with_mapping: (skip)
26939  * @settings: a #GSettings object
26940  * @key: the key to bind
26941  * @object: (type GObject.Object): a #GObject
26942  * @property: the name of the property to bind
26943  * @flags: flags for the binding
26944  * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26945  * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26946  * @user_data: data that gets passed to @get_mapping and @set_mapping
26947  * @destroy: #GDestroyNotify function for @user_data
26948  *
26949  * Create a binding between the @key in the @settings object
26950  * and the property @property of @object.
26951  *
26952  * The binding uses the provided mapping functions to map between
26953  * settings and property values.
26954  *
26955  * Note that the lifecycle of the binding is tied to the object,
26956  * and that you can have only one binding per object property.
26957  * If you bind the same property twice on the same object, the second
26958  * binding overrides the first one.
26959  *
26960  * Since: 2.26
26961  */
26962
26963
26964 /**
26965  * g_settings_bind_writable:
26966  * @settings: a #GSettings object
26967  * @key: the key to bind
26968  * @object: (type GObject.Object): a #GObject
26969  * @property: the name of a boolean property to bind
26970  * @inverted: whether to 'invert' the value
26971  *
26972  * Create a binding between the writability of @key in the
26973  * @settings object and the property @property of @object.
26974  * The property must be boolean; "sensitive" or "visible"
26975  * properties of widgets are the most likely candidates.
26976  *
26977  * Writable bindings are always uni-directional; changes of the
26978  * writability of the setting will be propagated to the object
26979  * property, not the other way.
26980  *
26981  * When the @inverted argument is %TRUE, the binding inverts the
26982  * value as it passes from the setting to the object, i.e. @property
26983  * will be set to %TRUE if the key is <emphasis>not</emphasis>
26984  * writable.
26985  *
26986  * Note that the lifecycle of the binding is tied to the object,
26987  * and that you can have only one binding per object property.
26988  * If you bind the same property twice on the same object, the second
26989  * binding overrides the first one.
26990  *
26991  * Since: 2.26
26992  */
26993
26994
26995 /**
26996  * g_settings_create_action:
26997  * @settings: a #GSettings
26998  * @key: the name of a key in @settings
26999  *
27000  * Creates a #GAction corresponding to a given #GSettings key.
27001  *
27002  * The action has the same name as the key.
27003  *
27004  * The value of the key becomes the state of the action and the action
27005  * is enabled when the key is writable.  Changing the state of the
27006  * action results in the key being written to.  Changes to the value or
27007  * writability of the key cause appropriate change notifications to be
27008  * emitted for the action.
27009  *
27010  * For boolean-valued keys, action activations take no parameter and
27011  * result in the toggling of the value.  For all other types,
27012  * activations take the new value for the key (which must have the
27013  * correct type).
27014  *
27015  * Returns: (transfer full): a new #GAction
27016  * Since: 2.32
27017  */
27018
27019
27020 /**
27021  * g_settings_delay:
27022  * @settings: a #GSettings object
27023  *
27024  * Changes the #GSettings object into 'delay-apply' mode. In this
27025  * mode, changes to @settings are not immediately propagated to the
27026  * backend, but kept locally until g_settings_apply() is called.
27027  *
27028  * Since: 2.26
27029  */
27030
27031
27032 /**
27033  * g_settings_get:
27034  * @settings: a #GSettings object
27035  * @key: the key to get the value for
27036  * @format: a #GVariant format string
27037  * @...: arguments as per @format
27038  *
27039  * Gets the value that is stored at @key in @settings.
27040  *
27041  * A convenience function that combines g_settings_get_value() with
27042  * g_variant_get().
27043  *
27044  * It is a programmer error to give a @key that isn't contained in the
27045  * schema for @settings or for the #GVariantType of @format to mismatch
27046  * the type given in the schema.
27047  *
27048  * Since: 2.26
27049  */
27050
27051
27052 /**
27053  * g_settings_get_boolean:
27054  * @settings: a #GSettings object
27055  * @key: the key to get the value for
27056  *
27057  * Gets the value that is stored at @key in @settings.
27058  *
27059  * A convenience variant of g_settings_get() for booleans.
27060  *
27061  * It is a programmer error to give a @key that isn't specified as
27062  * having a boolean type in the schema for @settings.
27063  *
27064  * Returns: a boolean
27065  * Since: 2.26
27066  */
27067
27068
27069 /**
27070  * g_settings_get_child:
27071  * @settings: a #GSettings object
27072  * @name: the name of the 'child' schema
27073  *
27074  * Creates a 'child' settings object which has a base path of
27075  * <replaceable>base-path</replaceable>/@name, where
27076  * <replaceable>base-path</replaceable> is the base path of @settings.
27077  *
27078  * The schema for the child settings object must have been declared
27079  * in the schema of @settings using a <tag class="starttag">child</tag> element.
27080  *
27081  * Returns: (transfer full): a 'child' settings object
27082  * Since: 2.26
27083  */
27084
27085
27086 /**
27087  * g_settings_get_double:
27088  * @settings: a #GSettings object
27089  * @key: the key to get the value for
27090  *
27091  * Gets the value that is stored at @key in @settings.
27092  *
27093  * A convenience variant of g_settings_get() for doubles.
27094  *
27095  * It is a programmer error to give a @key that isn't specified as
27096  * having a 'double' type in the schema for @settings.
27097  *
27098  * Returns: a double
27099  * Since: 2.26
27100  */
27101
27102
27103 /**
27104  * g_settings_get_enum:
27105  * @settings: a #GSettings object
27106  * @key: the key to get the value for
27107  *
27108  * Gets the value that is stored in @settings for @key and converts it
27109  * to the enum value that it represents.
27110  *
27111  * In order to use this function the type of the value must be a string
27112  * and it must be marked in the schema file as an enumerated type.
27113  *
27114  * It is a programmer error to give a @key that isn't contained in the
27115  * schema for @settings or is not marked as an enumerated type.
27116  *
27117  * If the value stored in the configuration database is not a valid
27118  * value for the enumerated type then this function will return the
27119  * default value.
27120  *
27121  * Returns: the enum value
27122  * Since: 2.26
27123  */
27124
27125
27126 /**
27127  * g_settings_get_flags:
27128  * @settings: a #GSettings object
27129  * @key: the key to get the value for
27130  *
27131  * Gets the value that is stored in @settings for @key and converts it
27132  * to the flags value that it represents.
27133  *
27134  * In order to use this function the type of the value must be an array
27135  * of strings and it must be marked in the schema file as an flags type.
27136  *
27137  * It is a programmer error to give a @key that isn't contained in the
27138  * schema for @settings or is not marked as a flags type.
27139  *
27140  * If the value stored in the configuration database is not a valid
27141  * value for the flags type then this function will return the default
27142  * value.
27143  *
27144  * Returns: the flags value
27145  * Since: 2.26
27146  */
27147
27148
27149 /**
27150  * g_settings_get_has_unapplied:
27151  * @settings: a #GSettings object
27152  *
27153  * Returns whether the #GSettings object has any unapplied
27154  * changes.  This can only be the case if it is in 'delayed-apply' mode.
27155  *
27156  * Returns: %TRUE if @settings has unapplied changes
27157  * Since: 2.26
27158  */
27159
27160
27161 /**
27162  * g_settings_get_int:
27163  * @settings: a #GSettings object
27164  * @key: the key to get the value for
27165  *
27166  * Gets the value that is stored at @key in @settings.
27167  *
27168  * A convenience variant of g_settings_get() for 32-bit integers.
27169  *
27170  * It is a programmer error to give a @key that isn't specified as
27171  * having a int32 type in the schema for @settings.
27172  *
27173  * Returns: an integer
27174  * Since: 2.26
27175  */
27176
27177
27178 /**
27179  * g_settings_get_mapped:
27180  * @settings: a #GSettings object
27181  * @key: the key to get the value for
27182  * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
27183  * @user_data: user data for @mapping
27184  *
27185  * Gets the value that is stored at @key in @settings, subject to
27186  * application-level validation/mapping.
27187  *
27188  * You should use this function when the application needs to perform
27189  * some processing on the value of the key (for example, parsing).  The
27190  * @mapping function performs that processing.  If the function
27191  * indicates that the processing was unsuccessful (due to a parse error,
27192  * for example) then the mapping is tried again with another value.
27193  *
27194  * This allows a robust 'fall back to defaults' behaviour to be
27195  * implemented somewhat automatically.
27196  *
27197  * The first value that is tried is the user's setting for the key.  If
27198  * the mapping function fails to map this value, other values may be
27199  * tried in an unspecified order (system or site defaults, translated
27200  * schema default values, untranslated schema default values, etc).
27201  *
27202  * If the mapping function fails for all possible values, one additional
27203  * attempt is made: the mapping function is called with a %NULL value.
27204  * If the mapping function still indicates failure at this point then
27205  * the application will be aborted.
27206  *
27207  * The result parameter for the @mapping function is pointed to a
27208  * #gpointer which is initially set to %NULL.  The same pointer is given
27209  * to each invocation of @mapping.  The final value of that #gpointer is
27210  * what is returned by this function.  %NULL is valid; it is returned
27211  * just as any other value would be.
27212  *
27213  * Returns: (transfer full): the result, which may be %NULL
27214  */
27215
27216
27217 /**
27218  * g_settings_get_range:
27219  * @settings: a #GSettings
27220  * @key: the key to query the range of
27221  *
27222  * Queries the range of a key.
27223  *
27224  * This function will return a #GVariant that fully describes the range
27225  * of values that are valid for @key.
27226  *
27227  * The type of #GVariant returned is <literal>(sv)</literal>.  The
27228  * string describes the type of range restriction in effect.  The type
27229  * and meaning of the value contained in the variant depends on the
27230  * string.
27231  *
27232  * If the string is <literal>'type'</literal> then the variant contains
27233  * an empty array.  The element type of that empty array is the expected
27234  * type of value and all values of that type are valid.
27235  *
27236  * If the string is <literal>'enum'</literal> then the variant contains
27237  * an array enumerating the possible values.  Each item in the array is
27238  * a possible valid value and no other values are valid.
27239  *
27240  * If the string is <literal>'flags'</literal> then the variant contains
27241  * an array.  Each item in the array is a value that may appear zero or
27242  * one times in an array to be used as the value for this key.  For
27243  * example, if the variant contained the array <literal>['x',
27244  * 'y']</literal> then the valid values for the key would be
27245  * <literal>[]</literal>, <literal>['x']</literal>,
27246  * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
27247  * <literal>['y', 'x']</literal>.
27248  *
27249  * Finally, if the string is <literal>'range'</literal> then the variant
27250  * contains a pair of like-typed values -- the minimum and maximum
27251  * permissible values for this key.
27252  *
27253  * This information should not be used by normal programs.  It is
27254  * considered to be a hint for introspection purposes.  Normal programs
27255  * should already know what is permitted by their own schema.  The
27256  * format may change in any way in the future -- but particularly, new
27257  * forms may be added to the possibilities described above.
27258  *
27259  * It is a programmer error to give a @key that isn't contained in the
27260  * schema for @settings.
27261  *
27262  * You should free the returned value with g_variant_unref() when it is
27263  * no longer needed.
27264  *
27265  * Returns: a #GVariant describing the range
27266  * Since: 2.28
27267  */
27268
27269
27270 /**
27271  * g_settings_get_string:
27272  * @settings: a #GSettings object
27273  * @key: the key to get the value for
27274  *
27275  * Gets the value that is stored at @key in @settings.
27276  *
27277  * A convenience variant of g_settings_get() for strings.
27278  *
27279  * It is a programmer error to give a @key that isn't specified as
27280  * having a string type in the schema for @settings.
27281  *
27282  * Returns: a newly-allocated string
27283  * Since: 2.26
27284  */
27285
27286
27287 /**
27288  * g_settings_get_strv:
27289  * @settings: a #GSettings object
27290  * @key: the key to get the value for
27291  *
27292  * A convenience variant of g_settings_get() for string arrays.
27293  *
27294  * It is a programmer error to give a @key that isn't specified as
27295  * having an array of strings type in the schema for @settings.
27296  *
27297  * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
27298  * Since: 2.26
27299  */
27300
27301
27302 /**
27303  * g_settings_get_uint:
27304  * @settings: a #GSettings object
27305  * @key: the key to get the value for
27306  *
27307  * Gets the value that is stored at @key in @settings.
27308  *
27309  * A convenience variant of g_settings_get() for 32-bit unsigned
27310  * integers.
27311  *
27312  * It is a programmer error to give a @key that isn't specified as
27313  * having a uint32 type in the schema for @settings.
27314  *
27315  * Returns: an unsigned integer
27316  * Since: 2.30
27317  */
27318
27319
27320 /**
27321  * g_settings_get_value:
27322  * @settings: a #GSettings object
27323  * @key: the key to get the value for
27324  *
27325  * Gets the value that is stored in @settings for @key.
27326  *
27327  * It is a programmer error to give a @key that isn't contained in the
27328  * schema for @settings.
27329  *
27330  * Returns: a new #GVariant
27331  * Since: 2.26
27332  */
27333
27334
27335 /**
27336  * g_settings_is_writable:
27337  * @settings: a #GSettings object
27338  * @name: the name of a key
27339  *
27340  * Finds out if a key can be written or not
27341  *
27342  * Returns: %TRUE if the key @name is writable
27343  * Since: 2.26
27344  */
27345
27346
27347 /**
27348  * g_settings_list_children:
27349  * @settings: a #GSettings object
27350  *
27351  * Gets the list of children on @settings.
27352  *
27353  * The list is exactly the list of strings for which it is not an error
27354  * to call g_settings_get_child().
27355  *
27356  * For GSettings objects that are lists, this value can change at any
27357  * time and you should connect to the "children-changed" signal to watch
27358  * for those changes.  Note that there is a race condition here: you may
27359  * request a child after listing it only for it to have been destroyed
27360  * in the meantime.  For this reason, g_settings_get_child() may return
27361  * %NULL even for a child that was listed by this function.
27362  *
27363  * For GSettings objects that are not lists, you should probably not be
27364  * calling this function from "normal" code (since you should already
27365  * know what children are in your schema).  This function may still be
27366  * useful there for introspection reasons, however.
27367  *
27368  * You should free the return value with g_strfreev() when you are done
27369  * with it.
27370  *
27371  * Returns: (transfer full) (element-type utf8): a list of the children on @settings
27372  */
27373
27374
27375 /**
27376  * g_settings_list_keys:
27377  * @settings: a #GSettings object
27378  *
27379  * Introspects the list of keys on @settings.
27380  *
27381  * You should probably not be calling this function from "normal" code
27382  * (since you should already know what keys are in your schema).  This
27383  * function is intended for introspection reasons.
27384  *
27385  * You should free the return value with g_strfreev() when you are done
27386  * with it.
27387  *
27388  * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
27389  */
27390
27391
27392 /**
27393  * g_settings_list_relocatable_schemas:
27394  *
27395  * Gets a list of the relocatable #GSettings schemas installed on the
27396  * system.  These are schemas that do not provide their own path.  It is
27397  * usual to instantiate these schemas directly, but if you want to you
27398  * can use g_settings_new_with_path() to specify the path.
27399  *
27400  * The output of this function, taken together with the output of
27401  * g_settings_list_schemas() represents the complete list of all
27402  * installed schemas.
27403  *
27404  * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available.  The list must not be modified or freed.
27405  * Since: 2.28
27406  */
27407
27408
27409 /**
27410  * g_settings_list_schemas:
27411  *
27412  * Gets a list of the #GSettings schemas installed on the system.  The
27413  * returned list is exactly the list of schemas for which you may call
27414  * g_settings_new() without adverse effects.
27415  *
27416  * This function does not list the schemas that do not provide their own
27417  * paths (ie: schemas for which you must use
27418  * g_settings_new_with_path()).  See
27419  * g_settings_list_relocatable_schemas() for that.
27420  *
27421  * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available.  The list must not be modified or freed.
27422  * Since: 2.26
27423  */
27424
27425
27426 /**
27427  * g_settings_new:
27428  * @schema_id: the id of the schema
27429  *
27430  * Creates a new #GSettings object with the schema specified by
27431  * @schema_id.
27432  *
27433  * Signals on the newly created #GSettings object will be dispatched
27434  * via the thread-default #GMainContext in effect at the time of the
27435  * call to g_settings_new().  The new #GSettings will hold a reference
27436  * on the context.  See g_main_context_push_thread_default().
27437  *
27438  * Returns: a new #GSettings object
27439  * Since: 2.26
27440  */
27441
27442
27443 /**
27444  * g_settings_new_full:
27445  * @schema: a #GSettingsSchema
27446  * @backend: (allow-none): a #GSettingsBackend
27447  * @path: (allow-none): the path to use
27448  *
27449  * Creates a new #GSettings object with a given schema, backend and
27450  * path.
27451  *
27452  * It should be extremely rare that you ever want to use this function.
27453  * It is made available for advanced use-cases (such as plugin systems
27454  * that want to provide access to schemas loaded from custom locations,
27455  * etc).
27456  *
27457  * At the most basic level, a #GSettings object is a pure composition of
27458  * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
27459  * backend, and a #GMainContext to which signals are dispatched.
27460  *
27461  * This constructor therefore gives you full control over constructing
27462  * #GSettings instances.  The first 4 parameters are given directly as
27463  * @schema, @backend and @path, and the main context is taken from the
27464  * thread-default (as per g_settings_new()).
27465  *
27466  * If @backend is %NULL then the default backend is used.
27467  *
27468  * If @path is %NULL then the path from the schema is used.  It is an
27469  * error f @path is %NULL and the schema has no path of its own or if
27470  * @path is non-%NULL and not equal to the path that the schema does
27471  * have.
27472  *
27473  * Returns: a new #GSettings object
27474  * Since: 2.32
27475  */
27476
27477
27478 /**
27479  * g_settings_new_with_backend:
27480  * @schema_id: the id of the schema
27481  * @backend: the #GSettingsBackend to use
27482  *
27483  * Creates a new #GSettings object with the schema specified by
27484  * @schema_id and a given #GSettingsBackend.
27485  *
27486  * Creating a #GSettings object with a different backend allows accessing
27487  * settings from a database other than the usual one. For example, it may make
27488  * sense to pass a backend corresponding to the "defaults" settings database on
27489  * the system to get a settings object that modifies the system default
27490  * settings instead of the settings for this user.
27491  *
27492  * Returns: a new #GSettings object
27493  * Since: 2.26
27494  */
27495
27496
27497 /**
27498  * g_settings_new_with_backend_and_path:
27499  * @schema_id: the id of the schema
27500  * @backend: the #GSettingsBackend to use
27501  * @path: the path to use
27502  *
27503  * Creates a new #GSettings object with the schema specified by
27504  * @schema_id and a given #GSettingsBackend and path.
27505  *
27506  * This is a mix of g_settings_new_with_backend() and
27507  * g_settings_new_with_path().
27508  *
27509  * Returns: a new #GSettings object
27510  * Since: 2.26
27511  */
27512
27513
27514 /**
27515  * g_settings_new_with_path:
27516  * @schema_id: the id of the schema
27517  * @path: the path to use
27518  *
27519  * Creates a new #GSettings object with the relocatable schema specified
27520  * by @schema_id and a given path.
27521  *
27522  * You only need to do this if you want to directly create a settings
27523  * object with a schema that doesn't have a specified path of its own.
27524  * That's quite rare.
27525  *
27526  * It is a programmer error to call this function for a schema that
27527  * has an explicitly specified path.
27528  *
27529  * Returns: a new #GSettings object
27530  * Since: 2.26
27531  */
27532
27533
27534 /**
27535  * g_settings_range_check:
27536  * @settings: a #GSettings
27537  * @key: the key to check
27538  * @value: the value to check
27539  *
27540  * Checks if the given @value is of the correct type and within the
27541  * permitted range for @key.
27542  *
27543  * This API is not intended to be used by normal programs -- they should
27544  * already know what is permitted by their own schemas.  This API is
27545  * meant to be used by programs such as editors or commandline tools.
27546  *
27547  * It is a programmer error to give a @key that isn't contained in the
27548  * schema for @settings.
27549  *
27550  * Returns: %TRUE if @value is valid for @key
27551  * Since: 2.28
27552  */
27553
27554
27555 /**
27556  * g_settings_reset:
27557  * @settings: a #GSettings object
27558  * @key: the name of a key
27559  *
27560  * Resets @key to its default value.
27561  *
27562  * This call resets the key, as much as possible, to its default value.
27563  * That might the value specified in the schema or the one set by the
27564  * administrator.
27565  */
27566
27567
27568 /**
27569  * g_settings_revert:
27570  * @settings: a #GSettings instance
27571  *
27572  * Reverts all non-applied changes to the settings.  This function
27573  * does nothing unless @settings is in 'delay-apply' mode; see
27574  * g_settings_delay().  In the normal case settings are always applied
27575  * immediately.
27576  *
27577  * Change notifications will be emitted for affected keys.
27578  */
27579
27580
27581 /**
27582  * g_settings_schema_get_id:
27583  * @schema: a #GSettingsSchema
27584  *
27585  * Get the ID of @schema.
27586  *
27587  * Returns: (transfer none): the ID
27588  */
27589
27590
27591 /**
27592  * g_settings_schema_get_path:
27593  * @schema: a #GSettingsSchema
27594  *
27595  * Gets the path associated with @schema, or %NULL.
27596  *
27597  * Schemas may be single-instance or relocatable.  Single-instance
27598  * schemas correspond to exactly one set of keys in the backend
27599  * database: those located at the path returned by this function.
27600  *
27601  * Relocatable schemas can be referenced by other schemas and can
27602  * threfore describe multiple sets of keys at different locations.  For
27603  * relocatable schemas, this function will return %NULL.
27604  *
27605  * Returns: (transfer none): the path of the schema, or %NULL
27606  * Since: 2.32
27607  */
27608
27609
27610 /**
27611  * g_settings_schema_ref:
27612  * @schema: a #GSettingsSchema
27613  *
27614  * Increase the reference count of @schema, returning a new reference.
27615  *
27616  * Returns: a new reference to @schema
27617  * Since: 2.32
27618  */
27619
27620
27621 /**
27622  * g_settings_schema_source_get_default:
27623  *
27624  * Gets the default system schema source.
27625  *
27626  * This function is not required for normal uses of #GSettings but it
27627  * may be useful to authors of plugin management systems or to those who
27628  * want to introspect the content of schemas.
27629  *
27630  * If no schemas are installed, %NULL will be returned.
27631  *
27632  * The returned source may actually consist of multiple schema sources
27633  * from different directories, depending on which directories were given
27634  * in <envar>XDG_DATA_DIRS</envar> and
27635  * <envar>GSETTINGS_SCHEMA_DIR</envar>.  For this reason, all lookups
27636  * performed against the default source should probably be done
27637  * recursively.
27638  *
27639  * Returns: (transfer none): the default schema source
27640  * Since: 2.32
27641  */
27642
27643
27644 /**
27645  * g_settings_schema_source_lookup:
27646  * @source: a #GSettingsSchemaSource
27647  * @schema_id: a schema ID
27648  * @recursive: %TRUE if the lookup should be recursive
27649  *
27650  * Looks up a schema with the identifier @schema_id in @source.
27651  *
27652  * This function is not required for normal uses of #GSettings but it
27653  * may be useful to authors of plugin management systems or to those who
27654  * want to introspect the content of schemas.
27655  *
27656  * If the schema isn't found directly in @source and @recursive is %TRUE
27657  * then the parent sources will also be checked.
27658  *
27659  * If the schema isn't found, %NULL is returned.
27660  *
27661  * Returns: (transfer full): a new #GSettingsSchema
27662  * Since: 2.32
27663  */
27664
27665
27666 /**
27667  * g_settings_schema_source_new_from_directory:
27668  * @directory: the filename of a directory
27669  * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27670  * @trusted: %TRUE, if the directory is trusted
27671  * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27672  *
27673  * Attempts to create a new schema source corresponding to the contents
27674  * of the given directory.
27675  *
27676  * This function is not required for normal uses of #GSettings but it
27677  * may be useful to authors of plugin management systems.
27678  *
27679  * The directory should contain a file called
27680  * <filename>gschemas.compiled</filename> as produced by
27681  * <command>glib-compile-schemas</command>.
27682  *
27683  * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27684  * trusted not to be corrupted.  This assumption has a performance
27685  * advantage, but can result in crashes or inconsistent behaviour in the
27686  * case of a corrupted file.  Generally, you should set @trusted to
27687  * %TRUE for files installed by the system and to %FALSE for files in
27688  * the home directory.
27689  *
27690  * If @parent is non-%NULL then there are two effects.
27691  *
27692  * First, if g_settings_schema_source_lookup() is called with the
27693  * @recursive flag set to %TRUE and the schema can not be found in the
27694  * source, the lookup will recurse to the parent.
27695  *
27696  * Second, any references to other schemas specified within this
27697  * source (ie: <literal>child</literal> or <literal>extends</literal>)
27698  * references may be resolved from the @parent.
27699  *
27700  * For this second reason, except in very unusual situations, the
27701  * @parent should probably be given as the default schema source, as
27702  * returned by g_settings_schema_source_get_default().
27703  *
27704  * Since: 2.32
27705  */
27706
27707
27708 /**
27709  * g_settings_schema_source_ref:
27710  * @source: a #GSettingsSchemaSource
27711  *
27712  * Increase the reference count of @source, returning a new reference.
27713  *
27714  * Returns: a new reference to @source
27715  * Since: 2.32
27716  */
27717
27718
27719 /**
27720  * g_settings_schema_source_unref:
27721  * @source: a #GSettingsSchemaSource
27722  *
27723  * Decrease the reference count of @source, possibly freeing it.
27724  *
27725  * Since: 2.32
27726  */
27727
27728
27729 /**
27730  * g_settings_schema_unref:
27731  * @schema: a #GSettingsSchema
27732  *
27733  * Decrease the reference count of @schema, possibly freeing it.
27734  *
27735  * Since: 2.32
27736  */
27737
27738
27739 /**
27740  * g_settings_set:
27741  * @settings: a #GSettings object
27742  * @key: the name of the key to set
27743  * @format: a #GVariant format string
27744  * @...: arguments as per @format
27745  *
27746  * Sets @key in @settings to @value.
27747  *
27748  * A convenience function that combines g_settings_set_value() with
27749  * g_variant_new().
27750  *
27751  * It is a programmer error to give a @key that isn't contained in the
27752  * schema for @settings or for the #GVariantType of @format to mismatch
27753  * the type given in the schema.
27754  *
27755  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27756  * Since: 2.26
27757  */
27758
27759
27760 /**
27761  * g_settings_set_boolean:
27762  * @settings: a #GSettings object
27763  * @key: the name of the key to set
27764  * @value: the value to set it to
27765  *
27766  * Sets @key in @settings to @value.
27767  *
27768  * A convenience variant of g_settings_set() for booleans.
27769  *
27770  * It is a programmer error to give a @key that isn't specified as
27771  * having a boolean type in the schema for @settings.
27772  *
27773  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27774  * Since: 2.26
27775  */
27776
27777
27778 /**
27779  * g_settings_set_double:
27780  * @settings: a #GSettings object
27781  * @key: the name of the key to set
27782  * @value: the value to set it to
27783  *
27784  * Sets @key in @settings to @value.
27785  *
27786  * A convenience variant of g_settings_set() for doubles.
27787  *
27788  * It is a programmer error to give a @key that isn't specified as
27789  * having a 'double' type in the schema for @settings.
27790  *
27791  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27792  * Since: 2.26
27793  */
27794
27795
27796 /**
27797  * g_settings_set_enum:
27798  * @settings: a #GSettings object
27799  * @key: a key, within @settings
27800  * @value: an enumerated value
27801  *
27802  * Looks up the enumerated type nick for @value and writes it to @key,
27803  * within @settings.
27804  *
27805  * It is a programmer error to give a @key that isn't contained in the
27806  * schema for @settings or is not marked as an enumerated type, or for
27807  * @value not to be a valid value for the named type.
27808  *
27809  * After performing the write, accessing @key directly with
27810  * g_settings_get_string() will return the 'nick' associated with
27811  * @value.
27812  *
27813  * Returns: %TRUE, if the set succeeds
27814  */
27815
27816
27817 /**
27818  * g_settings_set_flags:
27819  * @settings: a #GSettings object
27820  * @key: a key, within @settings
27821  * @value: a flags value
27822  *
27823  * Looks up the flags type nicks for the bits specified by @value, puts
27824  * them in an array of strings and writes the array to @key, within
27825  * @settings.
27826  *
27827  * It is a programmer error to give a @key that isn't contained in the
27828  * schema for @settings or is not marked as a flags type, or for @value
27829  * to contain any bits that are not value for the named type.
27830  *
27831  * After performing the write, accessing @key directly with
27832  * g_settings_get_strv() will return an array of 'nicks'; one for each
27833  * bit in @value.
27834  *
27835  * Returns: %TRUE, if the set succeeds
27836  */
27837
27838
27839 /**
27840  * g_settings_set_int:
27841  * @settings: a #GSettings object
27842  * @key: the name of the key to set
27843  * @value: the value to set it to
27844  *
27845  * Sets @key in @settings to @value.
27846  *
27847  * A convenience variant of g_settings_set() for 32-bit integers.
27848  *
27849  * It is a programmer error to give a @key that isn't specified as
27850  * having a int32 type in the schema for @settings.
27851  *
27852  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27853  * Since: 2.26
27854  */
27855
27856
27857 /**
27858  * g_settings_set_string:
27859  * @settings: a #GSettings object
27860  * @key: the name of the key to set
27861  * @value: the value to set it to
27862  *
27863  * Sets @key in @settings to @value.
27864  *
27865  * A convenience variant of g_settings_set() for strings.
27866  *
27867  * It is a programmer error to give a @key that isn't specified as
27868  * having a string type in the schema for @settings.
27869  *
27870  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27871  * Since: 2.26
27872  */
27873
27874
27875 /**
27876  * g_settings_set_strv:
27877  * @settings: a #GSettings object
27878  * @key: the name of the key to set
27879  * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27880  *
27881  * Sets @key in @settings to @value.
27882  *
27883  * A convenience variant of g_settings_set() for string arrays.  If
27884  * @value is %NULL, then @key is set to be the empty array.
27885  *
27886  * It is a programmer error to give a @key that isn't specified as
27887  * having an array of strings type in the schema for @settings.
27888  *
27889  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27890  * Since: 2.26
27891  */
27892
27893
27894 /**
27895  * g_settings_set_uint:
27896  * @settings: a #GSettings object
27897  * @key: the name of the key to set
27898  * @value: the value to set it to
27899  *
27900  * Sets @key in @settings to @value.
27901  *
27902  * A convenience variant of g_settings_set() for 32-bit unsigned
27903  * integers.
27904  *
27905  * It is a programmer error to give a @key that isn't specified as
27906  * having a uint32 type in the schema for @settings.
27907  *
27908  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27909  * Since: 2.30
27910  */
27911
27912
27913 /**
27914  * g_settings_set_value:
27915  * @settings: a #GSettings object
27916  * @key: the name of the key to set
27917  * @value: a #GVariant of the correct type
27918  *
27919  * Sets @key in @settings to @value.
27920  *
27921  * It is a programmer error to give a @key that isn't contained in the
27922  * schema for @settings or for @value to have the incorrect type, per
27923  * the schema.
27924  *
27925  * If @value is floating then this function consumes the reference.
27926  *
27927  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27928  * Since: 2.26
27929  */
27930
27931
27932 /**
27933  * g_settings_sync:
27934  *
27935  * Ensures that all pending operations for the given are complete for
27936  * the default backend.
27937  *
27938  * Writes made to a #GSettings are handled asynchronously.  For this
27939  * reason, it is very unlikely that the changes have it to disk by the
27940  * time g_settings_set() returns.
27941  *
27942  * This call will block until all of the writes have made it to the
27943  * backend.  Since the mainloop is not running, no change notifications
27944  * will be dispatched during this call (but some may be queued by the
27945  * time the call is done).
27946  */
27947
27948
27949 /**
27950  * g_settings_unbind:
27951  * @object: the object
27952  * @property: the property whose binding is removed
27953  *
27954  * Removes an existing binding for @property on @object.
27955  *
27956  * Note that bindings are automatically removed when the
27957  * object is finalized, so it is rarely necessary to call this
27958  * function.
27959  *
27960  * Since: 2.26
27961  */
27962
27963
27964 /**
27965  * g_simple_action_group_add_entries:
27966  * @simple: a #GSimpleActionGroup
27967  * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27968  * @n_entries: the length of @entries, or -1
27969  * @user_data: the user data for signal connections
27970  *
27971  * A convenience function for creating multiple #GSimpleAction instances
27972  * and adding them to the action group.
27973  *
27974  * Since: 2.30
27975  */
27976
27977
27978 /**
27979  * g_simple_action_group_insert:
27980  * @simple: a #GSimpleActionGroup
27981  * @action: a #GAction
27982  *
27983  * Adds an action to the action group.
27984  *
27985  * If the action group already contains an action with the same name as
27986  * @action then the old action is dropped from the group.
27987  *
27988  * The action group takes its own reference on @action.
27989  *
27990  * Since: 2.28
27991  */
27992
27993
27994 /**
27995  * g_simple_action_group_lookup:
27996  * @simple: a #GSimpleActionGroup
27997  * @action_name: the name of an action
27998  *
27999  * Looks up the action with the name @action_name in the group.
28000  *
28001  * If no such action exists, returns %NULL.
28002  *
28003  * Returns: (transfer none): a #GAction, or %NULL
28004  * Since: 2.28
28005  */
28006
28007
28008 /**
28009  * g_simple_action_group_new:
28010  *
28011  * Creates a new, empty, #GSimpleActionGroup.
28012  *
28013  * Returns: a new #GSimpleActionGroup
28014  * Since: 2.28
28015  */
28016
28017
28018 /**
28019  * g_simple_action_group_remove:
28020  * @simple: a #GSimpleActionGroup
28021  * @action_name: the name of the action
28022  *
28023  * Removes the named action from the action group.
28024  *
28025  * If no action of this name is in the group then nothing happens.
28026  *
28027  * Since: 2.28
28028  */
28029
28030
28031 /**
28032  * g_simple_action_new:
28033  * @name: the name of the action
28034  * @parameter_type: (allow-none): the type of parameter to the activate function
28035  *
28036  * Creates a new action.
28037  *
28038  * The created action is stateless.  See g_simple_action_new_stateful().
28039  *
28040  * Returns: a new #GSimpleAction
28041  * Since: 2.28
28042  */
28043
28044
28045 /**
28046  * g_simple_action_new_stateful:
28047  * @name: the name of the action
28048  * @parameter_type: (allow-none): the type of the parameter to the activate function
28049  * @state: the initial state of the action
28050  *
28051  * Creates a new stateful action.
28052  *
28053  * @state is the initial state of the action.  All future state values
28054  * must have the same #GVariantType as the initial state.
28055  *
28056  * If the @state GVariant is floating, it is consumed.
28057  *
28058  * Returns: a new #GSimpleAction
28059  * Since: 2.28
28060  */
28061
28062
28063 /**
28064  * g_simple_action_set_enabled:
28065  * @simple: a #GSimpleAction
28066  * @enabled: whether the action is enabled
28067  *
28068  * Sets the action as enabled or not.
28069  *
28070  * An action must be enabled in order to be activated or in order to
28071  * have its state changed from outside callers.
28072  *
28073  * This should only be called by the implementor of the action.  Users
28074  * of the action should not attempt to modify its enabled flag.
28075  *
28076  * Since: 2.28
28077  */
28078
28079
28080 /**
28081  * g_simple_action_set_state:
28082  * @simple: a #GSimpleAction
28083  * @value: the new #GVariant for the state
28084  *
28085  * Sets the state of the action.
28086  *
28087  * This directly updates the 'state' property to the given value.
28088  *
28089  * This should only be called by the implementor of the action.  Users
28090  * of the action should not attempt to directly modify the 'state'
28091  * property.  Instead, they should call g_action_change_state() to
28092  * request the change.
28093  *
28094  * Since: 2.30
28095  */
28096
28097
28098 /**
28099  * g_simple_async_report_error_in_idle: (skip)
28100  * @object: (allow-none): a #GObject, or %NULL.
28101  * @callback: a #GAsyncReadyCallback.
28102  * @user_data: user data passed to @callback.
28103  * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
28104  * @code: a specific error code.
28105  * @format: a formatted error reporting string.
28106  * @...: a list of variables to fill in @format.
28107  *
28108  * Reports an error in an asynchronous function in an idle function by
28109  * directly setting the contents of the #GAsyncResult with the given error
28110  * information.
28111  */
28112
28113
28114 /**
28115  * g_simple_async_report_gerror_in_idle:
28116  * @object: (allow-none): a #GObject, or %NULL
28117  * @callback: (scope async): a #GAsyncReadyCallback.
28118  * @user_data: (closure): user data passed to @callback.
28119  * @error: the #GError to report
28120  *
28121  * Reports an error in an idle function. Similar to
28122  * g_simple_async_report_error_in_idle(), but takes a #GError rather
28123  * than building a new one.
28124  */
28125
28126
28127 /**
28128  * g_simple_async_report_take_gerror_in_idle: (skip)
28129  * @object: (allow-none): a #GObject, or %NULL
28130  * @callback: a #GAsyncReadyCallback.
28131  * @user_data: user data passed to @callback.
28132  * @error: the #GError to report
28133  *
28134  * Reports an error in an idle function. Similar to
28135  * g_simple_async_report_gerror_in_idle(), but takes over the caller's
28136  * ownership of @error, so the caller does not have to free it any more.
28137  *
28138  * Since: 2.28
28139  */
28140
28141
28142 /**
28143  * g_simple_async_result_complete:
28144  * @simple: a #GSimpleAsyncResult.
28145  *
28146  * Completes an asynchronous I/O job immediately. Must be called in
28147  * the thread where the asynchronous result was to be delivered, as it
28148  * invokes the callback directly. If you are in a different thread use
28149  * g_simple_async_result_complete_in_idle().
28150  *
28151  * Calling this function takes a reference to @simple for as long as
28152  * is needed to complete the call.
28153  */
28154
28155
28156 /**
28157  * g_simple_async_result_complete_in_idle:
28158  * @simple: a #GSimpleAsyncResult.
28159  *
28160  * Completes an asynchronous function in an idle handler in the <link
28161  * linkend="g-main-context-push-thread-default">thread-default main
28162  * loop</link> of the thread that @simple was initially created in
28163  * (and re-pushes that context around the invocation of the callback).
28164  *
28165  * Calling this function takes a reference to @simple for as long as
28166  * is needed to complete the call.
28167  */
28168
28169
28170 /**
28171  * g_simple_async_result_get_op_res_gboolean:
28172  * @simple: a #GSimpleAsyncResult.
28173  *
28174  * Gets the operation result boolean from within the asynchronous result.
28175  *
28176  * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
28177  */
28178
28179
28180 /**
28181  * g_simple_async_result_get_op_res_gpointer: (skip)
28182  * @simple: a #GSimpleAsyncResult.
28183  *
28184  * Gets a pointer result as returned by the asynchronous function.
28185  *
28186  * Returns: a pointer from the result.
28187  */
28188
28189
28190 /**
28191  * g_simple_async_result_get_op_res_gssize:
28192  * @simple: a #GSimpleAsyncResult.
28193  *
28194  * Gets a gssize from the asynchronous result.
28195  *
28196  * Returns: a gssize returned from the asynchronous function.
28197  */
28198
28199
28200 /**
28201  * g_simple_async_result_get_source_tag: (skip)
28202  * @simple: a #GSimpleAsyncResult.
28203  *
28204  * Gets the source tag for the #GSimpleAsyncResult.
28205  *
28206  * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
28207  */
28208
28209
28210 /**
28211  * g_simple_async_result_is_valid:
28212  * @result: the #GAsyncResult passed to the _finish function.
28213  * @source: the #GObject passed to the _finish function.
28214  * @source_tag: the asynchronous function.
28215  *
28216  * Ensures that the data passed to the _finish function of an async
28217  * operation is consistent.  Three checks are performed.
28218  *
28219  * First, @result is checked to ensure that it is really a
28220  * #GSimpleAsyncResult.  Second, @source is checked to ensure that it
28221  * matches the source object of @result.  Third, @source_tag is
28222  * checked to ensure that it is either %NULL (as it is when the result was
28223  * created by g_simple_async_report_error_in_idle() or
28224  * g_simple_async_report_gerror_in_idle()) or equal to the
28225  * @source_tag argument given to g_simple_async_result_new() (which, by
28226  * convention, is a pointer to the _async function corresponding to the
28227  * _finish function from which this function is called).
28228  *
28229  * Returns: #TRUE if all checks passed or #FALSE if any failed.
28230  * Since: 2.20
28231  */
28232
28233
28234 /**
28235  * g_simple_async_result_new:
28236  * @source_object: (allow-none): a #GObject, or %NULL.
28237  * @callback: (scope async): a #GAsyncReadyCallback.
28238  * @user_data: (closure): user data passed to @callback.
28239  * @source_tag: the asynchronous function.
28240  *
28241  * Creates a #GSimpleAsyncResult.
28242  *
28243  * The common convention is to create the #GSimpleAsyncResult in the
28244  * function that starts the asynchronous operation and use that same
28245  * function as the @source_tag.
28246  *
28247  * If your operation supports cancellation with #GCancellable (which it
28248  * probably should) then you should provide the user's cancellable to
28249  * g_simple_async_result_set_check_cancellable() immediately after
28250  * this function returns.
28251  *
28252  * Returns: a #GSimpleAsyncResult.
28253  */
28254
28255
28256 /**
28257  * g_simple_async_result_new_error:
28258  * @source_object: (allow-none): a #GObject, or %NULL.
28259  * @callback: (scope async): a #GAsyncReadyCallback.
28260  * @user_data: (closure): user data passed to @callback.
28261  * @domain: a #GQuark.
28262  * @code: an error code.
28263  * @format: a string with format characters.
28264  * @...: a list of values to insert into @format.
28265  *
28266  * Creates a new #GSimpleAsyncResult with a set error.
28267  *
28268  * Returns: a #GSimpleAsyncResult.
28269  */
28270
28271
28272 /**
28273  * g_simple_async_result_new_from_error:
28274  * @source_object: (allow-none): a #GObject, or %NULL.
28275  * @callback: (scope async): a #GAsyncReadyCallback.
28276  * @user_data: (closure): user data passed to @callback.
28277  * @error: a #GError
28278  *
28279  * Creates a #GSimpleAsyncResult from an error condition.
28280  *
28281  * Returns: a #GSimpleAsyncResult.
28282  */
28283
28284
28285 /**
28286  * g_simple_async_result_new_take_error: (skip)
28287  * @source_object: (allow-none): a #GObject, or %NULL
28288  * @callback: (scope async): a #GAsyncReadyCallback
28289  * @user_data: (closure): user data passed to @callback
28290  * @error: a #GError
28291  *
28292  * Creates a #GSimpleAsyncResult from an error condition, and takes over the
28293  * caller's ownership of @error, so the caller does not need to free it anymore.
28294  *
28295  * Returns: a #GSimpleAsyncResult
28296  * Since: 2.28
28297  */
28298
28299
28300 /**
28301  * g_simple_async_result_propagate_error:
28302  * @simple: a #GSimpleAsyncResult.
28303  * @dest: (out): a location to propagate the error to.
28304  *
28305  * Propagates an error from within the simple asynchronous result to
28306  * a given destination.
28307  *
28308  * If the #GCancellable given to a prior call to
28309  * g_simple_async_result_set_check_cancellable() is cancelled then this
28310  * function will return %TRUE with @dest set appropriately.
28311  *
28312  * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
28313  */
28314
28315
28316 /**
28317  * g_simple_async_result_run_in_thread: (skip)
28318  * @simple: a #GSimpleAsyncResult.
28319  * @func: a #GSimpleAsyncThreadFunc.
28320  * @io_priority: the io priority of the request.
28321  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28322  *
28323  * Runs the asynchronous job in a separate thread and then calls
28324  * g_simple_async_result_complete_in_idle() on @simple to return
28325  * the result to the appropriate main loop.
28326  *
28327  * Calling this function takes a reference to @simple for as long as
28328  * is needed to run the job and report its completion.
28329  */
28330
28331
28332 /**
28333  * g_simple_async_result_set_check_cancellable:
28334  * @simple: a #GSimpleAsyncResult
28335  * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
28336  *
28337  * Sets a #GCancellable to check before dispatching results.
28338  *
28339  * This function has one very specific purpose: the provided cancellable
28340  * is checked at the time of g_simple_async_result_propagate_error() If
28341  * it is cancelled, these functions will return an "Operation was
28342  * cancelled" error (%G_IO_ERROR_CANCELLED).
28343  *
28344  * Implementors of cancellable asynchronous functions should use this in
28345  * order to provide a guarantee to their callers that cancelling an
28346  * async operation will reliably result in an error being returned for
28347  * that operation (even if a positive result for the operation has
28348  * already been sent as an idle to the main context to be dispatched).
28349  *
28350  * The checking described above is done regardless of any call to the
28351  * unrelated g_simple_async_result_set_handle_cancellation() function.
28352  *
28353  * Since: 2.32
28354  */
28355
28356
28357 /**
28358  * g_simple_async_result_set_error: (skip)
28359  * @simple: a #GSimpleAsyncResult.
28360  * @domain: a #GQuark (usually #G_IO_ERROR).
28361  * @code: an error code.
28362  * @format: a formatted error reporting string.
28363  * @...: a list of variables to fill in @format.
28364  *
28365  * Sets an error within the asynchronous result without a #GError.
28366  */
28367
28368
28369 /**
28370  * g_simple_async_result_set_error_va: (skip)
28371  * @simple: a #GSimpleAsyncResult.
28372  * @domain: a #GQuark (usually #G_IO_ERROR).
28373  * @code: an error code.
28374  * @format: a formatted error reporting string.
28375  * @args: va_list of arguments.
28376  *
28377  * Sets an error within the asynchronous result without a #GError.
28378  * Unless writing a binding, see g_simple_async_result_set_error().
28379  */
28380
28381
28382 /**
28383  * g_simple_async_result_set_from_error:
28384  * @simple: a #GSimpleAsyncResult.
28385  * @error: #GError.
28386  *
28387  * Sets the result from a #GError.
28388  */
28389
28390
28391 /**
28392  * g_simple_async_result_set_handle_cancellation:
28393  * @simple: a #GSimpleAsyncResult.
28394  * @handle_cancellation: a #gboolean.
28395  *
28396  * Sets whether to handle cancellation within the asynchronous operation.
28397  *
28398  * This function has nothing to do with
28399  * g_simple_async_result_set_check_cancellable().  It only refers to the
28400  * #GCancellable passed to g_simple_async_result_run_in_thread().
28401  */
28402
28403
28404 /**
28405  * g_simple_async_result_set_op_res_gboolean:
28406  * @simple: a #GSimpleAsyncResult.
28407  * @op_res: a #gboolean.
28408  *
28409  * Sets the operation result to a boolean within the asynchronous result.
28410  */
28411
28412
28413 /**
28414  * g_simple_async_result_set_op_res_gpointer: (skip)
28415  * @simple: a #GSimpleAsyncResult.
28416  * @op_res: a pointer result from an asynchronous function.
28417  * @destroy_op_res: a #GDestroyNotify function.
28418  *
28419  * Sets the operation result within the asynchronous result to a pointer.
28420  */
28421
28422
28423 /**
28424  * g_simple_async_result_set_op_res_gssize:
28425  * @simple: a #GSimpleAsyncResult.
28426  * @op_res: a #gssize.
28427  *
28428  * Sets the operation result within the asynchronous result to
28429  * the given @op_res.
28430  */
28431
28432
28433 /**
28434  * g_simple_async_result_take_error: (skip)
28435  * @simple: a #GSimpleAsyncResult
28436  * @error: a #GError
28437  *
28438  * Sets the result from @error, and takes over the caller's ownership
28439  * of @error, so the caller does not need to free it any more.
28440  *
28441  * Since: 2.28
28442  */
28443
28444
28445 /**
28446  * g_simple_permission_new:
28447  * @allowed: %TRUE if the action is allowed
28448  *
28449  * Creates a new #GPermission instance that represents an action that is
28450  * either always or never allowed.
28451  *
28452  * Returns: the #GSimplePermission, as a #GPermission
28453  * Since: 2.26
28454  */
28455
28456
28457 /**
28458  * g_socket_accept:
28459  * @socket: a #GSocket.
28460  * @cancellable: (allow-none): a %GCancellable or %NULL
28461  * @error: #GError for error reporting, or %NULL to ignore.
28462  *
28463  * Accept incoming connections on a connection-based socket. This removes
28464  * the first outstanding connection request from the listening socket and
28465  * creates a #GSocket object for it.
28466  *
28467  * The @socket must be bound to a local address with g_socket_bind() and
28468  * must be listening for incoming connections (g_socket_listen()).
28469  *
28470  * If there are no outstanding connections then the operation will block
28471  * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
28472  * To be notified of an incoming connection, wait for the %G_IO_IN condition.
28473  *
28474  * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
28475  * Since: 2.22
28476  */
28477
28478
28479 /**
28480  * g_socket_address_enumerator_next:
28481  * @enumerator: a #GSocketAddressEnumerator
28482  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28483  * @error: a #GError.
28484  *
28485  * Retrieves the next #GSocketAddress from @enumerator. Note that this
28486  * may block for some amount of time. (Eg, a #GNetworkAddress may need
28487  * to do a DNS lookup before it can return an address.) Use
28488  * g_socket_address_enumerator_next_async() if you need to avoid
28489  * blocking.
28490  *
28491  * If @enumerator is expected to yield addresses, but for some reason
28492  * is unable to (eg, because of a DNS error), then the first call to
28493  * g_socket_address_enumerator_next() will return an appropriate error
28494  * in *@error. However, if the first call to
28495  * g_socket_address_enumerator_next() succeeds, then any further
28496  * internal errors (other than @cancellable being triggered) will be
28497  * ignored.
28498  *
28499  * 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.
28500  */
28501
28502
28503 /**
28504  * g_socket_address_enumerator_next_async:
28505  * @enumerator: a #GSocketAddressEnumerator
28506  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28507  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
28508  * @user_data: (closure): the data to pass to callback function
28509  *
28510  * Asynchronously retrieves the next #GSocketAddress from @enumerator
28511  * and then calls @callback, which must call
28512  * g_socket_address_enumerator_next_finish() to get the result.
28513  */
28514
28515
28516 /**
28517  * g_socket_address_enumerator_next_finish:
28518  * @enumerator: a #GSocketAddressEnumerator
28519  * @result: a #GAsyncResult
28520  * @error: a #GError
28521  *
28522  * Retrieves the result of a completed call to
28523  * g_socket_address_enumerator_next_async(). See
28524  * g_socket_address_enumerator_next() for more information about
28525  * error handling.
28526  *
28527  * 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.
28528  */
28529
28530
28531 /**
28532  * g_socket_address_get_family:
28533  * @address: a #GSocketAddress
28534  *
28535  * Gets the socket family type of @address.
28536  *
28537  * Returns: the socket family type of @address.
28538  * Since: 2.22
28539  */
28540
28541
28542 /**
28543  * g_socket_address_get_native_size:
28544  * @address: a #GSocketAddress
28545  *
28546  * Gets the size of @address's native <type>struct sockaddr</type>.
28547  * You can use this to allocate memory to pass to
28548  * g_socket_address_to_native().
28549  *
28550  * Returns: the size of the native <type>struct sockaddr</type> that @address represents
28551  * Since: 2.22
28552  */
28553
28554
28555 /**
28556  * g_socket_address_new_from_native:
28557  * @native: a pointer to a <type>struct sockaddr</type>
28558  * @len: the size of the memory location pointed to by @native
28559  *
28560  * Creates a #GSocketAddress subclass corresponding to the native
28561  * <type>struct sockaddr</type> @native.
28562  *
28563  * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
28564  * Since: 2.22
28565  */
28566
28567
28568 /**
28569  * g_socket_address_to_native:
28570  * @address: a #GSocketAddress
28571  * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
28572  * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
28573  * @error: #GError for error reporting, or %NULL to ignore.
28574  *
28575  * Converts a #GSocketAddress to a native <type>struct
28576  * sockaddr</type>, which can be passed to low-level functions like
28577  * connect() or bind().
28578  *
28579  * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
28580  * returned. If the address type is not known on the system
28581  * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
28582  *
28583  * Returns: %TRUE if @dest was filled in, %FALSE on error
28584  * Since: 2.22
28585  */
28586
28587
28588 /**
28589  * g_socket_bind:
28590  * @socket: a #GSocket.
28591  * @address: a #GSocketAddress specifying the local address.
28592  * @allow_reuse: whether to allow reusing this address
28593  * @error: #GError for error reporting, or %NULL to ignore.
28594  *
28595  * When a socket is created it is attached to an address family, but it
28596  * doesn't have an address in this family. g_socket_bind() assigns the
28597  * address (sometimes called name) of the socket.
28598  *
28599  * It is generally required to bind to a local address before you can
28600  * receive connections. (See g_socket_listen() and g_socket_accept() ).
28601  * In certain situations, you may also want to bind a socket that will be
28602  * used to initiate connections, though this is not normally required.
28603  *
28604  * @allow_reuse should be %TRUE for server sockets (sockets that you will
28605  * eventually call g_socket_accept() on), and %FALSE for client sockets.
28606  * (Specifically, if it is %TRUE, then g_socket_bind() will set the
28607  * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
28608  * that address was previously used by another socket that has not yet been
28609  * fully cleaned-up by the kernel. Failing to set this flag on a server
28610  * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
28611  * the server program is stopped and then immediately restarted.)
28612  *
28613  * Returns: %TRUE on success, %FALSE on error.
28614  * Since: 2.22
28615  */
28616
28617
28618 /**
28619  * g_socket_check_connect_result:
28620  * @socket: a #GSocket
28621  * @error: #GError for error reporting, or %NULL to ignore.
28622  *
28623  * Checks and resets the pending connect error for the socket.
28624  * This is used to check for errors when g_socket_connect() is
28625  * used in non-blocking mode.
28626  *
28627  * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28628  * Since: 2.22
28629  */
28630
28631
28632 /**
28633  * g_socket_client_add_application_proxy:
28634  * @client: a #GSocketClient
28635  * @protocol: The proxy protocol
28636  *
28637  * Enable proxy protocols to be handled by the application. When the
28638  * indicated proxy protocol is returned by the #GProxyResolver,
28639  * #GSocketClient will consider this protocol as supported but will
28640  * not try to find a #GProxy instance to handle handshaking. The
28641  * application must check for this case by calling
28642  * g_socket_connection_get_remote_address() on the returned
28643  * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28644  * appropriate type, to determine whether or not it needs to handle
28645  * the proxy handshaking itself.
28646  *
28647  * This should be used for proxy protocols that are dialects of
28648  * another protocol such as HTTP proxy. It also allows cohabitation of
28649  * proxy protocols that are reused between protocols. A good example
28650  * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28651  * be use as generic socket proxy through the HTTP CONNECT method.
28652  *
28653  * When the proxy is detected as being an application proxy, TLS handshake
28654  * will be skipped. This is required to let the application do the proxy
28655  * specific handshake.
28656  */
28657
28658
28659 /**
28660  * g_socket_client_connect:
28661  * @client: a #GSocketClient.
28662  * @connectable: a #GSocketConnectable specifying the remote address.
28663  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28664  * @error: #GError for error reporting, or %NULL to ignore.
28665  *
28666  * Tries to resolve the @connectable and make a network connection to it.
28667  *
28668  * Upon a successful connection, a new #GSocketConnection is constructed
28669  * and returned.  The caller owns this new object and must drop their
28670  * reference to it when finished with it.
28671  *
28672  * The type of the #GSocketConnection object returned depends on the type of
28673  * the underlying socket that is used. For instance, for a TCP/IP connection
28674  * it will be a #GTcpConnection.
28675  *
28676  * The socket created will be the same family as the address that the
28677  * @connectable resolves to, unless family is set with g_socket_client_set_family()
28678  * or indirectly via g_socket_client_set_local_address(). The socket type
28679  * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28680  * g_socket_client_set_socket_type().
28681  *
28682  * If a local address is specified with g_socket_client_set_local_address() the
28683  * socket will be bound to this address before connecting.
28684  *
28685  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28686  * Since: 2.22
28687  */
28688
28689
28690 /**
28691  * g_socket_client_connect_async:
28692  * @client: a #GSocketClient
28693  * @connectable: a #GSocketConnectable specifying the remote address.
28694  * @cancellable: (allow-none): a #GCancellable, or %NULL
28695  * @callback: (scope async): a #GAsyncReadyCallback
28696  * @user_data: (closure): user data for the callback
28697  *
28698  * This is the asynchronous version of g_socket_client_connect().
28699  *
28700  * When the operation is finished @callback will be
28701  * called. You can then call g_socket_client_connect_finish() to get
28702  * the result of the operation.
28703  *
28704  * Since: 2.22
28705  */
28706
28707
28708 /**
28709  * g_socket_client_connect_finish:
28710  * @client: a #GSocketClient.
28711  * @result: a #GAsyncResult.
28712  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28713  *
28714  * Finishes an async connect operation. See g_socket_client_connect_async()
28715  *
28716  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28717  * Since: 2.22
28718  */
28719
28720
28721 /**
28722  * g_socket_client_connect_to_host:
28723  * @client: a #GSocketClient
28724  * @host_and_port: the name and optionally port of the host to connect to
28725  * @default_port: the default port to connect to
28726  * @cancellable: (allow-none): a #GCancellable, or %NULL
28727  * @error: a pointer to a #GError, or %NULL
28728  *
28729  * This is a helper function for g_socket_client_connect().
28730  *
28731  * Attempts to create a TCP connection to the named host.
28732  *
28733  * @host_and_port may be in any of a number of recognized formats; an IPv6
28734  * address, an IPv4 address, or a domain name (in which case a DNS
28735  * lookup is performed).  Quoting with [] is supported for all address
28736  * types.  A port override may be specified in the usual way with a
28737  * colon.  Ports may be given as decimal numbers or symbolic names (in
28738  * which case an /etc/services lookup is performed).
28739  *
28740  * If no port override is given in @host_and_port then @default_port will be
28741  * used as the port number to connect to.
28742  *
28743  * In general, @host_and_port is expected to be provided by the user (allowing
28744  * them to give the hostname, and a port override if necessary) and
28745  * @default_port is expected to be provided by the application.
28746  *
28747  * In the case that an IP address is given, a single connection
28748  * attempt is made.  In the case that a name is given, multiple
28749  * connection attempts may be made, in turn and according to the
28750  * number of address records in DNS, until a connection succeeds.
28751  *
28752  * Upon a successful connection, a new #GSocketConnection is constructed
28753  * and returned.  The caller owns this new object and must drop their
28754  * reference to it when finished with it.
28755  *
28756  * In the event of any failure (DNS error, service not found, no hosts
28757  * connectable) %NULL is returned and @error (if non-%NULL) is set
28758  * accordingly.
28759  *
28760  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28761  * Since: 2.22
28762  */
28763
28764
28765 /**
28766  * g_socket_client_connect_to_host_async:
28767  * @client: a #GSocketClient
28768  * @host_and_port: the name and optionally the port of the host to connect to
28769  * @default_port: the default port to connect to
28770  * @cancellable: (allow-none): a #GCancellable, or %NULL
28771  * @callback: (scope async): a #GAsyncReadyCallback
28772  * @user_data: (closure): user data for the callback
28773  *
28774  * This is the asynchronous version of g_socket_client_connect_to_host().
28775  *
28776  * When the operation is finished @callback will be
28777  * called. You can then call g_socket_client_connect_to_host_finish() to get
28778  * the result of the operation.
28779  *
28780  * Since: 2.22
28781  */
28782
28783
28784 /**
28785  * g_socket_client_connect_to_host_finish:
28786  * @client: a #GSocketClient.
28787  * @result: a #GAsyncResult.
28788  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28789  *
28790  * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28791  *
28792  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28793  * Since: 2.22
28794  */
28795
28796
28797 /**
28798  * g_socket_client_connect_to_service:
28799  * @client: a #GSocketConnection
28800  * @domain: a domain name
28801  * @service: the name of the service to connect to
28802  * @cancellable: (allow-none): a #GCancellable, or %NULL
28803  * @error: a pointer to a #GError, or %NULL
28804  *
28805  * Attempts to create a TCP connection to a service.
28806  *
28807  * This call looks up the SRV record for @service at @domain for the
28808  * "tcp" protocol.  It then attempts to connect, in turn, to each of
28809  * the hosts providing the service until either a connection succeeds
28810  * or there are no hosts remaining.
28811  *
28812  * Upon a successful connection, a new #GSocketConnection is constructed
28813  * and returned.  The caller owns this new object and must drop their
28814  * reference to it when finished with it.
28815  *
28816  * In the event of any failure (DNS error, service not found, no hosts
28817  * connectable) %NULL is returned and @error (if non-%NULL) is set
28818  * accordingly.
28819  *
28820  * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28821  */
28822
28823
28824 /**
28825  * g_socket_client_connect_to_service_async:
28826  * @client: a #GSocketClient
28827  * @domain: a domain name
28828  * @service: the name of the service to connect to
28829  * @cancellable: (allow-none): a #GCancellable, or %NULL
28830  * @callback: (scope async): a #GAsyncReadyCallback
28831  * @user_data: (closure): user data for the callback
28832  *
28833  * This is the asynchronous version of
28834  * g_socket_client_connect_to_service().
28835  *
28836  * Since: 2.22
28837  */
28838
28839
28840 /**
28841  * g_socket_client_connect_to_service_finish:
28842  * @client: a #GSocketClient.
28843  * @result: a #GAsyncResult.
28844  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28845  *
28846  * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28847  *
28848  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28849  * Since: 2.22
28850  */
28851
28852
28853 /**
28854  * g_socket_client_connect_to_uri:
28855  * @client: a #GSocketClient
28856  * @uri: A network URI
28857  * @default_port: the default port to connect to
28858  * @cancellable: (allow-none): a #GCancellable, or %NULL
28859  * @error: a pointer to a #GError, or %NULL
28860  *
28861  * This is a helper function for g_socket_client_connect().
28862  *
28863  * Attempts to create a TCP connection with a network URI.
28864  *
28865  * @uri may be any valid URI containing an "authority" (hostname/port)
28866  * component. If a port is not specified in the URI, @default_port
28867  * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28868  * (#GSocketClient does not know to automatically assume TLS for
28869  * certain URI schemes.)
28870  *
28871  * Using this rather than g_socket_client_connect() or
28872  * g_socket_client_connect_to_host() allows #GSocketClient to
28873  * determine when to use application-specific proxy protocols.
28874  *
28875  * Upon a successful connection, a new #GSocketConnection is constructed
28876  * and returned.  The caller owns this new object and must drop their
28877  * reference to it when finished with it.
28878  *
28879  * In the event of any failure (DNS error, service not found, no hosts
28880  * connectable) %NULL is returned and @error (if non-%NULL) is set
28881  * accordingly.
28882  *
28883  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28884  * Since: 2.26
28885  */
28886
28887
28888 /**
28889  * g_socket_client_connect_to_uri_async:
28890  * @client: a #GSocketClient
28891  * @uri: a network uri
28892  * @default_port: the default port to connect to
28893  * @cancellable: (allow-none): a #GCancellable, or %NULL
28894  * @callback: (scope async): a #GAsyncReadyCallback
28895  * @user_data: (closure): user data for the callback
28896  *
28897  * This is the asynchronous version of g_socket_client_connect_to_uri().
28898  *
28899  * When the operation is finished @callback will be
28900  * called. You can then call g_socket_client_connect_to_uri_finish() to get
28901  * the result of the operation.
28902  *
28903  * Since: 2.26
28904  */
28905
28906
28907 /**
28908  * g_socket_client_connect_to_uri_finish:
28909  * @client: a #GSocketClient.
28910  * @result: a #GAsyncResult.
28911  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28912  *
28913  * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28914  *
28915  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28916  * Since: 2.26
28917  */
28918
28919
28920 /**
28921  * g_socket_client_get_enable_proxy:
28922  * @client: a #GSocketClient.
28923  *
28924  * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28925  *
28926  * Returns: whether proxying is enabled
28927  * Since: 2.26
28928  */
28929
28930
28931 /**
28932  * g_socket_client_get_family:
28933  * @client: a #GSocketClient.
28934  *
28935  * Gets the socket family of the socket client.
28936  *
28937  * See g_socket_client_set_family() for details.
28938  *
28939  * Returns: a #GSocketFamily
28940  * Since: 2.22
28941  */
28942
28943
28944 /**
28945  * g_socket_client_get_local_address:
28946  * @client: a #GSocketClient.
28947  *
28948  * Gets the local address of the socket client.
28949  *
28950  * See g_socket_client_set_local_address() for details.
28951  *
28952  * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28953  * Since: 2.22
28954  */
28955
28956
28957 /**
28958  * g_socket_client_get_protocol:
28959  * @client: a #GSocketClient
28960  *
28961  * Gets the protocol name type of the socket client.
28962  *
28963  * See g_socket_client_set_protocol() for details.
28964  *
28965  * Returns: a #GSocketProtocol
28966  * Since: 2.22
28967  */
28968
28969
28970 /**
28971  * g_socket_client_get_socket_type:
28972  * @client: a #GSocketClient.
28973  *
28974  * Gets the socket type of the socket client.
28975  *
28976  * See g_socket_client_set_socket_type() for details.
28977  *
28978  * Returns: a #GSocketFamily
28979  * Since: 2.22
28980  */
28981
28982
28983 /**
28984  * g_socket_client_get_timeout:
28985  * @client: a #GSocketClient
28986  *
28987  * Gets the I/O timeout time for sockets created by @client.
28988  *
28989  * See g_socket_client_set_timeout() for details.
28990  *
28991  * Returns: the timeout in seconds
28992  * Since: 2.26
28993  */
28994
28995
28996 /**
28997  * g_socket_client_get_tls:
28998  * @client: a #GSocketClient.
28999  *
29000  * Gets whether @client creates TLS connections. See
29001  * g_socket_client_set_tls() for details.
29002  *
29003  * Returns: whether @client uses TLS
29004  * Since: 2.28
29005  */
29006
29007
29008 /**
29009  * g_socket_client_get_tls_validation_flags:
29010  * @client: a #GSocketClient.
29011  *
29012  * Gets the TLS validation flags used creating TLS connections via
29013  * @client.
29014  *
29015  * Returns: the TLS validation flags
29016  * Since: 2.28
29017  */
29018
29019
29020 /**
29021  * g_socket_client_new:
29022  *
29023  * Creates a new #GSocketClient with the default options.
29024  *
29025  * Returns: a #GSocketClient. Free the returned object with g_object_unref().
29026  * Since: 2.22
29027  */
29028
29029
29030 /**
29031  * g_socket_client_set_enable_proxy:
29032  * @client: a #GSocketClient.
29033  * @enable: whether to enable proxies
29034  *
29035  * Sets whether or not @client attempts to make connections via a
29036  * proxy server. When enabled (the default), #GSocketClient will use a
29037  * #GProxyResolver to determine if a proxy protocol such as SOCKS is
29038  * needed, and automatically do the necessary proxy negotiation.
29039  *
29040  * Since: 2.26
29041  */
29042
29043
29044 /**
29045  * g_socket_client_set_family:
29046  * @client: a #GSocketClient.
29047  * @family: a #GSocketFamily
29048  *
29049  * Sets the socket family of the socket client.
29050  * If this is set to something other than %G_SOCKET_FAMILY_INVALID
29051  * then the sockets created by this object will be of the specified
29052  * family.
29053  *
29054  * This might be useful for instance if you want to force the local
29055  * connection to be an ipv4 socket, even though the address might
29056  * be an ipv6 mapped to ipv4 address.
29057  *
29058  * Since: 2.22
29059  */
29060
29061
29062 /**
29063  * g_socket_client_set_local_address:
29064  * @client: a #GSocketClient.
29065  * @address: (allow-none): a #GSocketAddress, or %NULL
29066  *
29067  * Sets the local address of the socket client.
29068  * The sockets created by this object will bound to the
29069  * specified address (if not %NULL) before connecting.
29070  *
29071  * This is useful if you want to ensure that the local
29072  * side of the connection is on a specific port, or on
29073  * a specific interface.
29074  *
29075  * Since: 2.22
29076  */
29077
29078
29079 /**
29080  * g_socket_client_set_protocol:
29081  * @client: a #GSocketClient.
29082  * @protocol: a #GSocketProtocol
29083  *
29084  * Sets the protocol of the socket client.
29085  * The sockets created by this object will use of the specified
29086  * protocol.
29087  *
29088  * If @protocol is %0 that means to use the default
29089  * protocol for the socket family and type.
29090  *
29091  * Since: 2.22
29092  */
29093
29094
29095 /**
29096  * g_socket_client_set_socket_type:
29097  * @client: a #GSocketClient.
29098  * @type: a #GSocketType
29099  *
29100  * Sets the socket type of the socket client.
29101  * The sockets created by this object will be of the specified
29102  * type.
29103  *
29104  * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
29105  * as GSocketClient is used for connection oriented services.
29106  *
29107  * Since: 2.22
29108  */
29109
29110
29111 /**
29112  * g_socket_client_set_timeout:
29113  * @client: a #GSocketClient.
29114  * @timeout: the timeout
29115  *
29116  * Sets the I/O timeout for sockets created by @client. @timeout is a
29117  * time in seconds, or 0 for no timeout (the default).
29118  *
29119  * The timeout value affects the initial connection attempt as well,
29120  * so setting this may cause calls to g_socket_client_connect(), etc,
29121  * to fail with %G_IO_ERROR_TIMED_OUT.
29122  *
29123  * Since: 2.26
29124  */
29125
29126
29127 /**
29128  * g_socket_client_set_tls:
29129  * @client: a #GSocketClient.
29130  * @tls: whether to use TLS
29131  *
29132  * Sets whether @client creates TLS (aka SSL) connections. If @tls is
29133  * %TRUE, @client will wrap its connections in a #GTlsClientConnection
29134  * and perform a TLS handshake when connecting.
29135  *
29136  * Note that since #GSocketClient must return a #GSocketConnection,
29137  * but #GTlsClientConnection is not a #GSocketConnection, this
29138  * actually wraps the resulting #GTlsClientConnection in a
29139  * #GTcpWrapperConnection when returning it. You can use
29140  * g_tcp_wrapper_connection_get_base_io_stream() on the return value
29141  * to extract the #GTlsClientConnection.
29142  *
29143  * If you need to modify the behavior of the TLS handshake (eg, by
29144  * setting a client-side certificate to use, or connecting to the
29145  * #GTlsConnection::accept-certificate signal), you can connect to
29146  * @client's #GSocketClient::event signal and wait for it to be
29147  * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
29148  * a chance to see the #GTlsClientConnection before the handshake
29149  * starts.
29150  *
29151  * Since: 2.28
29152  */
29153
29154
29155 /**
29156  * g_socket_client_set_tls_validation_flags:
29157  * @client: a #GSocketClient.
29158  * @flags: the validation flags
29159  *
29160  * Sets the TLS validation flags used when creating TLS connections
29161  * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
29162  *
29163  * Since: 2.28
29164  */
29165
29166
29167 /**
29168  * g_socket_close:
29169  * @socket: a #GSocket
29170  * @error: #GError for error reporting, or %NULL to ignore.
29171  *
29172  * Closes the socket, shutting down any active connection.
29173  *
29174  * Closing a socket does not wait for all outstanding I/O operations
29175  * to finish, so the caller should not rely on them to be guaranteed
29176  * to complete even if the close returns with no error.
29177  *
29178  * Once the socket is closed, all other operations will return
29179  * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
29180  * return an error.
29181  *
29182  * Sockets will be automatically closed when the last reference
29183  * is dropped, but you might want to call this function to make sure
29184  * resources are released as early as possible.
29185  *
29186  * Beware that due to the way that TCP works, it is possible for
29187  * recently-sent data to be lost if either you close a socket while the
29188  * %G_IO_IN condition is set, or else if the remote connection tries to
29189  * send something to you after you close the socket but before it has
29190  * finished reading all of the data you sent. There is no easy generic
29191  * way to avoid this problem; the easiest fix is to design the network
29192  * protocol such that the client will never send data "out of turn".
29193  * Another solution is for the server to half-close the connection by
29194  * calling g_socket_shutdown() with only the @shutdown_write flag set,
29195  * and then wait for the client to notice this and close its side of the
29196  * connection, after which the server can safely call g_socket_close().
29197  * (This is what #GTcpConnection does if you call
29198  * g_tcp_connection_set_graceful_disconnect(). But of course, this
29199  * only works if the client will close its connection after the server
29200  * does.)
29201  *
29202  * Returns: %TRUE on success, %FALSE on error
29203  * Since: 2.22
29204  */
29205
29206
29207 /**
29208  * g_socket_condition_check:
29209  * @socket: a #GSocket
29210  * @condition: a #GIOCondition mask to check
29211  *
29212  * Checks on the readiness of @socket to perform operations.
29213  * The operations specified in @condition are checked for and masked
29214  * against the currently-satisfied conditions on @socket. The result
29215  * is returned.
29216  *
29217  * Note that on Windows, it is possible for an operation to return
29218  * %G_IO_ERROR_WOULD_BLOCK even immediately after
29219  * g_socket_condition_check() has claimed that the socket is ready for
29220  * writing. Rather than calling g_socket_condition_check() and then
29221  * writing to the socket if it succeeds, it is generally better to
29222  * simply try writing to the socket right away, and try again later if
29223  * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
29224  *
29225  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
29226  * these conditions will always be set in the output if they are true.
29227  *
29228  * This call never blocks.
29229  *
29230  * Returns: the @GIOCondition mask of the current state
29231  * Since: 2.22
29232  */
29233
29234
29235 /**
29236  * g_socket_condition_timed_wait:
29237  * @socket: a #GSocket
29238  * @condition: a #GIOCondition mask to wait for
29239  * @timeout: the maximum time (in microseconds) to wait, or -1
29240  * @cancellable: (allow-none): a #GCancellable, or %NULL
29241  * @error: a #GError pointer, or %NULL
29242  *
29243  * Waits for up to @timeout microseconds for @condition to become true
29244  * on @socket. If the condition is met, %TRUE is returned.
29245  *
29246  * If @cancellable is cancelled before the condition is met, or if
29247  * @timeout (or the socket's #GSocket:timeout) is reached before the
29248  * condition is met, then %FALSE is returned and @error, if non-%NULL,
29249  * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
29250  * %G_IO_ERROR_TIMED_OUT).
29251  *
29252  * If you don't want a timeout, use g_socket_condition_wait().
29253  * (Alternatively, you can pass -1 for @timeout.)
29254  *
29255  * Note that although @timeout is in microseconds for consistency with
29256  * other GLib APIs, this function actually only has millisecond
29257  * resolution, and the behavior is undefined if @timeout is not an
29258  * exact number of milliseconds.
29259  *
29260  * Returns: %TRUE if the condition was met, %FALSE otherwise
29261  * Since: 2.32
29262  */
29263
29264
29265 /**
29266  * g_socket_condition_wait:
29267  * @socket: a #GSocket
29268  * @condition: a #GIOCondition mask to wait for
29269  * @cancellable: (allow-none): a #GCancellable, or %NULL
29270  * @error: a #GError pointer, or %NULL
29271  *
29272  * Waits for @condition to become true on @socket. When the condition
29273  * is met, %TRUE is returned.
29274  *
29275  * If @cancellable is cancelled before the condition is met, or if the
29276  * socket has a timeout set and it is reached before the condition is
29277  * met, then %FALSE is returned and @error, if non-%NULL, is set to
29278  * the appropriate value (%G_IO_ERROR_CANCELLED or
29279  * %G_IO_ERROR_TIMED_OUT).
29280  *
29281  * See also g_socket_condition_timed_wait().
29282  *
29283  * Returns: %TRUE if the condition was met, %FALSE otherwise
29284  * Since: 2.22
29285  */
29286
29287
29288 /**
29289  * g_socket_connect:
29290  * @socket: a #GSocket.
29291  * @address: a #GSocketAddress specifying the remote address.
29292  * @cancellable: (allow-none): a %GCancellable or %NULL
29293  * @error: #GError for error reporting, or %NULL to ignore.
29294  *
29295  * Connect the socket to the specified remote address.
29296  *
29297  * For connection oriented socket this generally means we attempt to make
29298  * a connection to the @address. For a connection-less socket it sets
29299  * the default address for g_socket_send() and discards all incoming datagrams
29300  * from other sources.
29301  *
29302  * Generally connection oriented sockets can only connect once, but
29303  * connection-less sockets can connect multiple times to change the
29304  * default address.
29305  *
29306  * If the connect call needs to do network I/O it will block, unless
29307  * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
29308  * and the user can be notified of the connection finishing by waiting
29309  * for the G_IO_OUT condition. The result of the connection must then be
29310  * checked with g_socket_check_connect_result().
29311  *
29312  * Returns: %TRUE if connected, %FALSE on error.
29313  * Since: 2.22
29314  */
29315
29316
29317 /**
29318  * g_socket_connectable_enumerate:
29319  * @connectable: a #GSocketConnectable
29320  *
29321  * Creates a #GSocketAddressEnumerator for @connectable.
29322  *
29323  * Returns: (transfer full): a new #GSocketAddressEnumerator.
29324  * Since: 2.22
29325  */
29326
29327
29328 /**
29329  * g_socket_connectable_proxy_enumerate:
29330  * @connectable: a #GSocketConnectable
29331  *
29332  * Creates a #GSocketAddressEnumerator for @connectable that will
29333  * return #GProxyAddress<!-- -->es for addresses that you must connect
29334  * to via a proxy.
29335  *
29336  * If @connectable does not implement
29337  * g_socket_connectable_proxy_enumerate(), this will fall back to
29338  * calling g_socket_connectable_enumerate().
29339  *
29340  * Returns: (transfer full): a new #GSocketAddressEnumerator.
29341  * Since: 2.26
29342  */
29343
29344
29345 /**
29346  * g_socket_connection_connect:
29347  * @connection: a #GSocketConnection
29348  * @address: a #GSocketAddress specifying the remote address.
29349  * @cancellable: (allow-none): a %GCancellable or %NULL
29350  * @error: #GError for error reporting, or %NULL to ignore.
29351  *
29352  * Connect @connection to the specified remote address.
29353  *
29354  * Returns: %TRUE if the connection succeeded, %FALSE on error
29355  * Since: 2.32
29356  */
29357
29358
29359 /**
29360  * g_socket_connection_connect_async:
29361  * @connection: a #GSocketConnection
29362  * @address: a #GSocketAddress specifying the remote address.
29363  * @cancellable: (allow-none): a %GCancellable or %NULL
29364  * @callback: (scope async): a #GAsyncReadyCallback
29365  * @user_data: (closure): user data for the callback
29366  *
29367  * Asynchronously connect @connection to the specified remote address.
29368  *
29369  * This clears the #GSocket:blocking flag on @connection's underlying
29370  * socket if it is currently set.
29371  *
29372  * Use g_socket_connection_connect_finish() to retrieve the result.
29373  *
29374  * Since: 2.32
29375  */
29376
29377
29378 /**
29379  * g_socket_connection_connect_finish:
29380  * @connection: a #GSocketConnection
29381  * @result: the #GAsyncResult
29382  * @error: #GError for error reporting, or %NULL to ignore.
29383  *
29384  * Gets the result of a g_socket_connection_connect_async() call.
29385  *
29386  * Returns: %TRUE if the connection succeeded, %FALSE on error
29387  * Since: 2.32
29388  */
29389
29390
29391 /**
29392  * g_socket_connection_factory_create_connection:
29393  * @socket: a #GSocket
29394  *
29395  * Creates a #GSocketConnection subclass of the right type for
29396  * @socket.
29397  *
29398  * Returns: (transfer full): a #GSocketConnection
29399  * Since: 2.22
29400  */
29401
29402
29403 /**
29404  * g_socket_connection_factory_lookup_type:
29405  * @family: a #GSocketFamily
29406  * @type: a #GSocketType
29407  * @protocol_id: a protocol id
29408  *
29409  * Looks up the #GType to be used when creating socket connections on
29410  * sockets with the specified @family, @type and @protocol_id.
29411  *
29412  * If no type is registered, the #GSocketConnection base type is returned.
29413  *
29414  * Returns: a #GType
29415  * Since: 2.22
29416  */
29417
29418
29419 /**
29420  * g_socket_connection_factory_register_type:
29421  * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
29422  * @family: a #GSocketFamily
29423  * @type: a #GSocketType
29424  * @protocol: a protocol id
29425  *
29426  * Looks up the #GType to be used when creating socket connections on
29427  * sockets with the specified @family, @type and @protocol.
29428  *
29429  * If no type is registered, the #GSocketConnection base type is returned.
29430  *
29431  * Since: 2.22
29432  */
29433
29434
29435 /**
29436  * g_socket_connection_get_local_address:
29437  * @connection: a #GSocketConnection
29438  * @error: #GError for error reporting, or %NULL to ignore.
29439  *
29440  * Try to get the local address of a socket connection.
29441  *
29442  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29443  * Since: 2.22
29444  */
29445
29446
29447 /**
29448  * g_socket_connection_get_remote_address:
29449  * @connection: a #GSocketConnection
29450  * @error: #GError for error reporting, or %NULL to ignore.
29451  *
29452  * Try to get the remote address of a socket connection.
29453  *
29454  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29455  * Since: 2.22
29456  */
29457
29458
29459 /**
29460  * g_socket_connection_get_socket:
29461  * @connection: a #GSocketConnection
29462  *
29463  * Gets the underlying #GSocket object of the connection.
29464  * This can be useful if you want to do something unusual on it
29465  * not supported by the #GSocketConnection APIs.
29466  *
29467  * Returns: (transfer none): a #GSocketAddress or %NULL on error.
29468  * Since: 2.22
29469  */
29470
29471
29472 /**
29473  * g_socket_connection_is_connected:
29474  * @connection: a #GSocketConnection
29475  *
29476  * Checks if @connection is connected. This is equivalent to calling
29477  * g_socket_is_connected() on @connection's underlying #GSocket.
29478  *
29479  * Returns: whether @connection is connected
29480  * Since: 2.32
29481  */
29482
29483
29484 /**
29485  * g_socket_control_message_deserialize:
29486  * @level: a socket level
29487  * @type: a socket control message type for the given @level
29488  * @size: the size of the data in bytes
29489  * @data: (array length=size) (element-type guint8): pointer to the message data
29490  *
29491  * Tries to deserialize a socket control message of a given
29492  * @level and @type. This will ask all known (to GType) subclasses
29493  * of #GSocketControlMessage if they can understand this kind
29494  * of message and if so deserialize it into a #GSocketControlMessage.
29495  *
29496  * If there is no implementation for this kind of control message, %NULL
29497  * will be returned.
29498  *
29499  * Returns: (transfer full): the deserialized message or %NULL
29500  * Since: 2.22
29501  */
29502
29503
29504 /**
29505  * g_socket_control_message_get_level:
29506  * @message: a #GSocketControlMessage
29507  *
29508  * Returns the "level" (i.e. the originating protocol) of the control message.
29509  * This is often SOL_SOCKET.
29510  *
29511  * Returns: an integer describing the level
29512  * Since: 2.22
29513  */
29514
29515
29516 /**
29517  * g_socket_control_message_get_msg_type:
29518  * @message: a #GSocketControlMessage
29519  *
29520  * Returns the protocol specific type of the control message.
29521  * For instance, for UNIX fd passing this would be SCM_RIGHTS.
29522  *
29523  * Returns: an integer describing the type of control message
29524  * Since: 2.22
29525  */
29526
29527
29528 /**
29529  * g_socket_control_message_get_size:
29530  * @message: a #GSocketControlMessage
29531  *
29532  * Returns the space required for the control message, not including
29533  * headers or alignment.
29534  *
29535  * Returns: The number of bytes required.
29536  * Since: 2.22
29537  */
29538
29539
29540 /**
29541  * g_socket_control_message_serialize:
29542  * @message: a #GSocketControlMessage
29543  * @data: A buffer to write data to
29544  *
29545  * Converts the data in the message to bytes placed in the
29546  * message.
29547  *
29548  * @data is guaranteed to have enough space to fit the size
29549  * returned by g_socket_control_message_get_size() on this
29550  * object.
29551  *
29552  * Since: 2.22
29553  */
29554
29555
29556 /**
29557  * g_socket_create_source: (skip)
29558  * @socket: a #GSocket
29559  * @condition: a #GIOCondition mask to monitor
29560  * @cancellable: (allow-none): a %GCancellable or %NULL
29561  *
29562  * Creates a %GSource that can be attached to a %GMainContext to monitor
29563  * for the availibility of the specified @condition on the socket.
29564  *
29565  * The callback on the source is of the #GSocketSourceFunc type.
29566  *
29567  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
29568  * these conditions will always be reported output if they are true.
29569  *
29570  * @cancellable if not %NULL can be used to cancel the source, which will
29571  * cause the source to trigger, reporting the current condition (which
29572  * is likely 0 unless cancellation happened at the same time as a
29573  * condition change). You can check for this in the callback using
29574  * g_cancellable_is_cancelled().
29575  *
29576  * If @socket has a timeout set, and it is reached before @condition
29577  * occurs, the source will then trigger anyway, reporting %G_IO_IN or
29578  * %G_IO_OUT depending on @condition. However, @socket will have been
29579  * marked as having had a timeout, and so the next #GSocket I/O method
29580  * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
29581  *
29582  * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
29583  * Since: 2.22
29584  */
29585
29586
29587 /**
29588  * g_socket_get_available_bytes:
29589  * @socket: a #GSocket
29590  *
29591  * Get the amount of data pending in the OS input buffer.
29592  *
29593  * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
29594  * Since: 2.32
29595  */
29596
29597
29598 /**
29599  * g_socket_get_blocking:
29600  * @socket: a #GSocket.
29601  *
29602  * Gets the blocking mode of the socket. For details on blocking I/O,
29603  * see g_socket_set_blocking().
29604  *
29605  * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29606  * Since: 2.22
29607  */
29608
29609
29610 /**
29611  * g_socket_get_broadcast:
29612  * @socket: a #GSocket.
29613  *
29614  * Gets the broadcast setting on @socket; if %TRUE,
29615  * it is possible to send packets to broadcast
29616  * addresses or receive from broadcast addresses.
29617  *
29618  * Returns: the broadcast setting on @socket
29619  * Since: 2.32
29620  */
29621
29622
29623 /**
29624  * g_socket_get_credentials:
29625  * @socket: a #GSocket.
29626  * @error: #GError for error reporting, or %NULL to ignore.
29627  *
29628  * Returns the credentials of the foreign process connected to this
29629  * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29630  * sockets).
29631  *
29632  * If this operation isn't supported on the OS, the method fails with
29633  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29634  * by reading the %SO_PEERCRED option on the underlying socket.
29635  *
29636  * Other ways to obtain credentials from a foreign peer includes the
29637  * #GUnixCredentialsMessage type and
29638  * g_unix_connection_send_credentials() /
29639  * g_unix_connection_receive_credentials() functions.
29640  *
29641  * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29642  * Since: 2.26
29643  */
29644
29645
29646 /**
29647  * g_socket_get_family:
29648  * @socket: a #GSocket.
29649  *
29650  * Gets the socket family of the socket.
29651  *
29652  * Returns: a #GSocketFamily
29653  * Since: 2.22
29654  */
29655
29656
29657 /**
29658  * g_socket_get_fd:
29659  * @socket: a #GSocket.
29660  *
29661  * Returns the underlying OS socket object. On unix this
29662  * is a socket file descriptor, and on Windows this is
29663  * a Winsock2 SOCKET handle. This may be useful for
29664  * doing platform specific or otherwise unusual operations
29665  * on the socket.
29666  *
29667  * Returns: the file descriptor of the socket.
29668  * Since: 2.22
29669  */
29670
29671
29672 /**
29673  * g_socket_get_keepalive:
29674  * @socket: a #GSocket.
29675  *
29676  * Gets the keepalive mode of the socket. For details on this,
29677  * see g_socket_set_keepalive().
29678  *
29679  * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29680  * Since: 2.22
29681  */
29682
29683
29684 /**
29685  * g_socket_get_listen_backlog:
29686  * @socket: a #GSocket.
29687  *
29688  * Gets the listen backlog setting of the socket. For details on this,
29689  * see g_socket_set_listen_backlog().
29690  *
29691  * Returns: the maximum number of pending connections.
29692  * Since: 2.22
29693  */
29694
29695
29696 /**
29697  * g_socket_get_local_address:
29698  * @socket: a #GSocket.
29699  * @error: #GError for error reporting, or %NULL to ignore.
29700  *
29701  * Try to get the local address of a bound socket. This is only
29702  * useful if the socket has been bound to a local address,
29703  * either explicitly or implicitly when connecting.
29704  *
29705  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29706  * Since: 2.22
29707  */
29708
29709
29710 /**
29711  * g_socket_get_multicast_loopback:
29712  * @socket: a #GSocket.
29713  *
29714  * Gets the multicast loopback setting on @socket; if %TRUE (the
29715  * default), outgoing multicast packets will be looped back to
29716  * multicast listeners on the same host.
29717  *
29718  * Returns: the multicast loopback setting on @socket
29719  * Since: 2.32
29720  */
29721
29722
29723 /**
29724  * g_socket_get_multicast_ttl:
29725  * @socket: a #GSocket.
29726  *
29727  * Gets the multicast time-to-live setting on @socket; see
29728  * g_socket_set_multicast_ttl() for more details.
29729  *
29730  * Returns: the multicast time-to-live setting on @socket
29731  * Since: 2.32
29732  */
29733
29734
29735 /**
29736  * g_socket_get_protocol:
29737  * @socket: a #GSocket.
29738  *
29739  * Gets the socket protocol id the socket was created with.
29740  * In case the protocol is unknown, -1 is returned.
29741  *
29742  * Returns: a protocol id, or -1 if unknown
29743  * Since: 2.22
29744  */
29745
29746
29747 /**
29748  * g_socket_get_remote_address:
29749  * @socket: a #GSocket.
29750  * @error: #GError for error reporting, or %NULL to ignore.
29751  *
29752  * Try to get the remove address of a connected socket. This is only
29753  * useful for connection oriented sockets that have been connected.
29754  *
29755  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29756  * Since: 2.22
29757  */
29758
29759
29760 /**
29761  * g_socket_get_socket_type:
29762  * @socket: a #GSocket.
29763  *
29764  * Gets the socket type of the socket.
29765  *
29766  * Returns: a #GSocketType
29767  * Since: 2.22
29768  */
29769
29770
29771 /**
29772  * g_socket_get_timeout:
29773  * @socket: a #GSocket.
29774  *
29775  * Gets the timeout setting of the socket. For details on this, see
29776  * g_socket_set_timeout().
29777  *
29778  * Returns: the timeout in seconds
29779  * Since: 2.26
29780  */
29781
29782
29783 /**
29784  * g_socket_get_ttl:
29785  * @socket: a #GSocket.
29786  *
29787  * Gets the unicast time-to-live setting on @socket; see
29788  * g_socket_set_ttl() for more details.
29789  *
29790  * Returns: the time-to-live setting on @socket
29791  * Since: 2.32
29792  */
29793
29794
29795 /**
29796  * g_socket_is_closed:
29797  * @socket: a #GSocket
29798  *
29799  * Checks whether a socket is closed.
29800  *
29801  * Returns: %TRUE if socket is closed, %FALSE otherwise
29802  * Since: 2.22
29803  */
29804
29805
29806 /**
29807  * g_socket_is_connected:
29808  * @socket: a #GSocket.
29809  *
29810  * Check whether the socket is connected. This is only useful for
29811  * connection-oriented sockets.
29812  *
29813  * Returns: %TRUE if socket is connected, %FALSE otherwise.
29814  * Since: 2.22
29815  */
29816
29817
29818 /**
29819  * g_socket_join_multicast_group:
29820  * @socket: a #GSocket.
29821  * @group: a #GInetAddress specifying the group address to join.
29822  * @iface: (allow-none): Name of the interface to use, or %NULL
29823  * @source_specific: %TRUE if source-specific multicast should be used
29824  * @error: #GError for error reporting, or %NULL to ignore.
29825  *
29826  * Registers @socket to receive multicast messages sent to @group.
29827  * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29828  * been bound to an appropriate interface and port with
29829  * g_socket_bind().
29830  *
29831  * If @iface is %NULL, the system will automatically pick an interface
29832  * to bind to based on @group.
29833  *
29834  * If @source_specific is %TRUE, source-specific multicast as defined
29835  * in RFC 4604 is used. Note that on older platforms this may fail
29836  * with a %G_IO_ERROR_NOT_SUPPORTED error.
29837  *
29838  * Returns: %TRUE on success, %FALSE on error.
29839  * Since: 2.32
29840  */
29841
29842
29843 /**
29844  * g_socket_leave_multicast_group:
29845  * @socket: a #GSocket.
29846  * @group: a #GInetAddress specifying the group address to leave.
29847  * @iface: (allow-none): Interface used
29848  * @source_specific: %TRUE if source-specific multicast was used
29849  * @error: #GError for error reporting, or %NULL to ignore.
29850  *
29851  * Removes @socket from the multicast group defined by @group, @iface,
29852  * and @source_specific (which must all have the same values they had
29853  * when you joined the group).
29854  *
29855  * @socket remains bound to its address and port, and can still receive
29856  * unicast messages after calling this.
29857  *
29858  * Returns: %TRUE on success, %FALSE on error.
29859  * Since: 2.32
29860  */
29861
29862
29863 /**
29864  * g_socket_listen:
29865  * @socket: a #GSocket.
29866  * @error: #GError for error reporting, or %NULL to ignore.
29867  *
29868  * Marks the socket as a server socket, i.e. a socket that is used
29869  * to accept incoming requests using g_socket_accept().
29870  *
29871  * Before calling this the socket must be bound to a local address using
29872  * g_socket_bind().
29873  *
29874  * To set the maximum amount of outstanding clients, use
29875  * g_socket_set_listen_backlog().
29876  *
29877  * Returns: %TRUE on success, %FALSE on error.
29878  * Since: 2.22
29879  */
29880
29881
29882 /**
29883  * g_socket_listener_accept:
29884  * @listener: a #GSocketListener
29885  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29886  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29887  * @error: #GError for error reporting, or %NULL to ignore.
29888  *
29889  * Blocks waiting for a client to connect to any of the sockets added
29890  * to the listener. Returns a #GSocketConnection for the socket that was
29891  * accepted.
29892  *
29893  * If @source_object is not %NULL it will be filled out with the source
29894  * object specified when the corresponding socket or address was added
29895  * to the listener.
29896  *
29897  * If @cancellable is not %NULL, then the operation can be cancelled by
29898  * triggering the cancellable object from another thread. If the operation
29899  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29900  *
29901  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29902  * Since: 2.22
29903  */
29904
29905
29906 /**
29907  * g_socket_listener_accept_async:
29908  * @listener: a #GSocketListener
29909  * @cancellable: (allow-none): a #GCancellable, or %NULL
29910  * @callback: (scope async): a #GAsyncReadyCallback
29911  * @user_data: (closure): user data for the callback
29912  *
29913  * This is the asynchronous version of g_socket_listener_accept().
29914  *
29915  * When the operation is finished @callback will be
29916  * called. You can then call g_socket_listener_accept_socket()
29917  * to get the result of the operation.
29918  *
29919  * Since: 2.22
29920  */
29921
29922
29923 /**
29924  * g_socket_listener_accept_finish:
29925  * @listener: a #GSocketListener
29926  * @result: a #GAsyncResult.
29927  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29928  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29929  *
29930  * Finishes an async accept operation. See g_socket_listener_accept_async()
29931  *
29932  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29933  * Since: 2.22
29934  */
29935
29936
29937 /**
29938  * g_socket_listener_accept_socket:
29939  * @listener: a #GSocketListener
29940  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29941  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29942  * @error: #GError for error reporting, or %NULL to ignore.
29943  *
29944  * Blocks waiting for a client to connect to any of the sockets added
29945  * to the listener. Returns the #GSocket that was accepted.
29946  *
29947  * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29948  * which is often the case, then you should use g_socket_listener_accept()
29949  * instead.
29950  *
29951  * If @source_object is not %NULL it will be filled out with the source
29952  * object specified when the corresponding socket or address was added
29953  * to the listener.
29954  *
29955  * If @cancellable is not %NULL, then the operation can be cancelled by
29956  * triggering the cancellable object from another thread. If the operation
29957  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29958  *
29959  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29960  * Since: 2.22
29961  */
29962
29963
29964 /**
29965  * g_socket_listener_accept_socket_async:
29966  * @listener: a #GSocketListener
29967  * @cancellable: (allow-none): a #GCancellable, or %NULL
29968  * @callback: (scope async): a #GAsyncReadyCallback
29969  * @user_data: (closure): user data for the callback
29970  *
29971  * This is the asynchronous version of g_socket_listener_accept_socket().
29972  *
29973  * When the operation is finished @callback will be
29974  * called. You can then call g_socket_listener_accept_socket_finish()
29975  * to get the result of the operation.
29976  *
29977  * Since: 2.22
29978  */
29979
29980
29981 /**
29982  * g_socket_listener_accept_socket_finish:
29983  * @listener: a #GSocketListener
29984  * @result: a #GAsyncResult.
29985  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29986  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29987  *
29988  * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29989  *
29990  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29991  * Since: 2.22
29992  */
29993
29994
29995 /**
29996  * g_socket_listener_add_address:
29997  * @listener: a #GSocketListener
29998  * @address: a #GSocketAddress
29999  * @type: a #GSocketType
30000  * @protocol: a #GSocketProtocol
30001  * @source_object: (allow-none): Optional #GObject identifying this source
30002  * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
30003  * @error: #GError for error reporting, or %NULL to ignore.
30004  *
30005  * Creates a socket of type @type and protocol @protocol, binds
30006  * it to @address and adds it to the set of sockets we're accepting
30007  * sockets from.
30008  *
30009  * Note that adding an IPv6 address, depending on the platform,
30010  * may or may not result in a listener that also accepts IPv4
30011  * connections.  For more deterministic behavior, see
30012  * g_socket_listener_add_inet_port().
30013  *
30014  * @source_object will be passed out in the various calls
30015  * to accept to identify this particular source, which is
30016  * useful if you're listening on multiple addresses and do
30017  * different things depending on what address is connected to.
30018  *
30019  * If successful and @effective_address is non-%NULL then it will
30020  * be set to the address that the binding actually occurred at.  This
30021  * is helpful for determining the port number that was used for when
30022  * requesting a binding to port 0 (ie: "any port").  This address, if
30023  * requested, belongs to the caller and must be freed.
30024  *
30025  * Returns: %TRUE on success, %FALSE on error.
30026  * Since: 2.22
30027  */
30028
30029
30030 /**
30031  * g_socket_listener_add_any_inet_port:
30032  * @listener: a #GSocketListener
30033  * @source_object: (allow-none): Optional #GObject identifying this source
30034  * @error: a #GError location to store the error occurring, or %NULL to ignore.
30035  *
30036  * Listens for TCP connections on any available port number for both
30037  * IPv6 and IPv4 (if each is available).
30038  *
30039  * This is useful if you need to have a socket for incoming connections
30040  * but don't care about the specific port number.
30041  *
30042  * @source_object will be passed out in the various calls
30043  * to accept to identify this particular source, which is
30044  * useful if you're listening on multiple addresses and do
30045  * different things depending on what address is connected to.
30046  *
30047  * Returns: the port number, or 0 in case of failure.
30048  * Since: 2.24
30049  */
30050
30051
30052 /**
30053  * g_socket_listener_add_inet_port:
30054  * @listener: a #GSocketListener
30055  * @port: an IP port number (non-zero)
30056  * @source_object: (allow-none): Optional #GObject identifying this source
30057  * @error: #GError for error reporting, or %NULL to ignore.
30058  *
30059  * Helper function for g_socket_listener_add_address() that
30060  * creates a TCP/IP socket listening on IPv4 and IPv6 (if
30061  * supported) on the specified port on all interfaces.
30062  *
30063  * @source_object will be passed out in the various calls
30064  * to accept to identify this particular source, which is
30065  * useful if you're listening on multiple addresses and do
30066  * different things depending on what address is connected to.
30067  *
30068  * Returns: %TRUE on success, %FALSE on error.
30069  * Since: 2.22
30070  */
30071
30072
30073 /**
30074  * g_socket_listener_add_socket:
30075  * @listener: a #GSocketListener
30076  * @socket: a listening #GSocket
30077  * @source_object: (allow-none): Optional #GObject identifying this source
30078  * @error: #GError for error reporting, or %NULL to ignore.
30079  *
30080  * Adds @socket to the set of sockets that we try to accept
30081  * new clients from. The socket must be bound to a local
30082  * address and listened to.
30083  *
30084  * @source_object will be passed out in the various calls
30085  * to accept to identify this particular source, which is
30086  * useful if you're listening on multiple addresses and do
30087  * different things depending on what address is connected to.
30088  *
30089  * Returns: %TRUE on success, %FALSE on error.
30090  * Since: 2.22
30091  */
30092
30093
30094 /**
30095  * g_socket_listener_close:
30096  * @listener: a #GSocketListener
30097  *
30098  * Closes all the sockets in the listener.
30099  *
30100  * Since: 2.22
30101  */
30102
30103
30104 /**
30105  * g_socket_listener_new:
30106  *
30107  * Creates a new #GSocketListener with no sockets to listen for.
30108  * New listeners can be added with e.g. g_socket_listener_add_address()
30109  * or g_socket_listener_add_inet_port().
30110  *
30111  * Returns: a new #GSocketListener.
30112  * Since: 2.22
30113  */
30114
30115
30116 /**
30117  * g_socket_listener_set_backlog:
30118  * @listener: a #GSocketListener
30119  * @listen_backlog: an integer
30120  *
30121  * Sets the listen backlog on the sockets in the listener.
30122  *
30123  * See g_socket_set_listen_backlog() for details
30124  *
30125  * Since: 2.22
30126  */
30127
30128
30129 /**
30130  * g_socket_new:
30131  * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
30132  * @type: the socket type to use.
30133  * @protocol: the id of the protocol to use, or 0 for default.
30134  * @error: #GError for error reporting, or %NULL to ignore.
30135  *
30136  * Creates a new #GSocket with the defined family, type and protocol.
30137  * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
30138  * for the family and type is used.
30139  *
30140  * The @protocol is a family and type specific int that specifies what
30141  * kind of protocol to use. #GSocketProtocol lists several common ones.
30142  * Many families only support one protocol, and use 0 for this, others
30143  * support several and using 0 means to use the default protocol for
30144  * the family and type.
30145  *
30146  * The protocol id is passed directly to the operating
30147  * system, so you can use protocols not listed in #GSocketProtocol if you
30148  * know the protocol number used for it.
30149  *
30150  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
30151  * Since: 2.22
30152  */
30153
30154
30155 /**
30156  * g_socket_new_from_fd:
30157  * @fd: a native socket file descriptor.
30158  * @error: #GError for error reporting, or %NULL to ignore.
30159  *
30160  * Creates a new #GSocket from a native file descriptor
30161  * or winsock SOCKET handle.
30162  *
30163  * This reads all the settings from the file descriptor so that
30164  * all properties should work. Note that the file descriptor
30165  * will be set to non-blocking mode, independent on the blocking
30166  * mode of the #GSocket.
30167  *
30168  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
30169  * Since: 2.22
30170  */
30171
30172
30173 /**
30174  * g_socket_receive:
30175  * @socket: a #GSocket
30176  * @buffer: a buffer to read data into (which should be at least @size bytes long).
30177  * @size: the number of bytes you want to read from the socket
30178  * @cancellable: (allow-none): a %GCancellable or %NULL
30179  * @error: #GError for error reporting, or %NULL to ignore.
30180  *
30181  * Receive data (up to @size bytes) from a socket. This is mainly used by
30182  * connection-oriented sockets; it is identical to g_socket_receive_from()
30183  * with @address set to %NULL.
30184  *
30185  * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
30186  * g_socket_receive() will always read either 0 or 1 complete messages from
30187  * the socket. If the received message is too large to fit in @buffer, then
30188  * the data beyond @size bytes will be discarded, without any explicit
30189  * indication that this has occurred.
30190  *
30191  * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
30192  * number of bytes, up to @size. If more than @size bytes have been
30193  * received, the additional data will be returned in future calls to
30194  * g_socket_receive().
30195  *
30196  * If the socket is in blocking mode the call will block until there
30197  * is some data to receive, the connection is closed, or there is an
30198  * error. If there is no data available and the socket is in
30199  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30200  * returned. To be notified when data is available, wait for the
30201  * %G_IO_IN condition.
30202  *
30203  * On error -1 is returned and @error is set accordingly.
30204  *
30205  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30206  * Since: 2.22
30207  */
30208
30209
30210 /**
30211  * g_socket_receive_from:
30212  * @socket: a #GSocket
30213  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30214  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
30215  * @size: the number of bytes you want to read from the socket
30216  * @cancellable: (allow-none): a %GCancellable or %NULL
30217  * @error: #GError for error reporting, or %NULL to ignore.
30218  *
30219  * Receive data (up to @size bytes) from a socket.
30220  *
30221  * If @address is non-%NULL then @address will be set equal to the
30222  * source address of the received packet.
30223  * @address is owned by the caller.
30224  *
30225  * See g_socket_receive() for additional information.
30226  *
30227  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30228  * Since: 2.22
30229  */
30230
30231
30232 /**
30233  * g_socket_receive_message:
30234  * @socket: a #GSocket
30235  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30236  * @vectors: (array length=num_vectors): an array of #GInputVector structs
30237  * @num_vectors: the number of elements in @vectors, or -1
30238  * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
30239  * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
30240  * @flags: a pointer to an int containing #GSocketMsgFlags flags
30241  * @cancellable: (allow-none): a %GCancellable or %NULL
30242  * @error: a #GError pointer, or %NULL
30243  *
30244  * Receive data from a socket.  This is the most complicated and
30245  * fully-featured version of this call. For easier use, see
30246  * g_socket_receive() and g_socket_receive_from().
30247  *
30248  * If @address is non-%NULL then @address will be set equal to the
30249  * source address of the received packet.
30250  * @address is owned by the caller.
30251  *
30252  * @vector must point to an array of #GInputVector structs and
30253  * @num_vectors must be the length of this array.  These structs
30254  * describe the buffers that received data will be scattered into.
30255  * If @num_vectors is -1, then @vectors is assumed to be terminated
30256  * by a #GInputVector with a %NULL buffer pointer.
30257  *
30258  * As a special case, if @num_vectors is 0 (in which case, @vectors
30259  * may of course be %NULL), then a single byte is received and
30260  * discarded. This is to facilitate the common practice of sending a
30261  * single '\0' byte for the purposes of transferring ancillary data.
30262  *
30263  * @messages, if non-%NULL, will be set to point to a newly-allocated
30264  * array of #GSocketControlMessage instances or %NULL if no such
30265  * messages was received. These correspond to the control messages
30266  * received from the kernel, one #GSocketControlMessage per message
30267  * from the kernel. This array is %NULL-terminated and must be freed
30268  * by the caller using g_free() after calling g_object_unref() on each
30269  * element. If @messages is %NULL, any control messages received will
30270  * be discarded.
30271  *
30272  * @num_messages, if non-%NULL, will be set to the number of control
30273  * messages received.
30274  *
30275  * If both @messages and @num_messages are non-%NULL, then
30276  * @num_messages gives the number of #GSocketControlMessage instances
30277  * in @messages (ie: not including the %NULL terminator).
30278  *
30279  * @flags is an in/out parameter. The commonly available arguments
30280  * for this are available in the #GSocketMsgFlags enum, but the
30281  * values there are the same as the system values, and the flags
30282  * are passed in as-is, so you can pass in system-specific flags too
30283  * (and g_socket_receive_message() may pass system-specific flags out).
30284  *
30285  * As with g_socket_receive(), data may be discarded if @socket is
30286  * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
30287  * provide enough buffer space to read a complete message. You can pass
30288  * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
30289  * removing it from the receive queue, but there is no portable way to find
30290  * out the length of the message other than by reading it into a
30291  * sufficiently-large buffer.
30292  *
30293  * If the socket is in blocking mode the call will block until there
30294  * is some data to receive, the connection is closed, or there is an
30295  * error. If there is no data available and the socket is in
30296  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30297  * returned. To be notified when data is available, wait for the
30298  * %G_IO_IN condition.
30299  *
30300  * On error -1 is returned and @error is set accordingly.
30301  *
30302  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30303  * Since: 2.22
30304  */
30305
30306
30307 /**
30308  * g_socket_receive_with_blocking:
30309  * @socket: a #GSocket
30310  * @buffer: a buffer to read data into (which should be at least @size bytes long).
30311  * @size: the number of bytes you want to read from the socket
30312  * @blocking: whether to do blocking or non-blocking I/O
30313  * @cancellable: (allow-none): a %GCancellable or %NULL
30314  * @error: #GError for error reporting, or %NULL to ignore.
30315  *
30316  * This behaves exactly the same as g_socket_receive(), except that
30317  * the choice of blocking or non-blocking behavior is determined by
30318  * the @blocking argument rather than by @socket's properties.
30319  *
30320  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30321  * Since: 2.26
30322  */
30323
30324
30325 /**
30326  * g_socket_send:
30327  * @socket: a #GSocket
30328  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30329  * @size: the number of bytes to send
30330  * @cancellable: (allow-none): a %GCancellable or %NULL
30331  * @error: #GError for error reporting, or %NULL to ignore.
30332  *
30333  * Tries to send @size bytes from @buffer on the socket. This is
30334  * mainly used by connection-oriented sockets; it is identical to
30335  * g_socket_send_to() with @address set to %NULL.
30336  *
30337  * If the socket is in blocking mode the call will block until there is
30338  * space for the data in the socket queue. If there is no space available
30339  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30340  * will be returned. To be notified when space is available, wait for the
30341  * %G_IO_OUT condition. Note though that you may still receive
30342  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30343  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30344  * very common due to the way the underlying APIs work.)
30345  *
30346  * On error -1 is returned and @error is set accordingly.
30347  *
30348  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30349  * Since: 2.22
30350  */
30351
30352
30353 /**
30354  * g_socket_send_message:
30355  * @socket: a #GSocket
30356  * @address: (allow-none): a #GSocketAddress, or %NULL
30357  * @vectors: (array length=num_vectors): an array of #GOutputVector structs
30358  * @num_vectors: the number of elements in @vectors, or -1
30359  * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
30360  * @num_messages: number of elements in @messages, or -1.
30361  * @flags: an int containing #GSocketMsgFlags flags
30362  * @cancellable: (allow-none): a %GCancellable or %NULL
30363  * @error: #GError for error reporting, or %NULL to ignore.
30364  *
30365  * Send data to @address on @socket.  This is the most complicated and
30366  * fully-featured version of this call. For easier use, see
30367  * g_socket_send() and g_socket_send_to().
30368  *
30369  * If @address is %NULL then the message is sent to the default receiver
30370  * (set by g_socket_connect()).
30371  *
30372  * @vectors must point to an array of #GOutputVector structs and
30373  * @num_vectors must be the length of this array. (If @num_vectors is -1,
30374  * then @vectors is assumed to be terminated by a #GOutputVector with a
30375  * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
30376  * that the sent data will be gathered from. Using multiple
30377  * #GOutputVector<!-- -->s is more memory-efficient than manually copying
30378  * data from multiple sources into a single buffer, and more
30379  * network-efficient than making multiple calls to g_socket_send().
30380  *
30381  * @messages, if non-%NULL, is taken to point to an array of @num_messages
30382  * #GSocketControlMessage instances. These correspond to the control
30383  * messages to be sent on the socket.
30384  * If @num_messages is -1 then @messages is treated as a %NULL-terminated
30385  * array.
30386  *
30387  * @flags modify how the message is sent. The commonly available arguments
30388  * for this are available in the #GSocketMsgFlags enum, but the
30389  * values there are the same as the system values, and the flags
30390  * are passed in as-is, so you can pass in system-specific flags too.
30391  *
30392  * If the socket is in blocking mode the call will block until there is
30393  * space for the data in the socket queue. If there is no space available
30394  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30395  * will be returned. To be notified when space is available, wait for the
30396  * %G_IO_OUT condition. Note though that you may still receive
30397  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30398  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30399  * very common due to the way the underlying APIs work.)
30400  *
30401  * On error -1 is returned and @error is set accordingly.
30402  *
30403  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30404  * Since: 2.22
30405  */
30406
30407
30408 /**
30409  * g_socket_send_to:
30410  * @socket: a #GSocket
30411  * @address: (allow-none): a #GSocketAddress, or %NULL
30412  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30413  * @size: the number of bytes to send
30414  * @cancellable: (allow-none): a %GCancellable or %NULL
30415  * @error: #GError for error reporting, or %NULL to ignore.
30416  *
30417  * Tries to send @size bytes from @buffer to @address. If @address is
30418  * %NULL then the message is sent to the default receiver (set by
30419  * g_socket_connect()).
30420  *
30421  * See g_socket_send() for additional information.
30422  *
30423  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30424  * Since: 2.22
30425  */
30426
30427
30428 /**
30429  * g_socket_send_with_blocking:
30430  * @socket: a #GSocket
30431  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30432  * @size: the number of bytes to send
30433  * @blocking: whether to do blocking or non-blocking I/O
30434  * @cancellable: (allow-none): a %GCancellable or %NULL
30435  * @error: #GError for error reporting, or %NULL to ignore.
30436  *
30437  * This behaves exactly the same as g_socket_send(), except that
30438  * the choice of blocking or non-blocking behavior is determined by
30439  * the @blocking argument rather than by @socket's properties.
30440  *
30441  * Returns: Number of bytes written (which may be less than @size), or -1 on error
30442  * Since: 2.26
30443  */
30444
30445
30446 /**
30447  * g_socket_service_is_active:
30448  * @service: a #GSocketService
30449  *
30450  * Check whether the service is active or not. An active
30451  * service will accept new clients that connect, while
30452  * a non-active service will let connecting clients queue
30453  * up until the service is started.
30454  *
30455  * Returns: %TRUE if the service is active, %FALSE otherwise
30456  * Since: 2.22
30457  */
30458
30459
30460 /**
30461  * g_socket_service_new:
30462  *
30463  * Creates a new #GSocketService with no sockets to listen for.
30464  * New listeners can be added with e.g. g_socket_listener_add_address()
30465  * or g_socket_listener_add_inet_port().
30466  *
30467  * Returns: a new #GSocketService.
30468  * Since: 2.22
30469  */
30470
30471
30472 /**
30473  * g_socket_service_start:
30474  * @service: a #GSocketService
30475  *
30476  * Starts the service, i.e. start accepting connections
30477  * from the added sockets when the mainloop runs.
30478  *
30479  * This call is thread-safe, so it may be called from a thread
30480  * handling an incoming client request.
30481  *
30482  * Since: 2.22
30483  */
30484
30485
30486 /**
30487  * g_socket_service_stop:
30488  * @service: a #GSocketService
30489  *
30490  * Stops the service, i.e. stops accepting connections
30491  * from the added sockets when the mainloop runs.
30492  *
30493  * This call is thread-safe, so it may be called from a thread
30494  * handling an incoming client request.
30495  *
30496  * Since: 2.22
30497  */
30498
30499
30500 /**
30501  * g_socket_set_blocking:
30502  * @socket: a #GSocket.
30503  * @blocking: Whether to use blocking I/O or not.
30504  *
30505  * Sets the blocking mode of the socket. In blocking mode
30506  * all operations block until they succeed or there is an error. In
30507  * non-blocking mode all functions return results immediately or
30508  * with a %G_IO_ERROR_WOULD_BLOCK error.
30509  *
30510  * All sockets are created in blocking mode. However, note that the
30511  * platform level socket is always non-blocking, and blocking mode
30512  * is a GSocket level feature.
30513  *
30514  * Since: 2.22
30515  */
30516
30517
30518 /**
30519  * g_socket_set_broadcast:
30520  * @socket: a #GSocket.
30521  * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
30522  *
30523  * Sets whether @socket should allow sending to and receiving from
30524  * broadcast addresses. This is %FALSE by default.
30525  *
30526  * Since: 2.32
30527  */
30528
30529
30530 /**
30531  * g_socket_set_keepalive:
30532  * @socket: a #GSocket.
30533  * @keepalive: Value for the keepalive flag
30534  *
30535  * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
30536  * this flag is set on a socket, the system will attempt to verify that the
30537  * remote socket endpoint is still present if a sufficiently long period of
30538  * time passes with no data being exchanged. If the system is unable to
30539  * verify the presence of the remote endpoint, it will automatically close
30540  * the connection.
30541  *
30542  * This option is only functional on certain kinds of sockets. (Notably,
30543  * %G_SOCKET_PROTOCOL_TCP sockets.)
30544  *
30545  * The exact time between pings is system- and protocol-dependent, but will
30546  * normally be at least two hours. Most commonly, you would set this flag
30547  * on a server socket if you want to allow clients to remain idle for long
30548  * periods of time, but also want to ensure that connections are eventually
30549  * garbage-collected if clients crash or become unreachable.
30550  *
30551  * Since: 2.22
30552  */
30553
30554
30555 /**
30556  * g_socket_set_listen_backlog:
30557  * @socket: a #GSocket.
30558  * @backlog: the maximum number of pending connections.
30559  *
30560  * Sets the maximum number of outstanding connections allowed
30561  * when listening on this socket. If more clients than this are
30562  * connecting to the socket and the application is not handling them
30563  * on time then the new connections will be refused.
30564  *
30565  * Note that this must be called before g_socket_listen() and has no
30566  * effect if called after that.
30567  *
30568  * Since: 2.22
30569  */
30570
30571
30572 /**
30573  * g_socket_set_multicast_loopback:
30574  * @socket: a #GSocket.
30575  * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
30576  *
30577  * Sets whether outgoing multicast packets will be received by sockets
30578  * listening on that multicast address on the same host. This is %TRUE
30579  * by default.
30580  *
30581  * Since: 2.32
30582  */
30583
30584
30585 /**
30586  * g_socket_set_multicast_ttl:
30587  * @socket: a #GSocket.
30588  * @ttl: the time-to-live value for all multicast datagrams on @socket
30589  *
30590  * Sets the time-to-live for outgoing multicast datagrams on @socket.
30591  * By default, this is 1, meaning that multicast packets will not leave
30592  * the local network.
30593  *
30594  * Since: 2.32
30595  */
30596
30597
30598 /**
30599  * g_socket_set_timeout:
30600  * @socket: a #GSocket.
30601  * @timeout: the timeout for @socket, in seconds, or 0 for none
30602  *
30603  * Sets the time in seconds after which I/O operations on @socket will
30604  * time out if they have not yet completed.
30605  *
30606  * On a blocking socket, this means that any blocking #GSocket
30607  * operation will time out after @timeout seconds of inactivity,
30608  * returning %G_IO_ERROR_TIMED_OUT.
30609  *
30610  * On a non-blocking socket, calls to g_socket_condition_wait() will
30611  * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30612  * created with g_socket_create_source() will trigger after
30613  * @timeout seconds of inactivity, with the requested condition
30614  * set, at which point calling g_socket_receive(), g_socket_send(),
30615  * g_socket_check_connect_result(), etc, will fail with
30616  * %G_IO_ERROR_TIMED_OUT.
30617  *
30618  * If @timeout is 0 (the default), operations will never time out
30619  * on their own.
30620  *
30621  * Note that if an I/O operation is interrupted by a signal, this may
30622  * cause the timeout to be reset.
30623  *
30624  * Since: 2.26
30625  */
30626
30627
30628 /**
30629  * g_socket_set_ttl:
30630  * @socket: a #GSocket.
30631  * @ttl: the time-to-live value for all unicast packets on @socket
30632  *
30633  * Sets the time-to-live for outgoing unicast packets on @socket.
30634  * By default the platform-specific default value is used.
30635  *
30636  * Since: 2.32
30637  */
30638
30639
30640 /**
30641  * g_socket_shutdown:
30642  * @socket: a #GSocket
30643  * @shutdown_read: whether to shut down the read side
30644  * @shutdown_write: whether to shut down the write side
30645  * @error: #GError for error reporting, or %NULL to ignore.
30646  *
30647  * Shut down part of a full-duplex connection.
30648  *
30649  * If @shutdown_read is %TRUE then the receiving side of the connection
30650  * is shut down, and further reading is disallowed.
30651  *
30652  * If @shutdown_write is %TRUE then the sending side of the connection
30653  * is shut down, and further writing is disallowed.
30654  *
30655  * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30656  *
30657  * One example where this is used is graceful disconnect for TCP connections
30658  * where you close the sending side, then wait for the other side to close
30659  * the connection, thus ensuring that the other side saw all sent data.
30660  *
30661  * Returns: %TRUE on success, %FALSE on error
30662  * Since: 2.22
30663  */
30664
30665
30666 /**
30667  * g_socket_speaks_ipv4:
30668  * @socket: a #GSocket
30669  *
30670  * Checks if a socket is capable of speaking IPv4.
30671  *
30672  * IPv4 sockets are capable of speaking IPv4.  On some operating systems
30673  * and under some combinations of circumstances IPv6 sockets are also
30674  * capable of speaking IPv4.  See RFC 3493 section 3.7 for more
30675  * information.
30676  *
30677  * No other types of sockets are currently considered as being capable
30678  * of speaking IPv4.
30679  *
30680  * Returns: %TRUE if this socket can be used with IPv4.
30681  * Since: 2.22
30682  */
30683
30684
30685 /**
30686  * g_srv_target_copy:
30687  * @target: a #GSrvTarget
30688  *
30689  * Copies @target
30690  *
30691  * Returns: a copy of @target
30692  * Since: 2.22
30693  */
30694
30695
30696 /**
30697  * g_srv_target_free:
30698  * @target: a #GSrvTarget
30699  *
30700  * Frees @target
30701  *
30702  * Since: 2.22
30703  */
30704
30705
30706 /**
30707  * g_srv_target_get_hostname:
30708  * @target: a #GSrvTarget
30709  *
30710  * Gets @target's hostname (in ASCII form; if you are going to present
30711  * this to the user, you should use g_hostname_is_ascii_encoded() to
30712  * check if it contains encoded Unicode segments, and use
30713  * g_hostname_to_unicode() to convert it if it does.)
30714  *
30715  * Returns: @target's hostname
30716  * Since: 2.22
30717  */
30718
30719
30720 /**
30721  * g_srv_target_get_port:
30722  * @target: a #GSrvTarget
30723  *
30724  * Gets @target's port
30725  *
30726  * Returns: @target's port
30727  * Since: 2.22
30728  */
30729
30730
30731 /**
30732  * g_srv_target_get_priority:
30733  * @target: a #GSrvTarget
30734  *
30735  * Gets @target's priority. You should not need to look at this;
30736  * #GResolver already sorts the targets according to the algorithm in
30737  * RFC 2782.
30738  *
30739  * Returns: @target's priority
30740  * Since: 2.22
30741  */
30742
30743
30744 /**
30745  * g_srv_target_get_weight:
30746  * @target: a #GSrvTarget
30747  *
30748  * Gets @target's weight. You should not need to look at this;
30749  * #GResolver already sorts the targets according to the algorithm in
30750  * RFC 2782.
30751  *
30752  * Returns: @target's weight
30753  * Since: 2.22
30754  */
30755
30756
30757 /**
30758  * g_srv_target_list_sort: (skip)
30759  * @targets: a #GList of #GSrvTarget
30760  *
30761  * Sorts @targets in place according to the algorithm in RFC 2782.
30762  *
30763  * Returns: (transfer full): the head of the sorted list.
30764  * Since: 2.22
30765  */
30766
30767
30768 /**
30769  * g_srv_target_new:
30770  * @hostname: the host that the service is running on
30771  * @port: the port that the service is running on
30772  * @priority: the target's priority
30773  * @weight: the target's weight
30774  *
30775  * Creates a new #GSrvTarget with the given parameters.
30776  *
30777  * You should not need to use this; normally #GSrvTarget<!-- -->s are
30778  * created by #GResolver.
30779  *
30780  * Returns: a new #GSrvTarget.
30781  * Since: 2.22
30782  */
30783
30784
30785 /**
30786  * g_static_resource_fini:
30787  * @static_resource: pointer to a static #GStaticResource
30788  *
30789  * Finalized a GResource initialized by g_static_resource_init().
30790  *
30791  * This is normally used by code generated by
30792  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30793  * and is not typically used by other code.
30794  *
30795  * Since: 2.32
30796  */
30797
30798
30799 /**
30800  * g_static_resource_get_resource:
30801  * @static_resource: pointer to a static #GStaticResource
30802  *
30803  * Gets the GResource that was registered by a call to g_static_resource_init().
30804  *
30805  * This is normally used by code generated by
30806  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30807  * and is not typically used by other code.
30808  *
30809  * Returns: (transfer none): a #GResource
30810  * Since: 2.32
30811  */
30812
30813
30814 /**
30815  * g_static_resource_init:
30816  * @static_resource: pointer to a static #GStaticResource
30817  *
30818  * Initializes a GResource from static data using a
30819  * GStaticResource.
30820  *
30821  * This is normally used by code generated by
30822  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30823  * and is not typically used by other code.
30824  *
30825  * Since: 2.32
30826  */
30827
30828
30829 /**
30830  * g_task_attach_source:
30831  * @task: a #GTask
30832  * @source: the source to attach
30833  * @callback: the callback to invoke when @source triggers
30834  *
30835  * A utility function for dealing with async operations where you need
30836  * to wait for a #GSource to trigger. Attaches @source to @task's
30837  * #GMainContext with @task's <link
30838  * linkend="io-priority">priority</link>, and sets @source's callback
30839  * to @callback, with @task as the callback's
30840  * <literal>user_data</literal>.
30841  *
30842  * This takes a reference on @task until @source is destroyed.
30843  *
30844  * Since: 2.36
30845  */
30846
30847
30848 /**
30849  * g_task_get_cancellable:
30850  * @task: a #GTask
30851  *
30852  * Gets @task's #GCancellable
30853  *
30854  * Returns: (transfer none): @task's #GCancellable
30855  * Since: 2.36
30856  */
30857
30858
30859 /**
30860  * g_task_get_check_cancellable:
30861  * @task: the #GTask
30862  *
30863  * Gets @task's check-cancellable flag. See
30864  * g_task_set_check_cancellable() for more details.
30865  *
30866  * Since: 2.36
30867  */
30868
30869
30870 /**
30871  * g_task_get_context:
30872  * @task: a #GTask
30873  *
30874  * Gets the #GMainContext that @task will return its result in (that
30875  * is, the context that was the <link
30876  * linkend="g-main-context-push-thread-default">thread-default main
30877  * context</link> at the point when @task was created).
30878  *
30879  * This will always return a non-%NULL value, even if the task's
30880  * context is the default #GMainContext.
30881  *
30882  * Returns: (transfer none): @task's #GMainContext
30883  * Since: 2.36
30884  */
30885
30886
30887 /**
30888  * g_task_get_priority:
30889  * @task: a #GTask
30890  *
30891  * Gets @task's priority
30892  *
30893  * Returns: @task's priority
30894  * Since: 2.36
30895  */
30896
30897
30898 /**
30899  * g_task_get_return_on_cancel:
30900  * @task: the #GTask
30901  *
30902  * Gets @task's return-on-cancel flag. See
30903  * g_task_set_return_on_cancel() for more details.
30904  *
30905  * Since: 2.36
30906  */
30907
30908
30909 /**
30910  * g_task_get_source_object:
30911  * @task: a #GTask
30912  *
30913  * Gets the source object from @task. Like
30914  * g_async_result_get_source_object(), but does not ref the object.
30915  *
30916  * Returns: (transfer none): @task's source object, or %NULL
30917  * Since: 2.36
30918  */
30919
30920
30921 /**
30922  * g_task_get_source_tag:
30923  * @task: a #GTask
30924  *
30925  * Gets @task's source tag. See g_task_set_source_tag().
30926  *
30927  * Returns: (transfer none): @task's source tag
30928  * Since: 2.36
30929  */
30930
30931
30932 /**
30933  * g_task_get_task_data:
30934  * @task: a #GTask
30935  *
30936  * Gets @task's <literal>task_data</literal>.
30937  *
30938  * Returns: (transfer none): @task's <literal>task_data</literal>.
30939  * Since: 2.36
30940  */
30941
30942
30943 /**
30944  * g_task_had_error:
30945  * @task: a #GTask.
30946  *
30947  * Tests if @task resulted in an error.
30948  *
30949  * Returns: %TRUE if the task resulted in an error, %FALSE otherwise.
30950  * Since: 2.36
30951  */
30952
30953
30954 /**
30955  * g_task_is_valid:
30956  * @result: (type Gio.AsyncResult): A #GAsyncResult
30957  * @source_object: (allow-none): the source object expected to be associated with the task
30958  *
30959  * Checks that @result is a #GTask, and that @source_object is its
30960  * source object (or that @source_object is %NULL and @result has no
30961  * source object). This can be used in g_return_if_fail() checks.
30962  *
30963  * Returns: %TRUE if @result and @source_object are valid, %FALSE if not
30964  * Since: 2.36
30965  */
30966
30967
30968 /**
30969  * g_task_new:
30970  * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
30971  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30972  * @callback: (scope async): a #GAsyncReadyCallback.
30973  * @callback_data: (closure): user data passed to @callback.
30974  *
30975  * Creates a #GTask acting on @source_object, which will eventually be
30976  * used to invoke @callback in the current <link
30977  * linkend="g-main-context-push-thread-default">thread-default main
30978  * context</link>.
30979  *
30980  * Call this in the "start" method of your asynchronous method, and
30981  * pass the #GTask around throughout the asynchronous operation. You
30982  * can use g_task_set_task_data() to attach task-specific data to the
30983  * object, which you can retrieve later via g_task_get_task_data().
30984  *
30985  * By default, if @cancellable is cancelled, then the return value of
30986  * the task will always be %G_IO_ERROR_CANCELLED, even if the task had
30987  * already completed before the cancellation. This allows for
30988  * simplified handling in cases where cancellation may imply that
30989  * other objects that the task depends on have been destroyed. If you
30990  * do not want this behavior, you can use
30991  * g_task_set_check_cancellable() to change it.
30992  *
30993  * Returns: a #GTask.
30994  * Since: 2.36
30995  */
30996
30997
30998 /**
30999  * g_task_propagate_boolean:
31000  * @task: a #GTask.
31001  * @error: return location for a #GError
31002  *
31003  * Gets the result of @task as a #gboolean.
31004  *
31005  * If the task resulted in an error, or was cancelled, then this will
31006  * instead return %FALSE and set @error.
31007  *
31008  * Since this method transfers ownership of the return value (or
31009  * error) to the caller, you may only call it once.
31010  *
31011  * Returns: the task result, or %FALSE on error
31012  * Since: 2.36
31013  */
31014
31015
31016 /**
31017  * g_task_propagate_int:
31018  * @task: a #GTask.
31019  * @error: return location for a #GError
31020  *
31021  * Gets the result of @task as an integer (#gssize).
31022  *
31023  * If the task resulted in an error, or was cancelled, then this will
31024  * instead return -1 and set @error.
31025  *
31026  * Since this method transfers ownership of the return value (or
31027  * error) to the caller, you may only call it once.
31028  *
31029  * Returns: the task result, or -1 on error
31030  * Since: 2.36
31031  */
31032
31033
31034 /**
31035  * g_task_propagate_pointer:
31036  * @task: a #GTask
31037  * @error: return location for a #GError
31038  *
31039  * Gets the result of @task as a pointer, and transfers ownership
31040  * of that value to the caller.
31041  *
31042  * If the task resulted in an error, or was cancelled, then this will
31043  * instead return %NULL and set @error.
31044  *
31045  * Since this method transfers ownership of the return value (or
31046  * error) to the caller, you may only call it once.
31047  *
31048  * Returns: (transfer full): the task result, or %NULL on error
31049  * Since: 2.36
31050  */
31051
31052
31053 /**
31054  * g_task_report_error:
31055  * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
31056  * @callback: (scope async): a #GAsyncReadyCallback.
31057  * @callback_data: (closure): user data passed to @callback.
31058  * @source_tag: an opaque pointer indicating the source of this task
31059  * @error: (transfer full): error to report
31060  *
31061  * Creates a #GTask and then immediately calls g_task_return_error()
31062  * on it. Use this in the wrapper function of an asynchronous method
31063  * when you want to avoid even calling the virtual method. You can
31064  * then use g_async_result_is_tagged() in the finish method wrapper to
31065  * check if the result there is tagged as having been created by the
31066  * wrapper method, and deal with it appropriately if so.
31067  *
31068  * See also g_task_report_new_error().
31069  *
31070  * Since: 2.36
31071  */
31072
31073
31074 /**
31075  * g_task_report_new_error:
31076  * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
31077  * @callback: (scope async): a #GAsyncReadyCallback.
31078  * @callback_data: (closure): user data passed to @callback.
31079  * @source_tag: an opaque pointer indicating the source of this task
31080  * @domain: a #GQuark.
31081  * @code: an error code.
31082  * @format: a string with format characters.
31083  * @...: a list of values to insert into @format.
31084  *
31085  * Creates a #GTask and then immediately calls
31086  * g_task_return_new_error() on it. Use this in the wrapper function
31087  * of an asynchronous method when you want to avoid even calling the
31088  * virtual method. You can then use g_async_result_is_tagged() in the
31089  * finish method wrapper to check if the result there is tagged as
31090  * having been created by the wrapper method, and deal with it
31091  * appropriately if so.
31092  *
31093  * See also g_task_report_error().
31094  *
31095  * Since: 2.36
31096  */
31097
31098
31099 /**
31100  * g_task_return_boolean:
31101  * @task: a #GTask.
31102  * @result: the #gboolean result of a task function.
31103  *
31104  * Sets @task's result to @result and completes the task (see
31105  * g_task_return_pointer() for more discussion of exactly what this
31106  * means).
31107  *
31108  * Since: 2.36
31109  */
31110
31111
31112 /**
31113  * g_task_return_error:
31114  * @task: a #GTask.
31115  * @error: (transfer full): the #GError result of a task function.
31116  *
31117  * Sets @task's result to @error (which @task assumes ownership of)
31118  * and completes the task (see g_task_return_pointer() for more
31119  * discussion of exactly what this means).
31120  *
31121  * Note that since the task takes ownership of @error, and since the
31122  * task may be completed before returning from g_task_return_error(),
31123  * you cannot assume that @error is still valid after calling this.
31124  * Call g_error_copy() on the error if you need to keep a local copy
31125  * as well.
31126  *
31127  * See also g_task_return_new_error().
31128  *
31129  * Since: 2.36
31130  */
31131
31132
31133 /**
31134  * g_task_return_error_if_cancelled:
31135  * @task: a #GTask
31136  *
31137  * Checks if @task's #GCancellable has been cancelled, and if so, sets
31138  * @task's error accordingly and completes the task (see
31139  * g_task_return_pointer() for more discussion of exactly what this
31140  * means).
31141  *
31142  * Returns: %TRUE if @task has been cancelled, %FALSE if not
31143  * Since: 2.36
31144  */
31145
31146
31147 /**
31148  * g_task_return_int:
31149  * @task: a #GTask.
31150  * @result: the integer (#gssize) result of a task function.
31151  *
31152  * Sets @task's result to @result and completes the task (see
31153  * g_task_return_pointer() for more discussion of exactly what this
31154  * means).
31155  *
31156  * Since: 2.36
31157  */
31158
31159
31160 /**
31161  * g_task_return_new_error:
31162  * @task: a #GTask.
31163  * @domain: a #GQuark.
31164  * @code: an error code.
31165  * @format: a string with format characters.
31166  * @...: a list of values to insert into @format.
31167  *
31168  * Sets @task's result to a new #GError created from @domain, @code,
31169  * @format, and the remaining arguments, and completes the task (see
31170  * g_task_return_pointer() for more discussion of exactly what this
31171  * means).
31172  *
31173  * See also g_task_return_error().
31174  *
31175  * Since: 2.36
31176  */
31177
31178
31179 /**
31180  * g_task_return_pointer:
31181  * @task: a #GTask
31182  * @result: (allow-none) (transfer full): the pointer result of a task function
31183  * @result_destroy: (allow-none): a #GDestroyNotify function.
31184  *
31185  * Sets @task's result to @result and completes the task. If @result
31186  * is not %NULL, then @result_destroy will be used to free @result if
31187  * the caller does not take ownership of it with
31188  * g_task_propagate_pointer().
31189  *
31190  * "Completes the task" means that for an ordinary asynchronous task
31191  * it will either invoke the task's callback, or else queue that
31192  * callback to be invoked in the proper #GMainContext, or in the next
31193  * iteration of the current #GMainContext. For a task run via
31194  * g_task_run_in_thread() or g_task_run_in_thread_sync(), calling this
31195  * method will save @result to be returned to the caller later, but
31196  * the task will not actually be completed until the #GTaskThreadFunc
31197  * exits.
31198  *
31199  * Note that since the task may be completed before returning from
31200  * g_task_return_pointer(), you cannot assume that @result is still
31201  * valid after calling this, unless you are still holding another
31202  * reference on it.
31203  *
31204  * Since: 2.36
31205  */
31206
31207
31208 /**
31209  * g_task_run_in_thread:
31210  * @task: a #GTask
31211  * @task_func: a #GTaskThreadFunc
31212  *
31213  * Runs @task_func in another thread. When @task_func returns, @task's
31214  * #GAsyncReadyCallback will be invoked in @task's #GMainContext.
31215  *
31216  * This takes a ref on @task until the task completes.
31217  *
31218  * See #GTaskThreadFunc for more details about how @task_func is handled.
31219  *
31220  * Since: 2.36
31221  */
31222
31223
31224 /**
31225  * g_task_run_in_thread_sync:
31226  * @task: a #GTask
31227  * @task_func: a #GTaskThreadFunc
31228  *
31229  * Runs @task_func in another thread, and waits for it to return or be
31230  * cancelled. You can use g_task_propagate_pointer(), etc, afterward
31231  * to get the result of @task_func.
31232  *
31233  * See #GTaskThreadFunc for more details about how @task_func is handled.
31234  *
31235  * Normally this is used with tasks created with a %NULL
31236  * <literal>callback</literal>, but note that even if the task does
31237  * have a callback, it will not be invoked when @task_func returns.
31238  *
31239  * Since: 2.36
31240  */
31241
31242
31243 /**
31244  * g_task_set_check_cancellable:
31245  * @task: the #GTask
31246  * @check_cancellable: whether #GTask will check the state of its #GCancellable for you.
31247  *
31248  * Sets or clears @task's check-cancellable flag. If this is %TRUE
31249  * (the default), then g_task_propagate_pointer(), etc, and
31250  * g_task_had_error() will check the task's #GCancellable first, and
31251  * if it has been cancelled, then they will consider the task to have
31252  * returned an "Operation was cancelled" error
31253  * (%G_IO_ERROR_CANCELLED), regardless of any other error or return
31254  * value the task may have had.
31255  *
31256  * If @check_cancellable is %FALSE, then the #GTask will not check the
31257  * cancellable itself, and it is up to @task's owner to do this (eg,
31258  * via g_task_return_error_if_cancelled()).
31259  *
31260  * If you are using g_task_set_return_on_cancel() as well, then
31261  * you must leave check-cancellable set %TRUE.
31262  *
31263  * Since: 2.36
31264  */
31265
31266
31267 /**
31268  * g_task_set_priority:
31269  * @task: the #GTask
31270  * @priority: the <link linkend="io-priority">priority</link> of the request.
31271  *
31272  * Sets @task's priority. If you do not call this, it will default to
31273  * %G_PRIORITY_DEFAULT.
31274  *
31275  * This will affect the priority of #GSources created with
31276  * g_task_attach_source() and the scheduling of tasks run in threads,
31277  * and can also be explicitly retrieved later via
31278  * g_task_get_priority().
31279  *
31280  * Since: 2.36
31281  */
31282
31283
31284 /**
31285  * g_task_set_return_on_cancel:
31286  * @task: the #GTask
31287  * @return_on_cancel: whether the task returns automatically when it is cancelled.
31288  *
31289  * Sets or clears @task's return-on-cancel flag. This is only
31290  * meaningful for tasks run via g_task_run_in_thread() or
31291  * g_task_run_in_thread_sync().
31292  *
31293  * If @return_on_cancel is %TRUE, then cancelling @task's
31294  * #GCancellable will immediately cause it to return, as though the
31295  * task's #GTaskThreadFunc had called
31296  * g_task_return_error_if_cancelled() and then returned.
31297  *
31298  * This allows you to create a cancellable wrapper around an
31299  * uninterruptable function. The #GTaskThreadFunc just needs to be
31300  * careful that it does not modify any externally-visible state after
31301  * it has been cancelled. To do that, the thread should call
31302  * g_task_set_return_on_cancel() again to (atomically) set
31303  * return-on-cancel %FALSE before making externally-visible changes;
31304  * if the task gets cancelled before the return-on-cancel flag could
31305  * be changed, g_task_set_return_on_cancel() will indicate this by
31306  * returning %FALSE.
31307  *
31308  * You can disable and re-enable this flag multiple times if you wish.
31309  * If the task's #GCancellable is cancelled while return-on-cancel is
31310  * %FALSE, then calling g_task_set_return_on_cancel() to set it %TRUE
31311  * again will cause the task to be cancelled at that point.
31312  *
31313  * If the task's #GCancellable is already cancelled before you call
31314  * g_task_run_in_thread()/g_task_run_in_thread_sync(), then the
31315  * #GTaskThreadFunc will still be run (for consistency), but the task
31316  * will also be completed right away.
31317  *
31318  * Returns: %TRUE if @task's return-on-cancel flag was changed to match @return_on_cancel. %FALSE if @task has already been cancelled.
31319  * Since: 2.36
31320  */
31321
31322
31323 /**
31324  * g_task_set_source_tag:
31325  * @task: the #GTask
31326  * @source_tag: an opaque pointer indicating the source of this task
31327  *
31328  * Sets @task's source tag. You can use this to tag a task return
31329  * value with a particular pointer (usually a pointer to the function
31330  * doing the tagging) and then later check it using
31331  * g_task_get_source_tag() (or g_async_result_is_tagged()) in the
31332  * task's "finish" function, to figure out if the response came from a
31333  * particular place.
31334  *
31335  * Since: 2.36
31336  */
31337
31338
31339 /**
31340  * g_task_set_task_data:
31341  * @task: the #GTask
31342  * @task_data: (allow-none): task-specific data
31343  * @task_data_destroy: (allow-none): #GDestroyNotify for @task_data
31344  *
31345  * Sets @task's task data (freeing the existing task data, if any).
31346  *
31347  * Since: 2.36
31348  */
31349
31350
31351 /**
31352  * g_tcp_connection_get_graceful_disconnect:
31353  * @connection: a #GTcpConnection
31354  *
31355  * Checks if graceful disconnects are used. See
31356  * g_tcp_connection_set_graceful_disconnect().
31357  *
31358  * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
31359  * Since: 2.22
31360  */
31361
31362
31363 /**
31364  * g_tcp_connection_set_graceful_disconnect:
31365  * @connection: a #GTcpConnection
31366  * @graceful_disconnect: Whether to do graceful disconnects or not
31367  *
31368  * This enabled graceful disconnects on close. A graceful disconnect
31369  * means that we signal the receiving end that the connection is terminated
31370  * and wait for it to close the connection before closing the connection.
31371  *
31372  * A graceful disconnect means that we can be sure that we successfully sent
31373  * all the outstanding data to the other end, or get an error reported.
31374  * However, it also means we have to wait for all the data to reach the
31375  * other side and for it to acknowledge this by closing the socket, which may
31376  * take a while. For this reason it is disabled by default.
31377  *
31378  * Since: 2.22
31379  */
31380
31381
31382 /**
31383  * g_tcp_wrapper_connection_get_base_io_stream:
31384  * @conn: a #GTcpWrapperConnection
31385  *
31386  * Get's @conn's base #GIOStream
31387  *
31388  * Returns: (transfer none): @conn's base #GIOStream
31389  */
31390
31391
31392 /**
31393  * g_tcp_wrapper_connection_new:
31394  * @base_io_stream: the #GIOStream to wrap
31395  * @socket: the #GSocket associated with @base_io_stream
31396  *
31397  * Wraps @base_io_stream and @socket together as a #GSocketConnection.
31398  *
31399  * Returns: the new #GSocketConnection.
31400  * Since: 2.28
31401  */
31402
31403
31404 /**
31405  * g_test_dbus_add_service_dir:
31406  * @self: a #GTestDBus
31407  * @path: path to a directory containing .service files
31408  *
31409  * Add a path where dbus-daemon will lookup for .services files. This can't be
31410  * called after g_test_dbus_up().
31411  */
31412
31413
31414 /**
31415  * g_test_dbus_down:
31416  * @self: a #GTestDBus
31417  *
31418  * Stop the session bus started by g_test_dbus_up().
31419  *
31420  * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
31421  * is destroyed. This is done to ensure that the next unit test won't get a
31422  * leaked singleton from this test.
31423  */
31424
31425
31426 /**
31427  * g_test_dbus_get_bus_address:
31428  * @self: a #GTestDBus
31429  *
31430  * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
31431  * been called yet, %NULL is returned. This can be used with
31432  * g_dbus_connection_new_for_address()
31433  *
31434  * Returns: the address of the bus, or %NULL.
31435  */
31436
31437
31438 /**
31439  * g_test_dbus_get_flags:
31440  * @self: a #GTestDBus
31441  *
31442  * Gets the flags of the #GTestDBus object.
31443  *
31444  * Returns: the value of #GTestDBus:flags property
31445  */
31446
31447
31448 /**
31449  * g_test_dbus_new:
31450  * @flags: a #GTestDBusFlags
31451  *
31452  * Create a new #GTestDBus object.
31453  *
31454  * Returns: (transfer full): a new #GTestDBus.
31455  */
31456
31457
31458 /**
31459  * g_test_dbus_stop:
31460  * @self: a #GTestDBus
31461  *
31462  * Stop the session bus started by g_test_dbus_up().
31463  *
31464  * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
31465  * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
31466  * tests wanting to verify behaviour after the session bus has been stopped
31467  * can use this function but should still call g_test_dbus_down() when done.
31468  */
31469
31470
31471 /**
31472  * g_test_dbus_unset:
31473  *
31474  * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
31475  * won't use user's session bus.
31476  *
31477  * This is useful for unit tests that want to verify behaviour when no session
31478  * bus is running. It is not necessary to call this if unit test already calls
31479  * g_test_dbus_up() before acquiring the session bus.
31480  */
31481
31482
31483 /**
31484  * g_test_dbus_up:
31485  * @self: a #GTestDBus
31486  *
31487  * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
31488  * call, it is safe for unit tests to start sending messages on the session bus.
31489  *
31490  * If this function is called from setup callback of g_test_add(),
31491  * g_test_dbus_down() must be called in its teardown callback.
31492  *
31493  * If this function is called from unit test's main(), then g_test_dbus_down()
31494  * must be called after g_test_run().
31495  */
31496
31497
31498 /**
31499  * g_themed_icon_append_name:
31500  * @icon: a #GThemedIcon
31501  * @iconname: name of icon to append to list of icons from within @icon.
31502  *
31503  * Append a name to the list of icons from within @icon.
31504  *
31505  * <note><para>
31506  * Note that doing so invalidates the hash computed by prior calls
31507  * to g_icon_hash().
31508  * </para></note>
31509  */
31510
31511
31512 /**
31513  * g_themed_icon_get_names:
31514  * @icon: a #GThemedIcon.
31515  *
31516  * Gets the names of icons from within @icon.
31517  *
31518  * Returns: (transfer none): a list of icon names.
31519  */
31520
31521
31522 /**
31523  * g_themed_icon_new:
31524  * @iconname: a string containing an icon name.
31525  *
31526  * Creates a new themed icon for @iconname.
31527  *
31528  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31529  */
31530
31531
31532 /**
31533  * g_themed_icon_new_from_names:
31534  * @iconnames: (array length=len): an array of strings containing icon names.
31535  * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
31536  *
31537  * Creates a new themed icon for @iconnames.
31538  *
31539  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
31540  */
31541
31542
31543 /**
31544  * g_themed_icon_new_with_default_fallbacks:
31545  * @iconname: a string containing an icon name
31546  *
31547  * Creates a new themed icon for @iconname, and all the names
31548  * that can be created by shortening @iconname at '-' characters.
31549  *
31550  * In the following example, @icon1 and @icon2 are equivalent:
31551  * |[
31552  * const char *names[] = {
31553  *   "gnome-dev-cdrom-audio",
31554  *   "gnome-dev-cdrom",
31555  *   "gnome-dev",
31556  *   "gnome"
31557  * };
31558  *
31559  * icon1 = g_themed_icon_new_from_names (names, 4);
31560  * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
31561  * ]|
31562  *
31563  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31564  */
31565
31566
31567 /**
31568  * g_themed_icon_prepend_name:
31569  * @icon: a #GThemedIcon
31570  * @iconname: name of icon to prepend to list of icons from within @icon.
31571  *
31572  * Prepend a name to the list of icons from within @icon.
31573  *
31574  * <note><para>
31575  * Note that doing so invalidates the hash computed by prior calls
31576  * to g_icon_hash().
31577  * </para></note>
31578  *
31579  * Since: 2.18
31580  */
31581
31582
31583 /**
31584  * g_threaded_socket_service_new:
31585  * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
31586  *
31587  * Creates a new #GThreadedSocketService with no listeners. Listeners
31588  * must be added with one of the #GSocketListener "add" methods.
31589  *
31590  * Returns: a new #GSocketService.
31591  * Since: 2.22
31592  */
31593
31594
31595 /**
31596  * g_tls_backend_get_certificate_type:
31597  * @backend: the #GTlsBackend
31598  *
31599  * Gets the #GType of @backend's #GTlsCertificate implementation.
31600  *
31601  * Returns: the #GType of @backend's #GTlsCertificate implementation.
31602  * Since: 2.28
31603  */
31604
31605
31606 /**
31607  * g_tls_backend_get_client_connection_type:
31608  * @backend: the #GTlsBackend
31609  *
31610  * Gets the #GType of @backend's #GTlsClientConnection implementation.
31611  *
31612  * Returns: the #GType of @backend's #GTlsClientConnection implementation.
31613  * Since: 2.28
31614  */
31615
31616
31617 /**
31618  * g_tls_backend_get_default:
31619  *
31620  * Gets the default #GTlsBackend for the system.
31621  *
31622  * Returns: (transfer none): a #GTlsBackend
31623  * Since: 2.28
31624  */
31625
31626
31627 /**
31628  * g_tls_backend_get_default_database:
31629  * @backend: the #GTlsBackend
31630  *
31631  * Gets the default #GTlsDatabase used to verify TLS connections.
31632  *
31633  * Returns: (transfer full): the default database, which should be unreffed when done.
31634  * Since: 2.30
31635  */
31636
31637
31638 /**
31639  * g_tls_backend_get_file_database_type:
31640  * @backend: the #GTlsBackend
31641  *
31642  * Gets the #GType of @backend's #GTlsFileDatabase implementation.
31643  *
31644  * Returns: the #GType of backend's #GTlsFileDatabase implementation.
31645  * Since: 2.30
31646  */
31647
31648
31649 /**
31650  * g_tls_backend_get_server_connection_type:
31651  * @backend: the #GTlsBackend
31652  *
31653  * Gets the #GType of @backend's #GTlsServerConnection implementation.
31654  *
31655  * Returns: the #GType of @backend's #GTlsServerConnection implementation.
31656  * Since: 2.28
31657  */
31658
31659
31660 /**
31661  * g_tls_backend_supports_tls:
31662  * @backend: the #GTlsBackend
31663  *
31664  * Checks if TLS is supported; if this returns %FALSE for the default
31665  * #GTlsBackend, it means no "real" TLS backend is available.
31666  *
31667  * Returns: whether or not TLS is supported
31668  * Since: 2.28
31669  */
31670
31671
31672 /**
31673  * g_tls_certificate_get_issuer:
31674  * @cert: a #GTlsCertificate
31675  *
31676  * Gets the #GTlsCertificate representing @cert's issuer, if known
31677  *
31678  * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
31679  * Since: 2.28
31680  */
31681
31682
31683 /**
31684  * g_tls_certificate_is_same:
31685  * @cert_one: first certificate to compare
31686  * @cert_two: second certificate to compare
31687  *
31688  * Check if two #GTlsCertificate objects represent the same certificate.
31689  * The raw DER byte data of the two certificates are checked for equality.
31690  * This has the effect that two certificates may compare equal even if
31691  * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
31692  * #GTlsCertificate:private-key-pem properties differ.
31693  *
31694  * Returns: whether the same or not
31695  * Since: 2.34
31696  */
31697
31698
31699 /**
31700  * g_tls_certificate_list_new_from_file:
31701  * @file: file containing PEM-encoded certificates to import
31702  * @error: #GError for error reporting, or %NULL to ignore.
31703  *
31704  * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
31705  * data in @file. If @file cannot be read or parsed, the function will
31706  * return %NULL and set @error. If @file does not contain any
31707  * PEM-encoded certificates, this will return an empty list and not
31708  * set @error.
31709  *
31710  * 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.
31711  * Since: 2.28
31712  */
31713
31714
31715 /**
31716  * g_tls_certificate_new_from_file:
31717  * @file: file containing a PEM-encoded certificate to import
31718  * @error: #GError for error reporting, or %NULL to ignore.
31719  *
31720  * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
31721  * @file cannot be read or parsed, the function will return %NULL and
31722  * set @error. Otherwise, this behaves like
31723  * g_tls_certificate_new_from_pem().
31724  *
31725  * Returns: the new certificate, or %NULL on error
31726  * Since: 2.28
31727  */
31728
31729
31730 /**
31731  * g_tls_certificate_new_from_files:
31732  * @cert_file: file containing a PEM-encoded certificate to import
31733  * @key_file: file containing a PEM-encoded private key to import
31734  * @error: #GError for error reporting, or %NULL to ignore.
31735  *
31736  * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
31737  * and @key_file. If either file cannot be read or parsed, the
31738  * function will return %NULL and set @error. Otherwise, this behaves
31739  * like g_tls_certificate_new_from_pem().
31740  *
31741  * Returns: the new certificate, or %NULL on error
31742  * Since: 2.28
31743  */
31744
31745
31746 /**
31747  * g_tls_certificate_new_from_pem:
31748  * @data: PEM-encoded certificate data
31749  * @length: the length of @data, or -1 if it's 0-terminated.
31750  * @error: #GError for error reporting, or %NULL to ignore.
31751  *
31752  * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
31753  * If @data includes both a certificate and a private key, then the
31754  * returned certificate will include the private key data as well. (See
31755  * the #GTlsCertificate:private-key-pem property for information about
31756  * supported formats.)
31757  *
31758  * If @data includes multiple certificates, only the first one will be
31759  * parsed.
31760  *
31761  * Returns: the new certificate, or %NULL if @data is invalid
31762  * Since: 2.28
31763  */
31764
31765
31766 /**
31767  * g_tls_certificate_verify:
31768  * @cert: a #GTlsCertificate
31769  * @identity: (allow-none): the expected peer identity
31770  * @trusted_ca: (allow-none): the certificate of a trusted authority
31771  *
31772  * This verifies @cert and returns a set of #GTlsCertificateFlags
31773  * indicating any problems found with it. This can be used to verify a
31774  * certificate outside the context of making a connection, or to
31775  * check a certificate against a CA that is not part of the system
31776  * CA database.
31777  *
31778  * If @identity is not %NULL, @cert's name(s) will be compared against
31779  * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
31780  * value if it does not match. If @identity is %NULL, that bit will
31781  * never be set in the return value.
31782  *
31783  * If @trusted_ca is not %NULL, then @cert (or one of the certificates
31784  * in its chain) must be signed by it, or else
31785  * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
31786  * @trusted_ca is %NULL, that bit will never be set in the return
31787  * value.
31788  *
31789  * (All other #GTlsCertificateFlags values will always be set or unset
31790  * as appropriate.)
31791  *
31792  * Returns: the appropriate #GTlsCertificateFlags
31793  * Since: 2.28
31794  */
31795
31796
31797 /**
31798  * g_tls_client_connection_get_accepted_cas:
31799  * @conn: the #GTlsClientConnection
31800  *
31801  * Gets the list of distinguished names of the Certificate Authorities
31802  * that the server will accept certificates from. This will be set
31803  * during the TLS handshake if the server requests a certificate.
31804  * Otherwise, it will be %NULL.
31805  *
31806  * Each item in the list is a #GByteArray which contains the complete
31807  * subject DN of the certificate authority.
31808  *
31809  * 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().
31810  * Since: 2.28
31811  */
31812
31813
31814 /**
31815  * g_tls_client_connection_get_server_identity:
31816  * @conn: the #GTlsClientConnection
31817  *
31818  * Gets @conn's expected server identity
31819  *
31820  * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
31821  * Since: 2.28
31822  */
31823
31824
31825 /**
31826  * g_tls_client_connection_get_use_ssl3:
31827  * @conn: the #GTlsClientConnection
31828  *
31829  * Gets whether @conn will use SSL 3.0 rather than the
31830  * highest-supported version of TLS; see
31831  * g_tls_client_connection_set_use_ssl3().
31832  *
31833  * Returns: whether @conn will use SSL 3.0
31834  * Since: 2.28
31835  */
31836
31837
31838 /**
31839  * g_tls_client_connection_get_validation_flags:
31840  * @conn: the #GTlsClientConnection
31841  *
31842  * Gets @conn's validation flags
31843  *
31844  * Returns: the validation flags
31845  * Since: 2.28
31846  */
31847
31848
31849 /**
31850  * g_tls_client_connection_new:
31851  * @base_io_stream: the #GIOStream to wrap
31852  * @server_identity: (allow-none): the expected identity of the server
31853  * @error: #GError for error reporting, or %NULL to ignore.
31854  *
31855  * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
31856  * must have pollable input and output streams) which is assumed to
31857  * communicate with the server identified by @server_identity.
31858  *
31859  * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
31860  * Since: 2.28
31861  */
31862
31863
31864 /**
31865  * g_tls_client_connection_set_server_identity:
31866  * @conn: the #GTlsClientConnection
31867  * @identity: a #GSocketConnectable describing the expected server identity
31868  *
31869  * Sets @conn's expected server identity, which is used both to tell
31870  * servers on virtual hosts which certificate to present, and also
31871  * to let @conn know what name to look for in the certificate when
31872  * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
31873  *
31874  * Since: 2.28
31875  */
31876
31877
31878 /**
31879  * g_tls_client_connection_set_use_ssl3:
31880  * @conn: the #GTlsClientConnection
31881  * @use_ssl3: whether to use SSL 3.0
31882  *
31883  * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
31884  * trying to properly negotiate the right version of TLS or SSL to use.
31885  * This can be used when talking to servers that do not implement the
31886  * fallbacks correctly and which will therefore fail to handshake with
31887  * a "modern" TLS handshake attempt.
31888  *
31889  * Since: 2.28
31890  */
31891
31892
31893 /**
31894  * g_tls_client_connection_set_validation_flags:
31895  * @conn: the #GTlsClientConnection
31896  * @flags: the #GTlsCertificateFlags to use
31897  *
31898  * Sets @conn's validation flags, to override the default set of
31899  * checks performed when validating a server certificate. By default,
31900  * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
31901  *
31902  * Since: 2.28
31903  */
31904
31905
31906 /**
31907  * g_tls_connection_emit_accept_certificate:
31908  * @conn: a #GTlsConnection
31909  * @peer_cert: the peer's #GTlsCertificate
31910  * @errors: the problems with @peer_cert
31911  *
31912  * Used by #GTlsConnection implementations to emit the
31913  * #GTlsConnection::accept-certificate signal.
31914  *
31915  * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
31916  * Since: 2.28
31917  */
31918
31919
31920 /**
31921  * g_tls_connection_get_certificate:
31922  * @conn: a #GTlsConnection
31923  *
31924  * Gets @conn's certificate, as set by
31925  * g_tls_connection_set_certificate().
31926  *
31927  * Returns: (transfer none): @conn's certificate, or %NULL
31928  * Since: 2.28
31929  */
31930
31931
31932 /**
31933  * g_tls_connection_get_database:
31934  * @conn: a #GTlsConnection
31935  *
31936  * Gets the certificate database that @conn uses to verify
31937  * peer certificates. See g_tls_connection_set_database().
31938  *
31939  * Returns: (transfer none): the certificate database that @conn uses or %NULL
31940  * Since: 2.30
31941  */
31942
31943
31944 /**
31945  * g_tls_connection_get_interaction:
31946  * @conn: a connection
31947  *
31948  * Get the object that will be used to interact with the user. It will be used
31949  * for things like prompting the user for passwords. If %NULL is returned, then
31950  * no user interaction will occur for this connection.
31951  *
31952  * Returns: (transfer none): The interaction object.
31953  * Since: 2.30
31954  */
31955
31956
31957 /**
31958  * g_tls_connection_get_peer_certificate:
31959  * @conn: a #GTlsConnection
31960  *
31961  * Gets @conn's peer's certificate after the handshake has completed.
31962  * (It is not set during the emission of
31963  * #GTlsConnection::accept-certificate.)
31964  *
31965  * Returns: (transfer none): @conn's peer's certificate, or %NULL
31966  * Since: 2.28
31967  */
31968
31969
31970 /**
31971  * g_tls_connection_get_peer_certificate_errors:
31972  * @conn: a #GTlsConnection
31973  *
31974  * Gets the errors associated with validating @conn's peer's
31975  * certificate, after the handshake has completed. (It is not set
31976  * during the emission of #GTlsConnection::accept-certificate.)
31977  *
31978  * Returns: @conn's peer's certificate errors
31979  * Since: 2.28
31980  */
31981
31982
31983 /**
31984  * g_tls_connection_get_rehandshake_mode:
31985  * @conn: a #GTlsConnection
31986  *
31987  * Gets @conn rehandshaking mode. See
31988  * g_tls_connection_set_rehandshake_mode() for details.
31989  *
31990  * Returns: @conn's rehandshaking mode
31991  * Since: 2.28
31992  */
31993
31994
31995 /**
31996  * g_tls_connection_get_require_close_notify:
31997  * @conn: a #GTlsConnection
31998  *
31999  * Tests whether or not @conn expects a proper TLS close notification
32000  * when the connection is closed. See
32001  * g_tls_connection_set_require_close_notify() for details.
32002  *
32003  * Returns: %TRUE if @conn requires a proper TLS close notification.
32004  * Since: 2.28
32005  */
32006
32007
32008 /**
32009  * g_tls_connection_get_use_system_certdb:
32010  * @conn: a #GTlsConnection
32011  *
32012  * Gets whether @conn uses the system certificate database to verify
32013  * peer certificates. See g_tls_connection_set_use_system_certdb().
32014  *
32015  * Returns: whether @conn uses the system certificate database
32016  * Deprecated: 2.30: Use g_tls_connection_get_database() instead
32017  */
32018
32019
32020 /**
32021  * g_tls_connection_handshake:
32022  * @conn: a #GTlsConnection
32023  * @cancellable: (allow-none): a #GCancellable, or %NULL
32024  * @error: a #GError, or %NULL
32025  *
32026  * Attempts a TLS handshake on @conn.
32027  *
32028  * On the client side, it is never necessary to call this method;
32029  * although the connection needs to perform a handshake after
32030  * connecting (or after sending a "STARTTLS"-type command) and may
32031  * need to rehandshake later if the server requests it,
32032  * #GTlsConnection will handle this for you automatically when you try
32033  * to send or receive data on the connection. However, you can call
32034  * g_tls_connection_handshake() manually if you want to know for sure
32035  * whether the initial handshake succeeded or failed (as opposed to
32036  * just immediately trying to write to @conn's output stream, in which
32037  * case if it fails, it may not be possible to tell if it failed
32038  * before or after completing the handshake).
32039  *
32040  * Likewise, on the server side, although a handshake is necessary at
32041  * the beginning of the communication, you do not need to call this
32042  * function explicitly unless you want clearer error reporting.
32043  * However, you may call g_tls_connection_handshake() later on to
32044  * renegotiate parameters (encryption methods, etc) with the client.
32045  *
32046  * #GTlsConnection::accept_certificate may be emitted during the
32047  * handshake.
32048  *
32049  * Returns: success or failure
32050  * Since: 2.28
32051  */
32052
32053
32054 /**
32055  * g_tls_connection_handshake_async:
32056  * @conn: a #GTlsConnection
32057  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
32058  * @cancellable: (allow-none): a #GCancellable, or %NULL
32059  * @callback: callback to call when the handshake is complete
32060  * @user_data: the data to pass to the callback function
32061  *
32062  * Asynchronously performs a TLS handshake on @conn. See
32063  * g_tls_connection_handshake() for more information.
32064  *
32065  * Since: 2.28
32066  */
32067
32068
32069 /**
32070  * g_tls_connection_handshake_finish:
32071  * @conn: a #GTlsConnection
32072  * @result: a #GAsyncResult.
32073  * @error: a #GError pointer, or %NULL
32074  *
32075  * Finish an asynchronous TLS handshake operation. See
32076  * g_tls_connection_handshake() for more information.
32077  *
32078  * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
32079  * Since: 2.28
32080  */
32081
32082
32083 /**
32084  * g_tls_connection_set_certificate:
32085  * @conn: a #GTlsConnection
32086  * @certificate: the certificate to use for @conn
32087  *
32088  * This sets the certificate that @conn will present to its peer
32089  * during the TLS handshake. For a #GTlsServerConnection, it is
32090  * mandatory to set this, and that will normally be done at construct
32091  * time.
32092  *
32093  * For a #GTlsClientConnection, this is optional. If a handshake fails
32094  * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
32095  * requires a certificate, and if you try connecting again, you should
32096  * call this method first. You can call
32097  * g_tls_client_connection_get_accepted_cas() on the failed connection
32098  * to get a list of Certificate Authorities that the server will
32099  * accept certificates from.
32100  *
32101  * (It is also possible that a server will allow the connection with
32102  * or without a certificate; in that case, if you don't provide a
32103  * certificate, you can tell that the server requested one by the fact
32104  * that g_tls_client_connection_get_accepted_cas() will return
32105  * non-%NULL.)
32106  *
32107  * Since: 2.28
32108  */
32109
32110
32111 /**
32112  * g_tls_connection_set_database:
32113  * @conn: a #GTlsConnection
32114  * @database: a #GTlsDatabase
32115  *
32116  * Sets the certificate database that is used to verify peer certificates.
32117  * This is set to the default database by default. See
32118  * g_tls_backend_get_default_database(). If set to %NULL, then
32119  * peer certificate validation will always set the
32120  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32121  * #GTlsConnection::accept-certificate will always be emitted on
32122  * client-side connections, unless that bit is not set in
32123  * #GTlsClientConnection:validation-flags).
32124  *
32125  * Since: 2.30
32126  */
32127
32128
32129 /**
32130  * g_tls_connection_set_interaction:
32131  * @conn: a connection
32132  * @interaction: (allow-none): an interaction object, or %NULL
32133  *
32134  * Set the object that will be used to interact with the user. It will be used
32135  * for things like prompting the user for passwords.
32136  *
32137  * The @interaction argument will normally be a derived subclass of
32138  * #GTlsInteraction. %NULL can also be provided if no user interaction
32139  * should occur for this connection.
32140  *
32141  * Since: 2.30
32142  */
32143
32144
32145 /**
32146  * g_tls_connection_set_rehandshake_mode:
32147  * @conn: a #GTlsConnection
32148  * @mode: the rehandshaking mode
32149  *
32150  * Sets how @conn behaves with respect to rehandshaking requests.
32151  *
32152  * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
32153  * rehandshake after the initial handshake is complete. (For a client,
32154  * this means it will refuse rehandshake requests from the server, and
32155  * for a server, this means it will close the connection with an error
32156  * if the client attempts to rehandshake.)
32157  *
32158  * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
32159  * rehandshake only if the other end of the connection supports the
32160  * TLS <literal>renegotiation_info</literal> extension. This is the
32161  * default behavior, but means that rehandshaking will not work
32162  * against older implementations that do not support that extension.
32163  *
32164  * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
32165  * rehandshaking even without the
32166  * <literal>renegotiation_info</literal> extension. On the server side
32167  * in particular, this is not recommended, since it leaves the server
32168  * open to certain attacks. However, this mode is necessary if you
32169  * need to allow renegotiation with older client software.
32170  *
32171  * Since: 2.28
32172  */
32173
32174
32175 /**
32176  * g_tls_connection_set_require_close_notify:
32177  * @conn: a #GTlsConnection
32178  * @require_close_notify: whether or not to require close notification
32179  *
32180  * Sets whether or not @conn expects a proper TLS close notification
32181  * before the connection is closed. If this is %TRUE (the default),
32182  * then @conn will expect to receive a TLS close notification from its
32183  * peer before the connection is closed, and will return a
32184  * %G_TLS_ERROR_EOF error if the connection is closed without proper
32185  * notification (since this may indicate a network error, or
32186  * man-in-the-middle attack).
32187  *
32188  * In some protocols, the application will know whether or not the
32189  * connection was closed cleanly based on application-level data
32190  * (because the application-level data includes a length field, or is
32191  * somehow self-delimiting); in this case, the close notify is
32192  * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
32193  * in TLS 1.0 it is technically an error, but often done anyway.) You
32194  * can use g_tls_connection_set_require_close_notify() to tell @conn
32195  * to allow an "unannounced" connection close, in which case the close
32196  * will show up as a 0-length read, as in a non-TLS
32197  * #GSocketConnection, and it is up to the application to check that
32198  * the data has been fully received.
32199  *
32200  * Note that this only affects the behavior when the peer closes the
32201  * connection; when the application calls g_io_stream_close() itself
32202  * on @conn, this will send a close notification regardless of the
32203  * setting of this property. If you explicitly want to do an unclean
32204  * close, you can close @conn's #GTlsConnection:base-io-stream rather
32205  * than closing @conn itself.
32206  *
32207  * Since: 2.28
32208  */
32209
32210
32211 /**
32212  * g_tls_connection_set_use_system_certdb:
32213  * @conn: a #GTlsConnection
32214  * @use_system_certdb: whether to use the system certificate database
32215  *
32216  * Sets whether @conn uses the system certificate database to verify
32217  * peer certificates. This is %TRUE by default. If set to %FALSE, then
32218  * peer certificate validation will always set the
32219  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32220  * #GTlsConnection::accept-certificate will always be emitted on
32221  * client-side connections, unless that bit is not set in
32222  * #GTlsClientConnection:validation-flags).
32223  *
32224  * Deprecated: 2.30: Use g_tls_connection_set_database() instead
32225  */
32226
32227
32228 /**
32229  * g_tls_database_create_certificate_handle:
32230  * @self: a #GTlsDatabase
32231  * @certificate: certificate for which to create a handle.
32232  *
32233  * Create a handle string for the certificate. The database will only be able
32234  * to create a handle for certificates that originate from the database. In
32235  * cases where the database cannot create a handle for a certificate, %NULL
32236  * will be returned.
32237  *
32238  * This handle should be stable across various instances of the application,
32239  * and between applications. If a certificate is modified in the database,
32240  * then it is not guaranteed that this handle will continue to point to it.
32241  *
32242  * Returns: (allow-none): a newly allocated string containing the handle.
32243  * Since: 2.30
32244  */
32245
32246
32247 /**
32248  * g_tls_database_lookup_certificate_for_handle:
32249  * @self: a #GTlsDatabase
32250  * @handle: a certificate handle
32251  * @interaction: (allow-none): used to interact with the user if necessary
32252  * @flags: Flags which affect the lookup.
32253  * @cancellable: (allow-none): a #GCancellable, or %NULL
32254  * @error: (allow-none): a #GError, or %NULL
32255  *
32256  * Lookup a certificate by its handle.
32257  *
32258  * The handle should have been created by calling
32259  * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
32260  * the same TLS backend. The handle is designed to remain valid across
32261  * instantiations of the database.
32262  *
32263  * If the handle is no longer valid, or does not point to a certificate in
32264  * this database, then %NULL will be returned.
32265  *
32266  * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
32267  * the lookup operation asynchronously.
32268  *
32269  * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32270  * Since: 2.30
32271  */
32272
32273
32274 /**
32275  * g_tls_database_lookup_certificate_for_handle_async:
32276  * @self: a #GTlsDatabase
32277  * @handle: a certificate handle
32278  * @interaction: (allow-none): used to interact with the user if necessary
32279  * @flags: Flags which affect the lookup.
32280  * @cancellable: (allow-none): a #GCancellable, or %NULL
32281  * @callback: callback to call when the operation completes
32282  * @user_data: the data to pass to the callback function
32283  *
32284  * Asynchronously lookup a certificate by its handle in the database. See
32285  * g_tls_database_lookup_certificate_for_handle() for more information.
32286  *
32287  * Since: 2.30
32288  */
32289
32290
32291 /**
32292  * g_tls_database_lookup_certificate_for_handle_finish:
32293  * @self: a #GTlsDatabase
32294  * @result: a #GAsyncResult.
32295  * @error: a #GError pointer, or %NULL
32296  *
32297  * Finish an asynchronous lookup of a certificate by its handle. See
32298  * g_tls_database_lookup_certificate_handle() for more information.
32299  *
32300  * If the handle is no longer valid, or does not point to a certificate in
32301  * this database, then %NULL will be returned.
32302  *
32303  * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
32304  * Since: 2.30
32305  */
32306
32307
32308 /**
32309  * g_tls_database_lookup_certificate_issuer:
32310  * @self: a #GTlsDatabase
32311  * @certificate: a #GTlsCertificate
32312  * @interaction: (allow-none): used to interact with the user if necessary
32313  * @flags: flags which affect the lookup operation
32314  * @cancellable: (allow-none): a #GCancellable, or %NULL
32315  * @error: (allow-none): a #GError, or %NULL
32316  *
32317  * Lookup the issuer of @certificate in the database.
32318  *
32319  * The %issuer property
32320  * of @certificate is not modified, and the two certificates are not hooked
32321  * into a chain.
32322  *
32323  * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
32324  * the lookup operation asynchronously.
32325  *
32326  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32327  * Since: 2.30
32328  */
32329
32330
32331 /**
32332  * g_tls_database_lookup_certificate_issuer_async:
32333  * @self: a #GTlsDatabase
32334  * @certificate: a #GTlsCertificate
32335  * @interaction: (allow-none): used to interact with the user if necessary
32336  * @flags: flags which affect the lookup operation
32337  * @cancellable: (allow-none): a #GCancellable, or %NULL
32338  * @callback: callback to call when the operation completes
32339  * @user_data: the data to pass to the callback function
32340  *
32341  * Asynchronously lookup the issuer of @certificate in the database. See
32342  * g_tls_database_lookup_certificate_issuer() for more information.
32343  *
32344  * Since: 2.30
32345  */
32346
32347
32348 /**
32349  * g_tls_database_lookup_certificate_issuer_finish:
32350  * @self: a #GTlsDatabase
32351  * @result: a #GAsyncResult.
32352  * @error: a #GError pointer, or %NULL
32353  *
32354  * Finish an asynchronous lookup issuer operation. See
32355  * g_tls_database_lookup_certificate_issuer() for more information.
32356  *
32357  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32358  * Since: 2.30
32359  */
32360
32361
32362 /**
32363  * g_tls_database_lookup_certificates_issued_by:
32364  * @self: a #GTlsDatabase
32365  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32366  * @interaction: (allow-none): used to interact with the user if necessary
32367  * @flags: Flags which affect the lookup operation.
32368  * @cancellable: (allow-none): a #GCancellable, or %NULL
32369  * @error: (allow-none): a #GError, or %NULL
32370  *
32371  * Lookup certificates issued by this issuer in the database.
32372  *
32373  * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
32374  * the lookup operation asynchronously.
32375  *
32376  * 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.
32377  * Since: 2.30
32378  */
32379
32380
32381 /**
32382  * g_tls_database_lookup_certificates_issued_by_async:
32383  * @self: a #GTlsDatabase
32384  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32385  * @interaction: (allow-none): used to interact with the user if necessary
32386  * @flags: Flags which affect the lookup operation.
32387  * @cancellable: (allow-none): a #GCancellable, or %NULL
32388  * @callback: callback to call when the operation completes
32389  * @user_data: the data to pass to the callback function
32390  *
32391  * Asynchronously lookup certificates issued by this issuer in the database. See
32392  * g_tls_database_lookup_certificates_issued_by() for more information.
32393  *
32394  * The database may choose to hold a reference to the issuer byte array for the duration
32395  * of of this asynchronous operation. The byte array should not be modified during
32396  * this time.
32397  *
32398  * Since: 2.30
32399  */
32400
32401
32402 /**
32403  * g_tls_database_lookup_certificates_issued_by_finish:
32404  * @self: a #GTlsDatabase
32405  * @result: a #GAsyncResult.
32406  * @error: a #GError pointer, or %NULL
32407  *
32408  * Finish an asynchronous lookup of certificates. See
32409  * g_tls_database_lookup_certificates_issued_by() for more information.
32410  *
32411  * 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.
32412  * Since: 2.30
32413  */
32414
32415
32416 /**
32417  * g_tls_database_verify_chain:
32418  * @self: a #GTlsDatabase
32419  * @chain: a #GTlsCertificate chain
32420  * @purpose: the purpose that this certificate chain will be used for.
32421  * @identity: (allow-none): the expected peer identity
32422  * @interaction: (allow-none): used to interact with the user if necessary
32423  * @flags: additional verify flags
32424  * @cancellable: (allow-none): a #GCancellable, or %NULL
32425  * @error: (allow-none): a #GError, or %NULL
32426  *
32427  * Verify's a certificate chain after looking up and adding any missing
32428  * certificates to the chain.
32429  *
32430  * @chain is a chain of #GTlsCertificate objects each pointing to the next
32431  * certificate in the chain by its %issuer property. The chain may initially
32432  * consist of one or more certificates. After the verification process is
32433  * complete, @chain may be modified by adding missing certificates, or removing
32434  * extra certificates. If a certificate anchor was found, then it is added to
32435  * the @chain.
32436  *
32437  * @purpose describes the purpose (or usage) for which the certificate
32438  * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
32439  * which means that the certificate is being used to authenticate a server
32440  * (and we are acting as the client).
32441  *
32442  * The @identity is used to check for pinned certificates (trust exceptions)
32443  * in the database. These will override the normal verification process on a
32444  * host by host basis.
32445  *
32446  * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
32447  * used.
32448  *
32449  * This function can block, use g_tls_database_verify_chain_async() to perform
32450  * the verification operation asynchronously.
32451  *
32452  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32453  * Since: 2.30
32454  */
32455
32456
32457 /**
32458  * g_tls_database_verify_chain_async:
32459  * @self: a #GTlsDatabase
32460  * @chain: a #GTlsCertificate chain
32461  * @purpose: the purpose that this certificate chain will be used for.
32462  * @identity: (allow-none): the expected peer identity
32463  * @interaction: (allow-none): used to interact with the user if necessary
32464  * @flags: additional verify flags
32465  * @cancellable: (allow-none): a #GCancellable, or %NULL
32466  * @callback: callback to call when the operation completes
32467  * @user_data: the data to pass to the callback function
32468  *
32469  * Asynchronously verify's a certificate chain after looking up and adding
32470  * any missing certificates to the chain. See g_tls_database_verify_chain()
32471  * for more information.
32472  *
32473  * Since: 2.30
32474  */
32475
32476
32477 /**
32478  * g_tls_database_verify_chain_finish:
32479  * @self: a #GTlsDatabase
32480  * @result: a #GAsyncResult.
32481  * @error: a #GError pointer, or %NULL
32482  *
32483  * Finish an asynchronous verify chain operation. See
32484  * g_tls_database_verify_chain() for more information. *
32485  *
32486  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32487  * Since: 2.30
32488  */
32489
32490
32491 /**
32492  * g_tls_error_quark:
32493  *
32494  * Gets the TLS error quark.
32495  *
32496  * Returns: a #GQuark.
32497  * Since: 2.28
32498  */
32499
32500
32501 /**
32502  * g_tls_file_database_new:
32503  * @anchors: filename of anchor certificate authorities.
32504  * @error: #GError for error reporting, or %NULL to ignore.
32505  *
32506  * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
32507  * in @anchors to verify certificate chains.
32508  *
32509  * The certificates in @anchors must be PEM encoded.
32510  *
32511  * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
32512  * Since: 2.30
32513  */
32514
32515
32516 /**
32517  * g_tls_interaction_ask_password:
32518  * @interaction: a #GTlsInteraction object
32519  * @password: a #GTlsPassword object
32520  * @cancellable: an optional #GCancellable cancellation object
32521  * @error: an optional location to place an error on failure
32522  *
32523  * Run synchronous interaction to ask the user for a password. In general,
32524  * g_tls_interaction_invoke_ask_password() should be used instead of this
32525  * function.
32526  *
32527  * Derived subclasses usually implement a password prompt, although they may
32528  * also choose to provide a password from elsewhere. The @password value will
32529  * be filled in and then @callback will be called. Alternatively the user may
32530  * abort this password request, which will usually abort the TLS connection.
32531  *
32532  * If the interaction is cancelled by the cancellation object, or by the
32533  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32534  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32535  * not support immediate cancellation.
32536  *
32537  * Returns: The status of the ask password interaction.
32538  * Since: 2.30
32539  */
32540
32541
32542 /**
32543  * g_tls_interaction_ask_password_async:
32544  * @interaction: a #GTlsInteraction object
32545  * @password: a #GTlsPassword object
32546  * @cancellable: an optional #GCancellable cancellation object
32547  * @callback: (allow-none): will be called when the interaction completes
32548  * @user_data: (allow-none): data to pass to the @callback
32549  *
32550  * Run asynchronous interaction to ask the user for a password. In general,
32551  * g_tls_interaction_invoke_ask_password() should be used instead of this
32552  * function.
32553  *
32554  * Derived subclasses usually implement a password prompt, although they may
32555  * also choose to provide a password from elsewhere. The @password value will
32556  * be filled in and then @callback will be called. Alternatively the user may
32557  * abort this password request, which will usually abort the TLS connection.
32558  *
32559  * If the interaction is cancelled by the cancellation object, or by the
32560  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32561  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32562  * not support immediate cancellation.
32563  *
32564  * Certain implementations may not support immediate cancellation.
32565  *
32566  * Since: 2.30
32567  */
32568
32569
32570 /**
32571  * g_tls_interaction_ask_password_finish:
32572  * @interaction: a #GTlsInteraction object
32573  * @result: the result passed to the callback
32574  * @error: an optional location to place an error on failure
32575  *
32576  * Complete an ask password user interaction request. This should be once
32577  * the g_tls_interaction_ask_password_async() completion callback is called.
32578  *
32579  * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
32580  * to g_tls_interaction_ask_password() will have its password filled in.
32581  *
32582  * If the interaction is cancelled by the cancellation object, or by the
32583  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32584  * contains a %G_IO_ERROR_CANCELLED error code.
32585  *
32586  * Returns: The status of the ask password interaction.
32587  * Since: 2.30
32588  */
32589
32590
32591 /**
32592  * g_tls_interaction_invoke_ask_password:
32593  * @interaction: a #GTlsInteraction object
32594  * @password: a #GTlsPassword object
32595  * @cancellable: an optional #GCancellable cancellation object
32596  * @error: an optional location to place an error on failure
32597  *
32598  * Invoke the interaction to ask the user for a password. It invokes this
32599  * interaction in the main loop, specifically the #GMainContext returned by
32600  * g_main_context_get_thread_default() when the interaction is created. This
32601  * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
32602  * for a password.
32603  *
32604  * Derived subclasses usually implement a password prompt, although they may
32605  * also choose to provide a password from elsewhere. The @password value will
32606  * be filled in and then @callback will be called. Alternatively the user may
32607  * abort this password request, which will usually abort the TLS connection.
32608  *
32609  * The implementation can either be a synchronous (eg: modal dialog) or an
32610  * asynchronous one (eg: modeless dialog). This function will take care of
32611  * calling which ever one correctly.
32612  *
32613  * If the interaction is cancelled by the cancellation object, or by the
32614  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32615  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32616  * not support immediate cancellation.
32617  *
32618  * Returns: The status of the ask password interaction.
32619  * Since: 2.30
32620  */
32621
32622
32623 /**
32624  * g_tls_password_get_description:
32625  * @password: a #GTlsPassword object
32626  *
32627  * Get a description string about what the password will be used for.
32628  *
32629  * Returns: The description of the password.
32630  * Since: 2.30
32631  */
32632
32633
32634 /**
32635  * g_tls_password_get_flags:
32636  * @password: a #GTlsPassword object
32637  *
32638  * Get flags about the password.
32639  *
32640  * Returns: The flags about the password.
32641  * Since: 2.30
32642  */
32643
32644
32645 /**
32646  * g_tls_password_get_value:
32647  * @password: a #GTlsPassword object
32648  * @length: (allow-none): location to place the length of the password.
32649  *
32650  * Get the password value. If @length is not %NULL then it will be
32651  * filled in with the length of the password value. (Note that the
32652  * password value is not nul-terminated, so you can only pass %NULL
32653  * for @length in contexts where you know the password will have a
32654  * certain fixed length.)
32655  *
32656  * Returns: The password value (owned by the password object).
32657  * Since: 2.30
32658  */
32659
32660
32661 /**
32662  * g_tls_password_get_warning:
32663  * @password: a #GTlsPassword object
32664  *
32665  * Get a user readable translated warning. Usually this warning is a
32666  * representation of the password flags returned from
32667  * g_tls_password_get_flags().
32668  *
32669  * Returns: The warning.
32670  * Since: 2.30
32671  */
32672
32673
32674 /**
32675  * g_tls_password_new:
32676  * @flags: the password flags
32677  * @description: description of what the password is for
32678  *
32679  * Create a new #GTlsPassword object.
32680  *
32681  * Returns: (transfer full): The newly allocated password object
32682  */
32683
32684
32685 /**
32686  * g_tls_password_set_description:
32687  * @password: a #GTlsPassword object
32688  * @description: The description of the password
32689  *
32690  * Set a description string about what the password will be used for.
32691  *
32692  * Since: 2.30
32693  */
32694
32695
32696 /**
32697  * g_tls_password_set_flags:
32698  * @password: a #GTlsPassword object
32699  * @flags: The flags about the password
32700  *
32701  * Set flags about the password.
32702  *
32703  * Since: 2.30
32704  */
32705
32706
32707 /**
32708  * g_tls_password_set_value:
32709  * @password: a #GTlsPassword object
32710  * @value: the new password value
32711  * @length: the length of the password, or -1
32712  *
32713  * Set the value for this password. The @value will be copied by the password
32714  * object.
32715  *
32716  * Specify the @length, for a non-nul-terminated password. Pass -1 as
32717  * @length if using a nul-terminated password, and @length will be
32718  * calculated automatically. (Note that the terminating nul is not
32719  * considered part of the password in this case.)
32720  *
32721  * Since: 2.30
32722  */
32723
32724
32725 /**
32726  * g_tls_password_set_value_full:
32727  * @password: a #GTlsPassword object
32728  * @value: the value for the password
32729  * @length: the length of the password, or -1
32730  * @destroy: (allow-none): a function to use to free the password.
32731  *
32732  * Provide the value for this password.
32733  *
32734  * The @value will be owned by the password object, and later freed using
32735  * the @destroy function callback.
32736  *
32737  * Specify the @length, for a non-nul-terminated password. Pass -1 as
32738  * @length if using a nul-terminated password, and @length will be
32739  * calculated automatically. (Note that the terminating nul is not
32740  * considered part of the password in this case.)
32741  *
32742  * Virtual: set_value
32743  * Since: 2.30
32744  */
32745
32746
32747 /**
32748  * g_tls_password_set_warning:
32749  * @password: a #GTlsPassword object
32750  * @warning: The user readable warning
32751  *
32752  * Set a user readable translated warning. Usually this warning is a
32753  * representation of the password flags returned from
32754  * g_tls_password_get_flags().
32755  *
32756  * Since: 2.30
32757  */
32758
32759
32760 /**
32761  * g_tls_server_connection_new:
32762  * @base_io_stream: the #GIOStream to wrap
32763  * @certificate: (allow-none): the default server certificate, or %NULL
32764  * @error: #GError for error reporting, or %NULL to ignore.
32765  *
32766  * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
32767  * must have pollable input and output streams).
32768  *
32769  * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
32770  * Since: 2.28
32771  */
32772
32773
32774 /**
32775  * g_unix_connection_receive_credentials:
32776  * @connection: A #GUnixConnection.
32777  * @cancellable: (allow-none): A #GCancellable or %NULL.
32778  * @error: Return location for error or %NULL.
32779  *
32780  * Receives credentials from the sending end of the connection.  The
32781  * sending end has to call g_unix_connection_send_credentials() (or
32782  * similar) for this to work.
32783  *
32784  * As well as reading the credentials this also reads (and discards) a
32785  * single byte from the stream, as this is required for credentials
32786  * passing to work on some implementations.
32787  *
32788  * Other ways to exchange credentials with a foreign peer includes the
32789  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32790  *
32791  * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
32792  * Since: 2.26
32793  */
32794
32795
32796 /**
32797  * g_unix_connection_receive_credentials_async:
32798  * @connection: A #GUnixConnection.
32799  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32800  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32801  * @user_data: (closure): the data to pass to callback function
32802  *
32803  * Asynchronously receive credentials.
32804  *
32805  * For more details, see g_unix_connection_receive_credentials() which is
32806  * the synchronous version of this call.
32807  *
32808  * When the operation is finished, @callback will be called. You can then call
32809  * g_unix_connection_receive_credentials_finish() to get the result of the operation.
32810  *
32811  * Since: 2.32
32812  */
32813
32814
32815 /**
32816  * g_unix_connection_receive_credentials_finish:
32817  * @connection: A #GUnixConnection.
32818  * @result: a #GAsyncResult.
32819  * @error: a #GError, or %NULL
32820  *
32821  * Finishes an asynchronous receive credentials operation started with
32822  * g_unix_connection_receive_credentials_async().
32823  *
32824  * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
32825  * Since: 2.32
32826  */
32827
32828
32829 /**
32830  * g_unix_connection_receive_fd:
32831  * @connection: a #GUnixConnection
32832  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
32833  * @error: (allow-none): #GError for error reporting, or %NULL to ignore
32834  *
32835  * Receives a file descriptor from the sending end of the connection.
32836  * The sending end has to call g_unix_connection_send_fd() for this
32837  * to work.
32838  *
32839  * As well as reading the fd this also reads a single byte from the
32840  * stream, as this is required for fd passing to work on some
32841  * implementations.
32842  *
32843  * Returns: a file descriptor on success, -1 on error.
32844  * Since: 2.22
32845  */
32846
32847
32848 /**
32849  * g_unix_connection_send_credentials:
32850  * @connection: A #GUnixConnection.
32851  * @cancellable: (allow-none): A #GCancellable or %NULL.
32852  * @error: Return location for error or %NULL.
32853  *
32854  * Passes the credentials of the current user the receiving side
32855  * of the connection. The receiving end has to call
32856  * g_unix_connection_receive_credentials() (or similar) to accept the
32857  * credentials.
32858  *
32859  * As well as sending the credentials this also writes a single NUL
32860  * byte to the stream, as this is required for credentials passing to
32861  * work on some implementations.
32862  *
32863  * Other ways to exchange credentials with a foreign peer includes the
32864  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32865  *
32866  * Returns: %TRUE on success, %FALSE if @error is set.
32867  * Since: 2.26
32868  */
32869
32870
32871 /**
32872  * g_unix_connection_send_credentials_async:
32873  * @connection: A #GUnixConnection.
32874  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32875  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32876  * @user_data: (closure): the data to pass to callback function
32877  *
32878  * Asynchronously send credentials.
32879  *
32880  * For more details, see g_unix_connection_send_credentials() which is
32881  * the synchronous version of this call.
32882  *
32883  * When the operation is finished, @callback will be called. You can then call
32884  * g_unix_connection_send_credentials_finish() to get the result of the operation.
32885  *
32886  * Since: 2.32
32887  */
32888
32889
32890 /**
32891  * g_unix_connection_send_credentials_finish:
32892  * @connection: A #GUnixConnection.
32893  * @result: a #GAsyncResult.
32894  * @error: a #GError, or %NULL
32895  *
32896  * Finishes an asynchronous send credentials operation started with
32897  * g_unix_connection_send_credentials_async().
32898  *
32899  * Returns: %TRUE if the operation was successful, otherwise %FALSE.
32900  * Since: 2.32
32901  */
32902
32903
32904 /**
32905  * g_unix_connection_send_fd:
32906  * @connection: a #GUnixConnection
32907  * @fd: a file descriptor
32908  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32909  * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
32910  *
32911  * Passes a file descriptor to the receiving side of the
32912  * connection. The receiving end has to call g_unix_connection_receive_fd()
32913  * to accept the file descriptor.
32914  *
32915  * As well as sending the fd this also writes a single byte to the
32916  * stream, as this is required for fd passing to work on some
32917  * implementations.
32918  *
32919  * Returns: a %TRUE on success, %NULL on error.
32920  * Since: 2.22
32921  */
32922
32923
32924 /**
32925  * g_unix_credentials_message_get_credentials:
32926  * @message: A #GUnixCredentialsMessage.
32927  *
32928  * Gets the credentials stored in @message.
32929  *
32930  * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
32931  * Since: 2.26
32932  */
32933
32934
32935 /**
32936  * g_unix_credentials_message_is_supported:
32937  *
32938  * Checks if passing #GCredentials on a #GSocket is supported on this platform.
32939  *
32940  * Returns: %TRUE if supported, %FALSE otherwise
32941  * Since: 2.26
32942  */
32943
32944
32945 /**
32946  * g_unix_credentials_message_new:
32947  *
32948  * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
32949  *
32950  * Returns: a new #GUnixCredentialsMessage
32951  * Since: 2.26
32952  */
32953
32954
32955 /**
32956  * g_unix_credentials_message_new_with_credentials:
32957  * @credentials: A #GCredentials object.
32958  *
32959  * Creates a new #GUnixCredentialsMessage holding @credentials.
32960  *
32961  * Returns: a new #GUnixCredentialsMessage
32962  * Since: 2.26
32963  */
32964
32965
32966 /**
32967  * g_unix_fd_list_append:
32968  * @list: a #GUnixFDList
32969  * @fd: a valid open file descriptor
32970  * @error: a #GError pointer
32971  *
32972  * Adds a file descriptor to @list.
32973  *
32974  * The file descriptor is duplicated using dup(). You keep your copy
32975  * of the descriptor and the copy contained in @list will be closed
32976  * when @list is finalized.
32977  *
32978  * A possible cause of failure is exceeding the per-process or
32979  * system-wide file descriptor limit.
32980  *
32981  * The index of the file descriptor in the list is returned.  If you use
32982  * this index with g_unix_fd_list_get() then you will receive back a
32983  * duplicated copy of the same file descriptor.
32984  *
32985  * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
32986  * Since: 2.24
32987  */
32988
32989
32990 /**
32991  * g_unix_fd_list_get:
32992  * @list: a #GUnixFDList
32993  * @index_: the index into the list
32994  * @error: a #GError pointer
32995  *
32996  * Gets a file descriptor out of @list.
32997  *
32998  * @index_ specifies the index of the file descriptor to get.  It is a
32999  * programmer error for @index_ to be out of range; see
33000  * g_unix_fd_list_get_length().
33001  *
33002  * The file descriptor is duplicated using dup() and set as
33003  * close-on-exec before being returned.  You must call close() on it
33004  * when you are done.
33005  *
33006  * A possible cause of failure is exceeding the per-process or
33007  * system-wide file descriptor limit.
33008  *
33009  * Returns: the file descriptor, or -1 in case of error
33010  * Since: 2.24
33011  */
33012
33013
33014 /**
33015  * g_unix_fd_list_get_length:
33016  * @list: a #GUnixFDList
33017  *
33018  * Gets the length of @list (ie: the number of file descriptors
33019  * contained within).
33020  *
33021  * Returns: the length of @list
33022  * Since: 2.24
33023  */
33024
33025
33026 /**
33027  * g_unix_fd_list_new:
33028  *
33029  * Creates a new #GUnixFDList containing no file descriptors.
33030  *
33031  * Returns: a new #GUnixFDList
33032  * Since: 2.24
33033  */
33034
33035
33036 /**
33037  * g_unix_fd_list_new_from_array:
33038  * @fds: (array length=n_fds): the initial list of file descriptors
33039  * @n_fds: the length of #fds, or -1
33040  *
33041  * Creates a new #GUnixFDList containing the file descriptors given in
33042  * @fds.  The file descriptors become the property of the new list and
33043  * may no longer be used by the caller.  The array itself is owned by
33044  * the caller.
33045  *
33046  * Each file descriptor in the array should be set to close-on-exec.
33047  *
33048  * If @n_fds is -1 then @fds must be terminated with -1.
33049  *
33050  * Returns: a new #GUnixFDList
33051  * Since: 2.24
33052  */
33053
33054
33055 /**
33056  * g_unix_fd_list_peek_fds:
33057  * @list: a #GUnixFDList
33058  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33059  *
33060  * Returns the array of file descriptors that is contained in this
33061  * object.
33062  *
33063  * After this call, the descriptors remain the property of @list.  The
33064  * caller must not close them and must not free the array.  The array is
33065  * valid only until @list is changed in any way.
33066  *
33067  * If @length is non-%NULL then it is set to the number of file
33068  * descriptors in the returned array. The returned array is also
33069  * terminated with -1.
33070  *
33071  * This function never returns %NULL. In case there are no file
33072  * descriptors contained in @list, an empty array is returned.
33073  *
33074  * Returns: (array length=length) (transfer none): an array of file descriptors
33075  * Since: 2.24
33076  */
33077
33078
33079 /**
33080  * g_unix_fd_list_steal_fds:
33081  * @list: a #GUnixFDList
33082  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33083  *
33084  * Returns the array of file descriptors that is contained in this
33085  * object.
33086  *
33087  * After this call, the descriptors are no longer contained in
33088  * @list. Further calls will return an empty list (unless more
33089  * descriptors have been added).
33090  *
33091  * The return result of this function must be freed with g_free().
33092  * The caller is also responsible for closing all of the file
33093  * descriptors.  The file descriptors in the array are set to
33094  * close-on-exec.
33095  *
33096  * If @length is non-%NULL then it is set to the number of file
33097  * descriptors in the returned array. The returned array is also
33098  * terminated with -1.
33099  *
33100  * This function never returns %NULL. In case there are no file
33101  * descriptors contained in @list, an empty array is returned.
33102  *
33103  * Returns: (array length=length) (transfer full): an array of file descriptors
33104  * Since: 2.24
33105  */
33106
33107
33108 /**
33109  * g_unix_fd_message_append_fd:
33110  * @message: a #GUnixFDMessage
33111  * @fd: a valid open file descriptor
33112  * @error: a #GError pointer
33113  *
33114  * Adds a file descriptor to @message.
33115  *
33116  * The file descriptor is duplicated using dup(). You keep your copy
33117  * of the descriptor and the copy contained in @message will be closed
33118  * when @message is finalized.
33119  *
33120  * A possible cause of failure is exceeding the per-process or
33121  * system-wide file descriptor limit.
33122  *
33123  * Returns: %TRUE in case of success, else %FALSE (and @error is set)
33124  * Since: 2.22
33125  */
33126
33127
33128 /**
33129  * g_unix_fd_message_get_fd_list:
33130  * @message: a #GUnixFDMessage
33131  *
33132  * Gets the #GUnixFDList contained in @message.  This function does not
33133  * return a reference to the caller, but the returned list is valid for
33134  * the lifetime of @message.
33135  *
33136  * Returns: (transfer none): the #GUnixFDList from @message
33137  * Since: 2.24
33138  */
33139
33140
33141 /**
33142  * g_unix_fd_message_new:
33143  *
33144  * Creates a new #GUnixFDMessage containing an empty file descriptor
33145  * list.
33146  *
33147  * Returns: a new #GUnixFDMessage
33148  * Since: 2.22
33149  */
33150
33151
33152 /**
33153  * g_unix_fd_message_new_with_fd_list:
33154  * @fd_list: a #GUnixFDList
33155  *
33156  * Creates a new #GUnixFDMessage containing @list.
33157  *
33158  * Returns: a new #GUnixFDMessage
33159  * Since: 2.24
33160  */
33161
33162
33163 /**
33164  * g_unix_fd_message_steal_fds:
33165  * @message: a #GUnixFDMessage
33166  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33167  *
33168  * Returns the array of file descriptors that is contained in this
33169  * object.
33170  *
33171  * After this call, the descriptors are no longer contained in
33172  * @message. Further calls will return an empty list (unless more
33173  * descriptors have been added).
33174  *
33175  * The return result of this function must be freed with g_free().
33176  * The caller is also responsible for closing all of the file
33177  * descriptors.
33178  *
33179  * If @length is non-%NULL then it is set to the number of file
33180  * descriptors in the returned array. The returned array is also
33181  * terminated with -1.
33182  *
33183  * This function never returns %NULL. In case there are no file
33184  * descriptors contained in @message, an empty array is returned.
33185  *
33186  * Returns: (array length=length) (transfer full): an array of file descriptors
33187  * Since: 2.22
33188  */
33189
33190
33191 /**
33192  * g_unix_input_stream_get_close_fd:
33193  * @stream: a #GUnixInputStream
33194  *
33195  * Returns whether the file descriptor of @stream will be
33196  * closed when the stream is closed.
33197  *
33198  * Returns: %TRUE if the file descriptor is closed when done
33199  * Since: 2.20
33200  */
33201
33202
33203 /**
33204  * g_unix_input_stream_get_fd:
33205  * @stream: a #GUnixInputStream
33206  *
33207  * Return the UNIX file descriptor that the stream reads from.
33208  *
33209  * Returns: The file descriptor of @stream
33210  * Since: 2.20
33211  */
33212
33213
33214 /**
33215  * g_unix_input_stream_new:
33216  * @fd: a UNIX file descriptor
33217  * @close_fd: %TRUE to close the file descriptor when done
33218  *
33219  * Creates a new #GUnixInputStream for the given @fd.
33220  *
33221  * If @close_fd is %TRUE, the file descriptor will be closed
33222  * when the stream is closed.
33223  *
33224  * Returns: a new #GUnixInputStream
33225  */
33226
33227
33228 /**
33229  * g_unix_input_stream_set_close_fd:
33230  * @stream: a #GUnixInputStream
33231  * @close_fd: %TRUE to close the file descriptor when done
33232  *
33233  * Sets whether the file descriptor of @stream shall be closed
33234  * when the stream is closed.
33235  *
33236  * Since: 2.20
33237  */
33238
33239
33240 /**
33241  * g_unix_is_mount_path_system_internal:
33242  * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
33243  *
33244  * Determines if @mount_path is considered an implementation of the
33245  * OS. This is primarily used for hiding mountable and mounted volumes
33246  * that only are used in the OS and has little to no relevance to the
33247  * casual user.
33248  *
33249  * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
33250  */
33251
33252
33253 /**
33254  * g_unix_mount_at: (skip)
33255  * @mount_path: path for a possible unix mount.
33256  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33257  *
33258  * Gets a #GUnixMountEntry for a given mount path. If @time_read
33259  * is set, it will be filled with a unix timestamp for checking
33260  * if the mounts have changed since with g_unix_mounts_changed_since().
33261  *
33262  * Returns: (transfer full): a #GUnixMountEntry.
33263  */
33264
33265
33266 /**
33267  * g_unix_mount_compare:
33268  * @mount1: first #GUnixMountEntry to compare.
33269  * @mount2: second #GUnixMountEntry to compare.
33270  *
33271  * Compares two unix mounts.
33272  *
33273  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33274  */
33275
33276
33277 /**
33278  * g_unix_mount_free:
33279  * @mount_entry: a #GUnixMountEntry.
33280  *
33281  * Frees a unix mount.
33282  */
33283
33284
33285 /**
33286  * g_unix_mount_get_device_path:
33287  * @mount_entry: a #GUnixMount.
33288  *
33289  * Gets the device path for a unix mount.
33290  *
33291  * Returns: a string containing the device path.
33292  */
33293
33294
33295 /**
33296  * g_unix_mount_get_fs_type:
33297  * @mount_entry: a #GUnixMount.
33298  *
33299  * Gets the filesystem type for the unix mount.
33300  *
33301  * Returns: a string containing the file system type.
33302  */
33303
33304
33305 /**
33306  * g_unix_mount_get_mount_path:
33307  * @mount_entry: input #GUnixMountEntry to get the mount path for.
33308  *
33309  * Gets the mount path for a unix mount.
33310  *
33311  * Returns: the mount path for @mount_entry.
33312  */
33313
33314
33315 /**
33316  * g_unix_mount_guess_can_eject:
33317  * @mount_entry: a #GUnixMountEntry
33318  *
33319  * Guesses whether a Unix mount can be ejected.
33320  *
33321  * Returns: %TRUE if @mount_entry is deemed to be ejectable.
33322  */
33323
33324
33325 /**
33326  * g_unix_mount_guess_icon:
33327  * @mount_entry: a #GUnixMountEntry
33328  *
33329  * Guesses the icon of a Unix mount.
33330  *
33331  * Returns: (transfer full): a #GIcon
33332  */
33333
33334
33335 /**
33336  * g_unix_mount_guess_name:
33337  * @mount_entry: a #GUnixMountEntry
33338  *
33339  * Guesses the name of a Unix mount.
33340  * The result is a translated string.
33341  *
33342  * Returns: A newly allocated string that must be freed with g_free()
33343  */
33344
33345
33346 /**
33347  * g_unix_mount_guess_should_display:
33348  * @mount_entry: a #GUnixMountEntry
33349  *
33350  * Guesses whether a Unix mount should be displayed in the UI.
33351  *
33352  * Returns: %TRUE if @mount_entry is deemed to be displayable.
33353  */
33354
33355
33356 /**
33357  * g_unix_mount_guess_symbolic_icon:
33358  * @mount_entry: a #GUnixMountEntry
33359  *
33360  * Guesses the symbolic icon of a Unix mount.
33361  *
33362  * Returns: (transfer full): a #GIcon
33363  * Since: 2.34
33364  */
33365
33366
33367 /**
33368  * g_unix_mount_is_readonly:
33369  * @mount_entry: a #GUnixMount.
33370  *
33371  * Checks if a unix mount is mounted read only.
33372  *
33373  * Returns: %TRUE if @mount_entry is read only.
33374  */
33375
33376
33377 /**
33378  * g_unix_mount_is_system_internal:
33379  * @mount_entry: a #GUnixMount.
33380  *
33381  * Checks if a unix mount is a system path.
33382  *
33383  * Returns: %TRUE if the unix mount is for a system path.
33384  */
33385
33386
33387 /**
33388  * g_unix_mount_monitor_new:
33389  *
33390  * Gets a new #GUnixMountMonitor. The default rate limit for which the
33391  * monitor will report consecutive changes for the mount and mount
33392  * point entry files is the default for a #GFileMonitor. Use
33393  * g_unix_mount_monitor_set_rate_limit() to change this.
33394  *
33395  * Returns: a #GUnixMountMonitor.
33396  */
33397
33398
33399 /**
33400  * g_unix_mount_monitor_set_rate_limit:
33401  * @mount_monitor: a #GUnixMountMonitor
33402  * @limit_msec: a integer with the limit in milliseconds to poll for changes.
33403  *
33404  * Sets the rate limit to which the @mount_monitor will report
33405  * consecutive change events to the mount and mount point entry files.
33406  *
33407  * Since: 2.18
33408  */
33409
33410
33411 /**
33412  * g_unix_mount_point_compare:
33413  * @mount1: a #GUnixMount.
33414  * @mount2: a #GUnixMount.
33415  *
33416  * Compares two unix mount points.
33417  *
33418  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33419  */
33420
33421
33422 /**
33423  * g_unix_mount_point_free:
33424  * @mount_point: unix mount point to free.
33425  *
33426  * Frees a unix mount point.
33427  */
33428
33429
33430 /**
33431  * g_unix_mount_point_get_device_path:
33432  * @mount_point: a #GUnixMountPoint.
33433  *
33434  * Gets the device path for a unix mount point.
33435  *
33436  * Returns: a string containing the device path.
33437  */
33438
33439
33440 /**
33441  * g_unix_mount_point_get_fs_type:
33442  * @mount_point: a #GUnixMountPoint.
33443  *
33444  * Gets the file system type for the mount point.
33445  *
33446  * Returns: a string containing the file system type.
33447  */
33448
33449
33450 /**
33451  * g_unix_mount_point_get_mount_path:
33452  * @mount_point: a #GUnixMountPoint.
33453  *
33454  * Gets the mount path for a unix mount point.
33455  *
33456  * Returns: a string containing the mount path.
33457  */
33458
33459
33460 /**
33461  * g_unix_mount_point_get_options:
33462  * @mount_point: a #GUnixMountPoint.
33463  *
33464  * Gets the options for the mount point.
33465  *
33466  * Returns: a string containing the options.
33467  * Since: 2.32
33468  */
33469
33470
33471 /**
33472  * g_unix_mount_point_guess_can_eject:
33473  * @mount_point: a #GUnixMountPoint
33474  *
33475  * Guesses whether a Unix mount point can be ejected.
33476  *
33477  * Returns: %TRUE if @mount_point is deemed to be ejectable.
33478  */
33479
33480
33481 /**
33482  * g_unix_mount_point_guess_icon:
33483  * @mount_point: a #GUnixMountPoint
33484  *
33485  * Guesses the icon of a Unix mount point.
33486  *
33487  * Returns: (transfer full): a #GIcon
33488  */
33489
33490
33491 /**
33492  * g_unix_mount_point_guess_name:
33493  * @mount_point: a #GUnixMountPoint
33494  *
33495  * Guesses the name of a Unix mount point.
33496  * The result is a translated string.
33497  *
33498  * Returns: A newly allocated string that must be freed with g_free()
33499  */
33500
33501
33502 /**
33503  * g_unix_mount_point_guess_symbolic_icon:
33504  * @mount_point: a #GUnixMountPoint
33505  *
33506  * Guesses the symbolic icon of a Unix mount point.
33507  *
33508  * Returns: (transfer full): a #GIcon
33509  * Since: 2.34
33510  */
33511
33512
33513 /**
33514  * g_unix_mount_point_is_loopback:
33515  * @mount_point: a #GUnixMountPoint.
33516  *
33517  * Checks if a unix mount point is a loopback device.
33518  *
33519  * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
33520  */
33521
33522
33523 /**
33524  * g_unix_mount_point_is_readonly:
33525  * @mount_point: a #GUnixMountPoint.
33526  *
33527  * Checks if a unix mount point is read only.
33528  *
33529  * Returns: %TRUE if a mount point is read only.
33530  */
33531
33532
33533 /**
33534  * g_unix_mount_point_is_user_mountable:
33535  * @mount_point: a #GUnixMountPoint.
33536  *
33537  * Checks if a unix mount point is mountable by the user.
33538  *
33539  * Returns: %TRUE if the mount point is user mountable.
33540  */
33541
33542
33543 /**
33544  * g_unix_mount_points_changed_since:
33545  * @time: guint64 to contain a timestamp.
33546  *
33547  * Checks if the unix mount points have changed since a given unix time.
33548  *
33549  * Returns: %TRUE if the mount points have changed since @time.
33550  */
33551
33552
33553 /**
33554  * g_unix_mount_points_get: (skip)
33555  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33556  *
33557  * Gets a #GList of #GUnixMountPoint containing the unix mount points.
33558  * If @time_read is set, it will be filled with the mount timestamp,
33559  * allowing for checking if the mounts have changed with
33560  * g_unix_mount_points_changed_since().
33561  *
33562  * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
33563  */
33564
33565
33566 /**
33567  * g_unix_mounts_changed_since:
33568  * @time: guint64 to contain a timestamp.
33569  *
33570  * Checks if the unix mounts have changed since a given unix time.
33571  *
33572  * Returns: %TRUE if the mounts have changed since @time.
33573  */
33574
33575
33576 /**
33577  * g_unix_mounts_get: (skip)
33578  * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
33579  *
33580  * Gets a #GList of #GUnixMountEntry containing the unix mounts.
33581  * If @time_read is set, it will be filled with the mount
33582  * timestamp, allowing for checking if the mounts have changed
33583  * with g_unix_mounts_changed_since().
33584  *
33585  * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
33586  */
33587
33588
33589 /**
33590  * g_unix_output_stream_get_close_fd:
33591  * @stream: a #GUnixOutputStream
33592  *
33593  * Returns whether the file descriptor of @stream will be
33594  * closed when the stream is closed.
33595  *
33596  * Returns: %TRUE if the file descriptor is closed when done
33597  * Since: 2.20
33598  */
33599
33600
33601 /**
33602  * g_unix_output_stream_get_fd:
33603  * @stream: a #GUnixOutputStream
33604  *
33605  * Return the UNIX file descriptor that the stream writes to.
33606  *
33607  * Returns: The file descriptor of @stream
33608  * Since: 2.20
33609  */
33610
33611
33612 /**
33613  * g_unix_output_stream_new:
33614  * @fd: a UNIX file descriptor
33615  * @close_fd: %TRUE to close the file descriptor when done
33616  *
33617  * Creates a new #GUnixOutputStream for the given @fd.
33618  *
33619  * If @close_fd, is %TRUE, the file descriptor will be closed when
33620  * the output stream is destroyed.
33621  *
33622  * Returns: a new #GOutputStream
33623  */
33624
33625
33626 /**
33627  * g_unix_output_stream_set_close_fd:
33628  * @stream: a #GUnixOutputStream
33629  * @close_fd: %TRUE to close the file descriptor when done
33630  *
33631  * Sets whether the file descriptor of @stream shall be closed
33632  * when the stream is closed.
33633  *
33634  * Since: 2.20
33635  */
33636
33637
33638 /**
33639  * g_unix_socket_address_abstract_names_supported:
33640  *
33641  * Checks if abstract UNIX domain socket names are supported.
33642  *
33643  * Returns: %TRUE if supported, %FALSE otherwise
33644  * Since: 2.22
33645  */
33646
33647
33648 /**
33649  * g_unix_socket_address_get_address_type:
33650  * @address: a #GInetSocketAddress
33651  *
33652  * Gets @address's type.
33653  *
33654  * Returns: a #GUnixSocketAddressType
33655  * Since: 2.26
33656  */
33657
33658
33659 /**
33660  * g_unix_socket_address_get_is_abstract:
33661  * @address: a #GInetSocketAddress
33662  *
33663  * Tests if @address is abstract.
33664  *
33665  * Returns: %TRUE if the address is abstract, %FALSE otherwise
33666  * Since: 2.22
33667  * Deprecated: Use g_unix_socket_address_get_address_type()
33668  */
33669
33670
33671 /**
33672  * g_unix_socket_address_get_path:
33673  * @address: a #GInetSocketAddress
33674  *
33675  * Gets @address's path, or for abstract sockets the "name".
33676  *
33677  * Guaranteed to be zero-terminated, but an abstract socket
33678  * may contain embedded zeros, and thus you should use
33679  * g_unix_socket_address_get_path_len() to get the true length
33680  * of this string.
33681  *
33682  * Returns: the path for @address
33683  * Since: 2.22
33684  */
33685
33686
33687 /**
33688  * g_unix_socket_address_get_path_len:
33689  * @address: a #GInetSocketAddress
33690  *
33691  * Gets the length of @address's path.
33692  *
33693  * For details, see g_unix_socket_address_get_path().
33694  *
33695  * Returns: the length of the path
33696  * Since: 2.22
33697  */
33698
33699
33700 /**
33701  * g_unix_socket_address_new:
33702  * @path: the socket path
33703  *
33704  * Creates a new #GUnixSocketAddress for @path.
33705  *
33706  * To create abstract socket addresses, on systems that support that,
33707  * use g_unix_socket_address_new_abstract().
33708  *
33709  * Returns: a new #GUnixSocketAddress
33710  * Since: 2.22
33711  */
33712
33713
33714 /**
33715  * g_unix_socket_address_new_abstract:
33716  * @path: (array length=path_len) (element-type gchar): the abstract name
33717  * @path_len: the length of @path, or -1
33718  *
33719  * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
33720  * #GUnixSocketAddress for @path.
33721  *
33722  * Returns: a new #GUnixSocketAddress
33723  * Deprecated: Use g_unix_socket_address_new_with_type().
33724  */
33725
33726
33727 /**
33728  * g_unix_socket_address_new_with_type:
33729  * @path: (array length=path_len) (element-type gchar): the name
33730  * @path_len: the length of @path, or -1
33731  * @type: a #GUnixSocketAddressType
33732  *
33733  * Creates a new #GUnixSocketAddress of type @type with name @path.
33734  *
33735  * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
33736  * calling g_unix_socket_address_new().
33737  *
33738  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
33739  * bytes of @path will be copied to the socket's path, and only those
33740  * bytes will be considered part of the name. (If @path_len is -1,
33741  * then @path is assumed to be NUL-terminated.) For example, if @path
33742  * was "test", then calling g_socket_address_get_native_size() on the
33743  * returned socket would return 7 (2 bytes of overhead, 1 byte for the
33744  * abstract-socket indicator byte, and 4 bytes for the name "test").
33745  *
33746  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
33747  * @path_len bytes of @path will be copied to the socket's path, the
33748  * rest of the path will be padded with 0 bytes, and the entire
33749  * zero-padded buffer will be considered the name. (As above, if
33750  * @path_len is -1, then @path is assumed to be NUL-terminated.) In
33751  * this case, g_socket_address_get_native_size() will always return
33752  * the full size of a <literal>struct sockaddr_un</literal>, although
33753  * g_unix_socket_address_get_path_len() will still return just the
33754  * length of @path.
33755  *
33756  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
33757  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
33758  * when connecting to a server created by another process, you must
33759  * use the appropriate type corresponding to how that process created
33760  * its listening socket.
33761  *
33762  * Returns: a new #GUnixSocketAddress
33763  * Since: 2.26
33764  */
33765
33766
33767 /**
33768  * g_vfs_get_default:
33769  *
33770  * Gets the default #GVfs for the system.
33771  *
33772  * Returns: (transfer none): a #GVfs.
33773  */
33774
33775
33776 /**
33777  * g_vfs_get_file_for_path:
33778  * @vfs: a #GVfs.
33779  * @path: a string containing a VFS path.
33780  *
33781  * Gets a #GFile for @path.
33782  *
33783  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33784  */
33785
33786
33787 /**
33788  * g_vfs_get_file_for_uri:
33789  * @vfs: a#GVfs.
33790  * @uri: a string containing a URI
33791  *
33792  * Gets a #GFile for @uri.
33793  *
33794  * This operation never fails, but the returned object
33795  * might not support any I/O operation if the URI
33796  * is malformed or if the URI scheme is not supported.
33797  *
33798  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33799  */
33800
33801
33802 /**
33803  * g_vfs_get_local:
33804  *
33805  * Gets the local #GVfs for the system.
33806  *
33807  * Returns: (transfer none): a #GVfs.
33808  */
33809
33810
33811 /**
33812  * g_vfs_get_supported_uri_schemes:
33813  * @vfs: a #GVfs.
33814  *
33815  * Gets a list of URI schemes supported by @vfs.
33816  *
33817  * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
33818  */
33819
33820
33821 /**
33822  * g_vfs_is_active:
33823  * @vfs: a #GVfs.
33824  *
33825  * Checks if the VFS is active.
33826  *
33827  * Returns: %TRUE if construction of the @vfs was successful and it is now active.
33828  */
33829
33830
33831 /**
33832  * g_vfs_parse_name:
33833  * @vfs: a #GVfs.
33834  * @parse_name: a string to be parsed by the VFS module.
33835  *
33836  * This operation never fails, but the returned object might
33837  * not support any I/O operations if the @parse_name cannot
33838  * be parsed by the #GVfs module.
33839  *
33840  * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
33841  */
33842
33843
33844 /**
33845  * g_volume_can_eject:
33846  * @volume: a #GVolume.
33847  *
33848  * Checks if a volume can be ejected.
33849  *
33850  * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
33851  */
33852
33853
33854 /**
33855  * g_volume_can_mount:
33856  * @volume: a #GVolume.
33857  *
33858  * Checks if a volume can be mounted.
33859  *
33860  * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
33861  */
33862
33863
33864 /**
33865  * g_volume_eject:
33866  * @volume: a #GVolume.
33867  * @flags: flags affecting the unmount if required for eject
33868  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33869  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33870  * @user_data: user data that gets passed to @callback
33871  *
33872  * Ejects a volume. This is an asynchronous operation, and is
33873  * finished by calling g_volume_eject_finish() with the @volume
33874  * and #GAsyncResult returned in the @callback.
33875  *
33876  * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
33877  */
33878
33879
33880 /**
33881  * g_volume_eject_finish:
33882  * @volume: pointer to a #GVolume.
33883  * @result: a #GAsyncResult.
33884  * @error: a #GError location to store an error, or %NULL to ignore
33885  *
33886  * Finishes ejecting a volume. If any errors occurred during the operation,
33887  * @error will be set to contain the errors and %FALSE will be returned.
33888  *
33889  * Returns: %TRUE, %FALSE if operation failed.
33890  * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
33891  */
33892
33893
33894 /**
33895  * g_volume_eject_with_operation:
33896  * @volume: a #GVolume.
33897  * @flags: flags affecting the unmount if required for eject
33898  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33899  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33900  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33901  * @user_data: user data passed to @callback.
33902  *
33903  * Ejects a volume. This is an asynchronous operation, and is
33904  * finished by calling g_volume_eject_with_operation_finish() with the @volume
33905  * and #GAsyncResult data returned in the @callback.
33906  *
33907  * Since: 2.22
33908  */
33909
33910
33911 /**
33912  * g_volume_eject_with_operation_finish:
33913  * @volume: a #GVolume.
33914  * @result: a #GAsyncResult.
33915  * @error: a #GError location to store the error occurring, or %NULL to ignore.
33916  *
33917  * Finishes ejecting a volume. If any errors occurred during the operation,
33918  * @error will be set to contain the errors and %FALSE will be returned.
33919  *
33920  * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
33921  * Since: 2.22
33922  */
33923
33924
33925 /**
33926  * g_volume_enumerate_identifiers:
33927  * @volume: a #GVolume
33928  *
33929  * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
33930  * that @volume has. Use g_volume_get_identifier() to obtain
33931  * the identifiers themselves.
33932  *
33933  * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
33934  */
33935
33936
33937 /**
33938  * g_volume_get_activation_root:
33939  * @volume: a #GVolume
33940  *
33941  * Gets the activation root for a #GVolume if it is known ahead of
33942  * mount time. Returns %NULL otherwise. If not %NULL and if @volume
33943  * is mounted, then the result of g_mount_get_root() on the
33944  * #GMount object obtained from g_volume_get_mount() will always
33945  * either be equal or a prefix of what this function returns. In
33946  * other words, in code
33947  *
33948  * <programlisting>
33949  *   GMount *mount;
33950  *   GFile *mount_root
33951  *   GFile *volume_activation_root;
33952  *
33953  *   mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
33954  *   mount_root = g_mount_get_root (mount);
33955  *   volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
33956  * </programlisting>
33957  *
33958  * then the expression
33959  *
33960  * <programlisting>
33961  *   (g_file_has_prefix (volume_activation_root, mount_root) ||
33962  *       g_file_equal (volume_activation_root, mount_root))
33963  * </programlisting>
33964  *
33965  * will always be %TRUE.
33966  *
33967  * Activation roots are typically used in #GVolumeMonitor
33968  * implementations to find the underlying mount to shadow, see
33969  * g_mount_is_shadowed() for more details.
33970  *
33971  * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
33972  * Since: 2.18
33973  */
33974
33975
33976 /**
33977  * g_volume_get_drive:
33978  * @volume: a #GVolume.
33979  *
33980  * Gets the drive for the @volume.
33981  *
33982  * 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.
33983  */
33984
33985
33986 /**
33987  * g_volume_get_icon:
33988  * @volume: a #GVolume.
33989  *
33990  * Gets the icon for @volume.
33991  *
33992  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33993  */
33994
33995
33996 /**
33997  * g_volume_get_identifier:
33998  * @volume: a #GVolume
33999  * @kind: the kind of identifier to return
34000  *
34001  * Gets the identifier of the given kind for @volume.
34002  * See the <link linkend="volume-identifier">introduction</link>
34003  * for more information about volume identifiers.
34004  *
34005  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
34006  */
34007
34008
34009 /**
34010  * g_volume_get_mount:
34011  * @volume: a #GVolume.
34012  *
34013  * Gets the mount for the @volume.
34014  *
34015  * 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.
34016  */
34017
34018
34019 /**
34020  * g_volume_get_name:
34021  * @volume: a #GVolume.
34022  *
34023  * Gets the name of @volume.
34024  *
34025  * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
34026  */
34027
34028
34029 /**
34030  * g_volume_get_sort_key:
34031  * @volume: A #GVolume.
34032  *
34033  * Gets the sort key for @volume, if any.
34034  *
34035  * Returns: Sorting key for @volume or %NULL if no such key is available.
34036  * Since: 2.32
34037  */
34038
34039
34040 /**
34041  * g_volume_get_symbolic_icon:
34042  * @volume: a #GVolume.
34043  *
34044  * Gets the symbolic icon for @volume.
34045  *
34046  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
34047  * Since: 2.34
34048  */
34049
34050
34051 /**
34052  * g_volume_get_uuid:
34053  * @volume: a #GVolume.
34054  *
34055  * Gets the UUID for the @volume. The reference is typically based on
34056  * the file system UUID for the volume in question and should be
34057  * considered an opaque string. Returns %NULL if there is no UUID
34058  * available.
34059  *
34060  * 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.
34061  */
34062
34063
34064 /**
34065  * g_volume_monitor_adopt_orphan_mount:
34066  * @mount: a #GMount object to find a parent for
34067  *
34068  * This function should be called by any #GVolumeMonitor
34069  * implementation when a new #GMount object is created that is not
34070  * associated with a #GVolume object. It must be called just before
34071  * emitting the @mount_added signal.
34072  *
34073  * If the return value is not %NULL, the caller must associate the
34074  * returned #GVolume object with the #GMount. This involves returning
34075  * it in its g_mount_get_volume() implementation. The caller must
34076  * also listen for the "removed" signal on the returned object
34077  * and give up its reference when handling that signal
34078  *
34079  * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
34080  * the implementor must take a reference to @mount and return it in
34081  * its g_volume_get_mount() implemented. Also, the implementor must
34082  * listen for the "unmounted" signal on @mount and give up its
34083  * reference upon handling that signal.
34084  *
34085  * There are two main use cases for this function.
34086  *
34087  * One is when implementing a user space file system driver that reads
34088  * blocks of a block device that is already represented by the native
34089  * volume monitor (for example a CD Audio file system driver). Such
34090  * a driver will generate its own #GMount object that needs to be
34091  * associated with the #GVolume object that represents the volume.
34092  *
34093  * The other is for implementing a #GVolumeMonitor whose sole purpose
34094  * is to return #GVolume objects representing entries in the users
34095  * "favorite servers" list or similar.
34096  *
34097  * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
34098  * 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.
34099  */
34100
34101
34102 /**
34103  * g_volume_monitor_get:
34104  *
34105  * Gets the volume monitor used by gio.
34106  *
34107  * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
34108  */
34109
34110
34111 /**
34112  * g_volume_monitor_get_connected_drives:
34113  * @volume_monitor: a #GVolumeMonitor.
34114  *
34115  * Gets a list of drives connected to the system.
34116  *
34117  * The returned list should be freed with g_list_free(), after
34118  * its elements have been unreffed with g_object_unref().
34119  *
34120  * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
34121  */
34122
34123
34124 /**
34125  * g_volume_monitor_get_mount_for_uuid:
34126  * @volume_monitor: a #GVolumeMonitor.
34127  * @uuid: the UUID to look for
34128  *
34129  * Finds a #GMount object by its UUID (see g_mount_get_uuid())
34130  *
34131  * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
34132  */
34133
34134
34135 /**
34136  * g_volume_monitor_get_mounts:
34137  * @volume_monitor: a #GVolumeMonitor.
34138  *
34139  * Gets a list of the mounts on the system.
34140  *
34141  * The returned list should be freed with g_list_free(), after
34142  * its elements have been unreffed with g_object_unref().
34143  *
34144  * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
34145  */
34146
34147
34148 /**
34149  * g_volume_monitor_get_volume_for_uuid:
34150  * @volume_monitor: a #GVolumeMonitor.
34151  * @uuid: the UUID to look for
34152  *
34153  * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
34154  *
34155  * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
34156  */
34157
34158
34159 /**
34160  * g_volume_monitor_get_volumes:
34161  * @volume_monitor: a #GVolumeMonitor.
34162  *
34163  * Gets a list of the volumes on the system.
34164  *
34165  * The returned list should be freed with g_list_free(), after
34166  * its elements have been unreffed with g_object_unref().
34167  *
34168  * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
34169  */
34170
34171
34172 /**
34173  * g_volume_mount:
34174  * @volume: a #GVolume.
34175  * @flags: flags affecting the operation
34176  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
34177  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
34178  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
34179  * @user_data: user data that gets passed to @callback
34180  *
34181  * Mounts a volume. This is an asynchronous operation, and is
34182  * finished by calling g_volume_mount_finish() with the @volume
34183  * and #GAsyncResult returned in the @callback.
34184  *
34185  * Virtual: mount_fn
34186  */
34187
34188
34189 /**
34190  * g_volume_mount_finish:
34191  * @volume: a #GVolume
34192  * @result: a #GAsyncResult
34193  * @error: a #GError location to store an error, or %NULL to ignore
34194  *
34195  * Finishes mounting a volume. If any errors occurred during the operation,
34196  * @error will be set to contain the errors and %FALSE will be returned.
34197  *
34198  * If the mount operation succeeded, g_volume_get_mount() on @volume
34199  * is guaranteed to return the mount right after calling this
34200  * function; there's no need to listen for the 'mount-added' signal on
34201  * #GVolumeMonitor.
34202  *
34203  * Returns: %TRUE, %FALSE if operation failed.
34204  */
34205
34206
34207 /**
34208  * g_volume_should_automount:
34209  * @volume: a #GVolume
34210  *
34211  * Returns whether the volume should be automatically mounted.
34212  *
34213  * Returns: %TRUE if the volume should be automatically mounted.
34214  */
34215
34216
34217 /**
34218  * g_win32_input_stream_get_close_handle:
34219  * @stream: a #GWin32InputStream
34220  *
34221  * Returns whether the handle of @stream will be
34222  * closed when the stream is closed.
34223  *
34224  * Returns: %TRUE if the handle is closed when done
34225  * Since: 2.26
34226  */
34227
34228
34229 /**
34230  * g_win32_input_stream_get_handle:
34231  * @stream: a #GWin32InputStream
34232  *
34233  * Return the Windows file handle that the stream reads from.
34234  *
34235  * Returns: The file handle of @stream
34236  * Since: 2.26
34237  */
34238
34239
34240 /**
34241  * g_win32_input_stream_new:
34242  * @handle: a Win32 file handle
34243  * @close_handle: %TRUE to close the handle when done
34244  *
34245  * Creates a new #GWin32InputStream for the given @handle.
34246  *
34247  * If @close_handle is %TRUE, the handle will be closed
34248  * when the stream is closed.
34249  *
34250  * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
34251  * as used in the Windows C libraries.
34252  *
34253  * Returns: a new #GWin32InputStream
34254  */
34255
34256
34257 /**
34258  * g_win32_input_stream_set_close_handle:
34259  * @stream: a #GWin32InputStream
34260  * @close_handle: %TRUE to close the handle when done
34261  *
34262  * Sets whether the handle of @stream shall be closed
34263  * when the stream is closed.
34264  *
34265  * Since: 2.26
34266  */
34267
34268
34269 /**
34270  * g_win32_output_stream_get_close_handle:
34271  * @stream: a #GWin32OutputStream
34272  *
34273  * Returns whether the handle of @stream will be closed when the
34274  * stream is closed.
34275  *
34276  * Returns: %TRUE if the handle is closed when done
34277  * Since: 2.26
34278  */
34279
34280
34281 /**
34282  * g_win32_output_stream_get_handle:
34283  * @stream: a #GWin32OutputStream
34284  *
34285  * Return the Windows handle that the stream writes to.
34286  *
34287  * Returns: The handle descriptor of @stream
34288  * Since: 2.26
34289  */
34290
34291
34292 /**
34293  * g_win32_output_stream_new:
34294  * @handle: a Win32 file handle
34295  * @close_handle: %TRUE to close the handle when done
34296  *
34297  * Creates a new #GWin32OutputStream for the given @handle.
34298  *
34299  * If @close_handle, is %TRUE, the handle will be closed when the
34300  * output stream is destroyed.
34301  *
34302  * Returns: a new #GOutputStream
34303  * Since: 2.26
34304  */
34305
34306
34307 /**
34308  * g_win32_output_stream_set_close_handle:
34309  * @stream: a #GWin32OutputStream
34310  * @close_handle: %TRUE to close the handle when done
34311  *
34312  * Sets whether the handle of @stream shall be closed when the stream
34313  * is closed.
34314  *
34315  * Since: 2.26
34316  */
34317
34318
34319 /**
34320  * g_zlib_compressor_get_file_info:
34321  * @compressor: a #GZlibCompressor
34322  *
34323  * Returns the #GZlibCompressor:file-info property.
34324  *
34325  * Returns: (transfer none): a #GFileInfo, or %NULL
34326  * Since: 2.26
34327  */
34328
34329
34330 /**
34331  * g_zlib_compressor_new:
34332  * @format: The format to use for the compressed data
34333  * @level: compression level (0-9), -1 for default
34334  *
34335  * Creates a new #GZlibCompressor.
34336  *
34337  * Returns: a new #GZlibCompressor
34338  * Since: 2.24
34339  */
34340
34341
34342 /**
34343  * g_zlib_compressor_set_file_info:
34344  * @compressor: a #GZlibCompressor
34345  * @file_info: (allow-none): a #GFileInfo
34346  *
34347  * Sets @file_info in @compressor. If non-%NULL, and @compressor's
34348  * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34349  * it will be used to set the file name and modification time in
34350  * the GZIP header of the compressed data.
34351  *
34352  * Note: it is an error to call this function while a compression is in
34353  * progress; it may only be called immediately after creation of @compressor,
34354  * or after resetting it with g_converter_reset().
34355  *
34356  * Since: 2.26
34357  */
34358
34359
34360 /**
34361  * g_zlib_decompressor_get_file_info:
34362  * @decompressor: a #GZlibDecompressor
34363  *
34364  * Retrieves the #GFileInfo constructed from the GZIP header data
34365  * of compressed data processed by @compressor, or %NULL if @decompressor's
34366  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34367  * or the header data was not fully processed yet, or it not present in the
34368  * data stream at all.
34369  *
34370  * Returns: (transfer none): a #GFileInfo, or %NULL
34371  * Since: 2.26
34372  */
34373
34374
34375 /**
34376  * g_zlib_decompressor_new:
34377  * @format: The format to use for the compressed data
34378  *
34379  * Creates a new #GZlibDecompressor.
34380  *
34381  * Returns: a new #GZlibDecompressor
34382  * Since: 2.24
34383  */
34384
34385
34386 /**
34387  * get_all_desktop_entries_for_mime_type:
34388  * @mime_type: a mime type.
34389  * @except: NULL or a strv list
34390  *
34391  * Returns all the desktop ids for @mime_type. The desktop files
34392  * are listed in an order so that default applications are listed before
34393  * non-default ones, and handlers for inherited mimetypes are listed
34394  * after the base ones.
34395  *
34396  * Optionally doesn't list the desktop ids given in the @except
34397  *
34398  * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
34399  */
34400
34401
34402 /**
34403  * mime_info_cache_reload:
34404  * @dir: directory path which needs reloading.
34405  *
34406  * Reload the mime information for the @dir.
34407  */
34408
34409
34410
34411 /************************************************************/
34412 /* THIS FILE IS GENERATED DO NOT EDIT */
34413 /************************************************************/