Update annotations from glib git
[platform/upstream/gobject-introspection.git] / gir / gio-2.0.c
1 /************************************************************/
2 /* THIS FILE IS GENERATED DO NOT EDIT */
3 /************************************************************/
4
5 /**
6  * GAction:enabled:
7  *
8  * If @action is currently enabled.
9  *
10  * If the action is disabled then calls to g_action_activate() and
11  * g_action_change_state() have no effect.
12  *
13  * Since: 2.28
14  */
15
16
17 /**
18  * GAction:name:
19  *
20  * The name of the action.  This is mostly meaningful for identifying
21  * the action once it has been added to a #GActionGroup.
22  *
23  * Since: 2.28
24  */
25
26
27 /**
28  * GAction:parameter-type:
29  *
30  * The type of the parameter that must be given when activating the
31  * action.
32  *
33  * Since: 2.28
34  */
35
36
37 /**
38  * GAction:state:
39  *
40  * The state of the action, or %NULL if the action is stateless.
41  *
42  * Since: 2.28
43  */
44
45
46 /**
47  * GAction:state-type:
48  *
49  * The #GVariantType of the state that the action has, or %NULL if the
50  * action is stateless.
51  *
52  * Since: 2.28
53  */
54
55
56 /**
57  * GActionEntry:
58  * @name: the name of the action
59  * @activate: the callback to connect to the "activate" signal of the action
60  * @parameter_type: the type of the parameter that must be passed to the activate function for this action, given as a single GVariant type string (or %NULL for no parameter)
61  * @state: the initial state for this action, given in GVariant text format.  The state is parsed with no extra type information, so type tags must be added to the string if they are necessary.
62  * @change_state: the callback to connect to the "change-state" signal of the action
63  *
64  * This struct defines a single action.  It is for use with
65  * g_action_map_add_action_entries().
66  *
67  * The order of the items in the structure are intended to reflect
68  * frequency of use.  It is permissible to use an incomplete initialiser
69  * in order to leave some of the later values as %NULL.  All values
70  * after @name are optional.  Additional optional fields may be added in
71  * the future.
72  *
73  * See g_action_map_add_action_entries() for an example.
74  */
75
76
77 /**
78  * GActionGroup::action-added:
79  * @action_group: the #GActionGroup that changed
80  * @action_name: the name of the action in @action_group
81  *
82  * Signals that a new action was just added to the group.
83  * This signal is emitted after the action has been added
84  * and is now visible.
85  *
86  * Since: 2.28
87  */
88
89
90 /**
91  * GActionGroup::action-enabled-changed:
92  * @action_group: the #GActionGroup that changed
93  * @action_name: the name of the action in @action_group
94  * @enabled: whether the action is enabled or not
95  *
96  * Signals that the enabled status of the named action has changed.
97  *
98  * Since: 2.28
99  */
100
101
102 /**
103  * GActionGroup::action-removed:
104  * @action_group: the #GActionGroup that changed
105  * @action_name: the name of the action in @action_group
106  *
107  * Signals that an action is just about to be removed from the group.
108  * This signal is emitted before the action is removed, so the action
109  * is still visible and can be queried from the signal handler.
110  *
111  * Since: 2.28
112  */
113
114
115 /**
116  * GActionGroup::action-state-changed:
117  * @action_group: the #GActionGroup that changed
118  * @action_name: the name of the action in @action_group
119  * @value: the new value of the state
120  *
121  * Signals that the state of the named action has changed.
122  *
123  * Since: 2.28
124  */
125
126
127 /**
128  * GActionGroupInterface:
129  * @has_action: the virtual function pointer for g_action_group_has_action()
130  * @list_actions: the virtual function pointer for g_action_group_list_actions()
131  * @get_action_parameter_type: the virtual function pointer for g_action_group_get_action_parameter_type()
132  * @get_action_state_type: the virtual function pointer for g_action_group_get_action_state_type()
133  * @get_action_state_hint: the virtual function pointer for g_action_group_get_action_state_hint()
134  * @get_action_enabled: the virtual function pointer for g_action_group_get_action_enabled()
135  * @get_action_state: the virtual function pointer for g_action_group_get_action_state()
136  * @change_action_state: the virtual function pointer for g_action_group_change_action_state()
137  * @query_action: the virtual function pointer for g_action_group_query_action()
138  * @activate_action: the virtual function pointer for g_action_group_activate_action()
139  * @action_added: the class closure for the #GActionGroup::action-added signal
140  * @action_removed: the class closure for the #GActionGroup::action-removed signal
141  * @action_enabled_changed: the class closure for the #GActionGroup::action-enabled-changed signal
142  * @action_state_changed: the class closure for the #GActionGroup::action-enabled-changed signal
143  *
144  * The virtual function table for #GActionGroup.
145  *
146  * Since: 2.28
147  */
148
149
150 /**
151  * GActionInterface:
152  * @get_name: the virtual function pointer for g_action_get_name()
153  * @get_parameter_type: the virtual function pointer for g_action_get_parameter_type()
154  * @get_state_type: the virtual function pointer for g_action_get_state_type()
155  * @get_state_hint: the virtual function pointer for g_action_get_state_hint()
156  * @get_enabled: the virtual function pointer for g_action_get_enabled()
157  * @get_state: the virtual function pointer for g_action_get_state()
158  * @change_state: the virtual function pointer for g_action_change_state()
159  * @activate: the virtual function pointer for g_action_activate().  Note that #GAction does not have an 'activate' signal but that implementations of it may have one.
160  *
161  * The virtual function table for #GAction.
162  *
163  * Since: 2.28
164  */
165
166
167 /**
168  * GActionMapInterface:
169  * @lookup_action: the virtual function pointer for g_action_map_lookup_action()
170  * @add_action: the virtual function pointer for g_action_map_add_action()
171  * @remove_action: the virtual function pointer for g_action_map_remove_action()
172  *
173  * The virtual function table for #GActionMap.
174  *
175  * Since: 2.32
176  */
177
178
179 /**
180  * GApplication::activate:
181  * @application: the application
182  *
183  * The ::activate signal is emitted on the primary instance when an
184  * activation occurs. See g_application_activate().
185  */
186
187
188 /**
189  * GApplication::command-line:
190  * @application: the application
191  * @command_line: a #GApplicationCommandLine representing the passed commandline
192  *
193  * The ::command-line signal is emitted on the primary instance when
194  * a commandline is not handled locally. See g_application_run() and
195  * the #GApplicationCommandLine documentation for more information.
196  *
197  * Returns: An integer that is set as the exit status for the calling process. See g_application_command_line_set_exit_status().
198  */
199
200
201 /**
202  * GApplication::open:
203  * @application: the application
204  * @files: (array length=n_files) (element-type GFile): an array of #GFiles
205  * @n_files: the length of @files
206  * @hint: a hint provided by the calling instance
207  *
208  * The ::open signal is emitted on the primary instance when there are
209  * files to open. See g_application_open() for more information.
210  */
211
212
213 /**
214  * GApplication::shutdown:
215  * @application: the application
216  *
217  * The ::shutdown signal is emitted only on the registered primary instance
218  * immediately after the main loop terminates.
219  */
220
221
222 /**
223  * GApplication::startup:
224  * @application: the application
225  *
226  * The ::startup signal is emitted on the primary instance immediately
227  * after registration. See g_application_register().
228  */
229
230
231 /**
232  * GApplicationClass:
233  * @startup: invoked on the primary instance immediately after registration
234  * @shutdown: invoked only on the registered primary instance immediately after the main loop terminates
235  * @activate: invoked on the primary instance when an activation occurs
236  * @open: invoked on the primary instance when there are files to open
237  * @command_line: invoked on the primary instance when a command-line is not handled locally
238  * @local_command_line: invoked (locally) when the process has been invoked via commandline execution (as opposed to, say, D-Bus activation - which is not currently supported by GApplication). The virtual function has the chance to inspect (and possibly replace) the list of command line arguments. See g_application_run() for more information.
239  * @before_emit: invoked on the primary instance before 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
240  * @after_emit: invoked on the primary instance after 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
241  * @add_platform_data: invoked (locally) to add 'platform data' to be sent to the primary instance when activating, opening or invoking actions
242  * @quit_mainloop: Used to be invoked on the primary instance when the use count of the application drops to zero (and after any inactivity timeout, if requested). Not used anymore since 2.32
243  * @run_mainloop: Used to be invoked on the primary instance from g_application_run() if the use-count is non-zero. Since 2.32, GApplication is iterating the main context directly and is not using @run_mainloop anymore
244  * @dbus_register: invoked locally during registration, if the application is using its D-Bus backend. You can use this to export extra objects on the bus, that need to exist before the application tries to own the bus name. The function is passed the #GDBusConnection to to session bus, and the object path that #GApplication will use to export is D-Bus API. If this function returns %TRUE, registration will proceed; otherwise registration will abort. Since: 2.34
245  * @dbus_unregister: invoked locally during unregistration, if the application is using its D-Bus backend. Use this to undo anything done by the @dbus_register vfunc. Since: 2.34
246  *
247  * Virtual function table for #GApplication.
248  *
249  * Since: 2.28
250  */
251
252
253 /**
254  * GApplicationCommandLineClass:
255  *
256  * The <structname>GApplicationCommandLineClass</structname> structure
257  * contains private data only
258  *
259  * Since: 2.28
260  */
261
262
263 /**
264  * GCancellable::cancelled:
265  * @cancellable: a #GCancellable.
266  *
267  * Emitted when the operation has been cancelled.
268  *
269  * Can be used by implementations of cancellable operations. If the
270  * operation is cancelled from another thread, the signal will be
271  * emitted in the thread that cancelled the operation, not the
272  * thread that is running the operation.
273  *
274  * Note that disconnecting from this signal (or any signal) in a
275  * multi-threaded program is prone to race conditions. For instance
276  * it is possible that a signal handler may be invoked even
277  * <emphasis>after</emphasis> a call to
278  * g_signal_handler_disconnect() for that handler has already
279  * returned.
280  *
281  * There is also a problem when cancellation happen
282  * right before connecting to the signal. If this happens the
283  * signal will unexpectedly not be emitted, and checking before
284  * connecting to the signal leaves a race condition where this is
285  * still happening.
286  *
287  * In order to make it safe and easy to connect handlers there
288  * are two helper functions: g_cancellable_connect() and
289  * g_cancellable_disconnect() which protect against problems
290  * like this.
291  *
292  * An example of how to us this:
293  * |[
294  *     /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
295  *     if (g_cancellable_set_error_if_cancelled (cancellable))
296  *       return;
297  *
298  *     /<!-- -->* Set up all the data needed to be able to
299  *      * handle cancellation of the operation *<!-- -->/
300  *     my_data = my_data_new (...);
301  *
302  *     id = 0;
303  *     if (cancellable)
304  *       id = g_cancellable_connect (cancellable,
305  *                            G_CALLBACK (cancelled_handler)
306  *                            data, NULL);
307  *
308  *     /<!-- -->* cancellable operation here... *<!-- -->/
309  *
310  *     g_cancellable_disconnect (cancellable, id);
311  *
312  *     /<!-- -->* cancelled_handler is never called after this, it
313  *      * is now safe to free the data *<!-- -->/
314  *     my_data_free (my_data);
315  * ]|
316  *
317  * Note that the cancelled signal is emitted in the thread that
318  * the user cancelled from, which may be the main thread. So, the
319  * cancellable signal should not do something that can block.
320  */
321
322
323 /**
324  * GCharsetConverter:
325  *
326  * Conversions between character sets.
327  */
328
329
330 /**
331  * GCredentials:
332  *
333  * The #GCredentials structure contains only private data and
334  * should only be accessed using the provided API.
335  *
336  * Since: 2.26
337  */
338
339
340 /**
341  * GCredentialsClass:
342  *
343  * Class structure for #GCredentials.
344  *
345  * Since: 2.26
346  */
347
348
349 /**
350  * GDBusAuthMechanism:credentials:
351  *
352  * If authenticating as a server, this property contains the
353  * received credentials, if any.
354  *
355  * If authenticating as a client, the property contains the
356  * credentials that were sent, if any.
357  */
358
359
360 /**
361  * GDBusAuthObserver:
362  *
363  * The #GDBusAuthObserver structure contains only private data and
364  * should only be accessed using the provided API.
365  *
366  * Since: 2.26
367  */
368
369
370 /**
371  * GDBusAuthObserver::allow-mechanism:
372  * @observer: The #GDBusAuthObserver emitting the signal.
373  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
374  *
375  * Emitted to check if @mechanism is allowed to be used.
376  *
377  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
378  * Since: 2.34
379  */
380
381
382 /**
383  * GDBusAuthObserver::authorize-authenticated-peer:
384  * @observer: The #GDBusAuthObserver emitting the signal.
385  * @stream: A #GIOStream for the #GDBusConnection.
386  * @credentials: (allow-none): Credentials received from the peer or %NULL.
387  *
388  * Emitted to check if a peer that is successfully authenticated
389  * is authorized.
390  *
391  * Returns: %TRUE if the peer is authorized, %FALSE if not.
392  * Since: 2.26
393  */
394
395
396 /**
397  * GDBusAuthObserverClass:
398  * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
399  *
400  * Class structure for #GDBusAuthObserverClass.
401  *
402  * Since: 2.26
403  */
404
405
406 /**
407  * GDBusConnection:
408  *
409  * The #GDBusConnection structure contains only private data and
410  * should only be accessed using the provided API.
411  *
412  * Since: 2.26
413  */
414
415
416 /**
417  * GDBusConnection::closed:
418  * @connection: The #GDBusConnection emitting the signal.
419  * @remote_peer_vanished: %TRUE if @connection is closed because the remote peer closed its end of the connection.
420  * @error: (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  * GTestDBus:
2396  *
2397  * The #GTestDBus structure contains only private data and
2398  * should only be accessed using the provided API.
2399  *
2400  * Since: 2.34
2401  */
2402
2403
2404 /**
2405  * GTestDBus:flags:
2406  *
2407  * #GTestDBusFlags specifying the behaviour of the dbus session
2408  *
2409  * Since: 2.34
2410  */
2411
2412
2413 /**
2414  * GThemedIcon:name:
2415  *
2416  * The icon name.
2417  */
2418
2419
2420 /**
2421  * GThemedIcon:names:
2422  *
2423  * A %NULL-terminated array of icon names.
2424  */
2425
2426
2427 /**
2428  * GThemedIcon:use-default-fallbacks:
2429  *
2430  * Whether to use the default fallbacks found by shortening the icon name
2431  * at '-' characters. If the "names" array has more than one element,
2432  * ignores any past the first.
2433  *
2434  * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2435  * would become
2436  * |[
2437  * {
2438  *   "gnome-dev-cdrom-audio",
2439  *   "gnome-dev-cdrom",
2440  *   "gnome-dev",
2441  *   "gnome",
2442  *   NULL
2443  * };
2444  * ]|
2445  */
2446
2447
2448 /**
2449  * GThreadedSocketService::run:
2450  * @service: the #GThreadedSocketService.
2451  * @connection: a new #GSocketConnection object.
2452  * @source_object: the source_object passed to g_socket_listener_add_address().
2453  *
2454  * The ::run signal is emitted in a worker thread in response to an
2455  * incoming connection. This thread is dedicated to handling
2456  * @connection and may perform blocking IO. The signal handler need
2457  * not return until the connection is closed.
2458  *
2459  * Returns: %TRUE to stop further signal handlers from being called
2460  */
2461
2462
2463 /**
2464  * GTlsBackend:
2465  *
2466  * TLS (Transport Layer Security, aka SSL) backend. This is an
2467  * internal type used to coordinate the different classes implemented
2468  * by a TLS backend.
2469  *
2470  * Since: 2.28
2471  */
2472
2473
2474 /**
2475  * GTlsCertificate:
2476  *
2477  * Abstract base class for TLS certificate types.
2478  *
2479  * Since: 2.28
2480  */
2481
2482
2483 /**
2484  * GTlsCertificate:certificate:
2485  *
2486  * The DER (binary) encoded representation of the certificate.
2487  * This property and the #GTlsCertificate:certificate-pem property
2488  * represent the same data, just in different forms.
2489  *
2490  * Since: 2.28
2491  */
2492
2493
2494 /**
2495  * GTlsCertificate:certificate-pem:
2496  *
2497  * The PEM (ASCII) encoded representation of the certificate.
2498  * This property and the #GTlsCertificate:certificate
2499  * property represent the same data, just in different forms.
2500  *
2501  * Since: 2.28
2502  */
2503
2504
2505 /**
2506  * GTlsCertificate:issuer:
2507  *
2508  * A #GTlsCertificate representing the entity that issued this
2509  * certificate. If %NULL, this means that the certificate is either
2510  * self-signed, or else the certificate of the issuer is not
2511  * available.
2512  *
2513  * Since: 2.28
2514  */
2515
2516
2517 /**
2518  * GTlsCertificate:private-key:
2519  *
2520  * The DER (binary) encoded representation of the certificate's
2521  * private key, in either PKCS#1 format or unencrypted PKCS#8
2522  * format. This property (or the #GTlsCertificate:private-key-pem
2523  * property) can be set when constructing a key (eg, from a file),
2524  * but cannot be read.
2525  *
2526  * PKCS#8 format is supported since 2.32; earlier releases only
2527  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2528  * tool to convert PKCS#8 keys to PKCS#1.
2529  *
2530  * Since: 2.28
2531  */
2532
2533
2534 /**
2535  * GTlsCertificate:private-key-pem:
2536  *
2537  * The PEM (ASCII) encoded representation of the certificate's
2538  * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2539  * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2540  * PRIVATE KEY</literal>"). This property (or the
2541  * #GTlsCertificate:private-key property) can be set when
2542  * constructing a key (eg, from a file), but cannot be read.
2543  *
2544  * PKCS#8 format is supported since 2.32; earlier releases only
2545  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2546  * tool to convert PKCS#8 keys to PKCS#1.
2547  *
2548  * Since: 2.28
2549  */
2550
2551
2552 /**
2553  * GTlsClientConnection:
2554  *
2555  * Abstract base class for the backend-specific client connection
2556  * type.
2557  *
2558  * Since: 2.28
2559  */
2560
2561
2562 /**
2563  * GTlsClientConnection:accepted-cas:
2564  *
2565  * A list of the distinguished names of the Certificate Authorities
2566  * that the server will accept client certificates signed by. If the
2567  * server requests a client certificate during the handshake, then
2568  * this property will be set after the handshake completes.
2569  *
2570  * Each item in the list is a #GByteArray which contains the complete
2571  * subject DN of the certificate authority.
2572  *
2573  * Since: 2.28
2574  */
2575
2576
2577 /**
2578  * GTlsClientConnection:server-identity:
2579  *
2580  * A #GSocketConnectable describing the identity of the server that
2581  * is expected on the other end of the connection.
2582  *
2583  * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2584  * #GTlsClientConnection:validation-flags, this object will be used
2585  * to determine the expected identify of the remote end of the
2586  * connection; if #GTlsClientConnection:server-identity is not set,
2587  * or does not match the identity presented by the server, then the
2588  * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2589  *
2590  * In addition to its use in verifying the server certificate,
2591  * this is also used to give a hint to the server about what
2592  * certificate we expect, which is useful for servers that serve
2593  * virtual hosts.
2594  *
2595  * Since: 2.28
2596  */
2597
2598
2599 /**
2600  * GTlsClientConnection:use-ssl3:
2601  *
2602  * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2603  * to negotiate the best version of TLS or SSL to use. This can be
2604  * used when talking to servers that don't implement version
2605  * negotiation correctly and therefore refuse to handshake at all with
2606  * a "modern" TLS handshake.
2607  *
2608  * Since: 2.28
2609  */
2610
2611
2612 /**
2613  * GTlsClientConnection:validation-flags:
2614  *
2615  * What steps to perform when validating a certificate received from
2616  * a server. Server certificates that fail to validate in all of the
2617  * ways indicated here will be rejected unless the application
2618  * overrides the default via #GTlsConnection::accept-certificate.
2619  *
2620  * Since: 2.28
2621  */
2622
2623
2624 /**
2625  * GTlsConnection:
2626  *
2627  * Abstract base class for the backend-specific #GTlsClientConnection
2628  * and #GTlsServerConnection types.
2629  *
2630  * Since: 2.28
2631  */
2632
2633
2634 /**
2635  * GTlsConnection::accept-certificate:
2636  * @conn: a #GTlsConnection
2637  * @peer_cert: the peer's #GTlsCertificate
2638  * @errors: the problems with @peer_cert.
2639  *
2640  * Emitted during the TLS handshake after the peer certificate has
2641  * been received. You can examine @peer_cert's certification path by
2642  * calling g_tls_certificate_get_issuer() on it.
2643  *
2644  * For a client-side connection, @peer_cert is the server's
2645  * certificate, and the signal will only be emitted if the
2646  * certificate was not acceptable according to @conn's
2647  * #GTlsClientConnection:validation_flags. If you would like the
2648  * certificate to be accepted despite @errors, return %TRUE from the
2649  * signal handler. Otherwise, if no handler accepts the certificate,
2650  * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2651  *
2652  * For a server-side connection, @peer_cert is the certificate
2653  * presented by the client, if this was requested via the server's
2654  * #GTlsServerConnection:authentication_mode. On the server side,
2655  * the signal is always emitted when the client presents a
2656  * certificate, and the certificate will only be accepted if a
2657  * handler returns %TRUE.
2658  *
2659  * Note that if this signal is emitted as part of asynchronous I/O
2660  * in the main thread, then you should not attempt to interact with
2661  * the user before returning from the signal handler. If you want to
2662  * let the user decide whether or not to accept the certificate, you
2663  * would have to return %FALSE from the signal handler on the first
2664  * attempt, and then after the connection attempt returns a
2665  * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2666  * the user decides to accept the certificate, remember that fact,
2667  * create a new connection, and return %TRUE from the signal handler
2668  * the next time.
2669  *
2670  * If you are doing I/O in another thread, you do not
2671  * need to worry about this, and can simply block in the signal
2672  * handler until the UI thread returns an answer.
2673  *
2674  * 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.
2675  * Since: 2.28
2676  */
2677
2678
2679 /**
2680  * GTlsConnection:base-io-stream:
2681  *
2682  * The #GIOStream that the connection wraps
2683  *
2684  * Since: 2.28
2685  */
2686
2687
2688 /**
2689  * GTlsConnection:certificate:
2690  *
2691  * The connection's certificate; see
2692  * g_tls_connection_set_certificate().
2693  *
2694  * Since: 2.28
2695  */
2696
2697
2698 /**
2699  * GTlsConnection:database:
2700  *
2701  * The certificate database to use when verifying this TLS connection.
2702  * If no cerificate database is set, then the default database will be
2703  * used. See g_tls_backend_get_default_database().
2704  *
2705  * Since: 2.30
2706  */
2707
2708
2709 /**
2710  * GTlsConnection:interaction:
2711  *
2712  * A #GTlsInteraction object to be used when the connection or certificate
2713  * database need to interact with the user. This will be used to prompt the
2714  * user for passwords where necessary.
2715  *
2716  * Since: 2.30
2717  */
2718
2719
2720 /**
2721  * GTlsConnection:peer-certificate:
2722  *
2723  * The connection's peer's certificate, after the TLS handshake has
2724  * completed and the certificate has been accepted. Note in
2725  * particular that this is not yet set during the emission of
2726  * #GTlsConnection::accept-certificate.
2727  *
2728  * (You can watch for a #GObject::notify signal on this property to
2729  * detect when a handshake has occurred.)
2730  *
2731  * Since: 2.28
2732  */
2733
2734
2735 /**
2736  * GTlsConnection:peer-certificate-errors:
2737  *
2738  * The errors noticed-and-ignored while verifying
2739  * #GTlsConnection:peer-certificate. Normally this should be 0, but
2740  * it may not be if #GTlsClientConnection:validation-flags is not
2741  * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2742  * #GTlsConnection::accept-certificate overrode the default
2743  * behavior.
2744  *
2745  * Since: 2.28
2746  */
2747
2748
2749 /**
2750  * GTlsConnection:rehandshake-mode:
2751  *
2752  * The rehandshaking mode. See
2753  * g_tls_connection_set_rehandshake_mode().
2754  *
2755  * Since: 2.28
2756  */
2757
2758
2759 /**
2760  * GTlsConnection:require-close-notify:
2761  *
2762  * Whether or not proper TLS close notification is required.
2763  * See g_tls_connection_set_require_close_notify().
2764  *
2765  * Since: 2.28
2766  */
2767
2768
2769 /**
2770  * GTlsConnection:use-system-certdb:
2771  *
2772  * Whether or not the system certificate database will be used to
2773  * verify peer certificates. See
2774  * g_tls_connection_set_use_system_certdb().
2775  *
2776  * Deprecated: 2.30: Use GTlsConnection:database instead
2777  */
2778
2779
2780 /**
2781  * GTlsDatabase:
2782  *
2783  * Abstract base class for the backend-specific database types.
2784  *
2785  * Since: 2.30
2786  */
2787
2788
2789 /**
2790  * GTlsFileDatabase:
2791  *
2792  * Implemented by a #GTlsDatabase which allows you to load certificates
2793  * from a file.
2794  *
2795  * Since: 2.30
2796  */
2797
2798
2799 /**
2800  * GTlsFileDatabase:anchors:
2801  *
2802  * The path to a file containing PEM encoded certificate authority
2803  * root anchors. The certificates in this file will be treated as
2804  * root authorities for the purpose of verifying other certificates
2805  * via the g_tls_database_verify_chain() operation.
2806  *
2807  * Since: 2.30
2808  */
2809
2810
2811 /**
2812  * GTlsInteraction:
2813  *
2814  * An object representing interaction that the TLS connection and database
2815  * might have with the user.
2816  *
2817  * Since: 2.30
2818  */
2819
2820
2821 /**
2822  * GTlsInteractionClass:
2823  * @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.
2824  * @ask_password_async: ask for a password asynchronously.
2825  * @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.
2826  *
2827  * The class for #GTlsInteraction. Derived classes implement the various
2828  * virtual interaction methods to handle TLS interactions.
2829  *
2830  * Derived classes can choose to implement whichever interactions methods they'd
2831  * like to support by overriding those virtual methods in their class
2832  * initialization function. If a derived class implements an async method,
2833  * it must also implement the corresponding finish method.
2834  *
2835  * The synchronous interaction methods should implement to display modal dialogs,
2836  * and the asynchronous methods to display modeless dialogs.
2837  *
2838  * If the user cancels an interaction, then the result should be
2839  * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2840  * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2841  *
2842  * Since: 2.30
2843  */
2844
2845
2846 /**
2847  * GTlsPassword:
2848  *
2849  * An abstract interface representing a password used in TLS. Often used in
2850  * user interaction such as unlocking a key storage token.
2851  *
2852  * Since: 2.30
2853  */
2854
2855
2856 /**
2857  * GTlsServerConnection:authentication-mode:
2858  *
2859  * The #GTlsAuthenticationMode for the server. This can be changed
2860  * before calling g_tls_connection_handshake() if you want to
2861  * rehandshake with a different mode from the initial handshake.
2862  *
2863  * Since: 2.28
2864  */
2865
2866
2867 /**
2868  * GUnixCredentialsMessage:credentials:
2869  *
2870  * The credentials stored in the message.
2871  *
2872  * Since: 2.26
2873  */
2874
2875
2876 /**
2877  * GUnixInputStream:close-fd:
2878  *
2879  * Whether to close the file descriptor when the stream is closed.
2880  *
2881  * Since: 2.20
2882  */
2883
2884
2885 /**
2886  * GUnixInputStream:fd:
2887  *
2888  * The file descriptor that the stream reads from.
2889  *
2890  * Since: 2.20
2891  */
2892
2893
2894 /**
2895  * GUnixMountMonitor::mountpoints-changed:
2896  * @monitor: the object on which the signal is emitted
2897  *
2898  * Emitted when the unix mount points have changed.
2899  */
2900
2901
2902 /**
2903  * GUnixMountMonitor::mounts-changed:
2904  * @monitor: the object on which the signal is emitted
2905  *
2906  * Emitted when the unix mounts have changed.
2907  */
2908
2909
2910 /**
2911  * GUnixOutputStream:close-fd:
2912  *
2913  * Whether to close the file descriptor when the stream is closed.
2914  *
2915  * Since: 2.20
2916  */
2917
2918
2919 /**
2920  * GUnixOutputStream:fd:
2921  *
2922  * The file descriptor that the stream writes to.
2923  *
2924  * Since: 2.20
2925  */
2926
2927
2928 /**
2929  * GUnixSocketAddress:
2930  *
2931  * A UNIX-domain (local) socket address, corresponding to a
2932  * <type>struct sockaddr_un</type>.
2933  */
2934
2935
2936 /**
2937  * GUnixSocketAddress:abstract:
2938  *
2939  * Whether or not this is an abstract address
2940  *
2941  * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
2942  */
2943
2944
2945 /**
2946  * GVolume::changed:
2947  *
2948  * Emitted when the volume has been changed.
2949  */
2950
2951
2952 /**
2953  * GVolume::removed:
2954  *
2955  * This signal is emitted when the #GVolume have been removed. If
2956  * the recipient is holding references to the object they should
2957  * release them so the object can be finalized.
2958  */
2959
2960
2961 /**
2962  * GVolumeMonitor::drive-changed:
2963  * @volume_monitor: The volume monitor emitting the signal.
2964  * @drive: the drive that changed
2965  *
2966  * Emitted when a drive changes.
2967  */
2968
2969
2970 /**
2971  * GVolumeMonitor::drive-connected:
2972  * @volume_monitor: The volume monitor emitting the signal.
2973  * @drive: a #GDrive that was connected.
2974  *
2975  * Emitted when a drive is connected to the system.
2976  */
2977
2978
2979 /**
2980  * GVolumeMonitor::drive-disconnected:
2981  * @volume_monitor: The volume monitor emitting the signal.
2982  * @drive: a #GDrive that was disconnected.
2983  *
2984  * Emitted when a drive is disconnected from the system.
2985  */
2986
2987
2988 /**
2989  * GVolumeMonitor::drive-eject-button:
2990  * @volume_monitor: The volume monitor emitting the signal.
2991  * @drive: the drive where the eject button was pressed
2992  *
2993  * Emitted when the eject button is pressed on @drive.
2994  *
2995  * Since: 2.18
2996  */
2997
2998
2999 /**
3000  * GVolumeMonitor::drive-stop-button:
3001  * @volume_monitor: The volume monitor emitting the signal.
3002  * @drive: the drive where the stop button was pressed
3003  *
3004  * Emitted when the stop button is pressed on @drive.
3005  *
3006  * Since: 2.22
3007  */
3008
3009
3010 /**
3011  * GVolumeMonitor::mount-added:
3012  * @volume_monitor: The volume monitor emitting the signal.
3013  * @mount: a #GMount that was added.
3014  *
3015  * Emitted when a mount is added.
3016  */
3017
3018
3019 /**
3020  * GVolumeMonitor::mount-changed:
3021  * @volume_monitor: The volume monitor emitting the signal.
3022  * @mount: a #GMount that changed.
3023  *
3024  * Emitted when a mount changes.
3025  */
3026
3027
3028 /**
3029  * GVolumeMonitor::mount-pre-unmount:
3030  * @volume_monitor: The volume monitor emitting the signal.
3031  * @mount: a #GMount that is being unmounted.
3032  *
3033  * Emitted when a mount is about to be removed.
3034  */
3035
3036
3037 /**
3038  * GVolumeMonitor::mount-removed:
3039  * @volume_monitor: The volume monitor emitting the signal.
3040  * @mount: a #GMount that was removed.
3041  *
3042  * Emitted when a mount is removed.
3043  */
3044
3045
3046 /**
3047  * GVolumeMonitor::volume-added:
3048  * @volume_monitor: The volume monitor emitting the signal.
3049  * @volume: a #GVolume that was added.
3050  *
3051  * Emitted when a mountable volume is added to the system.
3052  */
3053
3054
3055 /**
3056  * GVolumeMonitor::volume-changed:
3057  * @volume_monitor: The volume monitor emitting the signal.
3058  * @volume: a #GVolume that changed.
3059  *
3060  * Emitted when mountable volume is changed.
3061  */
3062
3063
3064 /**
3065  * GVolumeMonitor::volume-removed:
3066  * @volume_monitor: The volume monitor emitting the signal.
3067  * @volume: a #GVolume that was removed.
3068  *
3069  * Emitted when a mountable volume is removed from the system.
3070  */
3071
3072
3073 /**
3074  * GWin32InputStream:close-handle:
3075  *
3076  * Whether to close the file handle when the stream is closed.
3077  *
3078  * Since: 2.26
3079  */
3080
3081
3082 /**
3083  * GWin32InputStream:handle:
3084  *
3085  * The handle that the stream reads from.
3086  *
3087  * Since: 2.26
3088  */
3089
3090
3091 /**
3092  * GWin32OutputStream:close-handle:
3093  *
3094  * Whether to close the file handle when the stream is closed.
3095  *
3096  * Since: 2.26
3097  */
3098
3099
3100 /**
3101  * GWin32OutputStream:handle:
3102  *
3103  * The file handle that the stream writes to.
3104  *
3105  * Since: 2.26
3106  */
3107
3108
3109 /**
3110  * GZlibCompressor:
3111  *
3112  * Zlib decompression
3113  */
3114
3115
3116 /**
3117  * GZlibCompressor:file-info:
3118  *
3119  * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3120  * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3121  * and modification time from the file info to the GZIP header.
3122  *
3123  * Since: 2.26
3124  */
3125
3126
3127 /**
3128  * GZlibDecompressor:
3129  *
3130  * Zlib decompression
3131  */
3132
3133
3134 /**
3135  * GZlibDecompressor:file-info:
3136  *
3137  * A #GFileInfo containing the information found in the GZIP header
3138  * of the data stream processed, or %NULL if the header was not yet
3139  * fully processed, is not present at all, or the compressor's
3140  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3141  *
3142  * Since: 2.26
3143  */
3144
3145
3146 /**
3147  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3148  *
3149  * The purpose used to verify the client certificate in a TLS connection.
3150  * Used by TLS servers.
3151  */
3152
3153
3154 /**
3155  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3156  *
3157  * The purpose used to verify the server certificate in a TLS connection. This
3158  * is the most common purpose in use. Used by TLS clients.
3159  */
3160
3161
3162 /**
3163  * G_TYPE_SETTINGS_SCHEMA:
3164  *
3165  * A boxed #GType corresponding to #GSettingsSchema.
3166  *
3167  * Since: 2.32
3168  */
3169
3170
3171 /**
3172  * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3173  *
3174  * A boxed #GType corresponding to #GSettingsSchemaSource.
3175  *
3176  * Since: 2.32
3177  */
3178
3179
3180 /**
3181  * SECTION:_GFreedesktopDBus
3182  * @title: _GFreedesktopDBus
3183  * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface
3184  *
3185  * 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.
3186  */
3187
3188
3189 /**
3190  * SECTION:extensionpoints
3191  * @short_description: Extension Points
3192  * @include: gio.h
3193  * @see_also: <link linkend="extending-gio">Extending GIO</link>
3194  *
3195  * #GIOExtensionPoint provides a mechanism for modules to extend the
3196  * functionality of the library or application that loaded it in an
3197  * organized fashion.
3198  *
3199  * An extension point is identified by a name, and it may optionally
3200  * require that any implementation must by of a certain type (or derived
3201  * thereof). Use g_io_extension_point_register() to register an
3202  * extension point, and g_io_extension_point_set_required_type() to
3203  * set a required type.
3204  *
3205  * A module can implement an extension point by specifying the #GType
3206  * that implements the functionality. Additionally, each implementation
3207  * of an extension point has a name, and a priority. Use
3208  * g_io_extension_point_implement() to implement an extension point.
3209  *
3210  *  |[
3211  *  GIOExtensionPoint *ep;
3212  *
3213  *  /&ast; Register an extension point &ast;/
3214  *  ep = g_io_extension_point_register ("my-extension-point");
3215  *  g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3216  *  ]|
3217  *
3218  *  |[
3219  *  /&ast; Implement an extension point &ast;/
3220  *  G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3221  *  g_io_extension_point_implement ("my-extension-point",
3222  *                                  my_example_impl_get_type (),
3223  *                                  "my-example",
3224  *                                  10);
3225  *  ]|
3226  *
3227  *  It is up to the code that registered the extension point how
3228  *  it uses the implementations that have been associated with it.
3229  *  Depending on the use case, it may use all implementations, or
3230  *  only the one with the highest priority, or pick a specific
3231  *  one by name.
3232  *
3233  *  To avoid opening all modules just to find out what extension
3234  *  points they implement, GIO makes use of a caching mechanism,
3235  *  see <link linkend="gio-querymodules">gio-querymodules</link>.
3236  *  You are expected to run this command after installing a
3237  *  GIO module.
3238  *
3239  *  The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3240  *  used to specify additional directories to automatically load modules
3241  *  from. This environment variable has the same syntax as the
3242  *  <envar>PATH</envar>. If two modules have the same base name in different
3243  *  directories, then the latter one will be ignored. If additional
3244  *  directories are specified GIO will load modules from the built-in
3245  *  directory last.
3246  */
3247
3248
3249 /**
3250  * SECTION:gaction
3251  * @title: GAction
3252  * @short_description: An action interface
3253  *
3254  * #GAction represents a single named action.
3255  *
3256  * The main interface to an action is that it can be activated with
3257  * g_action_activate().  This results in the 'activate' signal being
3258  * emitted.  An activation has a #GVariant parameter (which may be
3259  * %NULL).  The correct type for the parameter is determined by a static
3260  * parameter type (which is given at construction time).
3261  *
3262  * An action may optionally have a state, in which case the state may be
3263  * set with g_action_change_state().  This call takes a #GVariant.  The
3264  * correct type for the state is determined by a static state type
3265  * (which is given at construction time).
3266  *
3267  * The state may have a hint associated with it, specifying its valid
3268  * range.
3269  *
3270  * #GAction is merely the interface to the concept of an action, as
3271  * described above.  Various implementations of actions exist, including
3272  * #GSimpleAction and #GtkAction.
3273  *
3274  * In all cases, the implementing class is responsible for storing the
3275  * name of the action, the parameter type, the enabled state, the
3276  * optional state type and the state and emitting the appropriate
3277  * signals when these change.  The implementor responsible for filtering
3278  * calls to g_action_activate() and g_action_change_state() for type
3279  * safety and for the state being enabled.
3280  *
3281  * Probably the only useful thing to do with a #GAction is to put it
3282  * inside of a #GSimpleActionGroup.
3283  */
3284
3285
3286 /**
3287  * SECTION:gactiongroup
3288  * @title: GActionGroup
3289  * @short_description: A group of actions
3290  * @see_also: #GAction
3291  *
3292  * #GActionGroup represents a group of actions. Actions can be used to
3293  * expose functionality in a structured way, either from one part of a
3294  * program to another, or to the outside world. Action groups are often
3295  * used together with a #GMenuModel that provides additional
3296  * representation data for displaying the actions to the user, e.g. in
3297  * a menu.
3298  *
3299  * The main way to interact with the actions in a GActionGroup is to
3300  * activate them with g_action_group_activate_action(). Activating an
3301  * action may require a #GVariant parameter. The required type of the
3302  * parameter can be inquired with g_action_group_get_action_parameter_type().
3303  * Actions may be disabled, see g_action_group_get_action_enabled().
3304  * Activating a disabled action has no effect.
3305  *
3306  * Actions may optionally have a state in the form of a #GVariant. The
3307  * current state of an action can be inquired with
3308  * g_action_group_get_action_state(). Activating a stateful action may
3309  * change its state, but it is also possible to set the state by calling
3310  * g_action_group_change_action_state().
3311  *
3312  * As typical example, consider a text editing application which has an
3313  * option to change the current font to 'bold'. A good way to represent
3314  * this would be a stateful action, with a boolean state. Activating the
3315  * action would toggle the state.
3316  *
3317  * Each action in the group has a unique name (which is a string).  All
3318  * method calls, except g_action_group_list_actions() take the name of
3319  * an action as an argument.
3320  *
3321  * The #GActionGroup API is meant to be the 'public' API to the action
3322  * group.  The calls here are exactly the interaction that 'external
3323  * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3324  * with actions.  'Internal' APIs (ie: ones meant only to be accessed by
3325  * the action group implementation) are found on subclasses.  This is
3326  * why you will find - for example - g_action_group_get_action_enabled()
3327  * but not an equivalent <function>set()</function> call.
3328  *
3329  * Signals are emitted on the action group in response to state changes
3330  * on individual actions.
3331  *
3332  * Implementations of #GActionGroup should provide implementations for
3333  * the virtual functions g_action_group_list_actions() and
3334  * g_action_group_query_action().  The other virtual functions should
3335  * not be implemented - their "wrappers" are actually implemented with
3336  * calls to g_action_group_query_action().
3337  */
3338
3339
3340 /**
3341  * SECTION:gactiongroupexporter
3342  * @title: GActionGroup exporter
3343  * @short_description: Export GActionGroups on D-Bus
3344  * @see_also: #GActionGroup, #GDBusActionGroup
3345  *
3346  * These functions support exporting a #GActionGroup on D-Bus.
3347  * The D-Bus interface that is used is a private implementation
3348  * detail.
3349  *
3350  * To access an exported #GActionGroup remotely, use
3351  * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3352  */
3353
3354
3355 /**
3356  * SECTION:gactionmap
3357  * @title: GActionMap
3358  * @short_description: Interface for action containers
3359  *
3360  * The GActionMap interface is implemented by #GActionGroup
3361  * implementations that operate by containing a number of
3362  * named #GAction instances, such as #GSimpleActionGroup.
3363  *
3364  * One useful application of this interface is to map the
3365  * names of actions from various action groups to unique,
3366  * prefixed names (e.g. by prepending "app." or "win.").
3367  * This is the motivation for the 'Map' part of the interface
3368  * name.
3369  *
3370  * Since: 2.32
3371  */
3372
3373
3374 /**
3375  * SECTION:gappinfo
3376  * @short_description: Application information and launch contexts
3377  * @include: gio/gio.h
3378  *
3379  * #GAppInfo and #GAppLaunchContext are used for describing and launching
3380  * applications installed on the system.
3381  *
3382  * As of GLib 2.20, URIs will always be converted to POSIX paths
3383  * (using g_file_get_path()) when using g_app_info_launch() even if
3384  * the application requested an URI and not a POSIX path. For example
3385  * for an desktop-file based application with Exec key <literal>totem
3386  * &percnt;U</literal> and a single URI,
3387  * <literal>sftp://foo/file.avi</literal>, then
3388  * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3389  * passed. This will only work if a set of suitable GIO extensions
3390  * (such as gvfs 2.26 compiled with FUSE support), is available and
3391  * operational; if this is not the case, the URI will be passed
3392  * unmodified to the application. Some URIs, such as
3393  * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3394  * path (in gvfs there's no FUSE mount for it); such URIs will be
3395  * passed unmodified to the application.
3396  *
3397  * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3398  * back to the GIO URI in the #GFile constructors (since gvfs
3399  * implements the #GVfs extension point). As such, if the application
3400  * needs to examine the URI, it needs to use g_file_get_uri() or
3401  * similar on #GFile. In other words, an application cannot assume
3402  * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3403  * equal to the result of g_file_get_uri(). The following snippet
3404  * illustrates this:
3405  *
3406  * <programlisting>
3407  * GFile *f;
3408  * char *uri;
3409  *
3410  * file = g_file_new_for_commandline_arg (uri_from_commandline);
3411  *
3412  * uri = g_file_get_uri (file);
3413  * strcmp (uri, uri_from_commandline) == 0; // FALSE
3414  * g_free (uri);
3415  *
3416  * if (g_file_has_uri_scheme (file, "cdda"))
3417  *   {
3418  *     // do something special with uri
3419  *   }
3420  * g_object_unref (file);
3421  * </programlisting>
3422  *
3423  * This code will work when both <literal>cdda://sr0/Track
3424  * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3425  * 1.wav</literal> is passed to the application. It should be noted
3426  * that it's generally not safe for applications to rely on the format
3427  * of a particular URIs. Different launcher applications (e.g. file
3428  * managers) may have different ideas of what a given URI means.
3429  */
3430
3431
3432 /**
3433  * SECTION:gapplication
3434  * @title: GApplication
3435  * @short_description: Core application class
3436  *
3437  * A #GApplication is the foundation of an application.  It wraps some
3438  * low-level platform-specific services and is intended to act as the
3439  * foundation for higher-level application classes such as
3440  * #GtkApplication or #MxApplication.  In general, you should not use
3441  * this class outside of a higher level framework.
3442  *
3443  * GApplication provides convenient life cycle management by maintaining
3444  * a <firstterm>use count</firstterm> for the primary application instance.
3445  * The use count can be changed using g_application_hold() and
3446  * g_application_release(). If it drops to zero, the application exits.
3447  * Higher-level classes such as #GtkApplication employ the use count to
3448  * ensure that the application stays alive as long as it has any opened
3449  * windows.
3450  *
3451  * Another feature that GApplication (optionally) provides is process
3452  * uniqueness.  Applications can make use of this functionality by
3453  * providing a unique application ID.  If given, only one application
3454  * with this ID can be running at a time per session.  The session
3455  * concept is platform-dependent, but corresponds roughly to a graphical
3456  * desktop login.  When your application is launched again, its
3457  * arguments are passed through platform communication to the already
3458  * running program.  The already running instance of the program is
3459  * called the <firstterm>primary instance</firstterm>; for non-unique
3460  * applications this is the always the current instance.
3461  * On Linux, the D-Bus session bus is used for communication.
3462  *
3463  * If used, the expected form of an application identifier is very close
3464  * to that of of a
3465  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3466  * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3467  * For details on valid application identifiers, see g_application_id_is_valid().
3468  *
3469  * On Linux, the application identifier is claimed as a well-known bus name
3470  * on the user's session bus.  This means that the uniqueness of your
3471  * application is scoped to the current session.  It also means that your
3472  * application may provide additional services (through registration of other
3473  * object paths) at that bus name.  The registration of these object paths
3474  * should be done with the shared GDBus session bus.  Note that due to the
3475  * internal architecture of GDBus, method calls can be dispatched at any time
3476  * (even if a main loop is not running).  For this reason, you must ensure that
3477  * any object paths that you wish to register are registered before #GApplication
3478  * attempts to acquire the bus name of your application (which happens in
3479  * g_application_register()).  Unfortunately, this means that you cannot use
3480  * g_application_get_is_remote() to decide if you want to register object paths.
3481  *
3482  * GApplication also implements the #GActionGroup and #GActionMap
3483  * interfaces and lets you easily export actions by adding them with
3484  * g_action_map_add_action(). When invoking an action by calling
3485  * g_action_group_activate_action() on the application, it is always
3486  * invoked in the primary instance. The actions are also exported on
3487  * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3488  * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3489  * for remote access to exported #GMenuModels.
3490  *
3491  * There is a number of different entry points into a GApplication:
3492  * <itemizedlist>
3493  * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3494  * <listitem>via 'Open' (i.e. opening some files)</listitem>
3495  * <listitem>by handling a command-line</listitem>
3496  * <listitem>via activating an action</listitem>
3497  * </itemizedlist>
3498  * The #GApplication::startup signal lets you handle the application
3499  * initialization for all of these in a single place.
3500  *
3501  * Regardless of which of these entry points is used to start the application,
3502  * GApplication passes some <firstterm id="platform-data">platform
3503  * data</firstterm> from the launching instance to the primary instance,
3504  * in the form of a #GVariant dictionary mapping strings to variants.
3505  * To use platform data, override the @before_emit or @after_emit virtual
3506  * functions in your #GApplication subclass. When dealing with
3507  * #GApplicationCommandLine objects, the platform data is directly
3508  * available via g_application_command_line_get_cwd(),
3509  * g_application_command_line_get_environ() and
3510  * g_application_command_line_get_platform_data().
3511  *
3512  * As the name indicates, the platform data may vary depending on the
3513  * operating system, but it always includes the current directory (key
3514  * "cwd"), and optionally the environment (ie the set of environment
3515  * variables and their values) of the calling process (key "environ").
3516  * The environment is only added to the platform data if the
3517  * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3518  * can add their own platform data by overriding the @add_platform_data
3519  * virtual function. For instance, #GtkApplication adds startup notification
3520  * data in this way.
3521  *
3522  * To parse commandline arguments you may handle the
3523  * #GApplication::command-line signal or override the local_command_line()
3524  * vfunc, to parse them in either the primary instance or the local instance,
3525  * respectively.
3526  *
3527  * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3528  * <programlisting>
3529  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3530  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3531  * </xi:include>
3532  * </programlisting>
3533  * </example>
3534  *
3535  * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3536  * <programlisting>
3537  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3538  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3539  * </xi:include>
3540  * </programlisting>
3541  * </example>
3542  *
3543  * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3544  * <programlisting>
3545  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3546  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3547  * </xi:include>
3548  * </programlisting>
3549  * </example>
3550  *
3551  * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3552  * <programlisting>
3553  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3554  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3555  * </xi:include>
3556  * </programlisting>
3557  * </example>
3558  */
3559
3560
3561 /**
3562  * SECTION:gapplicationcommandline
3563  * @title: GApplicationCommandLine
3564  * @short_description: A command-line invocation of an application
3565  * @see_also: #GApplication
3566  *
3567  * #GApplicationCommandLine represents a command-line invocation of
3568  * an application.  It is created by #GApplication and emitted
3569  * in the #GApplication::command-line signal and virtual function.
3570  *
3571  * The class contains the list of arguments that the program was invoked
3572  * with.  It is also possible to query if the commandline invocation was
3573  * local (ie: the current process is running in direct response to the
3574  * invocation) or remote (ie: some other process forwarded the
3575  * commandline to this process).
3576  *
3577  * The GApplicationCommandLine object can provide the @argc and @argv
3578  * parameters for use with the #GOptionContext command-line parsing API,
3579  * with the g_application_command_line_get_arguments() function. See
3580  * <xref linkend="gapplication-example-cmdline3"/> for an example.
3581  *
3582  * The exit status of the originally-invoked process may be set and
3583  * messages can be printed to stdout or stderr of that process.  The
3584  * lifecycle of the originally-invoked process is tied to the lifecycle
3585  * of this object (ie: the process exits when the last reference is
3586  * dropped).
3587  *
3588  * The main use for #GApplicationCommandLine (and the
3589  * #GApplication::command-line signal) is 'Emacs server' like use cases:
3590  * You can set the <envar>EDITOR</envar> environment variable to have
3591  * e.g. git use your favourite editor to edit commit messages, and if you
3592  * already have an instance of the editor running, the editing will happen
3593  * in the running instance, instead of opening a new one. An important
3594  * aspect of this use case is that the process that gets started by git
3595  * does not return until the editing is done.
3596  *
3597  * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3598  * <para>
3599  * A simple example where the commandline is completely handled
3600  * in the #GApplication::command-line handler. The launching instance exits
3601  * once the signal handler in the primary instance has returned, and the
3602  * return value of the signal handler becomes the exit status of the launching
3603  * instance.
3604  * </para>
3605  * <programlisting>
3606  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3607  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3608  * </xi:include>
3609  * </programlisting>
3610  * </example>
3611  *
3612  * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3613  * <para>
3614  * An example of split commandline handling. Options that start with
3615  * <literal>--local-</literal> are handled locally, all other options are
3616  * passed to the #GApplication::command-line handler which runs in the primary
3617  * instance.
3618  * </para>
3619  * <programlisting>
3620  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3621  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3622  * </xi:include>
3623  * </programlisting>
3624  * </example>
3625  *
3626  * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3627  * <para>
3628  * An example of deferred commandline handling. Here, the commandline is
3629  * not completely handled before the #GApplication::command-line handler
3630  * returns. Instead, we keep a reference to the GApplicationCommandLine
3631  * object and handle it later(in this example, in an idle). Note that it
3632  * is necessary to hold the application until you are done with the
3633  * commandline.
3634  * </para>
3635  * <para>
3636  * This example also shows how to use #GOptionContext for parsing the
3637  * commandline arguments. Note that it is necessary to disable the
3638  * built-in help-handling of #GOptionContext, since it calls exit()
3639  * after printing help, which is not what you want to happen in
3640  * the primary instance.
3641  * </para>
3642  * <programlisting>
3643  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3644  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3645  * </xi:include>
3646  * </programlisting>
3647  * </example>
3648  */
3649
3650
3651 /**
3652  * SECTION:gasyncinitable
3653  * @short_description: Asynchronously failable object initialization interface
3654  * @include: gio/gio.h
3655  * @see_also: #GInitable
3656  *
3657  * This is the asynchronous version of #GInitable; it behaves the same
3658  * in all ways except that initialization is asynchronous. For more details
3659  * see the descriptions on #GInitable.
3660  *
3661  * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3662  *
3663  * Users of objects implementing this are not intended to use the interface
3664  * method directly; instead it will be used automatically in various ways.
3665  * For C applications you generally just call g_async_initable_new_async()
3666  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3667  * g_async_initable_init_async() under the cover, calling back with %NULL and
3668  * a set %GError on failure.
3669  *
3670  * A typical implementation might look something like this:
3671  *
3672  * |[
3673  * enum {
3674  *    NOT_INITIALIZED,
3675  *    INITIALIZING,
3676  *    INITIALIZED
3677  * };
3678  *
3679  * static void
3680  * _foo_ready_cb (Foo *self)
3681  * {
3682  *   GList *l;
3683  *
3684  *   self->priv->state = INITIALIZED;
3685  *
3686  *   for (l = self->priv->init_results; l != NULL; l = l->next)
3687  *     {
3688  *       GSimpleAsyncResult *simple = l->data;
3689  *
3690  *       if (!self->priv->success)
3691  *         g_simple_async_result_set_error (simple, ...);
3692  *
3693  *       g_simple_async_result_complete (simple);
3694  *       g_object_unref (simple);
3695  *     }
3696  *
3697  *   g_list_free (self->priv->init_results);
3698  *   self->priv->init_results = NULL;
3699  * }
3700  *
3701  * static void
3702  * foo_init_async (GAsyncInitable       *initable,
3703  *                 int                   io_priority,
3704  *                 GCancellable         *cancellable,
3705  *                 GAsyncReadyCallback   callback,
3706  *                 gpointer              user_data)
3707  * {
3708  *   Foo *self = FOO (initable);
3709  *   GSimpleAsyncResult *simple;
3710  *
3711  *   simple = g_simple_async_result_new (G_OBJECT (initable)
3712  *                                       callback,
3713  *                                       user_data,
3714  *                                       foo_init_async);
3715  *
3716  *   switch (self->priv->state)
3717  *     {
3718  *       case NOT_INITIALIZED:
3719  *         _foo_get_ready (self);
3720  *         self->priv->init_results = g_list_append (self->priv->init_results,
3721  *                                                   simple);
3722  *         self->priv->state = INITIALIZING;
3723  *         break;
3724  *       case INITIALIZING:
3725  *         self->priv->init_results = g_list_append (self->priv->init_results,
3726  *                                                   simple);
3727  *         break;
3728  *       case INITIALIZED:
3729  *         if (!self->priv->success)
3730  *           g_simple_async_result_set_error (simple, ...);
3731  *
3732  *         g_simple_async_result_complete_in_idle (simple);
3733  *         g_object_unref (simple);
3734  *         break;
3735  *     }
3736  * }
3737  *
3738  * static gboolean
3739  * foo_init_finish (GAsyncInitable       *initable,
3740  *                  GAsyncResult         *result,
3741  *                  GError              **error)
3742  * {
3743  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
3744  *       G_OBJECT (initable), foo_init_async), FALSE);
3745  *
3746  *   if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
3747  *           error))
3748  *     return FALSE;
3749  *
3750  *   return TRUE;
3751  * }
3752  *
3753  * static void
3754  * foo_async_initable_iface_init (gpointer g_iface,
3755  *                                gpointer data)
3756  * {
3757  *   GAsyncInitableIface *iface = g_iface;
3758  *
3759  *   iface->init_async = foo_init_async;
3760  *   iface->init_finish = foo_init_finish;
3761  * }
3762  * ]|
3763  */
3764
3765
3766 /**
3767  * SECTION:gasyncresult
3768  * @short_description: Asynchronous Function Results
3769  * @include: gio/gio.h
3770  * @see_also: #GSimpleAsyncResult
3771  *
3772  * Provides a base class for implementing asynchronous function results.
3773  *
3774  * Asynchronous operations are broken up into two separate operations
3775  * which are chained together by a #GAsyncReadyCallback. To begin
3776  * an asynchronous operation, provide a #GAsyncReadyCallback to the
3777  * asynchronous function. This callback will be triggered when the
3778  * operation has completed, and will be passed a #GAsyncResult instance
3779  * filled with the details of the operation's success or failure, the
3780  * object the asynchronous function was started for and any error codes
3781  * returned. The asynchronous callback function is then expected to call
3782  * the corresponding "_finish()" function, passing the object the
3783  * function was called for, the #GAsyncResult instance, and (optionally)
3784  * an @error to grab any error conditions that may have occurred.
3785  *
3786  * The "_finish()" function for an operation takes the generic result
3787  * (of type #GAsyncResult) and returns the specific result that the
3788  * operation in question yields (e.g. a #GFileEnumerator for a
3789  * "enumerate children" operation). If the result or error status of the
3790  * operation is not needed, there is no need to call the "_finish()"
3791  * function; GIO will take care of cleaning up the result and error
3792  * information after the #GAsyncReadyCallback returns. You can pass
3793  * %NULL for the #GAsyncReadyCallback if you don't need to take any
3794  * action at all after the operation completes. Applications may also
3795  * take a reference to the #GAsyncResult and call "_finish()" later;
3796  * however, the "_finish()" function may be called at most once.
3797  *
3798  * Example of a typical asynchronous operation flow:
3799  * |[
3800  * void _theoretical_frobnitz_async (Theoretical         *t,
3801  *                                   GCancellable        *c,
3802  *                                   GAsyncReadyCallback *cb,
3803  *                                   gpointer             u);
3804  *
3805  * gboolean _theoretical_frobnitz_finish (Theoretical   *t,
3806  *                                        GAsyncResult  *res,
3807  *                                        GError       **e);
3808  *
3809  * static void
3810  * frobnitz_result_func (GObject      *source_object,
3811  *               GAsyncResult *res,
3812  *               gpointer      user_data)
3813  * {
3814  *   gboolean success = FALSE;
3815  *
3816  *   success = _theoretical_frobnitz_finish (source_object, res, NULL);
3817  *
3818  *   if (success)
3819  *     g_printf ("Hurray!\n");
3820  *   else
3821  *     g_printf ("Uh oh!\n");
3822  *
3823  *   /<!-- -->* ... *<!-- -->/
3824  *
3825  * }
3826  *
3827  * int main (int argc, void *argv[])
3828  * {
3829  *    /<!-- -->* ... *<!-- -->/
3830  *
3831  *    _theoretical_frobnitz_async (theoretical_data,
3832  *                                 NULL,
3833  *                                 frobnitz_result_func,
3834  *                                 NULL);
3835  *
3836  *    /<!-- -->* ... *<!-- -->/
3837  * }
3838  * ]|
3839  *
3840  * The callback for an asynchronous operation is called only once, and is
3841  * always called, even in the case of a cancelled operation. On cancellation
3842  * the result is a %G_IO_ERROR_CANCELLED error.
3843  */
3844
3845
3846 /**
3847  * SECTION:gbufferedinputstream
3848  * @short_description: Buffered Input Stream
3849  * @include: gio/gio.h
3850  * @see_also: #GFilterInputStream, #GInputStream
3851  *
3852  * Buffered input stream implements #GFilterInputStream and provides
3853  * for buffered reads.
3854  *
3855  * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3856  *
3857  * To create a buffered input stream, use g_buffered_input_stream_new(),
3858  * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3859  * construction.
3860  *
3861  * To get the size of a buffer within a buffered input stream, use
3862  * g_buffered_input_stream_get_buffer_size(). To change the size of a
3863  * buffered input stream's buffer, use
3864  * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3865  * cannot be reduced below the size of the data within the buffer.
3866  */
3867
3868
3869 /**
3870  * SECTION:gbufferedoutputstream
3871  * @short_description: Buffered Output Stream
3872  * @include: gio/gio.h
3873  * @see_also: #GFilterOutputStream, #GOutputStream
3874  *
3875  * Buffered output stream implements #GFilterOutputStream and provides
3876  * for buffered writes.
3877  *
3878  * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
3879  *
3880  * To create a buffered output stream, use g_buffered_output_stream_new(),
3881  * or g_buffered_output_stream_new_sized() to specify the buffer's size
3882  * at construction.
3883  *
3884  * To get the size of a buffer within a buffered input stream, use
3885  * g_buffered_output_stream_get_buffer_size(). To change the size of a
3886  * buffered output stream's buffer, use
3887  * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
3888  * size cannot be reduced below the size of the data within the buffer.
3889  */
3890
3891
3892 /**
3893  * SECTION:gcancellable
3894  * @short_description: Thread-safe Operation Cancellation Stack
3895  * @include: gio/gio.h
3896  *
3897  * GCancellable is a thread-safe operation cancellation stack used
3898  * throughout GIO to allow for cancellation of synchronous and
3899  * asynchronous operations.
3900  */
3901
3902
3903 /**
3904  * SECTION:gcharsetconverter
3905  * @short_description: Convert between charsets
3906  * @include: gio/gio.h
3907  *
3908  * #GCharsetConverter is an implementation of #GConverter based on
3909  * GIConv.
3910  */
3911
3912
3913 /**
3914  * SECTION:gcontenttype
3915  * @short_description: Platform-specific content typing
3916  * @include: gio/gio.h
3917  *
3918  * A content type is a platform specific string that defines the type
3919  * 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".
3920  * On Win32 it is an extension string like ".doc", ".txt" or a perceived
3921  * string like "audio". Such strings can be looked up in the registry at
3922  * HKEY_CLASSES_ROOT.
3923  */
3924
3925
3926 /**
3927  * SECTION:gconverter
3928  * @short_description: Data conversion interface
3929  * @include: gio/gio.h
3930  * @see_also: #GInputStream, #GOutputStream
3931  *
3932  * #GConverter is implemented by objects that convert
3933  * binary data in various ways. The conversion can be
3934  * stateful and may fail at any place.
3935  *
3936  * Some example conversions are: character set conversion,
3937  * compression, decompression and regular expression
3938  * replace.
3939  *
3940  * Since: 2.24
3941  */
3942
3943
3944 /**
3945  * SECTION:gconverterinputstream
3946  * @short_description: Converter Input Stream
3947  * @include: gio/gio.h
3948  * @see_also: #GInputStream, #GConverter
3949  *
3950  * Converter input stream implements #GInputStream and allows
3951  * conversion of data of various types during reading.
3952  *
3953  * As of GLib 2.34, #GConverterInputStream implements
3954  * #GPollableInputStream.
3955  */
3956
3957
3958 /**
3959  * SECTION:gconverteroutputstream
3960  * @short_description: Converter Output Stream
3961  * @include: gio/gio.h
3962  * @see_also: #GOutputStream, #GConverter
3963  *
3964  * Converter output stream implements #GOutputStream and allows
3965  * conversion of data of various types during reading.
3966  *
3967  * As of GLib 2.34, #GConverterOutputStream implements
3968  * #GPollableOutputStream.
3969  */
3970
3971
3972 /**
3973  * SECTION:gcredentials
3974  * @short_description: An object containing credentials
3975  * @include: gio/gio.h
3976  *
3977  * The #GCredentials type is a reference-counted wrapper for native
3978  * credentials. This information is typically used for identifying,
3979  * authenticating and authorizing other processes.
3980  *
3981  * Some operating systems supports looking up the credentials of the
3982  * remote peer of a communication endpoint - see e.g.
3983  * g_socket_get_credentials().
3984  *
3985  * Some operating systems supports securely sending and receiving
3986  * credentials over a Unix Domain Socket, see
3987  * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3988  * g_unix_connection_receive_credentials() for details.
3989  *
3990  * On Linux, the native credential type is a <type>struct ucred</type>
3991  * - see the
3992  * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3993  * man page for details. This corresponds to
3994  * %G_CREDENTIALS_TYPE_LINUX_UCRED.
3995  *
3996  * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3997  * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3998  *
3999  * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4000  * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4001  */
4002
4003
4004 /**
4005  * SECTION:gdatainputstream
4006  * @short_description: Data Input Stream
4007  * @include: gio/gio.h
4008  * @see_also: #GInputStream
4009  *
4010  * Data input stream implements #GInputStream and includes functions for
4011  * reading structured data directly from a binary input stream.
4012  */
4013
4014
4015 /**
4016  * SECTION:gdataoutputstream
4017  * @short_description: Data Output Stream
4018  * @include: gio/gio.h
4019  * @see_also: #GOutputStream
4020  *
4021  * Data output stream implements #GOutputStream and includes functions for
4022  * writing data directly to an output stream.
4023  */
4024
4025
4026 /**
4027  * SECTION:gdbusactiongroup
4028  * @title: GDBusActionGroup
4029  * @short_description: A D-Bus GActionGroup implementation
4030  * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4031  *
4032  * #GDBusActionGroup is an implementation of the #GActionGroup
4033  * interface that can be used as a proxy for an action group
4034  * that is exported over D-Bus with g_dbus_connection_export_action_group().
4035  */
4036
4037
4038 /**
4039  * SECTION:gdbusaddress
4040  * @title: D-Bus Addresses
4041  * @short_description: D-Bus connection endpoints
4042  * @include: gio/gio.h
4043  *
4044  * Routines for working with D-Bus addresses. A D-Bus address is a string
4045  * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4046  * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html&num;addresses">D-Bus specification</link>.
4047  */
4048
4049
4050 /**
4051  * SECTION:gdbusauthobserver
4052  * @short_description: Object used for authenticating connections
4053  * @include: gio/gio.h
4054  *
4055  * The #GDBusAuthObserver type provides a mechanism for participating
4056  * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4057  * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4058  * signals you are interested in. Note that new signals may be added
4059  * in the future
4060  *
4061  * For example, if you only want to allow D-Bus connections from
4062  * processes owned by the same uid as the server, you would use a
4063  * signal handler like the following:
4064  * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4065  * static gboolean
4066  * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4067  *                                  GIOStream         *stream,
4068  *                                  GCredentials      *credentials,
4069  *                                  gpointer           user_data)
4070  * {
4071  *   gboolean authorized;
4072  *
4073  *   authorized = FALSE;
4074  *   if (credentials != NULL)
4075  *     {
4076  *       GCredentials *own_credentials;
4077  *       own_credentials = g_credentials_new ();
4078  *       if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4079  *         authorized = TRUE;
4080  *       g_object_unref (own_credentials);
4081  *     }
4082  *
4083  *   return authorized;
4084  * }
4085  * </programlisting></example>
4086  */
4087
4088
4089 /**
4090  * SECTION:gdbusconnection
4091  * @short_description: D-Bus Connections
4092  * @include: gio/gio.h
4093  *
4094  * The #GDBusConnection type is used for D-Bus connections to remote
4095  * peers such as a message buses. It is a low-level API that offers a
4096  * lot of flexibility. For instance, it lets you establish a connection
4097  * over any transport that can by represented as an #GIOStream.
4098  *
4099  * This class is rarely used directly in D-Bus clients. If you are writing
4100  * an D-Bus client, it is often easier to use the g_bus_own_name(),
4101  * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4102  *
4103  * As an exception to the usual GLib rule that a particular object must not be
4104  * used by two threads at the same time, #GDBusConnection's methods may be
4105  * called from any thread<footnote>
4106  * <para>
4107  *   This is so that g_bus_get() and g_bus_get_sync() can safely return the
4108  *   same #GDBusConnection when called from any thread.
4109  * </para>
4110  * </footnote>.
4111  *
4112  * Most of the ways to obtain a #GDBusConnection automatically initialize it
4113  * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4114  * g_bus_get(), and the synchronous versions of those methods, give you an
4115  * initialized connection. Language bindings for GIO should use
4116  * g_initable_new() or g_async_initable_new_async(), which also initialize the
4117  * connection.
4118  *
4119  * If you construct an uninitialized #GDBusConnection, such as via
4120  * g_object_new(), you must initialize it via g_initable_init() or
4121  * g_async_initable_init_async() before using its methods or properties.
4122  * Calling methods or accessing properties on a #GDBusConnection that has not
4123  * completed initialization successfully is considered to be invalid, and leads
4124  * to undefined behaviour. In particular, if initialization fails with a
4125  * #GError, the only valid thing you can do with that #GDBusConnection is to
4126  * free it with g_object_unref().
4127  *
4128  * <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>
4129  *
4130  * <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>
4131  *
4132  * <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>
4133  *
4134  * <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>
4135  */
4136
4137
4138 /**
4139  * SECTION:gdbuserror
4140  * @title: GDBusError
4141  * @short_description: Mapping D-Bus errors to and from GError
4142  * @include: gio/gio.h
4143  *
4144  * All facilities that return errors from remote methods (such as
4145  * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4146  * errors (e.g. errors returned from the other peer) and locally
4147  * in-process generated errors.
4148  *
4149  * To check if a returned #GError is an error from a remote peer, use
4150  * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4151  * use g_dbus_error_get_remote_error(). Before presenting an error,
4152  * always use g_dbus_error_strip_remote_error().
4153  *
4154  * In addition, facilities used to return errors to a remote peer also
4155  * use #GError. See g_dbus_method_invocation_return_error() for
4156  * discussion about how the D-Bus error name is set.
4157  *
4158  * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4159  * automatically map from D-Bus errors to #GError and back. This
4160  * is typically done in the function returning the #GQuark for the
4161  * error domain:
4162  * <example id="error-registration"><title>Error Registration</title><programlisting>
4163  * /<!-- -->* foo-bar-error.h: *<!-- -->/
4164  *
4165  * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4166  * GQuark foo_bar_error_quark (void);
4167  *
4168  * typedef enum
4169  * {
4170  *   FOO_BAR_ERROR_FAILED,
4171  *   FOO_BAR_ERROR_ANOTHER_ERROR,
4172  *   FOO_BAR_ERROR_SOME_THIRD_ERROR,
4173  *   FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4174  * } FooBarError;
4175  *
4176  * /<!-- -->* foo-bar-error.c: *<!-- -->/
4177  *
4178  * static const GDBusErrorEntry foo_bar_error_entries[] =
4179  * {
4180  *   {FOO_BAR_ERROR_FAILED,           "org.project.Foo.Bar.Error.Failed"},
4181  *   {FOO_BAR_ERROR_ANOTHER_ERROR,    "org.project.Foo.Bar.Error.AnotherError"},
4182  *   {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4183  * };
4184  *
4185  * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4186  * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4187  *
4188  * GQuark
4189  * foo_bar_error_quark (void)
4190  * {
4191  *   static volatile gsize quark_volatile = 0;
4192  *   g_dbus_error_register_error_domain ("foo-bar-error-quark",
4193  *                                       &quark_volatile,
4194  *                                       foo_bar_error_entries,
4195  *                                       G_N_ELEMENTS (foo_bar_error_entries));
4196  *   return (GQuark) quark_volatile;
4197  * }
4198  * </programlisting></example>
4199  * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4200  * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4201  * If the other peer is using GDBus, the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4202  * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4203  * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4204  *
4205  * Note that errors in the %G_DBUS_ERROR error domain is intended only
4206  * for returning errors from a remote message bus process. Errors
4207  * generated locally in-process by e.g. #GDBusConnection is from the
4208  * %G_IO_ERROR domain.
4209  */
4210
4211
4212 /**
4213  * SECTION:gdbusinterface
4214  * @short_description: Base type for D-Bus interfaces
4215  * @include: gio/gio.h
4216  *
4217  * The #GDBusInterface type is the base type for D-Bus interfaces both
4218  * on the service side (see #GDBusInterfaceSkeleton) and client side
4219  * (see #GDBusProxy).
4220  */
4221
4222
4223 /**
4224  * SECTION:gdbusinterfaceskeleton
4225  * @short_description: Service-side D-Bus interface
4226  * @include: gio/gio.h
4227  *
4228  * Abstract base class for D-Bus interfaces on the service side.
4229  */
4230
4231
4232 /**
4233  * SECTION:gdbusintrospection
4234  * @title: D-Bus Introspection Data
4235  * @short_description: Node and interface description data structures
4236  * @include: gio/gio.h
4237  *
4238  * Various data structures and convenience routines to parse and
4239  * generate D-Bus introspection XML. Introspection information is
4240  * used when registering objects with g_dbus_connection_register_object().
4241  *
4242  * The format of D-Bus introspection XML is specified in the
4243  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4244  */
4245
4246
4247 /**
4248  * SECTION:gdbusmenumodel
4249  * @title: GDBusMenuModel
4250  * @short_description: A D-Bus GMenuModel implementation
4251  * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4252  *
4253  * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4254  * as a proxy for a menu model that is exported over D-Bus with
4255  * g_dbus_connection_export_menu_model().
4256  */
4257
4258
4259 /**
4260  * SECTION:gdbusmessage
4261  * @short_description: D-Bus Message
4262  * @include: gio/gio.h
4263  *
4264  * A type for representing D-Bus messages that can be sent or received
4265  * on a #GDBusConnection.
4266  */
4267
4268
4269 /**
4270  * SECTION:gdbusmethodinvocation
4271  * @short_description: Object for handling remote calls
4272  * @include: gio/gio.h
4273  *
4274  * Instances of the #GDBusMethodInvocation class are used when
4275  * handling D-Bus method calls. It provides a way to asynchronously
4276  * return results and errors.
4277  *
4278  * The normal way to obtain a #GDBusMethodInvocation object is to receive
4279  * it as an argument to the handle_method_call() function in a
4280  * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4281  */
4282
4283
4284 /**
4285  * SECTION:gdbusnameowning
4286  * @title: Owning Bus Names
4287  * @short_description: Simple API for owning bus names
4288  * @include: gio/gio.h
4289  *
4290  * Convenience API for owning bus names.
4291  *
4292  * <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>
4293  */
4294
4295
4296 /**
4297  * SECTION:gdbusnamewatching
4298  * @title: Watching Bus Names
4299  * @short_description: Simple API for watching bus names
4300  * @include: gio/gio.h
4301  *
4302  * Convenience API for watching bus names.
4303  *
4304  * <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>
4305  */
4306
4307
4308 /**
4309  * SECTION:gdbusobject
4310  * @short_description: Base type for D-Bus objects
4311  * @include: gio/gio.h
4312  *
4313  * The #GDBusObject type is the base type for D-Bus objects on both
4314  * the service side (see #GDBusObjectSkeleton) and the client side
4315  * (see #GDBusObjectProxy). It is essentially just a container of
4316  * interfaces.
4317  */
4318
4319
4320 /**
4321  * SECTION:gdbusobjectmanager
4322  * @short_description: Base type for D-Bus object managers
4323  * @include: gio/gio.h
4324  *
4325  * The #GDBusObjectManager type is the base type for service- and
4326  * client-side implementations of the standardized <ulink
4327  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4328  * interface.
4329  *
4330  * See #GDBusObjectManagerClient for the client-side implementation
4331  * and #GDBusObjectManagerServer for the service-side implementation.
4332  */
4333
4334
4335 /**
4336  * SECTION:gdbusobjectmanagerclient
4337  * @short_description: Client-side object manager
4338  * @include: gio/gio.h
4339  *
4340  * #GDBusObjectManagerClient is used to create, monitor and delete object
4341  * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4342  * code implementing the <ulink
4343  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4344  * interface).
4345  *
4346  * Once an instance of this type has been created, you can connect to
4347  * the #GDBusObjectManager::object-added and
4348  * #GDBusObjectManager::object-removed signals and inspect the
4349  * #GDBusObjectProxy objects returned by
4350  * g_dbus_object_manager_get_objects().
4351  *
4352  * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4353  * object construction time, the default behavior is to request the
4354  * message bus to launch an owner for the name. This behavior can be
4355  * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4356  * flag. It's also worth noting that this only works if the name of
4357  * interest is activatable in the first place. E.g. in some cases it
4358  * is not possible to launch an owner for the requested name. In this
4359  * case, #GDBusObjectManagerClient object construction still succeeds but
4360  * there will be no object proxies
4361  * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4362  * the #GDBusObjectManagerClient:name-owner property is %NULL.
4363  *
4364  * The owner of the requested name can come and go (for example
4365  * consider a system service being restarted) â€“ #GDBusObjectManagerClient
4366  * handles this case too; simply connect to the #GObject::notify
4367  * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4368  * property. When the name owner vanishes, the behavior is that
4369  * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4370  * emission of the #GObject::notify signal) and then
4371  * #GDBusObjectManager::object-removed signals are synthesized
4372  * for all currently existing object proxies. Since
4373  * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4374  * use this information to disambiguate a synthesized signal from a
4375  * genuine signal caused by object removal on the remote
4376  * #GDBusObjectManager. Similarly, when a new name owner appears,
4377  * #GDBusObjectManager::object-added signals are synthesized
4378  * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4379  * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4380  * is set to the new name owner (this includes emission of the
4381  * #GObject::notify signal).  Furthermore, you are guaranteed that
4382  * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4383  * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4384  * the name of interest is atomically replaced
4385  *
4386  * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4387  * instances. All signals (including the
4388  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4389  * signal) delivered to #GDBusProxy instances are guaranteed to
4390  * originate from the name owner. This guarantee along with the
4391  * behavior described above, means that certain race conditions
4392  * including the <emphasis><quote>half the proxy is from the old owner
4393  * and the other half is from the new owner</quote></emphasis> problem
4394  * cannot happen.
4395  *
4396  * To avoid having the application connect to signals on the returned
4397  * #GDBusObjectProxy and #GDBusProxy objects, the
4398  * #GDBusObject::interface-added,
4399  * #GDBusObject::interface-removed,
4400  * #GDBusProxy::g-properties-changed and
4401  * #GDBusProxy::g-signal signals
4402  * are also emitted on the #GDBusObjectManagerClient instance managing these
4403  * objects. The signals emitted are
4404  * #GDBusObjectManager::interface-added,
4405  * #GDBusObjectManager::interface-removed,
4406  * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4407  * #GDBusObjectManagerClient::interface-proxy-signal.
4408  *
4409  * Note that all callbacks and signals are emitted in the
4410  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4411  * that the #GDBusObjectManagerClient object was constructed
4412  * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4413  * originating from the #GDBusObjectManagerClient object will be created in
4414  * the same context and, consequently, will deliver signals in the
4415  * same main loop.
4416  */
4417
4418
4419 /**
4420  * SECTION:gdbusobjectmanagerserver
4421  * @short_description: Service-side object manager
4422  * @include: gio/gio.h
4423  *
4424  * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4425  * the standardized <ulink
4426  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4427  * interface. For example, remote D-Bus clients can get all objects
4428  * and properties in a single call. Additionally, any change in the
4429  * object hierarchy is broadcast using signals. This means that D-Bus
4430  * clients can keep caches up to date by only listening to D-Bus
4431  * signals.
4432  *
4433  * See #GDBusObjectManagerClient for the client-side code that is
4434  * intended to be used with #GDBusObjectManagerServer or any D-Bus
4435  * object implementing the org.freedesktop.DBus.ObjectManager
4436  * interface.
4437  */
4438
4439
4440 /**
4441  * SECTION:gdbusobjectproxy
4442  * @short_description: Client-side D-Bus object
4443  * @include: gio/gio.h
4444  *
4445  * A #GDBusObjectProxy is an object used to represent a remote object
4446  * with one or more D-Bus interfaces. Normally, you don't instantiate
4447  * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4448  * is used to obtain it.
4449  *
4450  * Since: 2.30
4451  */
4452
4453
4454 /**
4455  * SECTION:gdbusobjectskeleton
4456  * @short_description: Service-side D-Bus object
4457  * @include: gio/gio.h
4458  *
4459  * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4460  * interfaces. The set of exported interfaces on the object may be
4461  * dynamic and change at runtime.
4462  *
4463  * This type is intended to be used with #GDBusObjectManager.
4464  */
4465
4466
4467 /**
4468  * SECTION:gdbusproxy
4469  * @short_description: Client-side D-Bus interface proxy
4470  * @include: gio/gio.h
4471  *
4472  * #GDBusProxy is a base class used for proxies to access a D-Bus
4473  * interface on a remote object. A #GDBusProxy can be constructed for
4474  * both well-known and unique names.
4475  *
4476  * By default, #GDBusProxy will cache all properties (and listen to
4477  * changes) of the remote object, and proxy all signals that gets
4478  * emitted. This behaviour can be changed by passing suitable
4479  * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4480  * well-known name, the property cache is flushed when the name owner
4481  * vanishes and reloaded when a name owner appears.
4482  *
4483  * If a #GDBusProxy is used for a well-known name, the owner of the
4484  * name is tracked and can be read from
4485  * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4486  * get notified of changes. Additionally, only signals and property
4487  * changes emitted from the current name owner are considered and
4488  * calls are always sent to the current name owner. This avoids a
4489  * number of race conditions when the name is lost by one owner and
4490  * claimed by another. However, if no name owner currently exists,
4491  * then calls will be sent to the well-known name which may result in
4492  * the message bus launching an owner (unless
4493  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4494  *
4495  * The generic #GDBusProxy::g-properties-changed and
4496  * #GDBusProxy::g-signal signals are not very convenient to work
4497  * with. Therefore, the recommended way of working with proxies is to
4498  * subclass #GDBusProxy, and have more natural properties and signals
4499  * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4500  * for how this can easily be done using the
4501  * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4502  * tool.
4503  *
4504  * A #GDBusProxy instance can be used from multiple threads but note
4505  * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4506  * and #GObject::notify) are emitted in the
4507  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4508  * of the thread where the instance was constructed.
4509  *
4510  * <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>
4511  */
4512
4513
4514 /**
4515  * SECTION:gdbusserver
4516  * @short_description: Helper for accepting connections
4517  * @include: gio/gio.h
4518  *
4519  * #GDBusServer is a helper for listening to and accepting D-Bus
4520  * connections. This can be used to create a new D-Bus server, allowing two
4521  * peers to use the D-Bus protocol for their own specialized communication.
4522  * A server instance provided in this way will not perform message routing or
4523  * implement the org.freedesktop.DBus interface.
4524  *
4525  * To just export an object on a well-known name on a message bus, such as the
4526  * session or system bus, you should instead use g_bus_own_name().
4527  *
4528  * <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>
4529  */
4530
4531
4532 /**
4533  * SECTION:gdbusutils
4534  * @title: D-Bus Utilities
4535  * @short_description: Various utilities related to D-Bus.
4536  * @include: gio/gio.h
4537  *
4538  * Various utility routines related to D-Bus.
4539  */
4540
4541
4542 /**
4543  * SECTION:gdesktopappinfo
4544  * @title: GDesktopAppInfo
4545  * @short_description: Application information from desktop files
4546  * @include: gio/gdesktopappinfo.h
4547  *
4548  * #GDesktopAppInfo is an implementation of #GAppInfo based on
4549  * desktop files.
4550  *
4551  * Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
4552  * the UNIX-specific GIO interfaces, thus you have to use the
4553  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4554  */
4555
4556
4557 /**
4558  * SECTION:gdrive
4559  * @short_description: Drive management
4560  * @include: gio/gio.h
4561  *
4562  * #GDrive - this represent a piece of hardware connected to the machine.
4563  * It's generally only created for removable hardware or hardware with
4564  * removable media.
4565  *
4566  * #GDrive is a container class for #GVolume objects that stem from
4567  * the same piece of media. As such, #GDrive abstracts a drive with
4568  * (or without) removable media and provides operations for querying
4569  * whether media is available, determing whether media change is
4570  * automatically detected and ejecting the media.
4571  *
4572  * If the #GDrive reports that media isn't automatically detected, one
4573  * can poll for media; typically one should not do this periodically
4574  * as a poll for media operation is potententially expensive and may
4575  * spin up the drive creating noise.
4576  *
4577  * #GDrive supports starting and stopping drives with authentication
4578  * support for the former. This can be used to support a diverse set
4579  * of use cases including connecting/disconnecting iSCSI devices,
4580  * powering down external disk enclosures and starting/stopping
4581  * multi-disk devices such as RAID devices. Note that the actual
4582  * semantics and side-effects of starting/stopping a #GDrive may vary
4583  * according to implementation. To choose the correct verbs in e.g. a
4584  * file manager, use g_drive_get_start_stop_type().
4585  *
4586  * For porting from GnomeVFS note that there is no equivalent of
4587  * #GDrive in that API.
4588  */
4589
4590
4591 /**
4592  * SECTION:gemblem
4593  * @short_description: An object for emblems
4594  * @include: gio/gio.h
4595  * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4596  *
4597  * #GEmblem is an implementation of #GIcon that supports
4598  * having an emblem, which is an icon with additional properties.
4599  * It can than be added to a #GEmblemedIcon.
4600  *
4601  * Currently, only metainformation about the emblem's origin is
4602  * supported. More may be added in the future.
4603  */
4604
4605
4606 /**
4607  * SECTION:gemblemedicon
4608  * @short_description: Icon with emblems
4609  * @include: gio/gio.h
4610  * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4611  *
4612  * #GEmblemedIcon is an implementation of #GIcon that supports
4613  * adding an emblem to an icon. Adding multiple emblems to an
4614  * icon is ensured via g_emblemed_icon_add_emblem().
4615  *
4616  * Note that #GEmblemedIcon allows no control over the position
4617  * of the emblems. See also #GEmblem for more information.
4618  */
4619
4620
4621 /**
4622  * SECTION:gfile
4623  * @short_description: File and Directory Handling
4624  * @include: gio/gio.h
4625  * @see_also: #GFileInfo, #GFileEnumerator
4626  *
4627  * #GFile is a high level abstraction for manipulating files on a
4628  * virtual file system. #GFiles are lightweight, immutable objects
4629  * that do no I/O upon creation. It is necessary to understand that
4630  * #GFile objects do not represent files, merely an identifier for a
4631  * file. All file content I/O is implemented as streaming operations
4632  * (see #GInputStream and #GOutputStream).
4633  *
4634  * To construct a #GFile, you can use:
4635  * <simplelist>
4636  * <member>g_file_new_for_path() if you have a path.</member>
4637  * <member>g_file_new_for_uri() if you have a URI.</member>
4638  * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4639  * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4640  * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4641  * </simplelist>
4642  *
4643  * One way to think of a #GFile is as an abstraction of a pathname. For
4644  * normal files the system pathname is what is stored internally, but as
4645  * #GFiles are extensible it could also be something else that corresponds
4646  * to a pathname in a userspace implementation of a filesystem.
4647  *
4648  * #GFiles make up hierarchies of directories and files that correspond to
4649  * the files on a filesystem. You can move through the file system with
4650  * #GFile using g_file_get_parent() to get an identifier for the parent
4651  * directory, g_file_get_child() to get a child within a directory,
4652  * g_file_resolve_relative_path() to resolve a relative path between two
4653  * #GFiles. There can be multiple hierarchies, so you may not end up at
4654  * the same root if you repeatedly call g_file_get_parent() on two different
4655  * files.
4656  *
4657  * All #GFiles have a basename (get with g_file_get_basename()). These names
4658  * are byte strings that are used to identify the file on the filesystem
4659  * (relative to its parent directory) and there is no guarantees that they
4660  * have any particular charset encoding or even make any sense at all. If
4661  * you want to use filenames in a user interface you should use the display
4662  * name that you can get by requesting the
4663  * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4664  * This is guaranteed to be in UTF-8 and can be used in a user interface.
4665  * But always store the real basename or the #GFile to use to actually
4666  * access the file, because there is no way to go from a display name to
4667  * the actual name.
4668  *
4669  * Using #GFile as an identifier has the same weaknesses as using a path
4670  * in that there may be multiple aliases for the same file. For instance,
4671  * hard or soft links may cause two different #GFiles to refer to the same
4672  * file. Other possible causes for aliases are: case insensitive filesystems,
4673  * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4674  * check if two #GFiles point to the same file you can query for the
4675  * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4676  * canonicalization of pathnames passed in, so that trivial differences in
4677  * the path string used at creation (duplicated slashes, slash at end of
4678  * path, "." or ".." path segments, etc) does not create different #GFiles.
4679  *
4680  * Many #GFile operations have both synchronous and asynchronous versions
4681  * to suit your application. Asynchronous versions of synchronous functions
4682  * simply have _async() appended to their function names. The asynchronous
4683  * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4684  * the operation, producing a GAsyncResult which is then passed to the
4685  * function's matching _finish() operation.
4686  *
4687  * Some #GFile operations do not have synchronous analogs, as they may
4688  * take a very long time to finish, and blocking may leave an application
4689  * unusable. Notable cases include:
4690  * <simplelist>
4691  * <member>g_file_mount_mountable() to mount a mountable file.</member>
4692  * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4693  * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4694  * </simplelist>
4695  *
4696  * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4697  * One notable feature of #GFiles are entity tags, or "etags" for
4698  * short. Entity tags are somewhat like a more abstract version of the
4699  * traditional mtime, and can be used to quickly determine if the file has
4700  * been modified from the version on the file system. See the HTTP 1.1
4701  * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4702  * for HTTP Etag headers, which are a very similar concept.
4703  * </para>
4704  */
4705
4706
4707 /**
4708  * SECTION:gfileattribute
4709  * @short_description: Key-Value Paired File Attributes
4710  * @include: gio/gio.h
4711  * @see_also: #GFile, #GFileInfo
4712  *
4713  * File attributes in GIO consist of a list of key-value pairs.
4714  *
4715  * Keys are strings that contain a key namespace and a key name, separated
4716  * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4717  * key-value pairs by namespaces for relevance. Keys can be retrived
4718  * using wildcards, e.g. "standard::*" will return all of the keys in the
4719  * "standard" namespace.
4720  *
4721  * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4722  * available as a #GFileAttributeInfoList. This list is queryable by key names
4723  * as indicated earlier.
4724  *
4725  * Information is stored within the list in #GFileAttributeInfo structures.
4726  * The info structure can store different types, listed in the enum
4727  * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4728  * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4729  *
4730  * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4731  * install default keys and values for their given file system, architecture,
4732  * and other possible implementation details (e.g., on a UNIX system, a file
4733  * attribute key will be registered for the user id for a given file).
4734  *
4735  * <para>
4736  * <table>
4737  * <title>GFileAttributes Default Namespaces</title>
4738  * <tgroup cols='2' align='left'><thead>
4739  * <row><entry>Namspace</entry><entry>Description</entry></row>
4740  * </thead>
4741  * <tbody>
4742  * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4743  * information that any application may need should be put in this namespace.
4744  * Examples include the file's name, type, and size.</entry></row>
4745  * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4746  * namespace. Currently, the only key in this namespace is "value", which contains
4747  * the value of the current entity tag.</entry></row>
4748  * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4749  * namespace is used by file managers and applications that list directories
4750  * to check for loops and to uniquely identify files.</entry></row>
4751  * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4752  * if a user has the proper privilidges to access files and perform
4753  * file operations. Keys in this namespace are made to be generic
4754  * and easily understood, e.g. the "can_read" key is %TRUE if
4755  * the current user has permission to read the file. UNIX permissions and
4756  * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4757  * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4758  * simple boolean keys for checking if a file or path supports mount operations, e.g.
4759  * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4760  * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4761  * access, changed, created times. </entry></row>
4762  * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4763  * information and may not be available for all files. Examples include
4764  * the UNIX "UID", "GID", etc.</entry></row>
4765  * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4766  * information and may not be available for all files. Examples include
4767  * "is_system" for checking if a file is marked as a system file, and "is_archive"
4768  * for checking if a file is marked as an archive file.</entry></row>
4769  * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4770  * about who owns a file. May not be available for all file systems. Examples include
4771  * "user" for getting the user name of the file owner. This information is often mapped from
4772  * some backend specific data such as a unix UID.</entry></row>
4773  * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4774  * information about file thumbnails and their location within the file system. Examples of
4775  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4776  * to check if thumbnailing of the file failed.</entry></row>
4777  * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4778  * about the file system where a file is located, such as its type, how much
4779  * space is left available, and the overall size of the file system.</entry></row>
4780  * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4781  * contain information about the current GVFS backend in use. </entry></row>
4782  * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4783  * about extended user attributes. See attr(5). The "user." prefix of the
4784  * extended user attribute name is stripped away when constructing keys in
4785  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4786  * the name "user.mime_type". Note that this information is only available
4787  * if GLib has been built with extended attribute support.</entry></row>
4788  * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4789  * Gets information about extended attributes which are not user-specific.
4790  * See attr(5). Note that this information is only available if GLib
4791  * has been built with extended attribute support.</entry></row>
4792  * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4793  * information about the SELinux context of files. Note that this information
4794  * is only available if GLib has been built with SELinux support.</entry></row>
4795  * </tbody>
4796  * </tgroup>
4797  * </table>
4798  * </para>
4799  *
4800  * Please note that these are not all of the possible namespaces.
4801  * More namespaces can be added from GIO modules or by individual applications.
4802  * For more information about writing GIO modules, see #GIOModule.
4803  *
4804  * <!-- TODO: Implementation note about using extended attributes on supported
4805  * file systems -->
4806  *
4807  * <para><table>
4808  * <title>GFileAttributes Built-in Keys and Value Types</title>
4809  * <tgroup cols='3' align='left'><thead>
4810  * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4811  * </thead><tbody>
4812  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4813  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4814  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4815  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4816  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4817  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4818  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4819  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4820  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4821  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4822  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4823  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4824  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4825  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4826  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4827  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4828  * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4829  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4830  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4831  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4832  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4833  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4834  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4835  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4836  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4837  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4838  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4839  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4840  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4841  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4842  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4843  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4844  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4845  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4846  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4847  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4848  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4849  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4850  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4851  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4852  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4853  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4854  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4855  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4856  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4857  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4858  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4859  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4860  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4861  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4862  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4863  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4864  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4865  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4866  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4867  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4868  * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4869  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4870  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4871  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4872  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4873  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4874  * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4875  * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4876  * </tbody></tgroup></table></para>
4877  *
4878  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4879  * namespaces. Keys for the "xattr" namespace are constructed by stripping
4880  * away the "user." prefix from the extended user attribute, and prepending
4881  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4882  * concatenating "xattr-sys::" with the extended attribute name. All extended
4883  * attribute values are returned as hex-encoded strings in which bytes outside
4884  * the ASCII range are encoded as hexadecimal escape sequences of the form
4885  * \x<replaceable>nn</replaceable>.
4886  */
4887
4888
4889 /**
4890  * SECTION:gfiledescriptorbased
4891  * @short_description: Interface for file descriptor based IO
4892  * @include: gio/gfiledescriptorbased.h
4893  * @see_also: #GInputStream, #GOutputStream
4894  *
4895  * #GFileDescriptorBased is implemented by streams (implementations of
4896  * #GInputStream or #GOutputStream) that are based on file descriptors.
4897  *
4898  * Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
4899  * the UNIX-specific GIO interfaces, thus you have to use the
4900  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4901  *
4902  * Since: 2.24
4903  */
4904
4905
4906 /**
4907  * SECTION:gfileenumerator
4908  * @short_description: Enumerated Files Routines
4909  * @include: gio/gio.h
4910  *
4911  * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4912  * returning a #GFileInfo structure for each file enumerated (e.g.
4913  * g_file_enumerate_children() will return a #GFileEnumerator for each
4914  * of the children within a directory).
4915  *
4916  * To get the next file's information from a #GFileEnumerator, use
4917  * g_file_enumerator_next_file() or its asynchronous version,
4918  * g_file_enumerator_next_files_async(). Note that the asynchronous
4919  * version will return a list of #GFileInfo<!---->s, whereas the
4920  * synchronous will only return the next file in the enumerator.
4921  *
4922  * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4923  * its asynchronous version, g_file_enumerator_close_async(). Once
4924  * a #GFileEnumerator is closed, no further actions may be performed
4925  * on it, and it should be freed with g_object_unref().
4926  */
4927
4928
4929 /**
4930  * SECTION:gfileicon
4931  * @short_description: Icons pointing to an image file
4932  * @include: gio/gio.h
4933  * @see_also: #GIcon, #GLoadableIcon
4934  *
4935  * #GFileIcon specifies an icon by pointing to an image file
4936  * to be used as icon.
4937  */
4938
4939
4940 /**
4941  * SECTION:gfileinfo
4942  * @short_description: File Information and Attributes
4943  * @include: gio/gio.h
4944  * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4945  *
4946  * Functionality for manipulating basic metadata for files. #GFileInfo
4947  * implements methods for getting information that all files should
4948  * contain, and allows for manipulation of extended attributes.
4949  *
4950  * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
4951  * information on how GIO handles file attributes.
4952  *
4953  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
4954  * async variant). To obtain a #GFileInfo for a file input or output
4955  * stream, use g_file_input_stream_query_info() or
4956  * g_file_output_stream_query_info() (or their async variants).
4957  *
4958  * To change the actual attributes of a file, you should then set the
4959  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
4960  * or g_file_set_attributes_async() on a GFile.
4961  *
4962  * However, not all attributes can be changed in the file. For instance,
4963  * the actual size of a file cannot be changed via g_file_info_set_size().
4964  * You may call g_file_query_settable_attributes() and
4965  * g_file_query_writable_namespaces() to discover the settable attributes
4966  * of a particular file at runtime.
4967  *
4968  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
4969  * attributes.
4970  */
4971
4972
4973 /**
4974  * SECTION:gfileinputstream
4975  * @short_description: File input streaming operations
4976  * @include: gio/gio.h
4977  * @see_also: #GInputStream, #GDataInputStream, #GSeekable
4978  *
4979  * GFileInputStream provides input streams that take their
4980  * content from a file.
4981  *
4982  * GFileInputStream implements #GSeekable, which allows the input
4983  * stream to jump to arbitrary positions in the file, provided the
4984  * filesystem of the file allows it. To find the position of a file
4985  * input stream, use g_seekable_tell(). To find out if a file input
4986  * stream supports seeking, use g_seekable_can_seek().
4987  * To position a file input stream, use g_seekable_seek().
4988  */
4989
4990
4991 /**
4992  * SECTION:gfileiostream
4993  * @short_description: File read and write streaming operations
4994  * @include: gio/gio.h
4995  * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
4996  *
4997  * GFileIOStream provides io streams that both read and write to the same
4998  * file handle.
4999  *
5000  * GFileIOStream implements #GSeekable, which allows the io
5001  * stream to jump to arbitrary positions in the file and to truncate
5002  * the file, provided the filesystem of the file supports these
5003  * operations.
5004  *
5005  * To find the position of a file io stream, use
5006  * g_seekable_tell().
5007  *
5008  * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5009  * To position a file io stream, use g_seekable_seek().
5010  * To find out if a file io stream supports truncating, use
5011  * g_seekable_can_truncate(). To truncate a file io
5012  * stream, use g_seekable_truncate().
5013  *
5014  * The default implementation of all the #GFileIOStream operations
5015  * and the implementation of #GSeekable just call into the same operations
5016  * on the output stream.
5017  *
5018  * Since: 2.22
5019  */
5020
5021
5022 /**
5023  * SECTION:gfilemonitor
5024  * @short_description: File Monitor
5025  * @include: gio/gio.h
5026  *
5027  * Monitors a file or directory for changes.
5028  *
5029  * To obtain a #GFileMonitor for a file or directory, use
5030  * g_file_monitor(), g_file_monitor_file(), or
5031  * g_file_monitor_directory().
5032  *
5033  * To get informed about changes to the file or directory you are
5034  * monitoring, connect to the #GFileMonitor::changed signal. The
5035  * signal will be emitted in the <link
5036  * linkend="g-main-context-push-thread-default">thread-default main
5037  * context</link> of the thread that the monitor was created in
5038  * (though if the global default main context is blocked, this may
5039  * cause notifications to be blocked even if the thread-default
5040  * context is still running).
5041  */
5042
5043
5044 /**
5045  * SECTION:gfilenamecompleter
5046  * @short_description: Filename Completer
5047  * @include: gio/gio.h
5048  *
5049  * Completes partial file and directory names given a partial string by
5050  * looking in the file system for clues. Can return a list of possible
5051  * completion strings for widget implementations.
5052  */
5053
5054
5055 /**
5056  * SECTION:gfileoutputstream
5057  * @short_description: File output streaming operations
5058  * @include: gio/gio.h
5059  * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5060  *
5061  * GFileOutputStream provides output streams that write their
5062  * content to a file.
5063  *
5064  * GFileOutputStream implements #GSeekable, which allows the output
5065  * stream to jump to arbitrary positions in the file and to truncate
5066  * the file, provided the filesystem of the file supports these
5067  * operations.
5068  *
5069  * To find the position of a file output stream, use g_seekable_tell().
5070  * To find out if a file output stream supports seeking, use
5071  * g_seekable_can_seek().To position a file output stream, use
5072  * g_seekable_seek(). To find out if a file output stream supports
5073  * truncating, use g_seekable_can_truncate(). To truncate a file output
5074  * stream, use g_seekable_truncate().
5075  */
5076
5077
5078 /**
5079  * SECTION:gfilterinputstream
5080  * @short_description: Filter Input Stream
5081  * @include: gio/gio.h
5082  *
5083  * Base class for input stream implementations that perform some
5084  * kind of filtering operation on a base stream. Typical examples
5085  * of filtering operations are character set conversion, compression
5086  * and byte order flipping.
5087  */
5088
5089
5090 /**
5091  * SECTION:gfilteroutputstream
5092  * @short_description: Filter Output Stream
5093  * @include: gio/gio.h
5094  *
5095  * Base class for output stream implementations that perform some
5096  * kind of filtering operation on a base stream. Typical examples
5097  * of filtering operations are character set conversion, compression
5098  * and byte order flipping.
5099  */
5100
5101
5102 /**
5103  * SECTION:gicon
5104  * @short_description: Interface for icons
5105  * @include: gio/gio.h
5106  *
5107  * #GIcon is a very minimal interface for icons. It provides functions
5108  * for checking the equality of two icons, hashing of icons and
5109  * serializing an icon to and from strings.
5110  *
5111  * #GIcon does not provide the actual pixmap for the icon as this is out
5112  * of GIO's scope, however implementations of #GIcon may contain the name
5113  * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5114  *
5115  * To obtain a hash of a #GIcon, see g_icon_hash().
5116  *
5117  * To check if two #GIcons are equal, see g_icon_equal().
5118  *
5119  * For serializing a #GIcon, use g_icon_to_string() and
5120  * g_icon_new_for_string().
5121  *
5122  * If your application or library provides one or more #GIcon
5123  * implementations you need to ensure that each #GType is registered
5124  * with the type system prior to calling g_icon_new_for_string().
5125  */
5126
5127
5128 /**
5129  * SECTION:ginetaddress
5130  * @short_description: An IPv4/IPv6 address
5131  *
5132  * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5133  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5134  * look up the #GInetAddress for a hostname. Use
5135  * g_resolver_lookup_by_address() or
5136  * g_resolver_lookup_by_address_async() to look up the hostname for a
5137  * #GInetAddress.
5138  *
5139  * To actually connect to a remote host, you will need a
5140  * #GInetSocketAddress (which includes a #GInetAddress as well as a
5141  * port number).
5142  */
5143
5144
5145 /**
5146  * SECTION:ginetaddressmask
5147  * @short_description: An IPv4/IPv6 address mask
5148  *
5149  * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5150  * described by a base address and a length indicating how many bits
5151  * of the base address are relevant for matching purposes. These are
5152  * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5153  */
5154
5155
5156 /**
5157  * SECTION:ginetsocketaddress
5158  * @short_description: Internet GSocketAddress
5159  *
5160  * An IPv4 or IPv6 socket address; that is, the combination of a
5161  * #GInetAddress and a port number.
5162  */
5163
5164
5165 /**
5166  * SECTION:ginitable
5167  * @short_description: Failable object initialization interface
5168  * @include: gio/gio.h
5169  * @see_also: #GAsyncInitable
5170  *
5171  * #GInitable is implemented by objects that can fail during
5172  * initialization. If an object implements this interface then
5173  * it must be initialized as the first thing after construction,
5174  * either via g_initable_init() or g_async_initable_init_async()
5175  * (the latter is only available if it also implements #GAsyncInitable).
5176  *
5177  * If the object is not initialized, or initialization returns with an
5178  * error, then all operations on the object except g_object_ref() and
5179  * g_object_unref() are considered to be invalid, and have undefined
5180  * behaviour. They will often fail with g_critical() or g_warning(), but
5181  * this must not be relied on.
5182  *
5183  * Users of objects implementing this are not intended to use
5184  * the interface method directly, instead it will be used automatically
5185  * in various ways. For C applications you generally just call
5186  * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5187  * This will call g_initable_init() under the cover, returning %NULL and
5188  * setting a #GError on failure (at which point the instance is
5189  * unreferenced).
5190  *
5191  * For bindings in languages where the native constructor supports
5192  * exceptions the binding could check for objects implemention %GInitable
5193  * during normal construction and automatically initialize them, throwing
5194  * an exception on failure.
5195  */
5196
5197
5198 /**
5199  * SECTION:ginputstream
5200  * @short_description: Base class for implementing streaming input
5201  * @include: gio/gio.h
5202  *
5203  * #GInputStream has functions to read from a stream (g_input_stream_read()),
5204  * to close a stream (g_input_stream_close()) and to skip some content
5205  * (g_input_stream_skip()).
5206  *
5207  * To copy the content of an input stream to an output stream without
5208  * manually handling the reads and writes, use g_output_stream_splice().
5209  *
5210  * All of these functions have async variants too.
5211  */
5212
5213
5214 /**
5215  * SECTION:gioerror
5216  * @short_description: Error helper functions
5217  * @include: gio/gio.h
5218  *
5219  * Contains helper functions for reporting errors to the user.
5220  */
5221
5222
5223 /**
5224  * SECTION:giomodule
5225  * @short_description: Loadable GIO Modules
5226  * @include: gio/gio.h
5227  *
5228  * Provides an interface and default functions for loading and unloading
5229  * modules. This is used internally to make GIO extensible, but can also
5230  * be used by others to implement module loading.
5231  */
5232
5233
5234 /**
5235  * SECTION:gioscheduler
5236  * @short_description: I/O Scheduler
5237  * @include: gio/gio.h
5238  *
5239  * Schedules asynchronous I/O operations. #GIOScheduler integrates
5240  * into the main event loop (#GMainLoop) and uses threads.
5241  *
5242  * <para id="io-priority"><indexterm><primary>I/O priority</primary></indexterm>
5243  * Each I/O operation has a priority, and the scheduler uses the priorities
5244  * to determine the order in which operations are executed. They are
5245  * <emphasis>not</emphasis> used to determine system-wide I/O scheduling.
5246  * Priorities are integers, with lower numbers indicating higher priority.
5247  * It is recommended to choose priorities between %G_PRIORITY_LOW and
5248  * %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a default.
5249  * </para>
5250  */
5251
5252
5253 /**
5254  * SECTION:giostream
5255  * @short_description: Base class for implementing read/write streams
5256  * @include: gio/gio.h
5257  * @see_also: #GInputStream, #GOutputStream
5258  *
5259  * GIOStream represents an object that has both read and write streams.
5260  * Generally the two streams acts as separate input and output streams,
5261  * but they share some common resources and state. For instance, for
5262  * seekable streams they may use the same position in both streams.
5263  *
5264  * Examples of #GIOStream objects are #GSocketConnection which represents
5265  * a two-way network connection, and #GFileIOStream which represent a
5266  * file handle opened in read-write mode.
5267  *
5268  * To do the actual reading and writing you need to get the substreams
5269  * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5270  *
5271  * The #GIOStream object owns the input and the output streams, not the other
5272  * way around, so keeping the substreams alive will not keep the #GIOStream
5273  * object alive. If the #GIOStream object is freed it will be closed, thus
5274  * closing the substream, so even if the substreams stay alive they will
5275  * always just return a %G_IO_ERROR_CLOSED for all operations.
5276  *
5277  * To close a stream use g_io_stream_close() which will close the common
5278  * stream object and also the individual substreams. You can also close
5279  * the substreams themselves. In most cases this only marks the
5280  * substream as closed, so further I/O on it fails. However, some streams
5281  * may support "half-closed" states where one direction of the stream
5282  * is actually shut down.
5283  *
5284  * Since: 2.22
5285  */
5286
5287
5288 /**
5289  * SECTION:gloadableicon
5290  * @short_description: Loadable Icons
5291  * @include: gio/gio.h
5292  * @see_also: #GIcon, #GThemedIcon
5293  *
5294  * Extends the #GIcon interface and adds the ability to
5295  * load icons from streams.
5296  */
5297
5298
5299 /**
5300  * SECTION:gmemoryinputstream
5301  * @short_description: Streaming input operations on memory chunks
5302  * @include: gio/gio.h
5303  * @see_also: #GMemoryOutputStream
5304  *
5305  * #GMemoryInputStream is a class for using arbitrary
5306  * memory chunks as input for GIO streaming input operations.
5307  *
5308  * As of GLib 2.34, #GMemoryInputStream implements
5309  * #GPollableInputStream.
5310  */
5311
5312
5313 /**
5314  * SECTION:gmemoryoutputstream
5315  * @short_description: Streaming output operations on memory chunks
5316  * @include: gio/gio.h
5317  * @see_also: #GMemoryInputStream
5318  *
5319  * #GMemoryOutputStream is a class for using arbitrary
5320  * memory chunks as output for GIO streaming output operations.
5321  *
5322  * As of GLib 2.34, #GMemoryOutputStream implements
5323  * #GPollableOutputStream.
5324  */
5325
5326
5327 /**
5328  * SECTION:gmenu
5329  * @title: GMenu
5330  * @short_description: A simple implementation of GMenuModel
5331  *
5332  * #GMenu is a simple implementation of #GMenuModel.
5333  * You populate a #GMenu by adding #GMenuItem instances to it.
5334  *
5335  * There are some convenience functions to allow you to directly
5336  * add items (avoiding #GMenuItem) for the common cases. To add
5337  * a regular item, use g_menu_insert(). To add a section, use
5338  * g_menu_insert_section(). To add a submenu, use
5339  * g_menu_insert_submenu().
5340  */
5341
5342
5343 /**
5344  * SECTION:gmenuexporter
5345  * @title: GMenuModel exporter
5346  * @short_description: Export GMenuModels on D-Bus
5347  * @see_also: #GMenuModel, #GDBusMenuModel
5348  *
5349  * These functions support exporting a #GMenuModel on D-Bus.
5350  * The D-Bus interface that is used is a private implementation
5351  * detail.
5352  *
5353  * To access an exported #GMenuModel remotely, use
5354  * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5355  */
5356
5357
5358 /**
5359  * SECTION:gmenumodel
5360  * @title: GMenuModel
5361  * @short_description: An abstract class representing the contents of a menu
5362  * @see_also: #GActionGroup
5363  *
5364  * #GMenuModel represents the contents of a menu -- an ordered list of
5365  * menu items. The items are associated with actions, which can be
5366  * activated through them. Items can be grouped in sections, and may
5367  * have submenus associated with them. Both items and sections usually
5368  * have some representation data, such as labels or icons. The type of
5369  * the associated action (ie whether it is stateful, and what kind of
5370  * state it has) can influence the representation of the item.
5371  *
5372  * The conceptual model of menus in #GMenuModel is hierarchical:
5373  * sections and submenus are again represented by #GMenuModels.
5374  * Menus themselves do not define their own roles. Rather, the role
5375  * of a particular #GMenuModel is defined by the item that references
5376  * it (or, in the case of the 'root' menu, is defined by the context
5377  * in which it is used).
5378  *
5379  * As an example, consider the visible portions of the menu in
5380  * <xref linkend="menu-example"/>.
5381  *
5382  * <figure id="menu-example">
5383  *   <title>An example menu</title>
5384  *   <graphic fileref="menu-example.png" format="PNG"></graphic>
5385  * </figure>
5386  *
5387  * There are 8 "menus" visible in the screenshot: one menubar, two
5388  * submenus and 5 sections:
5389  * <itemizedlist>
5390  * <listitem>the toplevel menubar (containing 4 items)</listitem>
5391  * <listitem>the View submenu (containing 3 sections)</listitem>
5392  * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5393  * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5394  * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5395  * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5396  * <listitem>the Sources section (containing 2 items)</listitem>
5397  * <listitem>the Markup section (containing 2 items)</listitem>
5398  * </itemizedlist>
5399  *
5400  * <xref linkend="menu-model"/> illustrates the conceptual connection between
5401  * these 8 menus. Each large block in the figure represents a menu and the
5402  * smaller blocks within the large block represent items in that menu. Some
5403  * items contain references to other menus.
5404  *
5405  * <figure id="menu-model">
5406  *   <title>A menu model</title>
5407  *   <graphic fileref="menu-model.png" format="PNG"></graphic>
5408  * </figure>
5409  *
5410  * Notice that the separators visible in <xref linkend="menu-example"/>
5411  * appear nowhere in <xref linkend="menu-model"/>. This is because
5412  * separators are not explicitly represented in the menu model. Instead,
5413  * a separator is inserted between any two non-empty sections of a menu.
5414  * Section items can have labels just like any other item. In that case,
5415  * a display system may show a section header instead of a separator.
5416  *
5417  * The motivation for this abstract model of application controls is
5418  * that modern user interfaces tend to make these controls available
5419  * outside the application. Examples include global menus, jumplists,
5420  * dash boards, etc. To support such uses, it is necessary to 'export'
5421  * information about actions and their representation in menus, which
5422  * is exactly what the
5423  * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5424  * and the
5425  * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5426  * do for #GActionGroup and #GMenuModel. The client-side counterparts
5427  * to make use of the exported information are #GDBusActionGroup and
5428  * #GDBusMenuModel.
5429  *
5430  * The API of #GMenuModel is very generic, with iterators for the
5431  * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5432  * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5433  * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5434  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5435  * and %G_MENU_LINK_SUBMENU.
5436  *
5437  * Items in a #GMenuModel represent active controls if they refer to
5438  * an action that can get activated when the user interacts with the
5439  * menu item. The reference to the action is encoded by the string id
5440  * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5441  * identifies an action in an action group. Which action group(s) provide
5442  * actions depends on the context in which the menu model is used.
5443  * E.g. when the model is exported as the application menu of a
5444  * #GtkApplication, actions can be application-wide or window-specific
5445  * (and thus come from two different action groups). By convention, the
5446  * application-wide actions have names that start with "app.", while the
5447  * names of window-specific actions start with "win.".
5448  *
5449  * While a wide variety of stateful actions is possible, the following
5450  * is the minimum that is expected to be supported by all users of exported
5451  * menu information:
5452  * <itemizedlist>
5453  * <listitem>an action with no parameter type and no state</listitem>
5454  * <listitem>an action with no parameter type and boolean state</listitem>
5455  * <listitem>an action with string parameter type and string state</listitem>
5456  * </itemizedlist>
5457  *
5458  * <formalpara><title>Stateless</title>
5459  * <para>
5460  * A stateless action typically corresponds to an ordinary menu item.
5461  * </para>
5462  * <para>
5463  * Selecting such a menu item will activate the action (with no parameter).
5464  * </para>
5465  * </formalpara>
5466  *
5467  * <formalpara><title>Boolean State</title>
5468  * <para>
5469  * An action with a boolean state will most typically be used with a "toggle"
5470  * or "switch" menu item. The state can be set directly, but activating the
5471  * action (with no parameter) results in the state being toggled.
5472  * </para>
5473  * <para>
5474  * Selecting a toggle menu item will activate the action. The menu item should
5475  * be rendered as "checked" when the state is true.
5476  * </para>
5477  * </formalpara>
5478  *
5479  * <formalpara><title>String Parameter and State</title>
5480  * <para>
5481  * Actions with string parameters and state will most typically be used to
5482  * represent an enumerated choice over the items available for a group of
5483  * radio menu items. Activating the action with a string parameter is
5484  * equivalent to setting that parameter as the state.
5485  * </para>
5486  * <para>
5487  * Radio menu items, in addition to being associated with the action, will
5488  * have a target value. Selecting that menu item will result in activation
5489  * of the action with the target value as the parameter. The menu item should
5490  * be rendered as "selected" when the state of the action is equal to the
5491  * target value of the menu item.
5492  * </para>
5493  * </formalpara>
5494  */
5495
5496
5497 /**
5498  * SECTION:gmount
5499  * @short_description: Mount management
5500  * @include: gio/gio.h
5501  * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5502  *
5503  * The #GMount interface represents user-visible mounts. Note, when
5504  * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5505  *
5506  * #GMount is a "mounted" filesystem that you can access. Mounted is in
5507  * quotes because it's not the same as a unix mount, it might be a gvfs
5508  * mount, but you can still access the files on it if you use GIO. Might or
5509  * might not be related to a volume object.
5510  *
5511  * Unmounting a #GMount instance is an asynchronous operation. For
5512  * more information about asynchronous operations, see #GAsyncResult
5513  * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5514  * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5515  * #GAsyncReadyCallback.  The callback will be fired when the
5516  * operation has resolved (either with success or failure), and a
5517  * #GAsyncReady structure will be passed to the callback.  That
5518  * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5519  * and the #GAsyncReady data to see if the operation was completed
5520  * successfully.  If an @error is present when g_mount_unmount_with_operation_finish()
5521  * is called, then it will be filled with any error information.
5522  */
5523
5524
5525 /**
5526  * SECTION:gmountoperation
5527  * @short_description: Object used for authentication and user interaction
5528  * @include: gio/gio.h
5529  *
5530  * #GMountOperation provides a mechanism for interacting with the user.
5531  * It can be used for authenticating mountable operations, such as loop
5532  * mounting files, hard drive partitions or server locations. It can
5533  * also be used to ask the user questions or show a list of applications
5534  * preventing unmount or eject operations from completing.
5535  *
5536  * Note that #GMountOperation is used for more than just #GMount
5537  * objects â€“ for example it is also used in g_drive_start() and
5538  * g_drive_stop().
5539  *
5540  * Users should instantiate a subclass of this that implements all the
5541  * various callbacks to show the required dialogs, such as
5542  * #GtkMountOperation. If no user interaction is desired (for example
5543  * when automounting filesystems at login time), usually %NULL can be
5544  * passed, see each method taking a #GMountOperation for details.
5545  */
5546
5547
5548 /**
5549  * SECTION:gnetworkaddress
5550  * @short_description: A GSocketConnectable for resolving hostnames
5551  * @include: gio/gio.h
5552  *
5553  * #GNetworkAddress provides an easy way to resolve a hostname and
5554  * then attempt to connect to that host, handling the possibility of
5555  * multiple IP addresses and multiple address families.
5556  *
5557  * See #GSocketConnectable for and example of using the connectable
5558  * interface.
5559  */
5560
5561
5562 /**
5563  * SECTION:gnetworkmonitor
5564  * @title: GNetworkMonitor
5565  * @short_description: Network status monitor
5566  * @include: gio/gio.h
5567  *
5568  * #GNetworkMonitor provides an easy-to-use cross-platform API
5569  * for monitoring network connectivity. On Linux, the implementation
5570  * is based on the kernels netlink interface.
5571  */
5572
5573
5574 /**
5575  * SECTION:gnetworkservice
5576  * @short_description: A GSocketConnectable for resolving SRV records
5577  * @include: gio/gio.h
5578  *
5579  * Like #GNetworkAddress does with hostnames, #GNetworkService
5580  * provides an easy way to resolve a SRV record, and then attempt to
5581  * connect to one of the hosts that implements that service, handling
5582  * service priority/weighting, multiple IP addresses, and multiple
5583  * address families.
5584  *
5585  * See #GSrvTarget for more information about SRV records, and see
5586  * #GSocketConnectable for and example of using the connectable
5587  * interface.
5588  */
5589
5590
5591 /**
5592  * SECTION:goutputstream
5593  * @short_description: Base class for implementing streaming output
5594  * @include: gio/gio.h
5595  *
5596  * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5597  * to close a stream (g_output_stream_close()) and to flush pending writes
5598  * (g_output_stream_flush()).
5599  *
5600  * To copy the content of an input stream to an output stream without
5601  * manually handling the reads and writes, use g_output_stream_splice().
5602  *
5603  * All of these functions have async variants too.
5604  */
5605
5606
5607 /**
5608  * SECTION:gpermission
5609  * @title: GPermission
5610  * @short_description: An object representing the permission to perform a certain action
5611  *
5612  * A #GPermission represents the status of the caller's permission to
5613  * perform a certain action.
5614  *
5615  * You can query if the action is currently allowed and if it is
5616  * possible to acquire the permission so that the action will be allowed
5617  * in the future.
5618  *
5619  * There is also an API to actually acquire the permission and one to
5620  * release it.
5621  *
5622  * As an example, a #GPermission might represent the ability for the
5623  * user to write to a #GSettings object.  This #GPermission object could
5624  * then be used to decide if it is appropriate to show a "Click here to
5625  * unlock" button in a dialog and to provide the mechanism to invoke
5626  * when that button is clicked.
5627  */
5628
5629
5630 /**
5631  * SECTION:gpollableinputstream
5632  * @short_description: Interface for pollable input streams
5633  * @include: gio/gio.h
5634  * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5635  *
5636  * #GPollableInputStream is implemented by #GInputStreams that
5637  * can be polled for readiness to read. This can be used when
5638  * interfacing with a non-GIO API that expects
5639  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5640  *
5641  * Since: 2.28
5642  */
5643
5644
5645 /**
5646  * SECTION:gpollableoutputstream
5647  * @short_description: Interface for pollable output streams
5648  * @include: gio/gio.h
5649  * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5650  *
5651  * #GPollableOutputStream is implemented by #GOutputStreams that
5652  * can be polled for readiness to write. This can be used when
5653  * interfacing with a non-GIO API that expects
5654  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5655  *
5656  * Since: 2.28
5657  */
5658
5659
5660 /**
5661  * SECTION:gpollableutils
5662  * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5663  * @include: gio/gio.h
5664  *
5665  * Utility functions for #GPollableInputStream and
5666  * #GPollableOutputStream implementations.
5667  */
5668
5669
5670 /**
5671  * SECTION:gproxy
5672  * @short_description: Interface for proxy handling
5673  *
5674  * A #GProxy handles connecting to a remote host via a given type of
5675  * proxy server. It is implemented by the 'gio-proxy' extension point.
5676  * The extensions are named after their proxy protocol name. As an
5677  * example, a SOCKS5 proxy implementation can be retrieved with the
5678  * name 'socks5' using the function
5679  * g_io_extension_point_get_extension_by_name().
5680  *
5681  * Since: 2.26
5682  */
5683
5684
5685 /**
5686  * SECTION:gproxyaddress
5687  * @short_description: An internet address with proxy information
5688  *
5689  * Support for proxied #GInetSocketAddress.
5690  */
5691
5692
5693 /**
5694  * SECTION:gproxyresolver
5695  * @short_description: Asynchronous and cancellable network proxy resolver
5696  * @include: gio/gio.h
5697  *
5698  * #GProxyResolver provides synchronous and asynchronous network proxy
5699  * resolution. #GProxyResolver is used within #GSocketClient through
5700  * the method g_socket_connectable_proxy_enumerate().
5701  */
5702
5703
5704 /**
5705  * SECTION:gremoteactiongroup
5706  * @title: GRemoteActionGroup
5707  * @short_description: a #GActionGroup that interacts with other processes
5708  *
5709  * The GRemoteActionGroup interface is implemented by #GActionGroup
5710  * instances that either transmit action invocations to other processes
5711  * or receive action invocations in the local process from other
5712  * processes.
5713  *
5714  * The interface has <literal>_full</literal> variants of the two
5715  * methods on #GActionGroup used to activate actions:
5716  * g_action_group_activate_action() and
5717  * g_action_group_change_action_state().  These variants allow a
5718  * "platform data" #GVariant to be specified: a dictionary providing
5719  * context for the action invocation (for example: timestamps, startup
5720  * notification IDs, etc).
5721  *
5722  * #GDBusActionGroup implements #GRemoteActionGroup.  This provides a
5723  * mechanism to send platform data for action invocations over D-Bus.
5724  *
5725  * Additionally, g_dbus_connection_export_action_group() will check if
5726  * the exported #GActionGroup implements #GRemoteActionGroup and use the
5727  * <literal>_full</literal> variants of the calls if available.  This
5728  * provides a mechanism by which to receive platform data for action
5729  * invocations that arrive by way of D-Bus.
5730  *
5731  * Since: 2.32
5732  */
5733
5734
5735 /**
5736  * SECTION:gresolver
5737  * @short_description: Asynchronous and cancellable DNS resolver
5738  * @include: gio/gio.h
5739  *
5740  * #GResolver provides cancellable synchronous and asynchronous DNS
5741  * resolution, for hostnames (g_resolver_lookup_by_address(),
5742  * g_resolver_lookup_by_name() and their async variants) and SRV
5743  * (service) records (g_resolver_lookup_service()).
5744  *
5745  * #GNetworkAddress and #GNetworkService provide wrappers around
5746  * #GResolver functionality that also implement #GSocketConnectable,
5747  * making it easy to connect to a remote host/service.
5748  */
5749
5750
5751 /**
5752  * SECTION:gresource
5753  * @short_description: Resource framework
5754  * @include: gio/gio.h
5755  *
5756  * Applications and libraries often contain binary or textual data that is really part of the
5757  * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5758  * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5759  * manually included as literal strings in the code.
5760  *
5761  * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5762  * provide a convenient and efficient alternative to this which has some nice properties. You
5763  * maintain the files as normal files, so its easy to edit them, but during the build the files
5764  * are combined into a binary bundle that is linked into the executable. This means that loading
5765  * the resource files are efficient (as they are already in memory, shared with other instances) and
5766  * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5767  * also makes it easier to create relocatable applications.
5768  *
5769  * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5770  * in a compressed form, but will be automatically uncompressed when the resource is used. This
5771  * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5772  *
5773  * Resource files can also be marked to be preprocessed, by setting the value of the
5774  * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5775  * The only options currently supported are:
5776  *
5777  * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5778  * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5779  * environment variable must be set to the full path to the xmllint executable, or xmllint
5780  * must be in the PATH; otherwise the preprocessing step is skipped.
5781  *
5782  * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5783  * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5784  * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5785  * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5786  * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5787  * abort.
5788  *
5789  * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5790  * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5791  * are combined into a binary resource bundle.
5792  *
5793  * <example id="resource-example"><title>Example resource description</title>
5794  * <programlisting><![CDATA[
5795  * <?xml version="1.0" encoding="UTF-8"?>
5796  * <gresources>
5797  *   <gresource prefix="/org/gtk/Example">
5798  *     <file>data/splashscreen.png</file>
5799  *     <file compressed="true">dialog.ui</file>
5800  *     <file preprocess="xml-stripblanks">menumarkup.xml</file>
5801  *   </gresource>
5802  * </gresources>
5803  * ]]></programlisting></example>
5804  *
5805  * This will create a resource bundle with the following files:
5806  * <programlisting><![CDATA[
5807  * /org/gtk/Example/data/splashscreen.png
5808  * /org/gtk/Example/dialog.ui
5809  * /org/gtk/Example/menumarkup.xml
5810  * ]]></programlisting>
5811  *
5812  * Note that all resources in the process share the same namespace, so use java-style
5813  * path prefixes (like in the above example) to avoid conflicts.
5814  *
5815  * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5816  * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5817  * --generate-header arguments to create a source file and header to link directly into your application.
5818  *
5819  * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5820  * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5821  * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5822  * the resource data.
5823  *
5824  * There are two forms of the generated source, the default version uses the compiler support for constructor
5825  * and destructor functions (where available) to automatically create and register the #GResource on startup
5826  * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5827  * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5828  * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5829  *
5830  * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5831  * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5832  * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5833  * is for your own resources, and resource data is often used once, during parsing, and then released.
5834  *
5835  * Since: 2.32
5836  */
5837
5838
5839 /**
5840  * SECTION:gseekable
5841  * @short_description: Stream seeking interface
5842  * @include: gio/gio.h
5843  * @see_also: #GInputStream, #GOutputStream
5844  *
5845  * #GSeekable is implemented by streams (implementations of
5846  * #GInputStream or #GOutputStream) that support seeking.
5847  */
5848
5849
5850 /**
5851  * SECTION:gsettings
5852  * @short_description: High-level API for application settings
5853  *
5854  * The #GSettings class provides a convenient API for storing and retrieving
5855  * application settings.
5856  *
5857  * Reads and writes can be considered to be non-blocking.  Reading
5858  * settings with #GSettings is typically extremely fast: on
5859  * approximately the same order of magnitude (but slower than) a
5860  * #GHashTable lookup.  Writing settings is also extremely fast in terms
5861  * of time to return to your application, but can be extremely expensive
5862  * for other threads and other processes.  Many settings backends
5863  * (including dconf) have lazy initialisation which means in the common
5864  * case of the user using their computer without modifying any settings
5865  * a lot of work can be avoided.  For dconf, the D-Bus service doesn't
5866  * even need to be started in this case.  For this reason, you should
5867  * only ever modify #GSettings keys in response to explicit user action.
5868  * Particular care should be paid to ensure that modifications are not
5869  * made during startup -- for example, when setting the initial value
5870  * of preferences widgets.  The built-in g_settings_bind() functionality
5871  * is careful not to write settings in response to notify signals as a
5872  * result of modifications that it makes to widgets.
5873  *
5874  * When creating a GSettings instance, you have to specify a schema
5875  * that describes the keys in your settings and their types and default
5876  * values, as well as some other information.
5877  *
5878  * Normally, a schema has as fixed path that determines where the settings
5879  * are stored in the conceptual global tree of settings. However, schemas
5880  * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5881  * useful e.g. when the schema describes an 'account', and you want to be
5882  * able to store a arbitrary number of accounts.
5883  *
5884  * Paths must start with and end with a forward slash character ('/')
5885  * and must not contain two sequential slash characters.  Paths should
5886  * be chosen based on a domain name associated with the program or
5887  * library to which the settings belong.  Examples of paths are
5888  * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5889  * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5890  * they often did in GConf.
5891  *
5892  * Unlike other configuration systems (like GConf), GSettings does not
5893  * restrict keys to basic types like strings and numbers. GSettings stores
5894  * values as #GVariant, and allows any #GVariantType for keys. Key names
5895  * are restricted to lowercase characters, numbers and '-'. Furthermore,
5896  * the names must begin with a lowercase character, must not end
5897  * with a '-', and must not contain consecutive dashes.
5898  *
5899  * Similar to GConf, the default values in GSettings schemas can be
5900  * localized, but the localized values are stored in gettext catalogs
5901  * and looked up with the domain that is specified in the
5902  * <tag class="attribute">gettext-domain</tag> attribute of the
5903  * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5904  * elements and the category that is specified in the l10n attribute of the
5905  * <tag class="starttag">key</tag> element.
5906  *
5907  * GSettings uses schemas in a compact binary form that is created
5908  * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5909  * utility. The input is a schema description in an XML format that can be
5910  * described by the following DTD:
5911  * |[<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>]|
5912  *
5913  * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5914  *
5915  * At runtime, schemas are identified by their id (as specified
5916  * in the <tag class="attribute">id</tag> attribute of the
5917  * <tag class="starttag">schema</tag> element). The
5918  * convention for schema ids is to use a dotted name, similar in
5919  * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5920  * if the settings are for a specific service that owns a D-Bus bus name,
5921  * the D-Bus bus name and schema id should match. For schemas which deal
5922  * with settings not associated with one named application, the id should
5923  * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5924  *
5925  * In addition to #GVariant types, keys can have types that have enumerated
5926  * types. These can be described by a <tag class="starttag">choice</tag>,
5927  * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5928  * <xref linkend="schema-enumerated"/>. The underlying type of
5929  * such a key is string, but you can use g_settings_get_enum(),
5930  * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5931  * access the numeric values corresponding to the string value of enum
5932  * and flags keys.
5933  *
5934  * <example id="schema-default-values"><title>Default values</title>
5935  * <programlisting><![CDATA[
5936  * <schemalist>
5937  *   <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5938  *
5939  *     <key name="greeting" type="s">
5940  *       <default l10n="messages">"Hello, earthlings"</default>
5941  *       <summary>A greeting</summary>
5942  *       <description>
5943  *         Greeting of the invading martians
5944  *       </description>
5945  *     </key>
5946  *
5947  *     <key name="box" type="(ii)">
5948  *       <default>(20,30)</default>
5949  *     </key>
5950  *
5951  *   </schema>
5952  * </schemalist>
5953  * ]]></programlisting></example>
5954  *
5955  * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
5956  * <programlisting><![CDATA[
5957  * <schemalist>
5958  *
5959  *   <enum id="org.gtk.Test.myenum">
5960  *     <value nick="first" value="1"/>
5961  *     <value nick="second" value="2"/>
5962  *   </enum>
5963  *
5964  *   <flags id="org.gtk.Test.myflags">
5965  *     <value nick="flag1" value="1"/>
5966  *     <value nick="flag2" value="2"/>
5967  *     <value nick="flag3" value="4"/>
5968  *   </flags>
5969  *
5970  *   <schema id="org.gtk.Test">
5971  *
5972  *     <key name="key-with-range" type="i">
5973  *       <range min="1" max="100"/>
5974  *       <default>10</default>
5975  *     </key>
5976  *
5977  *     <key name="key-with-choices" type="s">
5978  *       <choices>
5979  *         <choice value='Elisabeth'/>
5980  *         <choice value='Annabeth'/>
5981  *         <choice value='Joe'/>
5982  *       </choices>
5983  *       <aliases>
5984  *         <alias value='Anna' target='Annabeth'/>
5985  *         <alias value='Beth' target='Elisabeth'/>
5986  *       </aliases>
5987  *       <default>'Joe'</default>
5988  *     </key>
5989  *
5990  *     <key name='enumerated-key' enum='org.gtk.Test.myenum'>
5991  *       <default>'first'</default>
5992  *     </key>
5993  *
5994  *     <key name='flags-key' flags='org.gtk.Test.myflags'>
5995  *       <default>["flag1",flag2"]</default>
5996  *     </key>
5997  *   </schema>
5998  * </schemalist>
5999  * ]]></programlisting></example>
6000  *
6001  * <refsect2>
6002  *   <title>Vendor overrides</title>
6003  *   <para>
6004  *     Default values are defined in the schemas that get installed by
6005  *     an application. Sometimes, it is necessary for a vendor or distributor
6006  *     to adjust these defaults. Since patching the XML source for the schema
6007  *     is inconvenient and error-prone,
6008  *     <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6009  *     so-called 'vendor override' files. These are keyfiles in the same
6010  *     directory as the XML schema sources which can override default values.
6011  *     The schema id serves as the group name in the key file, and the values
6012  *     are expected in serialized GVariant form, as in the following example:
6013  *     <informalexample><programlisting>
6014  *     [org.gtk.Example]
6015  *     key1='string'
6016  *     key2=1.5
6017  *     </programlisting></informalexample>
6018  *   </para>
6019  *   <para>
6020  *     glib-compile-schemas expects schema files to have the extension
6021  *     <filename>.gschema.override</filename>
6022  *   </para>
6023  * </refsect2>
6024  *
6025  * <refsect2>
6026  *   <title>Binding</title>
6027  *   <para>
6028  *     A very convenient feature of GSettings lets you bind #GObject properties
6029  *     directly to settings, using g_settings_bind(). Once a GObject property
6030  *     has been bound to a setting, changes on either side are automatically
6031  *     propagated to the other side. GSettings handles details like
6032  *     mapping between GObject and GVariant types, and preventing infinite
6033  *     cycles.
6034  *   </para>
6035  *   <para>
6036  *     This makes it very easy to hook up a preferences dialog to the
6037  *     underlying settings. To make this even more convenient, GSettings
6038  *     looks for a boolean property with the name "sensitivity" and
6039  *     automatically binds it to the writability of the bound setting.
6040  *     If this 'magic' gets in the way, it can be suppressed with the
6041  *     #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6042  *   </para>
6043  * </refsect2>
6044  */
6045
6046
6047 /**
6048  * SECTION:gsettingsbackend
6049  * @title: GSettingsBackend
6050  * @short_description: Interface for settings backend implementations
6051  * @include: gio/gsettingsbackend.h
6052  * @see_also: #GSettings, #GIOExtensionPoint
6053  *
6054  * The #GSettingsBackend interface defines a generic interface for
6055  * non-strictly-typed data that is stored in a hierarchy. To implement
6056  * an alternative storage backend for #GSettings, you need to implement
6057  * the #GSettingsBackend interface and then make it implement the
6058  * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6059  *
6060  * The interface defines methods for reading and writing values, a
6061  * method for determining if writing of certain values will fail
6062  * (lockdown) and a change notification mechanism.
6063  *
6064  * The semantics of the interface are very precisely defined and
6065  * implementations must carefully adhere to the expectations of
6066  * callers that are documented on each of the interface methods.
6067  *
6068  * Some of the GSettingsBackend functions accept or return a #GTree.
6069  * These trees always have strings as keys and #GVariant as values.
6070  * g_settings_backend_create_tree() is a convenience function to create
6071  * suitable trees.
6072  *
6073  * <note><para>
6074  * The #GSettingsBackend API is exported to allow third-party
6075  * implementations, but does not carry the same stability guarantees
6076  * as the public GIO API. For this reason, you have to define the
6077  * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6078  * <filename>gio/gsettingsbackend.h</filename>
6079  * </para></note>
6080  */
6081
6082
6083 /**
6084  * SECTION:gsettingsschema
6085  * @short_description: introspecting and controlling the loading of GSettings schemas
6086  *
6087  * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6088  * mechanism for advanced control over the loading of schemas and a
6089  * mechanism for introspecting their content.
6090  *
6091  * Plugin loading systems that wish to provide plugins a way to access
6092  * settings face the problem of how to make the schemas for these
6093  * settings visible to GSettings.  Typically, a plugin will want to ship
6094  * the schema along with itself and it won't be installed into the
6095  * standard system directories for schemas.
6096  *
6097  * #GSettingsSchemaSource provides a mechanism for dealing with this by
6098  * allowing the creation of a new 'schema source' from which schemas can
6099  * be acquired.  This schema source can then become part of the metadata
6100  * associated with the plugin and queried whenever the plugin requires
6101  * access to some settings.
6102  *
6103  * Consider the following example:
6104  *
6105  * |[
6106  * typedef struct
6107  * {
6108  *    ...
6109  *    GSettingsSchemaSource *schema_source;
6110  *    ...
6111  * } Plugin;
6112  *
6113  * Plugin *
6114  * initialise_plugin (const gchar *dir)
6115  * {
6116  *   Plugin *plugin;
6117  *
6118  *   ...
6119  *
6120  *   plugin->schema_source =
6121  *     g_settings_new_schema_source_from_directory (dir,
6122  *       g_settings_schema_source_get_default (), FALSE, NULL);
6123  *
6124  *   ...
6125  *
6126  *   return plugin;
6127  * }
6128  *
6129  * ...
6130  *
6131  * GSettings *
6132  * plugin_get_settings (Plugin      *plugin,
6133  *                      const gchar *schema_id)
6134  * {
6135  *   GSettingsSchema *schema;
6136  *
6137  *   if (schema_id == NULL)
6138  *     schema_id = plugin->identifier;
6139  *
6140  *   schema = g_settings_schema_source_lookup (plugin->schema_source,
6141  *                                             schema_id, FALSE);
6142  *
6143  *   if (schema == NULL)
6144  *     {
6145  *       ... disable the plugin or abort, etc ...
6146  *     }
6147  *
6148  *   return g_settings_new_full (schema, NULL, NULL);
6149  * }
6150  * ]|
6151  *
6152  * The code above shows how hooks should be added to the code that
6153  * initialises (or enables) the plugin to create the schema source and
6154  * how an API can be added to the plugin system to provide a convenient
6155  * way for the plugin to access its settings, using the schemas that it
6156  * ships.
6157  *
6158  * From the standpoint of the plugin, it would need to ensure that it
6159  * ships a gschemas.compiled file as part of itself, and then simply do
6160  * the following:
6161  *
6162  * |[
6163  * {
6164  *   GSettings *settings;
6165  *   gint some_value;
6166  *
6167  *   settings = plugin_get_settings (self, NULL);
6168  *   some_value = g_settings_get_int (settings, "some-value");
6169  *   ...
6170  * }
6171  * ]|
6172  *
6173  * It's also possible that the plugin system expects the schema source
6174  * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6175  * In that case, the plugin loading system must compile the schemas for
6176  * itself before attempting to create the settings source.
6177  *
6178  * Since: 2.32
6179  */
6180
6181
6182 /**
6183  * SECTION:gsimpleaction
6184  * @title: GSimpleAction
6185  * @short_description: A simple GAction implementation
6186  *
6187  * A #GSimpleAction is the obvious simple implementation of the #GAction
6188  * interface. This is the easiest way to create an action for purposes of
6189  * adding it to a #GSimpleActionGroup.
6190  *
6191  * See also #GtkAction.
6192  */
6193
6194
6195 /**
6196  * SECTION:gsimpleactiongroup
6197  * @title: GSimpleActionGroup
6198  * @short_description: A simple GActionGroup implementation
6199  *
6200  * #GSimpleActionGroup is a hash table filled with #GAction objects,
6201  * implementing the #GActionGroup and #GActionMap interfaces.
6202  */
6203
6204
6205 /**
6206  * SECTION:gsimpleasyncresult
6207  * @short_description: Simple asynchronous results implementation
6208  * @include: gio/gio.h
6209  * @see_also: #GAsyncResult
6210  *
6211  * Implements #GAsyncResult for simple cases. Most of the time, this
6212  * will be all an application needs, and will be used transparently.
6213  * Because of this, #GSimpleAsyncResult is used throughout GIO for
6214  * handling asynchronous functions.
6215  *
6216  * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6217  * reporting, operation cancellation and the final state of an operation,
6218  * completely transparent to the application. Results can be returned
6219  * as a pointer e.g. for functions that return data that is collected
6220  * asynchronously, a boolean value for checking the success or failure
6221  * of an operation, or a #gssize for operations which return the number
6222  * of bytes modified by the operation; all of the simple return cases
6223  * are covered.
6224  *
6225  * Most of the time, an application will not need to know of the details
6226  * of this API; it is handled transparently, and any necessary operations
6227  * are handled by #GAsyncResult's interface. However, if implementing a
6228  * new GIO module, for writing language bindings, or for complex
6229  * applications that need better control of how asynchronous operations
6230  * are completed, it is important to understand this functionality.
6231  *
6232  * GSimpleAsyncResults are tagged with the calling function to ensure
6233  * that asynchronous functions and their finishing functions are used
6234  * together correctly.
6235  *
6236  * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6237  * If the result needs to be created for a #GError, use
6238  * g_simple_async_result_new_from_error() or
6239  * g_simple_async_result_new_take_error(). If a #GError is not available
6240  * (e.g. the asynchronous operation's doesn't take a #GError argument),
6241  * but the result still needs to be created for an error condition, use
6242  * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6243  * if your application or binding requires passing a variable argument list
6244  * directly), and the error can then be propagated through the use of
6245  * g_simple_async_result_propagate_error().
6246  *
6247  * An asynchronous operation can be made to ignore a cancellation event by
6248  * calling g_simple_async_result_set_handle_cancellation() with a
6249  * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6250  * operations that are dangerous to cancel, such as close (which would
6251  * cause a leak if cancelled before being run).
6252  *
6253  * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6254  * or it can use #GThread<!-- -->s.
6255  * g_simple_async_result_complete() will finish an I/O task directly
6256  * from the point where it is called. g_simple_async_result_complete_in_idle()
6257  * will finish it from an idle handler in the <link
6258  * linkend="g-main-context-push-thread-default">thread-default main
6259  * context</link>. g_simple_async_result_run_in_thread() will run the
6260  * job in a separate thread and then deliver the result to the
6261  * thread-default main context.
6262  *
6263  * To set the results of an asynchronous function,
6264  * g_simple_async_result_set_op_res_gpointer(),
6265  * g_simple_async_result_set_op_res_gboolean(), and
6266  * g_simple_async_result_set_op_res_gssize()
6267  * are provided, setting the operation's result to a gpointer, gboolean, or
6268  * gssize, respectively.
6269  *
6270  * Likewise, to get the result of an asynchronous function,
6271  * g_simple_async_result_get_op_res_gpointer(),
6272  * g_simple_async_result_get_op_res_gboolean(), and
6273  * g_simple_async_result_get_op_res_gssize() are
6274  * provided, getting the operation's result as a gpointer, gboolean, and
6275  * gssize, respectively.
6276  *
6277  * For the details of the requirements implementations must respect, see
6278  * #GAsyncResult.  A typical implementation of an asynchronous operation
6279  * using GSimpleAsyncResult looks something like this:
6280  *
6281  * |[
6282  * static void
6283  * baked_cb (Cake    *cake,
6284  *           gpointer user_data)
6285  * {
6286  *   /&ast; In this example, this callback is not given a reference to the cake, so
6287  *    &ast; the GSimpleAsyncResult has to take a reference to it.
6288  *    &ast;/
6289  *   GSimpleAsyncResult *result = user_data;
6290  *
6291  *   if (cake == NULL)
6292  *     g_simple_async_result_set_error (result,
6293  *                                      BAKER_ERRORS,
6294  *                                      BAKER_ERROR_NO_FLOUR,
6295  *                                      "Go to the supermarket");
6296  *   else
6297  *     g_simple_async_result_set_op_res_gpointer (result,
6298  *                                                g_object_ref (cake),
6299  *                                                g_object_unref);
6300  *
6301  *
6302  *   /&ast; In this example, we assume that baked_cb is called as a callback from
6303  *    &ast; the mainloop, so it's safe to complete the operation synchronously here.
6304  *    &ast; If, however, _baker_prepare_cake () might call its callback without
6305  *    &ast; first returning to the mainloop â€” inadvisable, but some APIs do so â€”
6306  *    &ast; we would need to use g_simple_async_result_complete_in_idle().
6307  *    &ast;/
6308  *   g_simple_async_result_complete (result);
6309  *   g_object_unref (result);
6310  * }
6311  *
6312  * void
6313  * baker_bake_cake_async (Baker              *self,
6314  *                        guint               radius,
6315  *                        GAsyncReadyCallback callback,
6316  *                        gpointer            user_data)
6317  * {
6318  *   GSimpleAsyncResult *simple;
6319  *   Cake               *cake;
6320  *
6321  *   if (radius < 3)
6322  *     {
6323  *       g_simple_async_report_error_in_idle (G_OBJECT (self),
6324  *                                            callback,
6325  *                                            user_data,
6326  *                                            BAKER_ERRORS,
6327  *                                            BAKER_ERROR_TOO_SMALL,
6328  *                                            "%ucm radius cakes are silly",
6329  *                                            radius);
6330  *       return;
6331  *     }
6332  *
6333  *   simple = g_simple_async_result_new (G_OBJECT (self),
6334  *                                       callback,
6335  *                                       user_data,
6336  *                                       baker_bake_cake_async);
6337  *   cake = _baker_get_cached_cake (self, radius);
6338  *
6339  *   if (cake != NULL)
6340  *     {
6341  *       g_simple_async_result_set_op_res_gpointer (simple,
6342  *                                                  g_object_ref (cake),
6343  *                                                  g_object_unref);
6344  *       g_simple_async_result_complete_in_idle (simple);
6345  *       g_object_unref (simple);
6346  *       /&ast; Drop the reference returned by _baker_get_cached_cake(); the
6347  *        &ast; GSimpleAsyncResult has taken its own reference.
6348  *        &ast;/
6349  *       g_object_unref (cake);
6350  *       return;
6351  *     }
6352  *
6353  *   _baker_prepare_cake (self, radius, baked_cb, simple);
6354  * }
6355  *
6356  * Cake *
6357  * baker_bake_cake_finish (Baker        *self,
6358  *                         GAsyncResult *result,
6359  *                         GError      **error)
6360  * {
6361  *   GSimpleAsyncResult *simple;
6362  *   Cake               *cake;
6363  *
6364  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
6365  *                                                         G_OBJECT (self),
6366  *                                                         baker_bake_cake_async),
6367  *                         NULL);
6368  *
6369  *   simple = (GSimpleAsyncResult *) result;
6370  *
6371  *   if (g_simple_async_result_propagate_error (simple, error))
6372  *     return NULL;
6373  *
6374  *   cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6375  *   return g_object_ref (cake);
6376  * }
6377  * ]|
6378  */
6379
6380
6381 /**
6382  * SECTION:gsimplepermission
6383  * @title: GSimplePermission
6384  * @short_description: A GPermission that doesn't change value
6385  *
6386  * #GSimplePermission is a trivial implementation of #GPermission that
6387  * represents a permission that is either always or never allowed.  The
6388  * value is given at construction and doesn't change.
6389  *
6390  * Calling request or release will result in errors.
6391  */
6392
6393
6394 /**
6395  * SECTION:gsocket
6396  * @short_description: Low-level socket object
6397  * @include: gio/gio.h
6398  * @see_also: #GInitable
6399  *
6400  * A #GSocket is a low-level networking primitive. It is a more or less
6401  * direct mapping of the BSD socket API in a portable GObject based API.
6402  * It supports both the UNIX socket implementations and winsock2 on Windows.
6403  *
6404  * #GSocket is the platform independent base upon which the higher level
6405  * network primitives are based. Applications are not typically meant to
6406  * use it directly, but rather through classes like #GSocketClient,
6407  * #GSocketService and #GSocketConnection. However there may be cases where
6408  * direct use of #GSocket is useful.
6409  *
6410  * #GSocket implements the #GInitable interface, so if it is manually constructed
6411  * by e.g. g_object_new() you must call g_initable_init() and check the
6412  * results before using the object. This is done automatically in
6413  * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6414  * %NULL.
6415  *
6416  * Sockets operate in two general modes, blocking or non-blocking. When
6417  * in blocking mode all operations block until the requested operation
6418  * is finished or there is an error. In non-blocking mode all calls that
6419  * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6420  * To know when a call would successfully run you can call g_socket_condition_check(),
6421  * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6422  * attach it to a #GMainContext to get callbacks when I/O is possible.
6423  * Note that all sockets are always set to non blocking mode in the system, and
6424  * blocking mode is emulated in GSocket.
6425  *
6426  * When working in non-blocking mode applications should always be able to
6427  * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6428  * function said that I/O was possible. This can easily happen in case
6429  * of a race condition in the application, but it can also happen for other
6430  * reasons. For instance, on Windows a socket is always seen as writable
6431  * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6432  *
6433  * #GSocket<!-- -->s can be either connection oriented or datagram based.
6434  * For connection oriented types you must first establish a connection by
6435  * either connecting to an address or accepting a connection from another
6436  * address. For connectionless socket types the target/source address is
6437  * specified or received in each I/O operation.
6438  *
6439  * All socket file descriptors are set to be close-on-exec.
6440  *
6441  * Note that creating a #GSocket causes the signal %SIGPIPE to be
6442  * ignored for the remainder of the program. If you are writing a
6443  * command-line utility that uses #GSocket, you may need to take into
6444  * account the fact that your program will not automatically be killed
6445  * if it tries to write to %stdout after it has been closed.
6446  *
6447  * Since: 2.22
6448  */
6449
6450
6451 /**
6452  * SECTION:gsocketaddress
6453  * @short_description: Abstract base class representing endpoints for socket communication
6454  *
6455  * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6456  * in the BSD sockets API. This is an abstract class; use
6457  * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6458  * for UNIX domain sockets.
6459  */
6460
6461
6462 /**
6463  * SECTION:gsocketclient
6464  * @short_description: Helper for connecting to a network service
6465  * @include: gio/gio.h
6466  * @see_also: #GSocketConnection, #GSocketListener
6467  *
6468  * #GSocketClient is a lightweight high-level utility class for connecting to
6469  * a network host using a connection oriented socket type.
6470  *
6471  * You create a #GSocketClient object, set any options you want, and then
6472  * call a sync or async connect operation, which returns a #GSocketConnection
6473  * subclass on success.
6474  *
6475  * The type of the #GSocketConnection object returned depends on the type of
6476  * the underlying socket that is in use. For instance, for a TCP/IP connection
6477  * it will be a #GTcpConnection.
6478  *
6479  * As #GSocketClient is a lightweight object, you don't need to cache it. You
6480  * can just create a new one any time you need one.
6481  *
6482  * Since: 2.22
6483  */
6484
6485
6486 /**
6487  * SECTION:gsocketconnectable
6488  * @short_description: Interface for potential socket endpoints
6489  *
6490  * Objects that describe one or more potential socket endpoints
6491  * implement #GSocketConnectable. Callers can then use
6492  * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6493  * to try out each socket address in turn until one succeeds, as shown
6494  * in the sample code below.
6495  *
6496  * |[
6497  * MyConnectionType *
6498  * connect_to_host (const char    *hostname,
6499  *                  guint16        port,
6500  *                  GCancellable  *cancellable,
6501  *                  GError       **error)
6502  * {
6503  *   MyConnection *conn = NULL;
6504  *   GSocketConnectable *addr;
6505  *   GSocketAddressEnumerator *enumerator;
6506  *   GSocketAddress *sockaddr;
6507  *   GError *conn_error = NULL;
6508  *
6509  *   addr = g_network_address_new ("www.gnome.org", 80);
6510  *   enumerator = g_socket_connectable_enumerate (addr);
6511  *   g_object_unref (addr);
6512  *
6513  *   /<!-- -->* Try each sockaddr until we succeed. Record the first
6514  *    * connection error, but not any further ones (since they'll probably
6515  *    * be basically the same as the first).
6516  *    *<!-- -->/
6517  *   while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6518  *     {
6519  *       conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6520  *       g_object_unref (sockaddr);
6521  *     }
6522  *   g_object_unref (enumerator);
6523  *
6524  *   if (conn)
6525  *     {
6526  *       if (conn_error)
6527  *         {
6528  *           /<!-- -->* We couldn't connect to the first address, but we succeeded
6529  *            * in connecting to a later address.
6530  *            *<!-- -->/
6531  *           g_error_free (conn_error);
6532  *         }
6533  *       return conn;
6534  *     }
6535  *   else if (error)
6536  *     {
6537  *       /<!-- -->* Either the initial lookup failed, or else the caller
6538  *        * cancelled us.
6539  *        *<!-- -->/
6540  *       if (conn_error)
6541  *         g_error_free (conn_error);
6542  *       return NULL;
6543  *     }
6544  *   else
6545  *     {
6546  *       g_error_propagate (error, conn_error);
6547  *       return NULL;
6548  *     }
6549  * }
6550  * ]|
6551  */
6552
6553
6554 /**
6555  * SECTION:gsocketconnection
6556  * @short_description: A socket connection
6557  * @include: gio/gio.h
6558  * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6559  *
6560  * #GSocketConnection is a #GIOStream for a connected socket. They
6561  * can be created either by #GSocketClient when connecting to a host,
6562  * or by #GSocketListener when accepting a new client.
6563  *
6564  * The type of the #GSocketConnection object returned from these calls
6565  * depends on the type of the underlying socket that is in use. For
6566  * instance, for a TCP/IP connection it will be a #GTcpConnection.
6567  *
6568  * Choosing what type of object to construct is done with the socket
6569  * connection factory, and it is possible for 3rd parties to register
6570  * custom socket connection types for specific combination of socket
6571  * family/type/protocol using g_socket_connection_factory_register_type().
6572  *
6573  * Since: 2.22
6574  */
6575
6576
6577 /**
6578  * SECTION:gsocketcontrolmessage
6579  * @title: GSocketControlMessage
6580  * @short_description: A GSocket control message
6581  * @see_also: #GSocket.
6582  *
6583  * A #GSocketControlMessage is a special-purpose utility message that
6584  * can be sent to or received from a #GSocket. These types of
6585  * messages are often called "ancillary data".
6586  *
6587  * The message can represent some sort of special instruction to or
6588  * information from the socket or can represent a special kind of
6589  * transfer to the peer (for example, sending a file description over
6590  * a UNIX socket).
6591  *
6592  * These messages are sent with g_socket_send_message() and received
6593  * with g_socket_receive_message().
6594  *
6595  * To extend the set of control message that can be sent, subclass this
6596  * class and override the get_size, get_level, get_type and serialize
6597  * methods.
6598  *
6599  * To extend the set of control messages that can be received, subclass
6600  * this class and implement the deserialize method. Also, make sure your
6601  * class is registered with the GType typesystem before calling
6602  * g_socket_receive_message() to read such a message.
6603  *
6604  * Since: 2.22
6605  */
6606
6607
6608 /**
6609  * SECTION:gsocketlistener
6610  * @title: GSocketListener
6611  * @short_description: Helper for accepting network client connections
6612  * @see_also: #GThreadedSocketService, #GSocketService.
6613  *
6614  * A #GSocketListener is an object that keeps track of a set
6615  * of server sockets and helps you accept sockets from any of the
6616  * socket, either sync or async.
6617  *
6618  * If you want to implement a network server, also look at #GSocketService
6619  * and #GThreadedSocketService which are subclass of #GSocketListener
6620  * that makes this even easier.
6621  *
6622  * Since: 2.22
6623  */
6624
6625
6626 /**
6627  * SECTION:gsocketservice
6628  * @title: GSocketService
6629  * @short_description: Make it easy to implement a network service
6630  * @see_also: #GThreadedSocketService, #GSocketListener.
6631  *
6632  * A #GSocketService is an object that represents a service that
6633  * is provided to the network or over local sockets.  When a new
6634  * connection is made to the service the #GSocketService::incoming
6635  * signal is emitted.
6636  *
6637  * A #GSocketService is a subclass of #GSocketListener and you need
6638  * to add the addresses you want to accept connections on with the
6639  * #GSocketListener APIs.
6640  *
6641  * There are two options for implementing a network service based on
6642  * #GSocketService. The first is to create the service using
6643  * g_socket_service_new() and to connect to the #GSocketService::incoming
6644  * signal. The second is to subclass #GSocketService and override the
6645  * default signal handler implementation.
6646  *
6647  * In either case, the handler must immediately return, or else it
6648  * will block additional incoming connections from being serviced.
6649  * If you are interested in writing connection handlers that contain
6650  * blocking code then see #GThreadedSocketService.
6651  *
6652  * The socket service runs on the main loop of the <link
6653  * linkend="g-main-context-push-thread-default-context">thread-default
6654  * context</link> of the thread it is created in, and is not
6655  * threadsafe in general. However, the calls to start and stop the
6656  * service are thread-safe so these can be used from threads that
6657  * handle incoming clients.
6658  *
6659  * Since: 2.22
6660  */
6661
6662
6663 /**
6664  * SECTION:gsrvtarget
6665  * @short_description: DNS SRV record target
6666  * @include: gio/gio.h
6667  *
6668  * SRV (service) records are used by some network protocols to provide
6669  * service-specific aliasing and load-balancing. For example, XMPP
6670  * (Jabber) uses SRV records to locate the XMPP server for a domain;
6671  * rather than connecting directly to "example.com" or assuming a
6672  * specific server hostname like "xmpp.example.com", an XMPP client
6673  * would look up the "xmpp-client" SRV record for "example.com", and
6674  * then connect to whatever host was pointed to by that record.
6675  *
6676  * You can use g_resolver_lookup_service() or
6677  * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6678  * for a given service. However, if you are simply planning to connect
6679  * to the remote service, you can use #GNetworkService's
6680  * #GSocketConnectable interface and not need to worry about
6681  * #GSrvTarget at all.
6682  */
6683
6684
6685 /**
6686  * SECTION:gtcpconnection
6687  * @title: GTcpConnection
6688  * @short_description: A TCP GSocketConnection
6689  * @see_also: #GSocketConnection.
6690  *
6691  * This is the subclass of #GSocketConnection that is created
6692  * for TCP/IP sockets.
6693  *
6694  * Since: 2.22
6695  */
6696
6697
6698 /**
6699  * SECTION:gtcpwrapperconnection
6700  * @title: GTcpWrapperConnection
6701  * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
6702  * @see_also: #GSocketConnection.
6703  *
6704  * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
6705  * based on a #GSocket, but which is not actually a
6706  * #GSocketConnection. This is used by #GSocketClient so that it can
6707  * always return a #GSocketConnection, even when the connection it has
6708  * actually created is not directly a #GSocketConnection.
6709  *
6710  * Since: 2.28
6711  */
6712
6713
6714 /**
6715  * SECTION:gtestdbus
6716  * @short_description: D-Bus testing helper
6717  * @include: gio/gio.h
6718  *
6719  * Helper to test D-Bus code wihtout messing up with user' session bus.
6720  */
6721
6722
6723 /**
6724  * SECTION:gthemedicon
6725  * @short_description: Icon theming support
6726  * @include: gio/gio.h
6727  * @see_also: #GIcon, #GLoadableIcon
6728  *
6729  * #GThemedIcon is an implementation of #GIcon that supports icon themes.
6730  * #GThemedIcon contains a list of all of the icons present in an icon
6731  * theme, so that icons can be looked up quickly. #GThemedIcon does
6732  * not provide actual pixmaps for icons, just the icon names.
6733  * Ideally something like gtk_icon_theme_choose_icon() should be used to
6734  * resolve the list of names so that fallback icons work nicely with
6735  * themes that inherit other themes.
6736  */
6737
6738
6739 /**
6740  * SECTION:gthreadedsocketservice
6741  * @title: GThreadedSocketService
6742  * @short_description: A threaded GSocketService
6743  * @see_also: #GSocketService.
6744  *
6745  * A #GThreadedSocketService is a simple subclass of #GSocketService
6746  * that handles incoming connections by creating a worker thread and
6747  * dispatching the connection to it by emitting the
6748  * #GThreadedSocketService::run signal in the new thread.
6749  *
6750  * The signal handler may perform blocking IO and need not return
6751  * until the connection is closed.
6752  *
6753  * The service is implemented using a thread pool, so there is a
6754  * limited amount of threads available to serve incoming requests.
6755  * The service automatically stops the #GSocketService from accepting
6756  * new connections when all threads are busy.
6757  *
6758  * As with #GSocketService, you may connect to #GThreadedSocketService::run,
6759  * or subclass and override the default handler.
6760  */
6761
6762
6763 /**
6764  * SECTION:gtls
6765  * @title: TLS Overview
6766  * @short_description: TLS (aka SSL) support for GSocketConnection
6767  * @include: gio/gio.h
6768  *
6769  * #GTlsConnection and related classes provide TLS (Transport Layer
6770  * Security, previously known as SSL, Secure Sockets Layer) support for
6771  * gio-based network streams.
6772  *
6773  * In the simplest case, for a client connection, you can just set the
6774  * #GSocketClient:tls flag on a #GSocketClient, and then any
6775  * connections created by that client will have TLS negotiated
6776  * automatically, using appropriate default settings, and rejecting
6777  * any invalid or self-signed certificates (unless you change that
6778  * default by setting the #GSocketClient:tls-validation-flags
6779  * property). The returned object will be a #GTcpWrapperConnection,
6780  * which wraps the underlying #GTlsClientConnection.
6781  *
6782  * For greater control, you can create your own #GTlsClientConnection,
6783  * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
6784  * pollable input and output streams) and then connect to its signals,
6785  * such as #GTlsConnection::accept-certificate, before starting the
6786  * handshake.
6787  *
6788  * Server-side TLS is similar, using #GTlsServerConnection. At the
6789  * moment, there is no support for automatically wrapping server-side
6790  * connections in the way #GSocketClient does for client-side
6791  * connections.
6792  */
6793
6794
6795 /**
6796  * SECTION:gtlsbackend
6797  * @title: GTlsBackend
6798  * @short_description: TLS backend implementation
6799  * @include: gio/gio.h
6800  *
6801  *
6802  */
6803
6804
6805 /**
6806  * SECTION:gtlscertificate
6807  * @title: GTlsCertificate
6808  * @short_description: TLS certificate
6809  * @see_also: #GTlsConnection
6810  *
6811  * A certificate used for TLS authentication and encryption.
6812  * This can represent either a certificate only (eg, the certificate
6813  * received by a client from a server), or the combination of
6814  * a certificate and a private key (which is needed when acting as a
6815  * #GTlsServerConnection).
6816  *
6817  * Since: 2.28
6818  */
6819
6820
6821 /**
6822  * SECTION:gtlsclientconnection
6823  * @short_description: TLS client-side connection
6824  * @include: gio/gio.h
6825  *
6826  * #GTlsClientConnection is the client-side subclass of
6827  * #GTlsConnection, representing a client-side TLS connection.
6828  */
6829
6830
6831 /**
6832  * SECTION:gtlsconnection
6833  * @short_description: TLS connection type
6834  * @include: gio/gio.h
6835  *
6836  * #GTlsConnection is the base TLS connection class type, which wraps
6837  * a #GIOStream and provides TLS encryption on top of it. Its
6838  * subclasses, #GTlsClientConnection and #GTlsServerConnection,
6839  * implement client-side and server-side TLS, respectively.
6840  *
6841  * Since: 2.28
6842  */
6843
6844
6845 /**
6846  * SECTION:gtlsdatabase
6847  * @short_description: TLS database type
6848  * @include: gio/gio.h
6849  *
6850  * #GTlsDatabase is used to lookup certificates and other information
6851  * from a certificate or key store. It is an abstract base class which
6852  * TLS library specific subtypes override.
6853  *
6854  * Most common client applications will not directly interact with
6855  * #GTlsDatabase. It is used internally by #GTlsConnection.
6856  *
6857  * Since: 2.30
6858  */
6859
6860
6861 /**
6862  * SECTION:gtlsfiledatabase
6863  * @short_description: TLS file based database type
6864  * @include: gio/gio.h
6865  *
6866  * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
6867  * their certificate information from a file. It is in interface which
6868  * TLS library specific subtypes implement.
6869  *
6870  * Since: 2.30
6871  */
6872
6873
6874 /**
6875  * SECTION:gtlsinteraction
6876  * @short_description: Interaction with the user during TLS operations.
6877  * @include: gio/gio.h
6878  *
6879  * #GTlsInteraction provides a mechanism for the TLS connection and database
6880  * code to interact with the user. It can be used to ask the user for passwords.
6881  *
6882  * To use a #GTlsInteraction with a TLS connection use
6883  * g_tls_connection_set_interaction().
6884  *
6885  * Callers should instantiate a derived class that implements the various
6886  * interaction methods to show the required dialogs.
6887  *
6888  * Callers should use the 'invoke' functions like
6889  * g_tls_interaction_invoke_ask_password() to run interaction methods. These
6890  * functions make sure that the interaction is invoked in the main loop
6891  * and not in the current thread, if the current thread is not running the
6892  * main loop.
6893  *
6894  * Derived classes can choose to implement whichever interactions methods they'd
6895  * like to support by overriding those virtual methods in their class
6896  * initialization function. Any interactions not implemented will return
6897  * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
6898  * it must also implement the corresponding finish method.
6899  */
6900
6901
6902 /**
6903  * SECTION:gtlspassword
6904  * @title: GTlsPassword
6905  * @short_description: TLS Passwords for prompting
6906  * @include: gio/gio.h
6907  *
6908  * Holds a password used in TLS.
6909  */
6910
6911
6912 /**
6913  * SECTION:gtlsserverconnection
6914  * @short_description: TLS server-side connection
6915  * @include: gio/gio.h
6916  *
6917  * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
6918  * representing a server-side TLS connection.
6919  *
6920  * Since: 2.28
6921  */
6922
6923
6924 /**
6925  * SECTION:gunixconnection
6926  * @title: GUnixConnection
6927  * @short_description: A UNIX domain GSocketConnection
6928  * @include: gio/gunixconnection.h
6929  * @see_also: #GSocketConnection.
6930  *
6931  * This is the subclass of #GSocketConnection that is created
6932  * for UNIX domain sockets.
6933  *
6934  * It contains functions to do some of the UNIX socket specific
6935  * functionality like passing file descriptors.
6936  *
6937  * Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
6938  * the UNIX-specific GIO interfaces, thus you have to use the
6939  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6940  *
6941  * Since: 2.22
6942  */
6943
6944
6945 /**
6946  * SECTION:gunixcredentialsmessage
6947  * @title: GUnixCredentialsMessage
6948  * @short_description: A GSocketControlMessage containing credentials
6949  * @include: gio/gunixcredentialsmessage.h
6950  * @see_also: #GUnixConnection, #GSocketControlMessage
6951  *
6952  * This #GSocketControlMessage contains a #GCredentials instance.  It
6953  * may be sent using g_socket_send_message() and received using
6954  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6955  * %G_SOCKET_FAMILY_UNIX family).
6956  *
6957  * For an easier way to send and receive credentials over
6958  * stream-oriented UNIX sockets, see
6959  * g_unix_connection_send_credentials() and
6960  * g_unix_connection_receive_credentials(). To receive credentials of
6961  * a foreign process connected to a socket, use
6962  * g_socket_get_credentials().
6963  */
6964
6965
6966 /**
6967  * SECTION:gunixfdlist
6968  * @title: GUnixFDList
6969  * @short_description: An object containing a set of UNIX file descriptors
6970  * @include: gio/gunixfdlist.h
6971  * @see_also: #GUnixFDMessage
6972  *
6973  * A #GUnixFDList contains a list of file descriptors.  It owns the file
6974  * descriptors that it contains, closing them when finalized.
6975  *
6976  * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
6977  * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
6978  * and received using g_socket_receive_message().
6979  *
6980  * Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
6981  * the UNIX-specific GIO interfaces, thus you have to use the
6982  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6983  */
6984
6985
6986 /**
6987  * SECTION:gunixfdmessage
6988  * @title: GUnixFDMessage
6989  * @short_description: A GSocketControlMessage containing a GUnixFDList
6990  * @include: gio/gunixfdmessage.h
6991  * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
6992  *
6993  * This #GSocketControlMessage contains a #GUnixFDList.
6994  * It may be sent using g_socket_send_message() and received using
6995  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6996  * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
6997  * between processes by the kernel.
6998  *
6999  * For an easier way to send and receive file descriptors over
7000  * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7001  * g_unix_connection_receive_fd().
7002  *
7003  * Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
7004  * the UNIX-specific GIO interfaces, thus you have to use the
7005  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7006  */
7007
7008
7009 /**
7010  * SECTION:gunixinputstream
7011  * @short_description: Streaming input operations for UNIX file descriptors
7012  * @include: gio/gunixinputstream.h
7013  * @see_also: #GInputStream
7014  *
7015  * #GUnixInputStream implements #GInputStream for reading from a UNIX
7016  * file descriptor, including asynchronous operations. (If the file
7017  * descriptor refers to a socket or pipe, this will use poll() to do
7018  * asynchronous I/O. If it refers to a regular file, it will fall back
7019  * to doing asynchronous I/O in another thread.)
7020  *
7021  * Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
7022  * to the UNIX-specific GIO interfaces, thus you have to use the
7023  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7024  */
7025
7026
7027 /**
7028  * SECTION:gunixmounts
7029  * @include: gio/gunixmounts.h
7030  * @short_description: UNIX mounts
7031  *
7032  * Routines for managing mounted UNIX mount points and paths.
7033  *
7034  * Note that <filename>&lt;gio/gunixmounts.h&gt;</filename> belongs to the
7035  * UNIX-specific GIO interfaces, thus you have to use the
7036  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7037  */
7038
7039
7040 /**
7041  * SECTION:gunixoutputstream
7042  * @short_description: Streaming output operations for UNIX file descriptors
7043  * @include: gio/gunixoutputstream.h
7044  * @see_also: #GOutputStream
7045  *
7046  * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7047  * file descriptor, including asynchronous operations. (If the file
7048  * descriptor refers to a socket or pipe, this will use poll() to do
7049  * asynchronous I/O. If it refers to a regular file, it will fall back
7050  * to doing asynchronous I/O in another thread.)
7051  *
7052  * Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
7053  * to the UNIX-specific GIO interfaces, thus you have to use the
7054  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7055  */
7056
7057
7058 /**
7059  * SECTION:gunixsocketaddress
7060  * @short_description: UNIX GSocketAddress
7061  * @include: gio/gunixsocketaddress.h
7062  *
7063  * Support for UNIX-domain (also known as local) sockets.
7064  *
7065  * UNIX domain sockets are generally visible in the filesystem.
7066  * However, some systems support abstract socket names which are not
7067  * visible in the filesystem and not affected by the filesystem
7068  * permissions, visibility, etc. Currently this is only supported
7069  * under Linux. If you attempt to use abstract sockets on other
7070  * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7071  * errors. You can use g_unix_socket_address_abstract_names_supported()
7072  * to see if abstract names are supported.
7073  *
7074  * Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
7075  * the UNIX-specific GIO interfaces, thus you have to use the
7076  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7077  */
7078
7079
7080 /**
7081  * SECTION:gvfs
7082  * @short_description: Virtual File System
7083  * @include: gio/gio.h
7084  *
7085  * Entry point for using GIO functionality.
7086  */
7087
7088
7089 /**
7090  * SECTION:gvolume
7091  * @short_description: Volume management
7092  * @include: gio/gio.h
7093  *
7094  * The #GVolume interface represents user-visible objects that can be
7095  * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7096  * equivalent of #GnomeVFSDrive.
7097  *
7098  * Mounting a #GVolume instance is an asynchronous operation. For more
7099  * information about asynchronous operations, see #GAsyncResult and
7100  * #GSimpleAsyncResult. To mount a #GVolume, first call
7101  * g_volume_mount() with (at least) the #GVolume instance, optionally
7102  * a #GMountOperation object and a #GAsyncReadyCallback.
7103  *
7104  * Typically, one will only want to pass %NULL for the
7105  * #GMountOperation if automounting all volumes when a desktop session
7106  * starts since it's not desirable to put up a lot of dialogs asking
7107  * for credentials.
7108  *
7109  * The callback will be fired when the operation has resolved (either
7110  * with success or failure), and a #GAsyncReady structure will be
7111  * passed to the callback.  That callback should then call
7112  * g_volume_mount_finish() with the #GVolume instance and the
7113  * #GAsyncReady data to see if the operation was completed
7114  * successfully.  If an @error is present when g_volume_mount_finish()
7115  * is called, then it will be filled with any error information.
7116  *
7117  * <para id="volume-identifier">
7118  * It is sometimes necessary to directly access the underlying
7119  * operating system object behind a volume (e.g. for passing a volume
7120  * to an application via the commandline). For this purpose, GIO
7121  * allows to obtain an 'identifier' for the volume. There can be
7122  * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7123  * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7124  * uuids. GIO uses predefind strings as names for the different kinds
7125  * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7126  * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7127  * to obtain an identifier for a volume.
7128  * </para>
7129  *
7130  * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7131  * when the gvfs hal volume monitor is in use. Other volume monitors
7132  * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7133  * identifier, which can be used to obtain a hal device by means of
7134  * libhal_manager_find_device_string_match().
7135  */
7136
7137
7138 /**
7139  * SECTION:gvolumemonitor
7140  * @short_description: Volume Monitor
7141  * @include: gio/gio.h
7142  * @see_also: #GFileMonitor
7143  *
7144  * #GVolumeMonitor is for listing the user interesting devices and volumes
7145  * on the computer. In other words, what a file selector or file manager
7146  * would show in a sidebar.
7147  *
7148  * #GVolumeMonitor is not <link
7149  * linkend="g-main-context-push-thread-default">thread-default-context
7150  * aware</link>, and so should not be used other than from the main
7151  * thread, with no thread-default-context active.
7152  */
7153
7154
7155 /**
7156  * SECTION:gwin32inputstream
7157  * @short_description: Streaming input operations for Windows file handles
7158  * @include: gio/gwin32inputstream.h
7159  * @see_also: #GInputStream
7160  *
7161  * #GWin32InputStream implements #GInputStream for reading from a
7162  * Windows file handle.
7163  *
7164  * Note that <filename>&lt;gio/gwin32inputstream.h&gt;</filename> belongs
7165  * to the Windows-specific GIO interfaces, thus you have to use the
7166  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7167  */
7168
7169
7170 /**
7171  * SECTION:gwin32outputstream
7172  * @short_description: Streaming output operations for Windows file handles
7173  * @include: gio/gwin32outputstream.h
7174  * @see_also: #GOutputStream
7175  *
7176  * #GWin32OutputStream implements #GOutputStream for writing to a
7177  * Windows file handle.
7178  *
7179  * Note that <filename>&lt;gio/gwin32outputstream.h&gt;</filename> belongs
7180  * to the Windows-specific GIO interfaces, thus you have to use the
7181  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7182  */
7183
7184
7185 /**
7186  * SECTION:gzcompressor
7187  * @short_description: Zlib compressor
7188  * @include: gio/gio.h
7189  *
7190  * #GZlibCompressor is an implementation of #GConverter that
7191  * compresses data using zlib.
7192  */
7193
7194
7195 /**
7196  * SECTION:gzdecompressor
7197  * @short_description: Zlib decompressor
7198  * @include: gio/gio.h
7199  *
7200  * #GZlibDecompressor is an implementation of #GConverter that
7201  * decompresses data compressed with zlib.
7202  */
7203
7204
7205 /**
7206  * _GFreedesktopDBus:
7207  *
7208  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7209  */
7210
7211
7212 /**
7213  * _GFreedesktopDBus::handle-add-match:
7214  * @object: A #_GFreedesktopDBus.
7215  * @invocation: A #GDBusMethodInvocation.
7216  * @arg_rule: Argument passed by remote caller.
7217  *
7218  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method.
7219  *
7220  * 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.
7221  *
7222  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7223  */
7224
7225
7226 /**
7227  * _GFreedesktopDBus::handle-get-connection-selinux-security-context:
7228  * @object: A #_GFreedesktopDBus.
7229  * @invocation: A #GDBusMethodInvocation.
7230  * @arg_name: Argument passed by remote caller.
7231  *
7232  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method.
7233  *
7234  * 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.
7235  *
7236  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7237  */
7238
7239
7240 /**
7241  * _GFreedesktopDBus::handle-get-connection-unix-process-id:
7242  * @object: A #_GFreedesktopDBus.
7243  * @invocation: A #GDBusMethodInvocation.
7244  * @arg_name: Argument passed by remote caller.
7245  *
7246  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method.
7247  *
7248  * 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.
7249  *
7250  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7251  */
7252
7253
7254 /**
7255  * _GFreedesktopDBus::handle-get-connection-unix-user:
7256  * @object: A #_GFreedesktopDBus.
7257  * @invocation: A #GDBusMethodInvocation.
7258  * @arg_name: Argument passed by remote caller.
7259  *
7260  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method.
7261  *
7262  * 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.
7263  *
7264  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7265  */
7266
7267
7268 /**
7269  * _GFreedesktopDBus::handle-get-id:
7270  * @object: A #_GFreedesktopDBus.
7271  * @invocation: A #GDBusMethodInvocation.
7272  *
7273  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method.
7274  *
7275  * 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.
7276  *
7277  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7278  */
7279
7280
7281 /**
7282  * _GFreedesktopDBus::handle-get-name-owner:
7283  * @object: A #_GFreedesktopDBus.
7284  * @invocation: A #GDBusMethodInvocation.
7285  * @arg_name: Argument passed by remote caller.
7286  *
7287  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method.
7288  *
7289  * 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.
7290  *
7291  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7292  */
7293
7294
7295 /**
7296  * _GFreedesktopDBus::handle-hello:
7297  * @object: A #_GFreedesktopDBus.
7298  * @invocation: A #GDBusMethodInvocation.
7299  *
7300  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method.
7301  *
7302  * 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.
7303  *
7304  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7305  */
7306
7307
7308 /**
7309  * _GFreedesktopDBus::handle-list-activatable-names:
7310  * @object: A #_GFreedesktopDBus.
7311  * @invocation: A #GDBusMethodInvocation.
7312  *
7313  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method.
7314  *
7315  * 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.
7316  *
7317  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7318  */
7319
7320
7321 /**
7322  * _GFreedesktopDBus::handle-list-names:
7323  * @object: A #_GFreedesktopDBus.
7324  * @invocation: A #GDBusMethodInvocation.
7325  *
7326  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method.
7327  *
7328  * 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.
7329  *
7330  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7331  */
7332
7333
7334 /**
7335  * _GFreedesktopDBus::handle-list-queued-owners:
7336  * @object: A #_GFreedesktopDBus.
7337  * @invocation: A #GDBusMethodInvocation.
7338  * @arg_name: Argument passed by remote caller.
7339  *
7340  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method.
7341  *
7342  * 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.
7343  *
7344  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7345  */
7346
7347
7348 /**
7349  * _GFreedesktopDBus::handle-name-has-owner:
7350  * @object: A #_GFreedesktopDBus.
7351  * @invocation: A #GDBusMethodInvocation.
7352  * @arg_name: Argument passed by remote caller.
7353  *
7354  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method.
7355  *
7356  * 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.
7357  *
7358  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7359  */
7360
7361
7362 /**
7363  * _GFreedesktopDBus::handle-release-name:
7364  * @object: A #_GFreedesktopDBus.
7365  * @invocation: A #GDBusMethodInvocation.
7366  * @arg_name: Argument passed by remote caller.
7367  *
7368  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method.
7369  *
7370  * 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.
7371  *
7372  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7373  */
7374
7375
7376 /**
7377  * _GFreedesktopDBus::handle-reload-config:
7378  * @object: A #_GFreedesktopDBus.
7379  * @invocation: A #GDBusMethodInvocation.
7380  *
7381  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method.
7382  *
7383  * 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.
7384  *
7385  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7386  */
7387
7388
7389 /**
7390  * _GFreedesktopDBus::handle-remove-match:
7391  * @object: A #_GFreedesktopDBus.
7392  * @invocation: A #GDBusMethodInvocation.
7393  * @arg_rule: Argument passed by remote caller.
7394  *
7395  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method.
7396  *
7397  * 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.
7398  *
7399  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7400  */
7401
7402
7403 /**
7404  * _GFreedesktopDBus::handle-request-name:
7405  * @object: A #_GFreedesktopDBus.
7406  * @invocation: A #GDBusMethodInvocation.
7407  * @arg_name: Argument passed by remote caller.
7408  * @arg_flags: Argument passed by remote caller.
7409  *
7410  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method.
7411  *
7412  * 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.
7413  *
7414  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7415  */
7416
7417
7418 /**
7419  * _GFreedesktopDBus::handle-start-service-by-name:
7420  * @object: A #_GFreedesktopDBus.
7421  * @invocation: A #GDBusMethodInvocation.
7422  * @arg_name: Argument passed by remote caller.
7423  * @arg_flags: Argument passed by remote caller.
7424  *
7425  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method.
7426  *
7427  * 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.
7428  *
7429  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7430  */
7431
7432
7433 /**
7434  * _GFreedesktopDBus::handle-update-activation-environment:
7435  * @object: A #_GFreedesktopDBus.
7436  * @invocation: A #GDBusMethodInvocation.
7437  * @arg_environment: Argument passed by remote caller.
7438  *
7439  * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method.
7440  *
7441  * 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.
7442  *
7443  * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7444  */
7445
7446
7447 /**
7448  * _GFreedesktopDBus::name-acquired:
7449  * @object: A #_GFreedesktopDBus.
7450  * @arg_name: Argument.
7451  *
7452  * 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.
7453  *
7454  * 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.
7455  */
7456
7457
7458 /**
7459  * _GFreedesktopDBus::name-lost:
7460  * @object: A #_GFreedesktopDBus.
7461  * @arg_name: Argument.
7462  *
7463  * 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.
7464  *
7465  * 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.
7466  */
7467
7468
7469 /**
7470  * _GFreedesktopDBus::name-owner-changed:
7471  * @object: A #_GFreedesktopDBus.
7472  * @arg_name: Argument.
7473  * @arg_old_owner: Argument.
7474  * @arg_new_owner: Argument.
7475  *
7476  * 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.
7477  *
7478  * 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.
7479  */
7480
7481
7482 /**
7483  * _GFreedesktopDBusIface:
7484  * @parent_iface: The parent interface.
7485  * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal.
7486  * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal.
7487  * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal.
7488  * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal.
7489  * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal.
7490  * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal.
7491  * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal.
7492  * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal.
7493  * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal.
7494  * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal.
7495  * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal.
7496  * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal.
7497  * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal.
7498  * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal.
7499  * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal.
7500  * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal.
7501  * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal.
7502  * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal.
7503  * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal.
7504  * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal.
7505  *
7506  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7507  */
7508
7509
7510 /**
7511  * _GFreedesktopDBusProxy:
7512  *
7513  * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API.
7514  */
7515
7516
7517 /**
7518  * _GFreedesktopDBusProxyClass:
7519  * @parent_class: The parent class.
7520  *
7521  * Class structure for #_GFreedesktopDBusProxy.
7522  */
7523
7524
7525 /**
7526  * _GFreedesktopDBusSkeleton:
7527  *
7528  * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API.
7529  */
7530
7531
7532 /**
7533  * _GFreedesktopDBusSkeletonClass:
7534  * @parent_class: The parent class.
7535  *
7536  * Class structure for #_GFreedesktopDBusSkeleton.
7537  */
7538
7539
7540 /**
7541  * _g_freedesktop_dbus_call_add_match:
7542  * @proxy: A #_GFreedesktopDBusProxy.
7543  * @arg_rule: Argument to pass with the method invocation.
7544  * @cancellable: (allow-none): A #GCancellable or %NULL.
7545  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7546  * @user_data: User data to pass to @callback.
7547  *
7548  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy.
7549  * 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.
7550  * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation.
7551  *
7552  * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method.
7553  */
7554
7555
7556 /**
7557  * _g_freedesktop_dbus_call_add_match_finish:
7558  * @proxy: A #_GFreedesktopDBusProxy.
7559  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match().
7560  * @error: Return location for error or %NULL.
7561  *
7562  * Finishes an operation started with _g_freedesktop_dbus_call_add_match().
7563  *
7564  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7565  */
7566
7567
7568 /**
7569  * _g_freedesktop_dbus_call_add_match_sync:
7570  * @proxy: A #_GFreedesktopDBusProxy.
7571  * @arg_rule: Argument to pass with the method invocation.
7572  * @cancellable: (allow-none): A #GCancellable or %NULL.
7573  * @error: Return location for error or %NULL.
7574  *
7575  * 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.
7576  *
7577  * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method.
7578  *
7579  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7580  */
7581
7582
7583 /**
7584  * _g_freedesktop_dbus_call_get_connection_selinux_security_context:
7585  * @proxy: A #_GFreedesktopDBusProxy.
7586  * @arg_name: Argument to pass with the method invocation.
7587  * @cancellable: (allow-none): A #GCancellable or %NULL.
7588  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7589  * @user_data: User data to pass to @callback.
7590  *
7591  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy.
7592  * 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.
7593  * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation.
7594  *
7595  * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method.
7596  */
7597
7598
7599 /**
7600  * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish:
7601  * @proxy: A #_GFreedesktopDBusProxy.
7602  * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7603  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7604  * @error: Return location for error or %NULL.
7605  *
7606  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7607  *
7608  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7609  */
7610
7611
7612 /**
7613  * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync:
7614  * @proxy: A #_GFreedesktopDBusProxy.
7615  * @arg_name: Argument to pass with the method invocation.
7616  * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7617  * @cancellable: (allow-none): A #GCancellable or %NULL.
7618  * @error: Return location for error or %NULL.
7619  *
7620  * 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.
7621  *
7622  * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method.
7623  *
7624  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7625  */
7626
7627
7628 /**
7629  * _g_freedesktop_dbus_call_get_connection_unix_process_id:
7630  * @proxy: A #_GFreedesktopDBusProxy.
7631  * @arg_name: Argument to pass with the method invocation.
7632  * @cancellable: (allow-none): A #GCancellable or %NULL.
7633  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7634  * @user_data: User data to pass to @callback.
7635  *
7636  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy.
7637  * 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.
7638  * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation.
7639  *
7640  * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method.
7641  */
7642
7643
7644 /**
7645  * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish:
7646  * @proxy: A #_GFreedesktopDBusProxy.
7647  * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7648  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id().
7649  * @error: Return location for error or %NULL.
7650  *
7651  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id().
7652  *
7653  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7654  */
7655
7656
7657 /**
7658  * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync:
7659  * @proxy: A #_GFreedesktopDBusProxy.
7660  * @arg_name: Argument to pass with the method invocation.
7661  * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7662  * @cancellable: (allow-none): A #GCancellable or %NULL.
7663  * @error: Return location for error or %NULL.
7664  *
7665  * 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.
7666  *
7667  * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method.
7668  *
7669  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7670  */
7671
7672
7673 /**
7674  * _g_freedesktop_dbus_call_get_connection_unix_user:
7675  * @proxy: A #_GFreedesktopDBusProxy.
7676  * @arg_name: Argument to pass with the method invocation.
7677  * @cancellable: (allow-none): A #GCancellable or %NULL.
7678  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7679  * @user_data: User data to pass to @callback.
7680  *
7681  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy.
7682  * 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.
7683  * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation.
7684  *
7685  * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method.
7686  */
7687
7688
7689 /**
7690  * _g_freedesktop_dbus_call_get_connection_unix_user_finish:
7691  * @proxy: A #_GFreedesktopDBusProxy.
7692  * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7693  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user().
7694  * @error: Return location for error or %NULL.
7695  *
7696  * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user().
7697  *
7698  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7699  */
7700
7701
7702 /**
7703  * _g_freedesktop_dbus_call_get_connection_unix_user_sync:
7704  * @proxy: A #_GFreedesktopDBusProxy.
7705  * @arg_name: Argument to pass with the method invocation.
7706  * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7707  * @cancellable: (allow-none): A #GCancellable or %NULL.
7708  * @error: Return location for error or %NULL.
7709  *
7710  * 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.
7711  *
7712  * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method.
7713  *
7714  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7715  */
7716
7717
7718 /**
7719  * _g_freedesktop_dbus_call_get_id:
7720  * @proxy: A #_GFreedesktopDBusProxy.
7721  * @cancellable: (allow-none): A #GCancellable or %NULL.
7722  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7723  * @user_data: User data to pass to @callback.
7724  *
7725  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy.
7726  * 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.
7727  * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation.
7728  *
7729  * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method.
7730  */
7731
7732
7733 /**
7734  * _g_freedesktop_dbus_call_get_id_finish:
7735  * @proxy: A #_GFreedesktopDBusProxy.
7736  * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7737  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id().
7738  * @error: Return location for error or %NULL.
7739  *
7740  * Finishes an operation started with _g_freedesktop_dbus_call_get_id().
7741  *
7742  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7743  */
7744
7745
7746 /**
7747  * _g_freedesktop_dbus_call_get_id_sync:
7748  * @proxy: A #_GFreedesktopDBusProxy.
7749  * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7750  * @cancellable: (allow-none): A #GCancellable or %NULL.
7751  * @error: Return location for error or %NULL.
7752  *
7753  * 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.
7754  *
7755  * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method.
7756  *
7757  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7758  */
7759
7760
7761 /**
7762  * _g_freedesktop_dbus_call_get_name_owner:
7763  * @proxy: A #_GFreedesktopDBusProxy.
7764  * @arg_name: Argument to pass with the method invocation.
7765  * @cancellable: (allow-none): A #GCancellable or %NULL.
7766  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7767  * @user_data: User data to pass to @callback.
7768  *
7769  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy.
7770  * 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.
7771  * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation.
7772  *
7773  * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method.
7774  */
7775
7776
7777 /**
7778  * _g_freedesktop_dbus_call_get_name_owner_finish:
7779  * @proxy: A #_GFreedesktopDBusProxy.
7780  * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7781  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner().
7782  * @error: Return location for error or %NULL.
7783  *
7784  * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner().
7785  *
7786  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7787  */
7788
7789
7790 /**
7791  * _g_freedesktop_dbus_call_get_name_owner_sync:
7792  * @proxy: A #_GFreedesktopDBusProxy.
7793  * @arg_name: Argument to pass with the method invocation.
7794  * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7795  * @cancellable: (allow-none): A #GCancellable or %NULL.
7796  * @error: Return location for error or %NULL.
7797  *
7798  * 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.
7799  *
7800  * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method.
7801  *
7802  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7803  */
7804
7805
7806 /**
7807  * _g_freedesktop_dbus_call_hello:
7808  * @proxy: A #_GFreedesktopDBusProxy.
7809  * @cancellable: (allow-none): A #GCancellable or %NULL.
7810  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7811  * @user_data: User data to pass to @callback.
7812  *
7813  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy.
7814  * 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.
7815  * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation.
7816  *
7817  * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method.
7818  */
7819
7820
7821 /**
7822  * _g_freedesktop_dbus_call_hello_finish:
7823  * @proxy: A #_GFreedesktopDBusProxy.
7824  * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7825  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello().
7826  * @error: Return location for error or %NULL.
7827  *
7828  * Finishes an operation started with _g_freedesktop_dbus_call_hello().
7829  *
7830  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7831  */
7832
7833
7834 /**
7835  * _g_freedesktop_dbus_call_hello_sync:
7836  * @proxy: A #_GFreedesktopDBusProxy.
7837  * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7838  * @cancellable: (allow-none): A #GCancellable or %NULL.
7839  * @error: Return location for error or %NULL.
7840  *
7841  * 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.
7842  *
7843  * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method.
7844  *
7845  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7846  */
7847
7848
7849 /**
7850  * _g_freedesktop_dbus_call_list_activatable_names:
7851  * @proxy: A #_GFreedesktopDBusProxy.
7852  * @cancellable: (allow-none): A #GCancellable or %NULL.
7853  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7854  * @user_data: User data to pass to @callback.
7855  *
7856  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy.
7857  * 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.
7858  * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation.
7859  *
7860  * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method.
7861  */
7862
7863
7864 /**
7865  * _g_freedesktop_dbus_call_list_activatable_names_finish:
7866  * @proxy: A #_GFreedesktopDBusProxy.
7867  * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7868  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names().
7869  * @error: Return location for error or %NULL.
7870  *
7871  * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names().
7872  *
7873  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7874  */
7875
7876
7877 /**
7878  * _g_freedesktop_dbus_call_list_activatable_names_sync:
7879  * @proxy: A #_GFreedesktopDBusProxy.
7880  * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7881  * @cancellable: (allow-none): A #GCancellable or %NULL.
7882  * @error: Return location for error or %NULL.
7883  *
7884  * 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.
7885  *
7886  * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method.
7887  *
7888  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7889  */
7890
7891
7892 /**
7893  * _g_freedesktop_dbus_call_list_names:
7894  * @proxy: A #_GFreedesktopDBusProxy.
7895  * @cancellable: (allow-none): A #GCancellable or %NULL.
7896  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7897  * @user_data: User data to pass to @callback.
7898  *
7899  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy.
7900  * 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.
7901  * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation.
7902  *
7903  * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method.
7904  */
7905
7906
7907 /**
7908  * _g_freedesktop_dbus_call_list_names_finish:
7909  * @proxy: A #_GFreedesktopDBusProxy.
7910  * @out_names: (out): Return location for return parameter or %NULL to ignore.
7911  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names().
7912  * @error: Return location for error or %NULL.
7913  *
7914  * Finishes an operation started with _g_freedesktop_dbus_call_list_names().
7915  *
7916  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7917  */
7918
7919
7920 /**
7921  * _g_freedesktop_dbus_call_list_names_sync:
7922  * @proxy: A #_GFreedesktopDBusProxy.
7923  * @out_names: (out): Return location for return parameter or %NULL to ignore.
7924  * @cancellable: (allow-none): A #GCancellable or %NULL.
7925  * @error: Return location for error or %NULL.
7926  *
7927  * 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.
7928  *
7929  * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method.
7930  *
7931  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7932  */
7933
7934
7935 /**
7936  * _g_freedesktop_dbus_call_list_queued_owners:
7937  * @proxy: A #_GFreedesktopDBusProxy.
7938  * @arg_name: Argument to pass with the method invocation.
7939  * @cancellable: (allow-none): A #GCancellable or %NULL.
7940  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7941  * @user_data: User data to pass to @callback.
7942  *
7943  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy.
7944  * 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.
7945  * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation.
7946  *
7947  * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method.
7948  */
7949
7950
7951 /**
7952  * _g_freedesktop_dbus_call_list_queued_owners_finish:
7953  * @proxy: A #_GFreedesktopDBusProxy.
7954  * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7955  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners().
7956  * @error: Return location for error or %NULL.
7957  *
7958  * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners().
7959  *
7960  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7961  */
7962
7963
7964 /**
7965  * _g_freedesktop_dbus_call_list_queued_owners_sync:
7966  * @proxy: A #_GFreedesktopDBusProxy.
7967  * @arg_name: Argument to pass with the method invocation.
7968  * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7969  * @cancellable: (allow-none): A #GCancellable or %NULL.
7970  * @error: Return location for error or %NULL.
7971  *
7972  * 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.
7973  *
7974  * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method.
7975  *
7976  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7977  */
7978
7979
7980 /**
7981  * _g_freedesktop_dbus_call_name_has_owner:
7982  * @proxy: A #_GFreedesktopDBusProxy.
7983  * @arg_name: Argument to pass with the method invocation.
7984  * @cancellable: (allow-none): A #GCancellable or %NULL.
7985  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7986  * @user_data: User data to pass to @callback.
7987  *
7988  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy.
7989  * 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.
7990  * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation.
7991  *
7992  * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method.
7993  */
7994
7995
7996 /**
7997  * _g_freedesktop_dbus_call_name_has_owner_finish:
7998  * @proxy: A #_GFreedesktopDBusProxy.
7999  * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8000  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner().
8001  * @error: Return location for error or %NULL.
8002  *
8003  * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner().
8004  *
8005  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8006  */
8007
8008
8009 /**
8010  * _g_freedesktop_dbus_call_name_has_owner_sync:
8011  * @proxy: A #_GFreedesktopDBusProxy.
8012  * @arg_name: Argument to pass with the method invocation.
8013  * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8014  * @cancellable: (allow-none): A #GCancellable or %NULL.
8015  * @error: Return location for error or %NULL.
8016  *
8017  * 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.
8018  *
8019  * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method.
8020  *
8021  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8022  */
8023
8024
8025 /**
8026  * _g_freedesktop_dbus_call_release_name:
8027  * @proxy: A #_GFreedesktopDBusProxy.
8028  * @arg_name: Argument to pass with the method invocation.
8029  * @cancellable: (allow-none): A #GCancellable or %NULL.
8030  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8031  * @user_data: User data to pass to @callback.
8032  *
8033  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy.
8034  * 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.
8035  * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation.
8036  *
8037  * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method.
8038  */
8039
8040
8041 /**
8042  * _g_freedesktop_dbus_call_release_name_finish:
8043  * @proxy: A #_GFreedesktopDBusProxy.
8044  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8045  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name().
8046  * @error: Return location for error or %NULL.
8047  *
8048  * Finishes an operation started with _g_freedesktop_dbus_call_release_name().
8049  *
8050  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8051  */
8052
8053
8054 /**
8055  * _g_freedesktop_dbus_call_release_name_sync:
8056  * @proxy: A #_GFreedesktopDBusProxy.
8057  * @arg_name: Argument to pass with the method invocation.
8058  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8059  * @cancellable: (allow-none): A #GCancellable or %NULL.
8060  * @error: Return location for error or %NULL.
8061  *
8062  * 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.
8063  *
8064  * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method.
8065  *
8066  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8067  */
8068
8069
8070 /**
8071  * _g_freedesktop_dbus_call_reload_config:
8072  * @proxy: A #_GFreedesktopDBusProxy.
8073  * @cancellable: (allow-none): A #GCancellable or %NULL.
8074  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8075  * @user_data: User data to pass to @callback.
8076  *
8077  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy.
8078  * 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.
8079  * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation.
8080  *
8081  * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method.
8082  */
8083
8084
8085 /**
8086  * _g_freedesktop_dbus_call_reload_config_finish:
8087  * @proxy: A #_GFreedesktopDBusProxy.
8088  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config().
8089  * @error: Return location for error or %NULL.
8090  *
8091  * Finishes an operation started with _g_freedesktop_dbus_call_reload_config().
8092  *
8093  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8094  */
8095
8096
8097 /**
8098  * _g_freedesktop_dbus_call_reload_config_sync:
8099  * @proxy: A #_GFreedesktopDBusProxy.
8100  * @cancellable: (allow-none): A #GCancellable or %NULL.
8101  * @error: Return location for error or %NULL.
8102  *
8103  * 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.
8104  *
8105  * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method.
8106  *
8107  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8108  */
8109
8110
8111 /**
8112  * _g_freedesktop_dbus_call_remove_match:
8113  * @proxy: A #_GFreedesktopDBusProxy.
8114  * @arg_rule: Argument to pass with the method invocation.
8115  * @cancellable: (allow-none): A #GCancellable or %NULL.
8116  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8117  * @user_data: User data to pass to @callback.
8118  *
8119  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy.
8120  * 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.
8121  * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation.
8122  *
8123  * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method.
8124  */
8125
8126
8127 /**
8128  * _g_freedesktop_dbus_call_remove_match_finish:
8129  * @proxy: A #_GFreedesktopDBusProxy.
8130  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match().
8131  * @error: Return location for error or %NULL.
8132  *
8133  * Finishes an operation started with _g_freedesktop_dbus_call_remove_match().
8134  *
8135  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8136  */
8137
8138
8139 /**
8140  * _g_freedesktop_dbus_call_remove_match_sync:
8141  * @proxy: A #_GFreedesktopDBusProxy.
8142  * @arg_rule: Argument to pass with the method invocation.
8143  * @cancellable: (allow-none): A #GCancellable or %NULL.
8144  * @error: Return location for error or %NULL.
8145  *
8146  * 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.
8147  *
8148  * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method.
8149  *
8150  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8151  */
8152
8153
8154 /**
8155  * _g_freedesktop_dbus_call_request_name:
8156  * @proxy: A #_GFreedesktopDBusProxy.
8157  * @arg_name: Argument to pass with the method invocation.
8158  * @arg_flags: Argument to pass with the method invocation.
8159  * @cancellable: (allow-none): A #GCancellable or %NULL.
8160  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8161  * @user_data: User data to pass to @callback.
8162  *
8163  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy.
8164  * 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.
8165  * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation.
8166  *
8167  * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method.
8168  */
8169
8170
8171 /**
8172  * _g_freedesktop_dbus_call_request_name_finish:
8173  * @proxy: A #_GFreedesktopDBusProxy.
8174  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8175  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name().
8176  * @error: Return location for error or %NULL.
8177  *
8178  * Finishes an operation started with _g_freedesktop_dbus_call_request_name().
8179  *
8180  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8181  */
8182
8183
8184 /**
8185  * _g_freedesktop_dbus_call_request_name_sync:
8186  * @proxy: A #_GFreedesktopDBusProxy.
8187  * @arg_name: Argument to pass with the method invocation.
8188  * @arg_flags: Argument to pass with the method invocation.
8189  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8190  * @cancellable: (allow-none): A #GCancellable or %NULL.
8191  * @error: Return location for error or %NULL.
8192  *
8193  * 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.
8194  *
8195  * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method.
8196  *
8197  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8198  */
8199
8200
8201 /**
8202  * _g_freedesktop_dbus_call_start_service_by_name:
8203  * @proxy: A #_GFreedesktopDBusProxy.
8204  * @arg_name: Argument to pass with the method invocation.
8205  * @arg_flags: Argument to pass with the method invocation.
8206  * @cancellable: (allow-none): A #GCancellable or %NULL.
8207  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8208  * @user_data: User data to pass to @callback.
8209  *
8210  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy.
8211  * 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.
8212  * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation.
8213  *
8214  * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method.
8215  */
8216
8217
8218 /**
8219  * _g_freedesktop_dbus_call_start_service_by_name_finish:
8220  * @proxy: A #_GFreedesktopDBusProxy.
8221  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8222  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name().
8223  * @error: Return location for error or %NULL.
8224  *
8225  * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name().
8226  *
8227  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8228  */
8229
8230
8231 /**
8232  * _g_freedesktop_dbus_call_start_service_by_name_sync:
8233  * @proxy: A #_GFreedesktopDBusProxy.
8234  * @arg_name: Argument to pass with the method invocation.
8235  * @arg_flags: Argument to pass with the method invocation.
8236  * @out_value: (out): Return location for return parameter or %NULL to ignore.
8237  * @cancellable: (allow-none): A #GCancellable or %NULL.
8238  * @error: Return location for error or %NULL.
8239  *
8240  * 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.
8241  *
8242  * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method.
8243  *
8244  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8245  */
8246
8247
8248 /**
8249  * _g_freedesktop_dbus_call_update_activation_environment:
8250  * @proxy: A #_GFreedesktopDBusProxy.
8251  * @arg_environment: Argument to pass with the method invocation.
8252  * @cancellable: (allow-none): A #GCancellable or %NULL.
8253  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8254  * @user_data: User data to pass to @callback.
8255  *
8256  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy.
8257  * 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.
8258  * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation.
8259  *
8260  * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method.
8261  */
8262
8263
8264 /**
8265  * _g_freedesktop_dbus_call_update_activation_environment_finish:
8266  * @proxy: A #_GFreedesktopDBusProxy.
8267  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment().
8268  * @error: Return location for error or %NULL.
8269  *
8270  * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment().
8271  *
8272  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8273  */
8274
8275
8276 /**
8277  * _g_freedesktop_dbus_call_update_activation_environment_sync:
8278  * @proxy: A #_GFreedesktopDBusProxy.
8279  * @arg_environment: Argument to pass with the method invocation.
8280  * @cancellable: (allow-none): A #GCancellable or %NULL.
8281  * @error: Return location for error or %NULL.
8282  *
8283  * 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.
8284  *
8285  * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method.
8286  *
8287  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8288  */
8289
8290
8291 /**
8292  * _g_freedesktop_dbus_complete_add_match:
8293  * @object: A #_GFreedesktopDBus.
8294  * @invocation: (transfer full): A #GDBusMethodInvocation.
8295  *
8296  * 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.
8297  *
8298  * This method will free @invocation, you cannot use it afterwards.
8299  */
8300
8301
8302 /**
8303  * _g_freedesktop_dbus_complete_get_connection_selinux_security_context:
8304  * @object: A #_GFreedesktopDBus.
8305  * @invocation: (transfer full): A #GDBusMethodInvocation.
8306  * @security_context: Parameter to return.
8307  *
8308  * 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.
8309  *
8310  * This method will free @invocation, you cannot use it afterwards.
8311  */
8312
8313
8314 /**
8315  * _g_freedesktop_dbus_complete_get_connection_unix_process_id:
8316  * @object: A #_GFreedesktopDBus.
8317  * @invocation: (transfer full): A #GDBusMethodInvocation.
8318  * @pid: Parameter to return.
8319  *
8320  * 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.
8321  *
8322  * This method will free @invocation, you cannot use it afterwards.
8323  */
8324
8325
8326 /**
8327  * _g_freedesktop_dbus_complete_get_connection_unix_user:
8328  * @object: A #_GFreedesktopDBus.
8329  * @invocation: (transfer full): A #GDBusMethodInvocation.
8330  * @uid: Parameter to return.
8331  *
8332  * 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.
8333  *
8334  * This method will free @invocation, you cannot use it afterwards.
8335  */
8336
8337
8338 /**
8339  * _g_freedesktop_dbus_complete_get_id:
8340  * @object: A #_GFreedesktopDBus.
8341  * @invocation: (transfer full): A #GDBusMethodInvocation.
8342  * @unique_id: Parameter to return.
8343  *
8344  * 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.
8345  *
8346  * This method will free @invocation, you cannot use it afterwards.
8347  */
8348
8349
8350 /**
8351  * _g_freedesktop_dbus_complete_get_name_owner:
8352  * @object: A #_GFreedesktopDBus.
8353  * @invocation: (transfer full): A #GDBusMethodInvocation.
8354  * @unique_name: Parameter to return.
8355  *
8356  * 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.
8357  *
8358  * This method will free @invocation, you cannot use it afterwards.
8359  */
8360
8361
8362 /**
8363  * _g_freedesktop_dbus_complete_hello:
8364  * @object: A #_GFreedesktopDBus.
8365  * @invocation: (transfer full): A #GDBusMethodInvocation.
8366  * @assigned_name: Parameter to return.
8367  *
8368  * 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.
8369  *
8370  * This method will free @invocation, you cannot use it afterwards.
8371  */
8372
8373
8374 /**
8375  * _g_freedesktop_dbus_complete_list_activatable_names:
8376  * @object: A #_GFreedesktopDBus.
8377  * @invocation: (transfer full): A #GDBusMethodInvocation.
8378  * @activatable_names: Parameter to return.
8379  *
8380  * 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.
8381  *
8382  * This method will free @invocation, you cannot use it afterwards.
8383  */
8384
8385
8386 /**
8387  * _g_freedesktop_dbus_complete_list_names:
8388  * @object: A #_GFreedesktopDBus.
8389  * @invocation: (transfer full): A #GDBusMethodInvocation.
8390  * @names: Parameter to return.
8391  *
8392  * 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.
8393  *
8394  * This method will free @invocation, you cannot use it afterwards.
8395  */
8396
8397
8398 /**
8399  * _g_freedesktop_dbus_complete_list_queued_owners:
8400  * @object: A #_GFreedesktopDBus.
8401  * @invocation: (transfer full): A #GDBusMethodInvocation.
8402  * @queued_owners: Parameter to return.
8403  *
8404  * 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.
8405  *
8406  * This method will free @invocation, you cannot use it afterwards.
8407  */
8408
8409
8410 /**
8411  * _g_freedesktop_dbus_complete_name_has_owner:
8412  * @object: A #_GFreedesktopDBus.
8413  * @invocation: (transfer full): A #GDBusMethodInvocation.
8414  * @has_owner: Parameter to return.
8415  *
8416  * 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.
8417  *
8418  * This method will free @invocation, you cannot use it afterwards.
8419  */
8420
8421
8422 /**
8423  * _g_freedesktop_dbus_complete_release_name:
8424  * @object: A #_GFreedesktopDBus.
8425  * @invocation: (transfer full): A #GDBusMethodInvocation.
8426  * @value: Parameter to return.
8427  *
8428  * 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.
8429  *
8430  * This method will free @invocation, you cannot use it afterwards.
8431  */
8432
8433
8434 /**
8435  * _g_freedesktop_dbus_complete_reload_config:
8436  * @object: A #_GFreedesktopDBus.
8437  * @invocation: (transfer full): A #GDBusMethodInvocation.
8438  *
8439  * 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.
8440  *
8441  * This method will free @invocation, you cannot use it afterwards.
8442  */
8443
8444
8445 /**
8446  * _g_freedesktop_dbus_complete_remove_match:
8447  * @object: A #_GFreedesktopDBus.
8448  * @invocation: (transfer full): A #GDBusMethodInvocation.
8449  *
8450  * 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.
8451  *
8452  * This method will free @invocation, you cannot use it afterwards.
8453  */
8454
8455
8456 /**
8457  * _g_freedesktop_dbus_complete_request_name:
8458  * @object: A #_GFreedesktopDBus.
8459  * @invocation: (transfer full): A #GDBusMethodInvocation.
8460  * @value: Parameter to return.
8461  *
8462  * 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.
8463  *
8464  * This method will free @invocation, you cannot use it afterwards.
8465  */
8466
8467
8468 /**
8469  * _g_freedesktop_dbus_complete_start_service_by_name:
8470  * @object: A #_GFreedesktopDBus.
8471  * @invocation: (transfer full): A #GDBusMethodInvocation.
8472  * @value: Parameter to return.
8473  *
8474  * 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.
8475  *
8476  * This method will free @invocation, you cannot use it afterwards.
8477  */
8478
8479
8480 /**
8481  * _g_freedesktop_dbus_complete_update_activation_environment:
8482  * @object: A #_GFreedesktopDBus.
8483  * @invocation: (transfer full): A #GDBusMethodInvocation.
8484  *
8485  * 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.
8486  *
8487  * This method will free @invocation, you cannot use it afterwards.
8488  */
8489
8490
8491 /**
8492  * _g_freedesktop_dbus_emit_name_acquired:
8493  * @object: A #_GFreedesktopDBus.
8494  * @arg_name: Argument to pass with the signal.
8495  *
8496  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> D-Bus signal.
8497  */
8498
8499
8500 /**
8501  * _g_freedesktop_dbus_emit_name_lost:
8502  * @object: A #_GFreedesktopDBus.
8503  * @arg_name: Argument to pass with the signal.
8504  *
8505  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> D-Bus signal.
8506  */
8507
8508
8509 /**
8510  * _g_freedesktop_dbus_emit_name_owner_changed:
8511  * @object: A #_GFreedesktopDBus.
8512  * @arg_name: Argument to pass with the signal.
8513  * @arg_old_owner: Argument to pass with the signal.
8514  * @arg_new_owner: Argument to pass with the signal.
8515  *
8516  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> D-Bus signal.
8517  */
8518
8519
8520 /**
8521  * _g_freedesktop_dbus_interface_info:
8522  *
8523  * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface.
8524  *
8525  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
8526  */
8527
8528
8529 /**
8530  * _g_freedesktop_dbus_override_properties:
8531  * @klass: The class structure for a #GObject<!-- -->-derived class.
8532  * @property_id_begin: The property id to assign to the first overridden property.
8533  *
8534  * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class.
8535  * The properties are overridden in the order they are defined.
8536  *
8537  * Returns: The last property id.
8538  */
8539
8540
8541 /**
8542  * _g_freedesktop_dbus_proxy_new:
8543  * @connection: A #GDBusConnection.
8544  * @flags: Flags from the #GDBusProxyFlags enumeration.
8545  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8546  * @object_path: An object path.
8547  * @cancellable: (allow-none): A #GCancellable or %NULL.
8548  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8549  * @user_data: User data to pass to @callback.
8550  *
8551  * 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.
8552  *
8553  * 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.
8554  * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation.
8555  *
8556  * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
8557  */
8558
8559
8560 /**
8561  * _g_freedesktop_dbus_proxy_new_finish:
8562  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new().
8563  * @error: Return location for error or %NULL
8564  *
8565  * Finishes an operation started with _g_freedesktop_dbus_proxy_new().
8566  *
8567  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8568  */
8569
8570
8571 /**
8572  * _g_freedesktop_dbus_proxy_new_for_bus:
8573  * @bus_type: A #GBusType.
8574  * @flags: Flags from the #GDBusProxyFlags enumeration.
8575  * @name: A bus name (well-known or unique).
8576  * @object_path: An object path.
8577  * @cancellable: (allow-none): A #GCancellable or %NULL.
8578  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8579  * @user_data: User data to pass to @callback.
8580  *
8581  * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
8582  *
8583  * 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.
8584  * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation.
8585  *
8586  * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
8587  */
8588
8589
8590 /**
8591  * _g_freedesktop_dbus_proxy_new_for_bus_finish:
8592  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus().
8593  * @error: Return location for error or %NULL
8594  *
8595  * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus().
8596  *
8597  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8598  */
8599
8600
8601 /**
8602  * _g_freedesktop_dbus_proxy_new_for_bus_sync:
8603  * @bus_type: A #GBusType.
8604  * @flags: Flags from the #GDBusProxyFlags enumeration.
8605  * @name: A bus name (well-known or unique).
8606  * @object_path: An object path.
8607  * @cancellable: (allow-none): A #GCancellable or %NULL.
8608  * @error: Return location for error or %NULL
8609  *
8610  * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
8611  *
8612  * The calling thread is blocked until a reply is received.
8613  *
8614  * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
8615  *
8616  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8617  */
8618
8619
8620 /**
8621  * _g_freedesktop_dbus_proxy_new_sync:
8622  * @connection: A #GDBusConnection.
8623  * @flags: Flags from the #GDBusProxyFlags enumeration.
8624  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8625  * @object_path: An object path.
8626  * @cancellable: (allow-none): A #GCancellable or %NULL.
8627  * @error: Return location for error or %NULL
8628  *
8629  * 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.
8630  *
8631  * The calling thread is blocked until a reply is received.
8632  *
8633  * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor.
8634  *
8635  * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8636  */
8637
8638
8639 /**
8640  * _g_freedesktop_dbus_skeleton_new:
8641  *
8642  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
8643  *
8644  * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object.
8645  */
8646
8647
8648 /**
8649  * _g_io_module_get_default:
8650  * @extension_point: the name of an extension point
8651  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8652  * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
8653  *
8654  * Retrieves the default object implementing @extension_point.
8655  *
8656  * If @envvar is not %NULL, and the environment variable with that
8657  * name is set, then the implementation it specifies will be tried
8658  * first. After that, or if @envvar is not set, all other
8659  * implementations will be tried in order of decreasing priority.
8660  *
8661  * If an extension point implementation implements #GInitable, then
8662  * that implementation will only be used if it initializes
8663  * successfully. Otherwise, if @verify_func is not %NULL, then it will
8664  * be called on each candidate implementation after construction, to
8665  * check if it is actually usable or not.
8666  *
8667  * The result is cached after it is generated the first time, and
8668  * the function is thread-safe.
8669  *
8670  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8671  */
8672
8673
8674 /**
8675  * g_action_activate:
8676  * @action: a #GAction
8677  * @parameter: (allow-none): the parameter to the activation
8678  *
8679  * Activates the action.
8680  *
8681  * @parameter must be the correct type of parameter for the action (ie:
8682  * the parameter type given at construction time).  If the parameter
8683  * type was %NULL then @parameter must also be %NULL.
8684  *
8685  * Since: 2.28
8686  */
8687
8688
8689 /**
8690  * g_action_change_state:
8691  * @action: a #GAction
8692  * @value: the new state
8693  *
8694  * Request for the state of @action to be changed to @value.
8695  *
8696  * The action must be stateful and @value must be of the correct type.
8697  * See g_action_get_state_type().
8698  *
8699  * This call merely requests a change.  The action may refuse to change
8700  * its state or may change its state to something other than @value.
8701  * See g_action_get_state_hint().
8702  *
8703  * If the @value GVariant is floating, it is consumed.
8704  *
8705  * Since: 2.30
8706  */
8707
8708
8709 /**
8710  * g_action_get_enabled:
8711  * @action: a #GAction
8712  *
8713  * Checks if @action is currently enabled.
8714  *
8715  * An action must be enabled in order to be activated or in order to
8716  * have its state changed from outside callers.
8717  *
8718  * Returns: whether the action is enabled
8719  * Since: 2.28
8720  */
8721
8722
8723 /**
8724  * g_action_get_name:
8725  * @action: a #GAction
8726  *
8727  * Queries the name of @action.
8728  *
8729  * Returns: the name of the action
8730  * Since: 2.28
8731  */
8732
8733
8734 /**
8735  * g_action_get_parameter_type:
8736  * @action: a #GAction
8737  *
8738  * Queries the type of the parameter that must be given when activating
8739  * @action.
8740  *
8741  * When activating the action using g_action_activate(), the #GVariant
8742  * given to that function must be of the type returned by this function.
8743  *
8744  * In the case that this function returns %NULL, you must not give any
8745  * #GVariant, but %NULL instead.
8746  *
8747  * Returns: (allow-none): the parameter type
8748  * Since: 2.28
8749  */
8750
8751
8752 /**
8753  * g_action_get_state:
8754  * @action: a #GAction
8755  *
8756  * Queries the current state of @action.
8757  *
8758  * If the action is not stateful then %NULL will be returned.  If the
8759  * action is stateful then the type of the return value is the type
8760  * given by g_action_get_state_type().
8761  *
8762  * The return value (if non-%NULL) should be freed with
8763  * g_variant_unref() when it is no longer required.
8764  *
8765  * Returns: (transfer full): the current state of the action
8766  * Since: 2.28
8767  */
8768
8769
8770 /**
8771  * g_action_get_state_hint:
8772  * @action: a #GAction
8773  *
8774  * Requests a hint about the valid range of values for the state of
8775  * @action.
8776  *
8777  * If %NULL is returned it either means that the action is not stateful
8778  * or that there is no hint about the valid range of values for the
8779  * state of the action.
8780  *
8781  * If a #GVariant array is returned then each item in the array is a
8782  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8783  * returned then the tuple specifies the inclusive lower and upper bound
8784  * of valid values for the state.
8785  *
8786  * In any case, the information is merely a hint.  It may be possible to
8787  * have a state value outside of the hinted range and setting a value
8788  * within the range may fail.
8789  *
8790  * The return value (if non-%NULL) should be freed with
8791  * g_variant_unref() when it is no longer required.
8792  *
8793  * Returns: (transfer full): the state range hint
8794  * Since: 2.28
8795  */
8796
8797
8798 /**
8799  * g_action_get_state_type:
8800  * @action: a #GAction
8801  *
8802  * Queries the type of the state of @action.
8803  *
8804  * If the action is stateful (e.g. created with
8805  * g_simple_action_new_stateful()) then this function returns the
8806  * #GVariantType of the state.  This is the type of the initial value
8807  * given as the state. All calls to g_action_change_state() must give a
8808  * #GVariant of this type and g_action_get_state() will return a
8809  * #GVariant of the same type.
8810  *
8811  * If the action is not stateful (e.g. created with g_simple_action_new())
8812  * then this function will return %NULL. In that case, g_action_get_state()
8813  * will return %NULL and you must not call g_action_change_state().
8814  *
8815  * Returns: (allow-none): the state type, if the action is stateful
8816  * Since: 2.28
8817  */
8818
8819
8820 /**
8821  * g_action_group_action_added:
8822  * @action_group: a #GActionGroup
8823  * @action_name: the name of an action in the group
8824  *
8825  * Emits the #GActionGroup::action-added signal on @action_group.
8826  *
8827  * This function should only be called by #GActionGroup implementations.
8828  *
8829  * Since: 2.28
8830  */
8831
8832
8833 /**
8834  * g_action_group_action_enabled_changed:
8835  * @action_group: a #GActionGroup
8836  * @action_name: the name of an action in the group
8837  * @enabled: whether or not the action is now enabled
8838  *
8839  * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8840  *
8841  * This function should only be called by #GActionGroup implementations.
8842  *
8843  * Since: 2.28
8844  */
8845
8846
8847 /**
8848  * g_action_group_action_removed:
8849  * @action_group: a #GActionGroup
8850  * @action_name: the name of an action in the group
8851  *
8852  * Emits the #GActionGroup::action-removed signal on @action_group.
8853  *
8854  * This function should only be called by #GActionGroup implementations.
8855  *
8856  * Since: 2.28
8857  */
8858
8859
8860 /**
8861  * g_action_group_action_state_changed:
8862  * @action_group: a #GActionGroup
8863  * @action_name: the name of an action in the group
8864  * @state: the new state of the named action
8865  *
8866  * Emits the #GActionGroup::action-state-changed signal on @action_group.
8867  *
8868  * This function should only be called by #GActionGroup implementations.
8869  *
8870  * Since: 2.28
8871  */
8872
8873
8874 /**
8875  * g_action_group_activate_action:
8876  * @action_group: a #GActionGroup
8877  * @action_name: the name of the action to activate
8878  * @parameter: (allow-none): parameters to the activation
8879  *
8880  * Activate the named action within @action_group.
8881  *
8882  * If the action is expecting a parameter, then the correct type of
8883  * parameter must be given as @parameter.  If the action is expecting no
8884  * parameters then @parameter must be %NULL.  See
8885  * g_action_group_get_action_parameter_type().
8886  *
8887  * Since: 2.28
8888  */
8889
8890
8891 /**
8892  * g_action_group_change_action_state:
8893  * @action_group: a #GActionGroup
8894  * @action_name: the name of the action to request the change on
8895  * @value: the new state
8896  *
8897  * Request for the state of the named action within @action_group to be
8898  * changed to @value.
8899  *
8900  * The action must be stateful and @value must be of the correct type.
8901  * See g_action_group_get_action_state_type().
8902  *
8903  * This call merely requests a change.  The action may refuse to change
8904  * its state or may change its state to something other than @value.
8905  * See g_action_group_get_action_state_hint().
8906  *
8907  * If the @value GVariant is floating, it is consumed.
8908  *
8909  * Since: 2.28
8910  */
8911
8912
8913 /**
8914  * g_action_group_get_action_enabled:
8915  * @action_group: a #GActionGroup
8916  * @action_name: the name of the action to query
8917  *
8918  * Checks if the named action within @action_group is currently enabled.
8919  *
8920  * An action must be enabled in order to be activated or in order to
8921  * have its state changed from outside callers.
8922  *
8923  * Returns: whether or not the action is currently enabled
8924  * Since: 2.28
8925  */
8926
8927
8928 /**
8929  * g_action_group_get_action_parameter_type:
8930  * @action_group: a #GActionGroup
8931  * @action_name: the name of the action to query
8932  *
8933  * Queries the type of the parameter that must be given when activating
8934  * the named action within @action_group.
8935  *
8936  * When activating the action using g_action_group_activate_action(),
8937  * the #GVariant given to that function must be of the type returned
8938  * by this function.
8939  *
8940  * In the case that this function returns %NULL, you must not give any
8941  * #GVariant, but %NULL instead.
8942  *
8943  * The parameter type of a particular action will never change but it is
8944  * possible for an action to be removed and for a new action to be added
8945  * with the same name but a different parameter type.
8946  *
8947  * Returns: the parameter type
8948  * Since: 2.28
8949  */
8950
8951
8952 /**
8953  * g_action_group_get_action_state:
8954  * @action_group: a #GActionGroup
8955  * @action_name: the name of the action to query
8956  *
8957  * Queries the current state of the named action within @action_group.
8958  *
8959  * If the action is not stateful then %NULL will be returned.  If the
8960  * action is stateful then the type of the return value is the type
8961  * given by g_action_group_get_action_state_type().
8962  *
8963  * The return value (if non-%NULL) should be freed with
8964  * g_variant_unref() when it is no longer required.
8965  *
8966  * Returns: (allow-none): the current state of the action
8967  * Since: 2.28
8968  */
8969
8970
8971 /**
8972  * g_action_group_get_action_state_hint:
8973  * @action_group: a #GActionGroup
8974  * @action_name: the name of the action to query
8975  *
8976  * Requests a hint about the valid range of values for the state of the
8977  * named action within @action_group.
8978  *
8979  * If %NULL is returned it either means that the action is not stateful
8980  * or that there is no hint about the valid range of values for the
8981  * state of the action.
8982  *
8983  * If a #GVariant array is returned then each item in the array is a
8984  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8985  * returned then the tuple specifies the inclusive lower and upper bound
8986  * of valid values for the state.
8987  *
8988  * In any case, the information is merely a hint.  It may be possible to
8989  * have a state value outside of the hinted range and setting a value
8990  * within the range may fail.
8991  *
8992  * The return value (if non-%NULL) should be freed with
8993  * g_variant_unref() when it is no longer required.
8994  *
8995  * Returns: (transfer full): the state range hint
8996  * Since: 2.28
8997  */
8998
8999
9000 /**
9001  * g_action_group_get_action_state_type:
9002  * @action_group: a #GActionGroup
9003  * @action_name: the name of the action to query
9004  *
9005  * Queries the type of the state of the named action within
9006  * @action_group.
9007  *
9008  * If the action is stateful then this function returns the
9009  * #GVariantType of the state.  All calls to
9010  * g_action_group_change_action_state() must give a #GVariant of this
9011  * type and g_action_group_get_action_state() will return a #GVariant
9012  * of the same type.
9013  *
9014  * If the action is not stateful then this function will return %NULL.
9015  * In that case, g_action_group_get_action_state() will return %NULL
9016  * and you must not call g_action_group_change_action_state().
9017  *
9018  * The state type of a particular action will never change but it is
9019  * possible for an action to be removed and for a new action to be added
9020  * with the same name but a different state type.
9021  *
9022  * Returns: (transfer full): the state type, if the action is stateful
9023  * Since: 2.28
9024  */
9025
9026
9027 /**
9028  * g_action_group_has_action:
9029  * @action_group: a #GActionGroup
9030  * @action_name: the name of the action to check for
9031  *
9032  * Checks if the named action exists within @action_group.
9033  *
9034  * Returns: whether the named action exists
9035  * Since: 2.28
9036  */
9037
9038
9039 /**
9040  * g_action_group_list_actions:
9041  * @action_group: a #GActionGroup
9042  *
9043  * Lists the actions contained within @action_group.
9044  *
9045  * The caller is responsible for freeing the list with g_strfreev() when
9046  * it is no longer required.
9047  *
9048  * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
9049  * Since: 2.28
9050  */
9051
9052
9053 /**
9054  * g_action_group_query_action:
9055  * @action_group: a #GActionGroup
9056  * @action_name: the name of an action in the group
9057  * @enabled: (out): if the action is presently enabled
9058  * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
9059  * @state_type: (out) (allow-none): the state type, or %NULL if stateless
9060  * @state_hint: (out) (allow-none): the state hint, or %NULL if none
9061  * @state: (out) (allow-none): the current state, or %NULL if stateless
9062  *
9063  * Queries all aspects of the named action within an @action_group.
9064  *
9065  * This function acquires the information available from
9066  * g_action_group_has_action(), g_action_group_get_action_enabled(),
9067  * g_action_group_get_action_parameter_type(),
9068  * g_action_group_get_action_state_type(),
9069  * g_action_group_get_action_state_hint() and
9070  * g_action_group_get_action_state() with a single function call.
9071  *
9072  * This provides two main benefits.
9073  *
9074  * The first is the improvement in efficiency that comes with not having
9075  * to perform repeated lookups of the action in order to discover
9076  * different things about it.  The second is that implementing
9077  * #GActionGroup can now be done by only overriding this one virtual
9078  * function.
9079  *
9080  * The interface provides a default implementation of this function that
9081  * calls the individual functions, as required, to fetch the
9082  * information.  The interface also provides default implementations of
9083  * those functions that call this function.  All implementations,
9084  * therefore, must override either this function or all of the others.
9085  *
9086  * If the action exists, %TRUE is returned and any of the requested
9087  * fields (as indicated by having a non-%NULL reference passed in) are
9088  * filled.  If the action doesn't exist, %FALSE is returned and the
9089  * fields may or may not have been modified.
9090  *
9091  * Returns: %TRUE if the action exists, else %FALSE
9092  * Since: 2.32
9093  */
9094
9095
9096 /**
9097  * g_action_map_add_action:
9098  * @action_map: a #GActionMap
9099  * @action: a #GAction
9100  *
9101  * Adds an action to the @action_map.
9102  *
9103  * If the action map already contains an action with the same name
9104  * as @action then the old action is dropped from the action map.
9105  *
9106  * The action map takes its own reference on @action.
9107  *
9108  * Since: 2.32
9109  */
9110
9111
9112 /**
9113  * g_action_map_add_action_entries:
9114  * @action_map: a #GActionMap
9115  * @entries: a pointer to the first item in an array of #GActionEntry structs
9116  * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
9117  * @user_data: the user data for signal connections
9118  *
9119  * A convenience function for creating multiple #GSimpleAction instances
9120  * and adding them to a #GActionMap.
9121  *
9122  * Each action is constructed as per one #GActionEntry.
9123  *
9124  * <example>
9125  * <title>Using g_action_map_add_action_entries()</title>
9126  * <programlisting>
9127  * static void
9128  * activate_quit (GSimpleAction *simple,
9129  *                GVariant      *parameter,
9130  *                gpointer       user_data)
9131  * {
9132  *   exit (0);
9133  * }
9134  *
9135  * static void
9136  * activate_print_string (GSimpleAction *simple,
9137  *                        GVariant      *parameter,
9138  *                        gpointer       user_data)
9139  * {
9140  *   g_print ("%s\n", g_variant_get_string (parameter, NULL));
9141  * }
9142  *
9143  * static GActionGroup *
9144  * create_action_group (void)
9145  * {
9146  *   const GActionEntry entries[] = {
9147  *     { "quit",         activate_quit              },
9148  *     { "print-string", activate_print_string, "s" }
9149  *   };
9150  *   GSimpleActionGroup *group;
9151  *
9152  *   group = g_simple_action_group_new ();
9153  *   g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
9154  *
9155  *   return G_ACTION_GROUP (group);
9156  * }
9157  * </programlisting>
9158  * </example>
9159  *
9160  * Since: 2.32
9161  */
9162
9163
9164 /**
9165  * g_action_map_lookup_action:
9166  * @action_map: a #GActionMap
9167  * @action_name: the name of an action
9168  *
9169  * Looks up the action with the name @action_name in @action_map.
9170  *
9171  * If no such action exists, returns %NULL.
9172  *
9173  * Returns: (transfer none): a #GAction, or %NULL
9174  * Since: 2.32
9175  */
9176
9177
9178 /**
9179  * g_action_map_remove_action:
9180  * @action_map: a #GActionMap
9181  * @action_name: the name of the action
9182  *
9183  * Removes the named action from the action map.
9184  *
9185  * If no action of this name is in the map then nothing happens.
9186  *
9187  * Since: 2.32
9188  */
9189
9190
9191 /**
9192  * g_app_info_add_supports_type:
9193  * @appinfo: a #GAppInfo.
9194  * @content_type: a string.
9195  * @error: a #GError.
9196  *
9197  * Adds a content type to the application information to indicate the
9198  * application is capable of opening files with the given content type.
9199  *
9200  * Returns: %TRUE on success, %FALSE on error.
9201  */
9202
9203
9204 /**
9205  * g_app_info_can_delete:
9206  * @appinfo: a #GAppInfo
9207  *
9208  * Obtains the information whether the #GAppInfo can be deleted.
9209  * See g_app_info_delete().
9210  *
9211  * Returns: %TRUE if @appinfo can be deleted
9212  * Since: 2.20
9213  */
9214
9215
9216 /**
9217  * g_app_info_can_remove_supports_type:
9218  * @appinfo: a #GAppInfo.
9219  *
9220  * Checks if a supported content type can be removed from an application.
9221  *
9222  * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
9223  */
9224
9225
9226 /**
9227  * g_app_info_create_from_commandline:
9228  * @commandline: the commandline to use
9229  * @application_name: (allow-none): the application name, or %NULL to use @commandline
9230  * @flags: flags that can specify details of the created #GAppInfo
9231  * @error: a #GError location to store the error occurring, %NULL to ignore.
9232  *
9233  * Creates a new #GAppInfo from the given information.
9234  *
9235  * Note that for @commandline, the quoting rules of the Exec key of the
9236  * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
9237  * Entry Specification</ulink> are applied. For example, if the @commandline contains
9238  * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
9239  * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
9240  *
9241  * Returns: (transfer full): new #GAppInfo for given command.
9242  */
9243
9244
9245 /**
9246  * g_app_info_delete:
9247  * @appinfo: a #GAppInfo
9248  *
9249  * Tries to delete a #GAppInfo.
9250  *
9251  * On some platforms, there may be a difference between user-defined
9252  * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
9253  * cannot. See g_app_info_can_delete().
9254  *
9255  * Virtual: do_delete
9256  * Returns: %TRUE if @appinfo has been deleted
9257  * Since: 2.20
9258  */
9259
9260
9261 /**
9262  * g_app_info_dup:
9263  * @appinfo: a #GAppInfo.
9264  *
9265  * Creates a duplicate of a #GAppInfo.
9266  *
9267  * Returns: (transfer full): a duplicate of @appinfo.
9268  */
9269
9270
9271 /**
9272  * g_app_info_equal:
9273  * @appinfo1: the first #GAppInfo.
9274  * @appinfo2: the second #GAppInfo.
9275  *
9276  * Checks if two #GAppInfo<!-- -->s are equal.
9277  *
9278  * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
9279  */
9280
9281
9282 /**
9283  * g_app_info_get_all:
9284  *
9285  * Gets a list of all of the applications currently registered
9286  * on this system.
9287  *
9288  * For desktop files, this includes applications that have
9289  * <literal>NoDisplay=true</literal> set or are excluded from
9290  * display by means of <literal>OnlyShowIn</literal> or
9291  * <literal>NotShowIn</literal>. See g_app_info_should_show().
9292  * The returned list does not include applications which have
9293  * the <literal>Hidden</literal> key set.
9294  *
9295  * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
9296  */
9297
9298
9299 /**
9300  * g_app_info_get_all_for_type:
9301  * @content_type: the content type to find a #GAppInfo for
9302  *
9303  * Gets a list of all #GAppInfos for a given content type,
9304  * including the recommended and fallback #GAppInfos. See
9305  * g_app_info_get_recommended_for_type() and
9306  * g_app_info_get_fallback_for_type().
9307  *
9308  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9309  */
9310
9311
9312 /**
9313  * g_app_info_get_commandline:
9314  * @appinfo: a #GAppInfo
9315  *
9316  * Gets the commandline with which the application will be
9317  * started.
9318  *
9319  * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
9320  * Since: 2.20
9321  */
9322
9323
9324 /**
9325  * g_app_info_get_default_for_type:
9326  * @content_type: the content type to find a #GAppInfo for
9327  * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
9328  *
9329  * Gets the default #GAppInfo for a given content type.
9330  *
9331  * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
9332  */
9333
9334
9335 /**
9336  * g_app_info_get_default_for_uri_scheme:
9337  * @uri_scheme: a string containing a URI scheme.
9338  *
9339  * Gets the default application for handling URIs with
9340  * the given URI scheme. A URI scheme is the initial part
9341  * of the URI, up to but not including the ':', e.g. "http",
9342  * "ftp" or "sip".
9343  *
9344  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
9345  */
9346
9347
9348 /**
9349  * g_app_info_get_description:
9350  * @appinfo: a #GAppInfo.
9351  *
9352  * Gets a human-readable description of an installed application.
9353  *
9354  * Returns: a string containing a description of the application @appinfo, or %NULL if none.
9355  */
9356
9357
9358 /**
9359  * g_app_info_get_display_name:
9360  * @appinfo: a #GAppInfo.
9361  *
9362  * Gets the display name of the application. The display name is often more
9363  * descriptive to the user than the name itself.
9364  *
9365  * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9366  * Since: 2.24
9367  */
9368
9369
9370 /**
9371  * g_app_info_get_executable:
9372  * @appinfo: a #GAppInfo
9373  *
9374  * Gets the executable's name for the installed application.
9375  *
9376  * Returns: a string containing the @appinfo's application binaries name
9377  */
9378
9379
9380 /**
9381  * g_app_info_get_fallback_for_type:
9382  * @content_type: the content type to find a #GAppInfo for
9383  *
9384  * Gets a list of fallback #GAppInfos for a given content type, i.e.
9385  * those applications which claim to support the given content type
9386  * by MIME type subclassing and not directly.
9387  *
9388  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9389  * Since: 2.28
9390  */
9391
9392
9393 /**
9394  * g_app_info_get_icon:
9395  * @appinfo: a #GAppInfo.
9396  *
9397  * Gets the icon for the application.
9398  *
9399  * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9400  */
9401
9402
9403 /**
9404  * g_app_info_get_id:
9405  * @appinfo: a #GAppInfo.
9406  *
9407  * Gets the ID of an application. An id is a string that
9408  * identifies the application. The exact format of the id is
9409  * platform dependent. For instance, on Unix this is the
9410  * desktop file id from the xdg menu specification.
9411  *
9412  * Note that the returned ID may be %NULL, depending on how
9413  * the @appinfo has been constructed.
9414  *
9415  * Returns: a string containing the application's ID.
9416  */
9417
9418
9419 /**
9420  * g_app_info_get_name:
9421  * @appinfo: a #GAppInfo.
9422  *
9423  * Gets the installed name of the application.
9424  *
9425  * Returns: the name of the application for @appinfo.
9426  */
9427
9428
9429 /**
9430  * g_app_info_get_recommended_for_type:
9431  * @content_type: the content type to find a #GAppInfo for
9432  *
9433  * Gets a list of recommended #GAppInfos for a given content type, i.e.
9434  * those applications which claim to support the given content type exactly,
9435  * and not by MIME type subclassing.
9436  * Note that the first application of the list is the last used one, i.e.
9437  * the last one for which g_app_info_set_as_last_used_for_type() has been
9438  * called.
9439  *
9440  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9441  * Since: 2.28
9442  */
9443
9444
9445 /**
9446  * g_app_info_get_supported_types:
9447  * @appinfo: a #GAppInfo that can handle files
9448  *
9449  * Retrieves the list of content types that @app_info claims to support.
9450  * If this information is not provided by the environment, this function
9451  * will return %NULL.
9452  * This function does not take in consideration associations added with
9453  * g_app_info_add_supports_type(), but only those exported directly by
9454  * the application.
9455  *
9456  * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
9457  * Since: 2.34
9458  */
9459
9460
9461 /**
9462  * g_app_info_launch:
9463  * @appinfo: a #GAppInfo
9464  * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
9465  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9466  * @error: a #GError
9467  *
9468  * Launches the application. Passes @files to the launched application
9469  * as arguments, using the optional @launch_context to get information
9470  * about the details of the launcher (like what screen it is on).
9471  * On error, @error will be set accordingly.
9472  *
9473  * To launch the application without arguments pass a %NULL @files list.
9474  *
9475  * Note that even if the launch is successful the application launched
9476  * can fail to start if it runs into problems during startup. There is
9477  * no way to detect this.
9478  *
9479  * Some URIs can be changed when passed through a GFile (for instance
9480  * unsupported URIs with strange formats like mailto:), so if you have
9481  * a textual URI you want to pass in as argument, consider using
9482  * g_app_info_launch_uris() instead.
9483  *
9484  * The launched application inherits the environment of the launching
9485  * process, but it can be modified with g_app_launch_context_setenv() and
9486  * g_app_launch_context_unsetenv().
9487  *
9488  * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
9489  * environment variable with the path of the launched desktop file and
9490  * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
9491  * id of the launched process. This can be used to ignore
9492  * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
9493  * by further processes. The <envar>DISPLAY</envar> and
9494  * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
9495  * set, based on information provided in @launch_context.
9496  *
9497  * Returns: %TRUE on successful launch, %FALSE otherwise.
9498  */
9499
9500
9501 /**
9502  * g_app_info_launch_default_for_uri:
9503  * @uri: the uri to show
9504  * @launch_context: (allow-none): an optional #GAppLaunchContext.
9505  * @error: a #GError.
9506  *
9507  * Utility function that launches the default application
9508  * registered to handle the specified uri. Synchronous I/O
9509  * is done on the uri to detect the type of the file if
9510  * required.
9511  *
9512  * Returns: %TRUE on success, %FALSE on error.
9513  */
9514
9515
9516 /**
9517  * g_app_info_launch_uris:
9518  * @appinfo: a #GAppInfo
9519  * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
9520  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9521  * @error: a #GError
9522  *
9523  * Launches the application. This passes the @uris to the launched application
9524  * as arguments, using the optional @launch_context to get information
9525  * about the details of the launcher (like what screen it is on).
9526  * On error, @error will be set accordingly.
9527  *
9528  * To launch the application without arguments pass a %NULL @uris list.
9529  *
9530  * Note that even if the launch is successful the application launched
9531  * can fail to start if it runs into problems during startup. There is
9532  * no way to detect this.
9533  *
9534  * Returns: %TRUE on successful launch, %FALSE otherwise.
9535  */
9536
9537
9538 /**
9539  * g_app_info_remove_supports_type:
9540  * @appinfo: a #GAppInfo.
9541  * @content_type: a string.
9542  * @error: a #GError.
9543  *
9544  * Removes a supported type from an application, if possible.
9545  *
9546  * Returns: %TRUE on success, %FALSE on error.
9547  */
9548
9549
9550 /**
9551  * g_app_info_reset_type_associations:
9552  * @content_type: a content type
9553  *
9554  * Removes all changes to the type associations done by
9555  * g_app_info_set_as_default_for_type(),
9556  * g_app_info_set_as_default_for_extension(),
9557  * g_app_info_add_supports_type() or
9558  * g_app_info_remove_supports_type().
9559  *
9560  * Since: 2.20
9561  */
9562
9563
9564 /**
9565  * g_app_info_set_as_default_for_extension:
9566  * @appinfo: a #GAppInfo.
9567  * @extension: a string containing the file extension (without the dot).
9568  * @error: a #GError.
9569  *
9570  * Sets the application as the default handler for the given file extension.
9571  *
9572  * Returns: %TRUE on success, %FALSE on error.
9573  */
9574
9575
9576 /**
9577  * g_app_info_set_as_default_for_type:
9578  * @appinfo: a #GAppInfo.
9579  * @content_type: the content type.
9580  * @error: a #GError.
9581  *
9582  * Sets the application as the default handler for a given type.
9583  *
9584  * Returns: %TRUE on success, %FALSE on error.
9585  */
9586
9587
9588 /**
9589  * g_app_info_set_as_last_used_for_type:
9590  * @appinfo: a #GAppInfo.
9591  * @content_type: the content type.
9592  * @error: a #GError.
9593  *
9594  * Sets the application as the last used application for a given type.
9595  * This will make the application appear as first in the list returned
9596  * by g_app_info_get_recommended_for_type(), regardless of the default
9597  * application for that content type.
9598  *
9599  * Returns: %TRUE on success, %FALSE on error.
9600  */
9601
9602
9603 /**
9604  * g_app_info_should_show:
9605  * @appinfo: a #GAppInfo.
9606  *
9607  * Checks if the application info should be shown in menus that
9608  * list available applications.
9609  *
9610  * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
9611  */
9612
9613
9614 /**
9615  * g_app_info_supports_files:
9616  * @appinfo: a #GAppInfo.
9617  *
9618  * Checks if the application accepts files as arguments.
9619  *
9620  * Returns: %TRUE if the @appinfo supports files.
9621  */
9622
9623
9624 /**
9625  * g_app_info_supports_uris:
9626  * @appinfo: a #GAppInfo.
9627  *
9628  * Checks if the application supports reading files and directories from URIs.
9629  *
9630  * Returns: %TRUE if the @appinfo supports URIs.
9631  */
9632
9633
9634 /**
9635  * g_app_launch_context_get_display:
9636  * @context: a #GAppLaunchContext
9637  * @info: a #GAppInfo
9638  * @files: (element-type GFile): a #GList of #GFile objects
9639  *
9640  * Gets the display string for the @context. This is used to ensure new
9641  * applications are started on the same display as the launching
9642  * application, by setting the <envar>DISPLAY</envar> environment variable.
9643  *
9644  * Returns: a display string for the display.
9645  */
9646
9647
9648 /**
9649  * g_app_launch_context_get_environment:
9650  * @context: a #GAppLaunchContext
9651  *
9652  * Gets the complete environment variable list to be passed to
9653  * the child process when @context is used to launch an application.
9654  * This is a %NULL-terminated array of strings, where each string has
9655  * the form <literal>KEY=VALUE</literal>.
9656  *
9657  * Returns: (array zero-terminated=1) (transfer full): the child's environment
9658  * Since: 2.32
9659  */
9660
9661
9662 /**
9663  * g_app_launch_context_get_startup_notify_id:
9664  * @context: a #GAppLaunchContext
9665  * @info: a #GAppInfo
9666  * @files: (element-type GFile): a #GList of of #GFile objects
9667  *
9668  * Initiates startup notification for the application and returns the
9669  * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
9670  * if supported.
9671  *
9672  * Startup notification IDs are defined in the <ulink
9673  * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
9674  * FreeDesktop.Org Startup Notifications standard</ulink>.
9675  *
9676  * Returns: a startup notification ID for the application, or %NULL if not supported.
9677  */
9678
9679
9680 /**
9681  * g_app_launch_context_launch_failed:
9682  * @context: a #GAppLaunchContext.
9683  * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
9684  *
9685  * Called when an application has failed to launch, so that it can cancel
9686  * the application startup notification started in g_app_launch_context_get_startup_notify_id().
9687  */
9688
9689
9690 /**
9691  * g_app_launch_context_new:
9692  *
9693  * Creates a new application launch context. This is not normally used,
9694  * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
9695  *
9696  * Returns: a #GAppLaunchContext.
9697  */
9698
9699
9700 /**
9701  * g_app_launch_context_setenv:
9702  * @context: a #GAppLaunchContext
9703  * @variable: the environment variable to set
9704  * @value: the value for to set the variable to.
9705  *
9706  * Arranges for @variable to be set to @value in the child's
9707  * environment when @context is used to launch an application.
9708  *
9709  * Since: 2.32
9710  */
9711
9712
9713 /**
9714  * g_app_launch_context_unsetenv:
9715  * @context: a #GAppLaunchContext
9716  * @variable: the environment variable to remove
9717  *
9718  * Arranges for @variable to be unset in the child's environment
9719  * when @context is used to launch an application.
9720  *
9721  * Since: 2.32
9722  */
9723
9724
9725 /**
9726  * g_application_activate:
9727  * @application: a #GApplication
9728  *
9729  * Activates the application.
9730  *
9731  * In essence, this results in the #GApplication::activate signal being
9732  * emitted in the primary instance.
9733  *
9734  * The application must be registered before calling this function.
9735  *
9736  * Since: 2.28
9737  */
9738
9739
9740 /**
9741  * g_application_command_line_get_arguments:
9742  * @cmdline: a #GApplicationCommandLine
9743  * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9744  *
9745  * Gets the list of arguments that was passed on the command line.
9746  *
9747  * The strings in the array may contain non-utf8 data.
9748  *
9749  * The return value is %NULL-terminated and should be freed using
9750  * g_strfreev().
9751  *
9752  * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9753  * Since: 2.28
9754  */
9755
9756
9757 /**
9758  * g_application_command_line_get_cwd:
9759  * @cmdline: a #GApplicationCommandLine
9760  *
9761  * Gets the working directory of the command line invocation.
9762  * The string may contain non-utf8 data.
9763  *
9764  * It is possible that the remote application did not send a working
9765  * directory, so this may be %NULL.
9766  *
9767  * The return value should not be modified or freed and is valid for as
9768  * long as @cmdline exists.
9769  *
9770  * Returns: the current directory, or %NULL
9771  * Since: 2.28
9772  */
9773
9774
9775 /**
9776  * g_application_command_line_get_environ:
9777  * @cmdline: a #GApplicationCommandLine
9778  *
9779  * Gets the contents of the 'environ' variable of the command line
9780  * invocation, as would be returned by g_get_environ(), ie as a
9781  * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9782  * The strings may contain non-utf8 data.
9783  *
9784  * The remote application usually does not send an environment.  Use
9785  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9786  * set it is possible that the environment is still not available (due
9787  * to invocation messages from other applications).
9788  *
9789  * The return value should not be modified or freed and is valid for as
9790  * long as @cmdline exists.
9791  *
9792  * See g_application_command_line_getenv() if you are only interested
9793  * in the value of a single environment variable.
9794  *
9795  * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9796  * Since: 2.28
9797  */
9798
9799
9800 /**
9801  * g_application_command_line_get_exit_status:
9802  * @cmdline: a #GApplicationCommandLine
9803  *
9804  * Gets the exit status of @cmdline.  See
9805  * g_application_command_line_set_exit_status() for more information.
9806  *
9807  * Returns: the exit status
9808  * Since: 2.28
9809  */
9810
9811
9812 /**
9813  * g_application_command_line_get_is_remote:
9814  * @cmdline: a #GApplicationCommandLine
9815  *
9816  * Determines if @cmdline represents a remote invocation.
9817  *
9818  * Returns: %TRUE if the invocation was remote
9819  * Since: 2.28
9820  */
9821
9822
9823 /**
9824  * g_application_command_line_get_platform_data:
9825  * @cmdline: #GApplicationCommandLine
9826  *
9827  * Gets the platform data associated with the invocation of @cmdline.
9828  *
9829  * This is a #GVariant dictionary containing information about the
9830  * context in which the invocation occurred.  It typically contains
9831  * information like the current working directory and the startup
9832  * notification ID.
9833  *
9834  * For local invocation, it will be %NULL.
9835  *
9836  * Returns: (allow-none): the platform data, or %NULL
9837  * Since: 2.28
9838  */
9839
9840
9841 /**
9842  * g_application_command_line_getenv:
9843  * @cmdline: a #GApplicationCommandLine
9844  * @name: the environment variable to get
9845  *
9846  * Gets the value of a particular environment variable of the command
9847  * line invocation, as would be returned by g_getenv().  The strings may
9848  * contain non-utf8 data.
9849  *
9850  * The remote application usually does not send an environment.  Use
9851  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9852  * set it is possible that the environment is still not available (due
9853  * to invocation messages from other applications).
9854  *
9855  * The return value should not be modified or freed and is valid for as
9856  * long as @cmdline exists.
9857  *
9858  * Returns: the value of the variable, or %NULL if unset or unsent
9859  * Since: 2.28
9860  */
9861
9862
9863 /**
9864  * g_application_command_line_print:
9865  * @cmdline: a #GApplicationCommandLine
9866  * @format: a printf-style format string
9867  * @...: arguments, as per @format
9868  *
9869  * Formats a message and prints it using the stdout print handler in the
9870  * invoking process.
9871  *
9872  * If @cmdline is a local invocation then this is exactly equivalent to
9873  * g_print().  If @cmdline is remote then this is equivalent to calling
9874  * g_print() in the invoking process.
9875  *
9876  * Since: 2.28
9877  */
9878
9879
9880 /**
9881  * g_application_command_line_printerr:
9882  * @cmdline: a #GApplicationCommandLine
9883  * @format: a printf-style format string
9884  * @...: arguments, as per @format
9885  *
9886  * Formats a message and prints it using the stderr print handler in the
9887  * invoking process.
9888  *
9889  * If @cmdline is a local invocation then this is exactly equivalent to
9890  * g_printerr().  If @cmdline is remote then this is equivalent to
9891  * calling g_printerr() in the invoking process.
9892  *
9893  * Since: 2.28
9894  */
9895
9896
9897 /**
9898  * g_application_command_line_set_exit_status:
9899  * @cmdline: a #GApplicationCommandLine
9900  * @exit_status: the exit status
9901  *
9902  * Sets the exit status that will be used when the invoking process
9903  * exits.
9904  *
9905  * The return value of the #GApplication::command-line signal is
9906  * passed to this function when the handler returns.  This is the usual
9907  * way of setting the exit status.
9908  *
9909  * In the event that you want the remote invocation to continue running
9910  * and want to decide on the exit status in the future, you can use this
9911  * call.  For the case of a remote invocation, the remote process will
9912  * typically exit when the last reference is dropped on @cmdline.  The
9913  * exit status of the remote process will be equal to the last value
9914  * that was set with this function.
9915  *
9916  * In the case that the commandline invocation is local, the situation
9917  * is slightly more complicated.  If the commandline invocation results
9918  * in the mainloop running (ie: because the use-count of the application
9919  * increased to a non-zero value) then the application is considered to
9920  * have been 'successful' in a certain sense, and the exit status is
9921  * always zero.  If the application use count is zero, though, the exit
9922  * status of the local #GApplicationCommandLine is used.
9923  *
9924  * Since: 2.28
9925  */
9926
9927
9928 /**
9929  * g_application_get_application_id:
9930  * @application: a #GApplication
9931  *
9932  * Gets the unique identifier for @application.
9933  *
9934  * Returns: the identifier for @application, owned by @application
9935  * Since: 2.28
9936  */
9937
9938
9939 /**
9940  * g_application_get_dbus_connection:
9941  * @application: a #GApplication
9942  *
9943  * Gets the #GDBusConnection being used by the application, or %NULL.
9944  *
9945  * If #GApplication is using its D-Bus backend then this function will
9946  * return the #GDBusConnection being used for uniqueness and
9947  * communication with the desktop environment and other instances of the
9948  * application.
9949  *
9950  * If #GApplication is not using D-Bus then this function will return
9951  * %NULL.  This includes the situation where the D-Bus backend would
9952  * normally be in use but we were unable to connect to the bus.
9953  *
9954  * This function must not be called before the application has been
9955  * registered.  See g_application_get_is_registered().
9956  *
9957  * Returns: (transfer none): a #GDBusConnection, or %NULL
9958  * Since: 2.34
9959  */
9960
9961
9962 /**
9963  * g_application_get_dbus_object_path:
9964  * @application: a #GApplication
9965  *
9966  * Gets the D-Bus object path being used by the application, or %NULL.
9967  *
9968  * If #GApplication is using its D-Bus backend then this function will
9969  * return the D-Bus object path that #GApplication is using.  If the
9970  * application is the primary instance then there is an object published
9971  * at this path.  If the application is not the primary instance then
9972  * the result of this function is undefined.
9973  *
9974  * If #GApplication is not using D-Bus then this function will return
9975  * %NULL.  This includes the situation where the D-Bus backend would
9976  * normally be in use but we were unable to connect to the bus.
9977  *
9978  * This function must not be called before the application has been
9979  * registered.  See g_application_get_is_registered().
9980  *
9981  * Returns: the object path, or %NULL
9982  * Since: 2.34
9983  */
9984
9985
9986 /**
9987  * g_application_get_default:
9988  *
9989  * Returns the default #GApplication instance for this process.
9990  *
9991  * Normally there is only one #GApplication per process and it becomes
9992  * the default when it is created.  You can exercise more control over
9993  * this by using g_application_set_default().
9994  *
9995  * If there is no default application then %NULL is returned.
9996  *
9997  * Returns: (transfer none): the default application for this process, or %NULL
9998  * Since: 2.32
9999  */
10000
10001
10002 /**
10003  * g_application_get_flags:
10004  * @application: a #GApplication
10005  *
10006  * Gets the flags for @application.
10007  *
10008  * See #GApplicationFlags.
10009  *
10010  * Returns: the flags for @application
10011  * Since: 2.28
10012  */
10013
10014
10015 /**
10016  * g_application_get_inactivity_timeout:
10017  * @application: a #GApplication
10018  *
10019  * Gets the current inactivity timeout for the application.
10020  *
10021  * This is the amount of time (in milliseconds) after the last call to
10022  * g_application_release() before the application stops running.
10023  *
10024  * Returns: the timeout, in milliseconds
10025  * Since: 2.28
10026  */
10027
10028
10029 /**
10030  * g_application_get_is_registered:
10031  * @application: a #GApplication
10032  *
10033  * Checks if @application is registered.
10034  *
10035  * An application is registered if g_application_register() has been
10036  * successfully called.
10037  *
10038  * Returns: %TRUE if @application is registered
10039  * Since: 2.28
10040  */
10041
10042
10043 /**
10044  * g_application_get_is_remote:
10045  * @application: a #GApplication
10046  *
10047  * Checks if @application is remote.
10048  *
10049  * If @application is remote then it means that another instance of
10050  * application already exists (the 'primary' instance).  Calls to
10051  * perform actions on @application will result in the actions being
10052  * performed by the primary instance.
10053  *
10054  * The value of this property cannot be accessed before
10055  * g_application_register() has been called.  See
10056  * g_application_get_is_registered().
10057  *
10058  * Returns: %TRUE if @application is remote
10059  * Since: 2.28
10060  */
10061
10062
10063 /**
10064  * g_application_hold:
10065  * @application: a #GApplication
10066  *
10067  * Increases the use count of @application.
10068  *
10069  * Use this function to indicate that the application has a reason to
10070  * continue to run.  For example, g_application_hold() is called by GTK+
10071  * when a toplevel window is on the screen.
10072  *
10073  * To cancel the hold, call g_application_release().
10074  */
10075
10076
10077 /**
10078  * g_application_id_is_valid:
10079  * @application_id: a potential application identifier
10080  *
10081  * Checks if @application_id is a valid application identifier.
10082  *
10083  * A valid ID is required for calls to g_application_new() and
10084  * g_application_set_application_id().
10085  *
10086  * For convenience, the restrictions on application identifiers are
10087  * reproduced here:
10088  * <itemizedlist>
10089  *   <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
10090  *   <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
10091  *   <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
10092  *   <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
10093  *   <listitem>Application identifiers must not exceed 255 characters.</listitem>
10094  * </itemizedlist>
10095  *
10096  * Returns: %TRUE if @application_id is valid
10097  */
10098
10099
10100 /**
10101  * g_application_new:
10102  * @application_id: (allow-none): the application id
10103  * @flags: the application flags
10104  *
10105  * Creates a new #GApplication instance.
10106  *
10107  * This function calls g_type_init() for you.
10108  *
10109  * If non-%NULL, the application id must be valid.  See
10110  * g_application_id_is_valid().
10111  *
10112  * If no application ID is given then some features of #GApplication
10113  * (most notably application uniqueness) will be disabled.
10114  *
10115  * Returns: a new #GApplication instance
10116  */
10117
10118
10119 /**
10120  * g_application_open:
10121  * @application: a #GApplication
10122  * @files: (array length=n_files): an array of #GFiles to open
10123  * @n_files: the length of the @files array
10124  * @hint: a hint (or ""), but never %NULL
10125  *
10126  * Opens the given files.
10127  *
10128  * In essence, this results in the #GApplication::open signal being emitted
10129  * in the primary instance.
10130  *
10131  * @n_files must be greater than zero.
10132  *
10133  * @hint is simply passed through to the ::open signal.  It is
10134  * intended to be used by applications that have multiple modes for
10135  * opening files (eg: "view" vs "edit", etc).  Unless you have a need
10136  * for this functionality, you should use "".
10137  *
10138  * The application must be registered before calling this function
10139  * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
10140  *
10141  * Since: 2.28
10142  */
10143
10144
10145 /**
10146  * g_application_quit:
10147  * @application: a #GApplication
10148  *
10149  * Immediately quits the application.
10150  *
10151  * Upon return to the mainloop, g_application_run() will return,
10152  * calling only the 'shutdown' function before doing so.
10153  *
10154  * The hold count is ignored.
10155  *
10156  * The result of calling g_application_run() again after it returns is
10157  * unspecified.
10158  *
10159  * Since: 2.32
10160  */
10161
10162
10163 /**
10164  * g_application_register:
10165  * @application: a #GApplication
10166  * @cancellable: (allow-none): a #GCancellable, or %NULL
10167  * @error: a pointer to a NULL #GError, or %NULL
10168  *
10169  * Attempts registration of the application.
10170  *
10171  * This is the point at which the application discovers if it is the
10172  * primary instance or merely acting as a remote for an already-existing
10173  * primary instance.  This is implemented by attempting to acquire the
10174  * application identifier as a unique bus name on the session bus using
10175  * GDBus.
10176  *
10177  * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
10178  * given, then this process will always become the primary instance.
10179  *
10180  * Due to the internal architecture of GDBus, method calls can be
10181  * dispatched at any time (even if a main loop is not running).  For
10182  * this reason, you must ensure that any object paths that you wish to
10183  * register are registered before calling this function.
10184  *
10185  * If the application has already been registered then %TRUE is
10186  * returned with no work performed.
10187  *
10188  * The #GApplication::startup signal is emitted if registration succeeds
10189  * and @application is the primary instance (including the non-unique
10190  * case).
10191  *
10192  * In the event of an error (such as @cancellable being cancelled, or a
10193  * failure to connect to the session bus), %FALSE is returned and @error
10194  * is set appropriately.
10195  *
10196  * Note: the return value of this function is not an indicator that this
10197  * instance is or is not the primary instance of the application.  See
10198  * g_application_get_is_remote() for that.
10199  *
10200  * Returns: %TRUE if registration succeeded
10201  * Since: 2.28
10202  */
10203
10204
10205 /**
10206  * g_application_release:
10207  * @application: a #GApplication
10208  *
10209  * Decrease the use count of @application.
10210  *
10211  * When the use count reaches zero, the application will stop running.
10212  *
10213  * Never call this function except to cancel the effect of a previous
10214  * call to g_application_hold().
10215  */
10216
10217
10218 /**
10219  * g_application_run:
10220  * @application: a #GApplication
10221  * @argc: the argc from main() (or 0 if @argv is %NULL)
10222  * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
10223  *
10224  * Runs the application.
10225  *
10226  * This function is intended to be run from main() and its return value
10227  * is intended to be returned by main(). Although you are expected to pass
10228  * the @argc, @argv parameters from main() to this function, it is possible
10229  * to pass %NULL if @argv is not available or commandline handling is not
10230  * required.
10231  *
10232  * First, the local_command_line() virtual function is invoked.
10233  * This function always runs on the local instance. It gets passed a pointer
10234  * to a %NULL-terminated copy of @argv and is expected to remove the arguments
10235  * that it handled (shifting up remaining arguments). See
10236  * <xref linkend="gapplication-example-cmdline2"/> for an example of
10237  * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
10238  * after setting <literal>argc = g_strv_length (argv);</literal>.
10239  *
10240  * The last argument to local_command_line() is a pointer to the @status
10241  * variable which can used to set the exit status that is returned from
10242  * g_application_run().
10243  *
10244  * If local_command_line() returns %TRUE, the command line is expected
10245  * to be completely handled, including possibly registering as the primary
10246  * instance, calling g_application_activate() or g_application_open(), etc.
10247  *
10248  * If local_command_line() returns %FALSE then the application is registered
10249  * and the #GApplication::command-line signal is emitted in the primary
10250  * instance (which may or may not be this instance). The signal handler
10251  * gets passed a #GApplicationCommandLine object that (among other things)
10252  * contains the remaining commandline arguments that have not been handled
10253  * by local_command_line().
10254  *
10255  * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
10256  * flag set then the default implementation of local_command_line()
10257  * always returns %FALSE immediately, resulting in the commandline
10258  * always being handled in the primary instance.
10259  *
10260  * Otherwise, the default implementation of local_command_line() tries
10261  * to do a couple of things that are probably reasonable for most
10262  * applications.  First, g_application_register() is called to attempt
10263  * to register the application.  If that works, then the command line
10264  * arguments are inspected.  If no commandline arguments are given, then
10265  * g_application_activate() is called.  If commandline arguments are
10266  * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
10267  * are assumed to be filenames and g_application_open() is called.
10268  *
10269  * If you need to handle commandline arguments that are not filenames,
10270  * and you don't mind commandline handling to happen in the primary
10271  * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
10272  * process the commandline arguments in your #GApplication::command-line
10273  * signal handler, either manually or using the #GOptionContext API.
10274  *
10275  * If you are interested in doing more complicated local handling of the
10276  * commandline then you should implement your own #GApplication subclass
10277  * and override local_command_line(). In this case, you most likely want
10278  * to return %TRUE from your local_command_line() implementation to
10279  * suppress the default handling. See
10280  * <xref linkend="gapplication-example-cmdline2"/> for an example.
10281  *
10282  * If, after the above is done, the use count of the application is zero
10283  * then the exit status is returned immediately.  If the use count is
10284  * non-zero then the default main context is iterated until the use count
10285  * falls to zero, at which point 0 is returned.
10286  *
10287  * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
10288  * use count of zero is delayed for a while (ie: the instance stays
10289  * around to provide its <emphasis>service</emphasis> to others).
10290  *
10291  * Returns: the exit status
10292  * Since: 2.28
10293  */
10294
10295
10296 /**
10297  * g_application_set_action_group:
10298  * @application: a #GApplication
10299  * @action_group: (allow-none): a #GActionGroup, or %NULL
10300  *
10301  * This used to be how actions were associated with a #GApplication.
10302  * Now there is #GActionMap for that.
10303  *
10304  * Since: 2.28
10305  * 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.
10306  */
10307
10308
10309 /**
10310  * g_application_set_application_id:
10311  * @application: a #GApplication
10312  * @application_id: (allow-none): the identifier for @application
10313  *
10314  * Sets the unique identifier for @application.
10315  *
10316  * The application id can only be modified if @application has not yet
10317  * been registered.
10318  *
10319  * If non-%NULL, the application id must be valid.  See
10320  * g_application_id_is_valid().
10321  *
10322  * Since: 2.28
10323  */
10324
10325
10326 /**
10327  * g_application_set_default:
10328  * @application: (allow-none): the application to set as default, or %NULL
10329  *
10330  * Sets or unsets the default application for the process, as returned
10331  * by g_application_get_default().
10332  *
10333  * This function does not take its own reference on @application.  If
10334  * @application is destroyed then the default application will revert
10335  * back to %NULL.
10336  *
10337  * Since: 2.32
10338  */
10339
10340
10341 /**
10342  * g_application_set_flags:
10343  * @application: a #GApplication
10344  * @flags: the flags for @application
10345  *
10346  * Sets the flags for @application.
10347  *
10348  * The flags can only be modified if @application has not yet been
10349  * registered.
10350  *
10351  * See #GApplicationFlags.
10352  *
10353  * Since: 2.28
10354  */
10355
10356
10357 /**
10358  * g_application_set_inactivity_timeout:
10359  * @application: a #GApplication
10360  * @inactivity_timeout: the timeout, in milliseconds
10361  *
10362  * Sets the current inactivity timeout for the application.
10363  *
10364  * This is the amount of time (in milliseconds) after the last call to
10365  * g_application_release() before the application stops running.
10366  *
10367  * This call has no side effects of its own.  The value set here is only
10368  * used for next time g_application_release() drops the use count to
10369  * zero.  Any timeouts currently in progress are not impacted.
10370  *
10371  * Since: 2.28
10372  */
10373
10374
10375 /**
10376  * g_async_initable_init_async:
10377  * @initable: a #GAsyncInitable.
10378  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10379  * @cancellable: optional #GCancellable object, %NULL to ignore.
10380  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10381  * @user_data: the data to pass to callback function
10382  *
10383  * Starts asynchronous initialization of the object implementing the
10384  * interface. This must be done before any real use of the object after
10385  * initial construction. If the object also implements #GInitable you can
10386  * optionally call g_initable_init() instead.
10387  *
10388  * When the initialization is finished, @callback will be called. You can
10389  * then call g_async_initable_init_finish() to get the result of the
10390  * initialization.
10391  *
10392  * Implementations may also support cancellation. If @cancellable is not
10393  * %NULL, then initialization can be cancelled by triggering the cancellable
10394  * object from another thread. If the operation was cancelled, the error
10395  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10396  * the object doesn't support cancellable initialization, the error
10397  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10398  *
10399  * As with #GInitable, if the object is not initialized, or initialization
10400  * returns with an error, then all operations on the object except
10401  * g_object_ref() and g_object_unref() are considered to be invalid, and
10402  * have undefined behaviour. They will often fail with g_critical() or
10403  * g_warning(), but this must not be relied on.
10404  *
10405  * Implementations of this method must be idempotent: i.e. multiple calls
10406  * to this function with the same argument should return the same results.
10407  * Only the first call initializes the object; further calls return the result
10408  * of the first call. This is so that it's safe to implement the singleton
10409  * pattern in the GObject constructor function.
10410  *
10411  * For classes that also support the #GInitable interface, the default
10412  * implementation of this method will run the g_initable_init() function
10413  * in a thread, so if you want to support asynchronous initialization via
10414  * threads, just implement the #GAsyncInitable interface without overriding
10415  * any interface methods.
10416  *
10417  * Since: 2.22
10418  */
10419
10420
10421 /**
10422  * g_async_initable_init_finish:
10423  * @initable: a #GAsyncInitable.
10424  * @res: a #GAsyncResult.
10425  * @error: a #GError location to store the error occurring, or %NULL to ignore.
10426  *
10427  * Finishes asynchronous initialization and returns the result.
10428  * See g_async_initable_init_async().
10429  *
10430  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
10431  * Since: 2.22
10432  */
10433
10434
10435 /**
10436  * g_async_initable_new_async:
10437  * @object_type: a #GType supporting #GAsyncInitable.
10438  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10439  * @cancellable: optional #GCancellable object, %NULL to ignore.
10440  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10441  * @user_data: the data to pass to callback function
10442  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
10443  * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
10444  *
10445  * Helper function for constructing #GAsyncInitable object. This is
10446  * similar to g_object_new() but also initializes the object asynchronously.
10447  *
10448  * When the initialization is finished, @callback will be called. You can
10449  * then call g_async_initable_new_finish() to get the new object and check
10450  * for any errors.
10451  *
10452  * Since: 2.22
10453  */
10454
10455
10456 /**
10457  * g_async_initable_new_finish:
10458  * @initable: the #GAsyncInitable from the callback
10459  * @res: the #GAsyncResult from the callback
10460  * @error: return location for errors, or %NULL to ignore
10461  *
10462  * Finishes the async construction for the various g_async_initable_new
10463  * calls, returning the created object or %NULL on error.
10464  *
10465  * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
10466  * Since: 2.22
10467  */
10468
10469
10470 /**
10471  * g_async_initable_new_valist_async:
10472  * @object_type: a #GType supporting #GAsyncInitable.
10473  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
10474  * @var_args: The var args list generated from @first_property_name.
10475  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10476  * @cancellable: optional #GCancellable object, %NULL to ignore.
10477  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10478  * @user_data: the data to pass to callback function
10479  *
10480  * Helper function for constructing #GAsyncInitable object. This is
10481  * similar to g_object_new_valist() but also initializes the object
10482  * asynchronously.
10483  *
10484  * When the initialization is finished, @callback will be called. You can
10485  * then call g_async_initable_new_finish() to get the new object and check
10486  * for any errors.
10487  *
10488  * Since: 2.22
10489  */
10490
10491
10492 /**
10493  * g_async_initable_newv_async:
10494  * @object_type: a #GType supporting #GAsyncInitable.
10495  * @n_parameters: the number of parameters in @parameters
10496  * @parameters: the parameters to use to construct the object
10497  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10498  * @cancellable: optional #GCancellable object, %NULL to ignore.
10499  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10500  * @user_data: the data to pass to callback function
10501  *
10502  * Helper function for constructing #GAsyncInitable object. This is
10503  * similar to g_object_newv() but also initializes the object asynchronously.
10504  *
10505  * When the initialization is finished, @callback will be called. You can
10506  * then call g_async_initable_new_finish() to get the new object and check
10507  * for any errors.
10508  *
10509  * Since: 2.22
10510  */
10511
10512
10513 /**
10514  * g_async_result_get_source_object:
10515  * @res: a #GAsyncResult
10516  *
10517  * Gets the source object from a #GAsyncResult.
10518  *
10519  * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
10520  */
10521
10522
10523 /**
10524  * g_async_result_get_user_data:
10525  * @res: a #GAsyncResult.
10526  *
10527  * Gets the user data from a #GAsyncResult.
10528  *
10529  * Returns: (transfer full): the user data for @res.
10530  */
10531
10532
10533 /**
10534  * g_async_result_is_tagged:
10535  * @result: a #GAsyncResult
10536  * @source_tag: an application-defined tag
10537  *
10538  * Checks if @result has the given @source_tag (generally a function
10539  * pointer indicating the function @result was created by).
10540  *
10541  * Returns: %TRUE if @result has the indicated @source_tag, %FALSE if not.
10542  * Since: 2.34
10543  */
10544
10545
10546 /**
10547  * g_async_result_legacy_propagate_error:
10548  * @result: a #GAsyncResult
10549  * @dest: (out): a location to propagate the error to.
10550  *
10551  * If @result is a #GSimpleAsyncResult, this is equivalent to
10552  * g_simple_async_result_propagate_error(). Otherwise it returns
10553  * %FALSE.
10554  *
10555  * This can be used for legacy error handling in async
10556  * <literal>_finish ()</literal> wrapper functions that traditionally
10557  * handled #GSimpleAsyncResult error returns themselves rather than
10558  * calling into the virtual method. This should not be used in new
10559  * code; #GAsyncResult errors that are set by virtual methods should
10560  * also be extracted by virtual methods, to enable subclasses to chain
10561  * up correctly.
10562  *
10563  * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
10564  * Since: 2.34
10565  */
10566
10567
10568 /**
10569  * g_buffered_input_stream_fill:
10570  * @stream: a #GBufferedInputStream
10571  * @count: the number of bytes that will be read from the stream
10572  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10573  * @error: location to store the error occurring, or %NULL to ignore
10574  *
10575  * Tries to read @count bytes from the stream into the buffer.
10576  * Will block during this read.
10577  *
10578  * If @count is zero, returns zero and does nothing. A value of @count
10579  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
10580  *
10581  * On success, the number of bytes read into the buffer is returned.
10582  * It is not an error if this is not the same as the requested size, as it
10583  * can happen e.g. near the end of a file. Zero is returned on end of file
10584  * (or if @count is zero),  but never otherwise.
10585  *
10586  * If @count is -1 then the attempted read size is equal to the number of
10587  * bytes that are required to fill the buffer.
10588  *
10589  * If @cancellable is not %NULL, then the operation can be cancelled by
10590  * triggering the cancellable object from another thread. If the operation
10591  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10592  * operation was partially finished when the operation was cancelled the
10593  * partial result will be returned, without an error.
10594  *
10595  * On error -1 is returned and @error is set accordingly.
10596  *
10597  * For the asynchronous, non-blocking, version of this function, see
10598  * g_buffered_input_stream_fill_async().
10599  *
10600  * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
10601  */
10602
10603
10604 /**
10605  * g_buffered_input_stream_fill_async:
10606  * @stream: a #GBufferedInputStream
10607  * @count: the number of bytes that will be read from the stream
10608  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
10609  * @cancellable: (allow-none): optional #GCancellable object
10610  * @callback: (scope async): a #GAsyncReadyCallback
10611  * @user_data: (closure): a #gpointer
10612  *
10613  * Reads data into @stream's buffer asynchronously, up to @count size.
10614  * @io_priority can be used to prioritize reads. For the synchronous
10615  * version of this function, see g_buffered_input_stream_fill().
10616  *
10617  * If @count is -1 then the attempted read size is equal to the number
10618  * of bytes that are required to fill the buffer.
10619  */
10620
10621
10622 /**
10623  * g_buffered_input_stream_fill_finish:
10624  * @stream: a #GBufferedInputStream
10625  * @result: a #GAsyncResult
10626  * @error: a #GError
10627  *
10628  * Finishes an asynchronous read.
10629  *
10630  * Returns: a #gssize of the read stream, or %-1 on an error.
10631  */
10632
10633
10634 /**
10635  * g_buffered_input_stream_get_available:
10636  * @stream: #GBufferedInputStream
10637  *
10638  * Gets the size of the available data within the stream.
10639  *
10640  * Returns: size of the available stream.
10641  */
10642
10643
10644 /**
10645  * g_buffered_input_stream_get_buffer_size:
10646  * @stream: a #GBufferedInputStream
10647  *
10648  * Gets the size of the input buffer.
10649  *
10650  * Returns: the current buffer size.
10651  */
10652
10653
10654 /**
10655  * g_buffered_input_stream_new:
10656  * @base_stream: a #GInputStream
10657  *
10658  * Creates a new #GInputStream from the given @base_stream, with
10659  * a buffer set to the default size (4 kilobytes).
10660  *
10661  * Returns: a #GInputStream for the given @base_stream.
10662  */
10663
10664
10665 /**
10666  * g_buffered_input_stream_new_sized:
10667  * @base_stream: a #GInputStream
10668  * @size: a #gsize
10669  *
10670  * Creates a new #GBufferedInputStream from the given @base_stream,
10671  * with a buffer set to @size.
10672  *
10673  * Returns: a #GInputStream.
10674  */
10675
10676
10677 /**
10678  * g_buffered_input_stream_peek:
10679  * @stream: a #GBufferedInputStream
10680  * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10681  * @offset: a #gsize
10682  * @count: a #gsize
10683  *
10684  * Peeks in the buffer, copying data of size @count into @buffer,
10685  * offset @offset bytes.
10686  *
10687  * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10688  */
10689
10690
10691 /**
10692  * g_buffered_input_stream_peek_buffer:
10693  * @stream: a #GBufferedInputStream
10694  * @count: (out): a #gsize to get the number of bytes available in the buffer
10695  *
10696  * Returns the buffer with the currently available bytes. The returned
10697  * buffer must not be modified and will become invalid when reading from
10698  * the stream or filling the buffer.
10699  *
10700  * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10701  */
10702
10703
10704 /**
10705  * g_buffered_input_stream_read_byte:
10706  * @stream: a #GBufferedInputStream
10707  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10708  * @error: location to store the error occurring, or %NULL to ignore
10709  *
10710  * Tries to read a single byte from the stream or the buffer. Will block
10711  * during this read.
10712  *
10713  * On success, the byte read from the stream is returned. On end of stream
10714  * -1 is returned but it's not an exceptional error and @error is not set.
10715  *
10716  * If @cancellable is not %NULL, then the operation can be cancelled by
10717  * triggering the cancellable object from another thread. If the operation
10718  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10719  * operation was partially finished when the operation was cancelled the
10720  * partial result will be returned, without an error.
10721  *
10722  * On error -1 is returned and @error is set accordingly.
10723  *
10724  * Returns: the byte read from the @stream, or -1 on end of stream or error.
10725  */
10726
10727
10728 /**
10729  * g_buffered_input_stream_set_buffer_size:
10730  * @stream: a #GBufferedInputStream
10731  * @size: a #gsize
10732  *
10733  * Sets the size of the internal buffer of @stream to @size, or to the
10734  * size of the contents of the buffer. The buffer can never be resized
10735  * smaller than its current contents.
10736  */
10737
10738
10739 /**
10740  * g_buffered_output_stream_get_auto_grow:
10741  * @stream: a #GBufferedOutputStream.
10742  *
10743  * Checks if the buffer automatically grows as data is added.
10744  *
10745  * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10746  */
10747
10748
10749 /**
10750  * g_buffered_output_stream_get_buffer_size:
10751  * @stream: a #GBufferedOutputStream.
10752  *
10753  * Gets the size of the buffer in the @stream.
10754  *
10755  * Returns: the current size of the buffer.
10756  */
10757
10758
10759 /**
10760  * g_buffered_output_stream_new:
10761  * @base_stream: a #GOutputStream.
10762  *
10763  * Creates a new buffered output stream for a base stream.
10764  *
10765  * Returns: a #GOutputStream for the given @base_stream.
10766  */
10767
10768
10769 /**
10770  * g_buffered_output_stream_new_sized:
10771  * @base_stream: a #GOutputStream.
10772  * @size: a #gsize.
10773  *
10774  * Creates a new buffered output stream with a given buffer size.
10775  *
10776  * Returns: a #GOutputStream with an internal buffer set to @size.
10777  */
10778
10779
10780 /**
10781  * g_buffered_output_stream_set_auto_grow:
10782  * @stream: a #GBufferedOutputStream.
10783  * @auto_grow: a #gboolean.
10784  *
10785  * Sets whether or not the @stream's buffer should automatically grow.
10786  * If @auto_grow is true, then each write will just make the buffer
10787  * larger, and you must manually flush the buffer to actually write out
10788  * the data to the underlying stream.
10789  */
10790
10791
10792 /**
10793  * g_buffered_output_stream_set_buffer_size:
10794  * @stream: a #GBufferedOutputStream.
10795  * @size: a #gsize.
10796  *
10797  * Sets the size of the internal buffer to @size.
10798  */
10799
10800
10801 /**
10802  * g_bus_get:
10803  * @bus_type: A #GBusType.
10804  * @cancellable: (allow-none): A #GCancellable or %NULL.
10805  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10806  * @user_data: The data to pass to @callback.
10807  *
10808  * Asynchronously connects to the message bus specified by @bus_type.
10809  *
10810  * When the operation is finished, @callback will be invoked. You can
10811  * then call g_bus_get_finish() to get the result of the operation.
10812  *
10813  * This is a asynchronous failable function. See g_bus_get_sync() for
10814  * the synchronous version.
10815  *
10816  * Since: 2.26
10817  */
10818
10819
10820 /**
10821  * g_bus_get_finish:
10822  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10823  * @error: Return location for error or %NULL.
10824  *
10825  * Finishes an operation started with g_bus_get().
10826  *
10827  * The returned object is a singleton, that is, shared with other
10828  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10829  * event that you need a private message bus connection, use
10830  * g_dbus_address_get_for_bus_sync() and
10831  * g_dbus_connection_new_for_address().
10832  *
10833  * Note that the returned #GDBusConnection object will (usually) have
10834  * the #GDBusConnection:exit-on-close property set to %TRUE.
10835  *
10836  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10837  * Since: 2.26
10838  */
10839
10840
10841 /**
10842  * g_bus_get_sync:
10843  * @bus_type: A #GBusType.
10844  * @cancellable: (allow-none): A #GCancellable or %NULL.
10845  * @error: Return location for error or %NULL.
10846  *
10847  * Synchronously connects to the message bus specified by @bus_type.
10848  * Note that the returned object may shared with other callers,
10849  * e.g. if two separate parts of a process calls this function with
10850  * the same @bus_type, they will share the same object.
10851  *
10852  * This is a synchronous failable function. See g_bus_get() and
10853  * g_bus_get_finish() for the asynchronous version.
10854  *
10855  * The returned object is a singleton, that is, shared with other
10856  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10857  * event that you need a private message bus connection, use
10858  * g_dbus_address_get_for_bus_sync() and
10859  * g_dbus_connection_new_for_address().
10860  *
10861  * Note that the returned #GDBusConnection object will (usually) have
10862  * the #GDBusConnection:exit-on-close property set to %TRUE.
10863  *
10864  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10865  * Since: 2.26
10866  */
10867
10868
10869 /**
10870  * g_bus_own_name:
10871  * @bus_type: The type of bus to own a name on.
10872  * @name: The well-known name to own.
10873  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10874  * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10875  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10876  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10877  * @user_data: User data to pass to handlers.
10878  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10879  *
10880  * Starts acquiring @name on the bus specified by @bus_type and calls
10881  * @name_acquired_handler and @name_lost_handler when the name is
10882  * acquired respectively lost. Callbacks will be invoked in the <link
10883  * linkend="g-main-context-push-thread-default">thread-default main
10884  * loop</link> of the thread you are calling this function from.
10885  *
10886  * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10887  * callbacks will be invoked after calling this function - there are three
10888  * possible cases:
10889  * <itemizedlist>
10890  *   <listitem><para>
10891  *     @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10892  *   </para></listitem>
10893  *   <listitem><para>
10894  *     @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10895  *   </para></listitem>
10896  *   <listitem><para>
10897  *     @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10898  *   </para></listitem>
10899  * </itemizedlist>
10900  * When you are done owning the name, just call g_bus_unown_name()
10901  * with the owner id this function returns.
10902  *
10903  * If the name is acquired or lost (for example another application
10904  * could acquire the name if you allow replacement or the application
10905  * currently owning the name exits), the handlers are also invoked. If the
10906  * #GDBusConnection that is used for attempting to own the name
10907  * closes, then @name_lost_handler is invoked since it is no
10908  * longer possible for other processes to access the process.
10909  *
10910  * You cannot use g_bus_own_name() several times for the same name (unless
10911  * interleaved with calls to g_bus_unown_name()) - only the first call
10912  * will work.
10913  *
10914  * Another guarantee is that invocations of @name_acquired_handler
10915  * and @name_lost_handler are guaranteed to alternate; that
10916  * is, if @name_acquired_handler is invoked then you are
10917  * guaranteed that the next time one of the handlers is invoked, it
10918  * will be @name_lost_handler. The reverse is also true.
10919  *
10920  * If you plan on exporting objects (using e.g.
10921  * g_dbus_connection_register_object()), note that it is generally too late
10922  * to export the objects in @name_acquired_handler. Instead, you can do this
10923  * in @bus_acquired_handler since you are guaranteed that this will run
10924  * before @name is requested from the bus.
10925  *
10926  * This behavior makes it very simple to write applications that wants
10927  * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10928  * Simply register objects to be exported in @bus_acquired_handler and
10929  * unregister the objects (if any) in @name_lost_handler.
10930  *
10931  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10932  * Since: 2.26
10933  */
10934
10935
10936 /**
10937  * g_bus_own_name_on_connection:
10938  * @connection: A #GDBusConnection.
10939  * @name: The well-known name to own.
10940  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10941  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10942  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10943  * @user_data: User data to pass to handlers.
10944  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10945  *
10946  * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10947  * #GBusType.
10948  *
10949  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10950  * Since: 2.26
10951  */
10952
10953
10954 /**
10955  * g_bus_own_name_on_connection_with_closures:
10956  * @connection: A #GDBusConnection.
10957  * @name: The well-known name to own.
10958  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10959  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10960  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10961  *
10962  * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10963  * easier binding in other languages.
10964  *
10965  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10966  * Rename to: g_bus_own_name_on_connection
10967  * Since: 2.26
10968  */
10969
10970
10971 /**
10972  * g_bus_own_name_with_closures:
10973  * @bus_type: The type of bus to own a name on.
10974  * @name: The well-known name to own.
10975  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10976  * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10977  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10978  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10979  *
10980  * Version of g_bus_own_name() using closures instead of callbacks for
10981  * easier binding in other languages.
10982  *
10983  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10984  * Rename to: g_bus_own_name
10985  * Since: 2.26
10986  */
10987
10988
10989 /**
10990  * g_bus_unown_name:
10991  * @owner_id: An identifier obtained from g_bus_own_name()
10992  *
10993  * Stops owning a name.
10994  *
10995  * Since: 2.26
10996  */
10997
10998
10999 /**
11000  * g_bus_unwatch_name:
11001  * @watcher_id: An identifier obtained from g_bus_watch_name()
11002  *
11003  * Stops watching a name.
11004  *
11005  * Since: 2.26
11006  */
11007
11008
11009 /**
11010  * g_bus_watch_name:
11011  * @bus_type: The type of bus to watch a name on.
11012  * @name: The name (well-known or unique) to watch.
11013  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11014  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11015  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11016  * @user_data: User data to pass to handlers.
11017  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11018  *
11019  * Starts watching @name on the bus specified by @bus_type and calls
11020  * @name_appeared_handler and @name_vanished_handler when the name is
11021  * known to have a owner respectively known to lose its
11022  * owner. Callbacks will be invoked in the <link
11023  * linkend="g-main-context-push-thread-default">thread-default main
11024  * loop</link> of the thread you are calling this function from.
11025  *
11026  * You are guaranteed that one of the handlers will be invoked after
11027  * calling this function. When you are done watching the name, just
11028  * call g_bus_unwatch_name() with the watcher id this function
11029  * returns.
11030  *
11031  * If the name vanishes or appears (for example the application owning
11032  * the name could restart), the handlers are also invoked. If the
11033  * #GDBusConnection that is used for watching the name disconnects, then
11034  * @name_vanished_handler is invoked since it is no longer
11035  * possible to access the name.
11036  *
11037  * Another guarantee is that invocations of @name_appeared_handler
11038  * and @name_vanished_handler are guaranteed to alternate; that
11039  * is, if @name_appeared_handler is invoked then you are
11040  * guaranteed that the next time one of the handlers is invoked, it
11041  * will be @name_vanished_handler. The reverse is also true.
11042  *
11043  * This behavior makes it very simple to write applications that wants
11044  * to take action when a certain name exists, see <xref
11045  * linkend="gdbus-watching-names"/>. Basically, the application
11046  * should create object proxies in @name_appeared_handler and destroy
11047  * them again (if any) in @name_vanished_handler.
11048  *
11049  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11050  * Since: 2.26
11051  */
11052
11053
11054 /**
11055  * g_bus_watch_name_on_connection:
11056  * @connection: A #GDBusConnection.
11057  * @name: The name (well-known or unique) to watch.
11058  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11059  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11060  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11061  * @user_data: User data to pass to handlers.
11062  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11063  *
11064  * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
11065  * #GBusType.
11066  *
11067  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11068  * Since: 2.26
11069  */
11070
11071
11072 /**
11073  * g_bus_watch_name_on_connection_with_closures:
11074  * @connection: A #GDBusConnection.
11075  * @name: The name (well-known or unique) to watch.
11076  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11077  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11078  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11079  *
11080  * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
11081  * easier binding in other languages.
11082  *
11083  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11084  * Rename to: g_bus_watch_name_on_connection
11085  * Since: 2.26
11086  */
11087
11088
11089 /**
11090  * g_bus_watch_name_with_closures:
11091  * @bus_type: The type of bus to watch a name on.
11092  * @name: The name (well-known or unique) to watch.
11093  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11094  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11095  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11096  *
11097  * Version of g_bus_watch_name() using closures instead of callbacks for
11098  * easier binding in other languages.
11099  *
11100  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11101  * Rename to: g_bus_watch_name
11102  * Since: 2.26
11103  */
11104
11105
11106 /**
11107  * g_cancellable_cancel:
11108  * @cancellable: a #GCancellable object.
11109  *
11110  * Will set @cancellable to cancelled, and will emit the
11111  * #GCancellable::cancelled signal. (However, see the warning about
11112  * race conditions in the documentation for that signal if you are
11113  * planning to connect to it.)
11114  *
11115  * This function is thread-safe. In other words, you can safely call
11116  * it from a thread other than the one running the operation that was
11117  * passed the @cancellable.
11118  *
11119  * The convention within gio is that cancelling an asynchronous
11120  * operation causes it to complete asynchronously. That is, if you
11121  * cancel the operation from the same thread in which it is running,
11122  * then the operation's #GAsyncReadyCallback will not be invoked until
11123  * the application returns to the main loop.
11124  */
11125
11126
11127 /**
11128  * g_cancellable_connect:
11129  * @cancellable: A #GCancellable.
11130  * @callback: The #GCallback to connect.
11131  * @data: Data to pass to @callback.
11132  * @data_destroy_func: (allow-none): Free function for @data or %NULL.
11133  *
11134  * Convenience function to connect to the #GCancellable::cancelled
11135  * signal. Also handles the race condition that may happen
11136  * if the cancellable is cancelled right before connecting.
11137  *
11138  * @callback is called at most once, either directly at the
11139  * time of the connect if @cancellable is already cancelled,
11140  * or when @cancellable is cancelled in some thread.
11141  *
11142  * @data_destroy_func will be called when the handler is
11143  * disconnected, or immediately if the cancellable is already
11144  * cancelled.
11145  *
11146  * See #GCancellable::cancelled for details on how to use this.
11147  *
11148  * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
11149  * Since: 2.22
11150  */
11151
11152
11153 /**
11154  * g_cancellable_disconnect:
11155  * @cancellable: (allow-none): A #GCancellable or %NULL.
11156  * @handler_id: Handler id of the handler to be disconnected, or %0.
11157  *
11158  * Disconnects a handler from a cancellable instance similar to
11159  * g_signal_handler_disconnect().  Additionally, in the event that a
11160  * signal handler is currently running, this call will block until the
11161  * handler has finished.  Calling this function from a
11162  * #GCancellable::cancelled signal handler will therefore result in a
11163  * deadlock.
11164  *
11165  * This avoids a race condition where a thread cancels at the
11166  * same time as the cancellable operation is finished and the
11167  * signal handler is removed. See #GCancellable::cancelled for
11168  * details on how to use this.
11169  *
11170  * If @cancellable is %NULL or @handler_id is %0 this function does
11171  * nothing.
11172  *
11173  * Since: 2.22
11174  */
11175
11176
11177 /**
11178  * g_cancellable_get_current:
11179  *
11180  * Gets the top cancellable from the stack.
11181  *
11182  * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
11183  */
11184
11185
11186 /**
11187  * g_cancellable_get_fd:
11188  * @cancellable: a #GCancellable.
11189  *
11190  * Gets the file descriptor for a cancellable job. This can be used to
11191  * implement cancellable operations on Unix systems. The returned fd will
11192  * turn readable when @cancellable is cancelled.
11193  *
11194  * You are not supposed to read from the fd yourself, just check for
11195  * readable status. Reading to unset the readable status is done
11196  * with g_cancellable_reset().
11197  *
11198  * After a successful return from this function, you should use
11199  * g_cancellable_release_fd() to free up resources allocated for
11200  * the returned file descriptor.
11201  *
11202  * See also g_cancellable_make_pollfd().
11203  *
11204  * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
11205  */
11206
11207
11208 /**
11209  * g_cancellable_is_cancelled:
11210  * @cancellable: (allow-none): a #GCancellable or %NULL
11211  *
11212  * Checks if a cancellable job has been cancelled.
11213  *
11214  * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
11215  */
11216
11217
11218 /**
11219  * g_cancellable_make_pollfd:
11220  * @cancellable: (allow-none): a #GCancellable or %NULL
11221  * @pollfd: a pointer to a #GPollFD
11222  *
11223  * Creates a #GPollFD corresponding to @cancellable; this can be passed
11224  * to g_poll() and used to poll for cancellation. This is useful both
11225  * for unix systems without a native poll and for portability to
11226  * windows.
11227  *
11228  * When this function returns %TRUE, you should use
11229  * g_cancellable_release_fd() to free up resources allocated for the
11230  * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
11231  *
11232  * If this function returns %FALSE, either no @cancellable was given or
11233  * resource limits prevent this function from allocating the necessary
11234  * structures for polling. (On Linux, you will likely have reached
11235  * the maximum number of file descriptors.) The suggested way to handle
11236  * these cases is to ignore the @cancellable.
11237  *
11238  * You are not supposed to read from the fd yourself, just check for
11239  * readable status. Reading to unset the readable status is done
11240  * with g_cancellable_reset().
11241  *
11242  * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
11243  * Since: 2.22
11244  */
11245
11246
11247 /**
11248  * g_cancellable_new:
11249  *
11250  * Creates a new #GCancellable object.
11251  *
11252  * Applications that want to start one or more operations
11253  * that should be cancellable should create a #GCancellable
11254  * and pass it to the operations.
11255  *
11256  * One #GCancellable can be used in multiple consecutive
11257  * operations or in multiple concurrent operations.
11258  *
11259  * Returns: a #GCancellable.
11260  */
11261
11262
11263 /**
11264  * g_cancellable_pop_current:
11265  * @cancellable: a #GCancellable object
11266  *
11267  * Pops @cancellable off the cancellable stack (verifying that @cancellable
11268  * is on the top of the stack).
11269  */
11270
11271
11272 /**
11273  * g_cancellable_push_current:
11274  * @cancellable: a #GCancellable object
11275  *
11276  * Pushes @cancellable onto the cancellable stack. The current
11277  * cancellable can then be received using g_cancellable_get_current().
11278  *
11279  * This is useful when implementing cancellable operations in
11280  * code that does not allow you to pass down the cancellable object.
11281  *
11282  * This is typically called automatically by e.g. #GFile operations,
11283  * so you rarely have to call this yourself.
11284  */
11285
11286
11287 /**
11288  * g_cancellable_release_fd:
11289  * @cancellable: a #GCancellable
11290  *
11291  * Releases a resources previously allocated by g_cancellable_get_fd()
11292  * or g_cancellable_make_pollfd().
11293  *
11294  * For compatibility reasons with older releases, calling this function
11295  * is not strictly required, the resources will be automatically freed
11296  * when the @cancellable is finalized. However, the @cancellable will
11297  * block scarce file descriptors until it is finalized if this function
11298  * is not called. This can cause the application to run out of file
11299  * descriptors when many #GCancellables are used at the same time.
11300  *
11301  * Since: 2.22
11302  */
11303
11304
11305 /**
11306  * g_cancellable_reset:
11307  * @cancellable: a #GCancellable object.
11308  *
11309  * Resets @cancellable to its uncancelled state.
11310  *
11311  * If cancellable is currently in use by any cancellable operation
11312  * then the behavior of this function is undefined.
11313  */
11314
11315
11316 /**
11317  * g_cancellable_set_error_if_cancelled:
11318  * @cancellable: (allow-none): a #GCancellable or %NULL
11319  * @error: #GError to append error state to
11320  *
11321  * If the @cancellable is cancelled, sets the error to notify
11322  * that the operation was cancelled.
11323  *
11324  * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11325  */
11326
11327
11328 /**
11329  * g_cancellable_source_new: (skip)
11330  * @cancellable: (allow-none): a #GCancellable, or %NULL
11331  *
11332  * Creates a source that triggers if @cancellable is cancelled and
11333  * calls its callback of type #GCancellableSourceFunc. This is
11334  * primarily useful for attaching to another (non-cancellable) source
11335  * with g_source_add_child_source() to add cancellability to it.
11336  *
11337  * For convenience, you can call this with a %NULL #GCancellable,
11338  * in which case the source will never trigger.
11339  *
11340  * Returns: (transfer full): the new #GSource.
11341  * Since: 2.28
11342  */
11343
11344
11345 /**
11346  * g_charset_converter_get_num_fallbacks:
11347  * @converter: a #GCharsetConverter
11348  *
11349  * Gets the number of fallbacks that @converter has applied so far.
11350  *
11351  * Returns: the number of fallbacks that @converter has applied
11352  * Since: 2.24
11353  */
11354
11355
11356 /**
11357  * g_charset_converter_get_use_fallback:
11358  * @converter: a #GCharsetConverter
11359  *
11360  * Gets the #GCharsetConverter:use-fallback property.
11361  *
11362  * Returns: %TRUE if fallbacks are used by @converter
11363  * Since: 2.24
11364  */
11365
11366
11367 /**
11368  * g_charset_converter_new:
11369  * @to_charset: destination charset
11370  * @from_charset: source charset
11371  * @error: #GError for error reporting, or %NULL to ignore.
11372  *
11373  * Creates a new #GCharsetConverter.
11374  *
11375  * Returns: a new #GCharsetConverter or %NULL on error.
11376  * Since: 2.24
11377  */
11378
11379
11380 /**
11381  * g_charset_converter_set_use_fallback:
11382  * @converter: a #GCharsetConverter
11383  * @use_fallback: %TRUE to use fallbacks
11384  *
11385  * Sets the #GCharsetConverter:use-fallback property.
11386  *
11387  * Since: 2.24
11388  */
11389
11390
11391 /**
11392  * g_content_type_can_be_executable:
11393  * @type: a content type string
11394  *
11395  * Checks if a content type can be executable. Note that for instance
11396  * things like text files can be executables (i.e. scripts and batch files).
11397  *
11398  * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11399  */
11400
11401
11402 /**
11403  * g_content_type_equals:
11404  * @type1: a content type string
11405  * @type2: a content type string
11406  *
11407  * Compares two content types for equality.
11408  *
11409  * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11410  */
11411
11412
11413 /**
11414  * g_content_type_from_mime_type:
11415  * @mime_type: a mime type string
11416  *
11417  * Tries to find a content type based on the mime type name.
11418  *
11419  * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
11420  * Since: 2.18
11421  */
11422
11423
11424 /**
11425  * g_content_type_get_description:
11426  * @type: a content type string
11427  *
11428  * Gets the human readable description of the content type.
11429  *
11430  * Returns: a short description of the content type @type. Free the returned string with g_free()
11431  */
11432
11433
11434 /**
11435  * g_content_type_get_icon:
11436  * @type: a content type string
11437  *
11438  * Gets the icon for a content type.
11439  *
11440  * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11441  */
11442
11443
11444 /**
11445  * g_content_type_get_mime_type:
11446  * @type: a content type string
11447  *
11448  * Gets the mime type for the content type, if one is registered.
11449  *
11450  * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11451  */
11452
11453
11454 /**
11455  * g_content_type_get_symbolic_icon:
11456  * @type: a content type string
11457  *
11458  * Gets the symbolic icon for a content type.
11459  *
11460  * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11461  * Since: 2.34
11462  */
11463
11464
11465 /**
11466  * g_content_type_guess:
11467  * @filename: (allow-none): a string, or %NULL
11468  * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11469  * @data_size: the size of @data
11470  * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11471  *
11472  * Guesses the content type based on example data. If the function is
11473  * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11474  * or @data may be %NULL, in which case the guess will be based solely
11475  * on the other argument.
11476  *
11477  * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11478  */
11479
11480
11481 /**
11482  * g_content_type_guess_for_tree:
11483  * @root: the root of the tree to guess a type for
11484  *
11485  * Tries to guess the type of the tree with root @root, by
11486  * looking at the files it contains. The result is an array
11487  * of content types, with the best guess coming first.
11488  *
11489  * The types returned all have the form x-content/foo, e.g.
11490  * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11491  * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11492  * specification for more on x-content types.
11493  *
11494  * This function is useful in the implementation of
11495  * g_mount_guess_content_type().
11496  *
11497  * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11498  * Since: 2.18
11499  */
11500
11501
11502 /**
11503  * g_content_type_is_a:
11504  * @type: a content type string
11505  * @supertype: a content type string
11506  *
11507  * Determines if @type is a subset of @supertype.
11508  *
11509  * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11510  */
11511
11512
11513 /**
11514  * g_content_type_is_unknown:
11515  * @type: a content type string
11516  *
11517  * Checks if the content type is the generic "unknown" type.
11518  * On UNIX this is the "application/octet-stream" mimetype,
11519  * while on win32 it is "*".
11520  *
11521  * Returns: %TRUE if the type is the unknown type.
11522  */
11523
11524
11525 /**
11526  * g_content_types_get_registered:
11527  *
11528  * Gets a list of strings containing all the registered content types
11529  * known to the system. The list and its data should be freed using
11530  * <programlisting>
11531  * g_list_free_full (list, g_free);
11532  * </programlisting>
11533  *
11534  * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11535  */
11536
11537
11538 /**
11539  * g_converter_convert:
11540  * @converter: a #GConverter.
11541  * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11542  * @inbuf_size: the number of bytes in @inbuf
11543  * @outbuf: a buffer to write converted data in.
11544  * @outbuf_size: the number of bytes in @outbuf, must be at least one
11545  * @flags: a #GConverterFlags controlling the conversion details
11546  * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11547  * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11548  * @error: location to store the error occurring, or %NULL to ignore
11549  *
11550  * This is the main operation used when converting data. It is to be called
11551  * multiple times in a loop, and each time it will do some work, i.e.
11552  * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11553  * both. If its not possible to do any work an error is returned.
11554  *
11555  * Note that a single call may not consume all input (or any input at all).
11556  * Also a call may produce output even if given no input, due to state stored
11557  * in the converter producing output.
11558  *
11559  * If any data was either produced or consumed, and then an error happens, then
11560  * only the successful conversion is reported and the error is returned on the
11561  * next call.
11562  *
11563  * A full conversion loop involves calling this method repeatedly, each time
11564  * giving it new input and space output space. When there is no more input
11565  * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11566  * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11567  * each time until all data is consumed and all output is produced, then
11568  * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11569  * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11570  * in a decompression converter where the end of data is detectable from the
11571  * data (and there might even be other data after the end of the compressed data).
11572  *
11573  * When some data has successfully been converted @bytes_read and is set to
11574  * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11575  * how many bytes was written to @outbuf. If there are more data to output
11576  * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11577  * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11578  * then %G_CONVERTER_FINISHED is returned.
11579  *
11580  * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11581  * Some errors need special handling:
11582  *
11583  * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11584  * to write the resulting converted data, the application should
11585  * call the function again with a larger @outbuf to continue.
11586  *
11587  * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11588  * input to fully determine what the conversion should produce,
11589  * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11590  * example with an incomplete multibyte sequence when converting text,
11591  * or when a regexp matches up to the end of the input (and may match
11592  * further input). It may also happen when @inbuf_size is zero and
11593  * there is no more data to produce.
11594  *
11595  * When this happens the application should read more input and then
11596  * call the function again. If further input shows that there is no
11597  * more data call the function again with the same data but with
11598  * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11599  * to finish as e.g. in the regexp match case (or, to fail again with
11600  * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11601  * input is actually partial).
11602  *
11603  * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11604  * converter object is in an invalid state where its not allowed
11605  * to call g_converter_convert() anymore. At this time you can only
11606  * free the object or call g_converter_reset() to reset it to the
11607  * initial state.
11608  *
11609  * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11610  * to try to write out all internal state to the output. The application
11611  * has to call the function multiple times with the flag set, and when
11612  * the available input has been consumed and all internal state has
11613  * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11614  * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11615  * This is somewhat similar to what happens at the end of the input stream,
11616  * but done in the middle of the data.
11617  *
11618  * This has different meanings for different conversions. For instance
11619  * in a compression converter it would mean that we flush all the
11620  * compression state into output such that if you uncompress the
11621  * compressed data you get back all the input data. Doing this may
11622  * make the final file larger due to padding though. Another example
11623  * is a regexp conversion, where if you at the end of the flushed data
11624  * have a match, but there is also a potential longer match. In the
11625  * non-flushed case we would ask for more input, but when flushing we
11626  * treat this as the end of input and do the match.
11627  *
11628  * Flushing is not always possible (like if a charset converter flushes
11629  * at a partial multibyte sequence). Converters are supposed to try
11630  * to produce as much output as possible and then return an error
11631  * (typically %G_IO_ERROR_PARTIAL_INPUT).
11632  *
11633  * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11634  * Since: 2.24
11635  */
11636
11637
11638 /**
11639  * g_converter_input_stream_get_converter:
11640  * @converter_stream: a #GConverterInputStream
11641  *
11642  * Gets the #GConverter that is used by @converter_stream.
11643  *
11644  * Returns: (transfer none): the converter of the converter input stream
11645  * Since: 2.24
11646  */
11647
11648
11649 /**
11650  * g_converter_input_stream_new:
11651  * @base_stream: a #GInputStream
11652  * @converter: a #GConverter
11653  *
11654  * Creates a new converter input stream for the @base_stream.
11655  *
11656  * Returns: a new #GInputStream.
11657  */
11658
11659
11660 /**
11661  * g_converter_output_stream_get_converter:
11662  * @converter_stream: a #GConverterOutputStream
11663  *
11664  * Gets the #GConverter that is used by @converter_stream.
11665  *
11666  * Returns: (transfer none): the converter of the converter output stream
11667  * Since: 2.24
11668  */
11669
11670
11671 /**
11672  * g_converter_output_stream_new:
11673  * @base_stream: a #GOutputStream
11674  * @converter: a #GConverter
11675  *
11676  * Creates a new converter output stream for the @base_stream.
11677  *
11678  * Returns: a new #GOutputStream.
11679  */
11680
11681
11682 /**
11683  * g_converter_reset:
11684  * @converter: a #GConverter.
11685  *
11686  * Resets all internal state in the converter, making it behave
11687  * as if it was just created. If the converter has any internal
11688  * state that would produce output then that output is lost.
11689  *
11690  * Since: 2.24
11691  */
11692
11693
11694 /**
11695  * g_credentials_get_native: (skip)
11696  * @credentials: A #GCredentials.
11697  * @native_type: The type of native credentials to get.
11698  *
11699  * Gets a pointer to native credentials of type @native_type from
11700  * @credentials.
11701  *
11702  * It is a programming error (which will cause an warning to be
11703  * logged) to use this method if there is no #GCredentials support for
11704  * the OS or if @native_type isn't supported by the OS.
11705  *
11706  * 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.
11707  * Since: 2.26
11708  */
11709
11710
11711 /**
11712  * g_credentials_get_unix_user:
11713  * @credentials: A #GCredentials
11714  * @error: Return location for error or %NULL.
11715  *
11716  * Tries to get the UNIX user identifier from @credentials. This
11717  * method is only available on UNIX platforms.
11718  *
11719  * This operation can fail if #GCredentials is not supported on the
11720  * OS or if the native credentials type does not contain information
11721  * about the UNIX user.
11722  *
11723  * Returns: The UNIX user identifier or -1 if @error is set.
11724  * Since: 2.26
11725  */
11726
11727
11728 /**
11729  * g_credentials_is_same_user:
11730  * @credentials: A #GCredentials.
11731  * @other_credentials: A #GCredentials.
11732  * @error: Return location for error or %NULL.
11733  *
11734  * Checks if @credentials and @other_credentials is the same user.
11735  *
11736  * This operation can fail if #GCredentials is not supported on the
11737  * the OS.
11738  *
11739  * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11740  * Since: 2.26
11741  */
11742
11743
11744 /**
11745  * g_credentials_new:
11746  *
11747  * Creates a new #GCredentials object with credentials matching the
11748  * the current process.
11749  *
11750  * Returns: A #GCredentials. Free with g_object_unref().
11751  * Since: 2.26
11752  */
11753
11754
11755 /**
11756  * g_credentials_set_native:
11757  * @credentials: A #GCredentials.
11758  * @native_type: The type of native credentials to set.
11759  * @native: A pointer to native credentials.
11760  *
11761  * Copies the native credentials of type @native_type from @native
11762  * into @credentials.
11763  *
11764  * It is a programming error (which will cause an warning to be
11765  * logged) to use this method if there is no #GCredentials support for
11766  * the OS or if @native_type isn't supported by the OS.
11767  *
11768  * Since: 2.26
11769  */
11770
11771
11772 /**
11773  * g_credentials_set_unix_user:
11774  * @credentials: A #GCredentials.
11775  * @uid: The UNIX user identifier to set.
11776  * @error: Return location for error or %NULL.
11777  *
11778  * Tries to set the UNIX user identifier on @credentials. This method
11779  * is only available on UNIX platforms.
11780  *
11781  * This operation can fail if #GCredentials is not supported on the
11782  * OS or if the native credentials type does not contain information
11783  * about the UNIX user.
11784  *
11785  * Returns: %TRUE if @uid was set, %FALSE if error is set.
11786  * Since: 2.26
11787  */
11788
11789
11790 /**
11791  * g_credentials_to_string:
11792  * @credentials: A #GCredentials object.
11793  *
11794  * Creates a human-readable textual representation of @credentials
11795  * that can be used in logging and debug messages. The format of the
11796  * returned string may change in future GLib release.
11797  *
11798  * Returns: A string that should be freed with g_free().
11799  * Since: 2.26
11800  */
11801
11802
11803 /**
11804  * g_data_input_stream_get_byte_order:
11805  * @stream: a given #GDataInputStream.
11806  *
11807  * Gets the byte order for the data input stream.
11808  *
11809  * Returns: the @stream's current #GDataStreamByteOrder.
11810  */
11811
11812
11813 /**
11814  * g_data_input_stream_get_newline_type:
11815  * @stream: a given #GDataInputStream.
11816  *
11817  * Gets the current newline type for the @stream.
11818  *
11819  * Returns: #GDataStreamNewlineType for the given @stream.
11820  */
11821
11822
11823 /**
11824  * g_data_input_stream_new:
11825  * @base_stream: a #GInputStream.
11826  *
11827  * Creates a new data input stream for the @base_stream.
11828  *
11829  * Returns: a new #GDataInputStream.
11830  */
11831
11832
11833 /**
11834  * g_data_input_stream_read_byte:
11835  * @stream: a given #GDataInputStream.
11836  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11837  * @error: #GError for error reporting.
11838  *
11839  * Reads an unsigned 8-bit/1-byte value from @stream.
11840  *
11841  * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11842  */
11843
11844
11845 /**
11846  * g_data_input_stream_read_int16:
11847  * @stream: a given #GDataInputStream.
11848  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11849  * @error: #GError for error reporting.
11850  *
11851  * Reads a 16-bit/2-byte value from @stream.
11852  *
11853  * In order to get the correct byte order for this read operation,
11854  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11855  *
11856  * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11857  */
11858
11859
11860 /**
11861  * g_data_input_stream_read_int32:
11862  * @stream: a given #GDataInputStream.
11863  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11864  * @error: #GError for error reporting.
11865  *
11866  * Reads a signed 32-bit/4-byte value from @stream.
11867  *
11868  * In order to get the correct byte order for this read operation,
11869  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11870  *
11871  * If @cancellable is not %NULL, then the operation can be cancelled by
11872  * triggering the cancellable object from another thread. If the operation
11873  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11874  *
11875  * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11876  */
11877
11878
11879 /**
11880  * g_data_input_stream_read_int64:
11881  * @stream: a given #GDataInputStream.
11882  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11883  * @error: #GError for error reporting.
11884  *
11885  * Reads a 64-bit/8-byte value from @stream.
11886  *
11887  * In order to get the correct byte order for this read operation,
11888  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11889  *
11890  * If @cancellable is not %NULL, then the operation can be cancelled by
11891  * triggering the cancellable object from another thread. If the operation
11892  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11893  *
11894  * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11895  */
11896
11897
11898 /**
11899  * g_data_input_stream_read_line:
11900  * @stream: a given #GDataInputStream.
11901  * @length: (out): a #gsize to get the length of the data read in.
11902  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11903  * @error: #GError for error reporting.
11904  *
11905  * Reads a line from the data input stream.  Note that no encoding
11906  * checks or conversion is performed; the input is not guaranteed to
11907  * be UTF-8, and may in fact have embedded NUL characters.
11908  *
11909  * If @cancellable is not %NULL, then the operation can be cancelled by
11910  * triggering the cancellable object from another thread. If the operation
11911  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11912  *
11913  * 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.
11914  */
11915
11916
11917 /**
11918  * g_data_input_stream_read_line_async:
11919  * @stream: a given #GDataInputStream.
11920  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11921  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11922  * @callback: (scope async): callback to call when the request is satisfied.
11923  * @user_data: (closure): the data to pass to callback function.
11924  *
11925  * The asynchronous version of g_data_input_stream_read_line().  It is
11926  * an error to have two outstanding calls to this function.
11927  *
11928  * When the operation is finished, @callback will be called. You
11929  * can then call g_data_input_stream_read_line_finish() to get
11930  * the result of the operation.
11931  *
11932  * Since: 2.20
11933  */
11934
11935
11936 /**
11937  * g_data_input_stream_read_line_finish:
11938  * @stream: a given #GDataInputStream.
11939  * @result: the #GAsyncResult that was provided to the callback.
11940  * @length: (out): a #gsize to get the length of the data read in.
11941  * @error: #GError for error reporting.
11942  *
11943  * Finish an asynchronous call started by
11944  * g_data_input_stream_read_line_async().  Note the warning about
11945  * string encoding in g_data_input_stream_read_line() applies here as
11946  * well.
11947  *
11948  * 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.
11949  * Since: 2.20
11950  */
11951
11952
11953 /**
11954  * g_data_input_stream_read_line_finish_utf8:
11955  * @stream: a given #GDataInputStream.
11956  * @result: the #GAsyncResult that was provided to the callback.
11957  * @length: (out): a #gsize to get the length of the data read in.
11958  * @error: #GError for error reporting.
11959  *
11960  * Finish an asynchronous call started by
11961  * g_data_input_stream_read_line_async().
11962  *
11963  * 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.
11964  * Since: 2.30
11965  */
11966
11967
11968 /**
11969  * g_data_input_stream_read_line_utf8:
11970  * @stream: a given #GDataInputStream.
11971  * @length: (out): a #gsize to get the length of the data read in.
11972  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11973  * @error: #GError for error reporting.
11974  *
11975  * Reads a UTF-8 encoded line from the data input stream.
11976  *
11977  * If @cancellable is not %NULL, then the operation can be cancelled by
11978  * triggering the cancellable object from another thread. If the operation
11979  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11980  *
11981  * 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.
11982  * Since: 2.30
11983  */
11984
11985
11986 /**
11987  * g_data_input_stream_read_uint16:
11988  * @stream: a given #GDataInputStream.
11989  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11990  * @error: #GError for error reporting.
11991  *
11992  * Reads an unsigned 16-bit/2-byte value from @stream.
11993  *
11994  * In order to get the correct byte order for this read operation,
11995  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11996  *
11997  * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
11998  */
11999
12000
12001 /**
12002  * g_data_input_stream_read_uint32:
12003  * @stream: a given #GDataInputStream.
12004  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12005  * @error: #GError for error reporting.
12006  *
12007  * Reads an unsigned 32-bit/4-byte value from @stream.
12008  *
12009  * In order to get the correct byte order for this read operation,
12010  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12011  *
12012  * If @cancellable is not %NULL, then the operation can be cancelled by
12013  * triggering the cancellable object from another thread. If the operation
12014  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12015  *
12016  * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12017  */
12018
12019
12020 /**
12021  * g_data_input_stream_read_uint64:
12022  * @stream: a given #GDataInputStream.
12023  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12024  * @error: #GError for error reporting.
12025  *
12026  * Reads an unsigned 64-bit/8-byte value from @stream.
12027  *
12028  * In order to get the correct byte order for this read operation,
12029  * see g_data_input_stream_get_byte_order().
12030  *
12031  * If @cancellable is not %NULL, then the operation can be cancelled by
12032  * triggering the cancellable object from another thread. If the operation
12033  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12034  *
12035  * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
12036  */
12037
12038
12039 /**
12040  * g_data_input_stream_read_until:
12041  * @stream: a given #GDataInputStream.
12042  * @stop_chars: characters to terminate the read.
12043  * @length: (out): a #gsize to get the length of the data read in.
12044  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12045  * @error: #GError for error reporting.
12046  *
12047  * Reads a string from the data input stream, up to the first
12048  * occurrence of any of the stop characters.
12049  *
12050  * Note that, in contrast to g_data_input_stream_read_until_async(),
12051  * this function consumes the stop character that it finds.
12052  *
12053  * Don't use this function in new code.  Its functionality is
12054  * inconsistent with g_data_input_stream_read_until_async().  Both
12055  * functions will be marked as deprecated in a future release.  Use
12056  * g_data_input_stream_read_upto() instead, but note that that function
12057  * does not consume the stop character.
12058  *
12059  * 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.
12060  */
12061
12062
12063 /**
12064  * g_data_input_stream_read_until_async:
12065  * @stream: a given #GDataInputStream.
12066  * @stop_chars: characters to terminate the read.
12067  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12068  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12069  * @callback: (scope async): callback to call when the request is satisfied.
12070  * @user_data: (closure): the data to pass to callback function.
12071  *
12072  * The asynchronous version of g_data_input_stream_read_until().
12073  * It is an error to have two outstanding calls to this function.
12074  *
12075  * Note that, in contrast to g_data_input_stream_read_until(),
12076  * this function does not consume the stop character that it finds.  You
12077  * must read it for yourself.
12078  *
12079  * When the operation is finished, @callback will be called. You
12080  * can then call g_data_input_stream_read_until_finish() to get
12081  * the result of the operation.
12082  *
12083  * Don't use this function in new code.  Its functionality is
12084  * inconsistent with g_data_input_stream_read_until().  Both functions
12085  * will be marked as deprecated in a future release.  Use
12086  * g_data_input_stream_read_upto_async() instead.
12087  *
12088  * Since: 2.20
12089  */
12090
12091
12092 /**
12093  * g_data_input_stream_read_until_finish:
12094  * @stream: a given #GDataInputStream.
12095  * @result: the #GAsyncResult that was provided to the callback.
12096  * @length: (out): a #gsize to get the length of the data read in.
12097  * @error: #GError for error reporting.
12098  *
12099  * Finish an asynchronous call started by
12100  * g_data_input_stream_read_until_async().
12101  *
12102  * Since: 2.20
12103  * 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.
12104  */
12105
12106
12107 /**
12108  * g_data_input_stream_read_upto:
12109  * @stream: a #GDataInputStream
12110  * @stop_chars: characters to terminate the read
12111  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12112  * @length: (out): a #gsize to get the length of the data read in
12113  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12114  * @error: #GError for error reporting
12115  *
12116  * Reads a string from the data input stream, up to the first
12117  * occurrence of any of the stop characters.
12118  *
12119  * In contrast to g_data_input_stream_read_until(), this function
12120  * does <emphasis>not</emphasis> consume the stop character. You have
12121  * to use g_data_input_stream_read_byte() to get it before calling
12122  * g_data_input_stream_read_upto() again.
12123  *
12124  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12125  * specified.
12126  *
12127  * 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
12128  * Since: 2.26
12129  */
12130
12131
12132 /**
12133  * g_data_input_stream_read_upto_async:
12134  * @stream: a #GDataInputStream
12135  * @stop_chars: characters to terminate the read
12136  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12137  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12138  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12139  * @callback: (scope async): callback to call when the request is satisfied
12140  * @user_data: (closure): the data to pass to callback function
12141  *
12142  * The asynchronous version of g_data_input_stream_read_upto().
12143  * It is an error to have two outstanding calls to this function.
12144  *
12145  * In contrast to g_data_input_stream_read_until(), this function
12146  * does <emphasis>not</emphasis> consume the stop character. You have
12147  * to use g_data_input_stream_read_byte() to get it before calling
12148  * g_data_input_stream_read_upto() again.
12149  *
12150  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12151  * specified.
12152  *
12153  * When the operation is finished, @callback will be called. You
12154  * can then call g_data_input_stream_read_upto_finish() to get
12155  * the result of the operation.
12156  *
12157  * Since: 2.26
12158  */
12159
12160
12161 /**
12162  * g_data_input_stream_read_upto_finish:
12163  * @stream: a #GDataInputStream
12164  * @result: the #GAsyncResult that was provided to the callback
12165  * @length: (out): a #gsize to get the length of the data read in
12166  * @error: #GError for error reporting
12167  *
12168  * Finish an asynchronous call started by
12169  * g_data_input_stream_read_upto_async().
12170  *
12171  * Note that this function does <emphasis>not</emphasis> consume the
12172  * stop character. You have to use g_data_input_stream_read_byte() to
12173  * get it before calling g_data_input_stream_read_upto_async() again.
12174  *
12175  * 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.
12176  * Since: 2.24
12177  */
12178
12179
12180 /**
12181  * g_data_input_stream_set_byte_order:
12182  * @stream: a given #GDataInputStream.
12183  * @order: a #GDataStreamByteOrder to set.
12184  *
12185  * This function sets the byte order for the given @stream. All subsequent
12186  * reads from the @stream will be read in the given @order.
12187  */
12188
12189
12190 /**
12191  * g_data_input_stream_set_newline_type:
12192  * @stream: a #GDataInputStream.
12193  * @type: the type of new line return as #GDataStreamNewlineType.
12194  *
12195  * Sets the newline type for the @stream.
12196  *
12197  * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12198  * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12199  * "CR LF", and this might block if there is no more data available.
12200  */
12201
12202
12203 /**
12204  * g_data_output_stream_get_byte_order:
12205  * @stream: a #GDataOutputStream.
12206  *
12207  * Gets the byte order for the stream.
12208  *
12209  * Returns: the #GDataStreamByteOrder for the @stream.
12210  */
12211
12212
12213 /**
12214  * g_data_output_stream_new:
12215  * @base_stream: a #GOutputStream.
12216  *
12217  * Creates a new data output stream for @base_stream.
12218  *
12219  * Returns: #GDataOutputStream.
12220  */
12221
12222
12223 /**
12224  * g_data_output_stream_put_byte:
12225  * @stream: a #GDataOutputStream.
12226  * @data: a #guchar.
12227  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12228  * @error: a #GError, %NULL to ignore.
12229  *
12230  * Puts a byte into the output stream.
12231  *
12232  * Returns: %TRUE if @data was successfully added to the @stream.
12233  */
12234
12235
12236 /**
12237  * g_data_output_stream_put_int16:
12238  * @stream: a #GDataOutputStream.
12239  * @data: a #gint16.
12240  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12241  * @error: a #GError, %NULL to ignore.
12242  *
12243  * Puts a signed 16-bit integer into the output stream.
12244  *
12245  * Returns: %TRUE if @data was successfully added to the @stream.
12246  */
12247
12248
12249 /**
12250  * g_data_output_stream_put_int32:
12251  * @stream: a #GDataOutputStream.
12252  * @data: a #gint32.
12253  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12254  * @error: a #GError, %NULL to ignore.
12255  *
12256  * Puts a signed 32-bit integer into the output stream.
12257  *
12258  * Returns: %TRUE if @data was successfully added to the @stream.
12259  */
12260
12261
12262 /**
12263  * g_data_output_stream_put_int64:
12264  * @stream: a #GDataOutputStream.
12265  * @data: a #gint64.
12266  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12267  * @error: a #GError, %NULL to ignore.
12268  *
12269  * Puts a signed 64-bit integer into the stream.
12270  *
12271  * Returns: %TRUE if @data was successfully added to the @stream.
12272  */
12273
12274
12275 /**
12276  * g_data_output_stream_put_string:
12277  * @stream: a #GDataOutputStream.
12278  * @str: a string.
12279  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12280  * @error: a #GError, %NULL to ignore.
12281  *
12282  * Puts a string into the output stream.
12283  *
12284  * Returns: %TRUE if @string was successfully added to the @stream.
12285  */
12286
12287
12288 /**
12289  * g_data_output_stream_put_uint16:
12290  * @stream: a #GDataOutputStream.
12291  * @data: a #guint16.
12292  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12293  * @error: a #GError, %NULL to ignore.
12294  *
12295  * Puts an unsigned 16-bit integer into the output stream.
12296  *
12297  * Returns: %TRUE if @data was successfully added to the @stream.
12298  */
12299
12300
12301 /**
12302  * g_data_output_stream_put_uint32:
12303  * @stream: a #GDataOutputStream.
12304  * @data: a #guint32.
12305  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12306  * @error: a #GError, %NULL to ignore.
12307  *
12308  * Puts an unsigned 32-bit integer into the stream.
12309  *
12310  * Returns: %TRUE if @data was successfully added to the @stream.
12311  */
12312
12313
12314 /**
12315  * g_data_output_stream_put_uint64:
12316  * @stream: a #GDataOutputStream.
12317  * @data: a #guint64.
12318  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12319  * @error: a #GError, %NULL to ignore.
12320  *
12321  * Puts an unsigned 64-bit integer into the stream.
12322  *
12323  * Returns: %TRUE if @data was successfully added to the @stream.
12324  */
12325
12326
12327 /**
12328  * g_data_output_stream_set_byte_order:
12329  * @stream: a #GDataOutputStream.
12330  * @order: a %GDataStreamByteOrder.
12331  *
12332  * Sets the byte order of the data output stream to @order.
12333  */
12334
12335
12336 /**
12337  * g_dbus_action_group_get:
12338  * @connection: A #GDBusConnection
12339  * @bus_name: the bus name which exports the action group
12340  * @object_path: the object path at which the action group is exported
12341  *
12342  * Obtains a #GDBusActionGroup for the action group which is exported at
12343  * the given @bus_name and @object_path.
12344  *
12345  * The thread default main context is taken at the time of this call.
12346  * All signals on the menu model (and any linked models) are reported
12347  * with respect to this context.  All calls on the returned menu model
12348  * (and linked models) must also originate from this same context, with
12349  * the thread default main context unchanged.
12350  *
12351  * This call is non-blocking.  The returned action group may or may not
12352  * already be filled in.  The correct thing to do is connect the signals
12353  * for the action group to monitor for changes and then to call
12354  * g_action_group_list_actions() to get the initial list.
12355  *
12356  * Returns: (transfer full): a #GDBusActionGroup
12357  * Since: 2.32
12358  */
12359
12360
12361 /**
12362  * g_dbus_address_get_for_bus_sync:
12363  * @bus_type: A #GBusType.
12364  * @cancellable: (allow-none): A #GCancellable or %NULL.
12365  * @error: Return location for error or %NULL.
12366  *
12367  * Synchronously looks up the D-Bus address for the well-known message
12368  * bus instance specified by @bus_type. This may involve using various
12369  * platform specific mechanisms.
12370  *
12371  * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12372  * Since: 2.26
12373  */
12374
12375
12376 /**
12377  * g_dbus_address_get_stream:
12378  * @address: A valid D-Bus address.
12379  * @cancellable: (allow-none): A #GCancellable or %NULL.
12380  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12381  * @user_data: Data to pass to @callback.
12382  *
12383  * Asynchronously connects to an endpoint specified by @address and
12384  * sets up the connection so it is in a state to run the client-side
12385  * of the D-Bus authentication conversation.
12386  *
12387  * When the operation is finished, @callback will be invoked. You can
12388  * then call g_dbus_address_get_stream_finish() to get the result of
12389  * the operation.
12390  *
12391  * This is an asynchronous failable function. See
12392  * g_dbus_address_get_stream_sync() for the synchronous version.
12393  *
12394  * Since: 2.26
12395  */
12396
12397
12398 /**
12399  * g_dbus_address_get_stream_finish:
12400  * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12401  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12402  * @error: Return location for error or %NULL.
12403  *
12404  * Finishes an operation started with g_dbus_address_get_stream().
12405  *
12406  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12407  * Since: 2.26
12408  */
12409
12410
12411 /**
12412  * g_dbus_address_get_stream_sync:
12413  * @address: A valid D-Bus address.
12414  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12415  * @cancellable: (allow-none): A #GCancellable or %NULL.
12416  * @error: Return location for error or %NULL.
12417  *
12418  * Synchronously connects to an endpoint specified by @address and
12419  * sets up the connection so it is in a state to run the client-side
12420  * of the D-Bus authentication conversation.
12421  *
12422  * This is a synchronous failable function. See
12423  * g_dbus_address_get_stream() for the asynchronous version.
12424  *
12425  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12426  * Since: 2.26
12427  */
12428
12429
12430 /**
12431  * g_dbus_annotation_info_lookup:
12432  * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12433  * @name: The name of the annotation to look up.
12434  *
12435  * Looks up the value of an annotation.
12436  *
12437  * This cost of this function is O(n) in number of annotations.
12438  *
12439  * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12440  * Since: 2.26
12441  */
12442
12443
12444 /**
12445  * g_dbus_annotation_info_ref:
12446  * @info: A #GDBusNodeInfo
12447  *
12448  * If @info is statically allocated does nothing. Otherwise increases
12449  * the reference count.
12450  *
12451  * Returns: The same @info.
12452  * Since: 2.26
12453  */
12454
12455
12456 /**
12457  * g_dbus_annotation_info_unref:
12458  * @info: A #GDBusAnnotationInfo.
12459  *
12460  * If @info is statically allocated, does nothing. Otherwise decreases
12461  * the reference count of @info. When its reference count drops to 0,
12462  * the memory used is freed.
12463  *
12464  * Since: 2.26
12465  */
12466
12467
12468 /**
12469  * g_dbus_arg_info_ref:
12470  * @info: A #GDBusArgInfo
12471  *
12472  * If @info is statically allocated does nothing. Otherwise increases
12473  * the reference count.
12474  *
12475  * Returns: The same @info.
12476  * Since: 2.26
12477  */
12478
12479
12480 /**
12481  * g_dbus_arg_info_unref:
12482  * @info: A #GDBusArgInfo.
12483  *
12484  * If @info is statically allocated, does nothing. Otherwise decreases
12485  * the reference count of @info. When its reference count drops to 0,
12486  * the memory used is freed.
12487  *
12488  * Since: 2.26
12489  */
12490
12491
12492 /**
12493  * g_dbus_auth_observer_allow_mechanism:
12494  * @observer: A #GDBusAuthObserver.
12495  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12496  *
12497  * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12498  *
12499  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12500  * Since: 2.34
12501  */
12502
12503
12504 /**
12505  * g_dbus_auth_observer_authorize_authenticated_peer:
12506  * @observer: A #GDBusAuthObserver.
12507  * @stream: A #GIOStream for the #GDBusConnection.
12508  * @credentials: (allow-none): Credentials received from the peer or %NULL.
12509  *
12510  * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12511  *
12512  * Returns: %TRUE if the peer is authorized, %FALSE if not.
12513  * Since: 2.26
12514  */
12515
12516
12517 /**
12518  * g_dbus_auth_observer_new:
12519  *
12520  * Creates a new #GDBusAuthObserver object.
12521  *
12522  * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12523  * Since: 2.26
12524  */
12525
12526
12527 /**
12528  * g_dbus_connection_add_filter:
12529  * @connection: A #GDBusConnection.
12530  * @filter_function: A filter function.
12531  * @user_data: User data to pass to @filter_function.
12532  * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12533  *
12534  * Adds a message filter. Filters are handlers that are run on all
12535  * incoming and outgoing messages, prior to standard dispatch. Filters
12536  * are run in the order that they were added.  The same handler can be
12537  * added as a filter more than once, in which case it will be run more
12538  * than once.  Filters added during a filter callback won't be run on
12539  * the message being processed. Filter functions are allowed to modify
12540  * and even drop messages.
12541  *
12542  * Note that filters are run in a dedicated message handling thread so
12543  * they can't block and, generally, can't do anything but signal a
12544  * worker thread. Also note that filters are rarely needed - use API
12545  * such as g_dbus_connection_send_message_with_reply(),
12546  * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12547  *
12548  * If a filter consumes an incoming message the message is not
12549  * dispatched anywhere else - not even the standard dispatch machinery
12550  * (that API such as g_dbus_connection_signal_subscribe() and
12551  * g_dbus_connection_send_message_with_reply() relies on) will see the
12552  * message. Similary, if a filter consumes an outgoing message, the
12553  * message will not be sent to the other peer.
12554  *
12555  * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12556  * Since: 2.26
12557  */
12558
12559
12560 /**
12561  * g_dbus_connection_call:
12562  * @connection: A #GDBusConnection.
12563  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12564  * @object_path: Path of remote object.
12565  * @interface_name: D-Bus interface to invoke method on.
12566  * @method_name: The name of the method to invoke.
12567  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12568  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12569  * @flags: Flags from the #GDBusCallFlags enumeration.
12570  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12571  * @cancellable: (allow-none): A #GCancellable or %NULL.
12572  * @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.
12573  * @user_data: The data to pass to @callback.
12574  *
12575  * Asynchronously invokes the @method_name method on the
12576  * @interface_name D-Bus interface on the remote object at
12577  * @object_path owned by @bus_name.
12578  *
12579  * If @connection is closed then the operation will fail with
12580  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12581  * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12582  * not compatible with the D-Bus protocol, the operation fails with
12583  * %G_IO_ERROR_INVALID_ARGUMENT.
12584  *
12585  * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12586  * error will be raised if it does not match.  Said another way, if you give a @reply_type
12587  * then any non-%NULL return value will be of this type.
12588  *
12589  * If the @parameters #GVariant is floating, it is consumed. This allows
12590  * convenient 'inline' use of g_variant_new(), e.g.:
12591  * |[
12592  *  g_dbus_connection_call (connection,
12593  *                          "org.freedesktop.StringThings",
12594  *                          "/org/freedesktop/StringThings",
12595  *                          "org.freedesktop.StringThings",
12596  *                          "TwoStrings",
12597  *                          g_variant_new ("(ss)",
12598  *                                         "Thing One",
12599  *                                         "Thing Two"),
12600  *                          NULL,
12601  *                          G_DBUS_CALL_FLAGS_NONE,
12602  *                          -1,
12603  *                          NULL,
12604  *                          (GAsyncReadyCallback) two_strings_done,
12605  *                          NULL);
12606  * ]|
12607  *
12608  * This is an asynchronous method. When the operation is finished, @callback will be invoked
12609  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12610  * of the thread you are calling this method from. You can then call
12611  * g_dbus_connection_call_finish() to get the result of the operation.
12612  * See g_dbus_connection_call_sync() for the synchronous version of this
12613  * function.
12614  *
12615  * If @callback is %NULL then the D-Bus method call message will be sent with
12616  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12617  *
12618  * Since: 2.26
12619  */
12620
12621
12622 /**
12623  * g_dbus_connection_call_finish:
12624  * @connection: A #GDBusConnection.
12625  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12626  * @error: Return location for error or %NULL.
12627  *
12628  * Finishes an operation started with g_dbus_connection_call().
12629  *
12630  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12631  * Since: 2.26
12632  */
12633
12634
12635 /**
12636  * g_dbus_connection_call_sync:
12637  * @connection: A #GDBusConnection.
12638  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12639  * @object_path: Path of remote object.
12640  * @interface_name: D-Bus interface to invoke method on.
12641  * @method_name: The name of the method to invoke.
12642  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12643  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12644  * @flags: Flags from the #GDBusCallFlags enumeration.
12645  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12646  * @cancellable: (allow-none): A #GCancellable or %NULL.
12647  * @error: Return location for error or %NULL.
12648  *
12649  * Synchronously invokes the @method_name method on the
12650  * @interface_name D-Bus interface on the remote object at
12651  * @object_path owned by @bus_name.
12652  *
12653  * If @connection is closed then the operation will fail with
12654  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12655  * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12656  * contains a value not compatible with the D-Bus protocol, the operation
12657  * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12658  *
12659  * If @reply_type is non-%NULL then the reply will be checked for having
12660  * this type and an error will be raised if it does not match.  Said
12661  * another way, if you give a @reply_type then any non-%NULL return
12662  * value will be of this type.
12663  *
12664  * If the @parameters #GVariant is floating, it is consumed.
12665  * This allows convenient 'inline' use of g_variant_new(), e.g.:
12666  * |[
12667  *  g_dbus_connection_call_sync (connection,
12668  *                               "org.freedesktop.StringThings",
12669  *                               "/org/freedesktop/StringThings",
12670  *                               "org.freedesktop.StringThings",
12671  *                               "TwoStrings",
12672  *                               g_variant_new ("(ss)",
12673  *                                              "Thing One",
12674  *                                              "Thing Two"),
12675  *                               NULL,
12676  *                               G_DBUS_CALL_FLAGS_NONE,
12677  *                               -1,
12678  *                               NULL,
12679  *                               &amp;error);
12680  * ]|
12681  *
12682  * The calling thread is blocked until a reply is received. See
12683  * g_dbus_connection_call() for the asynchronous version of
12684  * this method.
12685  *
12686  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12687  * Since: 2.26
12688  */
12689
12690
12691 /**
12692  * g_dbus_connection_call_with_unix_fd_list:
12693  * @connection: A #GDBusConnection.
12694  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12695  * @object_path: Path of remote object.
12696  * @interface_name: D-Bus interface to invoke method on.
12697  * @method_name: The name of the method to invoke.
12698  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12699  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12700  * @flags: Flags from the #GDBusCallFlags enumeration.
12701  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12702  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12703  * @cancellable: (allow-none): A #GCancellable or %NULL.
12704  * @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.
12705  * @user_data: The data to pass to @callback.
12706  *
12707  * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12708  *
12709  * This method is only available on UNIX.
12710  *
12711  * Since: 2.30
12712  */
12713
12714
12715 /**
12716  * g_dbus_connection_call_with_unix_fd_list_finish:
12717  * @connection: A #GDBusConnection.
12718  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12719  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12720  * @error: Return location for error or %NULL.
12721  *
12722  * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12723  *
12724  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12725  * Since: 2.30
12726  */
12727
12728
12729 /**
12730  * g_dbus_connection_call_with_unix_fd_list_sync:
12731  * @connection: A #GDBusConnection.
12732  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12733  * @object_path: Path of remote object.
12734  * @interface_name: D-Bus interface to invoke method on.
12735  * @method_name: The name of the method to invoke.
12736  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12737  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12738  * @flags: Flags from the #GDBusCallFlags enumeration.
12739  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12740  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12741  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12742  * @cancellable: (allow-none): A #GCancellable or %NULL.
12743  * @error: Return location for error or %NULL.
12744  *
12745  * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12746  *
12747  * This method is only available on UNIX.
12748  *
12749  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12750  * Since: 2.30
12751  */
12752
12753
12754 /**
12755  * g_dbus_connection_close:
12756  * @connection: A #GDBusConnection.
12757  * @cancellable: (allow-none): A #GCancellable or %NULL.
12758  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12759  * @user_data: The data to pass to @callback.
12760  *
12761  * Closes @connection. Note that this never causes the process to
12762  * exit (this might only happen if the other end of a shared message
12763  * bus connection disconnects, see #GDBusConnection:exit-on-close).
12764  *
12765  * Once the connection is closed, operations such as sending a message
12766  * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12767  * will not automatically flush the connection so queued messages may
12768  * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12769  *
12770  * If @connection is already closed, this method fails with
12771  * %G_IO_ERROR_CLOSED.
12772  *
12773  * When @connection has been closed, the #GDBusConnection::closed
12774  * signal is emitted in the <link
12775  * linkend="g-main-context-push-thread-default">thread-default main
12776  * loop</link> of the thread that @connection was constructed in.
12777  *
12778  * This is an asynchronous method. When the operation is finished,
12779  * @callback will be invoked in the <link
12780  * linkend="g-main-context-push-thread-default">thread-default main
12781  * loop</link> of the thread you are calling this method from. You can
12782  * then call g_dbus_connection_close_finish() to get the result of the
12783  * operation.  See g_dbus_connection_close_sync() for the synchronous
12784  * version.
12785  *
12786  * Since: 2.26
12787  */
12788
12789
12790 /**
12791  * g_dbus_connection_close_finish:
12792  * @connection: A #GDBusConnection.
12793  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12794  * @error: Return location for error or %NULL.
12795  *
12796  * Finishes an operation started with g_dbus_connection_close().
12797  *
12798  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12799  * Since: 2.26
12800  */
12801
12802
12803 /**
12804  * g_dbus_connection_close_sync:
12805  * @connection: A #GDBusConnection.
12806  * @cancellable: (allow-none): A #GCancellable or %NULL.
12807  * @error: Return location for error or %NULL.
12808  *
12809  * Synchronously closees @connection. The calling thread is blocked
12810  * until this is done. See g_dbus_connection_close() for the
12811  * asynchronous version of this method and more details about what it
12812  * does.
12813  *
12814  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12815  * Since: 2.26
12816  */
12817
12818
12819 /**
12820  * g_dbus_connection_emit_signal:
12821  * @connection: A #GDBusConnection.
12822  * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12823  * @object_path: Path of remote object.
12824  * @interface_name: D-Bus interface to emit a signal on.
12825  * @signal_name: The name of the signal to emit.
12826  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12827  * @error: Return location for error or %NULL.
12828  *
12829  * Emits a signal.
12830  *
12831  * If the parameters GVariant is floating, it is consumed.
12832  *
12833  * This can only fail if @parameters is not compatible with the D-Bus protocol.
12834  *
12835  * Returns: %TRUE unless @error is set.
12836  * Since: 2.26
12837  */
12838
12839
12840 /**
12841  * g_dbus_connection_export_action_group:
12842  * @connection: a #GDBusConnection
12843  * @object_path: a D-Bus object path
12844  * @action_group: a #GActionGroup
12845  * @error: a pointer to a %NULL #GError, or %NULL
12846  *
12847  * Exports @action_group on @connection at @object_path.
12848  *
12849  * The implemented D-Bus API should be considered private.  It is
12850  * subject to change in the future.
12851  *
12852  * A given object path can only have one action group exported on it.
12853  * If this constraint is violated, the export will fail and 0 will be
12854  * returned (with @error set accordingly).
12855  *
12856  * You can unexport the action group using
12857  * g_dbus_connection_unexport_action_group() with the return value of
12858  * this function.
12859  *
12860  * The thread default main context is taken at the time of this call.
12861  * All incoming action activations and state change requests are
12862  * reported from this context.  Any changes on the action group that
12863  * cause it to emit signals must also come from this same context.
12864  * Since incoming action activations and state change requests are
12865  * rather likely to cause changes on the action group, this effectively
12866  * limits a given action group to being exported from only one main
12867  * context.
12868  *
12869  * Returns: the ID of the export (never zero), or 0 in case of failure
12870  * Since: 2.32
12871  */
12872
12873
12874 /**
12875  * g_dbus_connection_export_menu_model:
12876  * @connection: a #GDBusConnection
12877  * @object_path: a D-Bus object path
12878  * @menu: a #GMenuModel
12879  * @error: return location for an error, or %NULL
12880  *
12881  * Exports @menu on @connection at @object_path.
12882  *
12883  * The implemented D-Bus API should be considered private.
12884  * It is subject to change in the future.
12885  *
12886  * An object path can only have one action group exported on it. If this
12887  * constraint is violated, the export will fail and 0 will be
12888  * returned (with @error set accordingly).
12889  *
12890  * You can unexport the menu model using
12891  * g_dbus_connection_unexport_menu_model() with the return value of
12892  * this function.
12893  *
12894  * Returns: the ID of the export (never zero), or 0 in case of failure
12895  * Since: 2.32
12896  */
12897
12898
12899 /**
12900  * g_dbus_connection_flush:
12901  * @connection: A #GDBusConnection.
12902  * @cancellable: (allow-none): A #GCancellable or %NULL.
12903  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12904  * @user_data: The data to pass to @callback.
12905  *
12906  * Asynchronously flushes @connection, that is, writes all queued
12907  * outgoing message to the transport and then flushes the transport
12908  * (using g_output_stream_flush_async()). This is useful in programs
12909  * that wants to emit a D-Bus signal and then exit
12910  * immediately. Without flushing the connection, there is no guarantee
12911  * that the message has been sent to the networking buffers in the OS
12912  * kernel.
12913  *
12914  * This is an asynchronous method. When the operation is finished,
12915  * @callback will be invoked in the <link
12916  * linkend="g-main-context-push-thread-default">thread-default main
12917  * loop</link> of the thread you are calling this method from. You can
12918  * then call g_dbus_connection_flush_finish() to get the result of the
12919  * operation.  See g_dbus_connection_flush_sync() for the synchronous
12920  * version.
12921  *
12922  * Since: 2.26
12923  */
12924
12925
12926 /**
12927  * g_dbus_connection_flush_finish:
12928  * @connection: A #GDBusConnection.
12929  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12930  * @error: Return location for error or %NULL.
12931  *
12932  * Finishes an operation started with g_dbus_connection_flush().
12933  *
12934  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12935  * Since: 2.26
12936  */
12937
12938
12939 /**
12940  * g_dbus_connection_flush_sync:
12941  * @connection: A #GDBusConnection.
12942  * @cancellable: (allow-none): A #GCancellable or %NULL.
12943  * @error: Return location for error or %NULL.
12944  *
12945  * Synchronously flushes @connection. The calling thread is blocked
12946  * until this is done. See g_dbus_connection_flush() for the
12947  * asynchronous version of this method and more details about what it
12948  * does.
12949  *
12950  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12951  * Since: 2.26
12952  */
12953
12954
12955 /**
12956  * g_dbus_connection_get_capabilities:
12957  * @connection: A #GDBusConnection.
12958  *
12959  * Gets the capabilities negotiated with the remote peer
12960  *
12961  * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12962  * Since: 2.26
12963  */
12964
12965
12966 /**
12967  * g_dbus_connection_get_exit_on_close:
12968  * @connection: A #GDBusConnection.
12969  *
12970  * Gets whether the process is terminated when @connection is
12971  * closed by the remote peer. See
12972  * #GDBusConnection:exit-on-close for more details.
12973  *
12974  * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12975  * Since: 2.26
12976  */
12977
12978
12979 /**
12980  * g_dbus_connection_get_guid:
12981  * @connection: A #GDBusConnection.
12982  *
12983  * The GUID of the peer performing the role of server when
12984  * authenticating. See #GDBusConnection:guid for more details.
12985  *
12986  * Returns: The GUID. Do not free this string, it is owned by @connection.
12987  * Since: 2.26
12988  */
12989
12990
12991 /**
12992  * g_dbus_connection_get_last_serial:
12993  * @connection: A #GDBusConnection.
12994  *
12995  * Retrieves the last serial number assigned to a #GDBusMessage on
12996  * the current thread. This includes messages sent via both low-level
12997  * API such as g_dbus_connection_send_message() as well as
12998  * high-level API such as g_dbus_connection_emit_signal(),
12999  * g_dbus_connection_call() or g_dbus_proxy_call().
13000  *
13001  * Returns: the last used serial or zero when no message has been sent within the current thread.
13002  * Since: 2.34
13003  */
13004
13005
13006 /**
13007  * g_dbus_connection_get_peer_credentials:
13008  * @connection: A #GDBusConnection.
13009  *
13010  * Gets the credentials of the authenticated peer. This will always
13011  * return %NULL unless @connection acted as a server
13012  * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
13013  * when set up and the client passed credentials as part of the
13014  * authentication process.
13015  *
13016  * In a message bus setup, the message bus is always the server and
13017  * each application is a client. So this method will always return
13018  * %NULL for message bus clients.
13019  *
13020  * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
13021  * Since: 2.26
13022  */
13023
13024
13025 /**
13026  * g_dbus_connection_get_stream:
13027  * @connection: a #GDBusConnection
13028  *
13029  * Gets the underlying stream used for IO.
13030  *
13031  * While the #GDBusConnection is active, it will interact with this
13032  * stream from a worker thread, so it is not safe to interact with
13033  * the stream directly.
13034  *
13035  * Returns: (transfer none): the stream used for IO
13036  * Since: 2.26
13037  */
13038
13039
13040 /**
13041  * g_dbus_connection_get_unique_name:
13042  * @connection: A #GDBusConnection.
13043  *
13044  * Gets the unique name of @connection as assigned by the message
13045  * bus. This can also be used to figure out if @connection is a
13046  * message bus connection.
13047  *
13048  * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
13049  * Since: 2.26
13050  */
13051
13052
13053 /**
13054  * g_dbus_connection_is_closed:
13055  * @connection: A #GDBusConnection.
13056  *
13057  * Gets whether @connection is closed.
13058  *
13059  * Returns: %TRUE if the connection is closed, %FALSE otherwise.
13060  * Since: 2.26
13061  */
13062
13063
13064 /**
13065  * g_dbus_connection_new:
13066  * @stream: A #GIOStream.
13067  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13068  * @flags: Flags describing how to make the connection.
13069  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13070  * @cancellable: (allow-none): A #GCancellable or %NULL.
13071  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13072  * @user_data: The data to pass to @callback.
13073  *
13074  * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
13075  * with the end represented by @stream.
13076  *
13077  * If @stream is a #GSocketConnection, then the corresponding #GSocket
13078  * will be put into non-blocking mode.
13079  *
13080  * The D-Bus connection will interact with @stream from a worker thread.
13081  * As a result, the caller should not interact with @stream after this
13082  * method has been called, except by calling g_object_unref() on it.
13083  *
13084  * If @observer is not %NULL it may be used to control the
13085  * authentication process.
13086  *
13087  * When the operation is finished, @callback will be invoked. You can
13088  * then call g_dbus_connection_new_finish() to get the result of the
13089  * operation.
13090  *
13091  * This is a asynchronous failable constructor. See
13092  * g_dbus_connection_new_sync() for the synchronous
13093  * version.
13094  *
13095  * Since: 2.26
13096  */
13097
13098
13099 /**
13100  * g_dbus_connection_new_finish:
13101  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13102  * @error: Return location for error or %NULL.
13103  *
13104  * Finishes an operation started with g_dbus_connection_new().
13105  *
13106  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13107  * Since: 2.26
13108  */
13109
13110
13111 /**
13112  * g_dbus_connection_new_for_address:
13113  * @address: A D-Bus address.
13114  * @flags: Flags describing how to make the connection.
13115  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13116  * @cancellable: (allow-none): A #GCancellable or %NULL.
13117  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13118  * @user_data: The data to pass to @callback.
13119  *
13120  * Asynchronously connects and sets up a D-Bus client connection for
13121  * exchanging D-Bus messages with an endpoint specified by @address
13122  * which must be in the D-Bus address format.
13123  *
13124  * This constructor can only be used to initiate client-side
13125  * connections - use g_dbus_connection_new() if you need to act as the
13126  * server. In particular, @flags cannot contain the
13127  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13128  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13129  *
13130  * When the operation is finished, @callback will be invoked. You can
13131  * then call g_dbus_connection_new_finish() to get the result of the
13132  * operation.
13133  *
13134  * If @observer is not %NULL it may be used to control the
13135  * authentication process.
13136  *
13137  * This is a asynchronous failable constructor. See
13138  * g_dbus_connection_new_for_address_sync() for the synchronous
13139  * version.
13140  *
13141  * Since: 2.26
13142  */
13143
13144
13145 /**
13146  * g_dbus_connection_new_for_address_finish:
13147  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13148  * @error: Return location for error or %NULL.
13149  *
13150  * Finishes an operation started with g_dbus_connection_new_for_address().
13151  *
13152  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13153  * Since: 2.26
13154  */
13155
13156
13157 /**
13158  * g_dbus_connection_new_for_address_sync:
13159  * @address: A D-Bus address.
13160  * @flags: Flags describing how to make the connection.
13161  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13162  * @cancellable: (allow-none): A #GCancellable or %NULL.
13163  * @error: Return location for error or %NULL.
13164  *
13165  * Synchronously connects and sets up a D-Bus client connection for
13166  * exchanging D-Bus messages with an endpoint specified by @address
13167  * which must be in the D-Bus address format.
13168  *
13169  * This constructor can only be used to initiate client-side
13170  * connections - use g_dbus_connection_new_sync() if you need to act
13171  * as the server. In particular, @flags cannot contain the
13172  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13173  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13174  *
13175  * This is a synchronous failable constructor. See
13176  * g_dbus_connection_new_for_address() for the asynchronous version.
13177  *
13178  * If @observer is not %NULL it may be used to control the
13179  * authentication process.
13180  *
13181  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13182  * Since: 2.26
13183  */
13184
13185
13186 /**
13187  * g_dbus_connection_new_sync:
13188  * @stream: A #GIOStream.
13189  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13190  * @flags: Flags describing how to make the connection.
13191  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13192  * @cancellable: (allow-none): A #GCancellable or %NULL.
13193  * @error: Return location for error or %NULL.
13194  *
13195  * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13196  * with the end represented by @stream.
13197  *
13198  * If @stream is a #GSocketConnection, then the corresponding #GSocket
13199  * will be put into non-blocking mode.
13200  *
13201  * The D-Bus connection will interact with @stream from a worker thread.
13202  * As a result, the caller should not interact with @stream after this
13203  * method has been called, except by calling g_object_unref() on it.
13204  *
13205  * If @observer is not %NULL it may be used to control the
13206  * authentication process.
13207  *
13208  * This is a synchronous failable constructor. See
13209  * g_dbus_connection_new() for the asynchronous version.
13210  *
13211  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13212  * Since: 2.26
13213  */
13214
13215
13216 /**
13217  * g_dbus_connection_register_object:
13218  * @connection: A #GDBusConnection.
13219  * @object_path: The object path to register at.
13220  * @interface_info: Introspection data for the interface.
13221  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13222  * @user_data: (allow-none): Data to pass to functions in @vtable.
13223  * @user_data_free_func: Function to call when the object path is unregistered.
13224  * @error: Return location for error or %NULL.
13225  *
13226  * Registers callbacks for exported objects at @object_path with the
13227  * D-Bus interface that is described in @interface_info.
13228  *
13229  * Calls to functions in @vtable (and @user_data_free_func) will
13230  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13231  * loop</link> of the thread you are calling this method from.
13232  *
13233  * Note that all #GVariant values passed to functions in @vtable will match
13234  * the signature given in @interface_info - if a remote caller passes
13235  * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13236  * is returned to the remote caller.
13237  *
13238  * Additionally, if the remote caller attempts to invoke methods or
13239  * access properties not mentioned in @interface_info the
13240  * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13241  * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13242  * are returned to the caller.
13243  *
13244  * It is considered a programming error if the
13245  * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13246  * #GVariant of incorrect type.
13247  *
13248  * If an existing callback is already registered at @object_path and
13249  * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13250  *
13251  * GDBus automatically implements the standard D-Bus interfaces
13252  * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13253  * and org.freedesktop.Peer, so you don't have to implement those for
13254  * the objects you export. You <emphasis>can</emphasis> implement
13255  * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13256  * and setting of properties asynchronously.
13257  *
13258  * Note that the reference count on @interface_info will be
13259  * incremented by 1 (unless allocated statically, e.g. if the
13260  * reference count is -1, see g_dbus_interface_info_ref()) for as long
13261  * as the object is exported. Also note that @vtable will be copied.
13262  *
13263  * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13264  *
13265  * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13266  * Since: 2.26
13267  */
13268
13269
13270 /**
13271  * g_dbus_connection_register_subtree:
13272  * @connection: A #GDBusConnection.
13273  * @object_path: The object path to register the subtree at.
13274  * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13275  * @flags: Flags used to fine tune the behavior of the subtree.
13276  * @user_data: Data to pass to functions in @vtable.
13277  * @user_data_free_func: Function to call when the subtree is unregistered.
13278  * @error: Return location for error or %NULL.
13279  *
13280  * Registers a whole subtree of <quote>dynamic</quote> objects.
13281  *
13282  * The @enumerate and @introspection functions in @vtable are used to
13283  * convey, to remote callers, what nodes exist in the subtree rooted
13284  * by @object_path.
13285  *
13286  * When handling remote calls into any node in the subtree, first the
13287  * @enumerate function is used to check if the node exists. If the node exists
13288  * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13289  * the @introspection function is used to check if the node supports the
13290  * requested method. If so, the @dispatch function is used to determine
13291  * where to dispatch the call. The collected #GDBusInterfaceVTable and
13292  * #gpointer will be used to call into the interface vtable for processing
13293  * the request.
13294  *
13295  * All calls into user-provided code will be invoked in the <link
13296  * linkend="g-main-context-push-thread-default">thread-default main
13297  * loop</link> of the thread you are calling this method from.
13298  *
13299  * If an existing subtree is already registered at @object_path or
13300  * then @error is set to #G_IO_ERROR_EXISTS.
13301  *
13302  * Note that it is valid to register regular objects (using
13303  * g_dbus_connection_register_object()) in a subtree registered with
13304  * g_dbus_connection_register_subtree() - if so, the subtree handler
13305  * is tried as the last resort. One way to think about a subtree
13306  * handler is to consider it a <quote>fallback handler</quote>
13307  * for object paths not registered via g_dbus_connection_register_object()
13308  * or other bindings.
13309  *
13310  * Note that @vtable will be copied so you cannot change it after
13311  * registration.
13312  *
13313  * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13314  *
13315  * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13316  * Since: 2.26
13317  */
13318
13319
13320 /**
13321  * g_dbus_connection_remove_filter:
13322  * @connection: a #GDBusConnection
13323  * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13324  *
13325  * Removes a filter.
13326  *
13327  * Since: 2.26
13328  */
13329
13330
13331 /**
13332  * g_dbus_connection_send_message:
13333  * @connection: A #GDBusConnection.
13334  * @message: A #GDBusMessage
13335  * @flags: Flags affecting how the message is sent.
13336  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13337  * @error: Return location for error or %NULL.
13338  *
13339  * Asynchronously sends @message to the peer represented by @connection.
13340  *
13341  * Unless @flags contain the
13342  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13343  * will be assigned by @connection and set on @message via
13344  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13345  * serial number used will be written to this location prior to
13346  * submitting the message to the underlying transport.
13347  *
13348  * If @connection is closed then the operation will fail with
13349  * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13350  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13351  *
13352  * See <xref linkend="gdbus-server"/> and <xref
13353  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13354  * low-level API to send and receive UNIX file descriptors.
13355  *
13356  * Note that @message must be unlocked, unless @flags contain the
13357  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13358  *
13359  * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13360  * Since: 2.26
13361  */
13362
13363
13364 /**
13365  * g_dbus_connection_send_message_with_reply:
13366  * @connection: A #GDBusConnection.
13367  * @message: A #GDBusMessage.
13368  * @flags: Flags affecting how the message is sent.
13369  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13370  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13371  * @cancellable: (allow-none): A #GCancellable or %NULL.
13372  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13373  * @user_data: The data to pass to @callback.
13374  *
13375  * Asynchronously sends @message to the peer represented by @connection.
13376  *
13377  * Unless @flags contain the
13378  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13379  * will be assigned by @connection and set on @message via
13380  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13381  * serial number used will be written to this location prior to
13382  * submitting the message to the underlying transport.
13383  *
13384  * If @connection is closed then the operation will fail with
13385  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13386  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13387  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13388  *
13389  * This is an asynchronous method. When the operation is finished, @callback will be invoked
13390  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13391  * of the thread you are calling this method from. You can then call
13392  * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13393  * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13394  *
13395  * Note that @message must be unlocked, unless @flags contain the
13396  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13397  *
13398  * See <xref linkend="gdbus-server"/> and <xref
13399  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13400  * low-level API to send and receive UNIX file descriptors.
13401  *
13402  * Since: 2.26
13403  */
13404
13405
13406 /**
13407  * g_dbus_connection_send_message_with_reply_finish:
13408  * @connection: a #GDBusConnection
13409  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13410  * @error: Return location for error or %NULL.
13411  *
13412  * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13413  *
13414  * Note that @error is only set if a local in-process error
13415  * occurred. That is to say that the returned #GDBusMessage object may
13416  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13417  * g_dbus_message_to_gerror() to transcode this to a #GError.
13418  *
13419  * See <xref linkend="gdbus-server"/> and <xref
13420  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13421  * low-level API to send and receive UNIX file descriptors.
13422  *
13423  * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13424  * Since: 2.26
13425  */
13426
13427
13428 /**
13429  * g_dbus_connection_send_message_with_reply_sync:
13430  * @connection: A #GDBusConnection.
13431  * @message: A #GDBusMessage.
13432  * @flags: Flags affecting how the message is sent.
13433  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13434  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13435  * @cancellable: (allow-none): A #GCancellable or %NULL.
13436  * @error: Return location for error or %NULL.
13437  *
13438  * Synchronously sends @message to the peer represented by @connection
13439  * and blocks the calling thread until a reply is received or the
13440  * timeout is reached. See g_dbus_connection_send_message_with_reply()
13441  * for the asynchronous version of this method.
13442  *
13443  * Unless @flags contain the
13444  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13445  * will be assigned by @connection and set on @message via
13446  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13447  * serial number used will be written to this location prior to
13448  * submitting the message to the underlying transport.
13449  *
13450  * If @connection is closed then the operation will fail with
13451  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13452  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13453  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13454  *
13455  * Note that @error is only set if a local in-process error
13456  * occurred. That is to say that the returned #GDBusMessage object may
13457  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13458  * g_dbus_message_to_gerror() to transcode this to a #GError.
13459  *
13460  * See <xref linkend="gdbus-server"/> and <xref
13461  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13462  * low-level API to send and receive UNIX file descriptors.
13463  *
13464  * Note that @message must be unlocked, unless @flags contain the
13465  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13466  *
13467  * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13468  * Since: 2.26
13469  */
13470
13471
13472 /**
13473  * g_dbus_connection_set_exit_on_close:
13474  * @connection: A #GDBusConnection.
13475  * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13476  *
13477  * Sets whether the process should be terminated when @connection is
13478  * closed by the remote peer. See #GDBusConnection:exit-on-close for
13479  * more details.
13480  *
13481  * Note that this function should be used with care. Most modern UNIX
13482  * desktops tie the notion of a user session the session bus, and expect
13483  * all of a users applications to quit when their bus connection goes away.
13484  * If you are setting @exit_on_close to %FALSE for the shared session
13485  * bus connection, you should make sure that your application exits
13486  * when the user session ends.
13487  *
13488  * Since: 2.26
13489  */
13490
13491
13492 /**
13493  * g_dbus_connection_signal_subscribe:
13494  * @connection: A #GDBusConnection.
13495  * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13496  * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13497  * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13498  * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13499  * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13500  * @flags: Flags describing how to subscribe to the signal (currently unused).
13501  * @callback: Callback to invoke when there is a signal matching the requested data.
13502  * @user_data: User data to pass to @callback.
13503  * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13504  *
13505  * Subscribes to signals on @connection and invokes @callback with a
13506  * whenever the signal is received. Note that @callback
13507  * will be invoked in the <link
13508  * linkend="g-main-context-push-thread-default">thread-default main
13509  * loop</link> of the thread you are calling this method from.
13510  *
13511  * If @connection is not a message bus connection, @sender must be
13512  * %NULL.
13513  *
13514  * If @sender is a well-known name note that @callback is invoked with
13515  * the unique name for the owner of @sender, not the well-known name
13516  * as one would expect. This is because the message bus rewrites the
13517  * name. As such, to avoid certain race conditions, users should be
13518  * tracking the name owner of the well-known name and use that when
13519  * processing the received signal.
13520  *
13521  * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13522  * Since: 2.26
13523  */
13524
13525
13526 /**
13527  * g_dbus_connection_signal_unsubscribe:
13528  * @connection: A #GDBusConnection.
13529  * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13530  *
13531  * Unsubscribes from signals.
13532  *
13533  * Since: 2.26
13534  */
13535
13536
13537 /**
13538  * g_dbus_connection_start_message_processing:
13539  * @connection: A #GDBusConnection.
13540  *
13541  * If @connection was created with
13542  * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13543  * starts processing messages. Does nothing on if @connection wasn't
13544  * created with this flag or if the method has already been called.
13545  *
13546  * Since: 2.26
13547  */
13548
13549
13550 /**
13551  * g_dbus_connection_unexport_action_group:
13552  * @connection: a #GDBusConnection
13553  * @export_id: the ID from g_dbus_connection_export_action_group()
13554  *
13555  * Reverses the effect of a previous call to
13556  * g_dbus_connection_export_action_group().
13557  *
13558  * It is an error to call this function with an ID that wasn't returned
13559  * from g_dbus_connection_export_action_group() or to call it with the
13560  * same ID more than once.
13561  *
13562  * Since: 2.32
13563  */
13564
13565
13566 /**
13567  * g_dbus_connection_unexport_menu_model:
13568  * @connection: a #GDBusConnection
13569  * @export_id: the ID from g_dbus_connection_export_menu_model()
13570  *
13571  * Reverses the effect of a previous call to
13572  * g_dbus_connection_export_menu_model().
13573  *
13574  * It is an error to call this function with an ID that wasn't returned
13575  * from g_dbus_connection_export_menu_model() or to call it with the
13576  * same ID more than once.
13577  *
13578  * Since: 2.32
13579  */
13580
13581
13582 /**
13583  * g_dbus_connection_unregister_object:
13584  * @connection: A #GDBusConnection.
13585  * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13586  *
13587  * Unregisters an object.
13588  *
13589  * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13590  * Since: 2.26
13591  */
13592
13593
13594 /**
13595  * g_dbus_connection_unregister_subtree:
13596  * @connection: A #GDBusConnection.
13597  * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13598  *
13599  * Unregisters a subtree.
13600  *
13601  * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13602  * Since: 2.26
13603  */
13604
13605
13606 /**
13607  * g_dbus_error_encode_gerror:
13608  * @error: A #GError.
13609  *
13610  * Creates a D-Bus error name to use for @error. If @error matches
13611  * a registered error (cf. g_dbus_error_register_error()), the corresponding
13612  * D-Bus error name will be returned.
13613  *
13614  * Otherwise the a name of the form
13615  * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13616  * will be used. This allows other GDBus applications to map the error
13617  * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13618  *
13619  * This function is typically only used in object mappings to put a
13620  * #GError on the wire. Regular applications should not use it.
13621  *
13622  * Returns: A D-Bus error name (never %NULL). Free with g_free().
13623  * Since: 2.26
13624  */
13625
13626
13627 /**
13628  * g_dbus_error_get_remote_error:
13629  * @error: A #GError.
13630  *
13631  * Gets the D-Bus error name used for @error, if any.
13632  *
13633  * This function is guaranteed to return a D-Bus error name for all
13634  * #GError<!-- -->s returned from functions handling remote method
13635  * calls (e.g. g_dbus_connection_call_finish()) unless
13636  * g_dbus_error_strip_remote_error() has been used on @error.
13637  *
13638  * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13639  * Since: 2.26
13640  */
13641
13642
13643 /**
13644  * g_dbus_error_is_remote_error:
13645  * @error: A #GError.
13646  *
13647  * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13648  * use g_dbus_error_get_remote_error() to get the name of the error.
13649  *
13650  * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13651  * Since: 2.26
13652  */
13653
13654
13655 /**
13656  * g_dbus_error_new_for_dbus_error:
13657  * @dbus_error_name: D-Bus error name.
13658  * @dbus_error_message: D-Bus error message.
13659  *
13660  * Creates a #GError based on the contents of @dbus_error_name and
13661  * @dbus_error_message.
13662  *
13663  * Errors registered with g_dbus_error_register_error() will be looked
13664  * up using @dbus_error_name and if a match is found, the error domain
13665  * and code is used. Applications can use g_dbus_error_get_remote_error()
13666  * to recover @dbus_error_name.
13667  *
13668  * If a match against a registered error is not found and the D-Bus
13669  * error name is in a form as returned by g_dbus_error_encode_gerror()
13670  * the error domain and code encoded in the name is used to
13671  * create the #GError. Also, @dbus_error_name is added to the error message
13672  * such that it can be recovered with g_dbus_error_get_remote_error().
13673  *
13674  * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13675  * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13676  * added to the error message such that it can be recovered with
13677  * g_dbus_error_get_remote_error().
13678  *
13679  * In all three cases, @dbus_error_name can always be recovered from the
13680  * returned #GError using the g_dbus_error_get_remote_error() function
13681  * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13682  *
13683  * This function is typically only used in object mappings to prepare
13684  * #GError instances for applications. Regular applications should not use
13685  * it.
13686  *
13687  * Returns: An allocated #GError. Free with g_error_free().
13688  * Since: 2.26
13689  */
13690
13691
13692 /**
13693  * g_dbus_error_register_error:
13694  * @error_domain: A #GQuark for a error domain.
13695  * @error_code: An error code.
13696  * @dbus_error_name: A D-Bus error name.
13697  *
13698  * Creates an association to map between @dbus_error_name and
13699  * #GError<!-- -->s specified by @error_domain and @error_code.
13700  *
13701  * This is typically done in the routine that returns the #GQuark for
13702  * an error domain.
13703  *
13704  * Returns: %TRUE if the association was created, %FALSE if it already exists.
13705  * Since: 2.26
13706  */
13707
13708
13709 /**
13710  * g_dbus_error_register_error_domain:
13711  * @error_domain_quark_name: The error domain name.
13712  * @quark_volatile: A pointer where to store the #GQuark.
13713  * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13714  * @num_entries: Number of items to register.
13715  *
13716  * Helper function for associating a #GError error domain with D-Bus error names.
13717  *
13718  * Since: 2.26
13719  */
13720
13721
13722 /**
13723  * g_dbus_error_set_dbus_error:
13724  * @error: A pointer to a #GError or %NULL.
13725  * @dbus_error_name: D-Bus error name.
13726  * @dbus_error_message: D-Bus error message.
13727  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13728  * @...: Arguments for @format.
13729  *
13730  * Does nothing if @error is %NULL. Otherwise sets *@error to
13731  * a new #GError created with g_dbus_error_new_for_dbus_error()
13732  * with @dbus_error_message prepend with @format (unless %NULL).
13733  *
13734  * Since: 2.26
13735  */
13736
13737
13738 /**
13739  * g_dbus_error_set_dbus_error_valist:
13740  * @error: A pointer to a #GError or %NULL.
13741  * @dbus_error_name: D-Bus error name.
13742  * @dbus_error_message: D-Bus error message.
13743  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13744  * @var_args: Arguments for @format.
13745  *
13746  * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13747  *
13748  * Since: 2.26
13749  */
13750
13751
13752 /**
13753  * g_dbus_error_strip_remote_error:
13754  * @error: A #GError.
13755  *
13756  * Looks for extra information in the error message used to recover
13757  * the D-Bus error name and strips it if found. If stripped, the
13758  * message field in @error will correspond exactly to what was
13759  * received on the wire.
13760  *
13761  * This is typically used when presenting errors to the end user.
13762  *
13763  * Returns: %TRUE if information was stripped, %FALSE otherwise.
13764  * Since: 2.26
13765  */
13766
13767
13768 /**
13769  * g_dbus_error_unregister_error:
13770  * @error_domain: A #GQuark for a error domain.
13771  * @error_code: An error code.
13772  * @dbus_error_name: A D-Bus error name.
13773  *
13774  * Destroys an association previously set up with g_dbus_error_register_error().
13775  *
13776  * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13777  * Since: 2.26
13778  */
13779
13780
13781 /**
13782  * g_dbus_generate_guid:
13783  *
13784  * Generate a D-Bus GUID that can be used with
13785  * e.g. g_dbus_connection_new().
13786  *
13787  * See the D-Bus specification regarding what strings are valid D-Bus
13788  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13789  *
13790  * Returns: A valid D-Bus GUID. Free with g_free().
13791  * Since: 2.26
13792  */
13793
13794
13795 /**
13796  * g_dbus_gvalue_to_gvariant:
13797  * @gvalue: A #GValue to convert to a #GVariant.
13798  * @type: A #GVariantType.
13799  *
13800  * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13801  *
13802  * The conversion is using the following rules:
13803  * <table frame='all'>
13804  *   <title>#GValue / #GVariant conversion rules</title>
13805  *   <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13806  *     <thead>
13807  *       <row>
13808  *         <entry>If the #GType for @gvalue is...</entry>
13809  *         <entry>... then @type must be</entry>
13810  *       </row>
13811  *     </thead>
13812  *     <tbody>
13813  *       <row>
13814  *         <entry>#G_TYPE_STRING</entry>
13815  *         <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>
13816  *       </row>
13817  *       <row>
13818  *         <entry>#G_TYPE_STRV</entry>
13819  *         <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>
13820  *       </row>
13821  *       <row>
13822  *         <entry>#G_TYPE_BOOLEAN</entry>
13823  *         <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13824  *       </row>
13825  *       <row>
13826  *         <entry>#G_TYPE_UCHAR</entry>
13827  *         <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13828  *       </row>
13829  *       <row>
13830  *         <entry>#G_TYPE_INT</entry>
13831  *         <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13832  *       </row>
13833  *       <row>
13834  *         <entry>#G_TYPE_UINT</entry>
13835  *         <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13836  *       </row>
13837  *       <row>
13838  *         <entry>#G_TYPE_INT64</entry>
13839  *         <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13840  *       </row>
13841  *       <row>
13842  *         <entry>#G_TYPE_UINT64</entry>
13843  *         <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13844  *       </row>
13845  *       <row>
13846  *         <entry>#G_TYPE_DOUBLE</entry>
13847  *         <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13848  *       </row>
13849  *       <row>
13850  *         <entry>#G_TYPE_VARIANT</entry>
13851  *         <entry>Any #GVariantType</entry>
13852  *       </row>
13853  *     </tbody>
13854  *   </tgroup>
13855  * </table>
13856  * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13857  * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13858  * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13859  * #G_TYPE_BOXED derived-types) not in the table above.
13860  *
13861  * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13862  * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13863  * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13864  * string for string types, <literal>'/'</literal> for object path
13865  * types, the empty array for any array type and so on).
13866  *
13867  * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13868  * #GVariant to a #GValue.
13869  *
13870  * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13871  * Since: 2.30
13872  */
13873
13874
13875 /**
13876  * g_dbus_gvariant_to_gvalue:
13877  * @value: A #GVariant.
13878  * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13879  *
13880  * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13881  *
13882  * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13883  * used - this function is essentially its reverse form.
13884  *
13885  * The conversion never fails - a valid #GValue is always returned in
13886  * @out_gvalue.
13887  *
13888  * Since: 2.30
13889  */
13890
13891
13892 /**
13893  * g_dbus_interface_dup_object:
13894  * @interface_: An exported D-Bus interface.
13895  *
13896  * Gets the #GDBusObject that @interface_ belongs to, if any.
13897  *
13898  * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13899  * Since: 2.32
13900  * Rename to: g_dbus_interface_get_object
13901  */
13902
13903
13904 /**
13905  * g_dbus_interface_get_info:
13906  * @interface_: An exported D-Bus interface.
13907  *
13908  * Gets D-Bus introspection information for the D-Bus interface
13909  * implemented by @interface_.
13910  *
13911  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13912  * Since: 2.30
13913  */
13914
13915
13916 /**
13917  * g_dbus_interface_get_object: (skip)
13918  * @interface_: An exported D-Bus interface.
13919  *
13920  * Gets the #GDBusObject that @interface_ belongs to, if any.
13921  *
13922  * <warning>It is not safe to use the returned object if @interface_
13923  * or the returned object is being used from other threads. See
13924  * g_dbus_interface_dup_object() for a thread-safe
13925  * alternative.</warning>
13926  *
13927  * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13928  * Since: 2.30
13929  */
13930
13931
13932 /**
13933  * g_dbus_interface_info_cache_build:
13934  * @info: A #GDBusInterfaceInfo.
13935  *
13936  * Builds a lookup-cache to speed up
13937  * g_dbus_interface_info_lookup_method(),
13938  * g_dbus_interface_info_lookup_signal() and
13939  * g_dbus_interface_info_lookup_property().
13940  *
13941  * If this has already been called with @info, the existing cache is
13942  * used and its use count is increased.
13943  *
13944  * Note that @info cannot be modified until
13945  * g_dbus_interface_info_cache_release() is called.
13946  *
13947  * Since: 2.30
13948  */
13949
13950
13951 /**
13952  * g_dbus_interface_info_cache_release:
13953  * @info: A GDBusInterfaceInfo
13954  *
13955  * Decrements the usage count for the cache for @info built by
13956  * g_dbus_interface_info_cache_build() (if any) and frees the
13957  * resources used by the cache if the usage count drops to zero.
13958  *
13959  * Since: 2.30
13960  */
13961
13962
13963 /**
13964  * g_dbus_interface_info_generate_xml:
13965  * @info: A #GDBusNodeInfo
13966  * @indent: Indentation level.
13967  * @string_builder: (out): A #GString to to append XML data to.
13968  *
13969  * Appends an XML representation of @info (and its children) to @string_builder.
13970  *
13971  * This function is typically used for generating introspection XML
13972  * documents at run-time for handling the
13973  * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13974  * method.
13975  *
13976  * Since: 2.26
13977  */
13978
13979
13980 /**
13981  * g_dbus_interface_info_lookup_method:
13982  * @info: A #GDBusInterfaceInfo.
13983  * @name: A D-Bus method name (typically in CamelCase)
13984  *
13985  * Looks up information about a method.
13986  *
13987  * This cost of this function is O(n) in number of methods unless
13988  * g_dbus_interface_info_cache_build() has been used on @info.
13989  *
13990  * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13991  * Since: 2.26
13992  */
13993
13994
13995 /**
13996  * g_dbus_interface_info_lookup_property:
13997  * @info: A #GDBusInterfaceInfo.
13998  * @name: A D-Bus property name (typically in CamelCase).
13999  *
14000  * Looks up information about a property.
14001  *
14002  * This cost of this function is O(n) in number of properties unless
14003  * g_dbus_interface_info_cache_build() has been used on @info.
14004  *
14005  * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
14006  * Since: 2.26
14007  */
14008
14009
14010 /**
14011  * g_dbus_interface_info_lookup_signal:
14012  * @info: A #GDBusInterfaceInfo.
14013  * @name: A D-Bus signal name (typically in CamelCase)
14014  *
14015  * Looks up information about a signal.
14016  *
14017  * This cost of this function is O(n) in number of signals unless
14018  * g_dbus_interface_info_cache_build() has been used on @info.
14019  *
14020  * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
14021  * Since: 2.26
14022  */
14023
14024
14025 /**
14026  * g_dbus_interface_info_ref:
14027  * @info: A #GDBusInterfaceInfo
14028  *
14029  * If @info is statically allocated does nothing. Otherwise increases
14030  * the reference count.
14031  *
14032  * Returns: The same @info.
14033  * Since: 2.26
14034  */
14035
14036
14037 /**
14038  * g_dbus_interface_info_unref:
14039  * @info: A #GDBusInterfaceInfo.
14040  *
14041  * If @info is statically allocated, does nothing. Otherwise decreases
14042  * the reference count of @info. When its reference count drops to 0,
14043  * the memory used is freed.
14044  *
14045  * Since: 2.26
14046  */
14047
14048
14049 /**
14050  * g_dbus_interface_set_object:
14051  * @interface_: An exported D-Bus interface.
14052  * @object: (allow-none): A #GDBusObject or %NULL.
14053  *
14054  * Sets the #GDBusObject for @interface_ to @object.
14055  *
14056  * Note that @interface_ will hold a weak reference to @object.
14057  *
14058  * Since: 2.30
14059  */
14060
14061
14062 /**
14063  * g_dbus_interface_skeleton_export:
14064  * @interface_: The D-Bus interface to export.
14065  * @connection: A #GDBusConnection to export @interface_ on.
14066  * @object_path: The path to export the interface at.
14067  * @error: Return location for error or %NULL.
14068  *
14069  * Exports @interface_ at @object_path on @connection.
14070  *
14071  * This can be called multiple times to export the same @interface_
14072  * onto multiple connections however the @object_path provided must be
14073  * the same for all connections.
14074  *
14075  * Use g_dbus_interface_skeleton_unexport() to unexport the object.
14076  *
14077  * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14078  * Since: 2.30
14079  */
14080
14081
14082 /**
14083  * g_dbus_interface_skeleton_flush:
14084  * @interface_: A #GDBusInterfaceSkeleton.
14085  *
14086  * If @interface_ has outstanding changes, request for these changes to be
14087  * emitted immediately.
14088  *
14089  * For example, an exported D-Bus interface may queue up property
14090  * changes and emit the
14091  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14092  * signal later (e.g. in an idle handler). This technique is useful
14093  * for collapsing multiple property changes into one.
14094  *
14095  * Since: 2.30
14096  */
14097
14098
14099 /**
14100  * g_dbus_interface_skeleton_get_connection:
14101  * @interface_: A #GDBusInterfaceSkeleton.
14102  *
14103  * Gets the first connection that @interface_ is exported on, if any.
14104  *
14105  * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14106  * Since: 2.30
14107  */
14108
14109
14110 /**
14111  * g_dbus_interface_skeleton_get_connections:
14112  * @interface_: A #GDBusInterfaceSkeleton.
14113  *
14114  * Gets a list of the connections that @interface_ is exported on.
14115  *
14116  * 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().
14117  * Since: 2.32
14118  */
14119
14120
14121 /**
14122  * g_dbus_interface_skeleton_get_flags:
14123  * @interface_: A #GDBusInterfaceSkeleton.
14124  *
14125  * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14126  * of @interface_
14127  *
14128  * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14129  * Since: 2.30
14130  */
14131
14132
14133 /**
14134  * g_dbus_interface_skeleton_get_info:
14135  * @interface_: A #GDBusInterfaceSkeleton.
14136  *
14137  * Gets D-Bus introspection information for the D-Bus interface
14138  * implemented by @interface_.
14139  *
14140  * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14141  * Since: 2.30
14142  */
14143
14144
14145 /**
14146  * g_dbus_interface_skeleton_get_object_path:
14147  * @interface_: A #GDBusInterfaceSkeleton.
14148  *
14149  * Gets the object path that @interface_ is exported on, if any.
14150  *
14151  * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14152  * Since: 2.30
14153  */
14154
14155
14156 /**
14157  * g_dbus_interface_skeleton_get_properties:
14158  * @interface_: A #GDBusInterfaceSkeleton.
14159  *
14160  * Gets all D-Bus properties for @interface_.
14161  *
14162  * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14163  * Since: 2.30
14164  */
14165
14166
14167 /**
14168  * g_dbus_interface_skeleton_get_vtable: (skip)
14169  * @interface_: A #GDBusInterfaceSkeleton.
14170  *
14171  * Gets the interface vtable for the D-Bus interface implemented by
14172  * @interface_. The returned function pointers should expect @interface_
14173  * itself to be passed as @user_data.
14174  *
14175  * Returns: A #GDBusInterfaceVTable (never %NULL).
14176  * Since: 2.30
14177  */
14178
14179
14180 /**
14181  * g_dbus_interface_skeleton_has_connection:
14182  * @interface_: A #GDBusInterfaceSkeleton.
14183  * @connection: A #GDBusConnection.
14184  *
14185  * Checks if @interface_ is export on @connection.
14186  *
14187  * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14188  * Since: 2.32
14189  */
14190
14191
14192 /**
14193  * g_dbus_interface_skeleton_set_flags:
14194  * @interface_: A #GDBusInterfaceSkeleton.
14195  * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14196  *
14197  * Sets flags describing what the behavior of @skeleton should be.
14198  *
14199  * Since: 2.30
14200  */
14201
14202
14203 /**
14204  * g_dbus_interface_skeleton_unexport:
14205  * @interface_: A #GDBusInterfaceSkeleton.
14206  *
14207  * Stops exporting @interface_ on all connections it is exported on.
14208  *
14209  * To unexport @interface_ from only a single connection, use
14210  * g_dbus_interface_skeleton_unexport_from_connection()
14211  *
14212  * Since: 2.30
14213  */
14214
14215
14216 /**
14217  * g_dbus_interface_skeleton_unexport_from_connection:
14218  * @interface_: A #GDBusInterfaceSkeleton.
14219  * @connection: A #GDBusConnection.
14220  *
14221  * Stops exporting @interface_ on @connection.
14222  *
14223  * To stop exporting on all connections the interface is exported on,
14224  * use g_dbus_interface_skeleton_unexport().
14225  *
14226  * Since: 2.32
14227  */
14228
14229
14230 /**
14231  * g_dbus_is_address:
14232  * @string: A string.
14233  *
14234  * Checks if @string is a D-Bus address.
14235  *
14236  * This doesn't check if @string is actually supported by #GDBusServer
14237  * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14238  * checks.
14239  *
14240  * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14241  * Since: 2.26
14242  */
14243
14244
14245 /**
14246  * g_dbus_is_guid:
14247  * @string: The string to check.
14248  *
14249  * Checks if @string is a D-Bus GUID.
14250  *
14251  * See the D-Bus specification regarding what strings are valid D-Bus
14252  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14253  *
14254  * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14255  * Since: 2.26
14256  */
14257
14258
14259 /**
14260  * g_dbus_is_interface_name:
14261  * @string: The string to check.
14262  *
14263  * Checks if @string is a valid D-Bus interface name.
14264  *
14265  * Returns: %TRUE if valid, %FALSE otherwise.
14266  * Since: 2.26
14267  */
14268
14269
14270 /**
14271  * g_dbus_is_member_name:
14272  * @string: The string to check.
14273  *
14274  * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14275  *
14276  * Returns: %TRUE if valid, %FALSE otherwise.
14277  * Since: 2.26
14278  */
14279
14280
14281 /**
14282  * g_dbus_is_name:
14283  * @string: The string to check.
14284  *
14285  * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14286  *
14287  * Returns: %TRUE if valid, %FALSE otherwise.
14288  * Since: 2.26
14289  */
14290
14291
14292 /**
14293  * g_dbus_is_supported_address:
14294  * @string: A string.
14295  * @error: Return location for error or %NULL.
14296  *
14297  * Like g_dbus_is_address() but also checks if the library suppors the
14298  * transports in @string and that key/value pairs for each transport
14299  * are valid.
14300  *
14301  * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14302  * Since: 2.26
14303  */
14304
14305
14306 /**
14307  * g_dbus_is_unique_name:
14308  * @string: The string to check.
14309  *
14310  * Checks if @string is a valid D-Bus unique bus name.
14311  *
14312  * Returns: %TRUE if valid, %FALSE otherwise.
14313  * Since: 2.26
14314  */
14315
14316
14317 /**
14318  * g_dbus_menu_model_get:
14319  * @connection: a #GDBusConnection
14320  * @bus_name: the bus name which exports the menu model
14321  * @object_path: the object path at which the menu model is exported
14322  *
14323  * Obtains a #GDBusMenuModel for the menu model which is exported
14324  * at the given @bus_name and @object_path.
14325  *
14326  * The thread default main context is taken at the time of this call.
14327  * All signals on the menu model (and any linked models) are reported
14328  * with respect to this context.  All calls on the returned menu model
14329  * (and linked models) must also originate from this same context, with
14330  * the thread default main context unchanged.
14331  *
14332  * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14333  * Since: 2.32
14334  */
14335
14336
14337 /**
14338  * g_dbus_message_bytes_needed:
14339  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14340  * @blob_len: The length of @blob (must be at least 16).
14341  * @error: Return location for error or %NULL.
14342  *
14343  * Utility function to calculate how many bytes are needed to
14344  * completely deserialize the D-Bus message stored at @blob.
14345  *
14346  * 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).
14347  * Since: 2.26
14348  */
14349
14350
14351 /**
14352  * g_dbus_message_copy:
14353  * @message: A #GDBusMessage.
14354  * @error: Return location for error or %NULL.
14355  *
14356  * Copies @message. The copy is a deep copy and the returned
14357  * #GDBusMessage is completely identical except that it is guaranteed
14358  * to not be locked.
14359  *
14360  * This operation can fail if e.g. @message contains file descriptors
14361  * and the per-process or system-wide open files limit is reached.
14362  *
14363  * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14364  * Since: 2.26
14365  */
14366
14367
14368 /**
14369  * g_dbus_message_get_arg0:
14370  * @message: A #GDBusMessage.
14371  *
14372  * Convenience to get the first item in the body of @message.
14373  *
14374  * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14375  * Since: 2.26
14376  */
14377
14378
14379 /**
14380  * g_dbus_message_get_body:
14381  * @message: A #GDBusMessage.
14382  *
14383  * Gets the body of a message.
14384  *
14385  * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14386  * Since: 2.26
14387  */
14388
14389
14390 /**
14391  * g_dbus_message_get_byte_order:
14392  * @message: A #GDBusMessage.
14393  *
14394  * Gets the byte order of @message.
14395  *
14396  * Returns: The byte order.
14397  */
14398
14399
14400 /**
14401  * g_dbus_message_get_destination:
14402  * @message: A #GDBusMessage.
14403  *
14404  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14405  *
14406  * Returns: The value.
14407  * Since: 2.26
14408  */
14409
14410
14411 /**
14412  * g_dbus_message_get_error_name:
14413  * @message: A #GDBusMessage.
14414  *
14415  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14416  *
14417  * Returns: The value.
14418  * Since: 2.26
14419  */
14420
14421
14422 /**
14423  * g_dbus_message_get_flags:
14424  * @message: A #GDBusMessage.
14425  *
14426  * Gets the flags for @message.
14427  *
14428  * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14429  * Since: 2.26
14430  */
14431
14432
14433 /**
14434  * g_dbus_message_get_header:
14435  * @message: A #GDBusMessage.
14436  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14437  *
14438  * Gets a header field on @message.
14439  *
14440  * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14441  * Since: 2.26
14442  */
14443
14444
14445 /**
14446  * g_dbus_message_get_header_fields:
14447  * @message: A #GDBusMessage.
14448  *
14449  * Gets an array of all header fields on @message that are set.
14450  *
14451  * 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().
14452  * Since: 2.26
14453  */
14454
14455
14456 /**
14457  * g_dbus_message_get_interface:
14458  * @message: A #GDBusMessage.
14459  *
14460  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14461  *
14462  * Returns: The value.
14463  * Since: 2.26
14464  */
14465
14466
14467 /**
14468  * g_dbus_message_get_locked:
14469  * @message: A #GDBusMessage.
14470  *
14471  * Checks whether @message is locked. To monitor changes to this
14472  * value, conncet to the #GObject::notify signal to listen for changes
14473  * on the #GDBusMessage:locked property.
14474  *
14475  * Returns: %TRUE if @message is locked, %FALSE otherwise.
14476  * Since: 2.26
14477  */
14478
14479
14480 /**
14481  * g_dbus_message_get_member:
14482  * @message: A #GDBusMessage.
14483  *
14484  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14485  *
14486  * Returns: The value.
14487  * Since: 2.26
14488  */
14489
14490
14491 /**
14492  * g_dbus_message_get_message_type:
14493  * @message: A #GDBusMessage.
14494  *
14495  * Gets the type of @message.
14496  *
14497  * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14498  * Since: 2.26
14499  */
14500
14501
14502 /**
14503  * g_dbus_message_get_num_unix_fds:
14504  * @message: A #GDBusMessage.
14505  *
14506  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14507  *
14508  * Returns: The value.
14509  * Since: 2.26
14510  */
14511
14512
14513 /**
14514  * g_dbus_message_get_path:
14515  * @message: A #GDBusMessage.
14516  *
14517  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14518  *
14519  * Returns: The value.
14520  * Since: 2.26
14521  */
14522
14523
14524 /**
14525  * g_dbus_message_get_reply_serial:
14526  * @message: A #GDBusMessage.
14527  *
14528  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14529  *
14530  * Returns: The value.
14531  * Since: 2.26
14532  */
14533
14534
14535 /**
14536  * g_dbus_message_get_sender:
14537  * @message: A #GDBusMessage.
14538  *
14539  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14540  *
14541  * Returns: The value.
14542  * Since: 2.26
14543  */
14544
14545
14546 /**
14547  * g_dbus_message_get_serial:
14548  * @message: A #GDBusMessage.
14549  *
14550  * Gets the serial for @message.
14551  *
14552  * Returns: A #guint32.
14553  * Since: 2.26
14554  */
14555
14556
14557 /**
14558  * g_dbus_message_get_signature:
14559  * @message: A #GDBusMessage.
14560  *
14561  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14562  *
14563  * Returns: The value.
14564  * Since: 2.26
14565  */
14566
14567
14568 /**
14569  * g_dbus_message_get_unix_fd_list:
14570  * @message: A #GDBusMessage.
14571  *
14572  * Gets the UNIX file descriptors associated with @message, if any.
14573  *
14574  * This method is only available on UNIX.
14575  *
14576  * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14577  * Since: 2.26
14578  */
14579
14580
14581 /**
14582  * g_dbus_message_lock:
14583  * @message: A #GDBusMessage.
14584  *
14585  * If @message is locked, does nothing. Otherwise locks the message.
14586  *
14587  * Since: 2.26
14588  */
14589
14590
14591 /**
14592  * g_dbus_message_new:
14593  *
14594  * Creates a new empty #GDBusMessage.
14595  *
14596  * Returns: A #GDBusMessage. Free with g_object_unref().
14597  * Since: 2.26
14598  */
14599
14600
14601 /**
14602  * g_dbus_message_new_from_blob:
14603  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14604  * @blob_len: The length of @blob.
14605  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14606  * @error: Return location for error or %NULL.
14607  *
14608  * Creates a new #GDBusMessage from the data stored at @blob. The byte
14609  * order that the message was in can be retrieved using
14610  * g_dbus_message_get_byte_order().
14611  *
14612  * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14613  * Since: 2.26
14614  */
14615
14616
14617 /**
14618  * g_dbus_message_new_method_call:
14619  * @name: (allow-none): A valid D-Bus name or %NULL.
14620  * @path: A valid object path.
14621  * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14622  * @method: A valid method name.
14623  *
14624  * Creates a new #GDBusMessage for a method call.
14625  *
14626  * Returns: A #GDBusMessage. Free with g_object_unref().
14627  * Since: 2.26
14628  */
14629
14630
14631 /**
14632  * g_dbus_message_new_method_error:
14633  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14634  * @error_name: A valid D-Bus error name.
14635  * @error_message_format: The D-Bus error message in a printf() format.
14636  * @...: Arguments for @error_message_format.
14637  *
14638  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14639  *
14640  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14641  * Since: 2.26
14642  */
14643
14644
14645 /**
14646  * g_dbus_message_new_method_error_literal:
14647  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14648  * @error_name: A valid D-Bus error name.
14649  * @error_message: The D-Bus error message.
14650  *
14651  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14652  *
14653  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14654  * Since: 2.26
14655  */
14656
14657
14658 /**
14659  * g_dbus_message_new_method_error_valist:
14660  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14661  * @error_name: A valid D-Bus error name.
14662  * @error_message_format: The D-Bus error message in a printf() format.
14663  * @var_args: Arguments for @error_message_format.
14664  *
14665  * Like g_dbus_message_new_method_error() but intended for language bindings.
14666  *
14667  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14668  * Since: 2.26
14669  */
14670
14671
14672 /**
14673  * g_dbus_message_new_method_reply:
14674  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14675  *
14676  * Creates a new #GDBusMessage that is a reply to @method_call_message.
14677  *
14678  * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14679  * Since: 2.26
14680  */
14681
14682
14683 /**
14684  * g_dbus_message_new_signal:
14685  * @path: A valid object path.
14686  * @interface_: A valid D-Bus interface name.
14687  * @signal: A valid signal name.
14688  *
14689  * Creates a new #GDBusMessage for a signal emission.
14690  *
14691  * Returns: A #GDBusMessage. Free with g_object_unref().
14692  * Since: 2.26
14693  */
14694
14695
14696 /**
14697  * g_dbus_message_print:
14698  * @message: A #GDBusMessage.
14699  * @indent: Indentation level.
14700  *
14701  * Produces a human-readable multi-line description of @message.
14702  *
14703  * The contents of the description has no ABI guarantees, the contents
14704  * and formatting is subject to change at any time. Typical output
14705  * looks something like this:
14706  * <programlisting>
14707  * Type&colon;    method-call
14708  * Flags&colon;   none
14709  * Version&colon; 0
14710  * Serial&colon;  4
14711  * Headers&colon;
14712  *   path -> objectpath '/org/gtk/GDBus/TestObject'
14713  *   interface -> 'org.gtk.GDBus.TestInterface'
14714  *   member -> 'GimmeStdout'
14715  *   destination -> ':1.146'
14716  * Body&colon; ()
14717  * UNIX File Descriptors:
14718  *   (none)
14719  * </programlisting>
14720  * or
14721  * <programlisting>
14722  * Type&colon;    method-return
14723  * Flags&colon;   no-reply-expected
14724  * Version&colon; 0
14725  * Serial&colon;  477
14726  * Headers&colon;
14727  *   reply-serial -> uint32 4
14728  *   destination -> ':1.159'
14729  *   sender -> ':1.146'
14730  *   num-unix-fds -> uint32 1
14731  * Body&colon; ()
14732  * UNIX File Descriptors&colon;
14733  *   fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14734  * </programlisting>
14735  *
14736  * Returns: A string that should be freed with g_free().
14737  * Since: 2.26
14738  */
14739
14740
14741 /**
14742  * g_dbus_message_set_body:
14743  * @message: A #GDBusMessage.
14744  * @body: Either %NULL or a #GVariant that is a tuple.
14745  *
14746  * Sets the body @message. As a side-effect the
14747  * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14748  * type string of @body (or cleared if @body is %NULL).
14749  *
14750  * If @body is floating, @message assumes ownership of @body.
14751  *
14752  * Since: 2.26
14753  */
14754
14755
14756 /**
14757  * g_dbus_message_set_byte_order:
14758  * @message: A #GDBusMessage.
14759  * @byte_order: The byte order.
14760  *
14761  * Sets the byte order of @message.
14762  */
14763
14764
14765 /**
14766  * g_dbus_message_set_destination:
14767  * @message: A #GDBusMessage.
14768  * @value: The value to set.
14769  *
14770  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14771  *
14772  * Since: 2.26
14773  */
14774
14775
14776 /**
14777  * g_dbus_message_set_error_name:
14778  * @message: A #GDBusMessage.
14779  * @value: The value to set.
14780  *
14781  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14782  *
14783  * Since: 2.26
14784  */
14785
14786
14787 /**
14788  * g_dbus_message_set_flags:
14789  * @message: A #GDBusMessage.
14790  * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14791  *
14792  * Sets the flags to set on @message.
14793  *
14794  * Since: 2.26
14795  */
14796
14797
14798 /**
14799  * g_dbus_message_set_header:
14800  * @message: A #GDBusMessage.
14801  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14802  * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14803  *
14804  * Sets a header field on @message.
14805  *
14806  * If @value is floating, @message assumes ownership of @value.
14807  *
14808  * Since: 2.26
14809  */
14810
14811
14812 /**
14813  * g_dbus_message_set_interface:
14814  * @message: A #GDBusMessage.
14815  * @value: The value to set.
14816  *
14817  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14818  *
14819  * Since: 2.26
14820  */
14821
14822
14823 /**
14824  * g_dbus_message_set_member:
14825  * @message: A #GDBusMessage.
14826  * @value: The value to set.
14827  *
14828  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14829  *
14830  * Since: 2.26
14831  */
14832
14833
14834 /**
14835  * g_dbus_message_set_message_type:
14836  * @message: A #GDBusMessage.
14837  * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14838  *
14839  * Sets @message to be of @type.
14840  *
14841  * Since: 2.26
14842  */
14843
14844
14845 /**
14846  * g_dbus_message_set_num_unix_fds:
14847  * @message: A #GDBusMessage.
14848  * @value: The value to set.
14849  *
14850  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14851  *
14852  * Since: 2.26
14853  */
14854
14855
14856 /**
14857  * g_dbus_message_set_path:
14858  * @message: A #GDBusMessage.
14859  * @value: The value to set.
14860  *
14861  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14862  *
14863  * Since: 2.26
14864  */
14865
14866
14867 /**
14868  * g_dbus_message_set_reply_serial:
14869  * @message: A #GDBusMessage.
14870  * @value: The value to set.
14871  *
14872  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14873  *
14874  * Since: 2.26
14875  */
14876
14877
14878 /**
14879  * g_dbus_message_set_sender:
14880  * @message: A #GDBusMessage.
14881  * @value: The value to set.
14882  *
14883  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14884  *
14885  * Since: 2.26
14886  */
14887
14888
14889 /**
14890  * g_dbus_message_set_serial:
14891  * @message: A #GDBusMessage.
14892  * @serial: A #guint32.
14893  *
14894  * Sets the serial for @message.
14895  *
14896  * Since: 2.26
14897  */
14898
14899
14900 /**
14901  * g_dbus_message_set_signature:
14902  * @message: A #GDBusMessage.
14903  * @value: The value to set.
14904  *
14905  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14906  *
14907  * Since: 2.26
14908  */
14909
14910
14911 /**
14912  * g_dbus_message_set_unix_fd_list:
14913  * @message: A #GDBusMessage.
14914  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14915  *
14916  * Sets the UNIX file descriptors associated with @message. As a
14917  * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14918  * field is set to the number of fds in @fd_list (or cleared if
14919  * @fd_list is %NULL).
14920  *
14921  * This method is only available on UNIX.
14922  *
14923  * Since: 2.26
14924  */
14925
14926
14927 /**
14928  * g_dbus_message_to_blob:
14929  * @message: A #GDBusMessage.
14930  * @out_size: Return location for size of generated blob.
14931  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14932  * @error: Return location for error.
14933  *
14934  * Serializes @message to a blob. The byte order returned by
14935  * g_dbus_message_get_byte_order() will be used.
14936  *
14937  * 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().
14938  * Since: 2.26
14939  */
14940
14941
14942 /**
14943  * g_dbus_message_to_gerror:
14944  * @message: A #GDBusMessage.
14945  * @error: The #GError to set.
14946  *
14947  * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14948  * nothing and returns %FALSE.
14949  *
14950  * Otherwise this method encodes the error in @message as a #GError
14951  * using g_dbus_error_set_dbus_error() using the information in the
14952  * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14953  * well as the first string item in @message's body.
14954  *
14955  * Returns: %TRUE if @error was set, %FALSE otherwise.
14956  * Since: 2.26
14957  */
14958
14959
14960 /**
14961  * g_dbus_method_info_ref:
14962  * @info: A #GDBusMethodInfo
14963  *
14964  * If @info is statically allocated does nothing. Otherwise increases
14965  * the reference count.
14966  *
14967  * Returns: The same @info.
14968  * Since: 2.26
14969  */
14970
14971
14972 /**
14973  * g_dbus_method_info_unref:
14974  * @info: A #GDBusMethodInfo.
14975  *
14976  * If @info is statically allocated, does nothing. Otherwise decreases
14977  * the reference count of @info. When its reference count drops to 0,
14978  * the memory used is freed.
14979  *
14980  * Since: 2.26
14981  */
14982
14983
14984 /**
14985  * g_dbus_method_invocation_get_connection:
14986  * @invocation: A #GDBusMethodInvocation.
14987  *
14988  * Gets the #GDBusConnection the method was invoked on.
14989  *
14990  * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14991  * Since: 2.26
14992  */
14993
14994
14995 /**
14996  * g_dbus_method_invocation_get_interface_name:
14997  * @invocation: A #GDBusMethodInvocation.
14998  *
14999  * Gets the name of the D-Bus interface the method was invoked on.
15000  *
15001  * Returns: A string. Do not free, it is owned by @invocation.
15002  * Since: 2.26
15003  */
15004
15005
15006 /**
15007  * g_dbus_method_invocation_get_message:
15008  * @invocation: A #GDBusMethodInvocation.
15009  *
15010  * Gets the #GDBusMessage for the method invocation. This is useful if
15011  * you need to use low-level protocol features, such as UNIX file
15012  * descriptor passing, that cannot be properly expressed in the
15013  * #GVariant API.
15014  *
15015  * See <xref linkend="gdbus-server"/> and <xref
15016  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
15017  * low-level API to send and receive UNIX file descriptors.
15018  *
15019  * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
15020  * Since: 2.26
15021  */
15022
15023
15024 /**
15025  * g_dbus_method_invocation_get_method_info:
15026  * @invocation: A #GDBusMethodInvocation.
15027  *
15028  * Gets information about the method call, if any.
15029  *
15030  * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
15031  * Since: 2.26
15032  */
15033
15034
15035 /**
15036  * g_dbus_method_invocation_get_method_name:
15037  * @invocation: A #GDBusMethodInvocation.
15038  *
15039  * Gets the name of the method that was invoked.
15040  *
15041  * Returns: A string. Do not free, it is owned by @invocation.
15042  * Since: 2.26
15043  */
15044
15045
15046 /**
15047  * g_dbus_method_invocation_get_object_path:
15048  * @invocation: A #GDBusMethodInvocation.
15049  *
15050  * Gets the object path the method was invoked on.
15051  *
15052  * Returns: A string. Do not free, it is owned by @invocation.
15053  * Since: 2.26
15054  */
15055
15056
15057 /**
15058  * g_dbus_method_invocation_get_parameters:
15059  * @invocation: A #GDBusMethodInvocation.
15060  *
15061  * Gets the parameters of the method invocation. If there are no input
15062  * parameters then this will return a GVariant with 0 children rather than NULL.
15063  *
15064  * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
15065  * Since: 2.26
15066  */
15067
15068
15069 /**
15070  * g_dbus_method_invocation_get_sender:
15071  * @invocation: A #GDBusMethodInvocation.
15072  *
15073  * Gets the bus name that invoked the method.
15074  *
15075  * Returns: A string. Do not free, it is owned by @invocation.
15076  * Since: 2.26
15077  */
15078
15079
15080 /**
15081  * g_dbus_method_invocation_get_user_data: (skip)
15082  * @invocation: A #GDBusMethodInvocation.
15083  *
15084  * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15085  *
15086  * Returns: A #gpointer.
15087  * Since: 2.26
15088  */
15089
15090
15091 /**
15092  * g_dbus_method_invocation_return_dbus_error:
15093  * @invocation: (transfer full): A #GDBusMethodInvocation.
15094  * @error_name: A valid D-Bus error name.
15095  * @error_message: A valid D-Bus error message.
15096  *
15097  * Finishes handling a D-Bus method call by returning an error.
15098  *
15099  * This method will free @invocation, you cannot use it afterwards.
15100  *
15101  * Since: 2.26
15102  */
15103
15104
15105 /**
15106  * g_dbus_method_invocation_return_error:
15107  * @invocation: (transfer full): A #GDBusMethodInvocation.
15108  * @domain: A #GQuark for the #GError error domain.
15109  * @code: The error code.
15110  * @format: printf()-style format.
15111  * @...: Parameters for @format.
15112  *
15113  * Finishes handling a D-Bus method call by returning an error.
15114  *
15115  * See g_dbus_error_encode_gerror() for details about what error name
15116  * will be returned on the wire. In a nutshell, if the given error is
15117  * registered using g_dbus_error_register_error() the name given
15118  * during registration is used. Otherwise, a name of the form
15119  * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15120  * used. This provides transparent mapping of #GError between
15121  * applications using GDBus.
15122  *
15123  * If you are writing an application intended to be portable,
15124  * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15125  * or use g_dbus_method_invocation_return_dbus_error().
15126  *
15127  * This method will free @invocation, you cannot use it afterwards.
15128  *
15129  * Since: 2.26
15130  */
15131
15132
15133 /**
15134  * g_dbus_method_invocation_return_error_literal:
15135  * @invocation: (transfer full): A #GDBusMethodInvocation.
15136  * @domain: A #GQuark for the #GError error domain.
15137  * @code: The error code.
15138  * @message: The error message.
15139  *
15140  * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15141  *
15142  * This method will free @invocation, you cannot use it afterwards.
15143  *
15144  * Since: 2.26
15145  */
15146
15147
15148 /**
15149  * g_dbus_method_invocation_return_error_valist:
15150  * @invocation: (transfer full): A #GDBusMethodInvocation.
15151  * @domain: A #GQuark for the #GError error domain.
15152  * @code: The error code.
15153  * @format: printf()-style format.
15154  * @var_args: #va_list of parameters for @format.
15155  *
15156  * Like g_dbus_method_invocation_return_error() but intended for
15157  * language bindings.
15158  *
15159  * This method will free @invocation, you cannot use it afterwards.
15160  *
15161  * Since: 2.26
15162  */
15163
15164
15165 /**
15166  * g_dbus_method_invocation_return_gerror:
15167  * @invocation: (transfer full): A #GDBusMethodInvocation.
15168  * @error: A #GError.
15169  *
15170  * Like g_dbus_method_invocation_return_error() but takes a #GError
15171  * instead of the error domain, error code and message.
15172  *
15173  * This method will free @invocation, you cannot use it afterwards.
15174  *
15175  * Since: 2.26
15176  */
15177
15178
15179 /**
15180  * g_dbus_method_invocation_return_value:
15181  * @invocation: (transfer full): A #GDBusMethodInvocation.
15182  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15183  *
15184  * Finishes handling a D-Bus method call by returning @parameters.
15185  * If the @parameters GVariant is floating, it is consumed.
15186  *
15187  * It is an error if @parameters is not of the right format.
15188  *
15189  * This method will free @invocation, you cannot use it afterwards.
15190  *
15191  * Since: 2.26
15192  */
15193
15194
15195 /**
15196  * g_dbus_method_invocation_return_value_with_unix_fd_list:
15197  * @invocation: (transfer full): A #GDBusMethodInvocation.
15198  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15199  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15200  *
15201  * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15202  *
15203  * This method is only available on UNIX.
15204  *
15205  * This method will free @invocation, you cannot use it afterwards.
15206  *
15207  * Since: 2.30
15208  */
15209
15210
15211 /**
15212  * g_dbus_method_invocation_take_error: (skip)
15213  * @invocation: (transfer full): A #GDBusMethodInvocation.
15214  * @error: (transfer full): A #GError.
15215  *
15216  * Like g_dbus_method_invocation_return_gerror() but takes ownership
15217  * of @error so the caller does not need to free it.
15218  *
15219  * This method will free @invocation, you cannot use it afterwards.
15220  *
15221  * Since: 2.30
15222  */
15223
15224
15225 /**
15226  * g_dbus_node_info_generate_xml:
15227  * @info: A #GDBusNodeInfo.
15228  * @indent: Indentation level.
15229  * @string_builder: (out): A #GString to to append XML data to.
15230  *
15231  * Appends an XML representation of @info (and its children) to @string_builder.
15232  *
15233  * This function is typically used for generating introspection XML documents at run-time for
15234  * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15235  *
15236  * Since: 2.26
15237  */
15238
15239
15240 /**
15241  * g_dbus_node_info_lookup_interface:
15242  * @info: A #GDBusNodeInfo.
15243  * @name: A D-Bus interface name.
15244  *
15245  * Looks up information about an interface.
15246  *
15247  * This cost of this function is O(n) in number of interfaces.
15248  *
15249  * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15250  * Since: 2.26
15251  */
15252
15253
15254 /**
15255  * g_dbus_node_info_new_for_xml:
15256  * @xml_data: Valid D-Bus introspection XML.
15257  * @error: Return location for error.
15258  *
15259  * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15260  *
15261  * The introspection XML must contain exactly one top-level
15262  * <tag class="starttag">node</tag> element.
15263  *
15264  * Note that this routine is using a
15265  * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15266  * parser that only accepts a subset of valid XML documents.
15267  *
15268  * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15269  * Since: 2.26
15270  */
15271
15272
15273 /**
15274  * g_dbus_node_info_ref:
15275  * @info: A #GDBusNodeInfo
15276  *
15277  * If @info is statically allocated does nothing. Otherwise increases
15278  * the reference count.
15279  *
15280  * Returns: The same @info.
15281  * Since: 2.26
15282  */
15283
15284
15285 /**
15286  * g_dbus_node_info_unref:
15287  * @info: A #GDBusNodeInfo.
15288  *
15289  * If @info is statically allocated, does nothing. Otherwise decreases
15290  * the reference count of @info. When its reference count drops to 0,
15291  * the memory used is freed.
15292  *
15293  * Since: 2.26
15294  */
15295
15296
15297 /**
15298  * g_dbus_object_get_interface:
15299  * @object: A #GDBusObject.
15300  * @interface_name: A D-Bus interface name.
15301  *
15302  * Gets the D-Bus interface with name @interface_name associated with
15303  * @object, if any.
15304  *
15305  * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15306  * Since: 2.30
15307  */
15308
15309
15310 /**
15311  * g_dbus_object_get_interfaces:
15312  * @object: A #GDBusObject.
15313  *
15314  * Gets the D-Bus interfaces associated with @object.
15315  *
15316  * 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().
15317  * Since: 2.30
15318  */
15319
15320
15321 /**
15322  * g_dbus_object_get_object_path:
15323  * @object: A #GDBusObject.
15324  *
15325  * Gets the object path for @object.
15326  *
15327  * Returns: A string owned by @object. Do not free.
15328  * Since: 2.30
15329  */
15330
15331
15332 /**
15333  * g_dbus_object_manager_client_get_connection:
15334  * @manager: A #GDBusObjectManagerClient
15335  *
15336  * Gets the #GDBusConnection used by @manager.
15337  *
15338  * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15339  * Since: 2.30
15340  */
15341
15342
15343 /**
15344  * g_dbus_object_manager_client_get_flags:
15345  * @manager: A #GDBusObjectManagerClient
15346  *
15347  * Gets the flags that @manager was constructed with.
15348  *
15349  * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15350  * Since: 2.30
15351  */
15352
15353
15354 /**
15355  * g_dbus_object_manager_client_get_name:
15356  * @manager: A #GDBusObjectManagerClient
15357  *
15358  * Gets the name that @manager is for.
15359  *
15360  * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15361  * Since: 2.30
15362  */
15363
15364
15365 /**
15366  * g_dbus_object_manager_client_get_name_owner:
15367  * @manager: A #GDBusObjectManagerClient.
15368  *
15369  * The unique name that owns the name that @manager is for or %NULL if
15370  * no-one currently owns that name. You can connect to the
15371  * #GObject::notify signal to track changes to the
15372  * #GDBusObjectManagerClient:name-owner property.
15373  *
15374  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15375  * Since: 2.30
15376  */
15377
15378
15379 /**
15380  * g_dbus_object_manager_client_new:
15381  * @connection: A #GDBusConnection.
15382  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15383  * @name: The owner of the control object (unique or well-known name).
15384  * @object_path: The object path of the control object.
15385  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15386  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15387  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15388  * @cancellable: (allow-none): A #GCancellable or %NULL
15389  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15390  * @user_data: The data to pass to @callback.
15391  *
15392  * Asynchronously creates a new #GDBusObjectManagerClient object.
15393  *
15394  * This is an asynchronous failable constructor. When the result is
15395  * ready, @callback will be invoked in the
15396  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15397  * of the thread you are calling this method from. You can
15398  * then call g_dbus_object_manager_client_new_finish() to get the result. See
15399  * g_dbus_object_manager_client_new_sync() for the synchronous version.
15400  *
15401  * Since: 2.30
15402  */
15403
15404
15405 /**
15406  * g_dbus_object_manager_client_new_finish:
15407  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15408  * @error: Return location for error or %NULL.
15409  *
15410  * Finishes an operation started with g_dbus_object_manager_client_new().
15411  *
15412  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15413  * Since: 2.30
15414  */
15415
15416
15417 /**
15418  * g_dbus_object_manager_client_new_for_bus:
15419  * @bus_type: A #GBusType.
15420  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15421  * @name: The owner of the control object (unique or well-known name).
15422  * @object_path: The object path of the control object.
15423  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15424  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15425  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15426  * @cancellable: (allow-none): A #GCancellable or %NULL
15427  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15428  * @user_data: The data to pass to @callback.
15429  *
15430  * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15431  * #GDBusConnection.
15432  *
15433  * This is an asynchronous failable constructor. When the result is
15434  * ready, @callback will be invoked in the
15435  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15436  * of the thread you are calling this method from. You can
15437  * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15438  * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15439  *
15440  * Since: 2.30
15441  */
15442
15443
15444 /**
15445  * g_dbus_object_manager_client_new_for_bus_finish:
15446  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15447  * @error: Return location for error or %NULL.
15448  *
15449  * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15450  *
15451  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15452  * Since: 2.30
15453  */
15454
15455
15456 /**
15457  * g_dbus_object_manager_client_new_for_bus_sync:
15458  * @bus_type: A #GBusType.
15459  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15460  * @name: The owner of the control object (unique or well-known name).
15461  * @object_path: The object path of the control object.
15462  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15463  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15464  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15465  * @cancellable: (allow-none): A #GCancellable or %NULL
15466  * @error: Return location for error or %NULL.
15467  *
15468  * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15469  * of a #GDBusConnection.
15470  *
15471  * This is a synchronous failable constructor - the calling thread is
15472  * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15473  * for the asynchronous version.
15474  *
15475  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15476  * Since: 2.30
15477  */
15478
15479
15480 /**
15481  * g_dbus_object_manager_client_new_sync:
15482  * @connection: A #GDBusConnection.
15483  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15484  * @name: The owner of the control object (unique or well-known name).
15485  * @object_path: The object path of the control object.
15486  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15487  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15488  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15489  * @cancellable: (allow-none): A #GCancellable or %NULL
15490  * @error: Return location for error or %NULL.
15491  *
15492  * Creates a new #GDBusObjectManagerClient object.
15493  *
15494  * This is a synchronous failable constructor - the calling thread is
15495  * blocked until a reply is received. See g_dbus_object_manager_client_new()
15496  * for the asynchronous version.
15497  *
15498  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15499  * Since: 2.30
15500  */
15501
15502
15503 /**
15504  * g_dbus_object_manager_get_interface:
15505  * @manager: A #GDBusObjectManager.
15506  * @object_path: Object path to lookup.
15507  * @interface_name: D-Bus interface name to lookup.
15508  *
15509  * Gets the interface proxy for @interface_name at @object_path, if
15510  * any.
15511  *
15512  * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15513  * Since: 2.30
15514  */
15515
15516
15517 /**
15518  * g_dbus_object_manager_get_object:
15519  * @manager: A #GDBusObjectManager.
15520  * @object_path: Object path to lookup.
15521  *
15522  * Gets the #GDBusObjectProxy at @object_path, if any.
15523  *
15524  * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15525  * Since: 2.30
15526  */
15527
15528
15529 /**
15530  * g_dbus_object_manager_get_object_path:
15531  * @manager: A #GDBusObjectManager.
15532  *
15533  * Gets the object path that @manager is for.
15534  *
15535  * Returns: A string owned by @manager. Do not free.
15536  * Since: 2.30
15537  */
15538
15539
15540 /**
15541  * g_dbus_object_manager_get_objects:
15542  * @manager: A #GDBusObjectManager.
15543  *
15544  * Gets all #GDBusObject objects known to @manager.
15545  *
15546  * 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().
15547  * Since: 2.30
15548  */
15549
15550
15551 /**
15552  * g_dbus_object_manager_server_export:
15553  * @manager: A #GDBusObjectManagerServer.
15554  * @object: A #GDBusObjectSkeleton.
15555  *
15556  * Exports @object on @manager.
15557  *
15558  * If there is already a #GDBusObject exported at the object path,
15559  * then the old object is removed.
15560  *
15561  * The object path for @object must be in the hierarchy rooted by the
15562  * object path for @manager.
15563  *
15564  * Note that @manager will take a reference on @object for as long as
15565  * it is exported.
15566  *
15567  * Since: 2.30
15568  */
15569
15570
15571 /**
15572  * g_dbus_object_manager_server_export_uniquely:
15573  * @manager: A #GDBusObjectManagerServer.
15574  * @object: An object.
15575  *
15576  * Like g_dbus_object_manager_server_export() but appends a string of
15577  * the form <literal>_N</literal> (with N being a natural number) to
15578  * @object<!-- -->'s object path if an object with the given path
15579  * already exists. As such, the #GDBusObjectProxy:g-object-path property
15580  * of @object may be modified.
15581  *
15582  * Since: 2.30
15583  */
15584
15585
15586 /**
15587  * g_dbus_object_manager_server_get_connection:
15588  * @manager: A #GDBusObjectManagerServer
15589  *
15590  * Gets the #GDBusConnection used by @manager.
15591  *
15592  * 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().
15593  * Since: 2.30
15594  */
15595
15596
15597 /**
15598  * g_dbus_object_manager_server_is_exported:
15599  * @manager: A #GDBusObjectManagerServer.
15600  * @object: An object.
15601  *
15602  * Returns whether @object is currently exported on @manager.
15603  *
15604  * Returns: %TRUE if @object is exported
15605  * Since: 2.34
15606  */
15607
15608
15609 /**
15610  * g_dbus_object_manager_server_new:
15611  * @object_path: The object path to export the manager object at.
15612  *
15613  * Creates a new #GDBusObjectManagerServer object.
15614  *
15615  * The returned server isn't yet exported on any connection. To do so,
15616  * use g_dbus_object_manager_server_set_connection(). Normally you
15617  * want to export all of your objects before doing so to avoid <ulink
15618  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15619  * signals being emitted.
15620  *
15621  * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15622  * Since: 2.30
15623  */
15624
15625
15626 /**
15627  * g_dbus_object_manager_server_set_connection:
15628  * @manager: A #GDBusObjectManagerServer.
15629  * @connection: (allow-none): A #GDBusConnection or %NULL.
15630  *
15631  * Exports all objects managed by @manager on @connection. If
15632  * @connection is %NULL, stops exporting objects.
15633  */
15634
15635
15636 /**
15637  * g_dbus_object_manager_server_unexport:
15638  * @manager: A #GDBusObjectManagerServer.
15639  * @object_path: An object path.
15640  *
15641  * If @manager has an object at @path, removes the object. Otherwise
15642  * does nothing.
15643  *
15644  * Note that @object_path must be in the hierarchy rooted by the
15645  * object path for @manager.
15646  *
15647  * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15648  * Since: 2.30
15649  */
15650
15651
15652 /**
15653  * g_dbus_object_proxy_get_connection:
15654  * @proxy: a #GDBusObjectProxy
15655  *
15656  * Gets the connection that @proxy is for.
15657  *
15658  * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15659  * Since: 2.30
15660  */
15661
15662
15663 /**
15664  * g_dbus_object_proxy_new:
15665  * @connection: a #GDBusConnection
15666  * @object_path: the object path
15667  *
15668  * Creates a new #GDBusObjectProxy for the given connection and
15669  * object path.
15670  *
15671  * Returns: a new #GDBusObjectProxy
15672  * Since: 2.30
15673  */
15674
15675
15676 /**
15677  * g_dbus_object_skeleton_add_interface:
15678  * @object: A #GDBusObjectSkeleton.
15679  * @interface_: A #GDBusInterfaceSkeleton.
15680  *
15681  * Adds @interface_ to @object.
15682  *
15683  * If @object already contains a #GDBusInterfaceSkeleton with the same
15684  * interface name, it is removed before @interface_ is added.
15685  *
15686  * Note that @object takes its own reference on @interface_ and holds
15687  * it until removed.
15688  *
15689  * Since: 2.30
15690  */
15691
15692
15693 /**
15694  * g_dbus_object_skeleton_flush:
15695  * @object: A #GDBusObjectSkeleton.
15696  *
15697  * This method simply calls g_dbus_interface_skeleton_flush() on all
15698  * interfaces belonging to @object. See that method for when flushing
15699  * is useful.
15700  *
15701  * Since: 2.30
15702  */
15703
15704
15705 /**
15706  * g_dbus_object_skeleton_new:
15707  * @object_path: An object path.
15708  *
15709  * Creates a new #GDBusObjectSkeleton.
15710  *
15711  * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15712  * Since: 2.30
15713  */
15714
15715
15716 /**
15717  * g_dbus_object_skeleton_remove_interface:
15718  * @object: A #GDBusObjectSkeleton.
15719  * @interface_: A #GDBusInterfaceSkeleton.
15720  *
15721  * Removes @interface_ from @object.
15722  *
15723  * Since: 2.30
15724  */
15725
15726
15727 /**
15728  * g_dbus_object_skeleton_remove_interface_by_name:
15729  * @object: A #GDBusObjectSkeleton.
15730  * @interface_name: A D-Bus interface name.
15731  *
15732  * Removes the #GDBusInterface with @interface_name from @object.
15733  *
15734  * If no D-Bus interface of the given interface exists, this function
15735  * does nothing.
15736  *
15737  * Since: 2.30
15738  */
15739
15740
15741 /**
15742  * g_dbus_object_skeleton_set_object_path:
15743  * @object: A #GDBusObjectSkeleton.
15744  * @object_path: A valid D-Bus object path.
15745  *
15746  * Sets the object path for @object.
15747  *
15748  * Since: 2.30
15749  */
15750
15751
15752 /**
15753  * g_dbus_property_info_ref:
15754  * @info: A #GDBusPropertyInfo
15755  *
15756  * If @info is statically allocated does nothing. Otherwise increases
15757  * the reference count.
15758  *
15759  * Returns: The same @info.
15760  * Since: 2.26
15761  */
15762
15763
15764 /**
15765  * g_dbus_property_info_unref:
15766  * @info: A #GDBusPropertyInfo.
15767  *
15768  * If @info is statically allocated, does nothing. Otherwise decreases
15769  * the reference count of @info. When its reference count drops to 0,
15770  * the memory used is freed.
15771  *
15772  * Since: 2.26
15773  */
15774
15775
15776 /**
15777  * g_dbus_proxy_call:
15778  * @proxy: A #GDBusProxy.
15779  * @method_name: Name of method to invoke.
15780  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15781  * @flags: Flags from the #GDBusCallFlags enumeration.
15782  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15783  * @cancellable: (allow-none): A #GCancellable or %NULL.
15784  * @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.
15785  * @user_data: The data to pass to @callback.
15786  *
15787  * Asynchronously invokes the @method_name method on @proxy.
15788  *
15789  * If @method_name contains any dots, then @name is split into interface and
15790  * method name parts. This allows using @proxy for invoking methods on
15791  * other interfaces.
15792  *
15793  * If the #GDBusConnection associated with @proxy is closed then
15794  * the operation will fail with %G_IO_ERROR_CLOSED. If
15795  * @cancellable is canceled, the operation will fail with
15796  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15797  * compatible with the D-Bus protocol, the operation fails with
15798  * %G_IO_ERROR_INVALID_ARGUMENT.
15799  *
15800  * If the @parameters #GVariant is floating, it is consumed. This allows
15801  * convenient 'inline' use of g_variant_new(), e.g.:
15802  * |[
15803  *  g_dbus_proxy_call (proxy,
15804  *                     "TwoStrings",
15805  *                     g_variant_new ("(ss)",
15806  *                                    "Thing One",
15807  *                                    "Thing Two"),
15808  *                     G_DBUS_CALL_FLAGS_NONE,
15809  *                     -1,
15810  *                     NULL,
15811  *                     (GAsyncReadyCallback) two_strings_done,
15812  *                     &amp;data);
15813  * ]|
15814  *
15815  * If @proxy has an expected interface (see
15816  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15817  * then the return value is checked against the return type.
15818  *
15819  * This is an asynchronous method. When the operation is finished,
15820  * @callback will be invoked in the
15821  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15822  * of the thread you are calling this method from.
15823  * You can then call g_dbus_proxy_call_finish() to get the result of
15824  * the operation. See g_dbus_proxy_call_sync() for the synchronous
15825  * version of this method.
15826  *
15827  * If @callback is %NULL then the D-Bus method call message will be sent with
15828  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15829  *
15830  * Since: 2.26
15831  */
15832
15833
15834 /**
15835  * g_dbus_proxy_call_finish:
15836  * @proxy: A #GDBusProxy.
15837  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15838  * @error: Return location for error or %NULL.
15839  *
15840  * Finishes an operation started with g_dbus_proxy_call().
15841  *
15842  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15843  * Since: 2.26
15844  */
15845
15846
15847 /**
15848  * g_dbus_proxy_call_sync:
15849  * @proxy: A #GDBusProxy.
15850  * @method_name: Name of method to invoke.
15851  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15852  * @flags: Flags from the #GDBusCallFlags enumeration.
15853  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15854  * @cancellable: (allow-none): A #GCancellable or %NULL.
15855  * @error: Return location for error or %NULL.
15856  *
15857  * Synchronously invokes the @method_name method on @proxy.
15858  *
15859  * If @method_name contains any dots, then @name is split into interface and
15860  * method name parts. This allows using @proxy for invoking methods on
15861  * other interfaces.
15862  *
15863  * If the #GDBusConnection associated with @proxy is disconnected then
15864  * the operation will fail with %G_IO_ERROR_CLOSED. If
15865  * @cancellable is canceled, the operation will fail with
15866  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15867  * compatible with the D-Bus protocol, the operation fails with
15868  * %G_IO_ERROR_INVALID_ARGUMENT.
15869  *
15870  * If the @parameters #GVariant is floating, it is consumed. This allows
15871  * convenient 'inline' use of g_variant_new(), e.g.:
15872  * |[
15873  *  g_dbus_proxy_call_sync (proxy,
15874  *                          "TwoStrings",
15875  *                          g_variant_new ("(ss)",
15876  *                                         "Thing One",
15877  *                                         "Thing Two"),
15878  *                          G_DBUS_CALL_FLAGS_NONE,
15879  *                          -1,
15880  *                          NULL,
15881  *                          &amp;error);
15882  * ]|
15883  *
15884  * The calling thread is blocked until a reply is received. See
15885  * g_dbus_proxy_call() for the asynchronous version of this
15886  * method.
15887  *
15888  * If @proxy has an expected interface (see
15889  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15890  * then the return value is checked against the return type.
15891  *
15892  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15893  * Since: 2.26
15894  */
15895
15896
15897 /**
15898  * g_dbus_proxy_call_with_unix_fd_list:
15899  * @proxy: A #GDBusProxy.
15900  * @method_name: Name of method to invoke.
15901  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15902  * @flags: Flags from the #GDBusCallFlags enumeration.
15903  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15904  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15905  * @cancellable: (allow-none): A #GCancellable or %NULL.
15906  * @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.
15907  * @user_data: The data to pass to @callback.
15908  *
15909  * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15910  *
15911  * This method is only available on UNIX.
15912  *
15913  * Since: 2.30
15914  */
15915
15916
15917 /**
15918  * g_dbus_proxy_call_with_unix_fd_list_finish:
15919  * @proxy: A #GDBusProxy.
15920  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15921  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15922  * @error: Return location for error or %NULL.
15923  *
15924  * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15925  *
15926  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15927  * Since: 2.30
15928  */
15929
15930
15931 /**
15932  * g_dbus_proxy_call_with_unix_fd_list_sync:
15933  * @proxy: A #GDBusProxy.
15934  * @method_name: Name of method to invoke.
15935  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15936  * @flags: Flags from the #GDBusCallFlags enumeration.
15937  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15938  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15939  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15940  * @cancellable: (allow-none): A #GCancellable or %NULL.
15941  * @error: Return location for error or %NULL.
15942  *
15943  * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15944  *
15945  * This method is only available on UNIX.
15946  *
15947  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15948  * Since: 2.30
15949  */
15950
15951
15952 /**
15953  * g_dbus_proxy_get_cached_property:
15954  * @proxy: A #GDBusProxy.
15955  * @property_name: Property name.
15956  *
15957  * Looks up the value for a property from the cache. This call does no
15958  * blocking IO.
15959  *
15960  * If @proxy has an expected interface (see
15961  * #GDBusProxy:g-interface-info) and @property_name is referenced by
15962  * it, then @value is checked against the type of the property.
15963  *
15964  * 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().
15965  * Since: 2.26
15966  */
15967
15968
15969 /**
15970  * g_dbus_proxy_get_cached_property_names:
15971  * @proxy: A #GDBusProxy.
15972  *
15973  * Gets the names of all cached properties on @proxy.
15974  *
15975  * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15976  * Since: 2.26
15977  */
15978
15979
15980 /**
15981  * g_dbus_proxy_get_connection:
15982  * @proxy: A #GDBusProxy.
15983  *
15984  * Gets the connection @proxy is for.
15985  *
15986  * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15987  * Since: 2.26
15988  */
15989
15990
15991 /**
15992  * g_dbus_proxy_get_default_timeout:
15993  * @proxy: A #GDBusProxy.
15994  *
15995  * Gets the timeout to use if -1 (specifying default timeout) is
15996  * passed as @timeout_msec in the g_dbus_proxy_call() and
15997  * g_dbus_proxy_call_sync() functions.
15998  *
15999  * See the #GDBusProxy:g-default-timeout property for more details.
16000  *
16001  * Returns: Timeout to use for @proxy.
16002  * Since: 2.26
16003  */
16004
16005
16006 /**
16007  * g_dbus_proxy_get_flags:
16008  * @proxy: A #GDBusProxy.
16009  *
16010  * Gets the flags that @proxy was constructed with.
16011  *
16012  * Returns: Flags from the #GDBusProxyFlags enumeration.
16013  * Since: 2.26
16014  */
16015
16016
16017 /**
16018  * g_dbus_proxy_get_interface_info:
16019  * @proxy: A #GDBusProxy
16020  *
16021  * Returns the #GDBusInterfaceInfo, if any, specifying the interface
16022  * that @proxy conforms to. See the #GDBusProxy:g-interface-info
16023  * property for more details.
16024  *
16025  * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
16026  * Since: 2.26
16027  */
16028
16029
16030 /**
16031  * g_dbus_proxy_get_interface_name:
16032  * @proxy: A #GDBusProxy.
16033  *
16034  * Gets the D-Bus interface name @proxy is for.
16035  *
16036  * Returns: A string owned by @proxy. Do not free.
16037  * Since: 2.26
16038  */
16039
16040
16041 /**
16042  * g_dbus_proxy_get_name:
16043  * @proxy: A #GDBusProxy.
16044  *
16045  * Gets the name that @proxy was constructed for.
16046  *
16047  * Returns: A string owned by @proxy. Do not free.
16048  * Since: 2.26
16049  */
16050
16051
16052 /**
16053  * g_dbus_proxy_get_name_owner:
16054  * @proxy: A #GDBusProxy.
16055  *
16056  * The unique name that owns the name that @proxy is for or %NULL if
16057  * no-one currently owns that name. You may connect to the
16058  * #GObject::notify signal to track changes to the
16059  * #GDBusProxy:g-name-owner property.
16060  *
16061  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
16062  * Since: 2.26
16063  */
16064
16065
16066 /**
16067  * g_dbus_proxy_get_object_path:
16068  * @proxy: A #GDBusProxy.
16069  *
16070  * Gets the object path @proxy is for.
16071  *
16072  * Returns: A string owned by @proxy. Do not free.
16073  * Since: 2.26
16074  */
16075
16076
16077 /**
16078  * g_dbus_proxy_new:
16079  * @connection: A #GDBusConnection.
16080  * @flags: Flags used when constructing the proxy.
16081  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16082  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16083  * @object_path: An object path.
16084  * @interface_name: A D-Bus interface name.
16085  * @cancellable: (allow-none): A #GCancellable or %NULL.
16086  * @callback: Callback function to invoke when the proxy is ready.
16087  * @user_data: User data to pass to @callback.
16088  *
16089  * Creates a proxy for accessing @interface_name on the remote object
16090  * at @object_path owned by @name at @connection and asynchronously
16091  * loads D-Bus properties unless the
16092  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16093  * the #GDBusProxy::g-properties-changed signal to get notified about
16094  * property changes.
16095  *
16096  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16097  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16098  * to handle signals from the remote object.
16099  *
16100  * If @name is a well-known name and the
16101  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16102  * owner currently exists, the message bus will be requested to launch
16103  * a name owner for the name.
16104  *
16105  * This is a failable asynchronous constructor - when the proxy is
16106  * ready, @callback will be invoked and you can use
16107  * g_dbus_proxy_new_finish() to get the result.
16108  *
16109  * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16110  *
16111  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16112  *
16113  * Since: 2.26
16114  */
16115
16116
16117 /**
16118  * g_dbus_proxy_new_finish:
16119  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16120  * @error: Return location for error or %NULL.
16121  *
16122  * Finishes creating a #GDBusProxy.
16123  *
16124  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16125  * Since: 2.26
16126  */
16127
16128
16129 /**
16130  * g_dbus_proxy_new_for_bus:
16131  * @bus_type: A #GBusType.
16132  * @flags: Flags used when constructing the proxy.
16133  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16134  * @name: A bus name (well-known or unique).
16135  * @object_path: An object path.
16136  * @interface_name: A D-Bus interface name.
16137  * @cancellable: (allow-none): A #GCancellable or %NULL.
16138  * @callback: Callback function to invoke when the proxy is ready.
16139  * @user_data: User data to pass to @callback.
16140  *
16141  * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16142  *
16143  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16144  *
16145  * Since: 2.26
16146  */
16147
16148
16149 /**
16150  * g_dbus_proxy_new_for_bus_finish:
16151  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16152  * @error: Return location for error or %NULL.
16153  *
16154  * Finishes creating a #GDBusProxy.
16155  *
16156  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16157  * Since: 2.26
16158  */
16159
16160
16161 /**
16162  * g_dbus_proxy_new_for_bus_sync:
16163  * @bus_type: A #GBusType.
16164  * @flags: Flags used when constructing the proxy.
16165  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16166  * @name: A bus name (well-known or unique).
16167  * @object_path: An object path.
16168  * @interface_name: A D-Bus interface name.
16169  * @cancellable: (allow-none): A #GCancellable or %NULL.
16170  * @error: Return location for error or %NULL.
16171  *
16172  * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16173  *
16174  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16175  *
16176  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16177  * Since: 2.26
16178  */
16179
16180
16181 /**
16182  * g_dbus_proxy_new_sync:
16183  * @connection: A #GDBusConnection.
16184  * @flags: Flags used when constructing the proxy.
16185  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16186  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16187  * @object_path: An object path.
16188  * @interface_name: A D-Bus interface name.
16189  * @cancellable: (allow-none): A #GCancellable or %NULL.
16190  * @error: (allow-none): Return location for error or %NULL.
16191  *
16192  * Creates a proxy for accessing @interface_name on the remote object
16193  * at @object_path owned by @name at @connection and synchronously
16194  * loads D-Bus properties unless the
16195  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16196  *
16197  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16198  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16199  * to handle signals from the remote object.
16200  *
16201  * If @name is a well-known name and the
16202  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16203  * owner currently exists, the message bus will be requested to launch
16204  * a name owner for the name.
16205  *
16206  * This is a synchronous failable constructor. See g_dbus_proxy_new()
16207  * and g_dbus_proxy_new_finish() for the asynchronous version.
16208  *
16209  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16210  *
16211  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16212  * Since: 2.26
16213  */
16214
16215
16216 /**
16217  * g_dbus_proxy_set_cached_property:
16218  * @proxy: A #GDBusProxy
16219  * @property_name: Property name.
16220  * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16221  *
16222  * If @value is not %NULL, sets the cached value for the property with
16223  * name @property_name to the value in @value.
16224  *
16225  * If @value is %NULL, then the cached value is removed from the
16226  * property cache.
16227  *
16228  * If @proxy has an expected interface (see
16229  * #GDBusProxy:g-interface-info) and @property_name is referenced by
16230  * it, then @value is checked against the type of the property.
16231  *
16232  * If the @value #GVariant is floating, it is consumed. This allows
16233  * convenient 'inline' use of g_variant_new(), e.g.
16234  * |[
16235  *  g_dbus_proxy_set_cached_property (proxy,
16236  *                                    "SomeProperty",
16237  *                                    g_variant_new ("(si)",
16238  *                                                  "A String",
16239  *                                                  42));
16240  * ]|
16241  *
16242  * Normally you will not need to use this method since @proxy is
16243  * tracking changes using the
16244  * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16245  * D-Bus signal. However, for performance reasons an object may decide
16246  * to not use this signal for some properties and instead use a
16247  * proprietary out-of-band mechanism to transmit changes.
16248  *
16249  * As a concrete example, consider an object with a property
16250  * <literal>ChatroomParticipants</literal> which is an array of
16251  * strings. Instead of transmitting the same (long) array every time
16252  * the property changes, it is more efficient to only transmit the
16253  * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16254  * name)</literal> and <literal>ChatroomParticipantParted(String
16255  * name)</literal>.
16256  *
16257  * Since: 2.26
16258  */
16259
16260
16261 /**
16262  * g_dbus_proxy_set_default_timeout:
16263  * @proxy: A #GDBusProxy.
16264  * @timeout_msec: Timeout in milliseconds.
16265  *
16266  * Sets the timeout to use if -1 (specifying default timeout) is
16267  * passed as @timeout_msec in the g_dbus_proxy_call() and
16268  * g_dbus_proxy_call_sync() functions.
16269  *
16270  * See the #GDBusProxy:g-default-timeout property for more details.
16271  *
16272  * Since: 2.26
16273  */
16274
16275
16276 /**
16277  * g_dbus_proxy_set_interface_info:
16278  * @proxy: A #GDBusProxy
16279  * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16280  *
16281  * Ensure that interactions with @proxy conform to the given
16282  * interface. See the #GDBusProxy:g-interface-info property for more
16283  * details.
16284  *
16285  * Since: 2.26
16286  */
16287
16288
16289 /**
16290  * g_dbus_server_get_client_address:
16291  * @server: A #GDBusServer.
16292  *
16293  * Gets a D-Bus address string that can be used by clients to connect
16294  * to @server.
16295  *
16296  * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16297  * Since: 2.26
16298  */
16299
16300
16301 /**
16302  * g_dbus_server_get_flags:
16303  * @server: A #GDBusServer.
16304  *
16305  * Gets the flags for @server.
16306  *
16307  * Returns: A set of flags from the #GDBusServerFlags enumeration.
16308  * Since: 2.26
16309  */
16310
16311
16312 /**
16313  * g_dbus_server_get_guid:
16314  * @server: A #GDBusServer.
16315  *
16316  * Gets the GUID for @server.
16317  *
16318  * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16319  * Since: 2.26
16320  */
16321
16322
16323 /**
16324  * g_dbus_server_is_active:
16325  * @server: A #GDBusServer.
16326  *
16327  * Gets whether @server is active.
16328  *
16329  * Returns: %TRUE if server is active, %FALSE otherwise.
16330  * Since: 2.26
16331  */
16332
16333
16334 /**
16335  * g_dbus_server_new_sync:
16336  * @address: A D-Bus address.
16337  * @flags: Flags from the #GDBusServerFlags enumeration.
16338  * @guid: A D-Bus GUID.
16339  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16340  * @cancellable: (allow-none): A #GCancellable or %NULL.
16341  * @error: Return location for server or %NULL.
16342  *
16343  * Creates a new D-Bus server that listens on the first address in
16344  * @address that works.
16345  *
16346  * Once constructed, you can use g_dbus_server_get_client_address() to
16347  * get a D-Bus address string that clients can use to connect.
16348  *
16349  * Connect to the #GDBusServer::new-connection signal to handle
16350  * incoming connections.
16351  *
16352  * The returned #GDBusServer isn't active - you have to start it with
16353  * g_dbus_server_start().
16354  *
16355  * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16356  * be used.
16357  *
16358  * This is a synchronous failable constructor. See
16359  * g_dbus_server_new() for the asynchronous version.
16360  *
16361  * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16362  * Since: 2.26
16363  */
16364
16365
16366 /**
16367  * g_dbus_server_start:
16368  * @server: A #GDBusServer.
16369  *
16370  * Starts @server.
16371  *
16372  * Since: 2.26
16373  */
16374
16375
16376 /**
16377  * g_dbus_server_stop:
16378  * @server: A #GDBusServer.
16379  *
16380  * Stops @server.
16381  *
16382  * Since: 2.26
16383  */
16384
16385
16386 /**
16387  * g_dbus_signal_info_ref:
16388  * @info: A #GDBusSignalInfo
16389  *
16390  * If @info is statically allocated does nothing. Otherwise increases
16391  * the reference count.
16392  *
16393  * Returns: The same @info.
16394  * Since: 2.26
16395  */
16396
16397
16398 /**
16399  * g_dbus_signal_info_unref:
16400  * @info: A #GDBusSignalInfo.
16401  *
16402  * If @info is statically allocated, does nothing. Otherwise decreases
16403  * the reference count of @info. When its reference count drops to 0,
16404  * the memory used is freed.
16405  *
16406  * Since: 2.26
16407  */
16408
16409
16410 /**
16411  * g_desktop_app_info_get_categories:
16412  * @info: a #GDesktopAppInfo
16413  *
16414  * Gets the categories from the desktop file.
16415  *
16416  * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16417  */
16418
16419
16420 /**
16421  * g_desktop_app_info_get_filename:
16422  * @info: a #GDesktopAppInfo
16423  *
16424  * When @info was created from a known filename, return it.  In some
16425  * situations such as the #GDesktopAppInfo returned from
16426  * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16427  *
16428  * Returns: The full path to the file for @info, or %NULL if not known.
16429  * Since: 2.24
16430  */
16431
16432
16433 /**
16434  * g_desktop_app_info_get_generic_name:
16435  * @info: a #GDesktopAppInfo
16436  *
16437  * Gets the generic name from the destkop file.
16438  *
16439  * Returns: The value of the GenericName key
16440  */
16441
16442
16443 /**
16444  * g_desktop_app_info_get_is_hidden:
16445  * @info: a #GDesktopAppInfo.
16446  *
16447  * A desktop file is hidden if the Hidden key in it is
16448  * set to True.
16449  *
16450  * Returns: %TRUE if hidden, %FALSE otherwise.
16451  */
16452
16453
16454 /**
16455  * g_desktop_app_info_get_keywords:
16456  * @info: a #GDesktopAppInfo
16457  *
16458  * Gets the keywords from the desktop file.
16459  *
16460  * Returns: (transfer none): The value of the Keywords key
16461  * Since: 2.32
16462  */
16463
16464
16465 /**
16466  * g_desktop_app_info_get_nodisplay:
16467  * @info: a #GDesktopAppInfo
16468  *
16469  * Gets the value of the NoDisplay key, which helps determine if the
16470  * application info should be shown in menus. See
16471  * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16472  *
16473  * Returns: The value of the NoDisplay key
16474  * Since: 2.30
16475  */
16476
16477
16478 /**
16479  * g_desktop_app_info_get_show_in:
16480  * @info: a #GDesktopAppInfo
16481  * @desktop_env: a string specifying a desktop name
16482  *
16483  * Checks if the application info should be shown in menus that list available
16484  * applications for a specific name of the desktop, based on the
16485  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16486  *
16487  * If @desktop_env is %NULL, then the name of the desktop set with
16488  * g_desktop_app_info_set_desktop_env() is used.
16489  *
16490  * Note that g_app_info_should_show() for @info will include this check (with
16491  * %NULL for @desktop_env) as well as additional checks.
16492  *
16493  * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16494  * Since: 2.30
16495  */
16496
16497
16498 /**
16499  * g_desktop_app_info_get_startup_wm_class:
16500  * @app_info: a #GDesktopAppInfo that supports startup notify
16501  *
16502  * Retrieves the StartupWMClass field from @app_info. This represents the
16503  * WM_CLASS property of the main window of the application, if launched through
16504  * @app_info.
16505  *
16506  * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16507  * Since: 2.34
16508  */
16509
16510
16511 /**
16512  * g_desktop_app_info_launch_uris_as_manager:
16513  * @appinfo: a #GDesktopAppInfo
16514  * @uris: (element-type utf8): List of URIs
16515  * @launch_context: a #GAppLaunchContext
16516  * @spawn_flags: #GSpawnFlags, used for each process
16517  * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16518  * @user_setup_data: (closure user_setup): User data for @user_setup
16519  * @pid_callback: (scope call): Callback for child processes
16520  * @pid_callback_data: (closure pid_callback): User data for @callback
16521  * @error: return location for a #GError, or %NULL
16522  *
16523  * This function performs the equivalent of g_app_info_launch_uris(),
16524  * but is intended primarily for operating system components that
16525  * launch applications.  Ordinary applications should use
16526  * g_app_info_launch_uris().
16527  *
16528  * In contrast to g_app_info_launch_uris(), all processes created will
16529  * always be run directly as children as if by the UNIX fork()/exec()
16530  * calls.
16531  *
16532  * This guarantee allows additional control over the exact environment
16533  * of the child processes, which is provided via a setup function
16534  * @user_setup, as well as the process identifier of each child process
16535  * via @pid_callback. See g_spawn_async() for more information about the
16536  * semantics of the @user_setup function.
16537  *
16538  * Returns: %TRUE on successful launch, %FALSE otherwise.
16539  */
16540
16541
16542 /**
16543  * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16544  * @lookup: a #GDesktopAppInfoLookup
16545  * @uri_scheme: a string containing a URI scheme.
16546  *
16547  * Gets the default application for launching applications
16548  * using this URI scheme for a particular GDesktopAppInfoLookup
16549  * implementation.
16550  *
16551  * The GDesktopAppInfoLookup interface and this function is used
16552  * to implement g_app_info_get_default_for_uri_scheme() backends
16553  * in a GIO module. There is no reason for applications to use it
16554  * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16555  *
16556  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16557  * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16558  */
16559
16560
16561 /**
16562  * g_desktop_app_info_new:
16563  * @desktop_id: the desktop file id
16564  *
16565  * Creates a new #GDesktopAppInfo based on a desktop file id.
16566  *
16567  * A desktop file id is the basename of the desktop file, including the
16568  * .desktop extension. GIO is looking for a desktop file with this name
16569  * in the <filename>applications</filename> subdirectories of the XDG data
16570  * directories (i.e. the directories specified in the
16571  * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16572  * variables). GIO also supports the prefix-to-subdirectory mapping that is
16573  * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16574  * (i.e. a desktop id of kde-foo.desktop will match
16575  * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16576  *
16577  * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16578  */
16579
16580
16581 /**
16582  * g_desktop_app_info_new_from_filename:
16583  * @filename: the path of a desktop file, in the GLib filename encoding
16584  *
16585  * Creates a new #GDesktopAppInfo.
16586  *
16587  * Returns: a new #GDesktopAppInfo or %NULL on error.
16588  */
16589
16590
16591 /**
16592  * g_desktop_app_info_new_from_keyfile:
16593  * @key_file: an opened #GKeyFile
16594  *
16595  * Creates a new #GDesktopAppInfo.
16596  *
16597  * Returns: a new #GDesktopAppInfo or %NULL on error.
16598  * Since: 2.18
16599  */
16600
16601
16602 /**
16603  * g_desktop_app_info_set_desktop_env:
16604  * @desktop_env: a string specifying what desktop this is
16605  *
16606  * Sets the name of the desktop that the application is running in.
16607  * This is used by g_app_info_should_show() and
16608  * g_desktop_app_info_get_show_in() to evaluate the
16609  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16610  * desktop entry fields.
16611  *
16612  * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16613  * Menu specification</ulink> recognizes the following:
16614  * <simplelist>
16615  *   <member>GNOME</member>
16616  *   <member>KDE</member>
16617  *   <member>ROX</member>
16618  *   <member>XFCE</member>
16619  *   <member>LXDE</member>
16620  *   <member>Unity</member>
16621  *   <member>Old</member>
16622  * </simplelist>
16623  *
16624  * Should be called only once; subsequent calls are ignored.
16625  */
16626
16627
16628 /**
16629  * g_drive_can_eject:
16630  * @drive: a #GDrive.
16631  *
16632  * Checks if a drive can be ejected.
16633  *
16634  * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16635  */
16636
16637
16638 /**
16639  * g_drive_can_poll_for_media:
16640  * @drive: a #GDrive.
16641  *
16642  * Checks if a drive can be polled for media changes.
16643  *
16644  * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16645  */
16646
16647
16648 /**
16649  * g_drive_can_start:
16650  * @drive: a #GDrive.
16651  *
16652  * Checks if a drive can be started.
16653  *
16654  * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16655  * Since: 2.22
16656  */
16657
16658
16659 /**
16660  * g_drive_can_start_degraded:
16661  * @drive: a #GDrive.
16662  *
16663  * Checks if a drive can be started degraded.
16664  *
16665  * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16666  * Since: 2.22
16667  */
16668
16669
16670 /**
16671  * g_drive_can_stop:
16672  * @drive: a #GDrive.
16673  *
16674  * Checks if a drive can be stopped.
16675  *
16676  * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16677  * Since: 2.22
16678  */
16679
16680
16681 /**
16682  * g_drive_eject:
16683  * @drive: a #GDrive.
16684  * @flags: flags affecting the unmount if required for eject
16685  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16686  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16687  * @user_data: user data to pass to @callback
16688  *
16689  * Asynchronously ejects a drive.
16690  *
16691  * When the operation is finished, @callback will be called.
16692  * You can then call g_drive_eject_finish() to obtain the
16693  * result of the operation.
16694  *
16695  * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16696  */
16697
16698
16699 /**
16700  * g_drive_eject_finish:
16701  * @drive: a #GDrive.
16702  * @result: a #GAsyncResult.
16703  * @error: a #GError, or %NULL
16704  *
16705  * Finishes ejecting a drive.
16706  *
16707  * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16708  * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16709  */
16710
16711
16712 /**
16713  * g_drive_eject_with_operation:
16714  * @drive: a #GDrive.
16715  * @flags: flags affecting the unmount if required for eject
16716  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16717  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16718  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16719  * @user_data: user data passed to @callback.
16720  *
16721  * Ejects a drive. This is an asynchronous operation, and is
16722  * finished by calling g_drive_eject_with_operation_finish() with the @drive
16723  * and #GAsyncResult data returned in the @callback.
16724  *
16725  * Since: 2.22
16726  */
16727
16728
16729 /**
16730  * g_drive_eject_with_operation_finish:
16731  * @drive: a #GDrive.
16732  * @result: a #GAsyncResult.
16733  * @error: a #GError location to store the error occurring, or %NULL to ignore.
16734  *
16735  * Finishes ejecting a drive. If any errors occurred during the operation,
16736  * @error will be set to contain the errors and %FALSE will be returned.
16737  *
16738  * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16739  * Since: 2.22
16740  */
16741
16742
16743 /**
16744  * g_drive_enumerate_identifiers:
16745  * @drive: a #GDrive
16746  *
16747  * Gets the kinds of identifiers that @drive has.
16748  * Use g_drive_get_identifier() to obtain the identifiers
16749  * themselves.
16750  *
16751  * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16752  */
16753
16754
16755 /**
16756  * g_drive_get_icon:
16757  * @drive: a #GDrive.
16758  *
16759  * Gets the icon for @drive.
16760  *
16761  * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16762  */
16763
16764
16765 /**
16766  * g_drive_get_identifier:
16767  * @drive: a #GDrive
16768  * @kind: the kind of identifier to return
16769  *
16770  * Gets the identifier of the given kind for @drive.
16771  *
16772  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16773  */
16774
16775
16776 /**
16777  * g_drive_get_name:
16778  * @drive: a #GDrive.
16779  *
16780  * Gets the name of @drive.
16781  *
16782  * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16783  */
16784
16785
16786 /**
16787  * g_drive_get_sort_key:
16788  * @drive: A #GDrive.
16789  *
16790  * Gets the sort key for @drive, if any.
16791  *
16792  * Returns: Sorting key for @drive or %NULL if no such key is available.
16793  * Since: 2.32
16794  */
16795
16796
16797 /**
16798  * g_drive_get_start_stop_type:
16799  * @drive: a #GDrive.
16800  *
16801  * Gets a hint about how a drive can be started/stopped.
16802  *
16803  * Returns: A value from the #GDriveStartStopType enumeration.
16804  * Since: 2.22
16805  */
16806
16807
16808 /**
16809  * g_drive_get_symbolic_icon:
16810  * @drive: a #GDrive.
16811  *
16812  * Gets the icon for @drive.
16813  *
16814  * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16815  * Since: 2.34
16816  */
16817
16818
16819 /**
16820  * g_drive_get_volumes:
16821  * @drive: a #GDrive.
16822  *
16823  * Get a list of mountable volumes for @drive.
16824  *
16825  * The returned list should be freed with g_list_free(), after
16826  * its elements have been unreffed with g_object_unref().
16827  *
16828  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16829  */
16830
16831
16832 /**
16833  * g_drive_has_media:
16834  * @drive: a #GDrive.
16835  *
16836  * Checks if the @drive has media. Note that the OS may not be polling
16837  * the drive for media changes; see g_drive_is_media_check_automatic()
16838  * for more details.
16839  *
16840  * Returns: %TRUE if @drive has media, %FALSE otherwise.
16841  */
16842
16843
16844 /**
16845  * g_drive_has_volumes:
16846  * @drive: a #GDrive.
16847  *
16848  * Check if @drive has any mountable volumes.
16849  *
16850  * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16851  */
16852
16853
16854 /**
16855  * g_drive_is_media_check_automatic:
16856  * @drive: a #GDrive.
16857  *
16858  * Checks if @drive is capabable of automatically detecting media changes.
16859  *
16860  * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16861  */
16862
16863
16864 /**
16865  * g_drive_is_media_removable:
16866  * @drive: a #GDrive.
16867  *
16868  * Checks if the @drive supports removable media.
16869  *
16870  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16871  */
16872
16873
16874 /**
16875  * g_drive_poll_for_media:
16876  * @drive: a #GDrive.
16877  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16878  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16879  * @user_data: user data to pass to @callback
16880  *
16881  * Asynchronously polls @drive to see if media has been inserted or removed.
16882  *
16883  * When the operation is finished, @callback will be called.
16884  * You can then call g_drive_poll_for_media_finish() to obtain the
16885  * result of the operation.
16886  */
16887
16888
16889 /**
16890  * g_drive_poll_for_media_finish:
16891  * @drive: a #GDrive.
16892  * @result: a #GAsyncResult.
16893  * @error: a #GError, or %NULL
16894  *
16895  * Finishes an operation started with g_drive_poll_for_media() on a drive.
16896  *
16897  * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16898  */
16899
16900
16901 /**
16902  * g_drive_start:
16903  * @drive: a #GDrive.
16904  * @flags: flags affecting the start operation.
16905  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16906  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16907  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16908  * @user_data: user data to pass to @callback
16909  *
16910  * Asynchronously starts a drive.
16911  *
16912  * When the operation is finished, @callback will be called.
16913  * You can then call g_drive_start_finish() to obtain the
16914  * result of the operation.
16915  *
16916  * Since: 2.22
16917  */
16918
16919
16920 /**
16921  * g_drive_start_finish:
16922  * @drive: a #GDrive.
16923  * @result: a #GAsyncResult.
16924  * @error: a #GError, or %NULL
16925  *
16926  * Finishes starting a drive.
16927  *
16928  * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16929  * Since: 2.22
16930  */
16931
16932
16933 /**
16934  * g_drive_stop:
16935  * @drive: a #GDrive.
16936  * @flags: flags affecting the unmount if required for stopping.
16937  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16938  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16939  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16940  * @user_data: user data to pass to @callback
16941  *
16942  * Asynchronously stops a drive.
16943  *
16944  * When the operation is finished, @callback will be called.
16945  * You can then call g_drive_stop_finish() to obtain the
16946  * result of the operation.
16947  *
16948  * Since: 2.22
16949  */
16950
16951
16952 /**
16953  * g_drive_stop_finish:
16954  * @drive: a #GDrive.
16955  * @result: a #GAsyncResult.
16956  * @error: a #GError, or %NULL
16957  *
16958  * Finishes stopping a drive.
16959  *
16960  * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16961  * Since: 2.22
16962  */
16963
16964
16965 /**
16966  * g_emblem_get_icon:
16967  * @emblem: a #GEmblem from which the icon should be extracted.
16968  *
16969  * Gives back the icon from @emblem.
16970  *
16971  * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16972  * Since: 2.18
16973  */
16974
16975
16976 /**
16977  * g_emblem_get_origin:
16978  * @emblem: a #GEmblem
16979  *
16980  * Gets the origin of the emblem.
16981  *
16982  * Returns: (transfer none): the origin of the emblem
16983  * Since: 2.18
16984  */
16985
16986
16987 /**
16988  * g_emblem_new:
16989  * @icon: a GIcon containing the icon.
16990  *
16991  * Creates a new emblem for @icon.
16992  *
16993  * Returns: a new #GEmblem.
16994  * Since: 2.18
16995  */
16996
16997
16998 /**
16999  * g_emblem_new_with_origin:
17000  * @icon: a GIcon containing the icon.
17001  * @origin: a GEmblemOrigin enum defining the emblem's origin
17002  *
17003  * Creates a new emblem for @icon.
17004  *
17005  * Returns: a new #GEmblem.
17006  * Since: 2.18
17007  */
17008
17009
17010 /**
17011  * g_emblemed_icon_add_emblem:
17012  * @emblemed: a #GEmblemedIcon
17013  * @emblem: a #GEmblem
17014  *
17015  * Adds @emblem to the #GList of #GEmblem <!-- -->s.
17016  *
17017  * Since: 2.18
17018  */
17019
17020
17021 /**
17022  * g_emblemed_icon_clear_emblems:
17023  * @emblemed: a #GEmblemedIcon
17024  *
17025  * Removes all the emblems from @icon.
17026  *
17027  * Since: 2.28
17028  */
17029
17030
17031 /**
17032  * g_emblemed_icon_get_emblems:
17033  * @emblemed: a #GEmblemedIcon
17034  *
17035  * Gets the list of emblems for the @icon.
17036  *
17037  * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
17038  * Since: 2.18
17039  */
17040
17041
17042 /**
17043  * g_emblemed_icon_get_icon:
17044  * @emblemed: a #GEmblemedIcon
17045  *
17046  * Gets the main icon for @emblemed.
17047  *
17048  * Returns: (transfer none): a #GIcon that is owned by @emblemed
17049  * Since: 2.18
17050  */
17051
17052
17053 /**
17054  * g_emblemed_icon_new:
17055  * @icon: a #GIcon
17056  * @emblem: (allow-none): a #GEmblem, or %NULL
17057  *
17058  * Creates a new emblemed icon for @icon with the emblem @emblem.
17059  *
17060  * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
17061  * Since: 2.18
17062  */
17063
17064
17065 /**
17066  * g_file_append_to:
17067  * @file: input #GFile
17068  * @flags: a set of #GFileCreateFlags
17069  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17070  * @error: a #GError, or %NULL
17071  *
17072  * Gets an output stream for appending data to the file.
17073  * If the file doesn't already exist it is created.
17074  *
17075  * By default files created are generally readable by everyone,
17076  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17077  * will be made readable only to the current user, to the level that
17078  * is supported on the target filesystem.
17079  *
17080  * If @cancellable is not %NULL, then the operation can be cancelled
17081  * by triggering the cancellable object from another thread. If the
17082  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17083  * returned.
17084  *
17085  * Some file systems don't allow all file names, and may return an
17086  * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17087  * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17088  * possible too, and depend on what kind of filesystem the file is on.
17089  *
17090  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17091  */
17092
17093
17094 /**
17095  * g_file_append_to_async:
17096  * @file: input #GFile
17097  * @flags: a set of #GFileCreateFlags
17098  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17099  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17100  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17101  * @user_data: (closure): the data to pass to callback function
17102  *
17103  * Asynchronously opens @file for appending.
17104  *
17105  * For more details, see g_file_append_to() which is
17106  * the synchronous version of this call.
17107  *
17108  * When the operation is finished, @callback will be called.
17109  * You can then call g_file_append_to_finish() to get the result
17110  * of the operation.
17111  */
17112
17113
17114 /**
17115  * g_file_append_to_finish:
17116  * @file: input #GFile
17117  * @res: #GAsyncResult
17118  * @error: a #GError, or %NULL
17119  *
17120  * Finishes an asynchronous file append operation started with
17121  * g_file_append_to_async().
17122  *
17123  * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17124  */
17125
17126
17127 /**
17128  * g_file_attribute_info_list_add:
17129  * @list: a #GFileAttributeInfoList.
17130  * @name: the name of the attribute to add.
17131  * @type: the #GFileAttributeType for the attribute.
17132  * @flags: #GFileAttributeInfoFlags for the attribute.
17133  *
17134  * Adds a new attribute with @name to the @list, setting
17135  * its @type and @flags.
17136  */
17137
17138
17139 /**
17140  * g_file_attribute_info_list_dup:
17141  * @list: a #GFileAttributeInfoList to duplicate.
17142  *
17143  * Makes a duplicate of a file attribute info list.
17144  *
17145  * Returns: a copy of the given @list.
17146  */
17147
17148
17149 /**
17150  * g_file_attribute_info_list_lookup:
17151  * @list: a #GFileAttributeInfoList.
17152  * @name: the name of the attribute to lookup.
17153  *
17154  * Gets the file attribute with the name @name from @list.
17155  *
17156  * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17157  */
17158
17159
17160 /**
17161  * g_file_attribute_info_list_new:
17162  *
17163  * Creates a new file attribute info list.
17164  *
17165  * Returns: a #GFileAttributeInfoList.
17166  */
17167
17168
17169 /**
17170  * g_file_attribute_info_list_ref:
17171  * @list: a #GFileAttributeInfoList to reference.
17172  *
17173  * References a file attribute info list.
17174  *
17175  * Returns: #GFileAttributeInfoList or %NULL on error.
17176  */
17177
17178
17179 /**
17180  * g_file_attribute_info_list_unref:
17181  * @list: The #GFileAttributeInfoList to unreference.
17182  *
17183  * Removes a reference from the given @list. If the reference count
17184  * falls to zero, the @list is deleted.
17185  */
17186
17187
17188 /**
17189  * g_file_attribute_matcher_enumerate_namespace:
17190  * @matcher: a #GFileAttributeMatcher.
17191  * @ns: a string containing a file attribute namespace.
17192  *
17193  * Checks if the matcher will match all of the keys in a given namespace.
17194  * This will always return %TRUE if a wildcard character is in use (e.g. if
17195  * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17196  * using "*" and namespace is anything.)
17197  *
17198  * TODO: this is awkwardly worded.
17199  *
17200  * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17201  */
17202
17203
17204 /**
17205  * g_file_attribute_matcher_enumerate_next:
17206  * @matcher: a #GFileAttributeMatcher.
17207  *
17208  * Gets the next matched attribute from a #GFileAttributeMatcher.
17209  *
17210  * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17211  */
17212
17213
17214 /**
17215  * g_file_attribute_matcher_matches:
17216  * @matcher: a #GFileAttributeMatcher.
17217  * @attribute: a file attribute key.
17218  *
17219  * Checks if an attribute will be matched by an attribute matcher. If
17220  * the matcher was created with the "*" matching string, this function
17221  * will always return %TRUE.
17222  *
17223  * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17224  */
17225
17226
17227 /**
17228  * g_file_attribute_matcher_matches_only:
17229  * @matcher: a #GFileAttributeMatcher.
17230  * @attribute: a file attribute key.
17231  *
17232  * Checks if a attribute matcher only matches a given attribute. Always
17233  * returns %FALSE if "*" was used when creating the matcher.
17234  *
17235  * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17236  */
17237
17238
17239 /**
17240  * g_file_attribute_matcher_new:
17241  * @attributes: an attribute string to match.
17242  *
17243  * Creates a new file attribute matcher, which matches attributes
17244  * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17245  * counted structures, and are created with a reference count of 1. If
17246  * the number of references falls to 0, the #GFileAttributeMatcher is
17247  * automatically destroyed.
17248  *
17249  * The @attribute string should be formatted with specific keys separated
17250  * from namespaces with a double colon. Several "namespace::key" strings may be
17251  * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17252  * The wildcard "*" may be used to match all keys and namespaces, or
17253  * "namespace::*" will match all keys in a given namespace.
17254  *
17255  * Examples of strings to use:
17256  * <table>
17257  * <title>File Attribute Matcher strings and results</title>
17258  * <tgroup cols='2' align='left'><thead>
17259  * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17260  * <tbody>
17261  * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17262  * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17263  * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17264  * all keys in the unix namespace.</entry></row>
17265  * </tbody></tgroup>
17266  * </table>
17267  *
17268  * Returns: a #GFileAttributeMatcher.
17269  */
17270
17271
17272 /**
17273  * g_file_attribute_matcher_ref:
17274  * @matcher: a #GFileAttributeMatcher.
17275  *
17276  * References a file attribute matcher.
17277  *
17278  * Returns: a #GFileAttributeMatcher.
17279  */
17280
17281
17282 /**
17283  * g_file_attribute_matcher_subtract:
17284  * @matcher: Matcher to subtract from
17285  * @subtract: The matcher to subtract
17286  *
17287  * Subtracts all attributes of @subtract from @matcher and returns
17288  * a matcher that supports those attributes.
17289  *
17290  * Note that currently it is not possible to remove a single
17291  * attribute when the @matcher matches the whole namespace - or remove
17292  * a namespace or attribute when the matcher matches everything. This
17293  * is a limitation of the current implementation, but may be fixed
17294  * in the future.
17295  *
17296  * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17297  */
17298
17299
17300 /**
17301  * g_file_attribute_matcher_to_string:
17302  * @matcher: (allow-none): a #GFileAttributeMatcher.
17303  *
17304  * Prints what the matcher is matching against. The format will be
17305  * equal to the format passed to g_file_attribute_matcher_new().
17306  * The output however, might not be identical, as the matcher may
17307  * decide to use a different order or omit needless parts.
17308  *
17309  * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17310  * Since: 2.32
17311  */
17312
17313
17314 /**
17315  * g_file_attribute_matcher_unref:
17316  * @matcher: a #GFileAttributeMatcher.
17317  *
17318  * Unreferences @matcher. If the reference count falls below 1,
17319  * the @matcher is automatically freed.
17320  */
17321
17322
17323 /**
17324  * g_file_copy:
17325  * @source: input #GFile
17326  * @destination: destination #GFile
17327  * @flags: set of #GFileCopyFlags
17328  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17329  * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17330  * @progress_callback_data: (closure): user data to pass to @progress_callback
17331  * @error: #GError to set on error, or %NULL
17332  *
17333  * Copies the file @source to the location specified by @destination.
17334  * Can not handle recursive copies of directories.
17335  *
17336  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17337  * existing @destination file is overwritten.
17338  *
17339  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17340  * will be copied as symlinks, otherwise the target of the
17341  * @source symlink will be copied.
17342  *
17343  * If @cancellable is not %NULL, then the operation can be cancelled by
17344  * triggering the cancellable object from another thread. If the operation
17345  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17346  *
17347  * If @progress_callback is not %NULL, then the operation can be monitored
17348  * by setting this to a #GFileProgressCallback function.
17349  * @progress_callback_data will be passed to this function. It is guaranteed
17350  * that this callback will be called after all data has been transferred with
17351  * the total number of bytes copied during the operation.
17352  *
17353  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17354  * is returned, independent on the status of the @destination.
17355  *
17356  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17357  * the error %G_IO_ERROR_EXISTS is returned.
17358  *
17359  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17360  * error is returned. If trying to overwrite a directory with a directory the
17361  * %G_IO_ERROR_WOULD_MERGE error is returned.
17362  *
17363  * If the source is a directory and the target does not exist, or
17364  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17365  * %G_IO_ERROR_WOULD_RECURSE error is returned.
17366  *
17367  * If you are interested in copying the #GFile object itself (not the on-disk
17368  * file), see g_file_dup().
17369  *
17370  * Returns: %TRUE on success, %FALSE otherwise.
17371  */
17372
17373
17374 /**
17375  * g_file_copy_async: (skip)
17376  * @source: input #GFile
17377  * @destination: destination #GFile
17378  * @flags: set of #GFileCopyFlags
17379  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17380  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17381  * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17382  * @progress_callback_data: (closure): user data to pass to @progress_callback
17383  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17384  * @user_data: the data to pass to callback function
17385  *
17386  * Copies the file @source to the location specified by @destination
17387  * asynchronously. For details of the behaviour, see g_file_copy().
17388  *
17389  * If @progress_callback is not %NULL, then that function that will be called
17390  * just like in g_file_copy(), however the callback will run in the main loop,
17391  * not in the thread that is doing the I/O operation.
17392  *
17393  * When the operation is finished, @callback will be called. You can then call
17394  * g_file_copy_finish() to get the result of the operation.
17395  */
17396
17397
17398 /**
17399  * g_file_copy_attributes:
17400  * @source: a #GFile with attributes
17401  * @destination: a #GFile to copy attributes to
17402  * @flags: a set of #GFileCopyFlags
17403  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17404  * @error: a #GError, %NULL to ignore
17405  *
17406  * Copies the file attributes from @source to @destination.
17407  *
17408  * Normally only a subset of the file attributes are copied,
17409  * those that are copies in a normal file copy operation
17410  * (which for instance does not include e.g. owner). However
17411  * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17412  * all the metadata that is possible to copy is copied. This
17413  * is useful when implementing move by copy + delete source.
17414  *
17415  * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17416  */
17417
17418
17419 /**
17420  * g_file_copy_finish:
17421  * @file: input #GFile
17422  * @res: a #GAsyncResult
17423  * @error: a #GError, or %NULL
17424  *
17425  * Finishes copying the file started with g_file_copy_async().
17426  *
17427  * Returns: a %TRUE on success, %FALSE on error.
17428  */
17429
17430
17431 /**
17432  * g_file_create:
17433  * @file: input #GFile
17434  * @flags: a set of #GFileCreateFlags
17435  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17436  * @error: a #GError, or %NULL
17437  *
17438  * Creates a new file and returns an output stream for writing to it.
17439  * The file must not already exist.
17440  *
17441  * By default files created are generally readable by everyone,
17442  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17443  * will be made readable only to the current user, to the level
17444  * that is supported on the target filesystem.
17445  *
17446  * If @cancellable is not %NULL, then the operation can be cancelled
17447  * by triggering the cancellable object from another thread. If the
17448  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17449  * returned.
17450  *
17451  * If a file or directory with this name already exists the
17452  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17453  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17454  * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
17455  * be returned. Other errors are possible too, and depend on what kind
17456  * of filesystem the file is on.
17457  *
17458  * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17459  */
17460
17461
17462 /**
17463  * g_file_create_async:
17464  * @file: input #GFile
17465  * @flags: a set of #GFileCreateFlags
17466  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17467  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17468  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17469  * @user_data: (closure): the data to pass to callback function
17470  *
17471  * Asynchronously creates a new file and returns an output stream
17472  * for writing to it. The file must not already exist.
17473  *
17474  * For more details, see g_file_create() which is
17475  * the synchronous version of this call.
17476  *
17477  * When the operation is finished, @callback will be called.
17478  * You can then call g_file_create_finish() to get the result
17479  * of the operation.
17480  */
17481
17482
17483 /**
17484  * g_file_create_finish:
17485  * @file: input #GFile
17486  * @res: a #GAsyncResult
17487  * @error: a #GError, or %NULL
17488  *
17489  * Finishes an asynchronous file create operation started with
17490  * g_file_create_async().
17491  *
17492  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17493  */
17494
17495
17496 /**
17497  * g_file_create_readwrite:
17498  * @file: a #GFile
17499  * @flags: a set of #GFileCreateFlags
17500  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17501  * @error: return location for a #GError, or %NULL
17502  *
17503  * Creates a new file and returns a stream for reading and
17504  * writing to it. The file must not already exist.
17505  *
17506  * By default files created are generally readable by everyone,
17507  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17508  * will be made readable only to the current user, to the level
17509  * that is supported on the target filesystem.
17510  *
17511  * If @cancellable is not %NULL, then the operation can be cancelled
17512  * by triggering the cancellable object from another thread. If the
17513  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17514  * returned.
17515  *
17516  * If a file or directory with this name already exists, the
17517  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17518  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17519  * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
17520  * will be returned. Other errors are possible too, and depend on what
17521  * kind of filesystem the file is on.
17522  *
17523  * Note that in many non-local file cases read and write streams are
17524  * not supported, so make sure you really need to do read and write
17525  * streaming, rather than just opening for reading or writing.
17526  *
17527  * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17528  * Since: 2.22
17529  */
17530
17531
17532 /**
17533  * g_file_create_readwrite_async:
17534  * @file: input #GFile
17535  * @flags: a set of #GFileCreateFlags
17536  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17537  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17538  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17539  * @user_data: (closure): the data to pass to callback function
17540  *
17541  * Asynchronously creates a new file and returns a stream
17542  * for reading and writing to it. The file must not already exist.
17543  *
17544  * For more details, see g_file_create_readwrite() which is
17545  * the synchronous version of this call.
17546  *
17547  * When the operation is finished, @callback will be called.
17548  * You can then call g_file_create_readwrite_finish() to get
17549  * the result of the operation.
17550  *
17551  * Since: 2.22
17552  */
17553
17554
17555 /**
17556  * g_file_create_readwrite_finish:
17557  * @file: input #GFile
17558  * @res: a #GAsyncResult
17559  * @error: a #GError, or %NULL
17560  *
17561  * Finishes an asynchronous file create operation started with
17562  * g_file_create_readwrite_async().
17563  *
17564  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17565  * Since: 2.22
17566  */
17567
17568
17569 /**
17570  * g_file_delete:
17571  * @file: input #GFile
17572  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17573  * @error: a #GError, or %NULL
17574  *
17575  * Deletes a file. If the @file is a directory, it will only be
17576  * deleted if it is empty. This has the same semantics as g_unlink().
17577  *
17578  * If @cancellable is not %NULL, then the operation can be cancelled by
17579  * triggering the cancellable object from another thread. If the operation
17580  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17581  *
17582  * Virtual: delete_file
17583  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17584  */
17585
17586
17587 /**
17588  * g_file_delete_async:
17589  * @file: input #GFile
17590  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17591  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17592  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17593  * @user_data: the data to pass to callback function
17594  *
17595  * Asynchronously delete a file. If the @file is a directory, it will
17596  * only be deleted if it is empty.  This has the same semantics as
17597  * g_unlink().
17598  *
17599  * Virtual: delete_file_async
17600  * Since: 2.34
17601  */
17602
17603
17604 /**
17605  * g_file_delete_finish:
17606  * @file: input #GFile
17607  * @res: a #GAsyncResult
17608  * @error: a #GError, or %NULL
17609  *
17610  * Finishes deleting a file started with g_file_delete_async().
17611  *
17612  * Virtual: delete_file_finish
17613  * Since: 2.34
17614  */
17615
17616
17617 /**
17618  * g_file_descriptor_based_get_fd:
17619  * @fd_based: a #GFileDescriptorBased.
17620  *
17621  * Gets the underlying file descriptor.
17622  *
17623  * Returns: The file descriptor
17624  * Since: 2.24
17625  */
17626
17627
17628 /**
17629  * g_file_dup:
17630  * @file: input #GFile
17631  *
17632  * Duplicates a #GFile handle. This operation does not duplicate
17633  * the actual file or directory represented by the #GFile; see
17634  * g_file_copy() if attempting to copy a file.
17635  *
17636  * This call does no blocking I/O.
17637  *
17638  * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17639  */
17640
17641
17642 /**
17643  * g_file_eject_mountable:
17644  * @file: input #GFile
17645  * @flags: flags affecting the operation
17646  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17647  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17648  * @user_data: (closure): the data to pass to callback function
17649  *
17650  * Starts an asynchronous eject on a mountable.
17651  * When this operation has completed, @callback will be called with
17652  * @user_user data, and the operation can be finalized with
17653  * g_file_eject_mountable_finish().
17654  *
17655  * If @cancellable is not %NULL, then the operation can be cancelled by
17656  * triggering the cancellable object from another thread. If the operation
17657  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17658  *
17659  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17660  */
17661
17662
17663 /**
17664  * g_file_eject_mountable_finish:
17665  * @file: input #GFile
17666  * @result: a #GAsyncResult
17667  * @error: a #GError, or %NULL
17668  *
17669  * Finishes an asynchronous eject operation started by
17670  * g_file_eject_mountable().
17671  *
17672  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17673  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17674  */
17675
17676
17677 /**
17678  * g_file_eject_mountable_with_operation:
17679  * @file: input #GFile
17680  * @flags: flags affecting the operation
17681  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17682  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17683  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17684  * @user_data: (closure): the data to pass to callback function
17685  *
17686  * Starts an asynchronous eject on a mountable.
17687  * When this operation has completed, @callback will be called with
17688  * @user_user data, and the operation can be finalized with
17689  * g_file_eject_mountable_with_operation_finish().
17690  *
17691  * If @cancellable is not %NULL, then the operation can be cancelled by
17692  * triggering the cancellable object from another thread. If the operation
17693  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17694  *
17695  * Since: 2.22
17696  */
17697
17698
17699 /**
17700  * g_file_eject_mountable_with_operation_finish:
17701  * @file: input #GFile
17702  * @result: a #GAsyncResult
17703  * @error: a #GError, or %NULL
17704  *
17705  * Finishes an asynchronous eject operation started by
17706  * g_file_eject_mountable_with_operation().
17707  *
17708  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17709  * Since: 2.22
17710  */
17711
17712
17713 /**
17714  * g_file_enumerate_children:
17715  * @file: input #GFile
17716  * @attributes: an attribute query string
17717  * @flags: a set of #GFileQueryInfoFlags
17718  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17719  * @error: #GError for error reporting
17720  *
17721  * Gets the requested information about the files in a directory.
17722  * The result is a #GFileEnumerator object that will give out
17723  * #GFileInfo objects for all the files in the directory.
17724  *
17725  * The @attributes value is a string that specifies the file
17726  * attributes that should be gathered. It is not an error if
17727  * it's not possible to read a particular requested attribute
17728  * from a file - it just won't be set. @attributes should
17729  * be a comma-separated list of attributes or attribute wildcards.
17730  * The wildcard "*" means all attributes, and a wildcard like
17731  * "standard::*" means all attributes in the standard namespace.
17732  * An example attribute query be "standard::*,owner::user".
17733  * The standard attributes are available as defines, like
17734  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17735  *
17736  * If @cancellable is not %NULL, then the operation can be cancelled
17737  * by triggering the cancellable object from another thread. If the
17738  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17739  * returned.
17740  *
17741  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17742  * be returned. If the file is not a directory, the %G_FILE_ERROR_NOTDIR
17743  * error will be returned. Other errors are possible too.
17744  *
17745  * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17746  */
17747
17748
17749 /**
17750  * g_file_enumerate_children_async:
17751  * @file: input #GFile
17752  * @attributes: an attribute query string
17753  * @flags: a set of #GFileQueryInfoFlags
17754  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17755  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17756  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17757  * @user_data: (closure): the data to pass to callback function
17758  *
17759  * Asynchronously gets the requested information about the files
17760  * in a directory. The result is a #GFileEnumerator object that will
17761  * give out #GFileInfo objects for all the files in the directory.
17762  *
17763  * For more details, see g_file_enumerate_children() which is
17764  * the synchronous version of this call.
17765  *
17766  * When the operation is finished, @callback will be called. You can
17767  * then call g_file_enumerate_children_finish() to get the result of
17768  * the operation.
17769  */
17770
17771
17772 /**
17773  * g_file_enumerate_children_finish:
17774  * @file: input #GFile
17775  * @res: a #GAsyncResult
17776  * @error: a #GError
17777  *
17778  * Finishes an async enumerate children operation.
17779  * See g_file_enumerate_children_async().
17780  *
17781  * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17782  */
17783
17784
17785 /**
17786  * g_file_enumerator_close:
17787  * @enumerator: a #GFileEnumerator.
17788  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17789  * @error: location to store the error occurring, or %NULL to ignore
17790  *
17791  * Releases all resources used by this enumerator, making the
17792  * enumerator return %G_IO_ERROR_CLOSED on all calls.
17793  *
17794  * This will be automatically called when the last reference
17795  * is dropped, but you might want to call this function to make
17796  * sure resources are released as early as possible.
17797  *
17798  * Returns: #TRUE on success or #FALSE on error.
17799  */
17800
17801
17802 /**
17803  * g_file_enumerator_close_async:
17804  * @enumerator: a #GFileEnumerator.
17805  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17806  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17807  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17808  * @user_data: (closure): the data to pass to callback function
17809  *
17810  * Asynchronously closes the file enumerator.
17811  *
17812  * If @cancellable is not %NULL, then the operation can be cancelled by
17813  * triggering the cancellable object from another thread. If the operation
17814  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17815  * g_file_enumerator_close_finish().
17816  */
17817
17818
17819 /**
17820  * g_file_enumerator_close_finish:
17821  * @enumerator: a #GFileEnumerator.
17822  * @result: a #GAsyncResult.
17823  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17824  *
17825  * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17826  *
17827  * If the file enumerator was already closed when g_file_enumerator_close_async()
17828  * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17829  * return %FALSE. If the file enumerator had pending operation when the close
17830  * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17831  * return %FALSE.  If @cancellable was not %NULL, then the operation may have been
17832  * cancelled by triggering the cancellable object from another thread. If the operation
17833  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17834  * returned.
17835  *
17836  * Returns: %TRUE if the close operation has finished successfully.
17837  */
17838
17839
17840 /**
17841  * g_file_enumerator_get_container:
17842  * @enumerator: a #GFileEnumerator
17843  *
17844  * Get the #GFile container which is being enumerated.
17845  *
17846  * Returns: (transfer none): the #GFile which is being enumerated.
17847  * Since: 2.18
17848  */
17849
17850
17851 /**
17852  * g_file_enumerator_has_pending:
17853  * @enumerator: a #GFileEnumerator.
17854  *
17855  * Checks if the file enumerator has pending operations.
17856  *
17857  * Returns: %TRUE if the @enumerator has pending operations.
17858  */
17859
17860
17861 /**
17862  * g_file_enumerator_is_closed:
17863  * @enumerator: a #GFileEnumerator.
17864  *
17865  * Checks if the file enumerator has been closed.
17866  *
17867  * Returns: %TRUE if the @enumerator is closed.
17868  */
17869
17870
17871 /**
17872  * g_file_enumerator_next_file:
17873  * @enumerator: a #GFileEnumerator.
17874  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17875  * @error: location to store the error occurring, or %NULL to ignore
17876  *
17877  * Returns information for the next file in the enumerated object.
17878  * Will block until the information is available. The #GFileInfo
17879  * returned from this function will contain attributes that match the
17880  * attribute string that was passed when the #GFileEnumerator was created.
17881  *
17882  * On error, returns %NULL and sets @error to the error. If the
17883  * enumerator is at the end, %NULL will be returned and @error will
17884  * be unset.
17885  *
17886  * 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.
17887  */
17888
17889
17890 /**
17891  * g_file_enumerator_next_files_async:
17892  * @enumerator: a #GFileEnumerator.
17893  * @num_files: the number of file info objects to request
17894  * @io_priority: the <link linkend="gioscheduler">io priority</link> of the request.
17895  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17896  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17897  * @user_data: (closure): the data to pass to callback function
17898  *
17899  * Request information for a number of files from the enumerator asynchronously.
17900  * When all i/o for the operation is finished the @callback will be called with
17901  * the requested information.
17902  *
17903  * The callback can be called with less than @num_files files in case of error
17904  * or at the end of the enumerator. In case of a partial error the callback will
17905  * be called with any succeeding items and no error, and on the next request the
17906  * error will be reported. If a request is cancelled the callback will be called
17907  * with %G_IO_ERROR_CANCELLED.
17908  *
17909  * During an async request no other sync and async calls are allowed, and will
17910  * result in %G_IO_ERROR_PENDING errors.
17911  *
17912  * Any outstanding i/o request with higher priority (lower numerical value) will
17913  * be executed before an outstanding request with lower priority. Default
17914  * priority is %G_PRIORITY_DEFAULT.
17915  */
17916
17917
17918 /**
17919  * g_file_enumerator_next_files_finish:
17920  * @enumerator: a #GFileEnumerator.
17921  * @result: a #GAsyncResult.
17922  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17923  *
17924  * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17925  *
17926  * 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.
17927  */
17928
17929
17930 /**
17931  * g_file_enumerator_set_pending:
17932  * @enumerator: a #GFileEnumerator.
17933  * @pending: a boolean value.
17934  *
17935  * Sets the file enumerator as having pending operations.
17936  */
17937
17938
17939 /**
17940  * g_file_equal:
17941  * @file1: the first #GFile
17942  * @file2: the second #GFile
17943  *
17944  * Checks equality of two given #GFiles.
17945  *
17946  * Note that two #GFiles that differ can still refer to the same
17947  * file on the filesystem due to various forms of filename
17948  * aliasing.
17949  *
17950  * This call does no blocking I/O.
17951  *
17952  * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17953  */
17954
17955
17956 /**
17957  * g_file_find_enclosing_mount:
17958  * @file: input #GFile
17959  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17960  * @error: a #GError
17961  *
17962  * Gets a #GMount for the #GFile.
17963  *
17964  * If the #GFileIface for @file does not have a mount (e.g.
17965  * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17966  * and %NULL will be returned.
17967  *
17968  * If @cancellable is not %NULL, then the operation can be cancelled by
17969  * triggering the cancellable object from another thread. If the operation
17970  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17971  *
17972  * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17973  */
17974
17975
17976 /**
17977  * g_file_find_enclosing_mount_async:
17978  * @file: a #GFile
17979  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17980  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17981  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17982  * @user_data: (closure): the data to pass to callback function
17983  *
17984  * Asynchronously gets the mount for the file.
17985  *
17986  * For more details, see g_file_find_enclosing_mount() which is
17987  * the synchronous version of this call.
17988  *
17989  * When the operation is finished, @callback will be called.
17990  * You can then call g_file_find_enclosing_mount_finish() to
17991  * get the result of the operation.
17992  */
17993
17994
17995 /**
17996  * g_file_find_enclosing_mount_finish:
17997  * @file: a #GFile
17998  * @res: a #GAsyncResult
17999  * @error: a #GError
18000  *
18001  * Finishes an asynchronous find mount request.
18002  * See g_file_find_enclosing_mount_async().
18003  *
18004  * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
18005  */
18006
18007
18008 /**
18009  * g_file_get_basename:
18010  * @file: input #GFile
18011  *
18012  * Gets the base name (the last component of the path) for a given #GFile.
18013  *
18014  * If called for the top level of a system (such as the filesystem root
18015  * or a uri like sftp://host/) it will return a single directory separator
18016  * (and on Windows, possibly a drive letter).
18017  *
18018  * The base name is a byte string (not UTF-8). It has no defined encoding
18019  * or rules other than it may not contain zero bytes.  If you want to use
18020  * filenames in a user interface you should use the display name that you
18021  * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
18022  * attribute with g_file_query_info().
18023  *
18024  * This call does no blocking I/O.
18025  *
18026  * 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.
18027  */
18028
18029
18030 /**
18031  * g_file_get_child:
18032  * @file: input #GFile
18033  * @name: string containing the child's basename
18034  *
18035  * Gets a child of @file with basename equal to @name.
18036  *
18037  * Note that the file with that specific name might not exist, but
18038  * you can still have a #GFile that points to it. You can use this
18039  * for instance to create that file.
18040  *
18041  * This call does no blocking I/O.
18042  *
18043  * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
18044  */
18045
18046
18047 /**
18048  * g_file_get_child_for_display_name:
18049  * @file: input #GFile
18050  * @display_name: string to a possible child
18051  * @error: return location for an error
18052  *
18053  * Gets the child of @file for a given @display_name (i.e. a UTF-8
18054  * version of the name). If this function fails, it returns %NULL
18055  * and @error will be set. This is very useful when constructing a
18056  * #GFile for a new file and the user entered the filename in the
18057  * user interface, for instance when you select a directory and
18058  * type a filename in the file selector.
18059  *
18060  * This call does no blocking I/O.
18061  *
18062  * 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().
18063  */
18064
18065
18066 /**
18067  * g_file_get_parent:
18068  * @file: input #GFile
18069  *
18070  * Gets the parent directory for the @file.
18071  * If the @file represents the root directory of the
18072  * file system, then %NULL will be returned.
18073  *
18074  * This call does no blocking I/O.
18075  *
18076  * 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().
18077  */
18078
18079
18080 /**
18081  * g_file_get_parse_name:
18082  * @file: input #GFile
18083  *
18084  * Gets the parse name of the @file.
18085  * A parse name is a UTF-8 string that describes the
18086  * file such that one can get the #GFile back using
18087  * g_file_parse_name().
18088  *
18089  * This is generally used to show the #GFile as a nice
18090  * full-pathname kind of string in a user interface,
18091  * like in a location entry.
18092  *
18093  * For local files with names that can safely be converted
18094  * to UTF-8 the pathname is used, otherwise the IRI is used
18095  * (a form of URI that allows UTF-8 characters unescaped).
18096  *
18097  * This call does no blocking I/O.
18098  *
18099  * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18100  */
18101
18102
18103 /**
18104  * g_file_get_path:
18105  * @file: input #GFile
18106  *
18107  * Gets the local pathname for #GFile, if one exists.
18108  *
18109  * This call does no blocking I/O.
18110  *
18111  * 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.
18112  */
18113
18114
18115 /**
18116  * g_file_get_relative_path:
18117  * @parent: input #GFile
18118  * @descendant: input #GFile
18119  *
18120  * Gets the path for @descendant relative to @parent.
18121  *
18122  * This call does no blocking I/O.
18123  *
18124  * 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.
18125  */
18126
18127
18128 /**
18129  * g_file_get_uri:
18130  * @file: input #GFile
18131  *
18132  * Gets the URI for the @file.
18133  *
18134  * This call does no blocking I/O.
18135  *
18136  * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18137  */
18138
18139
18140 /**
18141  * g_file_get_uri_scheme:
18142  * @file: input #GFile
18143  *
18144  * Gets the URI scheme for a #GFile.
18145  * RFC 3986 decodes the scheme as:
18146  * <programlisting>
18147  * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18148  * </programlisting>
18149  * Common schemes include "file", "http", "ftp", etc.
18150  *
18151  * This call does no blocking I/O.
18152  *
18153  * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18154  */
18155
18156
18157 /**
18158  * g_file_has_parent:
18159  * @file: input #GFile
18160  * @parent: (allow-none): the parent to check for, or %NULL
18161  *
18162  * Checks if @file has a parent, and optionally, if it is @parent.
18163  *
18164  * If @parent is %NULL then this function returns %TRUE if @file has any
18165  * parent at all.  If @parent is non-%NULL then %TRUE is only returned
18166  * if @file is a child of @parent.
18167  *
18168  * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18169  * Since: 2.24
18170  */
18171
18172
18173 /**
18174  * g_file_has_prefix:
18175  * @file: input #GFile
18176  * @prefix: input #GFile
18177  *
18178  * Checks whether @file has the prefix specified by @prefix.
18179  *
18180  * In other words, if the names of initial elements of @file's
18181  * pathname match @prefix. Only full pathname elements are matched,
18182  * so a path like /foo is not considered a prefix of /foobar, only
18183  * of /foo/bar.
18184  *
18185  * This call does no I/O, as it works purely on names. As such it can
18186  * sometimes return %FALSE even if @file is inside a @prefix (from a
18187  * filesystem point of view), because the prefix of @file is an alias
18188  * of @prefix.
18189  *
18190  * Virtual: prefix_matches
18191  * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18192  */
18193
18194
18195 /**
18196  * g_file_has_uri_scheme:
18197  * @file: input #GFile
18198  * @uri_scheme: a string containing a URI scheme
18199  *
18200  * Checks to see if a #GFile has a given URI scheme.
18201  *
18202  * This call does no blocking I/O.
18203  *
18204  * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18205  */
18206
18207
18208 /**
18209  * g_file_hash:
18210  * @file: (type GFile): #gconstpointer to a #GFile
18211  *
18212  * Creates a hash value for a #GFile.
18213  *
18214  * This call does no blocking I/O.
18215  *
18216  * Virtual: hash
18217  * 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.
18218  */
18219
18220
18221 /**
18222  * g_file_icon_get_file:
18223  * @icon: a #GIcon.
18224  *
18225  * Gets the #GFile associated with the given @icon.
18226  *
18227  * Returns: (transfer none): a #GFile, or %NULL.
18228  */
18229
18230
18231 /**
18232  * g_file_icon_new:
18233  * @file: a #GFile.
18234  *
18235  * Creates a new icon for a file.
18236  *
18237  * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18238  */
18239
18240
18241 /**
18242  * g_file_info_clear_status:
18243  * @info: a #GFileInfo.
18244  *
18245  * Clears the status information from @info.
18246  */
18247
18248
18249 /**
18250  * g_file_info_copy_into:
18251  * @src_info: source to copy attributes from.
18252  * @dest_info: destination to copy attributes to.
18253  *
18254  * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18255  * from @src_info to @dest_info.
18256  */
18257
18258
18259 /**
18260  * g_file_info_dup:
18261  * @other: a #GFileInfo.
18262  *
18263  * Duplicates a file info structure.
18264  *
18265  * Returns: (transfer full): a duplicate #GFileInfo of @other.
18266  */
18267
18268
18269 /**
18270  * g_file_info_get_attribute_as_string:
18271  * @info: a #GFileInfo.
18272  * @attribute: a file attribute key.
18273  *
18274  * Gets the value of a attribute, formated as a string.
18275  * This escapes things as needed to make the string valid
18276  * utf8.
18277  *
18278  * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18279  */
18280
18281
18282 /**
18283  * g_file_info_get_attribute_boolean:
18284  * @info: a #GFileInfo.
18285  * @attribute: a file attribute key.
18286  *
18287  * Gets the value of a boolean attribute. If the attribute does not
18288  * contain a boolean value, %FALSE will be returned.
18289  *
18290  * Returns: the boolean value contained within the attribute.
18291  */
18292
18293
18294 /**
18295  * g_file_info_get_attribute_byte_string:
18296  * @info: a #GFileInfo.
18297  * @attribute: a file attribute key.
18298  *
18299  * Gets the value of a byte string attribute. If the attribute does
18300  * not contain a byte string, %NULL will be returned.
18301  *
18302  * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18303  */
18304
18305
18306 /**
18307  * g_file_info_get_attribute_data:
18308  * @info: a #GFileInfo
18309  * @attribute: a file attribute key
18310  * @type: (out) (allow-none): return location for the attribute type, or %NULL
18311  * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18312  * @status: (out) (allow-none): return location for the attribute status, or %NULL
18313  *
18314  * Gets the attribute type, value and status for an attribute key.
18315  *
18316  * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18317  */
18318
18319
18320 /**
18321  * g_file_info_get_attribute_int32:
18322  * @info: a #GFileInfo.
18323  * @attribute: a file attribute key.
18324  *
18325  * Gets a signed 32-bit integer contained within the attribute. If the
18326  * attribute does not contain a signed 32-bit integer, or is invalid,
18327  * 0 will be returned.
18328  *
18329  * Returns: a signed 32-bit integer from the attribute.
18330  */
18331
18332
18333 /**
18334  * g_file_info_get_attribute_int64:
18335  * @info: a #GFileInfo.
18336  * @attribute: a file attribute key.
18337  *
18338  * Gets a signed 64-bit integer contained within the attribute. If the
18339  * attribute does not contain an signed 64-bit integer, or is invalid,
18340  * 0 will be returned.
18341  *
18342  * Returns: a signed 64-bit integer from the attribute.
18343  */
18344
18345
18346 /**
18347  * g_file_info_get_attribute_object:
18348  * @info: a #GFileInfo.
18349  * @attribute: a file attribute key.
18350  *
18351  * Gets the value of a #GObject attribute. If the attribute does
18352  * not contain a #GObject, %NULL will be returned.
18353  *
18354  * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18355  */
18356
18357
18358 /**
18359  * g_file_info_get_attribute_status:
18360  * @info: a #GFileInfo
18361  * @attribute: a file attribute key
18362  *
18363  * Gets the attribute status for an attribute key.
18364  *
18365  * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18366  */
18367
18368
18369 /**
18370  * g_file_info_get_attribute_string:
18371  * @info: a #GFileInfo.
18372  * @attribute: a file attribute key.
18373  *
18374  * Gets the value of a string attribute. If the attribute does
18375  * not contain a string, %NULL will be returned.
18376  *
18377  * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18378  */
18379
18380
18381 /**
18382  * g_file_info_get_attribute_stringv:
18383  * @info: a #GFileInfo.
18384  * @attribute: a file attribute key.
18385  *
18386  * Gets the value of a stringv attribute. If the attribute does
18387  * not contain a stringv, %NULL will be returned.
18388  *
18389  * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18390  * Since: 2.22
18391  */
18392
18393
18394 /**
18395  * g_file_info_get_attribute_type:
18396  * @info: a #GFileInfo.
18397  * @attribute: a file attribute key.
18398  *
18399  * Gets the attribute type for an attribute key.
18400  *
18401  * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18402  */
18403
18404
18405 /**
18406  * g_file_info_get_attribute_uint32:
18407  * @info: a #GFileInfo.
18408  * @attribute: a file attribute key.
18409  *
18410  * Gets an unsigned 32-bit integer contained within the attribute. If the
18411  * attribute does not contain an unsigned 32-bit integer, or is invalid,
18412  * 0 will be returned.
18413  *
18414  * Returns: an unsigned 32-bit integer from the attribute.
18415  */
18416
18417
18418 /**
18419  * g_file_info_get_attribute_uint64:
18420  * @info: a #GFileInfo.
18421  * @attribute: a file attribute key.
18422  *
18423  * Gets a unsigned 64-bit integer contained within the attribute. If the
18424  * attribute does not contain an unsigned 64-bit integer, or is invalid,
18425  * 0 will be returned.
18426  *
18427  * Returns: a unsigned 64-bit integer from the attribute.
18428  */
18429
18430
18431 /**
18432  * g_file_info_get_content_type:
18433  * @info: a #GFileInfo.
18434  *
18435  * Gets the file's content type.
18436  *
18437  * Returns: a string containing the file's content type.
18438  */
18439
18440
18441 /**
18442  * g_file_info_get_display_name:
18443  * @info: a #GFileInfo.
18444  *
18445  * Gets a display name for a file.
18446  *
18447  * Returns: a string containing the display name.
18448  */
18449
18450
18451 /**
18452  * g_file_info_get_edit_name:
18453  * @info: a #GFileInfo.
18454  *
18455  * Gets the edit name for a file.
18456  *
18457  * Returns: a string containing the edit name.
18458  */
18459
18460
18461 /**
18462  * g_file_info_get_etag:
18463  * @info: a #GFileInfo.
18464  *
18465  * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18466  * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18467  *
18468  * Returns: a string containing the value of the "etag:value" attribute.
18469  */
18470
18471
18472 /**
18473  * g_file_info_get_file_type:
18474  * @info: a #GFileInfo.
18475  *
18476  * Gets a file's type (whether it is a regular file, symlink, etc).
18477  * This is different from the file's content type, see g_file_info_get_content_type().
18478  *
18479  * Returns: a #GFileType for the given file.
18480  */
18481
18482
18483 /**
18484  * g_file_info_get_icon:
18485  * @info: a #GFileInfo.
18486  *
18487  * Gets the icon for a file.
18488  *
18489  * Returns: (transfer none): #GIcon for the given @info.
18490  */
18491
18492
18493 /**
18494  * g_file_info_get_is_backup:
18495  * @info: a #GFileInfo.
18496  *
18497  * Checks if a file is a backup file.
18498  *
18499  * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18500  */
18501
18502
18503 /**
18504  * g_file_info_get_is_hidden:
18505  * @info: a #GFileInfo.
18506  *
18507  * Checks if a file is hidden.
18508  *
18509  * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18510  */
18511
18512
18513 /**
18514  * g_file_info_get_is_symlink:
18515  * @info: a #GFileInfo.
18516  *
18517  * Checks if a file is a symlink.
18518  *
18519  * Returns: %TRUE if the given @info is a symlink.
18520  */
18521
18522
18523 /**
18524  * g_file_info_get_modification_time:
18525  * @info: a #GFileInfo.
18526  * @result: (out caller-allocates): a #GTimeVal.
18527  *
18528  * Gets the modification time of the current @info and sets it
18529  * in @result.
18530  */
18531
18532
18533 /**
18534  * g_file_info_get_name:
18535  * @info: a #GFileInfo.
18536  *
18537  * Gets the name for a file.
18538  *
18539  * Returns: a string containing the file name.
18540  */
18541
18542
18543 /**
18544  * g_file_info_get_size:
18545  * @info: a #GFileInfo.
18546  *
18547  * Gets the file's size.
18548  *
18549  * Returns: a #goffset containing the file's size.
18550  */
18551
18552
18553 /**
18554  * g_file_info_get_sort_order:
18555  * @info: a #GFileInfo.
18556  *
18557  * Gets the value of the sort_order attribute from the #GFileInfo.
18558  * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18559  *
18560  * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18561  */
18562
18563
18564 /**
18565  * g_file_info_get_symbolic_icon:
18566  * @info: a #GFileInfo.
18567  *
18568  * Gets the symbolic icon for a file.
18569  *
18570  * Returns: (transfer none): #GIcon for the given @info.
18571  * Since: 2.34
18572  */
18573
18574
18575 /**
18576  * g_file_info_get_symlink_target:
18577  * @info: a #GFileInfo.
18578  *
18579  * Gets the symlink target for a given #GFileInfo.
18580  *
18581  * Returns: a string containing the symlink target.
18582  */
18583
18584
18585 /**
18586  * g_file_info_has_attribute:
18587  * @info: a #GFileInfo.
18588  * @attribute: a file attribute key.
18589  *
18590  * Checks if a file info structure has an attribute named @attribute.
18591  *
18592  * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18593  */
18594
18595
18596 /**
18597  * g_file_info_has_namespace:
18598  * @info: a #GFileInfo.
18599  * @name_space: a file attribute namespace.
18600  *
18601  * Checks if a file info structure has an attribute in the
18602  * specified @name_space.
18603  *
18604  * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18605  * Since: 2.22
18606  */
18607
18608
18609 /**
18610  * g_file_info_list_attributes:
18611  * @info: a #GFileInfo.
18612  * @name_space: a file attribute key's namespace.
18613  *
18614  * Lists the file info structure's attributes.
18615  *
18616  * 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.
18617  */
18618
18619
18620 /**
18621  * g_file_info_new:
18622  *
18623  * Creates a new file info structure.
18624  *
18625  * Returns: a #GFileInfo.
18626  */
18627
18628
18629 /**
18630  * g_file_info_remove_attribute:
18631  * @info: a #GFileInfo.
18632  * @attribute: a file attribute key.
18633  *
18634  * Removes all cases of @attribute from @info if it exists.
18635  */
18636
18637
18638 /**
18639  * g_file_info_set_attribute:
18640  * @info: a #GFileInfo.
18641  * @attribute: a file attribute key.
18642  * @type: a #GFileAttributeType
18643  * @value_p: pointer to the value
18644  *
18645  * Sets the @attribute to contain the given value, if possible. To unset the
18646  * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18647  */
18648
18649
18650 /**
18651  * g_file_info_set_attribute_boolean:
18652  * @info: a #GFileInfo.
18653  * @attribute: a file attribute key.
18654  * @attr_value: a boolean value.
18655  *
18656  * Sets the @attribute to contain the given @attr_value,
18657  * if possible.
18658  */
18659
18660
18661 /**
18662  * g_file_info_set_attribute_byte_string:
18663  * @info: a #GFileInfo.
18664  * @attribute: a file attribute key.
18665  * @attr_value: a byte string.
18666  *
18667  * Sets the @attribute to contain the given @attr_value,
18668  * if possible.
18669  */
18670
18671
18672 /**
18673  * g_file_info_set_attribute_int32:
18674  * @info: a #GFileInfo.
18675  * @attribute: a file attribute key.
18676  * @attr_value: a signed 32-bit integer
18677  *
18678  * Sets the @attribute to contain the given @attr_value,
18679  * if possible.
18680  */
18681
18682
18683 /**
18684  * g_file_info_set_attribute_int64:
18685  * @info: a #GFileInfo.
18686  * @attribute: attribute name to set.
18687  * @attr_value: int64 value to set attribute to.
18688  *
18689  * Sets the @attribute to contain the given @attr_value,
18690  * if possible.
18691  */
18692
18693
18694 /**
18695  * g_file_info_set_attribute_mask:
18696  * @info: a #GFileInfo.
18697  * @mask: a #GFileAttributeMatcher.
18698  *
18699  * Sets @mask on @info to match specific attribute types.
18700  */
18701
18702
18703 /**
18704  * g_file_info_set_attribute_object:
18705  * @info: a #GFileInfo.
18706  * @attribute: a file attribute key.
18707  * @attr_value: a #GObject.
18708  *
18709  * Sets the @attribute to contain the given @attr_value,
18710  * if possible.
18711  */
18712
18713
18714 /**
18715  * g_file_info_set_attribute_status:
18716  * @info: a #GFileInfo
18717  * @attribute: a file attribute key
18718  * @status: a #GFileAttributeStatus
18719  *
18720  * Sets the attribute status for an attribute key. This is only
18721  * needed by external code that implement g_file_set_attributes_from_info()
18722  * or similar functions.
18723  *
18724  * The attribute must exist in @info for this to work. Otherwise %FALSE
18725  * is returned and @info is unchanged.
18726  *
18727  * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18728  * Since: 2.22
18729  */
18730
18731
18732 /**
18733  * g_file_info_set_attribute_string:
18734  * @info: a #GFileInfo.
18735  * @attribute: a file attribute key.
18736  * @attr_value: a UTF-8 string.
18737  *
18738  * Sets the @attribute to contain the given @attr_value,
18739  * if possible.
18740  */
18741
18742
18743 /**
18744  * g_file_info_set_attribute_stringv:
18745  * @info: a #GFileInfo.
18746  * @attribute: a file attribute key
18747  * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18748  *
18749  * Sets the @attribute to contain the given @attr_value,
18750  * if possible.
18751  *
18752  * Sinze: 2.22
18753  */
18754
18755
18756 /**
18757  * g_file_info_set_attribute_uint32:
18758  * @info: a #GFileInfo.
18759  * @attribute: a file attribute key.
18760  * @attr_value: an unsigned 32-bit integer.
18761  *
18762  * Sets the @attribute to contain the given @attr_value,
18763  * if possible.
18764  */
18765
18766
18767 /**
18768  * g_file_info_set_attribute_uint64:
18769  * @info: a #GFileInfo.
18770  * @attribute: a file attribute key.
18771  * @attr_value: an unsigned 64-bit integer.
18772  *
18773  * Sets the @attribute to contain the given @attr_value,
18774  * if possible.
18775  */
18776
18777
18778 /**
18779  * g_file_info_set_content_type:
18780  * @info: a #GFileInfo.
18781  * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18782  *
18783  * Sets the content type attribute for a given #GFileInfo.
18784  * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18785  */
18786
18787
18788 /**
18789  * g_file_info_set_display_name:
18790  * @info: a #GFileInfo.
18791  * @display_name: a string containing a display name.
18792  *
18793  * Sets the display name for the current #GFileInfo.
18794  * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18795  */
18796
18797
18798 /**
18799  * g_file_info_set_edit_name:
18800  * @info: a #GFileInfo.
18801  * @edit_name: a string containing an edit name.
18802  *
18803  * Sets the edit name for the current file.
18804  * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18805  */
18806
18807
18808 /**
18809  * g_file_info_set_file_type:
18810  * @info: a #GFileInfo.
18811  * @type: a #GFileType.
18812  *
18813  * Sets the file type in a #GFileInfo to @type.
18814  * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18815  */
18816
18817
18818 /**
18819  * g_file_info_set_icon:
18820  * @info: a #GFileInfo.
18821  * @icon: a #GIcon.
18822  *
18823  * Sets the icon for a given #GFileInfo.
18824  * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18825  */
18826
18827
18828 /**
18829  * g_file_info_set_is_hidden:
18830  * @info: a #GFileInfo.
18831  * @is_hidden: a #gboolean.
18832  *
18833  * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18834  * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18835  */
18836
18837
18838 /**
18839  * g_file_info_set_is_symlink:
18840  * @info: a #GFileInfo.
18841  * @is_symlink: a #gboolean.
18842  *
18843  * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18844  * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18845  */
18846
18847
18848 /**
18849  * g_file_info_set_modification_time:
18850  * @info: a #GFileInfo.
18851  * @mtime: a #GTimeVal.
18852  *
18853  * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18854  * info to the given time value.
18855  */
18856
18857
18858 /**
18859  * g_file_info_set_name:
18860  * @info: a #GFileInfo.
18861  * @name: a string containing a name.
18862  *
18863  * Sets the name attribute for the current #GFileInfo.
18864  * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18865  */
18866
18867
18868 /**
18869  * g_file_info_set_size:
18870  * @info: a #GFileInfo.
18871  * @size: a #goffset containing the file's size.
18872  *
18873  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18874  * to the given size.
18875  */
18876
18877
18878 /**
18879  * g_file_info_set_sort_order:
18880  * @info: a #GFileInfo.
18881  * @sort_order: a sort order integer.
18882  *
18883  * Sets the sort order attribute in the file info structure. See
18884  * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18885  */
18886
18887
18888 /**
18889  * g_file_info_set_symbolic_icon:
18890  * @info: a #GFileInfo.
18891  * @icon: a #GIcon.
18892  *
18893  * Sets the symbolic icon for a given #GFileInfo.
18894  * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18895  *
18896  * Since: 2.34
18897  */
18898
18899
18900 /**
18901  * g_file_info_set_symlink_target:
18902  * @info: a #GFileInfo.
18903  * @symlink_target: a static string containing a path to a symlink target.
18904  *
18905  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18906  * to the given symlink target.
18907  */
18908
18909
18910 /**
18911  * g_file_info_unset_attribute_mask:
18912  * @info: #GFileInfo.
18913  *
18914  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18915  * is set.
18916  */
18917
18918
18919 /**
18920  * g_file_input_stream_query_info:
18921  * @stream: a #GFileInputStream.
18922  * @attributes: a file attribute query string.
18923  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18924  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18925  *
18926  * Queries a file input stream the given @attributes. This function blocks
18927  * while querying the stream. For the asynchronous (non-blocking) version
18928  * of this function, see g_file_input_stream_query_info_async(). While the
18929  * stream is blocked, the stream will set the pending flag internally, and
18930  * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18931  *
18932  * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18933  */
18934
18935
18936 /**
18937  * g_file_input_stream_query_info_async:
18938  * @stream: a #GFileInputStream.
18939  * @attributes: a file attribute query string.
18940  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18941  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18942  * @callback: (scope async): callback to call when the request is satisfied
18943  * @user_data: (closure): the data to pass to callback function
18944  *
18945  * Queries the stream information asynchronously.
18946  * When the operation is finished @callback will be called.
18947  * You can then call g_file_input_stream_query_info_finish()
18948  * to get the result of the operation.
18949  *
18950  * For the synchronous version of this function,
18951  * see g_file_input_stream_query_info().
18952  *
18953  * If @cancellable is not %NULL, then the operation can be cancelled by
18954  * triggering the cancellable object from another thread. If the operation
18955  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18956  */
18957
18958
18959 /**
18960  * g_file_input_stream_query_info_finish:
18961  * @stream: a #GFileInputStream.
18962  * @result: a #GAsyncResult.
18963  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18964  *
18965  * Finishes an asynchronous info query operation.
18966  *
18967  * Returns: (transfer full): #GFileInfo.
18968  */
18969
18970
18971 /**
18972  * g_file_io_stream_get_etag:
18973  * @stream: a #GFileIOStream.
18974  *
18975  * Gets the entity tag for the file when it has been written.
18976  * This must be called after the stream has been written
18977  * and closed, as the etag can change while writing.
18978  *
18979  * Returns: the entity tag for the stream.
18980  * Since: 2.22
18981  */
18982
18983
18984 /**
18985  * g_file_io_stream_query_info:
18986  * @stream: a #GFileIOStream.
18987  * @attributes: a file attribute query string.
18988  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18989  * @error: a #GError, %NULL to ignore.
18990  *
18991  * Queries a file io stream for the given @attributes.
18992  * This function blocks while querying the stream. For the asynchronous
18993  * version of this function, see g_file_io_stream_query_info_async().
18994  * While the stream is blocked, the stream will set the pending flag
18995  * internally, and any other operations on the stream will fail with
18996  * %G_IO_ERROR_PENDING.
18997  *
18998  * Can fail if the stream was already closed (with @error being set to
18999  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19000  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19001  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
19002  * all cases of failure, %NULL will be returned.
19003  *
19004  * If @cancellable is not %NULL, then the operation can be cancelled by
19005  * triggering the cancellable object from another thread. If the operation
19006  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19007  * be returned.
19008  *
19009  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19010  * Since: 2.22
19011  */
19012
19013
19014 /**
19015  * g_file_io_stream_query_info_async:
19016  * @stream: a #GFileIOStream.
19017  * @attributes: a file attribute query string.
19018  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19019  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19020  * @callback: (scope async): callback to call when the request is satisfied
19021  * @user_data: (closure): the data to pass to callback function
19022  *
19023  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19024  * @callback will be called with a #GAsyncResult which can be used to
19025  * finish the operation with g_file_io_stream_query_info_finish().
19026  *
19027  * For the synchronous version of this function, see
19028  * g_file_io_stream_query_info().
19029  *
19030  * Since: 2.22
19031  */
19032
19033
19034 /**
19035  * g_file_io_stream_query_info_finish:
19036  * @stream: a #GFileIOStream.
19037  * @result: a #GAsyncResult.
19038  * @error: a #GError, %NULL to ignore.
19039  *
19040  * Finalizes the asynchronous query started
19041  * by g_file_io_stream_query_info_async().
19042  *
19043  * Returns: (transfer full): A #GFileInfo for the finished query.
19044  * Since: 2.22
19045  */
19046
19047
19048 /**
19049  * g_file_is_native:
19050  * @file: input #GFile
19051  *
19052  * Checks to see if a file is native to the platform.
19053  *
19054  * A native file s one expressed in the platform-native filename format,
19055  * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19056  * as it might be on a locally mounted remote filesystem.
19057  *
19058  * On some systems non-native files may be available using the native
19059  * filesystem via a userspace filesystem (FUSE), in these cases this call
19060  * will return %FALSE, but g_file_get_path() will still return a native path.
19061  *
19062  * This call does no blocking I/O.
19063  *
19064  * Returns: %TRUE if @file is native
19065  */
19066
19067
19068 /**
19069  * g_file_load_contents:
19070  * @file: input #GFile
19071  * @cancellable: optional #GCancellable object, %NULL to ignore
19072  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19073  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19074  * @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
19075  * @error: a #GError, or %NULL
19076  *
19077  * Loads the content of the file into memory. The data is always
19078  * zero-terminated, but this is not included in the resultant @length.
19079  * The returned @content should be freed with g_free() when no longer
19080  * needed.
19081  *
19082  * If @cancellable is not %NULL, then the operation can be cancelled by
19083  * triggering the cancellable object from another thread. If the operation
19084  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19085  *
19086  * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19087  */
19088
19089
19090 /**
19091  * g_file_load_contents_async:
19092  * @file: input #GFile
19093  * @cancellable: optional #GCancellable object, %NULL to ignore
19094  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19095  * @user_data: the data to pass to callback function
19096  *
19097  * Starts an asynchronous load of the @file's contents.
19098  *
19099  * For more details, see g_file_load_contents() which is
19100  * the synchronous version of this call.
19101  *
19102  * When the load operation has completed, @callback will be called
19103  * with @user data. To finish the operation, call
19104  * g_file_load_contents_finish() with the #GAsyncResult returned by
19105  * the @callback.
19106  *
19107  * If @cancellable is not %NULL, then the operation can be cancelled by
19108  * triggering the cancellable object from another thread. If the operation
19109  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19110  */
19111
19112
19113 /**
19114  * g_file_load_contents_finish:
19115  * @file: input #GFile
19116  * @res: a #GAsyncResult
19117  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19118  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19119  * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19120  * @error: a #GError, or %NULL
19121  *
19122  * Finishes an asynchronous load of the @file's contents.
19123  * The contents are placed in @contents, and @length is set to the
19124  * size of the @contents string. The @content should be freed with
19125  * g_free() when no longer needed. If @etag_out is present, it will be
19126  * set to the new entity tag for the @file.
19127  *
19128  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19129  */
19130
19131
19132 /**
19133  * g_file_load_partial_contents_async: (skip)
19134  * @file: input #GFile
19135  * @cancellable: optional #GCancellable object, %NULL to ignore
19136  * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19137  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19138  * @user_data: the data to pass to the callback functions
19139  *
19140  * Reads the partial contents of a file. A #GFileReadMoreCallback should
19141  * be used to stop reading from the file when appropriate, else this
19142  * function will behave exactly as g_file_load_contents_async(). This
19143  * operation can be finished by g_file_load_partial_contents_finish().
19144  *
19145  * Users of this function should be aware that @user_data is passed to
19146  * both the @read_more_callback and the @callback.
19147  *
19148  * If @cancellable is not %NULL, then the operation can be cancelled by
19149  * triggering the cancellable object from another thread. If the operation
19150  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19151  */
19152
19153
19154 /**
19155  * g_file_load_partial_contents_finish:
19156  * @file: input #GFile
19157  * @res: a #GAsyncResult
19158  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19159  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19160  * @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
19161  * @error: a #GError, or %NULL
19162  *
19163  * Finishes an asynchronous partial load operation that was started
19164  * with g_file_load_partial_contents_async(). The data is always
19165  * zero-terminated, but this is not included in the resultant @length.
19166  * The returned @content should be freed with g_free() when no longer
19167  * needed.
19168  *
19169  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19170  */
19171
19172
19173 /**
19174  * g_file_make_directory:
19175  * @file: input #GFile
19176  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19177  * @error: a #GError, or %NULL
19178  *
19179  * Creates a directory. Note that this will only create a child directory
19180  * of the immediate parent directory of the path or URI given by the #GFile.
19181  * To recursively create directories, see g_file_make_directory_with_parents().
19182  * This function will fail if the parent directory does not exist, setting
19183  * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19184  * creating directories, this function will fail, setting @error to
19185  * %G_IO_ERROR_NOT_SUPPORTED.
19186  *
19187  * For a local #GFile the newly created directory will have the default
19188  * (current) ownership and permissions of the current process.
19189  *
19190  * If @cancellable is not %NULL, then the operation can be cancelled by
19191  * triggering the cancellable object from another thread. If the operation
19192  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19193  *
19194  * Returns: %TRUE on successful creation, %FALSE otherwise.
19195  */
19196
19197
19198 /**
19199  * g_file_make_directory_with_parents:
19200  * @file: input #GFile
19201  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19202  * @error: a #GError, or %NULL
19203  *
19204  * Creates a directory and any parent directories that may not
19205  * exist similar to 'mkdir -p'. If the file system does not support
19206  * creating directories, this function will fail, setting @error to
19207  * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19208  * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19209  * the similar g_mkdir_with_parents().
19210  *
19211  * For a local #GFile the newly created directories will have the default
19212  * (current) ownership and permissions of the current process.
19213  *
19214  * If @cancellable is not %NULL, then the operation can be cancelled by
19215  * triggering the cancellable object from another thread. If the operation
19216  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19217  *
19218  * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19219  * Since: 2.18
19220  */
19221
19222
19223 /**
19224  * g_file_make_symbolic_link:
19225  * @file: a #GFile with the name of the symlink to create
19226  * @symlink_value: a string with the path for the target of the new symlink
19227  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19228  * @error: a #GError
19229  *
19230  * Creates a symbolic link named @file which contains the string
19231  * @symlink_value.
19232  *
19233  * If @cancellable is not %NULL, then the operation can be cancelled by
19234  * triggering the cancellable object from another thread. If the operation
19235  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19236  *
19237  * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19238  */
19239
19240
19241 /**
19242  * g_file_monitor:
19243  * @file: input #GFile
19244  * @flags: a set of #GFileMonitorFlags
19245  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19246  * @error: a #GError, or %NULL
19247  *
19248  * Obtains a file or directory monitor for the given file,
19249  * depending on the type of the file.
19250  *
19251  * If @cancellable is not %NULL, then the operation can be cancelled by
19252  * triggering the cancellable object from another thread. If the operation
19253  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19254  *
19255  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19256  * Since: 2.18
19257  */
19258
19259
19260 /**
19261  * g_file_monitor_cancel:
19262  * @monitor: a #GFileMonitor.
19263  *
19264  * Cancels a file monitor.
19265  *
19266  * Returns: %TRUE if monitor was cancelled.
19267  */
19268
19269
19270 /**
19271  * g_file_monitor_directory:
19272  * @file: input #GFile
19273  * @flags: a set of #GFileMonitorFlags
19274  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19275  * @error: a #GError, or %NULL
19276  *
19277  * Obtains a directory monitor for the given file.
19278  * This may fail if directory monitoring is not supported.
19279  *
19280  * If @cancellable is not %NULL, then the operation can be cancelled by
19281  * triggering the cancellable object from another thread. If the operation
19282  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19283  *
19284  * Virtual: monitor_dir
19285  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19286  */
19287
19288
19289 /**
19290  * g_file_monitor_emit_event:
19291  * @monitor: a #GFileMonitor.
19292  * @child: a #GFile.
19293  * @other_file: a #GFile.
19294  * @event_type: a set of #GFileMonitorEvent flags.
19295  *
19296  * Emits the #GFileMonitor::changed signal if a change
19297  * has taken place. Should be called from file monitor
19298  * implementations only.
19299  *
19300  * The signal will be emitted from an idle handler (in the <link
19301  * linkend="g-main-context-push-thread-default">thread-default main
19302  * context</link>).
19303  */
19304
19305
19306 /**
19307  * g_file_monitor_file:
19308  * @file: input #GFile
19309  * @flags: a set of #GFileMonitorFlags
19310  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19311  * @error: a #GError, or %NULL
19312  *
19313  * Obtains a file monitor for the given file. If no file notification
19314  * mechanism exists, then regular polling of the file is used.
19315  *
19316  * If @cancellable is not %NULL, then the operation can be cancelled by
19317  * triggering the cancellable object from another thread. If the operation
19318  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19319  *
19320  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19321  */
19322
19323
19324 /**
19325  * g_file_monitor_is_cancelled:
19326  * @monitor: a #GFileMonitor
19327  *
19328  * Returns whether the monitor is canceled.
19329  *
19330  * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19331  */
19332
19333
19334 /**
19335  * g_file_monitor_set_rate_limit:
19336  * @monitor: a #GFileMonitor.
19337  * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19338  *
19339  * Sets the rate limit to which the @monitor will report
19340  * consecutive change events to the same file.
19341  */
19342
19343
19344 /**
19345  * g_file_mount_enclosing_volume:
19346  * @location: input #GFile
19347  * @flags: flags affecting the operation
19348  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19349  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19350  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19351  * @user_data: the data to pass to callback function
19352  *
19353  * Starts a @mount_operation, mounting the volume that contains
19354  * the file @location.
19355  *
19356  * When this operation has completed, @callback will be called with
19357  * @user_user data, and the operation can be finalized with
19358  * g_file_mount_enclosing_volume_finish().
19359  *
19360  * If @cancellable is not %NULL, then the operation can be cancelled by
19361  * triggering the cancellable object from another thread. If the operation
19362  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19363  */
19364
19365
19366 /**
19367  * g_file_mount_enclosing_volume_finish:
19368  * @location: input #GFile
19369  * @result: a #GAsyncResult
19370  * @error: a #GError, or %NULL
19371  *
19372  * Finishes a mount operation started by g_file_mount_enclosing_volume().
19373  *
19374  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19375  */
19376
19377
19378 /**
19379  * g_file_mount_mountable:
19380  * @file: input #GFile
19381  * @flags: flags affecting the operation
19382  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19383  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19384  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19385  * @user_data: (closure): the data to pass to callback function
19386  *
19387  * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19388  * Using @mount_operation, you can request callbacks when, for instance,
19389  * passwords are needed during authentication.
19390  *
19391  * If @cancellable is not %NULL, then the operation can be cancelled by
19392  * triggering the cancellable object from another thread. If the operation
19393  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19394  *
19395  * When the operation is finished, @callback will be called.
19396  * You can then call g_file_mount_mountable_finish() to get
19397  * the result of the operation.
19398  */
19399
19400
19401 /**
19402  * g_file_mount_mountable_finish:
19403  * @file: input #GFile
19404  * @result: a #GAsyncResult
19405  * @error: a #GError, or %NULL
19406  *
19407  * Finishes a mount operation. See g_file_mount_mountable() for details.
19408  *
19409  * Finish an asynchronous mount operation that was started
19410  * with g_file_mount_mountable().
19411  *
19412  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19413  */
19414
19415
19416 /**
19417  * g_file_move:
19418  * @source: #GFile pointing to the source location
19419  * @destination: #GFile pointing to the destination location
19420  * @flags: set of #GFileCopyFlags
19421  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19422  * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
19423  * @progress_callback_data: (closure): gpointer to user data for the callback function
19424  * @error: #GError for returning error conditions, or %NULL
19425  *
19426  * Tries to move the file or directory @source to the location specified
19427  * by @destination. If native move operations are supported then this is
19428  * used, otherwise a copy + delete fallback is used. The native
19429  * implementation may support moving directories (for instance on moves
19430  * inside the same filesystem), but the fallback code does not.
19431  *
19432  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19433  * existing @destination file is overwritten.
19434  *
19435  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19436  * will be copied as symlinks, otherwise the target of the
19437  * @source symlink will be copied.
19438  *
19439  * If @cancellable is not %NULL, then the operation can be cancelled by
19440  * triggering the cancellable object from another thread. If the operation
19441  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19442  *
19443  * If @progress_callback is not %NULL, then the operation can be monitored
19444  * by setting this to a #GFileProgressCallback function.
19445  * @progress_callback_data will be passed to this function. It is
19446  * guaranteed that this callback will be called after all data has been
19447  * transferred with the total number of bytes copied during the operation.
19448  *
19449  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
19450  * error is returned, independent on the status of the @destination.
19451  *
19452  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
19453  * then the error %G_IO_ERROR_EXISTS is returned.
19454  *
19455  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
19456  * error is returned. If trying to overwrite a directory with a directory the
19457  * %G_IO_ERROR_WOULD_MERGE error is returned.
19458  *
19459  * If the source is a directory and the target does not exist, or
19460  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
19461  * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
19462  * move operation isn't available).
19463  *
19464  * Returns: %TRUE on successful move, %FALSE otherwise.
19465  */
19466
19467
19468 /**
19469  * g_file_new_for_commandline_arg:
19470  * @arg: a command line string
19471  *
19472  * Creates a #GFile with the given argument from the command line.
19473  * The value of @arg can be either a URI, an absolute path or a
19474  * relative path resolved relative to the current working directory.
19475  * This operation never fails, but the returned object might not
19476  * support any I/O operation if @arg points to a malformed path.
19477  *
19478  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19479  */
19480
19481
19482 /**
19483  * g_file_new_for_path:
19484  * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19485  *
19486  * Constructs a #GFile for a given path. This operation never
19487  * fails, but the returned object might not support any I/O
19488  * operation if @path is malformed.
19489  *
19490  * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19491  */
19492
19493
19494 /**
19495  * g_file_new_for_uri:
19496  * @uri: a UTF-8 string containing a URI
19497  *
19498  * Constructs a #GFile for a given URI. This operation never
19499  * fails, but the returned object might not support any I/O
19500  * operation if @uri is malformed or if the uri type is
19501  * not supported.
19502  *
19503  * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19504  */
19505
19506
19507 /**
19508  * g_file_new_tmp:
19509  * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
19510  * @iostream: (out): on return, a #GFileIOStream for the created file
19511  * @error: a #GError, or %NULL
19512  *
19513  * Opens a file in the preferred directory for temporary files (as
19514  * returned by g_get_tmp_dir()) and returns a #GFile and
19515  * #GFileIOStream pointing to it.
19516  *
19517  * @tmpl should be a string in the GLib file name encoding
19518  * containing a sequence of six 'X' characters, and containing no
19519  * directory components. If it is %NULL, a default template is used.
19520  *
19521  * Unlike the other #GFile constructors, this will return %NULL if
19522  * a temporary file could not be created.
19523  *
19524  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19525  * Since: 2.32
19526  */
19527
19528
19529 /**
19530  * g_file_open_readwrite:
19531  * @file: #GFile to open
19532  * @cancellable: (allow-none): a #GCancellable
19533  * @error: a #GError, or %NULL
19534  *
19535  * Opens an existing file for reading and writing. The result is
19536  * a #GFileIOStream that can be used to read and write the contents
19537  * of the file.
19538  *
19539  * If @cancellable is not %NULL, then the operation can be cancelled
19540  * by triggering the cancellable object from another thread. If the
19541  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19542  * returned.
19543  *
19544  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19545  * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19546  * error will be returned. Other errors are possible too, and depend on
19547  * what kind of filesystem the file is on. Note that in many non-local
19548  * file cases read and write streams are not supported, so make sure you
19549  * really need to do read and write streaming, rather than just opening
19550  * for reading or writing.
19551  *
19552  * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19553  * Since: 2.22
19554  */
19555
19556
19557 /**
19558  * g_file_open_readwrite_async:
19559  * @file: input #GFile
19560  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19561  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19562  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19563  * @user_data: (closure): the data to pass to callback function
19564  *
19565  * Asynchronously opens @file for reading and writing.
19566  *
19567  * For more details, see g_file_open_readwrite() which is
19568  * the synchronous version of this call.
19569  *
19570  * When the operation is finished, @callback will be called.
19571  * You can then call g_file_open_readwrite_finish() to get
19572  * the result of the operation.
19573  *
19574  * Since: 2.22
19575  */
19576
19577
19578 /**
19579  * g_file_open_readwrite_finish:
19580  * @file: input #GFile
19581  * @res: a #GAsyncResult
19582  * @error: a #GError, or %NULL
19583  *
19584  * Finishes an asynchronous file read operation started with
19585  * g_file_open_readwrite_async().
19586  *
19587  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19588  * Since: 2.22
19589  */
19590
19591
19592 /**
19593  * g_file_output_stream_get_etag:
19594  * @stream: a #GFileOutputStream.
19595  *
19596  * Gets the entity tag for the file when it has been written.
19597  * This must be called after the stream has been written
19598  * and closed, as the etag can change while writing.
19599  *
19600  * Returns: the entity tag for the stream.
19601  */
19602
19603
19604 /**
19605  * g_file_output_stream_query_info:
19606  * @stream: a #GFileOutputStream.
19607  * @attributes: a file attribute query string.
19608  * @cancellable: optional #GCancellable object, %NULL to ignore.
19609  * @error: a #GError, %NULL to ignore.
19610  *
19611  * Queries a file output stream for the given @attributes.
19612  * This function blocks while querying the stream. For the asynchronous
19613  * version of this function, see g_file_output_stream_query_info_async().
19614  * While the stream is blocked, the stream will set the pending flag
19615  * internally, and any other operations on the stream will fail with
19616  * %G_IO_ERROR_PENDING.
19617  *
19618  * Can fail if the stream was already closed (with @error being set to
19619  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19620  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19621  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19622  * all cases of failure, %NULL will be returned.
19623  *
19624  * If @cancellable is not %NULL, then the operation can be cancelled by
19625  * triggering the cancellable object from another thread. If the operation
19626  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19627  * be returned.
19628  *
19629  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19630  */
19631
19632
19633 /**
19634  * g_file_output_stream_query_info_async:
19635  * @stream: a #GFileOutputStream.
19636  * @attributes: a file attribute query string.
19637  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19638  * @cancellable: optional #GCancellable object, %NULL to ignore.
19639  * @callback: callback to call when the request is satisfied
19640  * @user_data: the data to pass to callback function
19641  *
19642  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19643  * @callback will be called with a #GAsyncResult which can be used to
19644  * finish the operation with g_file_output_stream_query_info_finish().
19645  *
19646  * For the synchronous version of this function, see
19647  * g_file_output_stream_query_info().
19648  */
19649
19650
19651 /**
19652  * g_file_output_stream_query_info_finish:
19653  * @stream: a #GFileOutputStream.
19654  * @result: a #GAsyncResult.
19655  * @error: a #GError, %NULL to ignore.
19656  *
19657  * Finalizes the asynchronous query started
19658  * by g_file_output_stream_query_info_async().
19659  *
19660  * Returns: (transfer full): A #GFileInfo for the finished query.
19661  */
19662
19663
19664 /**
19665  * g_file_parse_name:
19666  * @parse_name: a file name or path to be parsed
19667  *
19668  * Constructs a #GFile with the given @parse_name (i.e. something
19669  * given by g_file_get_parse_name()). This operation never fails,
19670  * but the returned object might not support any I/O operation if
19671  * the @parse_name cannot be parsed.
19672  *
19673  * Returns: (transfer full): a new #GFile.
19674  */
19675
19676
19677 /**
19678  * g_file_poll_mountable:
19679  * @file: input #GFile
19680  * @cancellable: optional #GCancellable object, %NULL to ignore
19681  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19682  * @user_data: the data to pass to callback function
19683  *
19684  * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19685  *
19686  * If @cancellable is not %NULL, then the operation can be cancelled by
19687  * triggering the cancellable object from another thread. If the operation
19688  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19689  *
19690  * When the operation is finished, @callback will be called.
19691  * You can then call g_file_mount_mountable_finish() to get
19692  * the result of the operation.
19693  *
19694  * Since: 2.22
19695  */
19696
19697
19698 /**
19699  * g_file_poll_mountable_finish:
19700  * @file: input #GFile
19701  * @result: a #GAsyncResult
19702  * @error: a #GError, or %NULL
19703  *
19704  * Finishes a poll operation. See g_file_poll_mountable() for details.
19705  *
19706  * Finish an asynchronous poll operation that was polled
19707  * with g_file_poll_mountable().
19708  *
19709  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19710  * Since: 2.22
19711  */
19712
19713
19714 /**
19715  * g_file_query_default_handler:
19716  * @file: a #GFile to open
19717  * @cancellable: optional #GCancellable object, %NULL to ignore
19718  * @error: a #GError, or %NULL
19719  *
19720  * Returns the #GAppInfo that is registered as the default
19721  * application to handle the file specified by @file.
19722  *
19723  * If @cancellable is not %NULL, then the operation can be cancelled by
19724  * triggering the cancellable object from another thread. If the operation
19725  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19726  *
19727  * 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()
19728  */
19729
19730
19731 /**
19732  * g_file_query_exists:
19733  * @file: input #GFile
19734  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19735  *
19736  * Utility function to check if a particular file exists. This is
19737  * implemented using g_file_query_info() and as such does blocking I/O.
19738  *
19739  * Note that in many cases it is racy to first check for file existence
19740  * and then execute something based on the outcome of that, because the
19741  * file might have been created or removed in between the operations. The
19742  * general approach to handling that is to not check, but just do the
19743  * operation and handle the errors as they come.
19744  *
19745  * As an example of race-free checking, take the case of reading a file,
19746  * and if it doesn't exist, creating it. There are two racy versions: read
19747  * it, and on error create it; and: check if it exists, if not create it.
19748  * These can both result in two processes creating the file (with perhaps
19749  * a partially written file as the result). The correct approach is to
19750  * always try to create the file with g_file_create() which will either
19751  * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19752  *
19753  * However, in many cases an existence check is useful in a user interface,
19754  * for instance to make a menu item sensitive/insensitive, so that you don't
19755  * have to fool users that something is possible and then just show an error
19756  * dialog. If you do this, you should make sure to also handle the errors
19757  * that can happen due to races when you execute the operation.
19758  *
19759  * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19760  */
19761
19762
19763 /**
19764  * g_file_query_file_type:
19765  * @file: input #GFile
19766  * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19767  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19768  *
19769  * Utility function to inspect the #GFileType of a file. This is
19770  * implemented using g_file_query_info() and as such does blocking I/O.
19771  *
19772  * The primary use case of this method is to check if a file is
19773  * a regular file, directory, or symlink.
19774  *
19775  * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19776  * Since: 2.18
19777  */
19778
19779
19780 /**
19781  * g_file_query_filesystem_info:
19782  * @file: input #GFile
19783  * @attributes: an attribute query string
19784  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19785  * @error: a #GError
19786  *
19787  * Similar to g_file_query_info(), but obtains information
19788  * about the filesystem the @file is on, rather than the file itself.
19789  * For instance the amount of space available and the type of
19790  * the filesystem.
19791  *
19792  * The @attributes value is a string that specifies the attributes
19793  * that should be gathered. It is not an error if it's not possible
19794  * to read a particular requested attribute from a file - it just
19795  * won't be set. @attributes should be a comma-separated list of
19796  * attributes or attribute wildcards. The wildcard "*" means all
19797  * attributes, and a wildcard like "filesystem::*" means all attributes
19798  * in the filesystem namespace. The standard namespace for filesystem
19799  * attributes is "filesystem". Common attributes of interest are
19800  * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19801  * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19802  * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19803  *
19804  * If @cancellable is not %NULL, then the operation can be cancelled
19805  * by triggering the cancellable object from another thread. If the
19806  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19807  * returned.
19808  *
19809  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19810  * be returned. Other errors are possible too, and depend on what
19811  * kind of filesystem the file is on.
19812  *
19813  * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19814  */
19815
19816
19817 /**
19818  * g_file_query_filesystem_info_async:
19819  * @file: input #GFile
19820  * @attributes: an attribute query string
19821  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19822  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19823  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19824  * @user_data: (closure): the data to pass to callback function
19825  *
19826  * Asynchronously gets the requested information about the filesystem
19827  * that the specified @file is on. The result is a #GFileInfo object
19828  * that contains key-value attributes (such as type or size for the
19829  * file).
19830  *
19831  * For more details, see g_file_query_filesystem_info() which is the
19832  * synchronous version of this call.
19833  *
19834  * When the operation is finished, @callback will be called. You can
19835  * then call g_file_query_info_finish() to get the result of the
19836  * operation.
19837  */
19838
19839
19840 /**
19841  * g_file_query_filesystem_info_finish:
19842  * @file: input #GFile
19843  * @res: a #GAsyncResult
19844  * @error: a #GError
19845  *
19846  * Finishes an asynchronous filesystem info query.
19847  * See g_file_query_filesystem_info_async().
19848  *
19849  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19850  */
19851
19852
19853 /**
19854  * g_file_query_info:
19855  * @file: input #GFile
19856  * @attributes: an attribute query string
19857  * @flags: a set of #GFileQueryInfoFlags
19858  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19859  * @error: a #GError
19860  *
19861  * Gets the requested information about specified @file.
19862  * The result is a #GFileInfo object that contains key-value
19863  * attributes (such as the type or size of the file).
19864  *
19865  * The @attributes value is a string that specifies the file
19866  * attributes that should be gathered. It is not an error if
19867  * it's not possible to read a particular requested attribute
19868  * from a file - it just won't be set. @attributes should be a
19869  * comma-separated list of attributes or attribute wildcards.
19870  * The wildcard "*" means all attributes, and a wildcard like
19871  * "standard::*" means all attributes in the standard namespace.
19872  * An example attribute query be "standard::*,owner::user".
19873  * The standard attributes are available as defines, like
19874  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19875  *
19876  * If @cancellable is not %NULL, then the operation can be cancelled
19877  * by triggering the cancellable object from another thread. If the
19878  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19879  * returned.
19880  *
19881  * For symlinks, normally the information about the target of the
19882  * symlink is returned, rather than information about the symlink
19883  * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19884  * in @flags the information about the symlink itself will be returned.
19885  * Also, for symlinks that point to non-existing files the information
19886  * about the symlink itself will be returned.
19887  *
19888  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19889  * returned. Other errors are possible too, and depend on what kind of
19890  * filesystem the file is on.
19891  *
19892  * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19893  */
19894
19895
19896 /**
19897  * g_file_query_info_async:
19898  * @file: input #GFile
19899  * @attributes: an attribute query string
19900  * @flags: a set of #GFileQueryInfoFlags
19901  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19902  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19903  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19904  * @user_data: (closure): the data to pass to callback function
19905  *
19906  * Asynchronously gets the requested information about specified @file.
19907  * The result is a #GFileInfo object that contains key-value attributes
19908  * (such as type or size for the file).
19909  *
19910  * For more details, see g_file_query_info() which is the synchronous
19911  * version of this call.
19912  *
19913  * When the operation is finished, @callback will be called. You can
19914  * then call g_file_query_info_finish() to get the result of the operation.
19915  */
19916
19917
19918 /**
19919  * g_file_query_info_finish:
19920  * @file: input #GFile
19921  * @res: a #GAsyncResult
19922  * @error: a #GError
19923  *
19924  * Finishes an asynchronous file info query.
19925  * See g_file_query_info_async().
19926  *
19927  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19928  */
19929
19930
19931 /**
19932  * g_file_query_settable_attributes:
19933  * @file: input #GFile
19934  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19935  * @error: a #GError, or %NULL
19936  *
19937  * Obtain the list of settable attributes for the file.
19938  *
19939  * Returns the type and full attribute name of all the attributes
19940  * that can be set on this file. This doesn't mean setting it will
19941  * always succeed though, you might get an access failure, or some
19942  * specific file may not support a specific attribute.
19943  *
19944  * If @cancellable is not %NULL, then the operation can be cancelled by
19945  * triggering the cancellable object from another thread. If the operation
19946  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19947  *
19948  * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19949  */
19950
19951
19952 /**
19953  * g_file_query_writable_namespaces:
19954  * @file: input #GFile
19955  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19956  * @error: a #GError, or %NULL
19957  *
19958  * Obtain the list of attribute namespaces where new attributes
19959  * can be created by a user. An example of this is extended
19960  * attributes (in the "xattr" namespace).
19961  *
19962  * If @cancellable is not %NULL, then the operation can be cancelled by
19963  * triggering the cancellable object from another thread. If the operation
19964  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19965  *
19966  * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19967  */
19968
19969
19970 /**
19971  * g_file_read:
19972  * @file: #GFile to read
19973  * @cancellable: (allow-none): a #GCancellable
19974  * @error: a #GError, or %NULL
19975  *
19976  * Opens a file for reading. The result is a #GFileInputStream that
19977  * can be used to read the contents of the file.
19978  *
19979  * If @cancellable is not %NULL, then the operation can be cancelled by
19980  * triggering the cancellable object from another thread. If the operation
19981  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19982  *
19983  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19984  * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19985  * error will be returned. Other errors are possible too, and depend
19986  * on what kind of filesystem the file is on.
19987  *
19988  * Virtual: read_fn
19989  * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19990  */
19991
19992
19993 /**
19994  * g_file_read_async:
19995  * @file: input #GFile
19996  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19997  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19998  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19999  * @user_data: (closure): the data to pass to callback function
20000  *
20001  * Asynchronously opens @file for reading.
20002  *
20003  * For more details, see g_file_read() which is
20004  * the synchronous version of this call.
20005  *
20006  * When the operation is finished, @callback will be called.
20007  * You can then call g_file_read_finish() to get the result
20008  * of the operation.
20009  */
20010
20011
20012 /**
20013  * g_file_read_finish:
20014  * @file: input #GFile
20015  * @res: a #GAsyncResult
20016  * @error: a #GError, or %NULL
20017  *
20018  * Finishes an asynchronous file read operation started with
20019  * g_file_read_async().
20020  *
20021  * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20022  */
20023
20024
20025 /**
20026  * g_file_replace:
20027  * @file: input #GFile
20028  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20029  * @make_backup: %TRUE if a backup should be created
20030  * @flags: a set of #GFileCreateFlags
20031  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20032  * @error: a #GError, or %NULL
20033  *
20034  * Returns an output stream for overwriting the file, possibly
20035  * creating a backup copy of the file first. If the file doesn't exist,
20036  * it will be created.
20037  *
20038  * This will try to replace the file in the safest way possible so
20039  * that any errors during the writing will not affect an already
20040  * existing copy of the file. For instance, for local files it
20041  * may write to a temporary file and then atomically rename over
20042  * the destination when the stream is closed.
20043  *
20044  * By default files created are generally readable by everyone,
20045  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20046  * will be made readable only to the current user, to the level that
20047  * is supported on the target filesystem.
20048  *
20049  * If @cancellable is not %NULL, then the operation can be cancelled
20050  * by triggering the cancellable object from another thread. If the
20051  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20052  * returned.
20053  *
20054  * If you pass in a non-%NULL @etag value, then this value is
20055  * compared to the current entity tag of the file, and if they differ
20056  * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20057  * that the file has been changed since you last read it. You can get
20058  * the new etag from g_file_output_stream_get_etag() after you've
20059  * finished writing and closed the #GFileOutputStream. When you load
20060  * a new file you can use g_file_input_stream_query_info() to get
20061  * the etag of the file.
20062  *
20063  * If @make_backup is %TRUE, this function will attempt to make a
20064  * backup of the current file before overwriting it. If this fails
20065  * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20066  * want to replace anyway, try again with @make_backup set to %FALSE.
20067  *
20068  * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20069  * be returned, and if the file is some other form of non-regular file
20070  * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20071  * file systems don't allow all file names, and may return an
20072  * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20073  * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20074  * possible too, and depend on what kind of filesystem the file is on.
20075  *
20076  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20077  */
20078
20079
20080 /**
20081  * g_file_replace_async:
20082  * @file: input #GFile
20083  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20084  * @make_backup: %TRUE if a backup should be created
20085  * @flags: a set of #GFileCreateFlags
20086  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20087  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20088  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20089  * @user_data: (closure): the data to pass to callback function
20090  *
20091  * Asynchronously overwrites the file, replacing the contents,
20092  * possibly creating a backup copy of the file first.
20093  *
20094  * For more details, see g_file_replace() which is
20095  * the synchronous version of this call.
20096  *
20097  * When the operation is finished, @callback will be called.
20098  * You can then call g_file_replace_finish() to get the result
20099  * of the operation.
20100  */
20101
20102
20103 /**
20104  * g_file_replace_contents:
20105  * @file: input #GFile
20106  * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20107  * @length: the length of @contents in bytes
20108  * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20109  * @make_backup: %TRUE if a backup should be created
20110  * @flags: a set of #GFileCreateFlags
20111  * @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
20112  * @cancellable: optional #GCancellable object, %NULL to ignore
20113  * @error: a #GError, or %NULL
20114  *
20115  * Replaces the contents of @file with @contents of @length bytes.
20116  *
20117  * If @etag is specified (not %NULL), any existing file must have that etag,
20118  * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20119  *
20120  * If @make_backup is %TRUE, this function will attempt to make a backup
20121  * of @file.
20122  *
20123  * If @cancellable is not %NULL, then the operation can be cancelled by
20124  * triggering the cancellable object from another thread. If the operation
20125  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20126  *
20127  * The returned @new_etag can be used to verify that the file hasn't
20128  * changed the next time it is saved over.
20129  *
20130  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20131  */
20132
20133
20134 /**
20135  * g_file_replace_contents_async:
20136  * @file: input #GFile
20137  * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20138  * @length: the length of @contents in bytes
20139  * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20140  * @make_backup: %TRUE if a backup should be created
20141  * @flags: a set of #GFileCreateFlags
20142  * @cancellable: optional #GCancellable object, %NULL to ignore
20143  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20144  * @user_data: the data to pass to callback function
20145  *
20146  * Starts an asynchronous replacement of @file with the given
20147  * @contents of @length bytes. @etag will replace the document's
20148  * current entity tag.
20149  *
20150  * When this operation has completed, @callback will be called with
20151  * @user_user data, and the operation can be finalized with
20152  * g_file_replace_contents_finish().
20153  *
20154  * If @cancellable is not %NULL, then the operation can be cancelled by
20155  * triggering the cancellable object from another thread. If the operation
20156  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20157  *
20158  * If @make_backup is %TRUE, this function will attempt to
20159  * make a backup of @file.
20160  */
20161
20162
20163 /**
20164  * g_file_replace_contents_finish:
20165  * @file: input #GFile
20166  * @res: a #GAsyncResult
20167  * @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
20168  * @error: a #GError, or %NULL
20169  *
20170  * Finishes an asynchronous replace of the given @file. See
20171  * g_file_replace_contents_async(). Sets @new_etag to the new entity
20172  * tag for the document, if present.
20173  *
20174  * Returns: %TRUE on success, %FALSE on failure.
20175  */
20176
20177
20178 /**
20179  * g_file_replace_finish:
20180  * @file: input #GFile
20181  * @res: a #GAsyncResult
20182  * @error: a #GError, or %NULL
20183  *
20184  * Finishes an asynchronous file replace operation started with
20185  * g_file_replace_async().
20186  *
20187  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20188  */
20189
20190
20191 /**
20192  * g_file_replace_readwrite:
20193  * @file: a #GFile
20194  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20195  * @make_backup: %TRUE if a backup should be created
20196  * @flags: a set of #GFileCreateFlags
20197  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20198  * @error: return location for a #GError, or %NULL
20199  *
20200  * Returns an output stream for overwriting the file in readwrite mode,
20201  * possibly creating a backup copy of the file first. If the file doesn't
20202  * exist, it will be created.
20203  *
20204  * For details about the behaviour, see g_file_replace() which does the
20205  * same thing but returns an output stream only.
20206  *
20207  * Note that in many non-local file cases read and write streams are not
20208  * supported, so make sure you really need to do read and write streaming,
20209  * rather than just opening for reading or writing.
20210  *
20211  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20212  * Since: 2.22
20213  */
20214
20215
20216 /**
20217  * g_file_replace_readwrite_async:
20218  * @file: input #GFile
20219  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20220  * @make_backup: %TRUE if a backup should be created
20221  * @flags: a set of #GFileCreateFlags
20222  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20223  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20224  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20225  * @user_data: (closure): the data to pass to callback function
20226  *
20227  * Asynchronously overwrites the file in read-write mode,
20228  * replacing the contents, possibly creating a backup copy
20229  * of the file first.
20230  *
20231  * For more details, see g_file_replace_readwrite() which is
20232  * the synchronous version of this call.
20233  *
20234  * When the operation is finished, @callback will be called.
20235  * You can then call g_file_replace_readwrite_finish() to get
20236  * the result of the operation.
20237  *
20238  * Since: 2.22
20239  */
20240
20241
20242 /**
20243  * g_file_replace_readwrite_finish:
20244  * @file: input #GFile
20245  * @res: a #GAsyncResult
20246  * @error: a #GError, or %NULL
20247  *
20248  * Finishes an asynchronous file replace operation started with
20249  * g_file_replace_readwrite_async().
20250  *
20251  * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20252  * Since: 2.22
20253  */
20254
20255
20256 /**
20257  * g_file_resolve_relative_path:
20258  * @file: input #GFile
20259  * @relative_path: a given relative path string
20260  *
20261  * Resolves a relative path for @file to an absolute path.
20262  *
20263  * This call does no blocking I/O.
20264  *
20265  * 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().
20266  */
20267
20268
20269 /**
20270  * g_file_set_attribute:
20271  * @file: input #GFile
20272  * @attribute: a string containing the attribute's name
20273  * @type: The type of the attribute
20274  * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20275  * @flags: a set of #GFileQueryInfoFlags
20276  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20277  * @error: a #GError, or %NULL
20278  *
20279  * Sets an attribute in the file with attribute name @attribute to @value.
20280  *
20281  * Some attributes can be unset by setting @attribute to
20282  * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20283  *
20284  * If @cancellable is not %NULL, then the operation can be cancelled by
20285  * triggering the cancellable object from another thread. If the operation
20286  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20287  *
20288  * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20289  */
20290
20291
20292 /**
20293  * g_file_set_attribute_byte_string:
20294  * @file: input #GFile
20295  * @attribute: a string containing the attribute's name
20296  * @value: a string containing the attribute's new value
20297  * @flags: a #GFileQueryInfoFlags
20298  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20299  * @error: a #GError, or %NULL
20300  *
20301  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20302  * If @attribute is of a different type, this operation will fail,
20303  * returning %FALSE.
20304  *
20305  * If @cancellable is not %NULL, then the operation can be cancelled by
20306  * triggering the cancellable object from another thread. If the operation
20307  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20308  *
20309  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20310  */
20311
20312
20313 /**
20314  * g_file_set_attribute_int32:
20315  * @file: input #GFile
20316  * @attribute: a string containing the attribute's name
20317  * @value: a #gint32 containing the attribute's new value
20318  * @flags: a #GFileQueryInfoFlags
20319  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20320  * @error: a #GError, or %NULL
20321  *
20322  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20323  * If @attribute is of a different type, this operation will fail.
20324  *
20325  * If @cancellable is not %NULL, then the operation can be cancelled by
20326  * triggering the cancellable object from another thread. If the operation
20327  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20328  *
20329  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20330  */
20331
20332
20333 /**
20334  * g_file_set_attribute_int64:
20335  * @file: input #GFile
20336  * @attribute: a string containing the attribute's name
20337  * @value: a #guint64 containing the attribute's new value
20338  * @flags: a #GFileQueryInfoFlags
20339  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20340  * @error: a #GError, or %NULL
20341  *
20342  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20343  * If @attribute is of a different type, this operation will fail.
20344  *
20345  * If @cancellable is not %NULL, then the operation can be cancelled by
20346  * triggering the cancellable object from another thread. If the operation
20347  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20348  *
20349  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20350  */
20351
20352
20353 /**
20354  * g_file_set_attribute_string:
20355  * @file: input #GFile
20356  * @attribute: a string containing the attribute's name
20357  * @value: a string containing the attribute's value
20358  * @flags: #GFileQueryInfoFlags
20359  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20360  * @error: a #GError, or %NULL
20361  *
20362  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20363  * If @attribute is of a different type, this operation will fail.
20364  *
20365  * If @cancellable is not %NULL, then the operation can be cancelled by
20366  * triggering the cancellable object from another thread. If the operation
20367  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20368  *
20369  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20370  */
20371
20372
20373 /**
20374  * g_file_set_attribute_uint32:
20375  * @file: input #GFile
20376  * @attribute: a string containing the attribute's name
20377  * @value: a #guint32 containing the attribute's new value
20378  * @flags: a #GFileQueryInfoFlags
20379  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20380  * @error: a #GError, or %NULL
20381  *
20382  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20383  * If @attribute is of a different type, this operation will fail.
20384  *
20385  * If @cancellable is not %NULL, then the operation can be cancelled by
20386  * triggering the cancellable object from another thread. If the operation
20387  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20388  *
20389  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20390  */
20391
20392
20393 /**
20394  * g_file_set_attribute_uint64:
20395  * @file: input #GFile
20396  * @attribute: a string containing the attribute's name
20397  * @value: a #guint64 containing the attribute's new value
20398  * @flags: a #GFileQueryInfoFlags
20399  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20400  * @error: a #GError, or %NULL
20401  *
20402  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20403  * If @attribute is of a different type, this operation will fail.
20404  *
20405  * If @cancellable is not %NULL, then the operation can be cancelled by
20406  * triggering the cancellable object from another thread. If the operation
20407  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20408  *
20409  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20410  */
20411
20412
20413 /**
20414  * g_file_set_attributes_async:
20415  * @file: input #GFile
20416  * @info: a #GFileInfo
20417  * @flags: a #GFileQueryInfoFlags
20418  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20419  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20420  * @callback: (scope async): a #GAsyncReadyCallback
20421  * @user_data: (closure): a #gpointer
20422  *
20423  * Asynchronously sets the attributes of @file with @info.
20424  *
20425  * For more details, see g_file_set_attributes_from_info(),
20426  * which is the synchronous version of this call.
20427  *
20428  * When the operation is finished, @callback will be called.
20429  * You can then call g_file_set_attributes_finish() to get
20430  * the result of the operation.
20431  */
20432
20433
20434 /**
20435  * g_file_set_attributes_finish:
20436  * @file: input #GFile
20437  * @result: a #GAsyncResult
20438  * @info: (out) (transfer full): a #GFileInfo
20439  * @error: a #GError, or %NULL
20440  *
20441  * Finishes setting an attribute started in g_file_set_attributes_async().
20442  *
20443  * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20444  */
20445
20446
20447 /**
20448  * g_file_set_attributes_from_info:
20449  * @file: input #GFile
20450  * @info: a #GFileInfo
20451  * @flags: #GFileQueryInfoFlags
20452  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20453  * @error: a #GError, or %NULL
20454  *
20455  * Tries to set all attributes in the #GFileInfo on the target
20456  * values, not stopping on the first error.
20457  *
20458  * If there is any error during this operation then @error will
20459  * be set to the first error. Error on particular fields are flagged
20460  * by setting the "status" field in the attribute value to
20461  * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
20462  * also detect further errors.
20463  *
20464  * If @cancellable is not %NULL, then the operation can be cancelled by
20465  * triggering the cancellable object from another thread. If the operation
20466  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20467  *
20468  * Returns: %TRUE if there was any error, %FALSE otherwise.
20469  */
20470
20471
20472 /**
20473  * g_file_set_display_name:
20474  * @file: input #GFile
20475  * @display_name: a string
20476  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20477  * @error: a #GError, or %NULL
20478  *
20479  * Renames @file to the specified display name.
20480  *
20481  * The display name is converted from UTF-8 to the correct encoding
20482  * for the target filesystem if possible and the @file is renamed to this.
20483  *
20484  * If you want to implement a rename operation in the user interface the
20485  * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
20486  * initial value in the rename widget, and then the result after editing
20487  * should be passed to g_file_set_display_name().
20488  *
20489  * On success the resulting converted filename is returned.
20490  *
20491  * If @cancellable is not %NULL, then the operation can be cancelled by
20492  * triggering the cancellable object from another thread. If the operation
20493  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20494  *
20495  * 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().
20496  */
20497
20498
20499 /**
20500  * g_file_set_display_name_async:
20501  * @file: input #GFile
20502  * @display_name: a string
20503  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20504  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20505  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20506  * @user_data: (closure): the data to pass to callback function
20507  *
20508  * Asynchronously sets the display name for a given #GFile.
20509  *
20510  * For more details, see g_file_set_display_name() which is
20511  * the synchronous version of this call.
20512  *
20513  * When the operation is finished, @callback will be called.
20514  * You can then call g_file_set_display_name_finish() to get
20515  * the result of the operation.
20516  */
20517
20518
20519 /**
20520  * g_file_set_display_name_finish:
20521  * @file: input #GFile
20522  * @res: a #GAsyncResult
20523  * @error: a #GError, or %NULL
20524  *
20525  * Finishes setting a display name started with
20526  * g_file_set_display_name_async().
20527  *
20528  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20529  */
20530
20531
20532 /**
20533  * g_file_start_mountable:
20534  * @file: input #GFile
20535  * @flags: flags affecting the operation
20536  * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20537  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20538  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20539  * @user_data: the data to pass to callback function
20540  *
20541  * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20542  * Using @start_operation, you can request callbacks when, for instance,
20543  * passwords are needed during authentication.
20544  *
20545  * If @cancellable is not %NULL, then the operation can be cancelled by
20546  * triggering the cancellable object from another thread. If the operation
20547  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20548  *
20549  * When the operation is finished, @callback will be called.
20550  * You can then call g_file_mount_mountable_finish() to get
20551  * the result of the operation.
20552  *
20553  * Since: 2.22
20554  */
20555
20556
20557 /**
20558  * g_file_start_mountable_finish:
20559  * @file: input #GFile
20560  * @result: a #GAsyncResult
20561  * @error: a #GError, or %NULL
20562  *
20563  * Finishes a start operation. See g_file_start_mountable() for details.
20564  *
20565  * Finish an asynchronous start operation that was started
20566  * with g_file_start_mountable().
20567  *
20568  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20569  * Since: 2.22
20570  */
20571
20572
20573 /**
20574  * g_file_stop_mountable:
20575  * @file: input #GFile
20576  * @flags: flags affecting the operation
20577  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20578  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20579  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20580  * @user_data: the data to pass to callback function
20581  *
20582  * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20583  *
20584  * If @cancellable is not %NULL, then the operation can be cancelled by
20585  * triggering the cancellable object from another thread. If the operation
20586  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20587  *
20588  * When the operation is finished, @callback will be called.
20589  * You can then call g_file_stop_mountable_finish() to get
20590  * the result of the operation.
20591  *
20592  * Since: 2.22
20593  */
20594
20595
20596 /**
20597  * g_file_stop_mountable_finish:
20598  * @file: input #GFile
20599  * @result: a #GAsyncResult
20600  * @error: a #GError, or %NULL
20601  *
20602  * Finishes an stop operation, see g_file_stop_mountable() for details.
20603  *
20604  * Finish an asynchronous stop operation that was started
20605  * with g_file_stop_mountable().
20606  *
20607  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20608  * Since: 2.22
20609  */
20610
20611
20612 /**
20613  * g_file_supports_thread_contexts:
20614  * @file: a #GFile
20615  *
20616  * Checks if @file supports <link
20617  * linkend="g-main-context-push-thread-default-context">thread-default
20618  * contexts</link>. If this returns %FALSE, you cannot perform
20619  * asynchronous operations on @file in a thread that has a
20620  * thread-default context.
20621  *
20622  * Returns: Whether or not @file supports thread-default contexts.
20623  * Since: 2.22
20624  */
20625
20626
20627 /**
20628  * g_file_trash:
20629  * @file: #GFile to send to trash
20630  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20631  * @error: a #GError, or %NULL
20632  *
20633  * Sends @file to the "Trashcan", if possible. This is similar to
20634  * deleting it, but the user can recover it before emptying the trashcan.
20635  * Not all file systems support trashing, so this call can return the
20636  * %G_IO_ERROR_NOT_SUPPORTED error.
20637  *
20638  * If @cancellable is not %NULL, then the operation can be cancelled by
20639  * triggering the cancellable object from another thread. If the operation
20640  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20641  *
20642  * Returns: %TRUE on successful trash, %FALSE otherwise.
20643  */
20644
20645
20646 /**
20647  * g_file_unmount_mountable:
20648  * @file: input #GFile
20649  * @flags: flags affecting the operation
20650  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20651  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20652  * @user_data: (closure): the data to pass to callback function
20653  *
20654  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20655  *
20656  * If @cancellable is not %NULL, then the operation can be cancelled by
20657  * triggering the cancellable object from another thread. If the operation
20658  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20659  *
20660  * When the operation is finished, @callback will be called.
20661  * You can then call g_file_unmount_mountable_finish() to get
20662  * the result of the operation.
20663  *
20664  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20665  */
20666
20667
20668 /**
20669  * g_file_unmount_mountable_finish:
20670  * @file: input #GFile
20671  * @result: a #GAsyncResult
20672  * @error: a #GError, or %NULL
20673  *
20674  * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20675  *
20676  * Finish an asynchronous unmount operation that was started
20677  * with g_file_unmount_mountable().
20678  *
20679  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20680  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20681  */
20682
20683
20684 /**
20685  * g_file_unmount_mountable_with_operation:
20686  * @file: input #GFile
20687  * @flags: flags affecting the operation
20688  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20689  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20690  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20691  * @user_data: (closure): the data to pass to callback function
20692  *
20693  * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20694  *
20695  * If @cancellable is not %NULL, then the operation can be cancelled by
20696  * triggering the cancellable object from another thread. If the operation
20697  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20698  *
20699  * When the operation is finished, @callback will be called.
20700  * You can then call g_file_unmount_mountable_finish() to get
20701  * the result of the operation.
20702  *
20703  * Since: 2.22
20704  */
20705
20706
20707 /**
20708  * g_file_unmount_mountable_with_operation_finish:
20709  * @file: input #GFile
20710  * @result: a #GAsyncResult
20711  * @error: a #GError, or %NULL
20712  *
20713  * Finishes an unmount operation,
20714  * see g_file_unmount_mountable_with_operation() for details.
20715  *
20716  * Finish an asynchronous unmount operation that was started
20717  * with g_file_unmount_mountable_with_operation().
20718  *
20719  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20720  * Since: 2.22
20721  */
20722
20723
20724 /**
20725  * g_filename_completer_get_completion_suffix:
20726  * @completer: the filename completer.
20727  * @initial_text: text to be completed.
20728  *
20729  * Obtains a completion for @initial_text from @completer.
20730  *
20731  * 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.
20732  */
20733
20734
20735 /**
20736  * g_filename_completer_get_completions:
20737  * @completer: the filename completer.
20738  * @initial_text: text to be completed.
20739  *
20740  * Gets an array of completion strings for a given initial text.
20741  *
20742  * 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.
20743  */
20744
20745
20746 /**
20747  * g_filename_completer_new:
20748  *
20749  * Creates a new filename completer.
20750  *
20751  * Returns: a #GFilenameCompleter.
20752  */
20753
20754
20755 /**
20756  * g_filename_completer_set_dirs_only:
20757  * @completer: the filename completer.
20758  * @dirs_only: a #gboolean.
20759  *
20760  * If @dirs_only is %TRUE, @completer will only
20761  * complete directory names, and not file names.
20762  */
20763
20764
20765 /**
20766  * g_filter_input_stream_get_base_stream:
20767  * @stream: a #GFilterInputStream.
20768  *
20769  * Gets the base stream for the filter stream.
20770  *
20771  * Returns: (transfer none): a #GInputStream.
20772  */
20773
20774
20775 /**
20776  * g_filter_input_stream_get_close_base_stream:
20777  * @stream: a #GFilterInputStream.
20778  *
20779  * Returns whether the base stream will be closed when @stream is
20780  * closed.
20781  *
20782  * Returns: %TRUE if the base stream will be closed.
20783  */
20784
20785
20786 /**
20787  * g_filter_input_stream_set_close_base_stream:
20788  * @stream: a #GFilterInputStream.
20789  * @close_base: %TRUE to close the base stream.
20790  *
20791  * Sets whether the base stream will be closed when @stream is closed.
20792  */
20793
20794
20795 /**
20796  * g_filter_output_stream_get_base_stream:
20797  * @stream: a #GFilterOutputStream.
20798  *
20799  * Gets the base stream for the filter stream.
20800  *
20801  * Returns: (transfer none): a #GOutputStream.
20802  */
20803
20804
20805 /**
20806  * g_filter_output_stream_get_close_base_stream:
20807  * @stream: a #GFilterOutputStream.
20808  *
20809  * Returns whether the base stream will be closed when @stream is
20810  * closed.
20811  *
20812  * Returns: %TRUE if the base stream will be closed.
20813  */
20814
20815
20816 /**
20817  * g_filter_output_stream_set_close_base_stream:
20818  * @stream: a #GFilterOutputStream.
20819  * @close_base: %TRUE to close the base stream.
20820  *
20821  * Sets whether the base stream will be closed when @stream is closed.
20822  */
20823
20824
20825 /**
20826  * g_icon_equal:
20827  * @icon1: (allow-none): pointer to the first #GIcon.
20828  * @icon2: (allow-none): pointer to the second #GIcon.
20829  *
20830  * Checks if two icons are equal.
20831  *
20832  * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20833  */
20834
20835
20836 /**
20837  * g_icon_hash:
20838  * @icon: #gconstpointer to an icon object.
20839  *
20840  * Gets a hash for an icon.
20841  *
20842  * Virtual: hash
20843  * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20844  */
20845
20846
20847 /**
20848  * g_icon_new_for_string:
20849  * @str: A string obtained via g_icon_to_string().
20850  * @error: Return location for error.
20851  *
20852  * Generate a #GIcon instance from @str. This function can fail if
20853  * @str is not valid - see g_icon_to_string() for discussion.
20854  *
20855  * If your application or library provides one or more #GIcon
20856  * implementations you need to ensure that each #GType is registered
20857  * with the type system prior to calling g_icon_new_for_string().
20858  *
20859  * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20860  * Since: 2.20
20861  */
20862
20863
20864 /**
20865  * g_icon_to_string:
20866  * @icon: a #GIcon.
20867  *
20868  * Generates a textual representation of @icon that can be used for
20869  * serialization such as when passing @icon to a different process or
20870  * saving it to persistent storage. Use g_icon_new_for_string() to
20871  * get @icon back from the returned string.
20872  *
20873  * The encoding of the returned string is proprietary to #GIcon except
20874  * in the following two cases
20875  *
20876  * <itemizedlist>
20877  * <listitem><para>
20878  *     If @icon is a #GFileIcon, the returned string is a native path
20879  *     (such as <literal>/path/to/my icon.png</literal>) without escaping
20880  *     if the #GFile for @icon is a native file.  If the file is not
20881  *     native, the returned string is the result of g_file_get_uri()
20882  *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
20883  * </para></listitem>
20884  * <listitem><para>
20885  *    If @icon is a #GThemedIcon with exactly one name, the encoding is
20886  *    simply the name (such as <literal>network-server</literal>).
20887  * </para></listitem>
20888  * </itemizedlist>
20889  *
20890  * Virtual: to_tokens
20891  * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20892  * Since: 2.20
20893  */
20894
20895
20896 /**
20897  * g_inet_address_equal:
20898  * @address: A #GInetAddress.
20899  * @other_address: Another #GInetAddress.
20900  *
20901  * Checks if two #GInetAddress instances are equal, e.g. the same address.
20902  *
20903  * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20904  * Since: 2.30
20905  */
20906
20907
20908 /**
20909  * g_inet_address_get_family:
20910  * @address: a #GInetAddress
20911  *
20912  * Gets @address's family
20913  *
20914  * Returns: @address's family
20915  * Since: 2.22
20916  */
20917
20918
20919 /**
20920  * g_inet_address_get_is_any:
20921  * @address: a #GInetAddress
20922  *
20923  * Tests whether @address is the "any" address for its family.
20924  *
20925  * Returns: %TRUE if @address is the "any" address for its family.
20926  * Since: 2.22
20927  */
20928
20929
20930 /**
20931  * g_inet_address_get_is_link_local:
20932  * @address: a #GInetAddress
20933  *
20934  * Tests whether @address is a link-local address (that is, if it
20935  * identifies a host on a local network that is not connected to the
20936  * Internet).
20937  *
20938  * Returns: %TRUE if @address is a link-local address.
20939  * Since: 2.22
20940  */
20941
20942
20943 /**
20944  * g_inet_address_get_is_loopback:
20945  * @address: a #GInetAddress
20946  *
20947  * Tests whether @address is the loopback address for its family.
20948  *
20949  * Returns: %TRUE if @address is the loopback address for its family.
20950  * Since: 2.22
20951  */
20952
20953
20954 /**
20955  * g_inet_address_get_is_mc_global:
20956  * @address: a #GInetAddress
20957  *
20958  * Tests whether @address is a global multicast address.
20959  *
20960  * Returns: %TRUE if @address is a global multicast address.
20961  * Since: 2.22
20962  */
20963
20964
20965 /**
20966  * g_inet_address_get_is_mc_link_local:
20967  * @address: a #GInetAddress
20968  *
20969  * Tests whether @address is a link-local multicast address.
20970  *
20971  * Returns: %TRUE if @address is a link-local multicast address.
20972  * Since: 2.22
20973  */
20974
20975
20976 /**
20977  * g_inet_address_get_is_mc_node_local:
20978  * @address: a #GInetAddress
20979  *
20980  * Tests whether @address is a node-local multicast address.
20981  *
20982  * Returns: %TRUE if @address is a node-local multicast address.
20983  * Since: 2.22
20984  */
20985
20986
20987 /**
20988  * g_inet_address_get_is_mc_org_local:
20989  * @address: a #GInetAddress
20990  *
20991  * Tests whether @address is an organization-local multicast address.
20992  *
20993  * Returns: %TRUE if @address is an organization-local multicast address.
20994  * Since: 2.22
20995  */
20996
20997
20998 /**
20999  * g_inet_address_get_is_mc_site_local:
21000  * @address: a #GInetAddress
21001  *
21002  * Tests whether @address is a site-local multicast address.
21003  *
21004  * Returns: %TRUE if @address is a site-local multicast address.
21005  * Since: 2.22
21006  */
21007
21008
21009 /**
21010  * g_inet_address_get_is_multicast:
21011  * @address: a #GInetAddress
21012  *
21013  * Tests whether @address is a multicast address.
21014  *
21015  * Returns: %TRUE if @address is a multicast address.
21016  * Since: 2.22
21017  */
21018
21019
21020 /**
21021  * g_inet_address_get_is_site_local:
21022  * @address: a #GInetAddress
21023  *
21024  * Tests whether @address is a site-local address such as 10.0.0.1
21025  * (that is, the address identifies a host on a local network that can
21026  * not be reached directly from the Internet, but which may have
21027  * outgoing Internet connectivity via a NAT or firewall).
21028  *
21029  * Returns: %TRUE if @address is a site-local address.
21030  * Since: 2.22
21031  */
21032
21033
21034 /**
21035  * g_inet_address_get_native_size:
21036  * @address: a #GInetAddress
21037  *
21038  * Gets the size of the native raw binary address for @address. This
21039  * is the size of the data that you get from g_inet_address_to_bytes().
21040  *
21041  * Returns: the number of bytes used for the native version of @address.
21042  * Since: 2.22
21043  */
21044
21045
21046 /**
21047  * g_inet_address_mask_equal:
21048  * @mask: a #GInetAddressMask
21049  * @mask2: another #GInetAddressMask
21050  *
21051  * Tests if @mask and @mask2 are the same mask.
21052  *
21053  * Returns: whether @mask and @mask2 are the same mask
21054  * Since: 2.32
21055  */
21056
21057
21058 /**
21059  * g_inet_address_mask_get_address:
21060  * @mask: a #GInetAddressMask
21061  *
21062  * Gets @mask's base address
21063  *
21064  * Returns: (transfer none): @mask's base address
21065  * Since: 2.32
21066  */
21067
21068
21069 /**
21070  * g_inet_address_mask_get_family:
21071  * @mask: a #GInetAddressMask
21072  *
21073  * Gets the #GSocketFamily of @mask's address
21074  *
21075  * Returns: the #GSocketFamily of @mask's address
21076  * Since: 2.32
21077  */
21078
21079
21080 /**
21081  * g_inet_address_mask_get_length:
21082  * @mask: a #GInetAddressMask
21083  *
21084  * Gets @mask's length
21085  *
21086  * Returns: @mask's length
21087  * Since: 2.32
21088  */
21089
21090
21091 /**
21092  * g_inet_address_mask_matches:
21093  * @mask: a #GInetAddressMask
21094  * @address: a #GInetAddress
21095  *
21096  * Tests if @address falls within the range described by @mask.
21097  *
21098  * Returns: whether @address falls within the range described by @mask.
21099  * Since: 2.32
21100  */
21101
21102
21103 /**
21104  * g_inet_address_mask_new:
21105  * @addr: a #GInetAddress
21106  * @length: number of bits of @addr to use
21107  * @error: return location for #GError, or %NULL
21108  *
21109  * Creates a new #GInetAddressMask representing all addresses whose
21110  * first @length bits match @addr.
21111  *
21112  * Returns: a new #GInetAddressMask, or %NULL on error
21113  * Since: 2.32
21114  */
21115
21116
21117 /**
21118  * g_inet_address_mask_new_from_string:
21119  * @mask_string: an IP address or address/length string
21120  * @error: return location for #GError, or %NULL
21121  *
21122  * Parses @mask_string as an IP address and (optional) length, and
21123  * creates a new #GInetAddressMask. The length, if present, is
21124  * delimited by a "/". If it is not present, then the length is
21125  * assumed to be the full length of the address.
21126  *
21127  * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21128  * Since: 2.32
21129  */
21130
21131
21132 /**
21133  * g_inet_address_mask_to_string:
21134  * @mask: a #GInetAddressMask
21135  *
21136  * Converts @mask back to its corresponding string form.
21137  *
21138  * Returns: a string corresponding to @mask.
21139  * Since: 2.32
21140  */
21141
21142
21143 /**
21144  * g_inet_address_new_any:
21145  * @family: the address family
21146  *
21147  * Creates a #GInetAddress for the "any" address (unassigned/"don't
21148  * care") for @family.
21149  *
21150  * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21151  * Since: 2.22
21152  */
21153
21154
21155 /**
21156  * g_inet_address_new_from_bytes:
21157  * @bytes: (array) (element-type guint8): raw address data
21158  * @family: the address family of @bytes
21159  *
21160  * Creates a new #GInetAddress from the given @family and @bytes.
21161  * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21162  * %G_SOCKET_FAMILY_IPV6.
21163  *
21164  * Returns: a new #GInetAddress corresponding to @family and @bytes.
21165  * Since: 2.22
21166  */
21167
21168
21169 /**
21170  * g_inet_address_new_from_string:
21171  * @string: a string representation of an IP address
21172  *
21173  * Parses @string as an IP address and creates a new #GInetAddress.
21174  *
21175  * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21176  * Since: 2.22
21177  */
21178
21179
21180 /**
21181  * g_inet_address_new_loopback:
21182  * @family: the address family
21183  *
21184  * Creates a #GInetAddress for the loopback address for @family.
21185  *
21186  * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21187  * Since: 2.22
21188  */
21189
21190
21191 /**
21192  * g_inet_address_to_bytes: (skip)
21193  * @address: a #GInetAddress
21194  *
21195  * Gets the raw binary address data from @address.
21196  *
21197  * 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().
21198  * Since: 2.22
21199  */
21200
21201
21202 /**
21203  * g_inet_address_to_string:
21204  * @address: a #GInetAddress
21205  *
21206  * Converts @address to string form.
21207  *
21208  * Returns: a representation of @address as a string, which should be freed after use.
21209  * Since: 2.22
21210  */
21211
21212
21213 /**
21214  * g_inet_socket_address_get_address:
21215  * @address: a #GInetSocketAddress
21216  *
21217  * Gets @address's #GInetAddress.
21218  *
21219  * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21220  * Since: 2.22
21221  */
21222
21223
21224 /**
21225  * g_inet_socket_address_get_flowinfo:
21226  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21227  *
21228  * Gets the <literal>sin6_flowinfo</literal> field from @address,
21229  * which must be an IPv6 address.
21230  *
21231  * Returns: the flowinfo field
21232  * Since: 2.32
21233  */
21234
21235
21236 /**
21237  * g_inet_socket_address_get_port:
21238  * @address: a #GInetSocketAddress
21239  *
21240  * Gets @address's port.
21241  *
21242  * Returns: the port for @address
21243  * Since: 2.22
21244  */
21245
21246
21247 /**
21248  * g_inet_socket_address_get_scope_id:
21249  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21250  *
21251  * Gets the <literal>sin6_scope_id</literal> field from @address,
21252  * which must be an IPv6 address.
21253  *
21254  * Returns: the scope id field
21255  * Since: 2.32
21256  */
21257
21258
21259 /**
21260  * g_inet_socket_address_new:
21261  * @address: a #GInetAddress
21262  * @port: a port number
21263  *
21264  * Creates a new #GInetSocketAddress for @address and @port.
21265  *
21266  * Returns: a new #GInetSocketAddress
21267  * Since: 2.22
21268  */
21269
21270
21271 /**
21272  * g_initable_init:
21273  * @initable: a #GInitable.
21274  * @cancellable: optional #GCancellable object, %NULL to ignore.
21275  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21276  *
21277  * Initializes the object implementing the interface.
21278  *
21279  * The object must be initialized before any real use after initial
21280  * construction, either with this function or g_async_initable_init_async().
21281  *
21282  * Implementations may also support cancellation. If @cancellable is not %NULL,
21283  * then initialization can be cancelled by triggering the cancellable object
21284  * from another thread. If the operation was cancelled, the error
21285  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21286  * the object doesn't support cancellable initialization the error
21287  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21288  *
21289  * If the object is not initialized, or initialization returns with an
21290  * error, then all operations on the object except g_object_ref() and
21291  * g_object_unref() are considered to be invalid, and have undefined
21292  * behaviour. See the <xref linkend="ginitable"/> section introduction
21293  * for more details.
21294  *
21295  * Implementations of this method must be idempotent, i.e. multiple calls
21296  * to this function with the same argument should return the same results.
21297  * Only the first call initializes the object, further calls return the result
21298  * of the first call. This is so that it's safe to implement the singleton
21299  * pattern in the GObject constructor function.
21300  *
21301  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21302  * Since: 2.22
21303  */
21304
21305
21306 /**
21307  * g_initable_new:
21308  * @object_type: a #GType supporting #GInitable.
21309  * @cancellable: optional #GCancellable object, %NULL to ignore.
21310  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21311  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21312  * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21313  *
21314  * Helper function for constructing #GInitable object. This is
21315  * similar to g_object_new() but also initializes the object
21316  * and returns %NULL, setting an error on failure.
21317  *
21318  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21319  * Since: 2.22
21320  */
21321
21322
21323 /**
21324  * g_initable_new_valist:
21325  * @object_type: a #GType supporting #GInitable.
21326  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21327  * @var_args: The var args list generated from @first_property_name.
21328  * @cancellable: optional #GCancellable object, %NULL to ignore.
21329  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21330  *
21331  * Helper function for constructing #GInitable object. This is
21332  * similar to g_object_new_valist() but also initializes the object
21333  * and returns %NULL, setting an error on failure.
21334  *
21335  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21336  * Since: 2.22
21337  */
21338
21339
21340 /**
21341  * g_initable_newv:
21342  * @object_type: a #GType supporting #GInitable.
21343  * @n_parameters: the number of parameters in @parameters
21344  * @parameters: (array length=n_parameters): the parameters to use to construct the object
21345  * @cancellable: optional #GCancellable object, %NULL to ignore.
21346  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21347  *
21348  * Helper function for constructing #GInitable object. This is
21349  * similar to g_object_newv() but also initializes the object
21350  * and returns %NULL, setting an error on failure.
21351  *
21352  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21353  * Since: 2.22
21354  */
21355
21356
21357 /**
21358  * g_input_stream_clear_pending:
21359  * @stream: input stream
21360  *
21361  * Clears the pending flag on @stream.
21362  */
21363
21364
21365 /**
21366  * g_input_stream_close:
21367  * @stream: A #GInputStream.
21368  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21369  * @error: location to store the error occurring, or %NULL to ignore
21370  *
21371  * Closes the stream, releasing resources related to it.
21372  *
21373  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21374  * Closing a stream multiple times will not return an error.
21375  *
21376  * Streams will be automatically closed when the last reference
21377  * is dropped, but you might want to call this function to make sure
21378  * resources are released as early as possible.
21379  *
21380  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21381  * open after the stream is closed. See the documentation for the individual
21382  * stream for details.
21383  *
21384  * On failure the first error that happened will be reported, but the close
21385  * operation will finish as much as possible. A stream that failed to
21386  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21387  * is important to check and report the error to the user.
21388  *
21389  * If @cancellable is not %NULL, then the operation can be cancelled by
21390  * triggering the cancellable object from another thread. If the operation
21391  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21392  * Cancelling a close will still leave the stream closed, but some streams
21393  * can use a faster close that doesn't block to e.g. check errors.
21394  *
21395  * Returns: %TRUE on success, %FALSE on failure
21396  */
21397
21398
21399 /**
21400  * g_input_stream_close_async:
21401  * @stream: A #GInputStream.
21402  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21403  * @cancellable: (allow-none): optional cancellable object
21404  * @callback: (scope async): callback to call when the request is satisfied
21405  * @user_data: (closure): the data to pass to callback function
21406  *
21407  * Requests an asynchronous closes of the stream, releasing resources related to it.
21408  * When the operation is finished @callback will be called.
21409  * You can then call g_input_stream_close_finish() to get the result of the
21410  * operation.
21411  *
21412  * For behaviour details see g_input_stream_close().
21413  *
21414  * The asyncronous methods have a default fallback that uses threads to implement
21415  * asynchronicity, so they are optional for inheriting classes. However, if you
21416  * override one you must override all.
21417  */
21418
21419
21420 /**
21421  * g_input_stream_close_finish:
21422  * @stream: a #GInputStream.
21423  * @result: a #GAsyncResult.
21424  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21425  *
21426  * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21427  *
21428  * Returns: %TRUE if the stream was closed successfully.
21429  */
21430
21431
21432 /**
21433  * g_input_stream_has_pending:
21434  * @stream: input stream.
21435  *
21436  * Checks if an input stream has pending actions.
21437  *
21438  * Returns: %TRUE if @stream has pending actions.
21439  */
21440
21441
21442 /**
21443  * g_input_stream_is_closed:
21444  * @stream: input stream.
21445  *
21446  * Checks if an input stream is closed.
21447  *
21448  * Returns: %TRUE if the stream is closed.
21449  */
21450
21451
21452 /**
21453  * g_input_stream_read:
21454  * @stream: a #GInputStream.
21455  * @buffer: a buffer to read data into (which should be at least count bytes long).
21456  * @count: the number of bytes that will be read from the stream
21457  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21458  * @error: location to store the error occurring, or %NULL to ignore
21459  *
21460  * Tries to read @count bytes from the stream into the buffer starting at
21461  * @buffer. Will block during this read.
21462  *
21463  * If count is zero returns zero and does nothing. A value of @count
21464  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21465  *
21466  * On success, the number of bytes read into the buffer is returned.
21467  * It is not an error if this is not the same as the requested size, as it
21468  * can happen e.g. near the end of a file. Zero is returned on end of file
21469  * (or if @count is zero),  but never otherwise.
21470  *
21471  * If @cancellable is not %NULL, then the operation can be cancelled by
21472  * triggering the cancellable object from another thread. If the operation
21473  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21474  * operation was partially finished when the operation was cancelled the
21475  * partial result will be returned, without an error.
21476  *
21477  * On error -1 is returned and @error is set accordingly.
21478  *
21479  * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21480  */
21481
21482
21483 /**
21484  * g_input_stream_read_all:
21485  * @stream: a #GInputStream.
21486  * @buffer: a buffer to read data into (which should be at least count bytes long).
21487  * @count: the number of bytes that will be read from the stream
21488  * @bytes_read: (out): location to store the number of bytes that was read from the stream
21489  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21490  * @error: location to store the error occurring, or %NULL to ignore
21491  *
21492  * Tries to read @count bytes from the stream into the buffer starting at
21493  * @buffer. Will block during this read.
21494  *
21495  * This function is similar to g_input_stream_read(), except it tries to
21496  * read as many bytes as requested, only stopping on an error or end of stream.
21497  *
21498  * On a successful read of @count bytes, or if we reached the end of the
21499  * stream,  %TRUE is returned, and @bytes_read is set to the number of bytes
21500  * read into @buffer.
21501  *
21502  * If there is an error during the operation %FALSE is returned and @error
21503  * is set to indicate the error status, @bytes_read is updated to contain
21504  * the number of bytes read into @buffer before the error occurred.
21505  *
21506  * Returns: %TRUE on success, %FALSE if there was an error
21507  */
21508
21509
21510 /**
21511  * g_input_stream_read_async:
21512  * @stream: A #GInputStream.
21513  * @buffer: a buffer to read data into (which should be at least count bytes long).
21514  * @count: the number of bytes that will be read from the stream
21515  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21516  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21517  * @callback: (scope async): callback to call when the request is satisfied
21518  * @user_data: (closure): the data to pass to callback function
21519  *
21520  * Request an asynchronous read of @count bytes from the stream into the buffer
21521  * starting at @buffer. When the operation is finished @callback will be called.
21522  * You can then call g_input_stream_read_finish() to get the result of the
21523  * operation.
21524  *
21525  * During an async request no other sync and async calls are allowed on @stream, and will
21526  * result in %G_IO_ERROR_PENDING errors.
21527  *
21528  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21529  *
21530  * On success, the number of bytes read into the buffer will be passed to the
21531  * callback. It is not an error if this is not the same as the requested size, as it
21532  * can happen e.g. near the end of a file, but generally we try to read
21533  * as many bytes as requested. Zero is returned on end of file
21534  * (or if @count is zero),  but never otherwise.
21535  *
21536  * Any outstanding i/o request with higher priority (lower numerical value) will
21537  * be executed before an outstanding request with lower priority. Default
21538  * priority is %G_PRIORITY_DEFAULT.
21539  *
21540  * The asyncronous methods have a default fallback that uses threads to implement
21541  * asynchronicity, so they are optional for inheriting classes. However, if you
21542  * override one you must override all.
21543  */
21544
21545
21546 /**
21547  * g_input_stream_read_bytes:
21548  * @stream: a #GInputStream.
21549  * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21550  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21551  * @error: location to store the error occurring, or %NULL to ignore
21552  *
21553  * Like g_input_stream_read(), this tries to read @count bytes from
21554  * the stream in a blocking fashion. However, rather than reading into
21555  * a user-supplied buffer, this will create a new #GBytes containing
21556  * the data that was read. This may be easier to use from language
21557  * bindings.
21558  *
21559  * If count is zero, returns a zero-length #GBytes and does nothing. A
21560  * value of @count larger than %G_MAXSSIZE will cause a
21561  * %G_IO_ERROR_INVALID_ARGUMENT error.
21562  *
21563  * On success, a new #GBytes is returned. It is not an error if the
21564  * size of this object is not the same as the requested size, as it
21565  * can happen e.g. near the end of a file. A zero-length #GBytes is
21566  * returned on end of file (or if @count is zero), but never
21567  * otherwise.
21568  *
21569  * If @cancellable is not %NULL, then the operation can be cancelled by
21570  * triggering the cancellable object from another thread. If the operation
21571  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21572  * operation was partially finished when the operation was cancelled the
21573  * partial result will be returned, without an error.
21574  *
21575  * On error %NULL is returned and @error is set accordingly.
21576  *
21577  * Returns: a new #GBytes, or %NULL on error
21578  */
21579
21580
21581 /**
21582  * g_input_stream_read_bytes_async:
21583  * @stream: A #GInputStream.
21584  * @count: the number of bytes that will be read from the stream
21585  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21586  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21587  * @callback: (scope async): callback to call when the request is satisfied
21588  * @user_data: (closure): the data to pass to callback function
21589  *
21590  * Request an asynchronous read of @count bytes from the stream into a
21591  * new #GBytes. When the operation is finished @callback will be
21592  * called. You can then call g_input_stream_read_bytes_finish() to get the
21593  * result of the operation.
21594  *
21595  * During an async request no other sync and async calls are allowed
21596  * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21597  *
21598  * A value of @count larger than %G_MAXSSIZE will cause a
21599  * %G_IO_ERROR_INVALID_ARGUMENT error.
21600  *
21601  * On success, the new #GBytes will be passed to the callback. It is
21602  * not an error if this is smaller than the requested size, as it can
21603  * happen e.g. near the end of a file, but generally we try to read as
21604  * many bytes as requested. Zero is returned on end of file (or if
21605  * @count is zero), but never otherwise.
21606  *
21607  * Any outstanding I/O request with higher priority (lower numerical
21608  * value) will be executed before an outstanding request with lower
21609  * priority. Default priority is %G_PRIORITY_DEFAULT.
21610  */
21611
21612
21613 /**
21614  * g_input_stream_read_bytes_finish:
21615  * @stream: a #GInputStream.
21616  * @result: a #GAsyncResult.
21617  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21618  *
21619  * Finishes an asynchronous stream read-into-#GBytes operation.
21620  *
21621  * Returns: the newly-allocated #GBytes, or %NULL on error
21622  */
21623
21624
21625 /**
21626  * g_input_stream_read_finish:
21627  * @stream: a #GInputStream.
21628  * @result: a #GAsyncResult.
21629  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21630  *
21631  * Finishes an asynchronous stream read operation.
21632  *
21633  * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21634  */
21635
21636
21637 /**
21638  * g_input_stream_set_pending:
21639  * @stream: input stream
21640  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21641  *
21642  * Sets @stream to have actions pending. If the pending flag is
21643  * already set or @stream is closed, it will return %FALSE and set
21644  * @error.
21645  *
21646  * Returns: %TRUE if pending was previously unset and is now set.
21647  */
21648
21649
21650 /**
21651  * g_input_stream_skip:
21652  * @stream: a #GInputStream.
21653  * @count: the number of bytes that will be skipped from the stream
21654  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21655  * @error: location to store the error occurring, or %NULL to ignore
21656  *
21657  * Tries to skip @count bytes from the stream. Will block during the operation.
21658  *
21659  * This is identical to g_input_stream_read(), from a behaviour standpoint,
21660  * but the bytes that are skipped are not returned to the user. Some
21661  * streams have an implementation that is more efficient than reading the data.
21662  *
21663  * This function is optional for inherited classes, as the default implementation
21664  * emulates it using read.
21665  *
21666  * If @cancellable is not %NULL, then the operation can be cancelled by
21667  * triggering the cancellable object from another thread. If the operation
21668  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21669  * operation was partially finished when the operation was cancelled the
21670  * partial result will be returned, without an error.
21671  *
21672  * Returns: Number of bytes skipped, or -1 on error
21673  */
21674
21675
21676 /**
21677  * g_input_stream_skip_async:
21678  * @stream: A #GInputStream.
21679  * @count: the number of bytes that will be skipped from the stream
21680  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21681  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21682  * @callback: (scope async): callback to call when the request is satisfied
21683  * @user_data: (closure): the data to pass to callback function
21684  *
21685  * Request an asynchronous skip of @count bytes from the stream.
21686  * When the operation is finished @callback will be called.
21687  * You can then call g_input_stream_skip_finish() to get the result
21688  * of the operation.
21689  *
21690  * During an async request no other sync and async calls are allowed,
21691  * and will result in %G_IO_ERROR_PENDING errors.
21692  *
21693  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21694  *
21695  * On success, the number of bytes skipped will be passed to the callback.
21696  * It is not an error if this is not the same as the requested size, as it
21697  * can happen e.g. near the end of a file, but generally we try to skip
21698  * as many bytes as requested. Zero is returned on end of file
21699  * (or if @count is zero), but never otherwise.
21700  *
21701  * Any outstanding i/o request with higher priority (lower numerical value)
21702  * will be executed before an outstanding request with lower priority.
21703  * Default priority is %G_PRIORITY_DEFAULT.
21704  *
21705  * The asynchronous methods have a default fallback that uses threads to
21706  * implement asynchronicity, so they are optional for inheriting classes.
21707  * However, if you override one, you must override all.
21708  */
21709
21710
21711 /**
21712  * g_input_stream_skip_finish:
21713  * @stream: a #GInputStream.
21714  * @result: a #GAsyncResult.
21715  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21716  *
21717  * Finishes a stream skip operation.
21718  *
21719  * Returns: the size of the bytes skipped, or %-1 on error.
21720  */
21721
21722
21723 /**
21724  * g_io_error_from_errno:
21725  * @err_no: Error number as defined in errno.h.
21726  *
21727  * Converts errno.h error codes into GIO error codes.
21728  *
21729  * Returns: #GIOErrorEnum value for the given errno.h error number.
21730  */
21731
21732
21733 /**
21734  * g_io_error_from_win32_error:
21735  * @error_code: Windows error number.
21736  *
21737  * Converts some common error codes into GIO error codes. The
21738  * fallback value G_IO_ERROR_FAILED is returned for error codes not
21739  * handled.
21740  *
21741  * Returns: #GIOErrorEnum value for the given error number.
21742  * Since: 2.26
21743  */
21744
21745
21746 /**
21747  * g_io_error_quark:
21748  *
21749  * Gets the GIO Error Quark.
21750  *
21751  * Returns: a #GQuark.
21752  */
21753
21754
21755 /**
21756  * g_io_extension_get_name:
21757  * @extension: a #GIOExtension
21758  *
21759  * Gets the name under which @extension was registered.
21760  *
21761  * Note that the same type may be registered as extension
21762  * for multiple extension points, under different names.
21763  *
21764  * Returns: the name of @extension.
21765  */
21766
21767
21768 /**
21769  * g_io_extension_get_priority:
21770  * @extension: a #GIOExtension
21771  *
21772  * Gets the priority with which @extension was registered.
21773  *
21774  * Returns: the priority of @extension
21775  */
21776
21777
21778 /**
21779  * g_io_extension_get_type:
21780  * @extension: a #GIOExtension
21781  *
21782  * Gets the type associated with @extension.
21783  *
21784  * Returns: the type of @extension
21785  */
21786
21787
21788 /**
21789  * g_io_extension_point_get_extension_by_name:
21790  * @extension_point: a #GIOExtensionPoint
21791  * @name: the name of the extension to get
21792  *
21793  * Finds a #GIOExtension for an extension point by name.
21794  *
21795  * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21796  */
21797
21798
21799 /**
21800  * g_io_extension_point_get_extensions:
21801  * @extension_point: a #GIOExtensionPoint
21802  *
21803  * Gets a list of all extensions that implement this extension point.
21804  * The list is sorted by priority, beginning with the highest priority.
21805  *
21806  * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21807  */
21808
21809
21810 /**
21811  * g_io_extension_point_get_required_type:
21812  * @extension_point: a #GIOExtensionPoint
21813  *
21814  * Gets the required type for @extension_point.
21815  *
21816  * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21817  */
21818
21819
21820 /**
21821  * g_io_extension_point_implement:
21822  * @extension_point_name: the name of the extension point
21823  * @type: the #GType to register as extension
21824  * @extension_name: the name for the extension
21825  * @priority: the priority for the extension
21826  *
21827  * Registers @type as extension for the extension point with name
21828  * @extension_point_name.
21829  *
21830  * If @type has already been registered as an extension for this
21831  * extension point, the existing #GIOExtension object is returned.
21832  *
21833  * Returns: (transfer none): a #GIOExtension object for #GType
21834  */
21835
21836
21837 /**
21838  * g_io_extension_point_lookup:
21839  * @name: the name of the extension point
21840  *
21841  * Looks up an existing extension point.
21842  *
21843  * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21844  */
21845
21846
21847 /**
21848  * g_io_extension_point_register:
21849  * @name: The name of the extension point
21850  *
21851  * Registers an extension point.
21852  *
21853  * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21854  */
21855
21856
21857 /**
21858  * g_io_extension_point_set_required_type:
21859  * @extension_point: a #GIOExtensionPoint
21860  * @type: the #GType to require
21861  *
21862  * Sets the required type for @extension_point to @type.
21863  * All implementations must henceforth have this type.
21864  */
21865
21866
21867 /**
21868  * g_io_extension_ref_class:
21869  * @extension: a #GIOExtension
21870  *
21871  * Gets a reference to the class for the type that is
21872  * associated with @extension.
21873  *
21874  * Returns: (transfer full): the #GTypeClass for the type of @extension
21875  */
21876
21877
21878 /**
21879  * g_io_module_new:
21880  * @filename: filename of the shared library module.
21881  *
21882  * Creates a new GIOModule that will load the specific
21883  * shared library when in use.
21884  *
21885  * Returns: a #GIOModule from given @filename, or %NULL on error.
21886  */
21887
21888
21889 /**
21890  * g_io_module_scope_block:
21891  * @scope: a module loading scope
21892  * @basename: the basename to block
21893  *
21894  * Block modules with the given @basename from being loaded when
21895  * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21896  * or g_io_modules_load_all_in_directory_with_scope().
21897  *
21898  * Since: 2.30
21899  */
21900
21901
21902 /**
21903  * g_io_module_scope_free:
21904  * @scope: a module loading scope
21905  *
21906  * Free a module scope.
21907  *
21908  * Since: 2.30
21909  */
21910
21911
21912 /**
21913  * g_io_module_scope_new:
21914  * @flags: flags for the new scope
21915  *
21916  * Create a new scope for loading of IO modules. A scope can be used for
21917  * blocking duplicate modules, or blocking a module you don't want to load.
21918  *
21919  * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21920  * which have the same base name as a module that has already been seen
21921  * in this scope.
21922  *
21923  * Returns: (transfer full): the new module scope
21924  * Since: 2.30
21925  */
21926
21927
21928 /**
21929  * g_io_modules_load_all_in_directory:
21930  * @dirname: pathname for a directory containing modules to load.
21931  *
21932  * Loads all the modules in the specified directory.
21933  *
21934  * If don't require all modules to be initialized (and thus registering
21935  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21936  * which allows delayed/lazy loading of modules.
21937  *
21938  * 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().
21939  */
21940
21941
21942 /**
21943  * g_io_modules_load_all_in_directory_with_scope:
21944  * @dirname: pathname for a directory containing modules to load.
21945  * @scope: a scope to use when scanning the modules.
21946  *
21947  * Loads all the modules in the specified directory.
21948  *
21949  * If don't require all modules to be initialized (and thus registering
21950  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21951  * which allows delayed/lazy loading of modules.
21952  *
21953  * 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().
21954  * Since: 2.30
21955  */
21956
21957
21958 /**
21959  * g_io_modules_scan_all_in_directory:
21960  * @dirname: pathname for a directory containing modules to scan.
21961  *
21962  * Scans all the modules in the specified directory, ensuring that
21963  * any extension point implemented by a module is registered.
21964  *
21965  * This may not actually load and initialize all the types in each
21966  * module, some modules may be lazily loaded and initialized when
21967  * an extension point it implementes is used with e.g.
21968  * g_io_extension_point_get_extensions() or
21969  * g_io_extension_point_get_extension_by_name().
21970  *
21971  * If you need to guarantee that all types are loaded in all the modules,
21972  * use g_io_modules_load_all_in_directory().
21973  *
21974  * Since: 2.24
21975  */
21976
21977
21978 /**
21979  * g_io_modules_scan_all_in_directory_with_scope:
21980  * @dirname: pathname for a directory containing modules to scan.
21981  * @scope: a scope to use when scanning the modules
21982  *
21983  * Scans all the modules in the specified directory, ensuring that
21984  * any extension point implemented by a module is registered.
21985  *
21986  * This may not actually load and initialize all the types in each
21987  * module, some modules may be lazily loaded and initialized when
21988  * an extension point it implementes is used with e.g.
21989  * g_io_extension_point_get_extensions() or
21990  * g_io_extension_point_get_extension_by_name().
21991  *
21992  * If you need to guarantee that all types are loaded in all the modules,
21993  * use g_io_modules_load_all_in_directory().
21994  *
21995  * Since: 2.30
21996  */
21997
21998
21999 /**
22000  * g_io_scheduler_cancel_all_jobs:
22001  *
22002  * Cancels all cancellable I/O jobs.
22003  *
22004  * A job is cancellable if a #GCancellable was passed into
22005  * g_io_scheduler_push_job().
22006  */
22007
22008
22009 /**
22010  * g_io_scheduler_job_send_to_mainloop:
22011  * @job: a #GIOSchedulerJob
22012  * @func: a #GSourceFunc callback that will be called in the original thread
22013  * @user_data: data to pass to @func
22014  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22015  *
22016  * Used from an I/O job to send a callback to be run in the thread
22017  * that the job was started from, waiting for the result (and thus
22018  * blocking the I/O job).
22019  *
22020  * Returns: The return value of @func
22021  */
22022
22023
22024 /**
22025  * g_io_scheduler_job_send_to_mainloop_async:
22026  * @job: a #GIOSchedulerJob
22027  * @func: a #GSourceFunc callback that will be called in the original thread
22028  * @user_data: data to pass to @func
22029  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22030  *
22031  * Used from an I/O job to send a callback to be run asynchronously in
22032  * the thread that the job was started from. The callback will be run
22033  * when the main loop is available, but at that time the I/O job might
22034  * have finished. The return value from the callback is ignored.
22035  *
22036  * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22037  * on to this function you have to ensure that it is not freed before
22038  * @func is called, either by passing %NULL as @notify to
22039  * g_io_scheduler_push_job() or by using refcounting for @user_data.
22040  */
22041
22042
22043 /**
22044  * g_io_scheduler_push_job:
22045  * @job_func: a #GIOSchedulerJobFunc.
22046  * @user_data: data to pass to @job_func
22047  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22048  * @io_priority: the <link linkend="gioscheduler">I/O priority</link> of the request.
22049  * @cancellable: optional #GCancellable object, %NULL to ignore.
22050  *
22051  * Schedules the I/O job to run in another thread.
22052  *
22053  * @notify will be called on @user_data after @job_func has returned,
22054  * regardless whether the job was cancelled or has run to completion.
22055  *
22056  * If @cancellable is not %NULL, it can be used to cancel the I/O job
22057  * by calling g_cancellable_cancel() or by calling
22058  * g_io_scheduler_cancel_all_jobs().
22059  */
22060
22061
22062 /**
22063  * g_io_stream_clear_pending:
22064  * @stream: a #GIOStream
22065  *
22066  * Clears the pending flag on @stream.
22067  *
22068  * Since: 2.22
22069  */
22070
22071
22072 /**
22073  * g_io_stream_close:
22074  * @stream: a #GIOStream
22075  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22076  * @error: location to store the error occurring, or %NULL to ignore
22077  *
22078  * Closes the stream, releasing resources related to it. This will also
22079  * closes the individual input and output streams, if they are not already
22080  * closed.
22081  *
22082  * Once the stream is closed, all other operations will return
22083  * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22084  * return an error.
22085  *
22086  * Closing a stream will automatically flush any outstanding buffers
22087  * in the stream.
22088  *
22089  * Streams will be automatically closed when the last reference
22090  * is dropped, but you might want to call this function to make sure
22091  * resources are released as early as possible.
22092  *
22093  * Some streams might keep the backing store of the stream (e.g. a file
22094  * descriptor) open after the stream is closed. See the documentation for
22095  * the individual stream for details.
22096  *
22097  * On failure the first error that happened will be reported, but the
22098  * close operation will finish as much as possible. A stream that failed
22099  * to close will still return %G_IO_ERROR_CLOSED for all operations.
22100  * Still, it is important to check and report the error to the user,
22101  * otherwise there might be a loss of data as all data might not be written.
22102  *
22103  * If @cancellable is not NULL, then the operation can be cancelled by
22104  * triggering the cancellable object from another thread. If the operation
22105  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22106  * Cancelling a close will still leave the stream closed, but some streams
22107  * can use a faster close that doesn't block to e.g. check errors.
22108  *
22109  * The default implementation of this method just calls close on the
22110  * individual input/output streams.
22111  *
22112  * Returns: %TRUE on success, %FALSE on failure
22113  * Since: 2.22
22114  */
22115
22116
22117 /**
22118  * g_io_stream_close_async:
22119  * @stream: a #GIOStream
22120  * @io_priority: the io priority of the request
22121  * @cancellable: (allow-none): optional cancellable object
22122  * @callback: (scope async): callback to call when the request is satisfied
22123  * @user_data: (closure): the data to pass to callback function
22124  *
22125  * Requests an asynchronous close of the stream, releasing resources
22126  * related to it. When the operation is finished @callback will be
22127  * called. You can then call g_io_stream_close_finish() to get
22128  * the result of the operation.
22129  *
22130  * For behaviour details see g_io_stream_close().
22131  *
22132  * The asynchronous methods have a default fallback that uses threads
22133  * to implement asynchronicity, so they are optional for inheriting
22134  * classes. However, if you override one you must override all.
22135  *
22136  * Since: 2.22
22137  */
22138
22139
22140 /**
22141  * g_io_stream_close_finish:
22142  * @stream: a #GIOStream
22143  * @result: a #GAsyncResult
22144  * @error: a #GError location to store the error occurring, or %NULL to ignore
22145  *
22146  * Closes a stream.
22147  *
22148  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22149  * Since: 2.22
22150  */
22151
22152
22153 /**
22154  * g_io_stream_get_input_stream:
22155  * @stream: a #GIOStream
22156  *
22157  * Gets the input stream for this object. This is used
22158  * for reading.
22159  *
22160  * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22161  * Since: 2.22
22162  */
22163
22164
22165 /**
22166  * g_io_stream_get_output_stream:
22167  * @stream: a #GIOStream
22168  *
22169  * Gets the output stream for this object. This is used for
22170  * writing.
22171  *
22172  * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22173  * Since: 2.22
22174  */
22175
22176
22177 /**
22178  * g_io_stream_has_pending:
22179  * @stream: a #GIOStream
22180  *
22181  * Checks if a stream has pending actions.
22182  *
22183  * Returns: %TRUE if @stream has pending actions.
22184  * Since: 2.22
22185  */
22186
22187
22188 /**
22189  * g_io_stream_is_closed:
22190  * @stream: a #GIOStream
22191  *
22192  * Checks if a stream is closed.
22193  *
22194  * Returns: %TRUE if the stream is closed.
22195  * Since: 2.22
22196  */
22197
22198
22199 /**
22200  * g_io_stream_set_pending:
22201  * @stream: a #GIOStream
22202  * @error: a #GError location to store the error occurring, or %NULL to ignore
22203  *
22204  * Sets @stream to have actions pending. If the pending flag is
22205  * already set or @stream is closed, it will return %FALSE and set
22206  * @error.
22207  *
22208  * Returns: %TRUE if pending was previously unset and is now set.
22209  * Since: 2.22
22210  */
22211
22212
22213 /**
22214  * g_io_stream_splice_async:
22215  * @stream1: a #GIOStream.
22216  * @stream2: a #GIOStream.
22217  * @flags: a set of #GIOStreamSpliceFlags.
22218  * @io_priority: the io priority of the request.
22219  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22220  * @callback: (scope async): a #GAsyncReadyCallback.
22221  * @user_data: (closure): user data passed to @callback.
22222  *
22223  * Asyncronously splice the output stream of @stream1 to the input stream of
22224  * @stream2, and splice the output stream of @stream2 to the input stream of
22225  * @stream1.
22226  *
22227  * When the operation is finished @callback will be called.
22228  * You can then call g_io_stream_splice_finish() to get the
22229  * result of the operation.
22230  *
22231  * Since: 2.28
22232  */
22233
22234
22235 /**
22236  * g_io_stream_splice_finish:
22237  * @result: a #GAsyncResult.
22238  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22239  *
22240  * Finishes an asynchronous io stream splice operation.
22241  *
22242  * Returns: %TRUE on success, %FALSE otherwise.
22243  * Since: 2.28
22244  */
22245
22246
22247 /**
22248  * g_keyfile_settings_backend_new:
22249  * @filename: the filename of the keyfile
22250  * @root_path: the path under which all settings keys appear
22251  * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22252  *
22253  * Creates a keyfile-backed #GSettingsBackend.
22254  *
22255  * The filename of the keyfile to use is given by @filename.
22256  *
22257  * All settings read to or written from the backend must fall under the
22258  * path given in @root_path (which must start and end with a slash and
22259  * not contain two consecutive slashes).  @root_path may be "/".
22260  *
22261  * If @root_group is non-%NULL then it specifies the name of the keyfile
22262  * group used for keys that are written directly below @root_path.  For
22263  * example, if @root_path is "/apps/example/" and @root_group is
22264  * "toplevel", then settings the key "/apps/example/enabled" to a value
22265  * of %TRUE will cause the following to appear in the keyfile:
22266  *
22267  * |[
22268  *   [toplevel]
22269  *   enabled=true
22270  * ]|
22271  *
22272  * If @root_group is %NULL then it is not permitted to store keys
22273  * directly below the @root_path.
22274  *
22275  * For keys not stored directly below @root_path (ie: in a sub-path),
22276  * the name of the subpath (with the final slash stripped) is used as
22277  * the name of the keyfile group.  To continue the example, if
22278  * "/apps/example/profiles/default/font-size" were set to
22279  * 12 then the following would appear in the keyfile:
22280  *
22281  * |[
22282  *   [profiles/default]
22283  *   font-size=12
22284  * ]|
22285  *
22286  * The backend will refuse writes (and return writability as being
22287  * %FALSE) for keys outside of @root_path and, in the event that
22288  * @root_group is %NULL, also for keys directly under @root_path.
22289  * Writes will also be refused if the backend detects that it has the
22290  * inability to rewrite the keyfile (ie: the containing directory is not
22291  * writable).
22292  *
22293  * There is no checking done for your key namespace clashing with the
22294  * syntax of the key file format.  For example, if you have '[' or ']'
22295  * characters in your path names or '=' in your key names you may be in
22296  * trouble.
22297  *
22298  * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22299  */
22300
22301
22302 /**
22303  * g_loadable_icon_load:
22304  * @icon: a #GLoadableIcon.
22305  * @size: an integer.
22306  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22307  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22308  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22309  *
22310  * Loads a loadable icon. For the asynchronous version of this function,
22311  * see g_loadable_icon_load_async().
22312  *
22313  * Returns: (transfer full): a #GInputStream to read the icon from.
22314  */
22315
22316
22317 /**
22318  * g_loadable_icon_load_async:
22319  * @icon: a #GLoadableIcon.
22320  * @size: an integer.
22321  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22322  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22323  * @user_data: (closure): the data to pass to callback function
22324  *
22325  * Loads an icon asynchronously. To finish this function, see
22326  * g_loadable_icon_load_finish(). For the synchronous, blocking
22327  * version of this function, see g_loadable_icon_load().
22328  */
22329
22330
22331 /**
22332  * g_loadable_icon_load_finish:
22333  * @icon: a #GLoadableIcon.
22334  * @res: a #GAsyncResult.
22335  * @type: a location to store the type of the loaded icon, %NULL to ignore.
22336  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22337  *
22338  * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22339  *
22340  * Returns: (transfer full): a #GInputStream to read the icon from.
22341  */
22342
22343
22344 /**
22345  * g_local_vfs_new:
22346  *
22347  * Returns a new #GVfs handle for a local vfs.
22348  *
22349  * Returns: a new #GVfs handle.
22350  */
22351
22352
22353 /**
22354  * g_memory_input_stream_add_bytes:
22355  * @stream: a #GMemoryInputStream
22356  * @bytes: input data
22357  *
22358  * Appends @bytes to data that can be read from the input stream.
22359  *
22360  * Since: 2.34
22361  */
22362
22363
22364 /**
22365  * g_memory_input_stream_add_data:
22366  * @stream: a #GMemoryInputStream
22367  * @data: (array length=len) (element-type guint8) (transfer full): input data
22368  * @len: length of the data, may be -1 if @data is a nul-terminated string
22369  * @destroy: (allow-none): function that is called to free @data, or %NULL
22370  *
22371  * Appends @data to data that can be read from the input stream
22372  */
22373
22374
22375 /**
22376  * g_memory_input_stream_new:
22377  *
22378  * Creates a new empty #GMemoryInputStream.
22379  *
22380  * Returns: a new #GInputStream
22381  */
22382
22383
22384 /**
22385  * g_memory_input_stream_new_from_bytes:
22386  * @bytes: a #GBytes
22387  *
22388  * Creates a new #GMemoryInputStream with data from the given @bytes.
22389  *
22390  * Returns: new #GInputStream read from @bytes
22391  * Since: 2.34
22392  */
22393
22394
22395 /**
22396  * g_memory_input_stream_new_from_data:
22397  * @data: (array length=len) (element-type guint8) (transfer full): input data
22398  * @len: length of the data, may be -1 if @data is a nul-terminated string
22399  * @destroy: (allow-none): function that is called to free @data, or %NULL
22400  *
22401  * Creates a new #GMemoryInputStream with data in memory of a given size.
22402  *
22403  * Returns: new #GInputStream read from @data of @len bytes.
22404  */
22405
22406
22407 /**
22408  * g_memory_output_stream_get_data:
22409  * @ostream: a #GMemoryOutputStream
22410  *
22411  * Gets any loaded data from the @ostream.
22412  *
22413  * Note that the returned pointer may become invalid on the next
22414  * write or truncate operation on the stream.
22415  *
22416  * Returns: (transfer none): pointer to the stream's data
22417  */
22418
22419
22420 /**
22421  * g_memory_output_stream_get_data_size:
22422  * @ostream: a #GMemoryOutputStream
22423  *
22424  * Returns the number of bytes from the start up
22425  * to including the last byte written in the stream
22426  * that has not been truncated away.
22427  *
22428  * Returns: the number of bytes written to the stream
22429  * Since: 2.18
22430  */
22431
22432
22433 /**
22434  * g_memory_output_stream_get_size:
22435  * @ostream: a #GMemoryOutputStream
22436  *
22437  * Gets the size of the currently allocated data area (available from
22438  * g_memory_output_stream_get_data()). If the stream isn't
22439  * growable (no realloc was passed to g_memory_output_stream_new()) then
22440  * this is the maximum size of the stream and further writes
22441  * will return %G_IO_ERROR_NO_SPACE.
22442  *
22443  * Note that for growable streams the returned size may become invalid on
22444  * the next write or truncate operation on the stream.
22445  *
22446  * If you want the number of bytes currently written to the stream, use
22447  * g_memory_output_stream_get_data_size().
22448  *
22449  * Returns: the number of bytes allocated for the data buffer
22450  */
22451
22452
22453 /**
22454  * g_memory_output_stream_new: (skip)
22455  * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22456  * @size: the size of @data
22457  * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22458  * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22459  *
22460  * Creates a new #GMemoryOutputStream.
22461  *
22462  * If @data is non-%NULL, the stream  will use that for its internal storage.
22463  * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22464  * storage when necessary. To construct a fixed-size output stream,
22465  * pass %NULL as @realloc_fn.
22466  *
22467  * |[
22468  * /&ast; a stream that can grow &ast;/
22469  * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22470  *
22471  * /&ast; another stream that can grow &ast;/
22472  * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22473  *
22474  * /&ast; a fixed-size stream &ast;/
22475  * data = malloc (200);
22476  * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22477  * ]|
22478  *
22479  * Returns: A newly created #GMemoryOutputStream object.
22480  */
22481
22482
22483 /**
22484  * g_memory_output_stream_steal_as_bytes:
22485  * @ostream: a #GMemoryOutputStream
22486  *
22487  * Returns data from the @ostream as a #GBytes. @ostream must be
22488  * closed before calling this function.
22489  *
22490  * Returns: (transfer full): the stream's data
22491  * Since: 2.34
22492  */
22493
22494
22495 /**
22496  * g_memory_output_stream_steal_data:
22497  * @ostream: a #GMemoryOutputStream
22498  *
22499  * Gets any loaded data from the @ostream. Ownership of the data
22500  * is transferred to the caller; when no longer needed it must be
22501  * freed using the free function set in @ostream's
22502  * #GMemoryOutputStream:destroy-function property.
22503  *
22504  * @ostream must be closed before calling this function.
22505  *
22506  * Returns: (transfer full): the stream's data
22507  * Since: 2.26
22508  */
22509
22510
22511 /**
22512  * g_memory_settings_backend_new:
22513  *
22514  * Creates a memory-backed #GSettingsBackend.
22515  *
22516  * This backend allows changes to settings, but does not write them
22517  * to any backing storage, so the next time you run your application,
22518  * the memory backend will start out with the default values again.
22519  *
22520  * Returns: (transfer full): a newly created #GSettingsBackend
22521  * Since: 2.28
22522  */
22523
22524
22525 /**
22526  * g_menu_append:
22527  * @menu: a #GMenu
22528  * @label: (allow-none): the section label, or %NULL
22529  * @detailed_action: (allow-none): the detailed action string, or %NULL
22530  *
22531  * Convenience function for appending a normal menu item to the end of
22532  * @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
22533  * flexible alternative.
22534  *
22535  * Since: 2.32
22536  */
22537
22538
22539 /**
22540  * g_menu_append_item:
22541  * @menu: a #GMenu
22542  * @item: a #GMenuItem to append
22543  *
22544  * Appends @item to the end of @menu.
22545  *
22546  * See g_menu_insert_item() for more information.
22547  *
22548  * Since: 2.32
22549  */
22550
22551
22552 /**
22553  * g_menu_append_section:
22554  * @menu: a #GMenu
22555  * @label: (allow-none): the section label, or %NULL
22556  * @section: a #GMenuModel with the items of the section
22557  *
22558  * Convenience function for appending a section menu item to the end of
22559  * @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for a
22560  * more flexible alternative.
22561  *
22562  * Since: 2.32
22563  */
22564
22565
22566 /**
22567  * g_menu_append_submenu:
22568  * @menu: a #GMenu
22569  * @label: (allow-none): the section label, or %NULL
22570  * @submenu: a #GMenuModel with the items of the submenu
22571  *
22572  * Convenience function for appending a submenu menu item to the end of
22573  * @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22574  * more flexible alternative.
22575  *
22576  * Since: 2.32
22577  */
22578
22579
22580 /**
22581  * g_menu_attribute_iter_get_name:
22582  * @iter: a #GMenuAttributeIter
22583  *
22584  * Gets the name of the attribute at the current iterator position, as
22585  * a string.
22586  *
22587  * The iterator is not advanced.
22588  *
22589  * Returns: the name of the attribute
22590  * Since: 2.32
22591  */
22592
22593
22594 /**
22595  * g_menu_attribute_iter_get_next:
22596  * @iter: a #GMenuAttributeIter
22597  * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22598  * @value: (out) (allow-none) (transfer full): the attribute value
22599  *
22600  * This function combines g_menu_attribute_iter_next() with
22601  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22602  *
22603  * First the iterator is advanced to the next (possibly first) attribute.
22604  * If that fails, then %FALSE is returned and there are no other
22605  * effects.
22606  *
22607  * If successful, @name and @value are set to the name and value of the
22608  * attribute that has just been advanced to.  At this point,
22609  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22610  * return the same values again.
22611  *
22612  * The value returned in @name remains valid for as long as the iterator
22613  * remains at the current position.  The value returned in @value must
22614  * be unreffed using g_variant_unref() when it is no longer in use.
22615  *
22616  * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22617  * Since: 2.32
22618  */
22619
22620
22621 /**
22622  * g_menu_attribute_iter_get_value:
22623  * @iter: a #GMenuAttributeIter
22624  *
22625  * Gets the value of the attribute at the current iterator position.
22626  *
22627  * The iterator is not advanced.
22628  *
22629  * Returns: (transfer full): the value of the current attribute
22630  * Since: 2.32
22631  */
22632
22633
22634 /**
22635  * g_menu_attribute_iter_next:
22636  * @iter: a #GMenuAttributeIter
22637  *
22638  * Attempts to advance the iterator to the next (possibly first)
22639  * attribute.
22640  *
22641  * %TRUE is returned on success, or %FALSE if there are no more
22642  * attributes.
22643  *
22644  * You must call this function when you first acquire the iterator
22645  * to advance it to the first attribute (and determine if the first
22646  * attribute exists at all).
22647  *
22648  * Returns: %TRUE on success, or %FALSE when there are no more attributes
22649  * Since: 2.32
22650  */
22651
22652
22653 /**
22654  * g_menu_freeze:
22655  * @menu: a #GMenu
22656  *
22657  * Marks @menu as frozen.
22658  *
22659  * After the menu is frozen, it is an error to attempt to make any
22660  * changes to it.  In effect this means that the #GMenu API must no
22661  * longer be used.
22662  *
22663  * This function causes g_menu_model_is_mutable() to begin returning
22664  * %FALSE, which has some positive performance implications.
22665  *
22666  * Since: 2.32
22667  */
22668
22669
22670 /**
22671  * g_menu_insert:
22672  * @menu: a #GMenu
22673  * @position: the position at which to insert the item
22674  * @label: (allow-none): the section label, or %NULL
22675  * @detailed_action: (allow-none): the detailed action string, or %NULL
22676  *
22677  * Convenience function for inserting a normal menu item into @menu.
22678  * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22679  * alternative.
22680  *
22681  * Since: 2.32
22682  */
22683
22684
22685 /**
22686  * g_menu_insert_item:
22687  * @menu: a #GMenu
22688  * @position: the position at which to insert the item
22689  * @item: the #GMenuItem to insert
22690  *
22691  * Inserts @item into @menu.
22692  *
22693  * The "insertion" is actually done by copying all of the attribute and
22694  * link values of @item and using them to form a new item within @menu.
22695  * As such, @item itself is not really inserted, but rather, a menu item
22696  * that is exactly the same as the one presently described by @item.
22697  *
22698  * This means that @item is essentially useless after the insertion
22699  * occurs.  Any changes you make to it are ignored unless it is inserted
22700  * again (at which point its updated values will be copied).
22701  *
22702  * You should probably just free @item once you're done.
22703  *
22704  * There are many convenience functions to take care of common cases.
22705  * See g_menu_insert(), g_menu_insert_section() and
22706  * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22707  * each of these functions.
22708  *
22709  * Since: 2.32
22710  */
22711
22712
22713 /**
22714  * g_menu_insert_section:
22715  * @menu: a #GMenu
22716  * @position: the position at which to insert the item
22717  * @label: (allow-none): the section label, or %NULL
22718  * @section: a #GMenuModel with the items of the section
22719  *
22720  * Convenience function for inserting a section menu item into @menu.
22721  * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22722  * flexible alternative.
22723  *
22724  * Since: 2.32
22725  */
22726
22727
22728 /**
22729  * g_menu_insert_submenu:
22730  * @menu: a #GMenu
22731  * @position: the position at which to insert the item
22732  * @label: (allow-none): the section label, or %NULL
22733  * @submenu: a #GMenuModel with the items of the submenu
22734  *
22735  * Convenience function for inserting a submenu menu item into @menu.
22736  * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22737  * flexible alternative.
22738  *
22739  * Since: 2.32
22740  */
22741
22742
22743 /**
22744  * g_menu_item_get_attribute:
22745  * @menu_item: a #GMenuItem
22746  * @attribute: the attribute name to query
22747  * @format_string: a #GVariant format string
22748  * @...: positional parameters, as per @format_string
22749  *
22750  * Queries the named @attribute on @menu_item.
22751  *
22752  * If the attribute exists and matches the #GVariantType corresponding
22753  * to @format_string then @format_string is used to deconstruct the
22754  * value into the positional parameters and %TRUE is returned.
22755  *
22756  * If the attribute does not exist, or it does exist but has the wrong
22757  * type, then the positional parameters are ignored and %FALSE is
22758  * returned.
22759  *
22760  * Returns: %TRUE if the named attribute was found with the expected type
22761  * Since: 2.34
22762  */
22763
22764
22765 /**
22766  * g_menu_item_get_attribute_value:
22767  * @menu_item: a #GMenuItem
22768  * @attribute: the attribute name to query
22769  * @expected_type: (allow-none): the expected type of the attribute
22770  *
22771  * Queries the named @attribute on @menu_item.
22772  *
22773  * If @expected_type is specified and the attribute does not have this
22774  * type, %NULL is returned.  %NULL is also returned if the attribute
22775  * simply does not exist.
22776  *
22777  * Returns: (transfer full): the attribute value, or %NULL
22778  * Since: 2.34
22779  */
22780
22781
22782 /**
22783  * g_menu_item_get_link:
22784  * @menu_item: a #GMenuItem
22785  * @link: the link name to query
22786  *
22787  * Queries the named @link on @menu_item.
22788  *
22789  * Returns: (transfer full): the link, or %NULL
22790  * Since: 2.34
22791  */
22792
22793
22794 /**
22795  * g_menu_item_new:
22796  * @label: (allow-none): the section label, or %NULL
22797  * @detailed_action: (allow-none): the detailed action string, or %NULL
22798  *
22799  * Creates a new #GMenuItem.
22800  *
22801  * If @label is non-%NULL it is used to set the "label" attribute of the
22802  * new item.
22803  *
22804  * If @detailed_action is non-%NULL it is used to set the "action" and
22805  * possibly the "target" attribute of the new item.  See
22806  * g_menu_item_set_detailed_action() for more information.
22807  *
22808  * Returns: a new #GMenuItem
22809  * Since: 2.32
22810  */
22811
22812
22813 /**
22814  * g_menu_item_new_from_model:
22815  * @model: a #GMenuModel
22816  * @item_index: the index of an item in @model
22817  *
22818  * Creates a #GMenuItem as an exact copy of an existing menu item in a
22819  * #GMenuModel.
22820  *
22821  * @item_index must be valid (ie: be sure to call
22822  * g_menu_model_get_n_items() first).
22823  *
22824  * Returns: a new #GMenuItem.
22825  * Since: 2.34
22826  */
22827
22828
22829 /**
22830  * g_menu_item_new_section:
22831  * @label: (allow-none): the section label, or %NULL
22832  * @section: a #GMenuModel with the items of the section
22833  *
22834  * Creates a new #GMenuItem representing a section.
22835  *
22836  * This is a convenience API around g_menu_item_new() and
22837  * g_menu_item_set_section().
22838  *
22839  * The effect of having one menu appear as a section of another is
22840  * exactly as it sounds: the items from @section become a direct part of
22841  * the menu that @menu_item is added to.
22842  *
22843  * Visual separation is typically displayed between two non-empty
22844  * sections.  If @label is non-%NULL then it will be encorporated into
22845  * this visual indication.  This allows for labeled subsections of a
22846  * menu.
22847  *
22848  * As a simple example, consider a typical "Edit" menu from a simple
22849  * program.  It probably contains an "Undo" and "Redo" item, followed by
22850  * a separator, followed by "Cut", "Copy" and "Paste".
22851  *
22852  * This would be accomplished by creating three #GMenu instances.  The
22853  * first would be populated with the "Undo" and "Redo" items, and the
22854  * second with the "Cut", "Copy" and "Paste" items.  The first and
22855  * second menus would then be added as submenus of the third.  In XML
22856  * format, this would look something like the following:
22857  *
22858  * <informalexample><programlisting><![CDATA[
22859  * <menu id='edit-menu'>
22860  *   <section>
22861  *     <item label='Undo'/>
22862  *     <item label='Redo'/>
22863  *   </section>
22864  *   <section>
22865  *     <item label='Cut'/>
22866  *     <item label='Copy'/>
22867  *     <item label='Paste'/>
22868  *   </section>
22869  * </menu>
22870  * ]]></programlisting></informalexample>
22871  *
22872  * The following example is exactly equivalent.  It is more illustrative
22873  * of the exact relationship between the menus and items (keeping in
22874  * mind that the 'link' element defines a new menu that is linked to the
22875  * containing one).  The style of the second example is more verbose and
22876  * difficult to read (and therefore not recommended except for the
22877  * purpose of understanding what is really going on).
22878  *
22879  * <informalexample><programlisting><![CDATA[
22880  * <menu id='edit-menu'>
22881  *   <item>
22882  *     <link name='section'>
22883  *       <item label='Undo'/>
22884  *       <item label='Redo'/>
22885  *     </link>
22886  *   </item>
22887  *   <item>
22888  *     <link name='section'>
22889  *       <item label='Cut'/>
22890  *       <item label='Copy'/>
22891  *       <item label='Paste'/>
22892  *     </link>
22893  *   </item>
22894  * </menu>
22895  * ]]></programlisting></informalexample>
22896  *
22897  * Returns: a new #GMenuItem
22898  * Since: 2.32
22899  */
22900
22901
22902 /**
22903  * g_menu_item_new_submenu:
22904  * @label: (allow-none): the section label, or %NULL
22905  * @submenu: a #GMenuModel with the items of the submenu
22906  *
22907  * Creates a new #GMenuItem representing a submenu.
22908  *
22909  * This is a convenience API around g_menu_item_new() and
22910  * g_menu_item_set_submenu().
22911  *
22912  * Returns: a new #GMenuItem
22913  * Since: 2.32
22914  */
22915
22916
22917 /**
22918  * g_menu_item_set_action_and_target:
22919  * @menu_item: a #GMenuItem
22920  * @action: (allow-none): the name of the action for this item
22921  * @format_string: (allow-none): a GVariant format string
22922  * @...: positional parameters, as per @format_string
22923  *
22924  * Sets or unsets the "action" and "target" attributes of @menu_item.
22925  *
22926  * If @action is %NULL then both the "action" and "target" attributes
22927  * are unset (and @format_string is ignored along with the positional
22928  * parameters).
22929  *
22930  * If @action is non-%NULL then the "action" attribute is set.
22931  * @format_string is then inspected.  If it is non-%NULL then the proper
22932  * position parameters are collected to create a #GVariant instance to
22933  * use as the target value.  If it is %NULL then the positional
22934  * parameters are ignored and the "target" attribute is unset.
22935  *
22936  * See also g_menu_item_set_action_and_target_value() for an equivalent
22937  * call that directly accepts a #GVariant.  See
22938  * g_menu_item_set_detailed_action() for a more convenient version that
22939  * works with string-typed targets.
22940  *
22941  * See also g_menu_item_set_action_and_target_value() for a
22942  * description of the semantics of the action and target attributes.
22943  *
22944  * Since: 2.32
22945  */
22946
22947
22948 /**
22949  * g_menu_item_set_action_and_target_value:
22950  * @menu_item: a #GMenuItem
22951  * @action: (allow-none): the name of the action for this item
22952  * @target_value: (allow-none): a #GVariant to use as the action target
22953  *
22954  * Sets or unsets the "action" and "target" attributes of @menu_item.
22955  *
22956  * If @action is %NULL then both the "action" and "target" attributes
22957  * are unset (and @target_value is ignored).
22958  *
22959  * If @action is non-%NULL then the "action" attribute is set.  The
22960  * "target" attribute is then set to the value of @target_value if it is
22961  * non-%NULL or unset otherwise.
22962  *
22963  * Normal menu items (ie: not submenu, section or other custom item
22964  * types) are expected to have the "action" attribute set to identify
22965  * the action that they are associated with.  The state type of the
22966  * action help to determine the disposition of the menu item.  See
22967  * #GAction and #GActionGroup for an overview of actions.
22968  *
22969  * In general, clicking on the menu item will result in activation of
22970  * the named action with the "target" attribute given as the parameter
22971  * to the action invocation.  If the "target" attribute is not set then
22972  * the action is invoked with no parameter.
22973  *
22974  * If the action has no state then the menu item is usually drawn as a
22975  * plain menu item (ie: with no additional decoration).
22976  *
22977  * If the action has a boolean state then the menu item is usually drawn
22978  * as a toggle menu item (ie: with a checkmark or equivalent
22979  * indication).  The item should be marked as 'toggled' or 'checked'
22980  * when the boolean state is %TRUE.
22981  *
22982  * If the action has a string state then the menu item is usually drawn
22983  * as a radio menu item (ie: with a radio bullet or equivalent
22984  * indication).  The item should be marked as 'selected' when the string
22985  * state is equal to the value of the @target property.
22986  *
22987  * See g_menu_item_set_action_and_target() or
22988  * g_menu_item_set_detailed_action() for two equivalent calls that are
22989  * probably more convenient for most uses.
22990  *
22991  * Since: 2.32
22992  */
22993
22994
22995 /**
22996  * g_menu_item_set_attribute:
22997  * @menu_item: a #GMenuItem
22998  * @attribute: the attribute to set
22999  * @format_string: (allow-none): a #GVariant format string, or %NULL
23000  * @...: positional parameters, as per @format_string
23001  *
23002  * Sets or unsets an attribute on @menu_item.
23003  *
23004  * The attribute to set or unset is specified by @attribute. This
23005  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23006  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23007  * attribute name.
23008  * Attribute names are restricted to lowercase characters, numbers
23009  * and '-'. Furthermore, the names must begin with a lowercase character,
23010  * must not end with a '-', and must not contain consecutive dashes.
23011  *
23012  * If @format_string is non-%NULL then the proper position parameters
23013  * are collected to create a #GVariant instance to use as the attribute
23014  * value.  If it is %NULL then the positional parameterrs are ignored
23015  * and the named attribute is unset.
23016  *
23017  * See also g_menu_item_set_attribute_value() for an equivalent call
23018  * that directly accepts a #GVariant.
23019  *
23020  * Since: 2.32
23021  */
23022
23023
23024 /**
23025  * g_menu_item_set_attribute_value:
23026  * @menu_item: a #GMenuItem
23027  * @attribute: the attribute to set
23028  * @value: (allow-none): a #GVariant to use as the value, or %NULL
23029  *
23030  * Sets or unsets an attribute on @menu_item.
23031  *
23032  * The attribute to set or unset is specified by @attribute. This
23033  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23034  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23035  * attribute name.
23036  * Attribute names are restricted to lowercase characters, numbers
23037  * and '-'. Furthermore, the names must begin with a lowercase character,
23038  * must not end with a '-', and must not contain consecutive dashes.
23039  *
23040  * must consist only of lowercase
23041  * ASCII characters, digits and '-'.
23042  *
23043  * If @value is non-%NULL then it is used as the new value for the
23044  * attribute.  If @value is %NULL then the attribute is unset. If
23045  * the @value #GVariant is floating, it is consumed.
23046  *
23047  * See also g_menu_item_set_attribute() for a more convenient way to do
23048  * the same.
23049  *
23050  * Since: 2.32
23051  */
23052
23053
23054 /**
23055  * g_menu_item_set_detailed_action:
23056  * @menu_item: a #GMenuItem
23057  * @detailed_action: the "detailed" action string
23058  *
23059  * Sets the "action" and possibly the "target" attribute of @menu_item.
23060  *
23061  * If @detailed_action contains a double colon ("::") then it is used as
23062  * a separator between an action name and a target string.  In this
23063  * case, this call is equivalent to calling
23064  * g_menu_item_set_action_and_target() with the part before the "::" and
23065  * with a string-type #GVariant containing the part following the "::".
23066  *
23067  * If @detailed_action doesn't contain "::" then the action is set to
23068  * the given string (verbatim) and the target value is unset.
23069  *
23070  * See g_menu_item_set_action_and_target() or
23071  * g_menu_item_set_action_and_target_value() for more flexible (but
23072  * slightly less convenient) alternatives.
23073  *
23074  * See also g_menu_item_set_action_and_target_value() for a description of
23075  * the semantics of the action and target attributes.
23076  *
23077  * Since: 2.32
23078  */
23079
23080
23081 /**
23082  * g_menu_item_set_label:
23083  * @menu_item: a #GMenuItem
23084  * @label: (allow-none): the label to set, or %NULL to unset
23085  *
23086  * Sets or unsets the "label" attribute of @menu_item.
23087  *
23088  * If @label is non-%NULL it is used as the label for the menu item.  If
23089  * it is %NULL then the label attribute is unset.
23090  *
23091  * Since: 2.32
23092  */
23093
23094
23095 /**
23096  * g_menu_item_set_link:
23097  * @menu_item: a #GMenuItem
23098  * @link: type of link to establish or unset
23099  * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23100  *
23101  * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23102  *
23103  * Links are used to establish a relationship between a particular menu
23104  * item and another menu.  For example, %G_MENU_LINK_SUBMENU is used to
23105  * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23106  * is used to create a section. Other types of link can be used, but there
23107  * is no guarantee that clients will be able to make sense of them.
23108  * Link types are restricted to lowercase characters, numbers
23109  * and '-'. Furthermore, the names must begin with a lowercase character,
23110  * must not end with a '-', and must not contain consecutive dashes.
23111  *
23112  * Since: 2.32
23113  */
23114
23115
23116 /**
23117  * g_menu_item_set_section:
23118  * @menu_item: a #GMenuItem
23119  * @section: (allow-none): a #GMenuModel, or %NULL
23120  *
23121  * Sets or unsets the "section" link of @menu_item to @section.
23122  *
23123  * The effect of having one menu appear as a section of another is
23124  * exactly as it sounds: the items from @section become a direct part of
23125  * the menu that @menu_item is added to.  See g_menu_item_new_section()
23126  * for more information about what it means for a menu item to be a
23127  * section.
23128  *
23129  * Since: 2.32
23130  */
23131
23132
23133 /**
23134  * g_menu_item_set_submenu:
23135  * @menu_item: a #GMenuItem
23136  * @submenu: (allow-none): a #GMenuModel, or %NULL
23137  *
23138  * Sets or unsets the "submenu" link of @menu_item to @submenu.
23139  *
23140  * If @submenu is non-%NULL, it is linked to.  If it is %NULL then the
23141  * link is unset.
23142  *
23143  * The effect of having one menu appear as a submenu of another is
23144  * exactly as it sounds.
23145  *
23146  * Since: 2.32
23147  */
23148
23149
23150 /**
23151  * g_menu_link_iter_get_name:
23152  * @iter: a #GMenuLinkIter
23153  *
23154  * Gets the name of the link at the current iterator position.
23155  *
23156  * The iterator is not advanced.
23157  *
23158  * Returns: the type of the link
23159  * Since: 2.32
23160  */
23161
23162
23163 /**
23164  * g_menu_link_iter_get_next:
23165  * @iter: a #GMenuLinkIter
23166  * @out_link: (out) (allow-none) (transfer none): the name of the link
23167  * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23168  *
23169  * This function combines g_menu_link_iter_next() with
23170  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23171  *
23172  * First the iterator is advanced to the next (possibly first) link.
23173  * If that fails, then %FALSE is returned and there are no other effects.
23174  *
23175  * If successful, @out_link and @value are set to the name and #GMenuModel
23176  * of the link that has just been advanced to.  At this point,
23177  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23178  * same values again.
23179  *
23180  * The value returned in @out_link remains valid for as long as the iterator
23181  * remains at the current position.  The value returned in @value must
23182  * be unreffed using g_object_unref() when it is no longer in use.
23183  *
23184  * Returns: %TRUE on success, or %FALSE if there is no additional link
23185  * Since: 2.32
23186  */
23187
23188
23189 /**
23190  * g_menu_link_iter_get_value:
23191  * @iter: a #GMenuLinkIter
23192  *
23193  * Gets the linked #GMenuModel at the current iterator position.
23194  *
23195  * The iterator is not advanced.
23196  *
23197  * Returns: (transfer full): the #GMenuModel that is linked to
23198  * Since: 2.32
23199  */
23200
23201
23202 /**
23203  * g_menu_link_iter_next:
23204  * @iter: a #GMenuLinkIter
23205  *
23206  * Attempts to advance the iterator to the next (possibly first)
23207  * link.
23208  *
23209  * %TRUE is returned on success, or %FALSE if there are no more links.
23210  *
23211  * You must call this function when you first acquire the iterator to
23212  * advance it to the first link (and determine if the first link exists
23213  * at all).
23214  *
23215  * Returns: %TRUE on success, or %FALSE when there are no more links
23216  * Since: 2.32
23217  */
23218
23219
23220 /**
23221  * g_menu_model_get_item_attribute:
23222  * @model: a #GMenuModel
23223  * @item_index: the index of the item
23224  * @attribute: the attribute to query
23225  * @format_string: a #GVariant format string
23226  * @...: positional parameters, as per @format_string
23227  *
23228  * Queries item at position @item_index in @model for the attribute
23229  * specified by @attribute.
23230  *
23231  * If the attribute exists and matches the #GVariantType corresponding
23232  * to @format_string then @format_string is used to deconstruct the
23233  * value into the positional parameters and %TRUE is returned.
23234  *
23235  * If the attribute does not exist, or it does exist but has the wrong
23236  * type, then the positional parameters are ignored and %FALSE is
23237  * returned.
23238  *
23239  * This function is a mix of g_menu_model_get_item_attribute_value() and
23240  * g_variant_get(), followed by a g_variant_unref().  As such,
23241  * @format_string must make a complete copy of the data (since the
23242  * #GVariant may go away after the call to g_variant_unref()).  In
23243  * particular, no '&amp;' characters are allowed in @format_string.
23244  *
23245  * Returns: %TRUE if the named attribute was found with the expected type
23246  * Since: 2.32
23247  */
23248
23249
23250 /**
23251  * g_menu_model_get_item_attribute_value:
23252  * @model: a #GMenuModel
23253  * @item_index: the index of the item
23254  * @attribute: the attribute to query
23255  * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23256  *
23257  * Queries the item at position @item_index in @model for the attribute
23258  * specified by @attribute.
23259  *
23260  * If @expected_type is non-%NULL then it specifies the expected type of
23261  * the attribute.  If it is %NULL then any type will be accepted.
23262  *
23263  * If the attribute exists and matches @expected_type (or if the
23264  * expected type is unspecified) then the value is returned.
23265  *
23266  * If the attribute does not exist, or does not match the expected type
23267  * then %NULL is returned.
23268  *
23269  * Returns: (transfer full): the value of the attribute
23270  * Since: 2.32
23271  */
23272
23273
23274 /**
23275  * g_menu_model_get_item_link:
23276  * @model: a #GMenuModel
23277  * @item_index: the index of the item
23278  * @link: the link to query
23279  *
23280  * Queries the item at position @item_index in @model for the link
23281  * specified by @link.
23282  *
23283  * If the link exists, the linked #GMenuModel is returned.  If the link
23284  * does not exist, %NULL is returned.
23285  *
23286  * Returns: (transfer full): the linked #GMenuModel, or %NULL
23287  * Since: 2.32
23288  */
23289
23290
23291 /**
23292  * g_menu_model_get_n_items:
23293  * @model: a #GMenuModel
23294  *
23295  * Query the number of items in @model.
23296  *
23297  * Returns: the number of items
23298  * Since: 2.32
23299  */
23300
23301
23302 /**
23303  * g_menu_model_is_mutable:
23304  * @model: a #GMenuModel
23305  *
23306  * Queries if @model is mutable.
23307  *
23308  * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23309  * signal. Consumers of the model may make optimisations accordingly.
23310  *
23311  * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23312  * Since: 2.32
23313  */
23314
23315
23316 /**
23317  * g_menu_model_items_changed:
23318  * @model: a #GMenuModel
23319  * @position: the position of the change
23320  * @removed: the number of items removed
23321  * @added: the number of items added
23322  *
23323  * Requests emission of the #GMenuModel::items-changed signal on @model.
23324  *
23325  * This function should never be called except by #GMenuModel
23326  * subclasses.  Any other calls to this function will very likely lead
23327  * to a violation of the interface of the model.
23328  *
23329  * The implementation should update its internal representation of the
23330  * menu before emitting the signal.  The implementation should further
23331  * expect to receive queries about the new state of the menu (and
23332  * particularly added menu items) while signal handlers are running.
23333  *
23334  * The implementation must dispatch this call directly from a mainloop
23335  * entry and not in response to calls -- particularly those from the
23336  * #GMenuModel API.  Said another way: the menu must not change while
23337  * user code is running without returning to the mainloop.
23338  *
23339  * Since: 2.32
23340  */
23341
23342
23343 /**
23344  * g_menu_model_iterate_item_attributes:
23345  * @model: a #GMenuModel
23346  * @item_index: the index of the item
23347  *
23348  * Creates a #GMenuAttributeIter to iterate over the attributes of
23349  * the item at position @item_index in @model.
23350  *
23351  * You must free the iterator with g_object_unref() when you are done.
23352  *
23353  * Returns: (transfer full): a new #GMenuAttributeIter
23354  * Since: 2.32
23355  */
23356
23357
23358 /**
23359  * g_menu_model_iterate_item_links:
23360  * @model: a #GMenuModel
23361  * @item_index: the index of the item
23362  *
23363  * Creates a #GMenuLinkIter to iterate over the links of the item at
23364  * position @item_index in @model.
23365  *
23366  * You must free the iterator with g_object_unref() when you are done.
23367  *
23368  * Returns: (transfer full): a new #GMenuLinkIter
23369  * Since: 2.32
23370  */
23371
23372
23373 /**
23374  * g_menu_new:
23375  *
23376  * Creates a new #GMenu.
23377  *
23378  * The new menu has no items.
23379  *
23380  * Returns: a new #GMenu
23381  * Since: 2.32
23382  */
23383
23384
23385 /**
23386  * g_menu_prepend:
23387  * @menu: a #GMenu
23388  * @label: (allow-none): the section label, or %NULL
23389  * @detailed_action: (allow-none): the detailed action string, or %NULL
23390  *
23391  * Convenience function for prepending a normal menu item to the start
23392  * of @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
23393  * flexible alternative.
23394  *
23395  * Since: 2.32
23396  */
23397
23398
23399 /**
23400  * g_menu_prepend_item:
23401  * @menu: a #GMenu
23402  * @item: a #GMenuItem to prepend
23403  *
23404  * Prepends @item to the start of @menu.
23405  *
23406  * See g_menu_insert_item() for more information.
23407  *
23408  * Since: 2.32
23409  */
23410
23411
23412 /**
23413  * g_menu_prepend_section:
23414  * @menu: a #GMenu
23415  * @label: (allow-none): the section label, or %NULL
23416  * @section: a #GMenuModel with the items of the section
23417  *
23418  * Convenience function for prepending a section menu item to the start
23419  * of @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for
23420  * a more flexible alternative.
23421  *
23422  * Since: 2.32
23423  */
23424
23425
23426 /**
23427  * g_menu_prepend_submenu:
23428  * @menu: a #GMenu
23429  * @label: (allow-none): the section label, or %NULL
23430  * @submenu: a #GMenuModel with the items of the submenu
23431  *
23432  * Convenience function for prepending a submenu menu item to the start
23433  * of @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23434  * a more flexible alternative.
23435  *
23436  * Since: 2.32
23437  */
23438
23439
23440 /**
23441  * g_menu_remove:
23442  * @menu: a #GMenu
23443  * @position: the position of the item to remove
23444  *
23445  * Removes an item from the menu.
23446  *
23447  * @position gives the index of the item to remove.
23448  *
23449  * It is an error if position is not in range the range from 0 to one
23450  * less than the number of items in the menu.
23451  *
23452  * It is not possible to remove items by identity since items are added
23453  * to the menu simply by copying their links and attributes (ie:
23454  * identity of the item itself is not preserved).
23455  *
23456  * Since: 2.32
23457  */
23458
23459
23460 /**
23461  * g_mount_can_eject:
23462  * @mount: a #GMount.
23463  *
23464  * Checks if @mount can be eject.
23465  *
23466  * Returns: %TRUE if the @mount can be ejected.
23467  */
23468
23469
23470 /**
23471  * g_mount_can_unmount:
23472  * @mount: a #GMount.
23473  *
23474  * Checks if @mount can be mounted.
23475  *
23476  * Returns: %TRUE if the @mount can be unmounted.
23477  */
23478
23479
23480 /**
23481  * g_mount_eject:
23482  * @mount: a #GMount.
23483  * @flags: flags affecting the unmount if required for eject
23484  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23485  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23486  * @user_data: user data passed to @callback.
23487  *
23488  * Ejects a mount. This is an asynchronous operation, and is
23489  * finished by calling g_mount_eject_finish() with the @mount
23490  * and #GAsyncResult data returned in the @callback.
23491  *
23492  * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23493  */
23494
23495
23496 /**
23497  * g_mount_eject_finish:
23498  * @mount: a #GMount.
23499  * @result: a #GAsyncResult.
23500  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23501  *
23502  * Finishes ejecting a mount. If any errors occurred during the operation,
23503  * @error will be set to contain the errors and %FALSE will be returned.
23504  *
23505  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23506  * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23507  */
23508
23509
23510 /**
23511  * g_mount_eject_with_operation:
23512  * @mount: a #GMount.
23513  * @flags: flags affecting the unmount if required for eject
23514  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23515  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23516  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23517  * @user_data: user data passed to @callback.
23518  *
23519  * Ejects a mount. This is an asynchronous operation, and is
23520  * finished by calling g_mount_eject_with_operation_finish() with the @mount
23521  * and #GAsyncResult data returned in the @callback.
23522  *
23523  * Since: 2.22
23524  */
23525
23526
23527 /**
23528  * g_mount_eject_with_operation_finish:
23529  * @mount: a #GMount.
23530  * @result: a #GAsyncResult.
23531  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23532  *
23533  * Finishes ejecting a mount. If any errors occurred during the operation,
23534  * @error will be set to contain the errors and %FALSE will be returned.
23535  *
23536  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23537  * Since: 2.22
23538  */
23539
23540
23541 /**
23542  * g_mount_get_default_location:
23543  * @mount: a #GMount.
23544  *
23545  * Gets the default location of @mount. The default location of the given
23546  * @mount is a path that reflects the main entry point for the user (e.g.
23547  * the home directory, or the root of the volume).
23548  *
23549  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23550  */
23551
23552
23553 /**
23554  * g_mount_get_drive:
23555  * @mount: a #GMount.
23556  *
23557  * Gets the drive for the @mount.
23558  *
23559  * This is a convenience method for getting the #GVolume and then
23560  * using that object to get the #GDrive.
23561  *
23562  * 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.
23563  */
23564
23565
23566 /**
23567  * g_mount_get_icon:
23568  * @mount: a #GMount.
23569  *
23570  * Gets the icon for @mount.
23571  *
23572  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23573  */
23574
23575
23576 /**
23577  * g_mount_get_name:
23578  * @mount: a #GMount.
23579  *
23580  * Gets the name of @mount.
23581  *
23582  * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23583  */
23584
23585
23586 /**
23587  * g_mount_get_root:
23588  * @mount: a #GMount.
23589  *
23590  * Gets the root directory on @mount.
23591  *
23592  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23593  */
23594
23595
23596 /**
23597  * g_mount_get_sort_key:
23598  * @mount: A #GMount.
23599  *
23600  * Gets the sort key for @mount, if any.
23601  *
23602  * Returns: Sorting key for @mount or %NULL if no such key is available.
23603  * Since: 2.32
23604  */
23605
23606
23607 /**
23608  * g_mount_get_symbolic_icon:
23609  * @mount: a #GMount.
23610  *
23611  * Gets the symbolic icon for @mount.
23612  *
23613  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23614  * Since: 2.34
23615  */
23616
23617
23618 /**
23619  * g_mount_get_uuid:
23620  * @mount: a #GMount.
23621  *
23622  * Gets the UUID for the @mount. The reference is typically based on
23623  * the file system UUID for the mount in question and should be
23624  * considered an opaque string. Returns %NULL if there is no UUID
23625  * available.
23626  *
23627  * 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.
23628  */
23629
23630
23631 /**
23632  * g_mount_get_volume:
23633  * @mount: a #GMount.
23634  *
23635  * Gets the volume for the @mount.
23636  *
23637  * 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.
23638  */
23639
23640
23641 /**
23642  * g_mount_guess_content_type:
23643  * @mount: a #GMount
23644  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23645  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23646  * @callback: a #GAsyncReadyCallback
23647  * @user_data: user data passed to @callback
23648  *
23649  * Tries to guess the type of content stored on @mount. Returns one or
23650  * more textual identifiers of well-known content types (typically
23651  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23652  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23653  * specification for more on x-content types.
23654  *
23655  * This is an asynchronous operation (see
23656  * g_mount_guess_content_type_sync() for the synchronous version), and
23657  * is finished by calling g_mount_guess_content_type_finish() with the
23658  * @mount and #GAsyncResult data returned in the @callback.
23659  *
23660  * Since: 2.18
23661  */
23662
23663
23664 /**
23665  * g_mount_guess_content_type_finish:
23666  * @mount: a #GMount
23667  * @result: a #GAsyncResult
23668  * @error: a #GError location to store the error occurring, or %NULL to ignore
23669  *
23670  * Finishes guessing content types of @mount. If any errors occurred
23671  * during the operation, @error will be set to contain the errors and
23672  * %FALSE will be returned. In particular, you may get an
23673  * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23674  * guessing.
23675  *
23676  * 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.
23677  * Since: 2.18
23678  */
23679
23680
23681 /**
23682  * g_mount_guess_content_type_sync:
23683  * @mount: a #GMount
23684  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23685  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23686  * @error: a #GError location to store the error occurring, or %NULL to ignore
23687  *
23688  * Tries to guess the type of content stored on @mount. Returns one or
23689  * more textual identifiers of well-known content types (typically
23690  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23691  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23692  * specification for more on x-content types.
23693  *
23694  * This is an synchronous operation and as such may block doing IO;
23695  * see g_mount_guess_content_type() for the asynchronous version.
23696  *
23697  * 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.
23698  * Since: 2.18
23699  */
23700
23701
23702 /**
23703  * g_mount_is_shadowed:
23704  * @mount: A #GMount.
23705  *
23706  * Determines if @mount is shadowed. Applications or libraries should
23707  * avoid displaying @mount in the user interface if it is shadowed.
23708  *
23709  * A mount is said to be shadowed if there exists one or more user
23710  * visible objects (currently #GMount objects) with a root that is
23711  * inside the root of @mount.
23712  *
23713  * One application of shadow mounts is when exposing a single file
23714  * system that is used to address several logical volumes. In this
23715  * situation, a #GVolumeMonitor implementation would create two
23716  * #GVolume objects (for example, one for the camera functionality of
23717  * the device and one for a SD card reader on the device) with
23718  * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23719  * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23720  * underlying mount (with root
23721  * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23722  * #GVolumeMonitor implementation would create two #GMount objects
23723  * (each with their root matching the corresponding volume activation
23724  * root) that would shadow the original mount.
23725  *
23726  * The proxy monitor in GVfs 2.26 and later, automatically creates and
23727  * manage shadow mounts (and shadows the underlying mount) if the
23728  * activation root on a #GVolume is set.
23729  *
23730  * Returns: %TRUE if @mount is shadowed.
23731  * Since: 2.20
23732  */
23733
23734
23735 /**
23736  * g_mount_operation_get_anonymous:
23737  * @op: a #GMountOperation.
23738  *
23739  * Check to see whether the mount operation is being used
23740  * for an anonymous user.
23741  *
23742  * Returns: %TRUE if mount operation is anonymous.
23743  */
23744
23745
23746 /**
23747  * g_mount_operation_get_choice:
23748  * @op: a #GMountOperation.
23749  *
23750  * Gets a choice from the mount operation.
23751  *
23752  * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23753  */
23754
23755
23756 /**
23757  * g_mount_operation_get_domain:
23758  * @op: a #GMountOperation.
23759  *
23760  * Gets the domain of the mount operation.
23761  *
23762  * Returns: a string set to the domain.
23763  */
23764
23765
23766 /**
23767  * g_mount_operation_get_password:
23768  * @op: a #GMountOperation.
23769  *
23770  * Gets a password from the mount operation.
23771  *
23772  * Returns: a string containing the password within @op.
23773  */
23774
23775
23776 /**
23777  * g_mount_operation_get_password_save:
23778  * @op: a #GMountOperation.
23779  *
23780  * Gets the state of saving passwords for the mount operation.
23781  *
23782  * Returns: a #GPasswordSave flag.
23783  */
23784
23785
23786 /**
23787  * g_mount_operation_get_username:
23788  * @op: a #GMountOperation.
23789  *
23790  * Get the user name from the mount operation.
23791  *
23792  * Returns: a string containing the user name.
23793  */
23794
23795
23796 /**
23797  * g_mount_operation_new:
23798  *
23799  * Creates a new mount operation.
23800  *
23801  * Returns: a #GMountOperation.
23802  */
23803
23804
23805 /**
23806  * g_mount_operation_reply:
23807  * @op: a #GMountOperation
23808  * @result: a #GMountOperationResult
23809  *
23810  * Emits the #GMountOperation::reply signal.
23811  */
23812
23813
23814 /**
23815  * g_mount_operation_set_anonymous:
23816  * @op: a #GMountOperation.
23817  * @anonymous: boolean value.
23818  *
23819  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23820  */
23821
23822
23823 /**
23824  * g_mount_operation_set_choice:
23825  * @op: a #GMountOperation.
23826  * @choice: an integer.
23827  *
23828  * Sets a default choice for the mount operation.
23829  */
23830
23831
23832 /**
23833  * g_mount_operation_set_domain:
23834  * @op: a #GMountOperation.
23835  * @domain: the domain to set.
23836  *
23837  * Sets the mount operation's domain.
23838  */
23839
23840
23841 /**
23842  * g_mount_operation_set_password:
23843  * @op: a #GMountOperation.
23844  * @password: password to set.
23845  *
23846  * Sets the mount operation's password to @password.
23847  */
23848
23849
23850 /**
23851  * g_mount_operation_set_password_save:
23852  * @op: a #GMountOperation.
23853  * @save: a set of #GPasswordSave flags.
23854  *
23855  * Sets the state of saving passwords for the mount operation.
23856  */
23857
23858
23859 /**
23860  * g_mount_operation_set_username:
23861  * @op: a #GMountOperation.
23862  * @username: input username.
23863  *
23864  * Sets the user name within @op to @username.
23865  */
23866
23867
23868 /**
23869  * g_mount_remount:
23870  * @mount: a #GMount.
23871  * @flags: flags affecting the operation
23872  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23873  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23874  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23875  * @user_data: user data passed to @callback.
23876  *
23877  * Remounts a mount. This is an asynchronous operation, and is
23878  * finished by calling g_mount_remount_finish() with the @mount
23879  * and #GAsyncResults data returned in the @callback.
23880  *
23881  * Remounting is useful when some setting affecting the operation
23882  * of the volume has been changed, as these may need a remount to
23883  * take affect. While this is semantically equivalent with unmounting
23884  * and then remounting not all backends might need to actually be
23885  * unmounted.
23886  */
23887
23888
23889 /**
23890  * g_mount_remount_finish:
23891  * @mount: a #GMount.
23892  * @result: a #GAsyncResult.
23893  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23894  *
23895  * Finishes remounting a mount. If any errors occurred during the operation,
23896  * @error will be set to contain the errors and %FALSE will be returned.
23897  *
23898  * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23899  */
23900
23901
23902 /**
23903  * g_mount_shadow:
23904  * @mount: A #GMount.
23905  *
23906  * Increments the shadow count on @mount. Usually used by
23907  * #GVolumeMonitor implementations when creating a shadow mount for
23908  * @mount, see g_mount_is_shadowed() for more information. The caller
23909  * will need to emit the #GMount::changed signal on @mount manually.
23910  *
23911  * Since: 2.20
23912  */
23913
23914
23915 /**
23916  * g_mount_unmount:
23917  * @mount: a #GMount.
23918  * @flags: flags affecting the operation
23919  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23920  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23921  * @user_data: user data passed to @callback.
23922  *
23923  * Unmounts a mount. This is an asynchronous operation, and is
23924  * finished by calling g_mount_unmount_finish() with the @mount
23925  * and #GAsyncResult data returned in the @callback.
23926  *
23927  * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23928  */
23929
23930
23931 /**
23932  * g_mount_unmount_finish:
23933  * @mount: a #GMount.
23934  * @result: a #GAsyncResult.
23935  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23936  *
23937  * Finishes unmounting a mount. If any errors occurred during the operation,
23938  * @error will be set to contain the errors and %FALSE will be returned.
23939  *
23940  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23941  * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23942  */
23943
23944
23945 /**
23946  * g_mount_unmount_with_operation:
23947  * @mount: a #GMount.
23948  * @flags: flags affecting the operation
23949  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23950  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23951  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23952  * @user_data: user data passed to @callback.
23953  *
23954  * Unmounts a mount. This is an asynchronous operation, and is
23955  * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23956  * and #GAsyncResult data returned in the @callback.
23957  *
23958  * Since: 2.22
23959  */
23960
23961
23962 /**
23963  * g_mount_unmount_with_operation_finish:
23964  * @mount: a #GMount.
23965  * @result: a #GAsyncResult.
23966  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23967  *
23968  * Finishes unmounting a mount. If any errors occurred during the operation,
23969  * @error will be set to contain the errors and %FALSE will be returned.
23970  *
23971  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23972  * Since: 2.22
23973  */
23974
23975
23976 /**
23977  * g_mount_unshadow:
23978  * @mount: A #GMount.
23979  *
23980  * Decrements the shadow count on @mount. Usually used by
23981  * #GVolumeMonitor implementations when destroying a shadow mount for
23982  * @mount, see g_mount_is_shadowed() for more information. The caller
23983  * will need to emit the #GMount::changed signal on @mount manually.
23984  *
23985  * Since: 2.20
23986  */
23987
23988
23989 /**
23990  * g_network_address_get_hostname:
23991  * @addr: a #GNetworkAddress
23992  *
23993  * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
23994  * depending on what @addr was created with.
23995  *
23996  * Returns: @addr's hostname
23997  * Since: 2.22
23998  */
23999
24000
24001 /**
24002  * g_network_address_get_port:
24003  * @addr: a #GNetworkAddress
24004  *
24005  * Gets @addr's port number
24006  *
24007  * Returns: @addr's port (which may be 0)
24008  * Since: 2.22
24009  */
24010
24011
24012 /**
24013  * g_network_address_get_scheme:
24014  * @addr: a #GNetworkAddress
24015  *
24016  * Gets @addr's scheme
24017  *
24018  * Returns: @addr's scheme (%NULL if not built from URI)
24019  * Since: 2.26
24020  */
24021
24022
24023 /**
24024  * g_network_address_new:
24025  * @hostname: the hostname
24026  * @port: the port
24027  *
24028  * Creates a new #GSocketConnectable for connecting to the given
24029  * @hostname and @port.
24030  *
24031  * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24032  * Since: 2.22
24033  */
24034
24035
24036 /**
24037  * g_network_address_parse:
24038  * @host_and_port: the hostname and optionally a port
24039  * @default_port: the default port if not in @host_and_port
24040  * @error: a pointer to a #GError, or %NULL
24041  *
24042  * Creates a new #GSocketConnectable for connecting to the given
24043  * @hostname and @port. May fail and return %NULL in case
24044  * parsing @host_and_port fails.
24045  *
24046  * @host_and_port may be in any of a number of recognised formats; an IPv6
24047  * address, an IPv4 address, or a domain name (in which case a DNS
24048  * lookup is performed). Quoting with [] is supported for all address
24049  * types. A port override may be specified in the usual way with a
24050  * colon.
24051  *
24052  * If no port is specified in @host_and_port then @default_port will be
24053  * used as the port number to connect to.
24054  *
24055  * In general, @host_and_port is expected to be provided by the user
24056  * (allowing them to give the hostname, and a port overide if necessary)
24057  * and @default_port is expected to be provided by the application.
24058  *
24059  * (The port component of @host_and_port can also be specified as a
24060  * service name rather than as a numeric port, but this functionality
24061  * is deprecated, because it depends on the contents of /etc/services,
24062  * which is generally quite sparse on platforms other than Linux.)
24063  *
24064  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24065  * Since: 2.22
24066  */
24067
24068
24069 /**
24070  * g_network_address_parse_uri:
24071  * @uri: the hostname and optionally a port
24072  * @default_port: The default port if none is found in the URI
24073  * @error: a pointer to a #GError, or %NULL
24074  *
24075  * Creates a new #GSocketConnectable for connecting to the given
24076  * @uri. May fail and return %NULL in case parsing @uri fails.
24077  *
24078  * Using this rather than g_network_address_new() or
24079  * g_network_address_parse() allows #GSocketClient to determine
24080  * when to use application-specific proxy protocols.
24081  *
24082  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24083  * Since: 2.26
24084  */
24085
24086
24087 /**
24088  * g_network_monitor_base_add_network:
24089  * @monitor: the #GNetworkMonitorBase
24090  * @network: a #GInetAddressMask
24091  *
24092  * Adds @network to @monitor's list of available networks.
24093  *
24094  * Since: 2.32
24095  */
24096
24097
24098 /**
24099  * g_network_monitor_base_remove_network:
24100  * @monitor: the #GNetworkMonitorBase
24101  * @network: a #GInetAddressMask
24102  *
24103  * Removes @network from @monitor's list of available networks.
24104  *
24105  * Since: 2.32
24106  */
24107
24108
24109 /**
24110  * g_network_monitor_base_set_networks:
24111  * @monitor: the #GNetworkMonitorBase
24112  * @networks: (array length=length): an array of #GInetAddressMask
24113  * @length: length of @networks
24114  *
24115  * Drops @monitor's current list of available networks and replaces
24116  * it with @networks.
24117  */
24118
24119
24120 /**
24121  * g_network_monitor_can_reach:
24122  * @monitor: a #GNetworkMonitor
24123  * @connectable: a #GSocketConnectable
24124  * @cancellable: (allow-none): a #GCancellable, or %NULL
24125  * @error: return location for a #GError, or %NULL
24126  *
24127  * Attempts to determine whether or not the host pointed to by
24128  * @connectable can be reached, without actually trying to connect to
24129  * it.
24130  *
24131  * This may return %TRUE even when #GNetworkMonitor:network-available
24132  * is %FALSE, if, for example, @monitor can determine that
24133  * @connectable refers to a host on a local network.
24134  *
24135  * If @monitor believes that an attempt to connect to @connectable
24136  * will succeed, it will return %TRUE. Otherwise, it will return
24137  * %FALSE and set @error to an appropriate error (such as
24138  * %G_IO_ERROR_HOST_UNREACHABLE).
24139  *
24140  * Note that although this does not attempt to connect to
24141  * @connectable, it may still block for a brief period of time (eg,
24142  * trying to do multicast DNS on the local network), so if you do not
24143  * want to block, you should use g_network_monitor_can_reach_async().
24144  *
24145  * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24146  * Since: 2.32
24147  */
24148
24149
24150 /**
24151  * g_network_monitor_can_reach_async:
24152  * @monitor: a #GNetworkMonitor
24153  * @connectable: a #GSocketConnectable
24154  * @cancellable: (allow-none): a #GCancellable, or %NULL
24155  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24156  * @user_data: (closure): the data to pass to callback function
24157  *
24158  * Asynchronously attempts to determine whether or not the host
24159  * pointed to by @connectable can be reached, without actually
24160  * trying to connect to it.
24161  *
24162  * For more details, see g_network_monitor_can_reach().
24163  *
24164  * When the operation is finished, @callback will be called.
24165  * You can then call g_network_monitor_can_reach_finish()
24166  * to get the result of the operation.
24167  */
24168
24169
24170 /**
24171  * g_network_monitor_can_reach_finish:
24172  * @monitor: a #GNetworkMonitor
24173  * @result: a #GAsyncResult
24174  * @error: return location for errors, or %NULL
24175  *
24176  * Finishes an async network connectivity test.
24177  * See g_network_monitor_can_reach_async().
24178  *
24179  * Returns: %TRUE if network is reachable, %FALSE if not.
24180  */
24181
24182
24183 /**
24184  * g_network_monitor_get_default:
24185  *
24186  * Gets the default #GNetworkMonitor for the system.
24187  *
24188  * Returns: (transfer none): a #GNetworkMonitor
24189  * Since: 2.32
24190  */
24191
24192
24193 /**
24194  * g_network_monitor_get_network_available:
24195  * @monitor: the #GNetworkMonitor
24196  *
24197  * Checks if the network is available. "Available" here means that the
24198  * system has a default route available for at least one of IPv4 or
24199  * IPv6. It does not necessarily imply that the public Internet is
24200  * reachable. See #GNetworkMonitor:network-available for more details.
24201  *
24202  * Returns: whether the network is available
24203  * Since: 2.32
24204  */
24205
24206
24207 /**
24208  * g_network_service_get_domain:
24209  * @srv: a #GNetworkService
24210  *
24211  * Gets the domain that @srv serves. This might be either UTF-8 or
24212  * ASCII-encoded, depending on what @srv was created with.
24213  *
24214  * Returns: @srv's domain name
24215  * Since: 2.22
24216  */
24217
24218
24219 /**
24220  * g_network_service_get_protocol:
24221  * @srv: a #GNetworkService
24222  *
24223  * Gets @srv's protocol name (eg, "tcp").
24224  *
24225  * Returns: @srv's protocol name
24226  * Since: 2.22
24227  */
24228
24229
24230 /**
24231  * g_network_service_get_scheme:
24232  * @srv: a #GNetworkService
24233  *
24234  * Get's the URI scheme used to resolve proxies. By default, the service name
24235  * is used as scheme.
24236  *
24237  * Returns: @srv's scheme name
24238  * Since: 2.26
24239  */
24240
24241
24242 /**
24243  * g_network_service_get_service:
24244  * @srv: a #GNetworkService
24245  *
24246  * Gets @srv's service name (eg, "ldap").
24247  *
24248  * Returns: @srv's service name
24249  * Since: 2.22
24250  */
24251
24252
24253 /**
24254  * g_network_service_new:
24255  * @service: the service type to look up (eg, "ldap")
24256  * @protocol: the networking protocol to use for @service (eg, "tcp")
24257  * @domain: the DNS domain to look up the service in
24258  *
24259  * Creates a new #GNetworkService representing the given @service,
24260  * @protocol, and @domain. This will initially be unresolved; use the
24261  * #GSocketConnectable interface to resolve it.
24262  *
24263  * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24264  * Since: 2.22
24265  */
24266
24267
24268 /**
24269  * g_network_service_set_scheme:
24270  * @srv: a #GNetworkService
24271  * @scheme: a URI scheme
24272  *
24273  * Set's the URI scheme used to resolve proxies. By default, the service name
24274  * is used as scheme.
24275  *
24276  * Since: 2.26
24277  */
24278
24279
24280 /**
24281  * g_null_settings_backend_new:
24282  *
24283  * Creates a readonly #GSettingsBackend.
24284  *
24285  * This backend does not allow changes to settings, so all settings
24286  * will always have their default values.
24287  *
24288  * Returns: (transfer full): a newly created #GSettingsBackend
24289  * Since: 2.28
24290  */
24291
24292
24293 /**
24294  * g_output_stream_clear_pending:
24295  * @stream: output stream
24296  *
24297  * Clears the pending flag on @stream.
24298  */
24299
24300
24301 /**
24302  * g_output_stream_close:
24303  * @stream: A #GOutputStream.
24304  * @cancellable: (allow-none): optional cancellable object
24305  * @error: location to store the error occurring, or %NULL to ignore
24306  *
24307  * Closes the stream, releasing resources related to it.
24308  *
24309  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24310  * Closing a stream multiple times will not return an error.
24311  *
24312  * Closing a stream will automatically flush any outstanding buffers in the
24313  * stream.
24314  *
24315  * Streams will be automatically closed when the last reference
24316  * is dropped, but you might want to call this function to make sure
24317  * resources are released as early as possible.
24318  *
24319  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24320  * open after the stream is closed. See the documentation for the individual
24321  * stream for details.
24322  *
24323  * On failure the first error that happened will be reported, but the close
24324  * operation will finish as much as possible. A stream that failed to
24325  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24326  * is important to check and report the error to the user, otherwise
24327  * there might be a loss of data as all data might not be written.
24328  *
24329  * If @cancellable is not %NULL, then the operation can be cancelled by
24330  * triggering the cancellable object from another thread. If the operation
24331  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24332  * Cancelling a close will still leave the stream closed, but there some streams
24333  * can use a faster close that doesn't block to e.g. check errors. On
24334  * cancellation (as with any error) there is no guarantee that all written
24335  * data will reach the target.
24336  *
24337  * Returns: %TRUE on success, %FALSE on failure
24338  */
24339
24340
24341 /**
24342  * g_output_stream_close_async:
24343  * @stream: A #GOutputStream.
24344  * @io_priority: the io priority of the request.
24345  * @cancellable: (allow-none): optional cancellable object
24346  * @callback: (scope async): callback to call when the request is satisfied
24347  * @user_data: (closure): the data to pass to callback function
24348  *
24349  * Requests an asynchronous close of the stream, releasing resources
24350  * related to it. When the operation is finished @callback will be
24351  * called. You can then call g_output_stream_close_finish() to get
24352  * the result of the operation.
24353  *
24354  * For behaviour details see g_output_stream_close().
24355  *
24356  * The asyncronous methods have a default fallback that uses threads
24357  * to implement asynchronicity, so they are optional for inheriting
24358  * classes. However, if you override one you must override all.
24359  */
24360
24361
24362 /**
24363  * g_output_stream_close_finish:
24364  * @stream: a #GOutputStream.
24365  * @result: a #GAsyncResult.
24366  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24367  *
24368  * Closes an output stream.
24369  *
24370  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24371  */
24372
24373
24374 /**
24375  * g_output_stream_flush:
24376  * @stream: a #GOutputStream.
24377  * @cancellable: (allow-none): optional cancellable object
24378  * @error: location to store the error occurring, or %NULL to ignore
24379  *
24380  * Forces a write of all user-space buffered data for the given
24381  * @stream. Will block during the operation. Closing the stream will
24382  * implicitly cause a flush.
24383  *
24384  * This function is optional for inherited classes.
24385  *
24386  * If @cancellable is not %NULL, then the operation can be cancelled by
24387  * triggering the cancellable object from another thread. If the operation
24388  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24389  *
24390  * Returns: %TRUE on success, %FALSE on error
24391  */
24392
24393
24394 /**
24395  * g_output_stream_flush_async:
24396  * @stream: a #GOutputStream.
24397  * @io_priority: the io priority of the request.
24398  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24399  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24400  * @user_data: (closure): the data to pass to callback function
24401  *
24402  * Forces an asynchronous write of all user-space buffered data for
24403  * the given @stream.
24404  * For behaviour details see g_output_stream_flush().
24405  *
24406  * When the operation is finished @callback will be
24407  * called. You can then call g_output_stream_flush_finish() to get the
24408  * result of the operation.
24409  */
24410
24411
24412 /**
24413  * g_output_stream_flush_finish:
24414  * @stream: a #GOutputStream.
24415  * @result: a GAsyncResult.
24416  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24417  *
24418  * Finishes flushing an output stream.
24419  *
24420  * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24421  */
24422
24423
24424 /**
24425  * g_output_stream_has_pending:
24426  * @stream: a #GOutputStream.
24427  *
24428  * Checks if an ouput stream has pending actions.
24429  *
24430  * Returns: %TRUE if @stream has pending actions.
24431  */
24432
24433
24434 /**
24435  * g_output_stream_is_closed:
24436  * @stream: a #GOutputStream.
24437  *
24438  * Checks if an output stream has already been closed.
24439  *
24440  * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24441  */
24442
24443
24444 /**
24445  * g_output_stream_is_closing:
24446  * @stream: a #GOutputStream.
24447  *
24448  * Checks if an output stream is being closed. This can be
24449  * used inside e.g. a flush implementation to see if the
24450  * flush (or other i/o operation) is called from within
24451  * the closing operation.
24452  *
24453  * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24454  * Since: 2.24
24455  */
24456
24457
24458 /**
24459  * g_output_stream_set_pending:
24460  * @stream: a #GOutputStream.
24461  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24462  *
24463  * Sets @stream to have actions pending. If the pending flag is
24464  * already set or @stream is closed, it will return %FALSE and set
24465  * @error.
24466  *
24467  * Returns: %TRUE if pending was previously unset and is now set.
24468  */
24469
24470
24471 /**
24472  * g_output_stream_splice:
24473  * @stream: a #GOutputStream.
24474  * @source: a #GInputStream.
24475  * @flags: a set of #GOutputStreamSpliceFlags.
24476  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24477  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24478  *
24479  * Splices an input stream into an output stream.
24480  *
24481  * 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.
24482  */
24483
24484
24485 /**
24486  * g_output_stream_splice_async:
24487  * @stream: a #GOutputStream.
24488  * @source: a #GInputStream.
24489  * @flags: a set of #GOutputStreamSpliceFlags.
24490  * @io_priority: the io priority of the request.
24491  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24492  * @callback: (scope async): a #GAsyncReadyCallback.
24493  * @user_data: (closure): user data passed to @callback.
24494  *
24495  * Splices a stream asynchronously.
24496  * When the operation is finished @callback will be called.
24497  * You can then call g_output_stream_splice_finish() to get the
24498  * result of the operation.
24499  *
24500  * For the synchronous, blocking version of this function, see
24501  * g_output_stream_splice().
24502  */
24503
24504
24505 /**
24506  * g_output_stream_splice_finish:
24507  * @stream: a #GOutputStream.
24508  * @result: a #GAsyncResult.
24509  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24510  *
24511  * Finishes an asynchronous stream splice operation.
24512  *
24513  * 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.
24514  */
24515
24516
24517 /**
24518  * g_output_stream_write:
24519  * @stream: a #GOutputStream.
24520  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24521  * @count: the number of bytes to write
24522  * @cancellable: (allow-none): optional cancellable object
24523  * @error: location to store the error occurring, or %NULL to ignore
24524  *
24525  * Tries to write @count bytes from @buffer into the stream. Will block
24526  * during the operation.
24527  *
24528  * If count is 0, returns 0 and does nothing. A value of @count
24529  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24530  *
24531  * On success, the number of bytes written to the stream is returned.
24532  * It is not an error if this is not the same as the requested size, as it
24533  * can happen e.g. on a partial I/O error, or if there is not enough
24534  * storage in the stream. All writes block until at least one byte
24535  * is written or an error occurs; 0 is never returned (unless
24536  * @count is 0).
24537  *
24538  * If @cancellable is not %NULL, then the operation can be cancelled by
24539  * triggering the cancellable object from another thread. If the operation
24540  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24541  * operation was partially finished when the operation was cancelled the
24542  * partial result will be returned, without an error.
24543  *
24544  * On error -1 is returned and @error is set accordingly.
24545  *
24546  * Virtual: write_fn
24547  * Returns: Number of bytes written, or -1 on error
24548  */
24549
24550
24551 /**
24552  * g_output_stream_write_all:
24553  * @stream: a #GOutputStream.
24554  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24555  * @count: the number of bytes to write
24556  * @bytes_written: (out): location to store the number of bytes that was written to the stream
24557  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24558  * @error: location to store the error occurring, or %NULL to ignore
24559  *
24560  * Tries to write @count bytes from @buffer into the stream. Will block
24561  * during the operation.
24562  *
24563  * This function is similar to g_output_stream_write(), except it tries to
24564  * write as many bytes as requested, only stopping on an error.
24565  *
24566  * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24567  * is set to @count.
24568  *
24569  * If there is an error during the operation %FALSE is returned and @error
24570  * is set to indicate the error status, @bytes_written is updated to contain
24571  * the number of bytes written into the stream before the error occurred.
24572  *
24573  * Returns: %TRUE on success, %FALSE if there was an error
24574  */
24575
24576
24577 /**
24578  * g_output_stream_write_async:
24579  * @stream: A #GOutputStream.
24580  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24581  * @count: the number of bytes to write
24582  * @io_priority: the io priority of the request.
24583  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24584  * @callback: (scope async): callback to call when the request is satisfied
24585  * @user_data: (closure): the data to pass to callback function
24586  *
24587  * Request an asynchronous write of @count bytes from @buffer into
24588  * the stream. When the operation is finished @callback will be called.
24589  * You can then call g_output_stream_write_finish() to get the result of the
24590  * operation.
24591  *
24592  * During an async request no other sync and async calls are allowed,
24593  * and will result in %G_IO_ERROR_PENDING errors.
24594  *
24595  * A value of @count larger than %G_MAXSSIZE will cause a
24596  * %G_IO_ERROR_INVALID_ARGUMENT error.
24597  *
24598  * On success, the number of bytes written will be passed to the
24599  * @callback. It is not an error if this is not the same as the
24600  * requested size, as it can happen e.g. on a partial I/O error,
24601  * but generally we try to write as many bytes as requested.
24602  *
24603  * You are guaranteed that this method will never fail with
24604  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24605  * method will just wait until this changes.
24606  *
24607  * Any outstanding I/O request with higher priority (lower numerical
24608  * value) will be executed before an outstanding request with lower
24609  * priority. Default priority is %G_PRIORITY_DEFAULT.
24610  *
24611  * The asyncronous methods have a default fallback that uses threads
24612  * to implement asynchronicity, so they are optional for inheriting
24613  * classes. However, if you override one you must override all.
24614  *
24615  * For the synchronous, blocking version of this function, see
24616  * g_output_stream_write().
24617  */
24618
24619
24620 /**
24621  * g_output_stream_write_bytes:
24622  * @stream: a #GOutputStream.
24623  * @bytes: the #GBytes to write
24624  * @cancellable: (allow-none): optional cancellable object
24625  * @error: location to store the error occurring, or %NULL to ignore
24626  *
24627  * Tries to write the data from @bytes into the stream. Will block
24628  * during the operation.
24629  *
24630  * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24631  * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24632  *
24633  * On success, the number of bytes written to the stream is returned.
24634  * It is not an error if this is not the same as the requested size, as it
24635  * can happen e.g. on a partial I/O error, or if there is not enough
24636  * storage in the stream. All writes block until at least one byte
24637  * is written or an error occurs; 0 is never returned (unless
24638  * the size of @bytes is 0).
24639  *
24640  * If @cancellable is not %NULL, then the operation can be cancelled by
24641  * triggering the cancellable object from another thread. If the operation
24642  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24643  * operation was partially finished when the operation was cancelled the
24644  * partial result will be returned, without an error.
24645  *
24646  * On error -1 is returned and @error is set accordingly.
24647  *
24648  * Returns: Number of bytes written, or -1 on error
24649  */
24650
24651
24652 /**
24653  * g_output_stream_write_bytes_async:
24654  * @stream: A #GOutputStream.
24655  * @bytes: The bytes to write
24656  * @io_priority: the io priority of the request.
24657  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24658  * @callback: (scope async): callback to call when the request is satisfied
24659  * @user_data: (closure): the data to pass to callback function
24660  *
24661  * Request an asynchronous write of the data in @bytes to the stream.
24662  * When the operation is finished @callback will be called. You can
24663  * then call g_output_stream_write_bytes_finish() to get the result of
24664  * the operation.
24665  *
24666  * During an async request no other sync and async calls are allowed,
24667  * and will result in %G_IO_ERROR_PENDING errors.
24668  *
24669  * A #GBytes larger than %G_MAXSSIZE will cause a
24670  * %G_IO_ERROR_INVALID_ARGUMENT error.
24671  *
24672  * On success, the number of bytes written will be passed to the
24673  * @callback. It is not an error if this is not the same as the
24674  * requested size, as it can happen e.g. on a partial I/O error,
24675  * but generally we try to write as many bytes as requested.
24676  *
24677  * You are guaranteed that this method will never fail with
24678  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24679  * method will just wait until this changes.
24680  *
24681  * Any outstanding I/O request with higher priority (lower numerical
24682  * value) will be executed before an outstanding request with lower
24683  * priority. Default priority is %G_PRIORITY_DEFAULT.
24684  *
24685  * For the synchronous, blocking version of this function, see
24686  * g_output_stream_write_bytes().
24687  */
24688
24689
24690 /**
24691  * g_output_stream_write_bytes_finish:
24692  * @stream: a #GOutputStream.
24693  * @result: a #GAsyncResult.
24694  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24695  *
24696  * Finishes a stream write-from-#GBytes operation.
24697  *
24698  * Returns: a #gssize containing the number of bytes written to the stream.
24699  */
24700
24701
24702 /**
24703  * g_output_stream_write_finish:
24704  * @stream: a #GOutputStream.
24705  * @result: a #GAsyncResult.
24706  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24707  *
24708  * Finishes a stream write operation.
24709  *
24710  * Returns: a #gssize containing the number of bytes written to the stream.
24711  */
24712
24713
24714 /**
24715  * g_permission_acquire:
24716  * @permission: a #GPermission instance
24717  * @cancellable: (allow-none): a #GCancellable, or %NULL
24718  * @error: a pointer to a %NULL #GError, or %NULL
24719  *
24720  * Attempts to acquire the permission represented by @permission.
24721  *
24722  * The precise method by which this happens depends on the permission
24723  * and the underlying authentication mechanism.  A simple example is
24724  * that a dialog may appear asking the user to enter their password.
24725  *
24726  * You should check with g_permission_get_can_acquire() before calling
24727  * this function.
24728  *
24729  * If the permission is acquired then %TRUE is returned.  Otherwise,
24730  * %FALSE is returned and @error is set appropriately.
24731  *
24732  * This call is blocking, likely for a very long time (in the case that
24733  * user interaction is required).  See g_permission_acquire_async() for
24734  * the non-blocking version.
24735  *
24736  * Returns: %TRUE if the permission was successfully acquired
24737  * Since: 2.26
24738  */
24739
24740
24741 /**
24742  * g_permission_acquire_async:
24743  * @permission: a #GPermission instance
24744  * @cancellable: (allow-none): a #GCancellable, or %NULL
24745  * @callback: the #GAsyncReadyCallback to call when done
24746  * @user_data: the user data to pass to @callback
24747  *
24748  * Attempts to acquire the permission represented by @permission.
24749  *
24750  * This is the first half of the asynchronous version of
24751  * g_permission_acquire().
24752  *
24753  * Since: 2.26
24754  */
24755
24756
24757 /**
24758  * g_permission_acquire_finish:
24759  * @permission: a #GPermission instance
24760  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24761  * @error: a pointer to a %NULL #GError, or %NULL
24762  *
24763  * Collects the result of attempting to acquire the permission
24764  * represented by @permission.
24765  *
24766  * This is the second half of the asynchronous version of
24767  * g_permission_acquire().
24768  *
24769  * Returns: %TRUE if the permission was successfully acquired
24770  * Since: 2.26
24771  */
24772
24773
24774 /**
24775  * g_permission_get_allowed:
24776  * @permission: a #GPermission instance
24777  *
24778  * Gets the value of the 'allowed' property.  This property is %TRUE if
24779  * the caller currently has permission to perform the action that
24780  * @permission represents the permission to perform.
24781  *
24782  * Returns: the value of the 'allowed' property
24783  * Since: 2.26
24784  */
24785
24786
24787 /**
24788  * g_permission_get_can_acquire:
24789  * @permission: a #GPermission instance
24790  *
24791  * Gets the value of the 'can-acquire' property.  This property is %TRUE
24792  * if it is generally possible to acquire the permission by calling
24793  * g_permission_acquire().
24794  *
24795  * Returns: the value of the 'can-acquire' property
24796  * Since: 2.26
24797  */
24798
24799
24800 /**
24801  * g_permission_get_can_release:
24802  * @permission: a #GPermission instance
24803  *
24804  * Gets the value of the 'can-release' property.  This property is %TRUE
24805  * if it is generally possible to release the permission by calling
24806  * g_permission_release().
24807  *
24808  * Returns: the value of the 'can-release' property
24809  * Since: 2.26
24810  */
24811
24812
24813 /**
24814  * g_permission_impl_update:
24815  * @permission: a #GPermission instance
24816  * @allowed: the new value for the 'allowed' property
24817  * @can_acquire: the new value for the 'can-acquire' property
24818  * @can_release: the new value for the 'can-release' property
24819  *
24820  * This function is called by the #GPermission implementation to update
24821  * the properties of the permission.  You should never call this
24822  * function except from a #GPermission implementation.
24823  *
24824  * GObject notify signals are generated, as appropriate.
24825  *
24826  * Since: 2.26
24827  */
24828
24829
24830 /**
24831  * g_permission_release:
24832  * @permission: a #GPermission instance
24833  * @cancellable: (allow-none): a #GCancellable, or %NULL
24834  * @error: a pointer to a %NULL #GError, or %NULL
24835  *
24836  * Attempts to release the permission represented by @permission.
24837  *
24838  * The precise method by which this happens depends on the permission
24839  * and the underlying authentication mechanism.  In most cases the
24840  * permission will be dropped immediately without further action.
24841  *
24842  * You should check with g_permission_get_can_release() before calling
24843  * this function.
24844  *
24845  * If the permission is released then %TRUE is returned.  Otherwise,
24846  * %FALSE is returned and @error is set appropriately.
24847  *
24848  * This call is blocking, likely for a very long time (in the case that
24849  * user interaction is required).  See g_permission_release_async() for
24850  * the non-blocking version.
24851  *
24852  * Returns: %TRUE if the permission was successfully released
24853  * Since: 2.26
24854  */
24855
24856
24857 /**
24858  * g_permission_release_async:
24859  * @permission: a #GPermission instance
24860  * @cancellable: (allow-none): a #GCancellable, or %NULL
24861  * @callback: the #GAsyncReadyCallback to call when done
24862  * @user_data: the user data to pass to @callback
24863  *
24864  * Attempts to release the permission represented by @permission.
24865  *
24866  * This is the first half of the asynchronous version of
24867  * g_permission_release().
24868  *
24869  * Since: 2.26
24870  */
24871
24872
24873 /**
24874  * g_permission_release_finish:
24875  * @permission: a #GPermission instance
24876  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24877  * @error: a pointer to a %NULL #GError, or %NULL
24878  *
24879  * Collects the result of attempting to release the permission
24880  * represented by @permission.
24881  *
24882  * This is the second half of the asynchronous version of
24883  * g_permission_release().
24884  *
24885  * Returns: %TRUE if the permission was successfully released
24886  * Since: 2.26
24887  */
24888
24889
24890 /**
24891  * g_poll_file_monitor_new:
24892  * @file: a #GFile.
24893  *
24894  * Polls @file for changes.
24895  *
24896  * Returns: a new #GFileMonitor for the given #GFile.
24897  */
24898
24899
24900 /**
24901  * g_pollable_input_stream_can_poll:
24902  * @stream: a #GPollableInputStream.
24903  *
24904  * Checks if @stream is actually pollable. Some classes may implement
24905  * #GPollableInputStream but have only certain instances of that class
24906  * be pollable. If this method returns %FALSE, then the behavior of
24907  * other #GPollableInputStream methods is undefined.
24908  *
24909  * For any given stream, the value returned by this method is constant;
24910  * a stream cannot switch from pollable to non-pollable or vice versa.
24911  *
24912  * Returns: %TRUE if @stream is pollable, %FALSE if not.
24913  * Since: 2.28
24914  */
24915
24916
24917 /**
24918  * g_pollable_input_stream_create_source:
24919  * @stream: a #GPollableInputStream.
24920  * @cancellable: (allow-none): a #GCancellable, or %NULL
24921  *
24922  * Creates a #GSource that triggers when @stream can be read, or
24923  * @cancellable is triggered or an error occurs. The callback on the
24924  * source is of the #GPollableSourceFunc type.
24925  *
24926  * As with g_pollable_input_stream_is_readable(), it is possible that
24927  * the stream may not actually be readable even after the source
24928  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24929  * rather than g_input_stream_read() from the callback.
24930  *
24931  * Returns: (transfer full): a new #GSource
24932  * Since: 2.28
24933  */
24934
24935
24936 /**
24937  * g_pollable_input_stream_is_readable:
24938  * @stream: a #GPollableInputStream.
24939  *
24940  * Checks if @stream can be read.
24941  *
24942  * Note that some stream types may not be able to implement this 100%
24943  * reliably, and it is possible that a call to g_input_stream_read()
24944  * after this returns %TRUE would still block. To guarantee
24945  * non-blocking behavior, you should always use
24946  * g_pollable_input_stream_read_nonblocking(), which will return a
24947  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24948  *
24949  * 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.
24950  * Since: 2.28
24951  */
24952
24953
24954 /**
24955  * g_pollable_input_stream_read_nonblocking:
24956  * @stream: a #GPollableInputStream
24957  * @buffer: a buffer to read data into (which should be at least @count bytes long).
24958  * @count: the number of bytes you want to read
24959  * @cancellable: (allow-none): a #GCancellable, or %NULL
24960  * @error: #GError for error reporting, or %NULL to ignore.
24961  *
24962  * Attempts to read up to @count bytes from @stream into @buffer, as
24963  * with g_input_stream_read(). If @stream is not currently readable,
24964  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24965  * use g_pollable_input_stream_create_source() to create a #GSource
24966  * that will be triggered when @stream is readable.
24967  *
24968  * Note that since this method never blocks, you cannot actually
24969  * use @cancellable to cancel it. However, it will return an error
24970  * if @cancellable has already been cancelled when you call, which
24971  * may happen if you call this method after a source triggers due
24972  * to having been cancelled.
24973  *
24974  * Virtual: read_nonblocking
24975  * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24976  */
24977
24978
24979 /**
24980  * g_pollable_output_stream_can_poll:
24981  * @stream: a #GPollableOutputStream.
24982  *
24983  * Checks if @stream is actually pollable. Some classes may implement
24984  * #GPollableOutputStream but have only certain instances of that
24985  * class be pollable. If this method returns %FALSE, then the behavior
24986  * of other #GPollableOutputStream methods is undefined.
24987  *
24988  * For any given stream, the value returned by this method is constant;
24989  * a stream cannot switch from pollable to non-pollable or vice versa.
24990  *
24991  * Returns: %TRUE if @stream is pollable, %FALSE if not.
24992  * Since: 2.28
24993  */
24994
24995
24996 /**
24997  * g_pollable_output_stream_create_source:
24998  * @stream: a #GPollableOutputStream.
24999  * @cancellable: (allow-none): a #GCancellable, or %NULL
25000  *
25001  * Creates a #GSource that triggers when @stream can be written, or
25002  * @cancellable is triggered or an error occurs. The callback on the
25003  * source is of the #GPollableSourceFunc type.
25004  *
25005  * As with g_pollable_output_stream_is_writable(), it is possible that
25006  * the stream may not actually be writable even after the source
25007  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25008  * rather than g_output_stream_write() from the callback.
25009  *
25010  * Returns: (transfer full): a new #GSource
25011  * Since: 2.28
25012  */
25013
25014
25015 /**
25016  * g_pollable_output_stream_is_writable:
25017  * @stream: a #GPollableOutputStream.
25018  *
25019  * Checks if @stream can be written.
25020  *
25021  * Note that some stream types may not be able to implement this 100%
25022  * reliably, and it is possible that a call to g_output_stream_write()
25023  * after this returns %TRUE would still block. To guarantee
25024  * non-blocking behavior, you should always use
25025  * g_pollable_output_stream_write_nonblocking(), which will return a
25026  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25027  *
25028  * 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.
25029  * Since: 2.28
25030  */
25031
25032
25033 /**
25034  * g_pollable_output_stream_write_nonblocking:
25035  * @stream: a #GPollableOutputStream
25036  * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25037  * @count: the number of bytes you want to write
25038  * @cancellable: (allow-none): a #GCancellable, or %NULL
25039  * @error: #GError for error reporting, or %NULL to ignore.
25040  *
25041  * Attempts to write up to @count bytes from @buffer to @stream, as
25042  * with g_output_stream_write(). If @stream is not currently writable,
25043  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25044  * use g_pollable_output_stream_create_source() to create a #GSource
25045  * that will be triggered when @stream is writable.
25046  *
25047  * Note that since this method never blocks, you cannot actually
25048  * use @cancellable to cancel it. However, it will return an error
25049  * if @cancellable has already been cancelled when you call, which
25050  * may happen if you call this method after a source triggers due
25051  * to having been cancelled.
25052  *
25053  * Virtual: write_nonblocking
25054  * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25055  */
25056
25057
25058 /**
25059  * g_pollable_source_new:
25060  * @pollable_stream: the stream associated with the new source
25061  *
25062  * Utility method for #GPollableInputStream and #GPollableOutputStream
25063  * implementations. Creates a new #GSource that expects a callback of
25064  * type #GPollableSourceFunc. The new source does not actually do
25065  * anything on its own; use g_source_add_child_source() to add other
25066  * sources to it to cause it to trigger.
25067  *
25068  * Returns: (transfer full): the new #GSource.
25069  * Since: 2.28
25070  */
25071
25072
25073 /**
25074  * g_pollable_source_new_full:
25075  * @pollable_stream: (type GObject): the stream associated with the new source
25076  * @child_source: (allow-none): optional child source to attach
25077  * @cancellable: (allow-none): optional #GCancellable to attach
25078  *
25079  * Utility method for #GPollableInputStream and #GPollableOutputStream
25080  * implementations. Creates a new #GSource, as with
25081  * g_pollable_source_new(), but also attaching @child_source (with a
25082  * dummy callback), and @cancellable, if they are non-%NULL.
25083  *
25084  * Returns: (transfer full): the new #GSource.
25085  * Since: 2.34
25086  */
25087
25088
25089 /**
25090  * g_pollable_stream_read:
25091  * @stream: a #GInputStream
25092  * @buffer: a buffer to read data into
25093  * @count: the number of bytes to read
25094  * @blocking: whether to do blocking I/O
25095  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25096  * @error: location to store the error occurring, or %NULL to ignore
25097  *
25098  * Tries to read from @stream, as with g_input_stream_read() (if
25099  * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25100  * (if @blocking is %FALSE). This can be used to more easily share
25101  * code between blocking and non-blocking implementations of a method.
25102  *
25103  * If @blocking is %FALSE, then @stream must be a
25104  * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25105  * returns %TRUE, or else the behavior is undefined. If @blocking is
25106  * %TRUE, then @stream does not need to be a #GPollableInputStream.
25107  *
25108  * Returns: the number of bytes read, or -1 on error.
25109  * Since: 2.34
25110  */
25111
25112
25113 /**
25114  * g_pollable_stream_write:
25115  * @stream: a #GOutputStream.
25116  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25117  * @count: the number of bytes to write
25118  * @blocking: whether to do blocking I/O
25119  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25120  * @error: location to store the error occurring, or %NULL to ignore
25121  *
25122  * Tries to write to @stream, as with g_output_stream_write() (if
25123  * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25124  * (if @blocking is %FALSE). This can be used to more easily share
25125  * code between blocking and non-blocking implementations of a method.
25126  *
25127  * If @blocking is %FALSE, then @stream must be a
25128  * #GPollableOutputStream for which
25129  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25130  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25131  * need to be a #GPollableOutputStream.
25132  *
25133  * Returns: the number of bytes written, or -1 on error.
25134  * Since: 2.34
25135  */
25136
25137
25138 /**
25139  * g_pollable_stream_write_all:
25140  * @stream: a #GOutputStream.
25141  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25142  * @count: the number of bytes to write
25143  * @blocking: whether to do blocking I/O
25144  * @bytes_written: (out): location to store the number of bytes that was written to the stream
25145  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25146  * @error: location to store the error occurring, or %NULL to ignore
25147  *
25148  * Tries to write @count bytes to @stream, as with
25149  * g_output_stream_write_all(), but using g_pollable_stream_write()
25150  * rather than g_output_stream_write().
25151  *
25152  * On a successful write of @count bytes, %TRUE is returned, and
25153  * @bytes_written is set to @count.
25154  *
25155  * If there is an error during the operation (including
25156  * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25157  * returned and @error is set to indicate the error status,
25158  * @bytes_written is updated to contain the number of bytes written
25159  * into the stream before the error occurred.
25160  *
25161  * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25162  * @stream must be a #GPollableOutputStream for which
25163  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25164  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25165  * need to be a #GPollableOutputStream.
25166  *
25167  * Returns: %TRUE on success, %FALSE if there was an error
25168  * Since: 2.34
25169  */
25170
25171
25172 /**
25173  * g_proxy_address_get_destination_hostname:
25174  * @proxy: a #GProxyAddress
25175  *
25176  * Gets @proxy's destination hostname; that is, the name of the host
25177  * that will be connected to via the proxy, not the name of the proxy
25178  * itself.
25179  *
25180  * Returns: the @proxy's destination hostname
25181  * Since: 2.26
25182  */
25183
25184
25185 /**
25186  * g_proxy_address_get_destination_port:
25187  * @proxy: a #GProxyAddress
25188  *
25189  * Gets @proxy's destination port; that is, the port on the
25190  * destination host that will be connected to via the proxy, not the
25191  * port number of the proxy itself.
25192  *
25193  * Returns: the @proxy's destination port
25194  * Since: 2.26
25195  */
25196
25197
25198 /**
25199  * g_proxy_address_get_destination_protocol:
25200  * @proxy: a #GProxyAddress
25201  *
25202  * Gets the protocol that is being spoken to the destination
25203  * server; eg, "http" or "ftp".
25204  *
25205  * Returns: the @proxy's destination protocol
25206  * Since: 2.34
25207  */
25208
25209
25210 /**
25211  * g_proxy_address_get_password:
25212  * @proxy: a #GProxyAddress
25213  *
25214  * Gets @proxy's password.
25215  *
25216  * Returns: the @proxy's password
25217  * Since: 2.26
25218  */
25219
25220
25221 /**
25222  * g_proxy_address_get_protocol:
25223  * @proxy: a #GProxyAddress
25224  *
25225  * Gets @proxy's protocol. eg, "socks" or "http"
25226  *
25227  * Returns: the @proxy's protocol
25228  * Since: 2.26
25229  */
25230
25231
25232 /**
25233  * g_proxy_address_get_uri:
25234  * @proxy: a #GProxyAddress
25235  *
25236  * Gets the proxy URI that @proxy was constructed from.
25237  *
25238  * Returns: the @proxy's URI, or %NULL if unknown
25239  * Since: 2.34
25240  */
25241
25242
25243 /**
25244  * g_proxy_address_get_username:
25245  * @proxy: a #GProxyAddress
25246  *
25247  * Gets @proxy's username.
25248  *
25249  * Returns: the @proxy's username
25250  * Since: 2.26
25251  */
25252
25253
25254 /**
25255  * g_proxy_address_new:
25256  * @inetaddr: The proxy server #GInetAddress.
25257  * @port: The proxy server port.
25258  * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25259  * @dest_hostname: The destination hostname the proxy should tunnel to.
25260  * @dest_port: The destination port to tunnel to.
25261  * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25262  * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25263  *
25264  * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25265  * tunnel through @dest_hostname and @dest_port.
25266  *
25267  * (Note that this method doesn't set the #GProxyAddress:uri or
25268  * #GProxyAddress:destination-protocol fields; use g_object_new()
25269  * directly if you want to set those.)
25270  *
25271  * Returns: a new #GProxyAddress
25272  * Since: 2.26
25273  */
25274
25275
25276 /**
25277  * g_proxy_connect:
25278  * @proxy: a #GProxy
25279  * @connection: a #GIOStream
25280  * @proxy_address: a #GProxyAddress
25281  * @cancellable: (allow-none): a #GCancellable
25282  * @error: return #GError
25283  *
25284  * Given @connection to communicate with a proxy (eg, a
25285  * #GSocketConnection that is connected to the proxy server), this
25286  * does the necessary handshake to connect to @proxy_address, and if
25287  * required, wraps the #GIOStream to handle proxy payload.
25288  *
25289  * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25290  * Since: 2.26
25291  */
25292
25293
25294 /**
25295  * g_proxy_connect_async:
25296  * @proxy: a #GProxy
25297  * @connection: a #GIOStream
25298  * @proxy_address: a #GProxyAddress
25299  * @cancellable: (allow-none): a #GCancellable
25300  * @callback: (scope async): a #GAsyncReadyCallback
25301  * @user_data: (closure): callback data
25302  *
25303  * Asynchronous version of g_proxy_connect().
25304  *
25305  * Since: 2.26
25306  */
25307
25308
25309 /**
25310  * g_proxy_connect_finish:
25311  * @proxy: a #GProxy
25312  * @result: a #GAsyncResult
25313  * @error: return #GError
25314  *
25315  * See g_proxy_connect().
25316  *
25317  * Returns: (transfer full): a #GIOStream.
25318  * Since: 2.26
25319  */
25320
25321
25322 /**
25323  * g_proxy_get_default_for_protocol:
25324  * @protocol: the proxy protocol name (e.g. http, socks, etc)
25325  *
25326  * Lookup "gio-proxy" extension point for a proxy implementation that supports
25327  * specified protocol.
25328  *
25329  * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25330  * Since: 2.26
25331  */
25332
25333
25334 /**
25335  * g_proxy_resolver_get_default:
25336  *
25337  * Gets the default #GProxyResolver for the system.
25338  *
25339  * Returns: (transfer none): the default #GProxyResolver.
25340  * Since: 2.26
25341  */
25342
25343
25344 /**
25345  * g_proxy_resolver_is_supported:
25346  * @resolver: a #GProxyResolver
25347  *
25348  * Checks if @resolver can be used on this system. (This is used
25349  * internally; g_proxy_resolver_get_default() will only return a proxy
25350  * resolver that returns %TRUE for this method.)
25351  *
25352  * Returns: %TRUE if @resolver is supported.
25353  * Since: 2.26
25354  */
25355
25356
25357 /**
25358  * g_proxy_resolver_lookup:
25359  * @resolver: a #GProxyResolver
25360  * @uri: a URI representing the destination to connect to
25361  * @cancellable: (allow-none): a #GCancellable, or %NULL
25362  * @error: return location for a #GError, or %NULL
25363  *
25364  * Looks into the system proxy configuration to determine what proxy,
25365  * if any, to use to connect to @uri. The returned proxy URIs are of the
25366  * form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
25367  * or <literal>direct://</literal>, where &lt;protocol&gt; could be
25368  * http, rtsp, socks or other proxying protocol.
25369  *
25370  * If you don't know what network protocol is being used on the
25371  * socket, you should use <literal>none</literal> as the URI protocol.
25372  * In this case, the resolver might still return a generic proxy type
25373  * (such as SOCKS), but would not return protocol-specific proxy types
25374  * (such as http).
25375  *
25376  * <literal>direct://</literal> is used when no proxy is needed.
25377  * Direct connection should not be attempted unless it is part of the
25378  * returned array of proxies.
25379  *
25380  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25381  * Since: 2.26
25382  */
25383
25384
25385 /**
25386  * g_proxy_resolver_lookup_async:
25387  * @resolver: a #GProxyResolver
25388  * @uri: a URI representing the destination to connect to
25389  * @cancellable: (allow-none): a #GCancellable, or %NULL
25390  * @callback: (scope async): callback to call after resolution completes
25391  * @user_data: (closure): data for @callback
25392  *
25393  * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25394  * details.
25395  *
25396  * Since: 2.26
25397  */
25398
25399
25400 /**
25401  * g_proxy_resolver_lookup_finish:
25402  * @resolver: a #GProxyResolver
25403  * @result: the result passed to your #GAsyncReadyCallback
25404  * @error: return location for a #GError, or %NULL
25405  *
25406  * Call this function to obtain the array of proxy URIs when
25407  * g_proxy_resolver_lookup_async() is complete. See
25408  * g_proxy_resolver_lookup() for more details.
25409  *
25410  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25411  * Since: 2.26
25412  */
25413
25414
25415 /**
25416  * g_proxy_supports_hostname:
25417  * @proxy: a #GProxy
25418  *
25419  * Some proxy protocols expect to be passed a hostname, which they
25420  * will resolve to an IP address themselves. Others, like SOCKS4, do
25421  * not allow this. This function will return %FALSE if @proxy is
25422  * implementing such a protocol. When %FALSE is returned, the caller
25423  * should resolve the destination hostname first, and then pass a
25424  * #GProxyAddress containing the stringified IP address to
25425  * g_proxy_connect() or g_proxy_connect_async().
25426  *
25427  * Returns: %TRUE if hostname resolution is supported.
25428  * Since: 2.26
25429  */
25430
25431
25432 /**
25433  * g_remote_action_group_activate_action_full:
25434  * @remote: a #GDBusActionGroup
25435  * @action_name: the name of the action to activate
25436  * @parameter: (allow-none): the optional parameter to the activation
25437  * @platform_data: the platform data to send
25438  *
25439  * Activates the remote action.
25440  *
25441  * This is the same as g_action_group_activate_action() except that it
25442  * allows for provision of "platform data" to be sent along with the
25443  * activation request.  This typically contains details such as the user
25444  * interaction timestamp or startup notification information.
25445  *
25446  * @platform_data must be non-%NULL and must have the type
25447  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25448  *
25449  * Since: 2.32
25450  */
25451
25452
25453 /**
25454  * g_remote_action_group_change_action_state_full:
25455  * @remote: a #GRemoteActionGroup
25456  * @action_name: the name of the action to change the state of
25457  * @value: the new requested value for the state
25458  * @platform_data: the platform data to send
25459  *
25460  * Changes the state of a remote action.
25461  *
25462  * This is the same as g_action_group_change_action_state() except that
25463  * it allows for provision of "platform data" to be sent along with the
25464  * state change request.  This typically contains details such as the
25465  * user interaction timestamp or startup notification information.
25466  *
25467  * @platform_data must be non-%NULL and must have the type
25468  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25469  *
25470  * Since: 2.32
25471  */
25472
25473
25474 /**
25475  * g_resolver_error_quark:
25476  *
25477  * Gets the #GResolver Error Quark.
25478  *
25479  * Returns: a #GQuark.
25480  * Since: 2.22
25481  */
25482
25483
25484 /**
25485  * g_resolver_free_addresses: (skip)
25486  * @addresses: a #GList of #GInetAddress
25487  *
25488  * Frees @addresses (which should be the return value from
25489  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25490  * (This is a convenience method; you can also simply free the results
25491  * by hand.)
25492  *
25493  * Since: 2.22
25494  */
25495
25496
25497 /**
25498  * g_resolver_free_targets: (skip)
25499  * @targets: a #GList of #GSrvTarget
25500  *
25501  * Frees @targets (which should be the return value from
25502  * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25503  * (This is a convenience method; you can also simply free the
25504  * results by hand.)
25505  *
25506  * Since: 2.22
25507  */
25508
25509
25510 /**
25511  * g_resolver_get_default:
25512  *
25513  * Gets the default #GResolver. You should unref it when you are done
25514  * with it. #GResolver may use its reference count as a hint about how
25515  * many threads it should allocate for concurrent DNS resolutions.
25516  *
25517  * Returns: (transfer full): the default #GResolver.
25518  * Since: 2.22
25519  */
25520
25521
25522 /**
25523  * g_resolver_lookup_by_address:
25524  * @resolver: a #GResolver
25525  * @address: the address to reverse-resolve
25526  * @cancellable: (allow-none): a #GCancellable, or %NULL
25527  * @error: return location for a #GError, or %NULL
25528  *
25529  * Synchronously reverse-resolves @address to determine its
25530  * associated hostname.
25531  *
25532  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25533  * a value from #GResolverError.
25534  *
25535  * If @cancellable is non-%NULL, it can be used to cancel the
25536  * operation, in which case @error (if non-%NULL) will be set to
25537  * %G_IO_ERROR_CANCELLED.
25538  *
25539  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25540  * Since: 2.22
25541  */
25542
25543
25544 /**
25545  * g_resolver_lookup_by_address_async:
25546  * @resolver: a #GResolver
25547  * @address: the address to reverse-resolve
25548  * @cancellable: (allow-none): a #GCancellable, or %NULL
25549  * @callback: (scope async): callback to call after resolution completes
25550  * @user_data: (closure): data for @callback
25551  *
25552  * Begins asynchronously reverse-resolving @address to determine its
25553  * associated hostname, and eventually calls @callback, which must
25554  * call g_resolver_lookup_by_address_finish() to get the final result.
25555  *
25556  * Since: 2.22
25557  */
25558
25559
25560 /**
25561  * g_resolver_lookup_by_address_finish:
25562  * @resolver: a #GResolver
25563  * @result: the result passed to your #GAsyncReadyCallback
25564  * @error: return location for a #GError, or %NULL
25565  *
25566  * Retrieves the result of a previous call to
25567  * g_resolver_lookup_by_address_async().
25568  *
25569  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25570  * a value from #GResolverError. If the operation was cancelled,
25571  * @error will be set to %G_IO_ERROR_CANCELLED.
25572  *
25573  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25574  * Since: 2.22
25575  */
25576
25577
25578 /**
25579  * g_resolver_lookup_by_name:
25580  * @resolver: a #GResolver
25581  * @hostname: the hostname to look up
25582  * @cancellable: (allow-none): a #GCancellable, or %NULL
25583  * @error: return location for a #GError, or %NULL
25584  *
25585  * Synchronously resolves @hostname to determine its associated IP
25586  * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25587  * the textual form of an IP address (in which case this just becomes
25588  * a wrapper around g_inet_address_new_from_string()).
25589  *
25590  * On success, g_resolver_lookup_by_name() will return a #GList of
25591  * #GInetAddress, sorted in order of preference and guaranteed to not
25592  * contain duplicates. That is, if using the result to connect to
25593  * @hostname, you should attempt to connect to the first address
25594  * first, then the second if the first fails, etc. If you are using
25595  * the result to listen on a socket, it is appropriate to add each
25596  * result using e.g. g_socket_listener_add_address().
25597  *
25598  * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25599  * value from #GResolverError.
25600  *
25601  * If @cancellable is non-%NULL, it can be used to cancel the
25602  * operation, in which case @error (if non-%NULL) will be set to
25603  * %G_IO_ERROR_CANCELLED.
25604  *
25605  * If you are planning to connect to a socket on the resolved IP
25606  * address, it may be easier to create a #GNetworkAddress and use its
25607  * #GSocketConnectable interface.
25608  *
25609  * 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.)
25610  * Since: 2.22
25611  */
25612
25613
25614 /**
25615  * g_resolver_lookup_by_name_async:
25616  * @resolver: a #GResolver
25617  * @hostname: the hostname to look up the address of
25618  * @cancellable: (allow-none): a #GCancellable, or %NULL
25619  * @callback: (scope async): callback to call after resolution completes
25620  * @user_data: (closure): data for @callback
25621  *
25622  * Begins asynchronously resolving @hostname to determine its
25623  * associated IP address(es), and eventually calls @callback, which
25624  * must call g_resolver_lookup_by_name_finish() to get the result.
25625  * See g_resolver_lookup_by_name() for more details.
25626  *
25627  * Since: 2.22
25628  */
25629
25630
25631 /**
25632  * g_resolver_lookup_by_name_finish:
25633  * @resolver: a #GResolver
25634  * @result: the result passed to your #GAsyncReadyCallback
25635  * @error: return location for a #GError, or %NULL
25636  *
25637  * Retrieves the result of a call to
25638  * g_resolver_lookup_by_name_async().
25639  *
25640  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25641  * a value from #GResolverError. If the operation was cancelled,
25642  * @error will be set to %G_IO_ERROR_CANCELLED.
25643  *
25644  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25645  * Since: 2.22
25646  */
25647
25648
25649 /**
25650  * g_resolver_lookup_records:
25651  * @resolver: a #GResolver
25652  * @rrname: the DNS name to lookup the record for
25653  * @record_type: the type of DNS record to lookup
25654  * @cancellable: (allow-none): a #GCancellable, or %NULL
25655  * @error: return location for a #GError, or %NULL
25656  *
25657  * Synchronously performs a DNS record lookup for the given @rrname and returns
25658  * a list of records as #GVariant tuples. See #GResolverRecordType for
25659  * information on what the records contain for each @record_type.
25660  *
25661  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25662  * a value from #GResolverError.
25663  *
25664  * If @cancellable is non-%NULL, it can be used to cancel the
25665  * operation, in which case @error (if non-%NULL) will be set to
25666  * %G_IO_ERROR_CANCELLED.
25667  *
25668  * 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.)
25669  * Since: 2.34
25670  */
25671
25672
25673 /**
25674  * g_resolver_lookup_records_async:
25675  * @resolver: a #GResolver
25676  * @rrname: the DNS name to lookup the record for
25677  * @record_type: the type of DNS record to lookup
25678  * @cancellable: (allow-none): a #GCancellable, or %NULL
25679  * @callback: (scope async): callback to call after resolution completes
25680  * @user_data: (closure): data for @callback
25681  *
25682  * Begins asynchronously performing a DNS lookup for the given
25683  * @rrname, and eventually calls @callback, which must call
25684  * g_resolver_lookup_records_finish() to get the final result. See
25685  * g_resolver_lookup_records() for more details.
25686  *
25687  * Since: 2.34
25688  */
25689
25690
25691 /**
25692  * g_resolver_lookup_records_finish:
25693  * @resolver: a #GResolver
25694  * @result: the result passed to your #GAsyncReadyCallback
25695  * @error: return location for a #GError, or %NULL
25696  *
25697  * Retrieves the result of a previous call to
25698  * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25699  * tuples. See #GResolverRecordType for information on what the records contain.
25700  *
25701  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25702  * a value from #GResolverError. If the operation was cancelled,
25703  * @error will be set to %G_IO_ERROR_CANCELLED.
25704  *
25705  * 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.)
25706  * Since: 2.34
25707  */
25708
25709
25710 /**
25711  * g_resolver_lookup_service:
25712  * @resolver: a #GResolver
25713  * @service: the service type to look up (eg, "ldap")
25714  * @protocol: the networking protocol to use for @service (eg, "tcp")
25715  * @domain: the DNS domain to look up the service in
25716  * @cancellable: (allow-none): a #GCancellable, or %NULL
25717  * @error: return location for a #GError, or %NULL
25718  *
25719  * Synchronously performs a DNS SRV lookup for the given @service and
25720  * @protocol in the given @domain and returns an array of #GSrvTarget.
25721  * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25722  * @service and @protocol arguments <emphasis>do not</emphasis>
25723  * include the leading underscore that appears in the actual DNS
25724  * entry.
25725  *
25726  * On success, g_resolver_lookup_service() will return a #GList of
25727  * #GSrvTarget, sorted in order of preference. (That is, you should
25728  * attempt to connect to the first target first, then the second if
25729  * the first fails, etc.)
25730  *
25731  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25732  * a value from #GResolverError.
25733  *
25734  * If @cancellable is non-%NULL, it can be used to cancel the
25735  * operation, in which case @error (if non-%NULL) will be set to
25736  * %G_IO_ERROR_CANCELLED.
25737  *
25738  * If you are planning to connect to the service, it is usually easier
25739  * to create a #GNetworkService and use its #GSocketConnectable
25740  * interface.
25741  *
25742  * 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.)
25743  * Since: 2.22
25744  */
25745
25746
25747 /**
25748  * g_resolver_lookup_service_async:
25749  * @resolver: a #GResolver
25750  * @service: the service type to look up (eg, "ldap")
25751  * @protocol: the networking protocol to use for @service (eg, "tcp")
25752  * @domain: the DNS domain to look up the service in
25753  * @cancellable: (allow-none): a #GCancellable, or %NULL
25754  * @callback: (scope async): callback to call after resolution completes
25755  * @user_data: (closure): data for @callback
25756  *
25757  * Begins asynchronously performing a DNS SRV lookup for the given
25758  * @service and @protocol in the given @domain, and eventually calls
25759  * @callback, which must call g_resolver_lookup_service_finish() to
25760  * get the final result. See g_resolver_lookup_service() for more
25761  * details.
25762  *
25763  * Since: 2.22
25764  */
25765
25766
25767 /**
25768  * g_resolver_lookup_service_finish:
25769  * @resolver: a #GResolver
25770  * @result: the result passed to your #GAsyncReadyCallback
25771  * @error: return location for a #GError, or %NULL
25772  *
25773  * Retrieves the result of a previous call to
25774  * g_resolver_lookup_service_async().
25775  *
25776  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25777  * a value from #GResolverError. If the operation was cancelled,
25778  * @error will be set to %G_IO_ERROR_CANCELLED.
25779  *
25780  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25781  * Since: 2.22
25782  */
25783
25784
25785 /**
25786  * g_resolver_set_default:
25787  * @resolver: the new default #GResolver
25788  *
25789  * Sets @resolver to be the application's default resolver (reffing
25790  * @resolver, and unreffing the previous default resolver, if any).
25791  * Future calls to g_resolver_get_default() will return this resolver.
25792  *
25793  * This can be used if an application wants to perform any sort of DNS
25794  * caching or "pinning"; it can implement its own #GResolver that
25795  * calls the original default resolver for DNS operations, and
25796  * implements its own cache policies on top of that, and then set
25797  * itself as the default resolver for all later code to use.
25798  *
25799  * Since: 2.22
25800  */
25801
25802
25803 /**
25804  * g_resource_enumerate_children:
25805  * @resource: A #GResource
25806  * @path: A pathname inside the resource
25807  * @lookup_flags: A #GResourceLookupFlags
25808  * @error: return location for a #GError, or %NULL
25809  *
25810  * Returns all the names of children at the specified @path in the resource.
25811  * The return result is a %NULL terminated list of strings which should
25812  * be released with g_strfreev().
25813  *
25814  * @lookup_flags controls the behaviour of the lookup.
25815  *
25816  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25817  * Since: 2.32
25818  */
25819
25820
25821 /**
25822  * g_resource_error_quark:
25823  *
25824  * Gets the #GResource Error Quark.
25825  *
25826  * Returns: a #GQuark
25827  * Since: 2.32
25828  */
25829
25830
25831 /**
25832  * g_resource_get_info:
25833  * @resource: A #GResource
25834  * @path: A pathname inside the resource
25835  * @lookup_flags: A #GResourceLookupFlags
25836  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25837  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25838  * @error: return location for a #GError, or %NULL
25839  *
25840  * Looks for a file at the specified @path in the resource and
25841  * if found returns information about it.
25842  *
25843  * @lookup_flags controls the behaviour of the lookup.
25844  *
25845  * Returns: %TRUE if the file was found. %FALSE if there were errors
25846  * Since: 2.32
25847  */
25848
25849
25850 /**
25851  * g_resource_load:
25852  * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25853  * @error: return location for a #GError, or %NULL
25854  *
25855  * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25856  * you to query it for data.
25857  *
25858  * If you want to use this resource in the global resource namespace you need
25859  * to register it with g_resources_register().
25860  *
25861  * Returns: (transfer full): a new #GResource, or %NULL on error
25862  * Since: 2.32
25863  */
25864
25865
25866 /**
25867  * g_resource_lookup_data:
25868  * @resource: A #GResource
25869  * @path: A pathname inside the resource
25870  * @lookup_flags: A #GResourceLookupFlags
25871  * @error: return location for a #GError, or %NULL
25872  *
25873  * Looks for a file at the specified @path in the resource and
25874  * returns a #GBytes that lets you directly access the data in
25875  * memory.
25876  *
25877  * The data is always followed by a zero byte, so you
25878  * can safely use the data as a C string. However, that byte
25879  * is not included in the size of the GBytes.
25880  *
25881  * For uncompressed resource files this is a pointer directly into
25882  * the resource bundle, which is typically in some readonly data section
25883  * in the program binary. For compressed files we allocate memory on
25884  * the heap and automatically uncompress the data.
25885  *
25886  * @lookup_flags controls the behaviour of the lookup.
25887  *
25888  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25889  * Since: 2.32
25890  */
25891
25892
25893 /**
25894  * g_resource_new_from_data:
25895  * @data: A #GBytes
25896  * @error: return location for a #GError, or %NULL
25897  *
25898  * Creates a GResource from a reference to the binary resource bundle.
25899  * This will keep a reference to @data while the resource lives, so
25900  * the data should not be modified or freed.
25901  *
25902  * If you want to use this resource in the global resource namespace you need
25903  * to register it with g_resources_register().
25904  *
25905  * Returns: (transfer full): a new #GResource, or %NULL on error
25906  * Since: 2.32
25907  */
25908
25909
25910 /**
25911  * g_resource_open_stream:
25912  * @resource: A #GResource
25913  * @path: A pathname inside the resource
25914  * @lookup_flags: A #GResourceLookupFlags
25915  * @error: return location for a #GError, or %NULL
25916  *
25917  * Looks for a file at the specified @path in the resource and
25918  * returns a #GInputStream that lets you read the data.
25919  *
25920  * @lookup_flags controls the behaviour of the lookup.
25921  *
25922  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25923  * Since: 2.32
25924  */
25925
25926
25927 /**
25928  * g_resource_ref:
25929  * @resource: A #GResource
25930  *
25931  * Atomically increments the reference count of @array by one. This
25932  * function is MT-safe and may be called from any thread.
25933  *
25934  * Returns: The passed in #GResource
25935  * Since: 2.32
25936  */
25937
25938
25939 /**
25940  * g_resource_unref:
25941  * @resource: A #GResource
25942  *
25943  * Atomically decrements the reference count of @resource by one. If the
25944  * reference count drops to 0, all memory allocated by the array is
25945  * released. This function is MT-safe and may be called from any
25946  * thread.
25947  *
25948  * Since: 2.32
25949  */
25950
25951
25952 /**
25953  * g_resources_enumerate_children:
25954  * @path: A pathname inside the resource
25955  * @lookup_flags: A #GResourceLookupFlags
25956  * @error: return location for a #GError, or %NULL
25957  *
25958  * Returns all the names of children at the specified @path in the set of
25959  * globally registered resources.
25960  * The return result is a %NULL terminated list of strings which should
25961  * be released with g_strfreev().
25962  *
25963  * @lookup_flags controls the behaviour of the lookup.
25964  *
25965  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25966  * Since: 2.32
25967  */
25968
25969
25970 /**
25971  * g_resources_get_info:
25972  * @path: A pathname inside the resource
25973  * @lookup_flags: A #GResourceLookupFlags
25974  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25975  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25976  * @error: return location for a #GError, or %NULL
25977  *
25978  * Looks for a file at the specified @path in the set of
25979  * globally registered resources and if found returns information about it.
25980  *
25981  * @lookup_flags controls the behaviour of the lookup.
25982  *
25983  * Returns: %TRUE if the file was found. %FALSE if there were errors
25984  * Since: 2.32
25985  */
25986
25987
25988 /**
25989  * g_resources_lookup_data:
25990  * @path: A pathname inside the resource
25991  * @lookup_flags: A #GResourceLookupFlags
25992  * @error: return location for a #GError, or %NULL
25993  *
25994  * Looks for a file at the specified @path in the set of
25995  * globally registered resources and returns a #GBytes that
25996  * lets you directly access the data in memory.
25997  *
25998  * The data is always followed by a zero byte, so you
25999  * can safely use the data as a C string. However, that byte
26000  * is not included in the size of the GBytes.
26001  *
26002  * For uncompressed resource files this is a pointer directly into
26003  * the resource bundle, which is typically in some readonly data section
26004  * in the program binary. For compressed files we allocate memory on
26005  * the heap and automatically uncompress the data.
26006  *
26007  * @lookup_flags controls the behaviour of the lookup.
26008  *
26009  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26010  * Since: 2.32
26011  */
26012
26013
26014 /**
26015  * g_resources_open_stream:
26016  * @path: A pathname inside the resource
26017  * @lookup_flags: A #GResourceLookupFlags
26018  * @error: return location for a #GError, or %NULL
26019  *
26020  * Looks for a file at the specified @path in the set of
26021  * globally registered resources and returns a #GInputStream
26022  * that lets you read the data.
26023  *
26024  * @lookup_flags controls the behaviour of the lookup.
26025  *
26026  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26027  * Since: 2.32
26028  */
26029
26030
26031 /**
26032  * g_resources_register:
26033  * @resource: A #GResource
26034  *
26035  * Registers the resource with the process-global set of resources.
26036  * Once a resource is registered the files in it can be accessed
26037  * with the global resource lookup functions like g_resources_lookup_data().
26038  *
26039  * Since: 2.32
26040  */
26041
26042
26043 /**
26044  * g_resources_unregister:
26045  * @resource: A #GResource
26046  *
26047  * Unregisters the resource from the process-global set of resources.
26048  *
26049  * Since: 2.32
26050  */
26051
26052
26053 /**
26054  * g_seekable_can_seek:
26055  * @seekable: a #GSeekable.
26056  *
26057  * Tests if the stream supports the #GSeekableIface.
26058  *
26059  * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26060  */
26061
26062
26063 /**
26064  * g_seekable_can_truncate:
26065  * @seekable: a #GSeekable.
26066  *
26067  * Tests if the stream can be truncated.
26068  *
26069  * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26070  */
26071
26072
26073 /**
26074  * g_seekable_seek:
26075  * @seekable: a #GSeekable.
26076  * @offset: a #goffset.
26077  * @type: a #GSeekType.
26078  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26079  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26080  *
26081  * Seeks in the stream by the given @offset, modified by @type.
26082  *
26083  * If @cancellable is not %NULL, then the operation can be cancelled by
26084  * triggering the cancellable object from another thread. If the operation
26085  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26086  *
26087  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26088  */
26089
26090
26091 /**
26092  * g_seekable_tell:
26093  * @seekable: a #GSeekable.
26094  *
26095  * Tells the current position within the stream.
26096  *
26097  * Returns: the offset from the beginning of the buffer.
26098  */
26099
26100
26101 /**
26102  * g_seekable_truncate:
26103  * @seekable: a #GSeekable.
26104  * @offset: a #goffset.
26105  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26106  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26107  *
26108  * Truncates a stream with a given #offset.
26109  *
26110  * If @cancellable is not %NULL, then the operation can be cancelled by
26111  * triggering the cancellable object from another thread. If the operation
26112  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26113  * operation was partially finished when the operation was cancelled the
26114  * partial result will be returned, without an error.
26115  *
26116  * Virtual: truncate_fn
26117  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26118  */
26119
26120
26121 /**
26122  * g_settings_apply:
26123  * @settings: a #GSettings instance
26124  *
26125  * Applies any changes that have been made to the settings.  This
26126  * function does nothing unless @settings is in 'delay-apply' mode;
26127  * see g_settings_delay().  In the normal case settings are always
26128  * applied immediately.
26129  */
26130
26131
26132 /**
26133  * g_settings_backend_changed:
26134  * @backend: a #GSettingsBackend implementation
26135  * @key: the name of the key
26136  * @origin_tag: the origin tag
26137  *
26138  * Signals that a single key has possibly changed.  Backend
26139  * implementations should call this if a key has possibly changed its
26140  * value.
26141  *
26142  * @key must be a valid key (ie starting with a slash, not containing
26143  * '//', and not ending with a slash).
26144  *
26145  * The implementation must call this function during any call to
26146  * g_settings_backend_write(), before the call returns (except in the
26147  * case that no keys are actually changed and it cares to detect this
26148  * fact).  It may not rely on the existence of a mainloop for
26149  * dispatching the signal later.
26150  *
26151  * The implementation may call this function at any other time it likes
26152  * in response to other events (such as changes occurring outside of the
26153  * program).  These calls may originate from a mainloop or may originate
26154  * in response to any other action (including from calls to
26155  * g_settings_backend_write()).
26156  *
26157  * In the case that this call is in response to a call to
26158  * g_settings_backend_write() then @origin_tag must be set to the same
26159  * value that was passed to that call.
26160  *
26161  * Since: 2.26
26162  */
26163
26164
26165 /**
26166  * g_settings_backend_changed_tree:
26167  * @backend: a #GSettingsBackend implementation
26168  * @tree: a #GTree containing the changes
26169  * @origin_tag: the origin tag
26170  *
26171  * This call is a convenience wrapper.  It gets the list of changes from
26172  * @tree, computes the longest common prefix and calls
26173  * g_settings_backend_changed().
26174  *
26175  * Since: 2.26
26176  */
26177
26178
26179 /**
26180  * g_settings_backend_flatten_tree:
26181  * @tree: a #GTree containing the changes
26182  * @path: (out): the location to save the path
26183  * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26184  * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26185  *
26186  * Calculate the longest common prefix of all keys in a tree and write
26187  * out an array of the key names relative to that prefix and,
26188  * optionally, the value to store at each of those keys.
26189  *
26190  * You must free the value returned in @path, @keys and @values using
26191  * g_free().  You should not attempt to free or unref the contents of
26192  * @keys or @values.
26193  *
26194  * Since: 2.26
26195  */
26196
26197
26198 /**
26199  * g_settings_backend_get_default:
26200  *
26201  * Returns the default #GSettingsBackend. It is possible to override
26202  * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26203  * environment variable to the name of a settings backend.
26204  *
26205  * The user gets a reference to the backend.
26206  *
26207  * Returns: (transfer full): the default #GSettingsBackend
26208  * Since: 2.28
26209  */
26210
26211
26212 /**
26213  * g_settings_backend_keys_changed:
26214  * @backend: a #GSettingsBackend implementation
26215  * @path: the path containing the changes
26216  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26217  * @origin_tag: the origin tag
26218  *
26219  * Signals that a list of keys have possibly changed.  Backend
26220  * implementations should call this if keys have possibly changed their
26221  * values.
26222  *
26223  * @path must be a valid path (ie starting and ending with a slash and
26224  * not containing '//').  Each string in @items must form a valid key
26225  * name when @path is prefixed to it (ie: each item must not start or
26226  * end with '/' and must not contain '//').
26227  *
26228  * The meaning of this signal is that any of the key names resulting
26229  * from the contatenation of @path with each item in @items may have
26230  * changed.
26231  *
26232  * The same rules for when notifications must occur apply as per
26233  * g_settings_backend_changed().  These two calls can be used
26234  * interchangeably if exactly one item has changed (although in that
26235  * case g_settings_backend_changed() is definitely preferred).
26236  *
26237  * For efficiency reasons, the implementation should strive for @path to
26238  * be as long as possible (ie: the longest common prefix of all of the
26239  * keys that were changed) but this is not strictly required.
26240  *
26241  * Since: 2.26
26242  */
26243
26244
26245 /**
26246  * g_settings_backend_path_changed:
26247  * @backend: a #GSettingsBackend implementation
26248  * @path: the path containing the changes
26249  * @origin_tag: the origin tag
26250  *
26251  * Signals that all keys below a given path may have possibly changed.
26252  * Backend implementations should call this if an entire path of keys
26253  * have possibly changed their values.
26254  *
26255  * @path must be a valid path (ie starting and ending with a slash and
26256  * not containing '//').
26257  *
26258  * The meaning of this signal is that any of the key which has a name
26259  * starting with @path may have changed.
26260  *
26261  * The same rules for when notifications must occur apply as per
26262  * g_settings_backend_changed().  This call might be an appropriate
26263  * reasponse to a 'reset' call but implementations are also free to
26264  * explicitly list the keys that were affected by that call if they can
26265  * easily do so.
26266  *
26267  * For efficiency reasons, the implementation should strive for @path to
26268  * be as long as possible (ie: the longest common prefix of all of the
26269  * keys that were changed) but this is not strictly required.  As an
26270  * example, if this function is called with the path of "/" then every
26271  * single key in the application will be notified of a possible change.
26272  *
26273  * Since: 2.26
26274  */
26275
26276
26277 /**
26278  * g_settings_backend_path_writable_changed:
26279  * @backend: a #GSettingsBackend implementation
26280  * @path: the name of the path
26281  *
26282  * Signals that the writability of all keys below a given path may have
26283  * changed.
26284  *
26285  * Since GSettings performs no locking operations for itself, this call
26286  * will always be made in response to external events.
26287  *
26288  * Since: 2.26
26289  */
26290
26291
26292 /**
26293  * g_settings_backend_writable_changed:
26294  * @backend: a #GSettingsBackend implementation
26295  * @key: the name of the key
26296  *
26297  * Signals that the writability of a single key has possibly changed.
26298  *
26299  * Since GSettings performs no locking operations for itself, this call
26300  * will always be made in response to external events.
26301  *
26302  * Since: 2.26
26303  */
26304
26305
26306 /**
26307  * g_settings_bind:
26308  * @settings: a #GSettings object
26309  * @key: the key to bind
26310  * @object: (type GObject.Object): a #GObject
26311  * @property: the name of the property to bind
26312  * @flags: flags for the binding
26313  *
26314  * Create a binding between the @key in the @settings object
26315  * and the property @property of @object.
26316  *
26317  * The binding uses the default GIO mapping functions to map
26318  * between the settings and property values. These functions
26319  * handle booleans, numeric types and string types in a
26320  * straightforward way. Use g_settings_bind_with_mapping() if
26321  * you need a custom mapping, or map between types that are not
26322  * supported by the default mapping functions.
26323  *
26324  * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26325  * function also establishes a binding between the writability of
26326  * @key and the "sensitive" property of @object (if @object has
26327  * a boolean property by that name). See g_settings_bind_writable()
26328  * for more details about writable bindings.
26329  *
26330  * Note that the lifecycle of the binding is tied to the object,
26331  * and that you can have only one binding per object property.
26332  * If you bind the same property twice on the same object, the second
26333  * binding overrides the first one.
26334  *
26335  * Since: 2.26
26336  */
26337
26338
26339 /**
26340  * g_settings_bind_with_mapping: (skip)
26341  * @settings: a #GSettings object
26342  * @key: the key to bind
26343  * @object: (type GObject.Object): a #GObject
26344  * @property: the name of the property to bind
26345  * @flags: flags for the binding
26346  * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26347  * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26348  * @user_data: data that gets passed to @get_mapping and @set_mapping
26349  * @destroy: #GDestroyNotify function for @user_data
26350  *
26351  * Create a binding between the @key in the @settings object
26352  * and the property @property of @object.
26353  *
26354  * The binding uses the provided mapping functions to map between
26355  * settings and property values.
26356  *
26357  * Note that the lifecycle of the binding is tied to the object,
26358  * and that you can have only one binding per object property.
26359  * If you bind the same property twice on the same object, the second
26360  * binding overrides the first one.
26361  *
26362  * Since: 2.26
26363  */
26364
26365
26366 /**
26367  * g_settings_bind_writable:
26368  * @settings: a #GSettings object
26369  * @key: the key to bind
26370  * @object: (type GObject.Object): a #GObject
26371  * @property: the name of a boolean property to bind
26372  * @inverted: whether to 'invert' the value
26373  *
26374  * Create a binding between the writability of @key in the
26375  * @settings object and the property @property of @object.
26376  * The property must be boolean; "sensitive" or "visible"
26377  * properties of widgets are the most likely candidates.
26378  *
26379  * Writable bindings are always uni-directional; changes of the
26380  * writability of the setting will be propagated to the object
26381  * property, not the other way.
26382  *
26383  * When the @inverted argument is %TRUE, the binding inverts the
26384  * value as it passes from the setting to the object, i.e. @property
26385  * will be set to %TRUE if the key is <emphasis>not</emphasis>
26386  * writable.
26387  *
26388  * Note that the lifecycle of the binding is tied to the object,
26389  * and that you can have only one binding per object property.
26390  * If you bind the same property twice on the same object, the second
26391  * binding overrides the first one.
26392  *
26393  * Since: 2.26
26394  */
26395
26396
26397 /**
26398  * g_settings_create_action:
26399  * @settings: a #GSettings
26400  * @key: the name of a key in @settings
26401  *
26402  * Creates a #GAction corresponding to a given #GSettings key.
26403  *
26404  * The action has the same name as the key.
26405  *
26406  * The value of the key becomes the state of the action and the action
26407  * is enabled when the key is writable.  Changing the state of the
26408  * action results in the key being written to.  Changes to the value or
26409  * writability of the key cause appropriate change notifications to be
26410  * emitted for the action.
26411  *
26412  * For boolean-valued keys, action activations take no parameter and
26413  * result in the toggling of the value.  For all other types,
26414  * activations take the new value for the key (which must have the
26415  * correct type).
26416  *
26417  * Returns: (transfer full): a new #GAction
26418  * Since: 2.32
26419  */
26420
26421
26422 /**
26423  * g_settings_delay:
26424  * @settings: a #GSettings object
26425  *
26426  * Changes the #GSettings object into 'delay-apply' mode. In this
26427  * mode, changes to @settings are not immediately propagated to the
26428  * backend, but kept locally until g_settings_apply() is called.
26429  *
26430  * Since: 2.26
26431  */
26432
26433
26434 /**
26435  * g_settings_get:
26436  * @settings: a #GSettings object
26437  * @key: the key to get the value for
26438  * @format: a #GVariant format string
26439  * @...: arguments as per @format
26440  *
26441  * Gets the value that is stored at @key in @settings.
26442  *
26443  * A convenience function that combines g_settings_get_value() with
26444  * g_variant_get().
26445  *
26446  * It is a programmer error to give a @key that isn't contained in the
26447  * schema for @settings or for the #GVariantType of @format to mismatch
26448  * the type given in the schema.
26449  *
26450  * Since: 2.26
26451  */
26452
26453
26454 /**
26455  * g_settings_get_boolean:
26456  * @settings: a #GSettings object
26457  * @key: the key to get the value for
26458  *
26459  * Gets the value that is stored at @key in @settings.
26460  *
26461  * A convenience variant of g_settings_get() for booleans.
26462  *
26463  * It is a programmer error to give a @key that isn't specified as
26464  * having a boolean type in the schema for @settings.
26465  *
26466  * Returns: a boolean
26467  * Since: 2.26
26468  */
26469
26470
26471 /**
26472  * g_settings_get_child:
26473  * @settings: a #GSettings object
26474  * @name: the name of the 'child' schema
26475  *
26476  * Creates a 'child' settings object which has a base path of
26477  * <replaceable>base-path</replaceable>/@name, where
26478  * <replaceable>base-path</replaceable> is the base path of @settings.
26479  *
26480  * The schema for the child settings object must have been declared
26481  * in the schema of @settings using a <tag class="starttag">child</tag> element.
26482  *
26483  * Returns: (transfer full): a 'child' settings object
26484  * Since: 2.26
26485  */
26486
26487
26488 /**
26489  * g_settings_get_double:
26490  * @settings: a #GSettings object
26491  * @key: the key to get the value for
26492  *
26493  * Gets the value that is stored at @key in @settings.
26494  *
26495  * A convenience variant of g_settings_get() for doubles.
26496  *
26497  * It is a programmer error to give a @key that isn't specified as
26498  * having a 'double' type in the schema for @settings.
26499  *
26500  * Returns: a double
26501  * Since: 2.26
26502  */
26503
26504
26505 /**
26506  * g_settings_get_enum:
26507  * @settings: a #GSettings object
26508  * @key: the key to get the value for
26509  *
26510  * Gets the value that is stored in @settings for @key and converts it
26511  * to the enum value that it represents.
26512  *
26513  * In order to use this function the type of the value must be a string
26514  * and it must be marked in the schema file as an enumerated type.
26515  *
26516  * It is a programmer error to give a @key that isn't contained in the
26517  * schema for @settings or is not marked as an enumerated type.
26518  *
26519  * If the value stored in the configuration database is not a valid
26520  * value for the enumerated type then this function will return the
26521  * default value.
26522  *
26523  * Returns: the enum value
26524  * Since: 2.26
26525  */
26526
26527
26528 /**
26529  * g_settings_get_flags:
26530  * @settings: a #GSettings object
26531  * @key: the key to get the value for
26532  *
26533  * Gets the value that is stored in @settings for @key and converts it
26534  * to the flags value that it represents.
26535  *
26536  * In order to use this function the type of the value must be an array
26537  * of strings and it must be marked in the schema file as an flags type.
26538  *
26539  * It is a programmer error to give a @key that isn't contained in the
26540  * schema for @settings or is not marked as a flags type.
26541  *
26542  * If the value stored in the configuration database is not a valid
26543  * value for the flags type then this function will return the default
26544  * value.
26545  *
26546  * Returns: the flags value
26547  * Since: 2.26
26548  */
26549
26550
26551 /**
26552  * g_settings_get_has_unapplied:
26553  * @settings: a #GSettings object
26554  *
26555  * Returns whether the #GSettings object has any unapplied
26556  * changes.  This can only be the case if it is in 'delayed-apply' mode.
26557  *
26558  * Returns: %TRUE if @settings has unapplied changes
26559  * Since: 2.26
26560  */
26561
26562
26563 /**
26564  * g_settings_get_int:
26565  * @settings: a #GSettings object
26566  * @key: the key to get the value for
26567  *
26568  * Gets the value that is stored at @key in @settings.
26569  *
26570  * A convenience variant of g_settings_get() for 32-bit integers.
26571  *
26572  * It is a programmer error to give a @key that isn't specified as
26573  * having a int32 type in the schema for @settings.
26574  *
26575  * Returns: an integer
26576  * Since: 2.26
26577  */
26578
26579
26580 /**
26581  * g_settings_get_mapped:
26582  * @settings: a #GSettings object
26583  * @key: the key to get the value for
26584  * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26585  * @user_data: user data for @mapping
26586  *
26587  * Gets the value that is stored at @key in @settings, subject to
26588  * application-level validation/mapping.
26589  *
26590  * You should use this function when the application needs to perform
26591  * some processing on the value of the key (for example, parsing).  The
26592  * @mapping function performs that processing.  If the function
26593  * indicates that the processing was unsuccessful (due to a parse error,
26594  * for example) then the mapping is tried again with another value.
26595  *
26596  * This allows a robust 'fall back to defaults' behaviour to be
26597  * implemented somewhat automatically.
26598  *
26599  * The first value that is tried is the user's setting for the key.  If
26600  * the mapping function fails to map this value, other values may be
26601  * tried in an unspecified order (system or site defaults, translated
26602  * schema default values, untranslated schema default values, etc).
26603  *
26604  * If the mapping function fails for all possible values, one additional
26605  * attempt is made: the mapping function is called with a %NULL value.
26606  * If the mapping function still indicates failure at this point then
26607  * the application will be aborted.
26608  *
26609  * The result parameter for the @mapping function is pointed to a
26610  * #gpointer which is initially set to %NULL.  The same pointer is given
26611  * to each invocation of @mapping.  The final value of that #gpointer is
26612  * what is returned by this function.  %NULL is valid; it is returned
26613  * just as any other value would be.
26614  *
26615  * Returns: (transfer full): the result, which may be %NULL
26616  */
26617
26618
26619 /**
26620  * g_settings_get_range:
26621  * @settings: a #GSettings
26622  * @key: the key to query the range of
26623  *
26624  * Queries the range of a key.
26625  *
26626  * This function will return a #GVariant that fully describes the range
26627  * of values that are valid for @key.
26628  *
26629  * The type of #GVariant returned is <literal>(sv)</literal>.  The
26630  * string describes the type of range restriction in effect.  The type
26631  * and meaning of the value contained in the variant depends on the
26632  * string.
26633  *
26634  * If the string is <literal>'type'</literal> then the variant contains
26635  * an empty array.  The element type of that empty array is the expected
26636  * type of value and all values of that type are valid.
26637  *
26638  * If the string is <literal>'enum'</literal> then the variant contains
26639  * an array enumerating the possible values.  Each item in the array is
26640  * a possible valid value and no other values are valid.
26641  *
26642  * If the string is <literal>'flags'</literal> then the variant contains
26643  * an array.  Each item in the array is a value that may appear zero or
26644  * one times in an array to be used as the value for this key.  For
26645  * example, if the variant contained the array <literal>['x',
26646  * 'y']</literal> then the valid values for the key would be
26647  * <literal>[]</literal>, <literal>['x']</literal>,
26648  * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26649  * <literal>['y', 'x']</literal>.
26650  *
26651  * Finally, if the string is <literal>'range'</literal> then the variant
26652  * contains a pair of like-typed values -- the minimum and maximum
26653  * permissible values for this key.
26654  *
26655  * This information should not be used by normal programs.  It is
26656  * considered to be a hint for introspection purposes.  Normal programs
26657  * should already know what is permitted by their own schema.  The
26658  * format may change in any way in the future -- but particularly, new
26659  * forms may be added to the possibilities described above.
26660  *
26661  * It is a programmer error to give a @key that isn't contained in the
26662  * schema for @settings.
26663  *
26664  * You should free the returned value with g_variant_unref() when it is
26665  * no longer needed.
26666  *
26667  * Returns: a #GVariant describing the range
26668  * Since: 2.28
26669  */
26670
26671
26672 /**
26673  * g_settings_get_string:
26674  * @settings: a #GSettings object
26675  * @key: the key to get the value for
26676  *
26677  * Gets the value that is stored at @key in @settings.
26678  *
26679  * A convenience variant of g_settings_get() for strings.
26680  *
26681  * It is a programmer error to give a @key that isn't specified as
26682  * having a string type in the schema for @settings.
26683  *
26684  * Returns: a newly-allocated string
26685  * Since: 2.26
26686  */
26687
26688
26689 /**
26690  * g_settings_get_strv:
26691  * @settings: a #GSettings object
26692  * @key: the key to get the value for
26693  *
26694  * A convenience variant of g_settings_get() for string arrays.
26695  *
26696  * It is a programmer error to give a @key that isn't specified as
26697  * having an array of strings type in the schema for @settings.
26698  *
26699  * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26700  * Since: 2.26
26701  */
26702
26703
26704 /**
26705  * g_settings_get_uint:
26706  * @settings: a #GSettings object
26707  * @key: the key to get the value for
26708  *
26709  * Gets the value that is stored at @key in @settings.
26710  *
26711  * A convenience variant of g_settings_get() for 32-bit unsigned
26712  * integers.
26713  *
26714  * It is a programmer error to give a @key that isn't specified as
26715  * having a uint32 type in the schema for @settings.
26716  *
26717  * Returns: an unsigned integer
26718  * Since: 2.30
26719  */
26720
26721
26722 /**
26723  * g_settings_get_value:
26724  * @settings: a #GSettings object
26725  * @key: the key to get the value for
26726  *
26727  * Gets the value that is stored in @settings for @key.
26728  *
26729  * It is a programmer error to give a @key that isn't contained in the
26730  * schema for @settings.
26731  *
26732  * Returns: a new #GVariant
26733  * Since: 2.26
26734  */
26735
26736
26737 /**
26738  * g_settings_is_writable:
26739  * @settings: a #GSettings object
26740  * @name: the name of a key
26741  *
26742  * Finds out if a key can be written or not
26743  *
26744  * Returns: %TRUE if the key @name is writable
26745  * Since: 2.26
26746  */
26747
26748
26749 /**
26750  * g_settings_list_children:
26751  * @settings: a #GSettings object
26752  *
26753  * Gets the list of children on @settings.
26754  *
26755  * The list is exactly the list of strings for which it is not an error
26756  * to call g_settings_get_child().
26757  *
26758  * For GSettings objects that are lists, this value can change at any
26759  * time and you should connect to the "children-changed" signal to watch
26760  * for those changes.  Note that there is a race condition here: you may
26761  * request a child after listing it only for it to have been destroyed
26762  * in the meantime.  For this reason, g_settings_get_child() may return
26763  * %NULL even for a child that was listed by this function.
26764  *
26765  * For GSettings objects that are not lists, you should probably not be
26766  * calling this function from "normal" code (since you should already
26767  * know what children are in your schema).  This function may still be
26768  * useful there for introspection reasons, however.
26769  *
26770  * You should free the return value with g_strfreev() when you are done
26771  * with it.
26772  *
26773  * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26774  */
26775
26776
26777 /**
26778  * g_settings_list_keys:
26779  * @settings: a #GSettings object
26780  *
26781  * Introspects the list of keys on @settings.
26782  *
26783  * You should probably not be calling this function from "normal" code
26784  * (since you should already know what keys are in your schema).  This
26785  * function is intended for introspection reasons.
26786  *
26787  * You should free the return value with g_strfreev() when you are done
26788  * with it.
26789  *
26790  * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26791  */
26792
26793
26794 /**
26795  * g_settings_list_relocatable_schemas:
26796  *
26797  * Gets a list of the relocatable #GSettings schemas installed on the
26798  * system.  These are schemas that do not provide their own path.  It is
26799  * usual to instantiate these schemas directly, but if you want to you
26800  * can use g_settings_new_with_path() to specify the path.
26801  *
26802  * The output of this function, taken together with the output of
26803  * g_settings_list_schemas() represents the complete list of all
26804  * installed schemas.
26805  *
26806  * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available.  The list must not be modified or freed.
26807  * Since: 2.28
26808  */
26809
26810
26811 /**
26812  * g_settings_list_schemas:
26813  *
26814  * Gets a list of the #GSettings schemas installed on the system.  The
26815  * returned list is exactly the list of schemas for which you may call
26816  * g_settings_new() without adverse effects.
26817  *
26818  * This function does not list the schemas that do not provide their own
26819  * paths (ie: schemas for which you must use
26820  * g_settings_new_with_path()).  See
26821  * g_settings_list_relocatable_schemas() for that.
26822  *
26823  * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available.  The list must not be modified or freed.
26824  * Since: 2.26
26825  */
26826
26827
26828 /**
26829  * g_settings_new:
26830  * @schema_id: the id of the schema
26831  *
26832  * Creates a new #GSettings object with the schema specified by
26833  * @schema_id.
26834  *
26835  * Signals on the newly created #GSettings object will be dispatched
26836  * via the thread-default #GMainContext in effect at the time of the
26837  * call to g_settings_new().  The new #GSettings will hold a reference
26838  * on the context.  See g_main_context_push_thread_default().
26839  *
26840  * Returns: a new #GSettings object
26841  * Since: 2.26
26842  */
26843
26844
26845 /**
26846  * g_settings_new_full:
26847  * @schema: a #GSettingsSchema
26848  * @backend: (allow-none): a #GSettingsBackend
26849  * @path: (allow-none): the path to use
26850  *
26851  * Creates a new #GSettings object with a given schema, backend and
26852  * path.
26853  *
26854  * It should be extremely rare that you ever want to use this function.
26855  * It is made available for advanced use-cases (such as plugin systems
26856  * that want to provide access to schemas loaded from custom locations,
26857  * etc).
26858  *
26859  * At the most basic level, a #GSettings object is a pure composition of
26860  * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26861  * backend, and a #GMainContext to which signals are dispatched.
26862  *
26863  * This constructor therefore gives you full control over constructing
26864  * #GSettings instances.  The first 4 parameters are given directly as
26865  * @schema, @backend and @path, and the main context is taken from the
26866  * thread-default (as per g_settings_new()).
26867  *
26868  * If @backend is %NULL then the default backend is used.
26869  *
26870  * If @path is %NULL then the path from the schema is used.  It is an
26871  * error f @path is %NULL and the schema has no path of its own or if
26872  * @path is non-%NULL and not equal to the path that the schema does
26873  * have.
26874  *
26875  * Returns: a new #GSettings object
26876  * Since: 2.32
26877  */
26878
26879
26880 /**
26881  * g_settings_new_with_backend:
26882  * @schema_id: the id of the schema
26883  * @backend: the #GSettingsBackend to use
26884  *
26885  * Creates a new #GSettings object with the schema specified by
26886  * @schema_id and a given #GSettingsBackend.
26887  *
26888  * Creating a #GSettings object with a different backend allows accessing
26889  * settings from a database other than the usual one. For example, it may make
26890  * sense to pass a backend corresponding to the "defaults" settings database on
26891  * the system to get a settings object that modifies the system default
26892  * settings instead of the settings for this user.
26893  *
26894  * Returns: a new #GSettings object
26895  * Since: 2.26
26896  */
26897
26898
26899 /**
26900  * g_settings_new_with_backend_and_path:
26901  * @schema_id: the id of the schema
26902  * @backend: the #GSettingsBackend to use
26903  * @path: the path to use
26904  *
26905  * Creates a new #GSettings object with the schema specified by
26906  * @schema_id and a given #GSettingsBackend and path.
26907  *
26908  * This is a mix of g_settings_new_with_backend() and
26909  * g_settings_new_with_path().
26910  *
26911  * Returns: a new #GSettings object
26912  * Since: 2.26
26913  */
26914
26915
26916 /**
26917  * g_settings_new_with_path:
26918  * @schema_id: the id of the schema
26919  * @path: the path to use
26920  *
26921  * Creates a new #GSettings object with the relocatable schema specified
26922  * by @schema_id and a given path.
26923  *
26924  * You only need to do this if you want to directly create a settings
26925  * object with a schema that doesn't have a specified path of its own.
26926  * That's quite rare.
26927  *
26928  * It is a programmer error to call this function for a schema that
26929  * has an explicitly specified path.
26930  *
26931  * Returns: a new #GSettings object
26932  * Since: 2.26
26933  */
26934
26935
26936 /**
26937  * g_settings_range_check:
26938  * @settings: a #GSettings
26939  * @key: the key to check
26940  * @value: the value to check
26941  *
26942  * Checks if the given @value is of the correct type and within the
26943  * permitted range for @key.
26944  *
26945  * This API is not intended to be used by normal programs -- they should
26946  * already know what is permitted by their own schemas.  This API is
26947  * meant to be used by programs such as editors or commandline tools.
26948  *
26949  * It is a programmer error to give a @key that isn't contained in the
26950  * schema for @settings.
26951  *
26952  * Returns: %TRUE if @value is valid for @key
26953  * Since: 2.28
26954  */
26955
26956
26957 /**
26958  * g_settings_reset:
26959  * @settings: a #GSettings object
26960  * @key: the name of a key
26961  *
26962  * Resets @key to its default value.
26963  *
26964  * This call resets the key, as much as possible, to its default value.
26965  * That might the value specified in the schema or the one set by the
26966  * administrator.
26967  */
26968
26969
26970 /**
26971  * g_settings_revert:
26972  * @settings: a #GSettings instance
26973  *
26974  * Reverts all non-applied changes to the settings.  This function
26975  * does nothing unless @settings is in 'delay-apply' mode; see
26976  * g_settings_delay().  In the normal case settings are always applied
26977  * immediately.
26978  *
26979  * Change notifications will be emitted for affected keys.
26980  */
26981
26982
26983 /**
26984  * g_settings_schema_get_id:
26985  * @schema: a #GSettingsSchema
26986  *
26987  * Get the ID of @schema.
26988  *
26989  * Returns: (transfer none): the ID
26990  */
26991
26992
26993 /**
26994  * g_settings_schema_get_path:
26995  * @schema: a #GSettingsSchema
26996  *
26997  * Gets the path associated with @schema, or %NULL.
26998  *
26999  * Schemas may be single-instance or relocatable.  Single-instance
27000  * schemas correspond to exactly one set of keys in the backend
27001  * database: those located at the path returned by this function.
27002  *
27003  * Relocatable schemas can be referenced by other schemas and can
27004  * threfore describe multiple sets of keys at different locations.  For
27005  * relocatable schemas, this function will return %NULL.
27006  *
27007  * Returns: (transfer none): the path of the schema, or %NULL
27008  * Since: 2.32
27009  */
27010
27011
27012 /**
27013  * g_settings_schema_ref:
27014  * @schema: a #GSettingsSchema
27015  *
27016  * Increase the reference count of @schema, returning a new reference.
27017  *
27018  * Returns: a new reference to @schema
27019  * Since: 2.32
27020  */
27021
27022
27023 /**
27024  * g_settings_schema_source_get_default:
27025  *
27026  * Gets the default system schema source.
27027  *
27028  * This function is not required for normal uses of #GSettings but it
27029  * may be useful to authors of plugin management systems or to those who
27030  * want to introspect the content of schemas.
27031  *
27032  * If no schemas are installed, %NULL will be returned.
27033  *
27034  * The returned source may actually consist of multiple schema sources
27035  * from different directories, depending on which directories were given
27036  * in <envar>XDG_DATA_DIRS</envar> and
27037  * <envar>GSETTINGS_SCHEMA_DIR</envar>.  For this reason, all lookups
27038  * performed against the default source should probably be done
27039  * recursively.
27040  *
27041  * Returns: (transfer none): the default schema source
27042  * Since: 2.32
27043  */
27044
27045
27046 /**
27047  * g_settings_schema_source_lookup:
27048  * @source: a #GSettingsSchemaSource
27049  * @schema_id: a schema ID
27050  * @recursive: %TRUE if the lookup should be recursive
27051  *
27052  * Looks up a schema with the identifier @schema_id in @source.
27053  *
27054  * This function is not required for normal uses of #GSettings but it
27055  * may be useful to authors of plugin management systems or to those who
27056  * want to introspect the content of schemas.
27057  *
27058  * If the schema isn't found directly in @source and @recursive is %TRUE
27059  * then the parent sources will also be checked.
27060  *
27061  * If the schema isn't found, %NULL is returned.
27062  *
27063  * Returns: (transfer full): a new #GSettingsSchema
27064  * Since: 2.32
27065  */
27066
27067
27068 /**
27069  * g_settings_schema_source_new_from_directory:
27070  * @directory: the filename of a directory
27071  * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27072  * @trusted: %TRUE, if the directory is trusted
27073  * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27074  *
27075  * Attempts to create a new schema source corresponding to the contents
27076  * of the given directory.
27077  *
27078  * This function is not required for normal uses of #GSettings but it
27079  * may be useful to authors of plugin management systems.
27080  *
27081  * The directory should contain a file called
27082  * <filename>gschemas.compiled</filename> as produced by
27083  * <command>glib-compile-schemas</command>.
27084  *
27085  * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27086  * trusted not to be corrupted.  This assumption has a performance
27087  * advantage, but can result in crashes or inconsistent behaviour in the
27088  * case of a corrupted file.  Generally, you should set @trusted to
27089  * %TRUE for files installed by the system and to %FALSE for files in
27090  * the home directory.
27091  *
27092  * If @parent is non-%NULL then there are two effects.
27093  *
27094  * First, if g_settings_schema_source_lookup() is called with the
27095  * @recursive flag set to %TRUE and the schema can not be found in the
27096  * source, the lookup will recurse to the parent.
27097  *
27098  * Second, any references to other schemas specified within this
27099  * source (ie: <literal>child</literal> or <literal>extends</literal>)
27100  * references may be resolved from the @parent.
27101  *
27102  * For this second reason, except in very unusual situations, the
27103  * @parent should probably be given as the default schema source, as
27104  * returned by g_settings_schema_source_get_default().
27105  *
27106  * Since: 2.32
27107  */
27108
27109
27110 /**
27111  * g_settings_schema_source_ref:
27112  * @source: a #GSettingsSchemaSource
27113  *
27114  * Increase the reference count of @source, returning a new reference.
27115  *
27116  * Returns: a new reference to @source
27117  * Since: 2.32
27118  */
27119
27120
27121 /**
27122  * g_settings_schema_source_unref:
27123  * @source: a #GSettingsSchemaSource
27124  *
27125  * Decrease the reference count of @source, possibly freeing it.
27126  *
27127  * Since: 2.32
27128  */
27129
27130
27131 /**
27132  * g_settings_schema_unref:
27133  * @schema: a #GSettingsSchema
27134  *
27135  * Decrease the reference count of @schema, possibly freeing it.
27136  *
27137  * Since: 2.32
27138  */
27139
27140
27141 /**
27142  * g_settings_set:
27143  * @settings: a #GSettings object
27144  * @key: the name of the key to set
27145  * @format: a #GVariant format string
27146  * @...: arguments as per @format
27147  *
27148  * Sets @key in @settings to @value.
27149  *
27150  * A convenience function that combines g_settings_set_value() with
27151  * g_variant_new().
27152  *
27153  * It is a programmer error to give a @key that isn't contained in the
27154  * schema for @settings or for the #GVariantType of @format to mismatch
27155  * the type given in the schema.
27156  *
27157  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27158  * Since: 2.26
27159  */
27160
27161
27162 /**
27163  * g_settings_set_boolean:
27164  * @settings: a #GSettings object
27165  * @key: the name of the key to set
27166  * @value: the value to set it to
27167  *
27168  * Sets @key in @settings to @value.
27169  *
27170  * A convenience variant of g_settings_set() for booleans.
27171  *
27172  * It is a programmer error to give a @key that isn't specified as
27173  * having a boolean type in the schema for @settings.
27174  *
27175  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27176  * Since: 2.26
27177  */
27178
27179
27180 /**
27181  * g_settings_set_double:
27182  * @settings: a #GSettings object
27183  * @key: the name of the key to set
27184  * @value: the value to set it to
27185  *
27186  * Sets @key in @settings to @value.
27187  *
27188  * A convenience variant of g_settings_set() for doubles.
27189  *
27190  * It is a programmer error to give a @key that isn't specified as
27191  * having a 'double' type in the schema for @settings.
27192  *
27193  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27194  * Since: 2.26
27195  */
27196
27197
27198 /**
27199  * g_settings_set_enum:
27200  * @settings: a #GSettings object
27201  * @key: a key, within @settings
27202  * @value: an enumerated value
27203  *
27204  * Looks up the enumerated type nick for @value and writes it to @key,
27205  * within @settings.
27206  *
27207  * It is a programmer error to give a @key that isn't contained in the
27208  * schema for @settings or is not marked as an enumerated type, or for
27209  * @value not to be a valid value for the named type.
27210  *
27211  * After performing the write, accessing @key directly with
27212  * g_settings_get_string() will return the 'nick' associated with
27213  * @value.
27214  *
27215  * Returns: %TRUE, if the set succeeds
27216  */
27217
27218
27219 /**
27220  * g_settings_set_flags:
27221  * @settings: a #GSettings object
27222  * @key: a key, within @settings
27223  * @value: a flags value
27224  *
27225  * Looks up the flags type nicks for the bits specified by @value, puts
27226  * them in an array of strings and writes the array to @key, within
27227  * @settings.
27228  *
27229  * It is a programmer error to give a @key that isn't contained in the
27230  * schema for @settings or is not marked as a flags type, or for @value
27231  * to contain any bits that are not value for the named type.
27232  *
27233  * After performing the write, accessing @key directly with
27234  * g_settings_get_strv() will return an array of 'nicks'; one for each
27235  * bit in @value.
27236  *
27237  * Returns: %TRUE, if the set succeeds
27238  */
27239
27240
27241 /**
27242  * g_settings_set_int:
27243  * @settings: a #GSettings object
27244  * @key: the name of the key to set
27245  * @value: the value to set it to
27246  *
27247  * Sets @key in @settings to @value.
27248  *
27249  * A convenience variant of g_settings_set() for 32-bit integers.
27250  *
27251  * It is a programmer error to give a @key that isn't specified as
27252  * having a int32 type in the schema for @settings.
27253  *
27254  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27255  * Since: 2.26
27256  */
27257
27258
27259 /**
27260  * g_settings_set_string:
27261  * @settings: a #GSettings object
27262  * @key: the name of the key to set
27263  * @value: the value to set it to
27264  *
27265  * Sets @key in @settings to @value.
27266  *
27267  * A convenience variant of g_settings_set() for strings.
27268  *
27269  * It is a programmer error to give a @key that isn't specified as
27270  * having a string type in the schema for @settings.
27271  *
27272  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27273  * Since: 2.26
27274  */
27275
27276
27277 /**
27278  * g_settings_set_strv:
27279  * @settings: a #GSettings object
27280  * @key: the name of the key to set
27281  * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27282  *
27283  * Sets @key in @settings to @value.
27284  *
27285  * A convenience variant of g_settings_set() for string arrays.  If
27286  * @value is %NULL, then @key is set to be the empty array.
27287  *
27288  * It is a programmer error to give a @key that isn't specified as
27289  * having an array of strings type in the schema for @settings.
27290  *
27291  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27292  * Since: 2.26
27293  */
27294
27295
27296 /**
27297  * g_settings_set_uint:
27298  * @settings: a #GSettings object
27299  * @key: the name of the key to set
27300  * @value: the value to set it to
27301  *
27302  * Sets @key in @settings to @value.
27303  *
27304  * A convenience variant of g_settings_set() for 32-bit unsigned
27305  * integers.
27306  *
27307  * It is a programmer error to give a @key that isn't specified as
27308  * having a uint32 type in the schema for @settings.
27309  *
27310  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27311  * Since: 2.30
27312  */
27313
27314
27315 /**
27316  * g_settings_set_value:
27317  * @settings: a #GSettings object
27318  * @key: the name of the key to set
27319  * @value: a #GVariant of the correct type
27320  *
27321  * Sets @key in @settings to @value.
27322  *
27323  * It is a programmer error to give a @key that isn't contained in the
27324  * schema for @settings or for @value to have the incorrect type, per
27325  * the schema.
27326  *
27327  * If @value is floating then this function consumes the reference.
27328  *
27329  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27330  * Since: 2.26
27331  */
27332
27333
27334 /**
27335  * g_settings_sync:
27336  *
27337  * Ensures that all pending operations for the given are complete for
27338  * the default backend.
27339  *
27340  * Writes made to a #GSettings are handled asynchronously.  For this
27341  * reason, it is very unlikely that the changes have it to disk by the
27342  * time g_settings_set() returns.
27343  *
27344  * This call will block until all of the writes have made it to the
27345  * backend.  Since the mainloop is not running, no change notifications
27346  * will be dispatched during this call (but some may be queued by the
27347  * time the call is done).
27348  */
27349
27350
27351 /**
27352  * g_settings_unbind:
27353  * @object: the object
27354  * @property: the property whose binding is removed
27355  *
27356  * Removes an existing binding for @property on @object.
27357  *
27358  * Note that bindings are automatically removed when the
27359  * object is finalized, so it is rarely necessary to call this
27360  * function.
27361  *
27362  * Since: 2.26
27363  */
27364
27365
27366 /**
27367  * g_simple_action_group_add_entries:
27368  * @simple: a #GSimpleActionGroup
27369  * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27370  * @n_entries: the length of @entries, or -1
27371  * @user_data: the user data for signal connections
27372  *
27373  * A convenience function for creating multiple #GSimpleAction instances
27374  * and adding them to the action group.
27375  *
27376  * Since: 2.30
27377  */
27378
27379
27380 /**
27381  * g_simple_action_group_insert:
27382  * @simple: a #GSimpleActionGroup
27383  * @action: a #GAction
27384  *
27385  * Adds an action to the action group.
27386  *
27387  * If the action group already contains an action with the same name as
27388  * @action then the old action is dropped from the group.
27389  *
27390  * The action group takes its own reference on @action.
27391  *
27392  * Since: 2.28
27393  */
27394
27395
27396 /**
27397  * g_simple_action_group_lookup:
27398  * @simple: a #GSimpleActionGroup
27399  * @action_name: the name of an action
27400  *
27401  * Looks up the action with the name @action_name in the group.
27402  *
27403  * If no such action exists, returns %NULL.
27404  *
27405  * Returns: (transfer none): a #GAction, or %NULL
27406  * Since: 2.28
27407  */
27408
27409
27410 /**
27411  * g_simple_action_group_new:
27412  *
27413  * Creates a new, empty, #GSimpleActionGroup.
27414  *
27415  * Returns: a new #GSimpleActionGroup
27416  * Since: 2.28
27417  */
27418
27419
27420 /**
27421  * g_simple_action_group_remove:
27422  * @simple: a #GSimpleActionGroup
27423  * @action_name: the name of the action
27424  *
27425  * Removes the named action from the action group.
27426  *
27427  * If no action of this name is in the group then nothing happens.
27428  *
27429  * Since: 2.28
27430  */
27431
27432
27433 /**
27434  * g_simple_action_new:
27435  * @name: the name of the action
27436  * @parameter_type: (allow-none): the type of parameter to the activate function
27437  *
27438  * Creates a new action.
27439  *
27440  * The created action is stateless.  See g_simple_action_new_stateful().
27441  *
27442  * Returns: a new #GSimpleAction
27443  * Since: 2.28
27444  */
27445
27446
27447 /**
27448  * g_simple_action_new_stateful:
27449  * @name: the name of the action
27450  * @parameter_type: (allow-none): the type of the parameter to the activate function
27451  * @state: the initial state of the action
27452  *
27453  * Creates a new stateful action.
27454  *
27455  * @state is the initial state of the action.  All future state values
27456  * must have the same #GVariantType as the initial state.
27457  *
27458  * If the @state GVariant is floating, it is consumed.
27459  *
27460  * Returns: a new #GSimpleAction
27461  * Since: 2.28
27462  */
27463
27464
27465 /**
27466  * g_simple_action_set_enabled:
27467  * @simple: a #GSimpleAction
27468  * @enabled: whether the action is enabled
27469  *
27470  * Sets the action as enabled or not.
27471  *
27472  * An action must be enabled in order to be activated or in order to
27473  * have its state changed from outside callers.
27474  *
27475  * This should only be called by the implementor of the action.  Users
27476  * of the action should not attempt to modify its enabled flag.
27477  *
27478  * Since: 2.28
27479  */
27480
27481
27482 /**
27483  * g_simple_action_set_state:
27484  * @simple: a #GSimpleAction
27485  * @value: the new #GVariant for the state
27486  *
27487  * Sets the state of the action.
27488  *
27489  * This directly updates the 'state' property to the given value.
27490  *
27491  * This should only be called by the implementor of the action.  Users
27492  * of the action should not attempt to directly modify the 'state'
27493  * property.  Instead, they should call g_action_change_state() to
27494  * request the change.
27495  *
27496  * Since: 2.30
27497  */
27498
27499
27500 /**
27501  * g_simple_async_report_error_in_idle: (skip)
27502  * @object: (allow-none): a #GObject, or %NULL.
27503  * @callback: a #GAsyncReadyCallback.
27504  * @user_data: user data passed to @callback.
27505  * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27506  * @code: a specific error code.
27507  * @format: a formatted error reporting string.
27508  * @...: a list of variables to fill in @format.
27509  *
27510  * Reports an error in an asynchronous function in an idle function by
27511  * directly setting the contents of the #GAsyncResult with the given error
27512  * information.
27513  */
27514
27515
27516 /**
27517  * g_simple_async_report_gerror_in_idle:
27518  * @object: (allow-none): a #GObject, or %NULL
27519  * @callback: (scope async): a #GAsyncReadyCallback.
27520  * @user_data: (closure): user data passed to @callback.
27521  * @error: the #GError to report
27522  *
27523  * Reports an error in an idle function. Similar to
27524  * g_simple_async_report_error_in_idle(), but takes a #GError rather
27525  * than building a new one.
27526  */
27527
27528
27529 /**
27530  * g_simple_async_report_take_gerror_in_idle: (skip)
27531  * @object: (allow-none): a #GObject, or %NULL
27532  * @callback: a #GAsyncReadyCallback.
27533  * @user_data: user data passed to @callback.
27534  * @error: the #GError to report
27535  *
27536  * Reports an error in an idle function. Similar to
27537  * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27538  * ownership of @error, so the caller does not have to free it any more.
27539  *
27540  * Since: 2.28
27541  */
27542
27543
27544 /**
27545  * g_simple_async_result_complete:
27546  * @simple: a #GSimpleAsyncResult.
27547  *
27548  * Completes an asynchronous I/O job immediately. Must be called in
27549  * the thread where the asynchronous result was to be delivered, as it
27550  * invokes the callback directly. If you are in a different thread use
27551  * g_simple_async_result_complete_in_idle().
27552  *
27553  * Calling this function takes a reference to @simple for as long as
27554  * is needed to complete the call.
27555  */
27556
27557
27558 /**
27559  * g_simple_async_result_complete_in_idle:
27560  * @simple: a #GSimpleAsyncResult.
27561  *
27562  * Completes an asynchronous function in an idle handler in the <link
27563  * linkend="g-main-context-push-thread-default">thread-default main
27564  * loop</link> of the thread that @simple was initially created in
27565  * (and re-pushes that context around the invocation of the callback).
27566  *
27567  * Calling this function takes a reference to @simple for as long as
27568  * is needed to complete the call.
27569  */
27570
27571
27572 /**
27573  * g_simple_async_result_get_op_res_gboolean:
27574  * @simple: a #GSimpleAsyncResult.
27575  *
27576  * Gets the operation result boolean from within the asynchronous result.
27577  *
27578  * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27579  */
27580
27581
27582 /**
27583  * g_simple_async_result_get_op_res_gpointer: (skip)
27584  * @simple: a #GSimpleAsyncResult.
27585  *
27586  * Gets a pointer result as returned by the asynchronous function.
27587  *
27588  * Returns: a pointer from the result.
27589  */
27590
27591
27592 /**
27593  * g_simple_async_result_get_op_res_gssize:
27594  * @simple: a #GSimpleAsyncResult.
27595  *
27596  * Gets a gssize from the asynchronous result.
27597  *
27598  * Returns: a gssize returned from the asynchronous function.
27599  */
27600
27601
27602 /**
27603  * g_simple_async_result_get_source_tag: (skip)
27604  * @simple: a #GSimpleAsyncResult.
27605  *
27606  * Gets the source tag for the #GSimpleAsyncResult.
27607  *
27608  * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27609  */
27610
27611
27612 /**
27613  * g_simple_async_result_is_valid:
27614  * @result: the #GAsyncResult passed to the _finish function.
27615  * @source: the #GObject passed to the _finish function.
27616  * @source_tag: the asynchronous function.
27617  *
27618  * Ensures that the data passed to the _finish function of an async
27619  * operation is consistent.  Three checks are performed.
27620  *
27621  * First, @result is checked to ensure that it is really a
27622  * #GSimpleAsyncResult.  Second, @source is checked to ensure that it
27623  * matches the source object of @result.  Third, @source_tag is
27624  * checked to ensure that it is either %NULL (as it is when the result was
27625  * created by g_simple_async_report_error_in_idle() or
27626  * g_simple_async_report_gerror_in_idle()) or equal to the
27627  * @source_tag argument given to g_simple_async_result_new() (which, by
27628  * convention, is a pointer to the _async function corresponding to the
27629  * _finish function from which this function is called).
27630  *
27631  * Returns: #TRUE if all checks passed or #FALSE if any failed.
27632  * Since: 2.20
27633  */
27634
27635
27636 /**
27637  * g_simple_async_result_new:
27638  * @source_object: (allow-none): a #GObject, or %NULL.
27639  * @callback: (scope async): a #GAsyncReadyCallback.
27640  * @user_data: (closure): user data passed to @callback.
27641  * @source_tag: the asynchronous function.
27642  *
27643  * Creates a #GSimpleAsyncResult.
27644  *
27645  * The common convention is to create the #GSimpleAsyncResult in the
27646  * function that starts the asynchronous operation and use that same
27647  * function as the @source_tag.
27648  *
27649  * If your operation supports cancellation with #GCancellable (which it
27650  * probably should) then you should provide the user's cancellable to
27651  * g_simple_async_result_set_check_cancellable() immediately after
27652  * this function returns.
27653  *
27654  * Returns: a #GSimpleAsyncResult.
27655  */
27656
27657
27658 /**
27659  * g_simple_async_result_new_error:
27660  * @source_object: (allow-none): a #GObject, or %NULL.
27661  * @callback: (scope async): a #GAsyncReadyCallback.
27662  * @user_data: (closure): user data passed to @callback.
27663  * @domain: a #GQuark.
27664  * @code: an error code.
27665  * @format: a string with format characters.
27666  * @...: a list of values to insert into @format.
27667  *
27668  * Creates a new #GSimpleAsyncResult with a set error.
27669  *
27670  * Returns: a #GSimpleAsyncResult.
27671  */
27672
27673
27674 /**
27675  * g_simple_async_result_new_from_error:
27676  * @source_object: (allow-none): a #GObject, or %NULL.
27677  * @callback: (scope async): a #GAsyncReadyCallback.
27678  * @user_data: (closure): user data passed to @callback.
27679  * @error: a #GError
27680  *
27681  * Creates a #GSimpleAsyncResult from an error condition.
27682  *
27683  * Returns: a #GSimpleAsyncResult.
27684  */
27685
27686
27687 /**
27688  * g_simple_async_result_new_take_error: (skip)
27689  * @source_object: (allow-none): a #GObject, or %NULL
27690  * @callback: (scope async): a #GAsyncReadyCallback
27691  * @user_data: (closure): user data passed to @callback
27692  * @error: a #GError
27693  *
27694  * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27695  * caller's ownership of @error, so the caller does not need to free it anymore.
27696  *
27697  * Returns: a #GSimpleAsyncResult
27698  * Since: 2.28
27699  */
27700
27701
27702 /**
27703  * g_simple_async_result_propagate_error:
27704  * @simple: a #GSimpleAsyncResult.
27705  * @dest: (out): a location to propagate the error to.
27706  *
27707  * Propagates an error from within the simple asynchronous result to
27708  * a given destination.
27709  *
27710  * If the #GCancellable given to a prior call to
27711  * g_simple_async_result_set_check_cancellable() is cancelled then this
27712  * function will return %TRUE with @dest set appropriately.
27713  *
27714  * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27715  */
27716
27717
27718 /**
27719  * g_simple_async_result_run_in_thread: (skip)
27720  * @simple: a #GSimpleAsyncResult.
27721  * @func: a #GSimpleAsyncThreadFunc.
27722  * @io_priority: the io priority of the request.
27723  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27724  *
27725  * Runs the asynchronous job in a separate thread and then calls
27726  * g_simple_async_result_complete_in_idle() on @simple to return
27727  * the result to the appropriate main loop.
27728  *
27729  * Calling this function takes a reference to @simple for as long as
27730  * is needed to run the job and report its completion.
27731  */
27732
27733
27734 /**
27735  * g_simple_async_result_set_check_cancellable:
27736  * @simple: a #GSimpleAsyncResult
27737  * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27738  *
27739  * Sets a #GCancellable to check before dispatching results.
27740  *
27741  * This function has one very specific purpose: the provided cancellable
27742  * is checked at the time of g_simple_async_result_propagate_error() If
27743  * it is cancelled, these functions will return an "Operation was
27744  * cancelled" error (%G_IO_ERROR_CANCELLED).
27745  *
27746  * Implementors of cancellable asynchronous functions should use this in
27747  * order to provide a guarantee to their callers that cancelling an
27748  * async operation will reliably result in an error being returned for
27749  * that operation (even if a positive result for the operation has
27750  * already been sent as an idle to the main context to be dispatched).
27751  *
27752  * The checking described above is done regardless of any call to the
27753  * unrelated g_simple_async_result_set_handle_cancellation() function.
27754  *
27755  * Since: 2.32
27756  */
27757
27758
27759 /**
27760  * g_simple_async_result_set_error: (skip)
27761  * @simple: a #GSimpleAsyncResult.
27762  * @domain: a #GQuark (usually #G_IO_ERROR).
27763  * @code: an error code.
27764  * @format: a formatted error reporting string.
27765  * @...: a list of variables to fill in @format.
27766  *
27767  * Sets an error within the asynchronous result without a #GError.
27768  */
27769
27770
27771 /**
27772  * g_simple_async_result_set_error_va: (skip)
27773  * @simple: a #GSimpleAsyncResult.
27774  * @domain: a #GQuark (usually #G_IO_ERROR).
27775  * @code: an error code.
27776  * @format: a formatted error reporting string.
27777  * @args: va_list of arguments.
27778  *
27779  * Sets an error within the asynchronous result without a #GError.
27780  * Unless writing a binding, see g_simple_async_result_set_error().
27781  */
27782
27783
27784 /**
27785  * g_simple_async_result_set_from_error:
27786  * @simple: a #GSimpleAsyncResult.
27787  * @error: #GError.
27788  *
27789  * Sets the result from a #GError.
27790  */
27791
27792
27793 /**
27794  * g_simple_async_result_set_handle_cancellation:
27795  * @simple: a #GSimpleAsyncResult.
27796  * @handle_cancellation: a #gboolean.
27797  *
27798  * Sets whether to handle cancellation within the asynchronous operation.
27799  *
27800  * This function has nothing to do with
27801  * g_simple_async_result_set_check_cancellable().  It only refers to the
27802  * #GCancellable passed to g_simple_async_result_run_in_thread().
27803  */
27804
27805
27806 /**
27807  * g_simple_async_result_set_op_res_gboolean:
27808  * @simple: a #GSimpleAsyncResult.
27809  * @op_res: a #gboolean.
27810  *
27811  * Sets the operation result to a boolean within the asynchronous result.
27812  */
27813
27814
27815 /**
27816  * g_simple_async_result_set_op_res_gpointer: (skip)
27817  * @simple: a #GSimpleAsyncResult.
27818  * @op_res: a pointer result from an asynchronous function.
27819  * @destroy_op_res: a #GDestroyNotify function.
27820  *
27821  * Sets the operation result within the asynchronous result to a pointer.
27822  */
27823
27824
27825 /**
27826  * g_simple_async_result_set_op_res_gssize:
27827  * @simple: a #GSimpleAsyncResult.
27828  * @op_res: a #gssize.
27829  *
27830  * Sets the operation result within the asynchronous result to
27831  * the given @op_res.
27832  */
27833
27834
27835 /**
27836  * g_simple_async_result_take_error: (skip)
27837  * @simple: a #GSimpleAsyncResult
27838  * @error: a #GError
27839  *
27840  * Sets the result from @error, and takes over the caller's ownership
27841  * of @error, so the caller does not need to free it any more.
27842  *
27843  * Since: 2.28
27844  */
27845
27846
27847 /**
27848  * g_simple_permission_new:
27849  * @allowed: %TRUE if the action is allowed
27850  *
27851  * Creates a new #GPermission instance that represents an action that is
27852  * either always or never allowed.
27853  *
27854  * Returns: the #GSimplePermission, as a #GPermission
27855  * Since: 2.26
27856  */
27857
27858
27859 /**
27860  * g_socket_accept:
27861  * @socket: a #GSocket.
27862  * @cancellable: (allow-none): a %GCancellable or %NULL
27863  * @error: #GError for error reporting, or %NULL to ignore.
27864  *
27865  * Accept incoming connections on a connection-based socket. This removes
27866  * the first outstanding connection request from the listening socket and
27867  * creates a #GSocket object for it.
27868  *
27869  * The @socket must be bound to a local address with g_socket_bind() and
27870  * must be listening for incoming connections (g_socket_listen()).
27871  *
27872  * If there are no outstanding connections then the operation will block
27873  * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27874  * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27875  *
27876  * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27877  * Since: 2.22
27878  */
27879
27880
27881 /**
27882  * g_socket_address_enumerator_next:
27883  * @enumerator: a #GSocketAddressEnumerator
27884  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27885  * @error: a #GError.
27886  *
27887  * Retrieves the next #GSocketAddress from @enumerator. Note that this
27888  * may block for some amount of time. (Eg, a #GNetworkAddress may need
27889  * to do a DNS lookup before it can return an address.) Use
27890  * g_socket_address_enumerator_next_async() if you need to avoid
27891  * blocking.
27892  *
27893  * If @enumerator is expected to yield addresses, but for some reason
27894  * is unable to (eg, because of a DNS error), then the first call to
27895  * g_socket_address_enumerator_next() will return an appropriate error
27896  * in *@error. However, if the first call to
27897  * g_socket_address_enumerator_next() succeeds, then any further
27898  * internal errors (other than @cancellable being triggered) will be
27899  * ignored.
27900  *
27901  * 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.
27902  */
27903
27904
27905 /**
27906  * g_socket_address_enumerator_next_async:
27907  * @enumerator: a #GSocketAddressEnumerator
27908  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27909  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27910  * @user_data: (closure): the data to pass to callback function
27911  *
27912  * Asynchronously retrieves the next #GSocketAddress from @enumerator
27913  * and then calls @callback, which must call
27914  * g_socket_address_enumerator_next_finish() to get the result.
27915  */
27916
27917
27918 /**
27919  * g_socket_address_enumerator_next_finish:
27920  * @enumerator: a #GSocketAddressEnumerator
27921  * @result: a #GAsyncResult
27922  * @error: a #GError
27923  *
27924  * Retrieves the result of a completed call to
27925  * g_socket_address_enumerator_next_async(). See
27926  * g_socket_address_enumerator_next() for more information about
27927  * error handling.
27928  *
27929  * 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.
27930  */
27931
27932
27933 /**
27934  * g_socket_address_get_family:
27935  * @address: a #GSocketAddress
27936  *
27937  * Gets the socket family type of @address.
27938  *
27939  * Returns: the socket family type of @address.
27940  * Since: 2.22
27941  */
27942
27943
27944 /**
27945  * g_socket_address_get_native_size:
27946  * @address: a #GSocketAddress
27947  *
27948  * Gets the size of @address's native <type>struct sockaddr</type>.
27949  * You can use this to allocate memory to pass to
27950  * g_socket_address_to_native().
27951  *
27952  * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27953  * Since: 2.22
27954  */
27955
27956
27957 /**
27958  * g_socket_address_new_from_native:
27959  * @native: a pointer to a <type>struct sockaddr</type>
27960  * @len: the size of the memory location pointed to by @native
27961  *
27962  * Creates a #GSocketAddress subclass corresponding to the native
27963  * <type>struct sockaddr</type> @native.
27964  *
27965  * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27966  * Since: 2.22
27967  */
27968
27969
27970 /**
27971  * g_socket_address_to_native:
27972  * @address: a #GSocketAddress
27973  * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27974  * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27975  * @error: #GError for error reporting, or %NULL to ignore.
27976  *
27977  * Converts a #GSocketAddress to a native <type>struct
27978  * sockaddr</type>, which can be passed to low-level functions like
27979  * connect() or bind().
27980  *
27981  * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27982  * returned. If the address type is not known on the system
27983  * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27984  *
27985  * Returns: %TRUE if @dest was filled in, %FALSE on error
27986  * Since: 2.22
27987  */
27988
27989
27990 /**
27991  * g_socket_bind:
27992  * @socket: a #GSocket.
27993  * @address: a #GSocketAddress specifying the local address.
27994  * @allow_reuse: whether to allow reusing this address
27995  * @error: #GError for error reporting, or %NULL to ignore.
27996  *
27997  * When a socket is created it is attached to an address family, but it
27998  * doesn't have an address in this family. g_socket_bind() assigns the
27999  * address (sometimes called name) of the socket.
28000  *
28001  * It is generally required to bind to a local address before you can
28002  * receive connections. (See g_socket_listen() and g_socket_accept() ).
28003  * In certain situations, you may also want to bind a socket that will be
28004  * used to initiate connections, though this is not normally required.
28005  *
28006  * @allow_reuse should be %TRUE for server sockets (sockets that you will
28007  * eventually call g_socket_accept() on), and %FALSE for client sockets.
28008  * (Specifically, if it is %TRUE, then g_socket_bind() will set the
28009  * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
28010  * that address was previously used by another socket that has not yet been
28011  * fully cleaned-up by the kernel. Failing to set this flag on a server
28012  * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
28013  * the server program is stopped and then immediately restarted.)
28014  *
28015  * Returns: %TRUE on success, %FALSE on error.
28016  * Since: 2.22
28017  */
28018
28019
28020 /**
28021  * g_socket_check_connect_result:
28022  * @socket: a #GSocket
28023  * @error: #GError for error reporting, or %NULL to ignore.
28024  *
28025  * Checks and resets the pending connect error for the socket.
28026  * This is used to check for errors when g_socket_connect() is
28027  * used in non-blocking mode.
28028  *
28029  * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28030  * Since: 2.22
28031  */
28032
28033
28034 /**
28035  * g_socket_client_add_application_proxy:
28036  * @client: a #GSocketClient
28037  * @protocol: The proxy protocol
28038  *
28039  * Enable proxy protocols to be handled by the application. When the
28040  * indicated proxy protocol is returned by the #GProxyResolver,
28041  * #GSocketClient will consider this protocol as supported but will
28042  * not try to find a #GProxy instance to handle handshaking. The
28043  * application must check for this case by calling
28044  * g_socket_connection_get_remote_address() on the returned
28045  * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28046  * appropriate type, to determine whether or not it needs to handle
28047  * the proxy handshaking itself.
28048  *
28049  * This should be used for proxy protocols that are dialects of
28050  * another protocol such as HTTP proxy. It also allows cohabitation of
28051  * proxy protocols that are reused between protocols. A good example
28052  * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28053  * be use as generic socket proxy through the HTTP CONNECT method.
28054  *
28055  * When the proxy is detected as being an application proxy, TLS handshake
28056  * will be skipped. This is required to let the application do the proxy
28057  * specific handshake.
28058  */
28059
28060
28061 /**
28062  * g_socket_client_connect:
28063  * @client: a #GSocketClient.
28064  * @connectable: a #GSocketConnectable specifying the remote address.
28065  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28066  * @error: #GError for error reporting, or %NULL to ignore.
28067  *
28068  * Tries to resolve the @connectable and make a network connection to it.
28069  *
28070  * Upon a successful connection, a new #GSocketConnection is constructed
28071  * and returned.  The caller owns this new object and must drop their
28072  * reference to it when finished with it.
28073  *
28074  * The type of the #GSocketConnection object returned depends on the type of
28075  * the underlying socket that is used. For instance, for a TCP/IP connection
28076  * it will be a #GTcpConnection.
28077  *
28078  * The socket created will be the same family as the address that the
28079  * @connectable resolves to, unless family is set with g_socket_client_set_family()
28080  * or indirectly via g_socket_client_set_local_address(). The socket type
28081  * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28082  * g_socket_client_set_socket_type().
28083  *
28084  * If a local address is specified with g_socket_client_set_local_address() the
28085  * socket will be bound to this address before connecting.
28086  *
28087  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28088  * Since: 2.22
28089  */
28090
28091
28092 /**
28093  * g_socket_client_connect_async:
28094  * @client: a #GSocketClient
28095  * @connectable: a #GSocketConnectable specifying the remote address.
28096  * @cancellable: (allow-none): a #GCancellable, or %NULL
28097  * @callback: (scope async): a #GAsyncReadyCallback
28098  * @user_data: (closure): user data for the callback
28099  *
28100  * This is the asynchronous version of g_socket_client_connect().
28101  *
28102  * When the operation is finished @callback will be
28103  * called. You can then call g_socket_client_connect_finish() to get
28104  * the result of the operation.
28105  *
28106  * Since: 2.22
28107  */
28108
28109
28110 /**
28111  * g_socket_client_connect_finish:
28112  * @client: a #GSocketClient.
28113  * @result: a #GAsyncResult.
28114  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28115  *
28116  * Finishes an async connect operation. See g_socket_client_connect_async()
28117  *
28118  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28119  * Since: 2.22
28120  */
28121
28122
28123 /**
28124  * g_socket_client_connect_to_host:
28125  * @client: a #GSocketClient
28126  * @host_and_port: the name and optionally port of the host to connect to
28127  * @default_port: the default port to connect to
28128  * @cancellable: (allow-none): a #GCancellable, or %NULL
28129  * @error: a pointer to a #GError, or %NULL
28130  *
28131  * This is a helper function for g_socket_client_connect().
28132  *
28133  * Attempts to create a TCP connection to the named host.
28134  *
28135  * @host_and_port may be in any of a number of recognized formats; an IPv6
28136  * address, an IPv4 address, or a domain name (in which case a DNS
28137  * lookup is performed).  Quoting with [] is supported for all address
28138  * types.  A port override may be specified in the usual way with a
28139  * colon.  Ports may be given as decimal numbers or symbolic names (in
28140  * which case an /etc/services lookup is performed).
28141  *
28142  * If no port override is given in @host_and_port then @default_port will be
28143  * used as the port number to connect to.
28144  *
28145  * In general, @host_and_port is expected to be provided by the user (allowing
28146  * them to give the hostname, and a port override if necessary) and
28147  * @default_port is expected to be provided by the application.
28148  *
28149  * In the case that an IP address is given, a single connection
28150  * attempt is made.  In the case that a name is given, multiple
28151  * connection attempts may be made, in turn and according to the
28152  * number of address records in DNS, until a connection succeeds.
28153  *
28154  * Upon a successful connection, a new #GSocketConnection is constructed
28155  * and returned.  The caller owns this new object and must drop their
28156  * reference to it when finished with it.
28157  *
28158  * In the event of any failure (DNS error, service not found, no hosts
28159  * connectable) %NULL is returned and @error (if non-%NULL) is set
28160  * accordingly.
28161  *
28162  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28163  * Since: 2.22
28164  */
28165
28166
28167 /**
28168  * g_socket_client_connect_to_host_async:
28169  * @client: a #GSocketClient
28170  * @host_and_port: the name and optionally the port of the host to connect to
28171  * @default_port: the default port to connect to
28172  * @cancellable: (allow-none): a #GCancellable, or %NULL
28173  * @callback: (scope async): a #GAsyncReadyCallback
28174  * @user_data: (closure): user data for the callback
28175  *
28176  * This is the asynchronous version of g_socket_client_connect_to_host().
28177  *
28178  * When the operation is finished @callback will be
28179  * called. You can then call g_socket_client_connect_to_host_finish() to get
28180  * the result of the operation.
28181  *
28182  * Since: 2.22
28183  */
28184
28185
28186 /**
28187  * g_socket_client_connect_to_host_finish:
28188  * @client: a #GSocketClient.
28189  * @result: a #GAsyncResult.
28190  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28191  *
28192  * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28193  *
28194  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28195  * Since: 2.22
28196  */
28197
28198
28199 /**
28200  * g_socket_client_connect_to_service:
28201  * @client: a #GSocketConnection
28202  * @domain: a domain name
28203  * @service: the name of the service to connect to
28204  * @cancellable: (allow-none): a #GCancellable, or %NULL
28205  * @error: a pointer to a #GError, or %NULL
28206  *
28207  * Attempts to create a TCP connection to a service.
28208  *
28209  * This call looks up the SRV record for @service at @domain for the
28210  * "tcp" protocol.  It then attempts to connect, in turn, to each of
28211  * the hosts providing the service until either a connection succeeds
28212  * or there are no hosts remaining.
28213  *
28214  * Upon a successful connection, a new #GSocketConnection is constructed
28215  * and returned.  The caller owns this new object and must drop their
28216  * reference to it when finished with it.
28217  *
28218  * In the event of any failure (DNS error, service not found, no hosts
28219  * connectable) %NULL is returned and @error (if non-%NULL) is set
28220  * accordingly.
28221  *
28222  * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28223  */
28224
28225
28226 /**
28227  * g_socket_client_connect_to_service_async:
28228  * @client: a #GSocketClient
28229  * @domain: a domain name
28230  * @service: the name of the service to connect to
28231  * @cancellable: (allow-none): a #GCancellable, or %NULL
28232  * @callback: (scope async): a #GAsyncReadyCallback
28233  * @user_data: (closure): user data for the callback
28234  *
28235  * This is the asynchronous version of
28236  * g_socket_client_connect_to_service().
28237  *
28238  * Since: 2.22
28239  */
28240
28241
28242 /**
28243  * g_socket_client_connect_to_service_finish:
28244  * @client: a #GSocketClient.
28245  * @result: a #GAsyncResult.
28246  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28247  *
28248  * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28249  *
28250  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28251  * Since: 2.22
28252  */
28253
28254
28255 /**
28256  * g_socket_client_connect_to_uri:
28257  * @client: a #GSocketClient
28258  * @uri: A network URI
28259  * @default_port: the default port to connect to
28260  * @cancellable: (allow-none): a #GCancellable, or %NULL
28261  * @error: a pointer to a #GError, or %NULL
28262  *
28263  * This is a helper function for g_socket_client_connect().
28264  *
28265  * Attempts to create a TCP connection with a network URI.
28266  *
28267  * @uri may be any valid URI containing an "authority" (hostname/port)
28268  * component. If a port is not specified in the URI, @default_port
28269  * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28270  * (#GSocketClient does not know to automatically assume TLS for
28271  * certain URI schemes.)
28272  *
28273  * Using this rather than g_socket_client_connect() or
28274  * g_socket_client_connect_to_host() allows #GSocketClient to
28275  * determine when to use application-specific proxy protocols.
28276  *
28277  * Upon a successful connection, a new #GSocketConnection is constructed
28278  * and returned.  The caller owns this new object and must drop their
28279  * reference to it when finished with it.
28280  *
28281  * In the event of any failure (DNS error, service not found, no hosts
28282  * connectable) %NULL is returned and @error (if non-%NULL) is set
28283  * accordingly.
28284  *
28285  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28286  * Since: 2.26
28287  */
28288
28289
28290 /**
28291  * g_socket_client_connect_to_uri_async:
28292  * @client: a #GSocketClient
28293  * @uri: a network uri
28294  * @default_port: the default port to connect to
28295  * @cancellable: (allow-none): a #GCancellable, or %NULL
28296  * @callback: (scope async): a #GAsyncReadyCallback
28297  * @user_data: (closure): user data for the callback
28298  *
28299  * This is the asynchronous version of g_socket_client_connect_to_uri().
28300  *
28301  * When the operation is finished @callback will be
28302  * called. You can then call g_socket_client_connect_to_uri_finish() to get
28303  * the result of the operation.
28304  *
28305  * Since: 2.26
28306  */
28307
28308
28309 /**
28310  * g_socket_client_connect_to_uri_finish:
28311  * @client: a #GSocketClient.
28312  * @result: a #GAsyncResult.
28313  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28314  *
28315  * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28316  *
28317  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28318  * Since: 2.26
28319  */
28320
28321
28322 /**
28323  * g_socket_client_get_enable_proxy:
28324  * @client: a #GSocketClient.
28325  *
28326  * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28327  *
28328  * Returns: whether proxying is enabled
28329  * Since: 2.26
28330  */
28331
28332
28333 /**
28334  * g_socket_client_get_family:
28335  * @client: a #GSocketClient.
28336  *
28337  * Gets the socket family of the socket client.
28338  *
28339  * See g_socket_client_set_family() for details.
28340  *
28341  * Returns: a #GSocketFamily
28342  * Since: 2.22
28343  */
28344
28345
28346 /**
28347  * g_socket_client_get_local_address:
28348  * @client: a #GSocketClient.
28349  *
28350  * Gets the local address of the socket client.
28351  *
28352  * See g_socket_client_set_local_address() for details.
28353  *
28354  * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28355  * Since: 2.22
28356  */
28357
28358
28359 /**
28360  * g_socket_client_get_protocol:
28361  * @client: a #GSocketClient
28362  *
28363  * Gets the protocol name type of the socket client.
28364  *
28365  * See g_socket_client_set_protocol() for details.
28366  *
28367  * Returns: a #GSocketProtocol
28368  * Since: 2.22
28369  */
28370
28371
28372 /**
28373  * g_socket_client_get_socket_type:
28374  * @client: a #GSocketClient.
28375  *
28376  * Gets the socket type of the socket client.
28377  *
28378  * See g_socket_client_set_socket_type() for details.
28379  *
28380  * Returns: a #GSocketFamily
28381  * Since: 2.22
28382  */
28383
28384
28385 /**
28386  * g_socket_client_get_timeout:
28387  * @client: a #GSocketClient
28388  *
28389  * Gets the I/O timeout time for sockets created by @client.
28390  *
28391  * See g_socket_client_set_timeout() for details.
28392  *
28393  * Returns: the timeout in seconds
28394  * Since: 2.26
28395  */
28396
28397
28398 /**
28399  * g_socket_client_get_tls:
28400  * @client: a #GSocketClient.
28401  *
28402  * Gets whether @client creates TLS connections. See
28403  * g_socket_client_set_tls() for details.
28404  *
28405  * Returns: whether @client uses TLS
28406  * Since: 2.28
28407  */
28408
28409
28410 /**
28411  * g_socket_client_get_tls_validation_flags:
28412  * @client: a #GSocketClient.
28413  *
28414  * Gets the TLS validation flags used creating TLS connections via
28415  * @client.
28416  *
28417  * Returns: the TLS validation flags
28418  * Since: 2.28
28419  */
28420
28421
28422 /**
28423  * g_socket_client_new:
28424  *
28425  * Creates a new #GSocketClient with the default options.
28426  *
28427  * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28428  * Since: 2.22
28429  */
28430
28431
28432 /**
28433  * g_socket_client_set_enable_proxy:
28434  * @client: a #GSocketClient.
28435  * @enable: whether to enable proxies
28436  *
28437  * Sets whether or not @client attempts to make connections via a
28438  * proxy server. When enabled (the default), #GSocketClient will use a
28439  * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28440  * needed, and automatically do the necessary proxy negotiation.
28441  *
28442  * Since: 2.26
28443  */
28444
28445
28446 /**
28447  * g_socket_client_set_family:
28448  * @client: a #GSocketClient.
28449  * @family: a #GSocketFamily
28450  *
28451  * Sets the socket family of the socket client.
28452  * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28453  * then the sockets created by this object will be of the specified
28454  * family.
28455  *
28456  * This might be useful for instance if you want to force the local
28457  * connection to be an ipv4 socket, even though the address might
28458  * be an ipv6 mapped to ipv4 address.
28459  *
28460  * Since: 2.22
28461  */
28462
28463
28464 /**
28465  * g_socket_client_set_local_address:
28466  * @client: a #GSocketClient.
28467  * @address: (allow-none): a #GSocketAddress, or %NULL
28468  *
28469  * Sets the local address of the socket client.
28470  * The sockets created by this object will bound to the
28471  * specified address (if not %NULL) before connecting.
28472  *
28473  * This is useful if you want to ensure that the local
28474  * side of the connection is on a specific port, or on
28475  * a specific interface.
28476  *
28477  * Since: 2.22
28478  */
28479
28480
28481 /**
28482  * g_socket_client_set_protocol:
28483  * @client: a #GSocketClient.
28484  * @protocol: a #GSocketProtocol
28485  *
28486  * Sets the protocol of the socket client.
28487  * The sockets created by this object will use of the specified
28488  * protocol.
28489  *
28490  * If @protocol is %0 that means to use the default
28491  * protocol for the socket family and type.
28492  *
28493  * Since: 2.22
28494  */
28495
28496
28497 /**
28498  * g_socket_client_set_socket_type:
28499  * @client: a #GSocketClient.
28500  * @type: a #GSocketType
28501  *
28502  * Sets the socket type of the socket client.
28503  * The sockets created by this object will be of the specified
28504  * type.
28505  *
28506  * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28507  * as GSocketClient is used for connection oriented services.
28508  *
28509  * Since: 2.22
28510  */
28511
28512
28513 /**
28514  * g_socket_client_set_timeout:
28515  * @client: a #GSocketClient.
28516  * @timeout: the timeout
28517  *
28518  * Sets the I/O timeout for sockets created by @client. @timeout is a
28519  * time in seconds, or 0 for no timeout (the default).
28520  *
28521  * The timeout value affects the initial connection attempt as well,
28522  * so setting this may cause calls to g_socket_client_connect(), etc,
28523  * to fail with %G_IO_ERROR_TIMED_OUT.
28524  *
28525  * Since: 2.26
28526  */
28527
28528
28529 /**
28530  * g_socket_client_set_tls:
28531  * @client: a #GSocketClient.
28532  * @tls: whether to use TLS
28533  *
28534  * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28535  * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28536  * and perform a TLS handshake when connecting.
28537  *
28538  * Note that since #GSocketClient must return a #GSocketConnection,
28539  * but #GTlsClientConnection is not a #GSocketConnection, this
28540  * actually wraps the resulting #GTlsClientConnection in a
28541  * #GTcpWrapperConnection when returning it. You can use
28542  * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28543  * to extract the #GTlsClientConnection.
28544  *
28545  * If you need to modify the behavior of the TLS handshake (eg, by
28546  * setting a client-side certificate to use, or connecting to the
28547  * #GTlsConnection::accept-certificate signal), you can connect to
28548  * @client's #GSocketClient::event signal and wait for it to be
28549  * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28550  * a chance to see the #GTlsClientConnection before the handshake
28551  * starts.
28552  *
28553  * Since: 2.28
28554  */
28555
28556
28557 /**
28558  * g_socket_client_set_tls_validation_flags:
28559  * @client: a #GSocketClient.
28560  * @flags: the validation flags
28561  *
28562  * Sets the TLS validation flags used when creating TLS connections
28563  * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28564  *
28565  * Since: 2.28
28566  */
28567
28568
28569 /**
28570  * g_socket_close:
28571  * @socket: a #GSocket
28572  * @error: #GError for error reporting, or %NULL to ignore.
28573  *
28574  * Closes the socket, shutting down any active connection.
28575  *
28576  * Closing a socket does not wait for all outstanding I/O operations
28577  * to finish, so the caller should not rely on them to be guaranteed
28578  * to complete even if the close returns with no error.
28579  *
28580  * Once the socket is closed, all other operations will return
28581  * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28582  * return an error.
28583  *
28584  * Sockets will be automatically closed when the last reference
28585  * is dropped, but you might want to call this function to make sure
28586  * resources are released as early as possible.
28587  *
28588  * Beware that due to the way that TCP works, it is possible for
28589  * recently-sent data to be lost if either you close a socket while the
28590  * %G_IO_IN condition is set, or else if the remote connection tries to
28591  * send something to you after you close the socket but before it has
28592  * finished reading all of the data you sent. There is no easy generic
28593  * way to avoid this problem; the easiest fix is to design the network
28594  * protocol such that the client will never send data "out of turn".
28595  * Another solution is for the server to half-close the connection by
28596  * calling g_socket_shutdown() with only the @shutdown_write flag set,
28597  * and then wait for the client to notice this and close its side of the
28598  * connection, after which the server can safely call g_socket_close().
28599  * (This is what #GTcpConnection does if you call
28600  * g_tcp_connection_set_graceful_disconnect(). But of course, this
28601  * only works if the client will close its connection after the server
28602  * does.)
28603  *
28604  * Returns: %TRUE on success, %FALSE on error
28605  * Since: 2.22
28606  */
28607
28608
28609 /**
28610  * g_socket_condition_check:
28611  * @socket: a #GSocket
28612  * @condition: a #GIOCondition mask to check
28613  *
28614  * Checks on the readiness of @socket to perform operations.
28615  * The operations specified in @condition are checked for and masked
28616  * against the currently-satisfied conditions on @socket. The result
28617  * is returned.
28618  *
28619  * Note that on Windows, it is possible for an operation to return
28620  * %G_IO_ERROR_WOULD_BLOCK even immediately after
28621  * g_socket_condition_check() has claimed that the socket is ready for
28622  * writing. Rather than calling g_socket_condition_check() and then
28623  * writing to the socket if it succeeds, it is generally better to
28624  * simply try writing to the socket right away, and try again later if
28625  * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28626  *
28627  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28628  * these conditions will always be set in the output if they are true.
28629  *
28630  * This call never blocks.
28631  *
28632  * Returns: the @GIOCondition mask of the current state
28633  * Since: 2.22
28634  */
28635
28636
28637 /**
28638  * g_socket_condition_timed_wait:
28639  * @socket: a #GSocket
28640  * @condition: a #GIOCondition mask to wait for
28641  * @timeout: the maximum time (in microseconds) to wait, or -1
28642  * @cancellable: (allow-none): a #GCancellable, or %NULL
28643  * @error: a #GError pointer, or %NULL
28644  *
28645  * Waits for up to @timeout microseconds for @condition to become true
28646  * on @socket. If the condition is met, %TRUE is returned.
28647  *
28648  * If @cancellable is cancelled before the condition is met, or if
28649  * @timeout (or the socket's #GSocket:timeout) is reached before the
28650  * condition is met, then %FALSE is returned and @error, if non-%NULL,
28651  * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28652  * %G_IO_ERROR_TIMED_OUT).
28653  *
28654  * If you don't want a timeout, use g_socket_condition_wait().
28655  * (Alternatively, you can pass -1 for @timeout.)
28656  *
28657  * Note that although @timeout is in microseconds for consistency with
28658  * other GLib APIs, this function actually only has millisecond
28659  * resolution, and the behavior is undefined if @timeout is not an
28660  * exact number of milliseconds.
28661  *
28662  * Returns: %TRUE if the condition was met, %FALSE otherwise
28663  * Since: 2.32
28664  */
28665
28666
28667 /**
28668  * g_socket_condition_wait:
28669  * @socket: a #GSocket
28670  * @condition: a #GIOCondition mask to wait for
28671  * @cancellable: (allow-none): a #GCancellable, or %NULL
28672  * @error: a #GError pointer, or %NULL
28673  *
28674  * Waits for @condition to become true on @socket. When the condition
28675  * is met, %TRUE is returned.
28676  *
28677  * If @cancellable is cancelled before the condition is met, or if the
28678  * socket has a timeout set and it is reached before the condition is
28679  * met, then %FALSE is returned and @error, if non-%NULL, is set to
28680  * the appropriate value (%G_IO_ERROR_CANCELLED or
28681  * %G_IO_ERROR_TIMED_OUT).
28682  *
28683  * See also g_socket_condition_timed_wait().
28684  *
28685  * Returns: %TRUE if the condition was met, %FALSE otherwise
28686  * Since: 2.22
28687  */
28688
28689
28690 /**
28691  * g_socket_connect:
28692  * @socket: a #GSocket.
28693  * @address: a #GSocketAddress specifying the remote address.
28694  * @cancellable: (allow-none): a %GCancellable or %NULL
28695  * @error: #GError for error reporting, or %NULL to ignore.
28696  *
28697  * Connect the socket to the specified remote address.
28698  *
28699  * For connection oriented socket this generally means we attempt to make
28700  * a connection to the @address. For a connection-less socket it sets
28701  * the default address for g_socket_send() and discards all incoming datagrams
28702  * from other sources.
28703  *
28704  * Generally connection oriented sockets can only connect once, but
28705  * connection-less sockets can connect multiple times to change the
28706  * default address.
28707  *
28708  * If the connect call needs to do network I/O it will block, unless
28709  * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28710  * and the user can be notified of the connection finishing by waiting
28711  * for the G_IO_OUT condition. The result of the connection must then be
28712  * checked with g_socket_check_connect_result().
28713  *
28714  * Returns: %TRUE if connected, %FALSE on error.
28715  * Since: 2.22
28716  */
28717
28718
28719 /**
28720  * g_socket_connectable_enumerate:
28721  * @connectable: a #GSocketConnectable
28722  *
28723  * Creates a #GSocketAddressEnumerator for @connectable.
28724  *
28725  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28726  * Since: 2.22
28727  */
28728
28729
28730 /**
28731  * g_socket_connectable_proxy_enumerate:
28732  * @connectable: a #GSocketConnectable
28733  *
28734  * Creates a #GSocketAddressEnumerator for @connectable that will
28735  * return #GProxyAddress<!-- -->es for addresses that you must connect
28736  * to via a proxy.
28737  *
28738  * If @connectable does not implement
28739  * g_socket_connectable_proxy_enumerate(), this will fall back to
28740  * calling g_socket_connectable_enumerate().
28741  *
28742  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28743  * Since: 2.26
28744  */
28745
28746
28747 /**
28748  * g_socket_connection_connect:
28749  * @connection: a #GSocketConnection
28750  * @address: a #GSocketAddress specifying the remote address.
28751  * @cancellable: (allow-none): a %GCancellable or %NULL
28752  * @error: #GError for error reporting, or %NULL to ignore.
28753  *
28754  * Connect @connection to the specified remote address.
28755  *
28756  * Returns: %TRUE if the connection succeeded, %FALSE on error
28757  * Since: 2.32
28758  */
28759
28760
28761 /**
28762  * g_socket_connection_connect_async:
28763  * @connection: a #GSocketConnection
28764  * @address: a #GSocketAddress specifying the remote address.
28765  * @cancellable: (allow-none): a %GCancellable or %NULL
28766  * @callback: (scope async): a #GAsyncReadyCallback
28767  * @user_data: (closure): user data for the callback
28768  *
28769  * Asynchronously connect @connection to the specified remote address.
28770  *
28771  * This clears the #GSocket:blocking flag on @connection's underlying
28772  * socket if it is currently set.
28773  *
28774  * Use g_socket_connection_connect_finish() to retrieve the result.
28775  *
28776  * Since: 2.32
28777  */
28778
28779
28780 /**
28781  * g_socket_connection_connect_finish:
28782  * @connection: a #GSocketConnection
28783  * @result: the #GAsyncResult
28784  * @error: #GError for error reporting, or %NULL to ignore.
28785  *
28786  * Gets the result of a g_socket_connection_connect_async() call.
28787  *
28788  * Returns: %TRUE if the connection succeeded, %FALSE on error
28789  * Since: 2.32
28790  */
28791
28792
28793 /**
28794  * g_socket_connection_factory_create_connection:
28795  * @socket: a #GSocket
28796  *
28797  * Creates a #GSocketConnection subclass of the right type for
28798  * @socket.
28799  *
28800  * Returns: (transfer full): a #GSocketConnection
28801  * Since: 2.22
28802  */
28803
28804
28805 /**
28806  * g_socket_connection_factory_lookup_type:
28807  * @family: a #GSocketFamily
28808  * @type: a #GSocketType
28809  * @protocol_id: a protocol id
28810  *
28811  * Looks up the #GType to be used when creating socket connections on
28812  * sockets with the specified @family, @type and @protocol_id.
28813  *
28814  * If no type is registered, the #GSocketConnection base type is returned.
28815  *
28816  * Returns: a #GType
28817  * Since: 2.22
28818  */
28819
28820
28821 /**
28822  * g_socket_connection_factory_register_type:
28823  * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28824  * @family: a #GSocketFamily
28825  * @type: a #GSocketType
28826  * @protocol: a protocol id
28827  *
28828  * Looks up the #GType to be used when creating socket connections on
28829  * sockets with the specified @family, @type and @protocol.
28830  *
28831  * If no type is registered, the #GSocketConnection base type is returned.
28832  *
28833  * Since: 2.22
28834  */
28835
28836
28837 /**
28838  * g_socket_connection_get_local_address:
28839  * @connection: a #GSocketConnection
28840  * @error: #GError for error reporting, or %NULL to ignore.
28841  *
28842  * Try to get the local address of a socket connection.
28843  *
28844  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28845  * Since: 2.22
28846  */
28847
28848
28849 /**
28850  * g_socket_connection_get_remote_address:
28851  * @connection: a #GSocketConnection
28852  * @error: #GError for error reporting, or %NULL to ignore.
28853  *
28854  * Try to get the remote address of a socket connection.
28855  *
28856  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28857  * Since: 2.22
28858  */
28859
28860
28861 /**
28862  * g_socket_connection_get_socket:
28863  * @connection: a #GSocketConnection
28864  *
28865  * Gets the underlying #GSocket object of the connection.
28866  * This can be useful if you want to do something unusual on it
28867  * not supported by the #GSocketConnection APIs.
28868  *
28869  * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28870  * Since: 2.22
28871  */
28872
28873
28874 /**
28875  * g_socket_connection_is_connected:
28876  * @connection: a #GSocketConnection
28877  *
28878  * Checks if @connection is connected. This is equivalent to calling
28879  * g_socket_is_connected() on @connection's underlying #GSocket.
28880  *
28881  * Returns: whether @connection is connected
28882  * Since: 2.32
28883  */
28884
28885
28886 /**
28887  * g_socket_control_message_deserialize:
28888  * @level: a socket level
28889  * @type: a socket control message type for the given @level
28890  * @size: the size of the data in bytes
28891  * @data: (array length=size) (element-type guint8): pointer to the message data
28892  *
28893  * Tries to deserialize a socket control message of a given
28894  * @level and @type. This will ask all known (to GType) subclasses
28895  * of #GSocketControlMessage if they can understand this kind
28896  * of message and if so deserialize it into a #GSocketControlMessage.
28897  *
28898  * If there is no implementation for this kind of control message, %NULL
28899  * will be returned.
28900  *
28901  * Returns: (transfer full): the deserialized message or %NULL
28902  * Since: 2.22
28903  */
28904
28905
28906 /**
28907  * g_socket_control_message_get_level:
28908  * @message: a #GSocketControlMessage
28909  *
28910  * Returns the "level" (i.e. the originating protocol) of the control message.
28911  * This is often SOL_SOCKET.
28912  *
28913  * Returns: an integer describing the level
28914  * Since: 2.22
28915  */
28916
28917
28918 /**
28919  * g_socket_control_message_get_msg_type:
28920  * @message: a #GSocketControlMessage
28921  *
28922  * Returns the protocol specific type of the control message.
28923  * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28924  *
28925  * Returns: an integer describing the type of control message
28926  * Since: 2.22
28927  */
28928
28929
28930 /**
28931  * g_socket_control_message_get_size:
28932  * @message: a #GSocketControlMessage
28933  *
28934  * Returns the space required for the control message, not including
28935  * headers or alignment.
28936  *
28937  * Returns: The number of bytes required.
28938  * Since: 2.22
28939  */
28940
28941
28942 /**
28943  * g_socket_control_message_serialize:
28944  * @message: a #GSocketControlMessage
28945  * @data: A buffer to write data to
28946  *
28947  * Converts the data in the message to bytes placed in the
28948  * message.
28949  *
28950  * @data is guaranteed to have enough space to fit the size
28951  * returned by g_socket_control_message_get_size() on this
28952  * object.
28953  *
28954  * Since: 2.22
28955  */
28956
28957
28958 /**
28959  * g_socket_create_source: (skip)
28960  * @socket: a #GSocket
28961  * @condition: a #GIOCondition mask to monitor
28962  * @cancellable: (allow-none): a %GCancellable or %NULL
28963  *
28964  * Creates a %GSource that can be attached to a %GMainContext to monitor
28965  * for the availibility of the specified @condition on the socket.
28966  *
28967  * The callback on the source is of the #GSocketSourceFunc type.
28968  *
28969  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28970  * these conditions will always be reported output if they are true.
28971  *
28972  * @cancellable if not %NULL can be used to cancel the source, which will
28973  * cause the source to trigger, reporting the current condition (which
28974  * is likely 0 unless cancellation happened at the same time as a
28975  * condition change). You can check for this in the callback using
28976  * g_cancellable_is_cancelled().
28977  *
28978  * If @socket has a timeout set, and it is reached before @condition
28979  * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28980  * %G_IO_OUT depending on @condition. However, @socket will have been
28981  * marked as having had a timeout, and so the next #GSocket I/O method
28982  * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28983  *
28984  * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
28985  * Since: 2.22
28986  */
28987
28988
28989 /**
28990  * g_socket_get_available_bytes:
28991  * @socket: a #GSocket
28992  *
28993  * Get the amount of data pending in the OS input buffer.
28994  *
28995  * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
28996  * Since: 2.32
28997  */
28998
28999
29000 /**
29001  * g_socket_get_blocking:
29002  * @socket: a #GSocket.
29003  *
29004  * Gets the blocking mode of the socket. For details on blocking I/O,
29005  * see g_socket_set_blocking().
29006  *
29007  * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29008  * Since: 2.22
29009  */
29010
29011
29012 /**
29013  * g_socket_get_broadcast:
29014  * @socket: a #GSocket.
29015  *
29016  * Gets the broadcast setting on @socket; if %TRUE,
29017  * it is possible to send packets to broadcast
29018  * addresses or receive from broadcast addresses.
29019  *
29020  * Returns: the broadcast setting on @socket
29021  * Since: 2.32
29022  */
29023
29024
29025 /**
29026  * g_socket_get_credentials:
29027  * @socket: a #GSocket.
29028  * @error: #GError for error reporting, or %NULL to ignore.
29029  *
29030  * Returns the credentials of the foreign process connected to this
29031  * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29032  * sockets).
29033  *
29034  * If this operation isn't supported on the OS, the method fails with
29035  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29036  * by reading the %SO_PEERCRED option on the underlying socket.
29037  *
29038  * Other ways to obtain credentials from a foreign peer includes the
29039  * #GUnixCredentialsMessage type and
29040  * g_unix_connection_send_credentials() /
29041  * g_unix_connection_receive_credentials() functions.
29042  *
29043  * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29044  * Since: 2.26
29045  */
29046
29047
29048 /**
29049  * g_socket_get_family:
29050  * @socket: a #GSocket.
29051  *
29052  * Gets the socket family of the socket.
29053  *
29054  * Returns: a #GSocketFamily
29055  * Since: 2.22
29056  */
29057
29058
29059 /**
29060  * g_socket_get_fd:
29061  * @socket: a #GSocket.
29062  *
29063  * Returns the underlying OS socket object. On unix this
29064  * is a socket file descriptor, and on Windows this is
29065  * a Winsock2 SOCKET handle. This may be useful for
29066  * doing platform specific or otherwise unusual operations
29067  * on the socket.
29068  *
29069  * Returns: the file descriptor of the socket.
29070  * Since: 2.22
29071  */
29072
29073
29074 /**
29075  * g_socket_get_keepalive:
29076  * @socket: a #GSocket.
29077  *
29078  * Gets the keepalive mode of the socket. For details on this,
29079  * see g_socket_set_keepalive().
29080  *
29081  * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29082  * Since: 2.22
29083  */
29084
29085
29086 /**
29087  * g_socket_get_listen_backlog:
29088  * @socket: a #GSocket.
29089  *
29090  * Gets the listen backlog setting of the socket. For details on this,
29091  * see g_socket_set_listen_backlog().
29092  *
29093  * Returns: the maximum number of pending connections.
29094  * Since: 2.22
29095  */
29096
29097
29098 /**
29099  * g_socket_get_local_address:
29100  * @socket: a #GSocket.
29101  * @error: #GError for error reporting, or %NULL to ignore.
29102  *
29103  * Try to get the local address of a bound socket. This is only
29104  * useful if the socket has been bound to a local address,
29105  * either explicitly or implicitly when connecting.
29106  *
29107  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29108  * Since: 2.22
29109  */
29110
29111
29112 /**
29113  * g_socket_get_multicast_loopback:
29114  * @socket: a #GSocket.
29115  *
29116  * Gets the multicast loopback setting on @socket; if %TRUE (the
29117  * default), outgoing multicast packets will be looped back to
29118  * multicast listeners on the same host.
29119  *
29120  * Returns: the multicast loopback setting on @socket
29121  * Since: 2.32
29122  */
29123
29124
29125 /**
29126  * g_socket_get_multicast_ttl:
29127  * @socket: a #GSocket.
29128  *
29129  * Gets the multicast time-to-live setting on @socket; see
29130  * g_socket_set_multicast_ttl() for more details.
29131  *
29132  * Returns: the multicast time-to-live setting on @socket
29133  * Since: 2.32
29134  */
29135
29136
29137 /**
29138  * g_socket_get_protocol:
29139  * @socket: a #GSocket.
29140  *
29141  * Gets the socket protocol id the socket was created with.
29142  * In case the protocol is unknown, -1 is returned.
29143  *
29144  * Returns: a protocol id, or -1 if unknown
29145  * Since: 2.22
29146  */
29147
29148
29149 /**
29150  * g_socket_get_remote_address:
29151  * @socket: a #GSocket.
29152  * @error: #GError for error reporting, or %NULL to ignore.
29153  *
29154  * Try to get the remove address of a connected socket. This is only
29155  * useful for connection oriented sockets that have been connected.
29156  *
29157  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29158  * Since: 2.22
29159  */
29160
29161
29162 /**
29163  * g_socket_get_socket_type:
29164  * @socket: a #GSocket.
29165  *
29166  * Gets the socket type of the socket.
29167  *
29168  * Returns: a #GSocketType
29169  * Since: 2.22
29170  */
29171
29172
29173 /**
29174  * g_socket_get_timeout:
29175  * @socket: a #GSocket.
29176  *
29177  * Gets the timeout setting of the socket. For details on this, see
29178  * g_socket_set_timeout().
29179  *
29180  * Returns: the timeout in seconds
29181  * Since: 2.26
29182  */
29183
29184
29185 /**
29186  * g_socket_get_ttl:
29187  * @socket: a #GSocket.
29188  *
29189  * Gets the unicast time-to-live setting on @socket; see
29190  * g_socket_set_ttl() for more details.
29191  *
29192  * Returns: the time-to-live setting on @socket
29193  * Since: 2.32
29194  */
29195
29196
29197 /**
29198  * g_socket_is_closed:
29199  * @socket: a #GSocket
29200  *
29201  * Checks whether a socket is closed.
29202  *
29203  * Returns: %TRUE if socket is closed, %FALSE otherwise
29204  * Since: 2.22
29205  */
29206
29207
29208 /**
29209  * g_socket_is_connected:
29210  * @socket: a #GSocket.
29211  *
29212  * Check whether the socket is connected. This is only useful for
29213  * connection-oriented sockets.
29214  *
29215  * Returns: %TRUE if socket is connected, %FALSE otherwise.
29216  * Since: 2.22
29217  */
29218
29219
29220 /**
29221  * g_socket_join_multicast_group:
29222  * @socket: a #GSocket.
29223  * @group: a #GInetAddress specifying the group address to join.
29224  * @iface: (allow-none): Name of the interface to use, or %NULL
29225  * @source_specific: %TRUE if source-specific multicast should be used
29226  * @error: #GError for error reporting, or %NULL to ignore.
29227  *
29228  * Registers @socket to receive multicast messages sent to @group.
29229  * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29230  * been bound to an appropriate interface and port with
29231  * g_socket_bind().
29232  *
29233  * If @iface is %NULL, the system will automatically pick an interface
29234  * to bind to based on @group.
29235  *
29236  * If @source_specific is %TRUE, source-specific multicast as defined
29237  * in RFC 4604 is used. Note that on older platforms this may fail
29238  * with a %G_IO_ERROR_NOT_SUPPORTED error.
29239  *
29240  * Returns: %TRUE on success, %FALSE on error.
29241  * Since: 2.32
29242  */
29243
29244
29245 /**
29246  * g_socket_leave_multicast_group:
29247  * @socket: a #GSocket.
29248  * @group: a #GInetAddress specifying the group address to leave.
29249  * @iface: (allow-none): Interface used
29250  * @source_specific: %TRUE if source-specific multicast was used
29251  * @error: #GError for error reporting, or %NULL to ignore.
29252  *
29253  * Removes @socket from the multicast group defined by @group, @iface,
29254  * and @source_specific (which must all have the same values they had
29255  * when you joined the group).
29256  *
29257  * @socket remains bound to its address and port, and can still receive
29258  * unicast messages after calling this.
29259  *
29260  * Returns: %TRUE on success, %FALSE on error.
29261  * Since: 2.32
29262  */
29263
29264
29265 /**
29266  * g_socket_listen:
29267  * @socket: a #GSocket.
29268  * @error: #GError for error reporting, or %NULL to ignore.
29269  *
29270  * Marks the socket as a server socket, i.e. a socket that is used
29271  * to accept incoming requests using g_socket_accept().
29272  *
29273  * Before calling this the socket must be bound to a local address using
29274  * g_socket_bind().
29275  *
29276  * To set the maximum amount of outstanding clients, use
29277  * g_socket_set_listen_backlog().
29278  *
29279  * Returns: %TRUE on success, %FALSE on error.
29280  * Since: 2.22
29281  */
29282
29283
29284 /**
29285  * g_socket_listener_accept:
29286  * @listener: a #GSocketListener
29287  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29288  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29289  * @error: #GError for error reporting, or %NULL to ignore.
29290  *
29291  * Blocks waiting for a client to connect to any of the sockets added
29292  * to the listener. Returns a #GSocketConnection for the socket that was
29293  * accepted.
29294  *
29295  * If @source_object is not %NULL it will be filled out with the source
29296  * object specified when the corresponding socket or address was added
29297  * to the listener.
29298  *
29299  * If @cancellable is not %NULL, then the operation can be cancelled by
29300  * triggering the cancellable object from another thread. If the operation
29301  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29302  *
29303  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29304  * Since: 2.22
29305  */
29306
29307
29308 /**
29309  * g_socket_listener_accept_async:
29310  * @listener: a #GSocketListener
29311  * @cancellable: (allow-none): a #GCancellable, or %NULL
29312  * @callback: (scope async): a #GAsyncReadyCallback
29313  * @user_data: (closure): user data for the callback
29314  *
29315  * This is the asynchronous version of g_socket_listener_accept().
29316  *
29317  * When the operation is finished @callback will be
29318  * called. You can then call g_socket_listener_accept_socket()
29319  * to get the result of the operation.
29320  *
29321  * Since: 2.22
29322  */
29323
29324
29325 /**
29326  * g_socket_listener_accept_finish:
29327  * @listener: a #GSocketListener
29328  * @result: a #GAsyncResult.
29329  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29330  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29331  *
29332  * Finishes an async accept operation. See g_socket_listener_accept_async()
29333  *
29334  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29335  * Since: 2.22
29336  */
29337
29338
29339 /**
29340  * g_socket_listener_accept_socket:
29341  * @listener: a #GSocketListener
29342  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29343  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29344  * @error: #GError for error reporting, or %NULL to ignore.
29345  *
29346  * Blocks waiting for a client to connect to any of the sockets added
29347  * to the listener. Returns the #GSocket that was accepted.
29348  *
29349  * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29350  * which is often the case, then you should use g_socket_listener_accept()
29351  * instead.
29352  *
29353  * If @source_object is not %NULL it will be filled out with the source
29354  * object specified when the corresponding socket or address was added
29355  * to the listener.
29356  *
29357  * If @cancellable is not %NULL, then the operation can be cancelled by
29358  * triggering the cancellable object from another thread. If the operation
29359  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29360  *
29361  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29362  * Since: 2.22
29363  */
29364
29365
29366 /**
29367  * g_socket_listener_accept_socket_async:
29368  * @listener: a #GSocketListener
29369  * @cancellable: (allow-none): a #GCancellable, or %NULL
29370  * @callback: (scope async): a #GAsyncReadyCallback
29371  * @user_data: (closure): user data for the callback
29372  *
29373  * This is the asynchronous version of g_socket_listener_accept_socket().
29374  *
29375  * When the operation is finished @callback will be
29376  * called. You can then call g_socket_listener_accept_socket_finish()
29377  * to get the result of the operation.
29378  *
29379  * Since: 2.22
29380  */
29381
29382
29383 /**
29384  * g_socket_listener_accept_socket_finish:
29385  * @listener: a #GSocketListener
29386  * @result: a #GAsyncResult.
29387  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29388  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29389  *
29390  * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29391  *
29392  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29393  * Since: 2.22
29394  */
29395
29396
29397 /**
29398  * g_socket_listener_add_address:
29399  * @listener: a #GSocketListener
29400  * @address: a #GSocketAddress
29401  * @type: a #GSocketType
29402  * @protocol: a #GSocketProtocol
29403  * @source_object: (allow-none): Optional #GObject identifying this source
29404  * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29405  * @error: #GError for error reporting, or %NULL to ignore.
29406  *
29407  * Creates a socket of type @type and protocol @protocol, binds
29408  * it to @address and adds it to the set of sockets we're accepting
29409  * sockets from.
29410  *
29411  * Note that adding an IPv6 address, depending on the platform,
29412  * may or may not result in a listener that also accepts IPv4
29413  * connections.  For more deterministic behavior, see
29414  * g_socket_listener_add_inet_port().
29415  *
29416  * @source_object will be passed out in the various calls
29417  * to accept to identify this particular source, which is
29418  * useful if you're listening on multiple addresses and do
29419  * different things depending on what address is connected to.
29420  *
29421  * If successful and @effective_address is non-%NULL then it will
29422  * be set to the address that the binding actually occurred at.  This
29423  * is helpful for determining the port number that was used for when
29424  * requesting a binding to port 0 (ie: "any port").  This address, if
29425  * requested, belongs to the caller and must be freed.
29426  *
29427  * Returns: %TRUE on success, %FALSE on error.
29428  * Since: 2.22
29429  */
29430
29431
29432 /**
29433  * g_socket_listener_add_any_inet_port:
29434  * @listener: a #GSocketListener
29435  * @source_object: (allow-none): Optional #GObject identifying this source
29436  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29437  *
29438  * Listens for TCP connections on any available port number for both
29439  * IPv6 and IPv4 (if each is available).
29440  *
29441  * This is useful if you need to have a socket for incoming connections
29442  * but don't care about the specific port number.
29443  *
29444  * @source_object will be passed out in the various calls
29445  * to accept to identify this particular source, which is
29446  * useful if you're listening on multiple addresses and do
29447  * different things depending on what address is connected to.
29448  *
29449  * Returns: the port number, or 0 in case of failure.
29450  * Since: 2.24
29451  */
29452
29453
29454 /**
29455  * g_socket_listener_add_inet_port:
29456  * @listener: a #GSocketListener
29457  * @port: an IP port number (non-zero)
29458  * @source_object: (allow-none): Optional #GObject identifying this source
29459  * @error: #GError for error reporting, or %NULL to ignore.
29460  *
29461  * Helper function for g_socket_listener_add_address() that
29462  * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29463  * supported) on the specified port on all interfaces.
29464  *
29465  * @source_object will be passed out in the various calls
29466  * to accept to identify this particular source, which is
29467  * useful if you're listening on multiple addresses and do
29468  * different things depending on what address is connected to.
29469  *
29470  * Returns: %TRUE on success, %FALSE on error.
29471  * Since: 2.22
29472  */
29473
29474
29475 /**
29476  * g_socket_listener_add_socket:
29477  * @listener: a #GSocketListener
29478  * @socket: a listening #GSocket
29479  * @source_object: (allow-none): Optional #GObject identifying this source
29480  * @error: #GError for error reporting, or %NULL to ignore.
29481  *
29482  * Adds @socket to the set of sockets that we try to accept
29483  * new clients from. The socket must be bound to a local
29484  * address and listened to.
29485  *
29486  * @source_object will be passed out in the various calls
29487  * to accept to identify this particular source, which is
29488  * useful if you're listening on multiple addresses and do
29489  * different things depending on what address is connected to.
29490  *
29491  * Returns: %TRUE on success, %FALSE on error.
29492  * Since: 2.22
29493  */
29494
29495
29496 /**
29497  * g_socket_listener_close:
29498  * @listener: a #GSocketListener
29499  *
29500  * Closes all the sockets in the listener.
29501  *
29502  * Since: 2.22
29503  */
29504
29505
29506 /**
29507  * g_socket_listener_new:
29508  *
29509  * Creates a new #GSocketListener with no sockets to listen for.
29510  * New listeners can be added with e.g. g_socket_listener_add_address()
29511  * or g_socket_listener_add_inet_port().
29512  *
29513  * Returns: a new #GSocketListener.
29514  * Since: 2.22
29515  */
29516
29517
29518 /**
29519  * g_socket_listener_set_backlog:
29520  * @listener: a #GSocketListener
29521  * @listen_backlog: an integer
29522  *
29523  * Sets the listen backlog on the sockets in the listener.
29524  *
29525  * See g_socket_set_listen_backlog() for details
29526  *
29527  * Since: 2.22
29528  */
29529
29530
29531 /**
29532  * g_socket_new:
29533  * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29534  * @type: the socket type to use.
29535  * @protocol: the id of the protocol to use, or 0 for default.
29536  * @error: #GError for error reporting, or %NULL to ignore.
29537  *
29538  * Creates a new #GSocket with the defined family, type and protocol.
29539  * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29540  * for the family and type is used.
29541  *
29542  * The @protocol is a family and type specific int that specifies what
29543  * kind of protocol to use. #GSocketProtocol lists several common ones.
29544  * Many families only support one protocol, and use 0 for this, others
29545  * support several and using 0 means to use the default protocol for
29546  * the family and type.
29547  *
29548  * The protocol id is passed directly to the operating
29549  * system, so you can use protocols not listed in #GSocketProtocol if you
29550  * know the protocol number used for it.
29551  *
29552  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29553  * Since: 2.22
29554  */
29555
29556
29557 /**
29558  * g_socket_new_from_fd:
29559  * @fd: a native socket file descriptor.
29560  * @error: #GError for error reporting, or %NULL to ignore.
29561  *
29562  * Creates a new #GSocket from a native file descriptor
29563  * or winsock SOCKET handle.
29564  *
29565  * This reads all the settings from the file descriptor so that
29566  * all properties should work. Note that the file descriptor
29567  * will be set to non-blocking mode, independent on the blocking
29568  * mode of the #GSocket.
29569  *
29570  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29571  * Since: 2.22
29572  */
29573
29574
29575 /**
29576  * g_socket_receive:
29577  * @socket: a #GSocket
29578  * @buffer: a buffer to read data into (which should be at least @size bytes long).
29579  * @size: the number of bytes you want to read from the socket
29580  * @cancellable: (allow-none): a %GCancellable or %NULL
29581  * @error: #GError for error reporting, or %NULL to ignore.
29582  *
29583  * Receive data (up to @size bytes) from a socket. This is mainly used by
29584  * connection-oriented sockets; it is identical to g_socket_receive_from()
29585  * with @address set to %NULL.
29586  *
29587  * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29588  * g_socket_receive() will always read either 0 or 1 complete messages from
29589  * the socket. If the received message is too large to fit in @buffer, then
29590  * the data beyond @size bytes will be discarded, without any explicit
29591  * indication that this has occurred.
29592  *
29593  * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29594  * number of bytes, up to @size. If more than @size bytes have been
29595  * received, the additional data will be returned in future calls to
29596  * g_socket_receive().
29597  *
29598  * If the socket is in blocking mode the call will block until there
29599  * is some data to receive, the connection is closed, or there is an
29600  * error. If there is no data available and the socket is in
29601  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29602  * returned. To be notified when data is available, wait for the
29603  * %G_IO_IN condition.
29604  *
29605  * On error -1 is returned and @error is set accordingly.
29606  *
29607  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29608  * Since: 2.22
29609  */
29610
29611
29612 /**
29613  * g_socket_receive_from:
29614  * @socket: a #GSocket
29615  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29616  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29617  * @size: the number of bytes you want to read from the socket
29618  * @cancellable: (allow-none): a %GCancellable or %NULL
29619  * @error: #GError for error reporting, or %NULL to ignore.
29620  *
29621  * Receive data (up to @size bytes) from a socket.
29622  *
29623  * If @address is non-%NULL then @address will be set equal to the
29624  * source address of the received packet.
29625  * @address is owned by the caller.
29626  *
29627  * See g_socket_receive() for additional information.
29628  *
29629  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29630  * Since: 2.22
29631  */
29632
29633
29634 /**
29635  * g_socket_receive_message:
29636  * @socket: a #GSocket
29637  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29638  * @vectors: (array length=num_vectors): an array of #GInputVector structs
29639  * @num_vectors: the number of elements in @vectors, or -1
29640  * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29641  * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29642  * @flags: a pointer to an int containing #GSocketMsgFlags flags
29643  * @cancellable: (allow-none): a %GCancellable or %NULL
29644  * @error: a #GError pointer, or %NULL
29645  *
29646  * Receive data from a socket.  This is the most complicated and
29647  * fully-featured version of this call. For easier use, see
29648  * g_socket_receive() and g_socket_receive_from().
29649  *
29650  * If @address is non-%NULL then @address will be set equal to the
29651  * source address of the received packet.
29652  * @address is owned by the caller.
29653  *
29654  * @vector must point to an array of #GInputVector structs and
29655  * @num_vectors must be the length of this array.  These structs
29656  * describe the buffers that received data will be scattered into.
29657  * If @num_vectors is -1, then @vectors is assumed to be terminated
29658  * by a #GInputVector with a %NULL buffer pointer.
29659  *
29660  * As a special case, if @num_vectors is 0 (in which case, @vectors
29661  * may of course be %NULL), then a single byte is received and
29662  * discarded. This is to facilitate the common practice of sending a
29663  * single '\0' byte for the purposes of transferring ancillary data.
29664  *
29665  * @messages, if non-%NULL, will be set to point to a newly-allocated
29666  * array of #GSocketControlMessage instances or %NULL if no such
29667  * messages was received. These correspond to the control messages
29668  * received from the kernel, one #GSocketControlMessage per message
29669  * from the kernel. This array is %NULL-terminated and must be freed
29670  * by the caller using g_free() after calling g_object_unref() on each
29671  * element. If @messages is %NULL, any control messages received will
29672  * be discarded.
29673  *
29674  * @num_messages, if non-%NULL, will be set to the number of control
29675  * messages received.
29676  *
29677  * If both @messages and @num_messages are non-%NULL, then
29678  * @num_messages gives the number of #GSocketControlMessage instances
29679  * in @messages (ie: not including the %NULL terminator).
29680  *
29681  * @flags is an in/out parameter. The commonly available arguments
29682  * for this are available in the #GSocketMsgFlags enum, but the
29683  * values there are the same as the system values, and the flags
29684  * are passed in as-is, so you can pass in system-specific flags too
29685  * (and g_socket_receive_message() may pass system-specific flags out).
29686  *
29687  * As with g_socket_receive(), data may be discarded if @socket is
29688  * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29689  * provide enough buffer space to read a complete message. You can pass
29690  * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29691  * removing it from the receive queue, but there is no portable way to find
29692  * out the length of the message other than by reading it into a
29693  * sufficiently-large buffer.
29694  *
29695  * If the socket is in blocking mode the call will block until there
29696  * is some data to receive, the connection is closed, or there is an
29697  * error. If there is no data available and the socket is in
29698  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29699  * returned. To be notified when data is available, wait for the
29700  * %G_IO_IN condition.
29701  *
29702  * On error -1 is returned and @error is set accordingly.
29703  *
29704  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29705  * Since: 2.22
29706  */
29707
29708
29709 /**
29710  * g_socket_receive_with_blocking:
29711  * @socket: a #GSocket
29712  * @buffer: a buffer to read data into (which should be at least @size bytes long).
29713  * @size: the number of bytes you want to read from the socket
29714  * @blocking: whether to do blocking or non-blocking I/O
29715  * @cancellable: (allow-none): a %GCancellable or %NULL
29716  * @error: #GError for error reporting, or %NULL to ignore.
29717  *
29718  * This behaves exactly the same as g_socket_receive(), except that
29719  * the choice of blocking or non-blocking behavior is determined by
29720  * the @blocking argument rather than by @socket's properties.
29721  *
29722  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29723  * Since: 2.26
29724  */
29725
29726
29727 /**
29728  * g_socket_send:
29729  * @socket: a #GSocket
29730  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29731  * @size: the number of bytes to send
29732  * @cancellable: (allow-none): a %GCancellable or %NULL
29733  * @error: #GError for error reporting, or %NULL to ignore.
29734  *
29735  * Tries to send @size bytes from @buffer on the socket. This is
29736  * mainly used by connection-oriented sockets; it is identical to
29737  * g_socket_send_to() with @address set to %NULL.
29738  *
29739  * If the socket is in blocking mode the call will block until there is
29740  * space for the data in the socket queue. If there is no space available
29741  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29742  * will be returned. To be notified when space is available, wait for the
29743  * %G_IO_OUT condition. Note though that you may still receive
29744  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29745  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29746  * very common due to the way the underlying APIs work.)
29747  *
29748  * On error -1 is returned and @error is set accordingly.
29749  *
29750  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29751  * Since: 2.22
29752  */
29753
29754
29755 /**
29756  * g_socket_send_message:
29757  * @socket: a #GSocket
29758  * @address: (allow-none): a #GSocketAddress, or %NULL
29759  * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29760  * @num_vectors: the number of elements in @vectors, or -1
29761  * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29762  * @num_messages: number of elements in @messages, or -1.
29763  * @flags: an int containing #GSocketMsgFlags flags
29764  * @cancellable: (allow-none): a %GCancellable or %NULL
29765  * @error: #GError for error reporting, or %NULL to ignore.
29766  *
29767  * Send data to @address on @socket.  This is the most complicated and
29768  * fully-featured version of this call. For easier use, see
29769  * g_socket_send() and g_socket_send_to().
29770  *
29771  * If @address is %NULL then the message is sent to the default receiver
29772  * (set by g_socket_connect()).
29773  *
29774  * @vectors must point to an array of #GOutputVector structs and
29775  * @num_vectors must be the length of this array. (If @num_vectors is -1,
29776  * then @vectors is assumed to be terminated by a #GOutputVector with a
29777  * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29778  * that the sent data will be gathered from. Using multiple
29779  * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29780  * data from multiple sources into a single buffer, and more
29781  * network-efficient than making multiple calls to g_socket_send().
29782  *
29783  * @messages, if non-%NULL, is taken to point to an array of @num_messages
29784  * #GSocketControlMessage instances. These correspond to the control
29785  * messages to be sent on the socket.
29786  * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29787  * array.
29788  *
29789  * @flags modify how the message is sent. The commonly available arguments
29790  * for this are available in the #GSocketMsgFlags enum, but the
29791  * values there are the same as the system values, and the flags
29792  * are passed in as-is, so you can pass in system-specific flags too.
29793  *
29794  * If the socket is in blocking mode the call will block until there is
29795  * space for the data in the socket queue. If there is no space available
29796  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29797  * will be returned. To be notified when space is available, wait for the
29798  * %G_IO_OUT condition. Note though that you may still receive
29799  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29800  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29801  * very common due to the way the underlying APIs work.)
29802  *
29803  * On error -1 is returned and @error is set accordingly.
29804  *
29805  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29806  * Since: 2.22
29807  */
29808
29809
29810 /**
29811  * g_socket_send_to:
29812  * @socket: a #GSocket
29813  * @address: (allow-none): a #GSocketAddress, or %NULL
29814  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29815  * @size: the number of bytes to send
29816  * @cancellable: (allow-none): a %GCancellable or %NULL
29817  * @error: #GError for error reporting, or %NULL to ignore.
29818  *
29819  * Tries to send @size bytes from @buffer to @address. If @address is
29820  * %NULL then the message is sent to the default receiver (set by
29821  * g_socket_connect()).
29822  *
29823  * See g_socket_send() for additional information.
29824  *
29825  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29826  * Since: 2.22
29827  */
29828
29829
29830 /**
29831  * g_socket_send_with_blocking:
29832  * @socket: a #GSocket
29833  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29834  * @size: the number of bytes to send
29835  * @blocking: whether to do blocking or non-blocking I/O
29836  * @cancellable: (allow-none): a %GCancellable or %NULL
29837  * @error: #GError for error reporting, or %NULL to ignore.
29838  *
29839  * This behaves exactly the same as g_socket_send(), except that
29840  * the choice of blocking or non-blocking behavior is determined by
29841  * the @blocking argument rather than by @socket's properties.
29842  *
29843  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29844  * Since: 2.26
29845  */
29846
29847
29848 /**
29849  * g_socket_service_is_active:
29850  * @service: a #GSocketService
29851  *
29852  * Check whether the service is active or not. An active
29853  * service will accept new clients that connect, while
29854  * a non-active service will let connecting clients queue
29855  * up until the service is started.
29856  *
29857  * Returns: %TRUE if the service is active, %FALSE otherwise
29858  * Since: 2.22
29859  */
29860
29861
29862 /**
29863  * g_socket_service_new:
29864  *
29865  * Creates a new #GSocketService with no sockets to listen for.
29866  * New listeners can be added with e.g. g_socket_listener_add_address()
29867  * or g_socket_listener_add_inet_port().
29868  *
29869  * Returns: a new #GSocketService.
29870  * Since: 2.22
29871  */
29872
29873
29874 /**
29875  * g_socket_service_start:
29876  * @service: a #GSocketService
29877  *
29878  * Starts the service, i.e. start accepting connections
29879  * from the added sockets when the mainloop runs.
29880  *
29881  * This call is thread-safe, so it may be called from a thread
29882  * handling an incoming client request.
29883  *
29884  * Since: 2.22
29885  */
29886
29887
29888 /**
29889  * g_socket_service_stop:
29890  * @service: a #GSocketService
29891  *
29892  * Stops the service, i.e. stops accepting connections
29893  * from the added sockets when the mainloop runs.
29894  *
29895  * This call is thread-safe, so it may be called from a thread
29896  * handling an incoming client request.
29897  *
29898  * Since: 2.22
29899  */
29900
29901
29902 /**
29903  * g_socket_set_blocking:
29904  * @socket: a #GSocket.
29905  * @blocking: Whether to use blocking I/O or not.
29906  *
29907  * Sets the blocking mode of the socket. In blocking mode
29908  * all operations block until they succeed or there is an error. In
29909  * non-blocking mode all functions return results immediately or
29910  * with a %G_IO_ERROR_WOULD_BLOCK error.
29911  *
29912  * All sockets are created in blocking mode. However, note that the
29913  * platform level socket is always non-blocking, and blocking mode
29914  * is a GSocket level feature.
29915  *
29916  * Since: 2.22
29917  */
29918
29919
29920 /**
29921  * g_socket_set_broadcast:
29922  * @socket: a #GSocket.
29923  * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29924  *
29925  * Sets whether @socket should allow sending to and receiving from
29926  * broadcast addresses. This is %FALSE by default.
29927  *
29928  * Since: 2.32
29929  */
29930
29931
29932 /**
29933  * g_socket_set_keepalive:
29934  * @socket: a #GSocket.
29935  * @keepalive: Value for the keepalive flag
29936  *
29937  * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29938  * this flag is set on a socket, the system will attempt to verify that the
29939  * remote socket endpoint is still present if a sufficiently long period of
29940  * time passes with no data being exchanged. If the system is unable to
29941  * verify the presence of the remote endpoint, it will automatically close
29942  * the connection.
29943  *
29944  * This option is only functional on certain kinds of sockets. (Notably,
29945  * %G_SOCKET_PROTOCOL_TCP sockets.)
29946  *
29947  * The exact time between pings is system- and protocol-dependent, but will
29948  * normally be at least two hours. Most commonly, you would set this flag
29949  * on a server socket if you want to allow clients to remain idle for long
29950  * periods of time, but also want to ensure that connections are eventually
29951  * garbage-collected if clients crash or become unreachable.
29952  *
29953  * Since: 2.22
29954  */
29955
29956
29957 /**
29958  * g_socket_set_listen_backlog:
29959  * @socket: a #GSocket.
29960  * @backlog: the maximum number of pending connections.
29961  *
29962  * Sets the maximum number of outstanding connections allowed
29963  * when listening on this socket. If more clients than this are
29964  * connecting to the socket and the application is not handling them
29965  * on time then the new connections will be refused.
29966  *
29967  * Note that this must be called before g_socket_listen() and has no
29968  * effect if called after that.
29969  *
29970  * Since: 2.22
29971  */
29972
29973
29974 /**
29975  * g_socket_set_multicast_loopback:
29976  * @socket: a #GSocket.
29977  * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29978  *
29979  * Sets whether outgoing multicast packets will be received by sockets
29980  * listening on that multicast address on the same host. This is %TRUE
29981  * by default.
29982  *
29983  * Since: 2.32
29984  */
29985
29986
29987 /**
29988  * g_socket_set_multicast_ttl:
29989  * @socket: a #GSocket.
29990  * @ttl: the time-to-live value for all multicast datagrams on @socket
29991  *
29992  * Sets the time-to-live for outgoing multicast datagrams on @socket.
29993  * By default, this is 1, meaning that multicast packets will not leave
29994  * the local network.
29995  *
29996  * Since: 2.32
29997  */
29998
29999
30000 /**
30001  * g_socket_set_timeout:
30002  * @socket: a #GSocket.
30003  * @timeout: the timeout for @socket, in seconds, or 0 for none
30004  *
30005  * Sets the time in seconds after which I/O operations on @socket will
30006  * time out if they have not yet completed.
30007  *
30008  * On a blocking socket, this means that any blocking #GSocket
30009  * operation will time out after @timeout seconds of inactivity,
30010  * returning %G_IO_ERROR_TIMED_OUT.
30011  *
30012  * On a non-blocking socket, calls to g_socket_condition_wait() will
30013  * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30014  * created with g_socket_create_source() will trigger after
30015  * @timeout seconds of inactivity, with the requested condition
30016  * set, at which point calling g_socket_receive(), g_socket_send(),
30017  * g_socket_check_connect_result(), etc, will fail with
30018  * %G_IO_ERROR_TIMED_OUT.
30019  *
30020  * If @timeout is 0 (the default), operations will never time out
30021  * on their own.
30022  *
30023  * Note that if an I/O operation is interrupted by a signal, this may
30024  * cause the timeout to be reset.
30025  *
30026  * Since: 2.26
30027  */
30028
30029
30030 /**
30031  * g_socket_set_ttl:
30032  * @socket: a #GSocket.
30033  * @ttl: the time-to-live value for all unicast packets on @socket
30034  *
30035  * Sets the time-to-live for outgoing unicast packets on @socket.
30036  * By default the platform-specific default value is used.
30037  *
30038  * Since: 2.32
30039  */
30040
30041
30042 /**
30043  * g_socket_shutdown:
30044  * @socket: a #GSocket
30045  * @shutdown_read: whether to shut down the read side
30046  * @shutdown_write: whether to shut down the write side
30047  * @error: #GError for error reporting, or %NULL to ignore.
30048  *
30049  * Shut down part of a full-duplex connection.
30050  *
30051  * If @shutdown_read is %TRUE then the receiving side of the connection
30052  * is shut down, and further reading is disallowed.
30053  *
30054  * If @shutdown_write is %TRUE then the sending side of the connection
30055  * is shut down, and further writing is disallowed.
30056  *
30057  * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30058  *
30059  * One example where this is used is graceful disconnect for TCP connections
30060  * where you close the sending side, then wait for the other side to close
30061  * the connection, thus ensuring that the other side saw all sent data.
30062  *
30063  * Returns: %TRUE on success, %FALSE on error
30064  * Since: 2.22
30065  */
30066
30067
30068 /**
30069  * g_socket_speaks_ipv4:
30070  * @socket: a #GSocket
30071  *
30072  * Checks if a socket is capable of speaking IPv4.
30073  *
30074  * IPv4 sockets are capable of speaking IPv4.  On some operating systems
30075  * and under some combinations of circumstances IPv6 sockets are also
30076  * capable of speaking IPv4.  See RFC 3493 section 3.7 for more
30077  * information.
30078  *
30079  * No other types of sockets are currently considered as being capable
30080  * of speaking IPv4.
30081  *
30082  * Returns: %TRUE if this socket can be used with IPv4.
30083  * Since: 2.22
30084  */
30085
30086
30087 /**
30088  * g_srv_target_copy:
30089  * @target: a #GSrvTarget
30090  *
30091  * Copies @target
30092  *
30093  * Returns: a copy of @target
30094  * Since: 2.22
30095  */
30096
30097
30098 /**
30099  * g_srv_target_free:
30100  * @target: a #GSrvTarget
30101  *
30102  * Frees @target
30103  *
30104  * Since: 2.22
30105  */
30106
30107
30108 /**
30109  * g_srv_target_get_hostname:
30110  * @target: a #GSrvTarget
30111  *
30112  * Gets @target's hostname (in ASCII form; if you are going to present
30113  * this to the user, you should use g_hostname_is_ascii_encoded() to
30114  * check if it contains encoded Unicode segments, and use
30115  * g_hostname_to_unicode() to convert it if it does.)
30116  *
30117  * Returns: @target's hostname
30118  * Since: 2.22
30119  */
30120
30121
30122 /**
30123  * g_srv_target_get_port:
30124  * @target: a #GSrvTarget
30125  *
30126  * Gets @target's port
30127  *
30128  * Returns: @target's port
30129  * Since: 2.22
30130  */
30131
30132
30133 /**
30134  * g_srv_target_get_priority:
30135  * @target: a #GSrvTarget
30136  *
30137  * Gets @target's priority. You should not need to look at this;
30138  * #GResolver already sorts the targets according to the algorithm in
30139  * RFC 2782.
30140  *
30141  * Returns: @target's priority
30142  * Since: 2.22
30143  */
30144
30145
30146 /**
30147  * g_srv_target_get_weight:
30148  * @target: a #GSrvTarget
30149  *
30150  * Gets @target's weight. You should not need to look at this;
30151  * #GResolver already sorts the targets according to the algorithm in
30152  * RFC 2782.
30153  *
30154  * Returns: @target's weight
30155  * Since: 2.22
30156  */
30157
30158
30159 /**
30160  * g_srv_target_list_sort: (skip)
30161  * @targets: a #GList of #GSrvTarget
30162  *
30163  * Sorts @targets in place according to the algorithm in RFC 2782.
30164  *
30165  * Returns: (transfer full): the head of the sorted list.
30166  * Since: 2.22
30167  */
30168
30169
30170 /**
30171  * g_srv_target_new:
30172  * @hostname: the host that the service is running on
30173  * @port: the port that the service is running on
30174  * @priority: the target's priority
30175  * @weight: the target's weight
30176  *
30177  * Creates a new #GSrvTarget with the given parameters.
30178  *
30179  * You should not need to use this; normally #GSrvTarget<!-- -->s are
30180  * created by #GResolver.
30181  *
30182  * Returns: a new #GSrvTarget.
30183  * Since: 2.22
30184  */
30185
30186
30187 /**
30188  * g_static_resource_fini:
30189  * @static_resource: pointer to a static #GStaticResource
30190  *
30191  * Finalized a GResource initialized by g_static_resource_init().
30192  *
30193  * This is normally used by code generated by
30194  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30195  * and is not typically used by other code.
30196  *
30197  * Since: 2.32
30198  */
30199
30200
30201 /**
30202  * g_static_resource_get_resource:
30203  * @static_resource: pointer to a static #GStaticResource
30204  *
30205  * Gets the GResource that was registered by a call to g_static_resource_init().
30206  *
30207  * This is normally used by code generated by
30208  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30209  * and is not typically used by other code.
30210  *
30211  * Returns: (transfer none): a #GResource
30212  * Since: 2.32
30213  */
30214
30215
30216 /**
30217  * g_static_resource_init:
30218  * @static_resource: pointer to a static #GStaticResource
30219  *
30220  * Initializes a GResource from static data using a
30221  * GStaticResource.
30222  *
30223  * This is normally used by code generated by
30224  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30225  * and is not typically used by other code.
30226  *
30227  * Since: 2.32
30228  */
30229
30230
30231 /**
30232  * g_tcp_connection_get_graceful_disconnect:
30233  * @connection: a #GTcpConnection
30234  *
30235  * Checks if graceful disconnects are used. See
30236  * g_tcp_connection_set_graceful_disconnect().
30237  *
30238  * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
30239  * Since: 2.22
30240  */
30241
30242
30243 /**
30244  * g_tcp_connection_set_graceful_disconnect:
30245  * @connection: a #GTcpConnection
30246  * @graceful_disconnect: Whether to do graceful disconnects or not
30247  *
30248  * This enabled graceful disconnects on close. A graceful disconnect
30249  * means that we signal the receiving end that the connection is terminated
30250  * and wait for it to close the connection before closing the connection.
30251  *
30252  * A graceful disconnect means that we can be sure that we successfully sent
30253  * all the outstanding data to the other end, or get an error reported.
30254  * However, it also means we have to wait for all the data to reach the
30255  * other side and for it to acknowledge this by closing the socket, which may
30256  * take a while. For this reason it is disabled by default.
30257  *
30258  * Since: 2.22
30259  */
30260
30261
30262 /**
30263  * g_tcp_wrapper_connection_get_base_io_stream:
30264  * @conn: a #GTcpWrapperConnection
30265  *
30266  * Get's @conn's base #GIOStream
30267  *
30268  * Returns: (transfer none): @conn's base #GIOStream
30269  */
30270
30271
30272 /**
30273  * g_tcp_wrapper_connection_new:
30274  * @base_io_stream: the #GIOStream to wrap
30275  * @socket: the #GSocket associated with @base_io_stream
30276  *
30277  * Wraps @base_io_stream and @socket together as a #GSocketConnection.
30278  *
30279  * Returns: the new #GSocketConnection.
30280  * Since: 2.28
30281  */
30282
30283
30284 /**
30285  * g_test_dbus_add_service_dir:
30286  * @self: a #GTestDBus
30287  * @path: path to a directory containing .service files
30288  *
30289  * Add a path where dbus-daemon will lookup for .services files. This can't be
30290  * called after g_test_dbus_up().
30291  */
30292
30293
30294 /**
30295  * g_test_dbus_down:
30296  * @self: a #GTestDBus
30297  *
30298  * Stop the session bus started by g_test_dbus_up().
30299  *
30300  * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30301  * is destroyed. This is done to ensure that the next unit test won't get a
30302  * leaked singleton from this test.
30303  */
30304
30305
30306 /**
30307  * g_test_dbus_get_bus_address:
30308  * @self: a #GTestDBus
30309  *
30310  * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30311  * been called yet, %NULL is returned. This can be used with
30312  * g_dbus_connection_new_for_address()
30313  *
30314  * Returns: the address of the bus, or %NULL.
30315  */
30316
30317
30318 /**
30319  * g_test_dbus_get_flags:
30320  * @self: a #GTestDBus
30321  *
30322  *
30323  *
30324  * Returns: the value of #GTestDBus:flags property
30325  */
30326
30327
30328 /**
30329  * g_test_dbus_new:
30330  * @flags: a #GTestDBusFlags
30331  *
30332  * Create a new #GTestDBus object.
30333  *
30334  * Returns: (transfer full): a new #GTestDBus.
30335  */
30336
30337
30338 /**
30339  * g_test_dbus_stop:
30340  * @self: a #GTestDBus
30341  *
30342  * Stop the session bus started by g_test_dbus_up().
30343  *
30344  * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30345  * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30346  * tests wanting to verify behaviour after the session bus has been stopped
30347  * can use this function but should still call g_test_dbus_down() when done.
30348  */
30349
30350
30351 /**
30352  * g_test_dbus_unset:
30353  *
30354  * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30355  * won't use user's session bus.
30356  *
30357  * This is useful for unit tests that want to verify behaviour when no session
30358  * bus is running. It is not necessary to call this if unit test already calls
30359  * g_test_dbus_up() before acquiring the session bus.
30360  */
30361
30362
30363 /**
30364  * g_test_dbus_up:
30365  * @self: a #GTestDBus
30366  *
30367  * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30368  * call, it is safe for unit tests to start sending messages on the session bug.
30369  *
30370  * If this function is called from setup callback of g_test_add(),
30371  * g_test_dbus_down() must be called in its teardown callback.
30372  *
30373  * If this function is called from unit test's main(), then g_test_dbus_down()
30374  * must be called after g_test_run().
30375  */
30376
30377
30378 /**
30379  * g_themed_icon_append_name:
30380  * @icon: a #GThemedIcon
30381  * @iconname: name of icon to append to list of icons from within @icon.
30382  *
30383  * Append a name to the list of icons from within @icon.
30384  *
30385  * <note><para>
30386  * Note that doing so invalidates the hash computed by prior calls
30387  * to g_icon_hash().
30388  * </para></note>
30389  */
30390
30391
30392 /**
30393  * g_themed_icon_get_names:
30394  * @icon: a #GThemedIcon.
30395  *
30396  * Gets the names of icons from within @icon.
30397  *
30398  * Returns: (transfer none): a list of icon names.
30399  */
30400
30401
30402 /**
30403  * g_themed_icon_new:
30404  * @iconname: a string containing an icon name.
30405  *
30406  * Creates a new themed icon for @iconname.
30407  *
30408  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30409  */
30410
30411
30412 /**
30413  * g_themed_icon_new_from_names:
30414  * @iconnames: (array length=len): an array of strings containing icon names.
30415  * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30416  *
30417  * Creates a new themed icon for @iconnames.
30418  *
30419  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30420  */
30421
30422
30423 /**
30424  * g_themed_icon_new_with_default_fallbacks:
30425  * @iconname: a string containing an icon name
30426  *
30427  * Creates a new themed icon for @iconname, and all the names
30428  * that can be created by shortening @iconname at '-' characters.
30429  *
30430  * In the following example, @icon1 and @icon2 are equivalent:
30431  * |[
30432  * const char *names[] = {
30433  *   "gnome-dev-cdrom-audio",
30434  *   "gnome-dev-cdrom",
30435  *   "gnome-dev",
30436  *   "gnome"
30437  * };
30438  *
30439  * icon1 = g_themed_icon_new_from_names (names, 4);
30440  * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30441  * ]|
30442  *
30443  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30444  */
30445
30446
30447 /**
30448  * g_themed_icon_prepend_name:
30449  * @icon: a #GThemedIcon
30450  * @iconname: name of icon to prepend to list of icons from within @icon.
30451  *
30452  * Prepend a name to the list of icons from within @icon.
30453  *
30454  * <note><para>
30455  * Note that doing so invalidates the hash computed by prior calls
30456  * to g_icon_hash().
30457  * </para></note>
30458  *
30459  * Since: 2.18
30460  */
30461
30462
30463 /**
30464  * g_threaded_socket_service_new:
30465  * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30466  *
30467  * Creates a new #GThreadedSocketService with no listeners. Listeners
30468  * must be added with one of the #GSocketListener "add" methods.
30469  *
30470  * Returns: a new #GSocketService.
30471  * Since: 2.22
30472  */
30473
30474
30475 /**
30476  * g_tls_backend_get_certificate_type:
30477  * @backend: the #GTlsBackend
30478  *
30479  * Gets the #GType of @backend's #GTlsCertificate implementation.
30480  *
30481  * Returns: the #GType of @backend's #GTlsCertificate implementation.
30482  * Since: 2.28
30483  */
30484
30485
30486 /**
30487  * g_tls_backend_get_client_connection_type:
30488  * @backend: the #GTlsBackend
30489  *
30490  * Gets the #GType of @backend's #GTlsClientConnection implementation.
30491  *
30492  * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30493  * Since: 2.28
30494  */
30495
30496
30497 /**
30498  * g_tls_backend_get_default:
30499  *
30500  * Gets the default #GTlsBackend for the system.
30501  *
30502  * Returns: (transfer none): a #GTlsBackend
30503  * Since: 2.28
30504  */
30505
30506
30507 /**
30508  * g_tls_backend_get_default_database:
30509  * @backend: the #GTlsBackend
30510  *
30511  * Gets the default #GTlsDatabase used to verify TLS connections.
30512  *
30513  * Returns: (transfer full): the default database, which should be unreffed when done.
30514  * Since: 2.30
30515  */
30516
30517
30518 /**
30519  * g_tls_backend_get_file_database_type:
30520  * @backend: the #GTlsBackend
30521  *
30522  * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30523  *
30524  * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30525  * Since: 2.30
30526  */
30527
30528
30529 /**
30530  * g_tls_backend_get_server_connection_type:
30531  * @backend: the #GTlsBackend
30532  *
30533  * Gets the #GType of @backend's #GTlsServerConnection implementation.
30534  *
30535  * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30536  * Since: 2.28
30537  */
30538
30539
30540 /**
30541  * g_tls_backend_supports_tls:
30542  * @backend: the #GTlsBackend
30543  *
30544  * Checks if TLS is supported; if this returns %FALSE for the default
30545  * #GTlsBackend, it means no "real" TLS backend is available.
30546  *
30547  * Returns: whether or not TLS is supported
30548  * Since: 2.28
30549  */
30550
30551
30552 /**
30553  * g_tls_certificate_get_issuer:
30554  * @cert: a #GTlsCertificate
30555  *
30556  * Gets the #GTlsCertificate representing @cert's issuer, if known
30557  *
30558  * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30559  * Since: 2.28
30560  */
30561
30562
30563 /**
30564  * g_tls_certificate_is_same:
30565  * @cert_one: first certificate to compare
30566  * @cert_two: second certificate to compare
30567  *
30568  * Check if two #GTlsCertificate objects represent the same certificate.
30569  * The raw DER byte data of the two certificates are checked for equality.
30570  * This has the effect that two certificates may compare equal even if
30571  * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
30572  * #GTlsCertificate:private-key-pem properties differ.
30573  *
30574  * Returns: whether the same or not
30575  * Since: 2.34
30576  */
30577
30578
30579 /**
30580  * g_tls_certificate_list_new_from_file:
30581  * @file: file containing PEM-encoded certificates to import
30582  * @error: #GError for error reporting, or %NULL to ignore.
30583  *
30584  * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30585  * data in @file. If @file cannot be read or parsed, the function will
30586  * return %NULL and set @error. If @file does not contain any
30587  * PEM-encoded certificates, this will return an empty list and not
30588  * set @error.
30589  *
30590  * 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.
30591  * Since: 2.28
30592  */
30593
30594
30595 /**
30596  * g_tls_certificate_new_from_file:
30597  * @file: file containing a PEM-encoded certificate to import
30598  * @error: #GError for error reporting, or %NULL to ignore.
30599  *
30600  * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30601  * @file cannot be read or parsed, the function will return %NULL and
30602  * set @error. Otherwise, this behaves like
30603  * g_tls_certificate_new_from_pem().
30604  *
30605  * Returns: the new certificate, or %NULL on error
30606  * Since: 2.28
30607  */
30608
30609
30610 /**
30611  * g_tls_certificate_new_from_files:
30612  * @cert_file: file containing a PEM-encoded certificate to import
30613  * @key_file: file containing a PEM-encoded private key to import
30614  * @error: #GError for error reporting, or %NULL to ignore.
30615  *
30616  * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30617  * and @key_file. If either file cannot be read or parsed, the
30618  * function will return %NULL and set @error. Otherwise, this behaves
30619  * like g_tls_certificate_new_from_pem().
30620  *
30621  * Returns: the new certificate, or %NULL on error
30622  * Since: 2.28
30623  */
30624
30625
30626 /**
30627  * g_tls_certificate_new_from_pem:
30628  * @data: PEM-encoded certificate data
30629  * @length: the length of @data, or -1 if it's 0-terminated.
30630  * @error: #GError for error reporting, or %NULL to ignore.
30631  *
30632  * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30633  * If @data includes both a certificate and a private key, then the
30634  * returned certificate will include the private key data as well. (See
30635  * the #GTlsCertificate:private-key-pem property for information about
30636  * supported formats.)
30637  *
30638  * If @data includes multiple certificates, only the first one will be
30639  * parsed.
30640  *
30641  * Returns: the new certificate, or %NULL if @data is invalid
30642  * Since: 2.28
30643  */
30644
30645
30646 /**
30647  * g_tls_certificate_verify:
30648  * @cert: a #GTlsCertificate
30649  * @identity: (allow-none): the expected peer identity
30650  * @trusted_ca: (allow-none): the certificate of a trusted authority
30651  *
30652  * This verifies @cert and returns a set of #GTlsCertificateFlags
30653  * indicating any problems found with it. This can be used to verify a
30654  * certificate outside the context of making a connection, or to
30655  * check a certificate against a CA that is not part of the system
30656  * CA database.
30657  *
30658  * If @identity is not %NULL, @cert's name(s) will be compared against
30659  * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30660  * value if it does not match. If @identity is %NULL, that bit will
30661  * never be set in the return value.
30662  *
30663  * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30664  * in its chain) must be signed by it, or else
30665  * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30666  * @trusted_ca is %NULL, that bit will never be set in the return
30667  * value.
30668  *
30669  * (All other #GTlsCertificateFlags values will always be set or unset
30670  * as appropriate.)
30671  *
30672  * Returns: the appropriate #GTlsCertificateFlags
30673  * Since: 2.28
30674  */
30675
30676
30677 /**
30678  * g_tls_client_connection_get_accepted_cas:
30679  * @conn: the #GTlsClientConnection
30680  *
30681  * Gets the list of distinguished names of the Certificate Authorities
30682  * that the server will accept certificates from. This will be set
30683  * during the TLS handshake if the server requests a certificate.
30684  * Otherwise, it will be %NULL.
30685  *
30686  * Each item in the list is a #GByteArray which contains the complete
30687  * subject DN of the certificate authority.
30688  *
30689  * 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().
30690  * Since: 2.28
30691  */
30692
30693
30694 /**
30695  * g_tls_client_connection_get_server_identity:
30696  * @conn: the #GTlsClientConnection
30697  *
30698  * Gets @conn's expected server identity
30699  *
30700  * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30701  * Since: 2.28
30702  */
30703
30704
30705 /**
30706  * g_tls_client_connection_get_use_ssl3:
30707  * @conn: the #GTlsClientConnection
30708  *
30709  * Gets whether @conn will use SSL 3.0 rather than the
30710  * highest-supported version of TLS; see
30711  * g_tls_client_connection_set_use_ssl3().
30712  *
30713  * Returns: whether @conn will use SSL 3.0
30714  * Since: 2.28
30715  */
30716
30717
30718 /**
30719  * g_tls_client_connection_get_validation_flags:
30720  * @conn: the #GTlsClientConnection
30721  *
30722  * Gets @conn's validation flags
30723  *
30724  * Returns: the validation flags
30725  * Since: 2.28
30726  */
30727
30728
30729 /**
30730  * g_tls_client_connection_new:
30731  * @base_io_stream: the #GIOStream to wrap
30732  * @server_identity: (allow-none): the expected identity of the server
30733  * @error: #GError for error reporting, or %NULL to ignore.
30734  *
30735  * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30736  * must have pollable input and output streams) which is assumed to
30737  * communicate with the server identified by @server_identity.
30738  *
30739  * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30740  * Since: 2.28
30741  */
30742
30743
30744 /**
30745  * g_tls_client_connection_set_server_identity:
30746  * @conn: the #GTlsClientConnection
30747  * @identity: a #GSocketConnectable describing the expected server identity
30748  *
30749  * Sets @conn's expected server identity, which is used both to tell
30750  * servers on virtual hosts which certificate to present, and also
30751  * to let @conn know what name to look for in the certificate when
30752  * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30753  *
30754  * Since: 2.28
30755  */
30756
30757
30758 /**
30759  * g_tls_client_connection_set_use_ssl3:
30760  * @conn: the #GTlsClientConnection
30761  * @use_ssl3: whether to use SSL 3.0
30762  *
30763  * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30764  * trying to properly negotiate the right version of TLS or SSL to use.
30765  * This can be used when talking to servers that do not implement the
30766  * fallbacks correctly and which will therefore fail to handshake with
30767  * a "modern" TLS handshake attempt.
30768  *
30769  * Since: 2.28
30770  */
30771
30772
30773 /**
30774  * g_tls_client_connection_set_validation_flags:
30775  * @conn: the #GTlsClientConnection
30776  * @flags: the #GTlsCertificateFlags to use
30777  *
30778  * Sets @conn's validation flags, to override the default set of
30779  * checks performed when validating a server certificate. By default,
30780  * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30781  *
30782  * Since: 2.28
30783  */
30784
30785
30786 /**
30787  * g_tls_connection_emit_accept_certificate:
30788  * @conn: a #GTlsConnection
30789  * @peer_cert: the peer's #GTlsCertificate
30790  * @errors: the problems with @peer_cert
30791  *
30792  * Used by #GTlsConnection implementations to emit the
30793  * #GTlsConnection::accept-certificate signal.
30794  *
30795  * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30796  * Since: 2.28
30797  */
30798
30799
30800 /**
30801  * g_tls_connection_get_certificate:
30802  * @conn: a #GTlsConnection
30803  *
30804  * Gets @conn's certificate, as set by
30805  * g_tls_connection_set_certificate().
30806  *
30807  * Returns: (transfer none): @conn's certificate, or %NULL
30808  * Since: 2.28
30809  */
30810
30811
30812 /**
30813  * g_tls_connection_get_database:
30814  * @conn: a #GTlsConnection
30815  *
30816  * Gets the certificate database that @conn uses to verify
30817  * peer certificates. See g_tls_connection_set_database().
30818  *
30819  * Returns: (transfer none): the certificate database that @conn uses or %NULL
30820  * Since: 2.30
30821  */
30822
30823
30824 /**
30825  * g_tls_connection_get_interaction:
30826  * @conn: a connection
30827  *
30828  * Get the object that will be used to interact with the user. It will be used
30829  * for things like prompting the user for passwords. If %NULL is returned, then
30830  * no user interaction will occur for this connection.
30831  *
30832  * Returns: (transfer none): The interaction object.
30833  * Since: 2.30
30834  */
30835
30836
30837 /**
30838  * g_tls_connection_get_peer_certificate:
30839  * @conn: a #GTlsConnection
30840  *
30841  * Gets @conn's peer's certificate after the handshake has completed.
30842  * (It is not set during the emission of
30843  * #GTlsConnection::accept-certificate.)
30844  *
30845  * Returns: (transfer none): @conn's peer's certificate, or %NULL
30846  * Since: 2.28
30847  */
30848
30849
30850 /**
30851  * g_tls_connection_get_peer_certificate_errors:
30852  * @conn: a #GTlsConnection
30853  *
30854  * Gets the errors associated with validating @conn's peer's
30855  * certificate, after the handshake has completed. (It is not set
30856  * during the emission of #GTlsConnection::accept-certificate.)
30857  *
30858  * Returns: @conn's peer's certificate errors
30859  * Since: 2.28
30860  */
30861
30862
30863 /**
30864  * g_tls_connection_get_rehandshake_mode:
30865  * @conn: a #GTlsConnection
30866  *
30867  * Gets @conn rehandshaking mode. See
30868  * g_tls_connection_set_rehandshake_mode() for details.
30869  *
30870  * Returns: @conn's rehandshaking mode
30871  * Since: 2.28
30872  */
30873
30874
30875 /**
30876  * g_tls_connection_get_require_close_notify:
30877  * @conn: a #GTlsConnection
30878  *
30879  * Tests whether or not @conn expects a proper TLS close notification
30880  * when the connection is closed. See
30881  * g_tls_connection_set_require_close_notify() for details.
30882  *
30883  * Returns: %TRUE if @conn requires a proper TLS close notification.
30884  * Since: 2.28
30885  */
30886
30887
30888 /**
30889  * g_tls_connection_get_use_system_certdb:
30890  * @conn: a #GTlsConnection
30891  *
30892  * Gets whether @conn uses the system certificate database to verify
30893  * peer certificates. See g_tls_connection_set_use_system_certdb().
30894  *
30895  * Returns: whether @conn uses the system certificate database
30896  * Deprecated: 2.30: Use g_tls_connection_get_database() instead
30897  */
30898
30899
30900 /**
30901  * g_tls_connection_handshake:
30902  * @conn: a #GTlsConnection
30903  * @cancellable: (allow-none): a #GCancellable, or %NULL
30904  * @error: a #GError, or %NULL
30905  *
30906  * Attempts a TLS handshake on @conn.
30907  *
30908  * On the client side, it is never necessary to call this method;
30909  * although the connection needs to perform a handshake after
30910  * connecting (or after sending a "STARTTLS"-type command) and may
30911  * need to rehandshake later if the server requests it,
30912  * #GTlsConnection will handle this for you automatically when you try
30913  * to send or receive data on the connection. However, you can call
30914  * g_tls_connection_handshake() manually if you want to know for sure
30915  * whether the initial handshake succeeded or failed (as opposed to
30916  * just immediately trying to write to @conn's output stream, in which
30917  * case if it fails, it may not be possible to tell if it failed
30918  * before or after completing the handshake).
30919  *
30920  * Likewise, on the server side, although a handshake is necessary at
30921  * the beginning of the communication, you do not need to call this
30922  * function explicitly unless you want clearer error reporting.
30923  * However, you may call g_tls_connection_handshake() later on to
30924  * renegotiate parameters (encryption methods, etc) with the client.
30925  *
30926  * #GTlsConnection::accept_certificate may be emitted during the
30927  * handshake.
30928  *
30929  * Returns: success or failure
30930  * Since: 2.28
30931  */
30932
30933
30934 /**
30935  * g_tls_connection_handshake_async:
30936  * @conn: a #GTlsConnection
30937  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
30938  * @cancellable: (allow-none): a #GCancellable, or %NULL
30939  * @callback: callback to call when the handshake is complete
30940  * @user_data: the data to pass to the callback function
30941  *
30942  * Asynchronously performs a TLS handshake on @conn. See
30943  * g_tls_connection_handshake() for more information.
30944  *
30945  * Since: 2.28
30946  */
30947
30948
30949 /**
30950  * g_tls_connection_handshake_finish:
30951  * @conn: a #GTlsConnection
30952  * @result: a #GAsyncResult.
30953  * @error: a #GError pointer, or %NULL
30954  *
30955  * Finish an asynchronous TLS handshake operation. See
30956  * g_tls_connection_handshake() for more information.
30957  *
30958  * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
30959  * Since: 2.28
30960  */
30961
30962
30963 /**
30964  * g_tls_connection_set_certificate:
30965  * @conn: a #GTlsConnection
30966  * @certificate: the certificate to use for @conn
30967  *
30968  * This sets the certificate that @conn will present to its peer
30969  * during the TLS handshake. For a #GTlsServerConnection, it is
30970  * mandatory to set this, and that will normally be done at construct
30971  * time.
30972  *
30973  * For a #GTlsClientConnection, this is optional. If a handshake fails
30974  * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
30975  * requires a certificate, and if you try connecting again, you should
30976  * call this method first. You can call
30977  * g_tls_client_connection_get_accepted_cas() on the failed connection
30978  * to get a list of Certificate Authorities that the server will
30979  * accept certificates from.
30980  *
30981  * (It is also possible that a server will allow the connection with
30982  * or without a certificate; in that case, if you don't provide a
30983  * certificate, you can tell that the server requested one by the fact
30984  * that g_tls_client_connection_get_accepted_cas() will return
30985  * non-%NULL.)
30986  *
30987  * Since: 2.28
30988  */
30989
30990
30991 /**
30992  * g_tls_connection_set_database:
30993  * @conn: a #GTlsConnection
30994  * @database: a #GTlsDatabase
30995  *
30996  * Sets the certificate database that is used to verify peer certificates.
30997  * This is set to the default database by default. See
30998  * g_tls_backend_get_default_database(). If set to %NULL, then
30999  * peer certificate validation will always set the
31000  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31001  * #GTlsConnection::accept-certificate will always be emitted on
31002  * client-side connections, unless that bit is not set in
31003  * #GTlsClientConnection:validation-flags).
31004  *
31005  * Since: 2.30
31006  */
31007
31008
31009 /**
31010  * g_tls_connection_set_interaction:
31011  * @conn: a connection
31012  * @interaction: (allow-none): an interaction object, or %NULL
31013  *
31014  * Set the object that will be used to interact with the user. It will be used
31015  * for things like prompting the user for passwords.
31016  *
31017  * The @interaction argument will normally be a derived subclass of
31018  * #GTlsInteraction. %NULL can also be provided if no user interaction
31019  * should occur for this connection.
31020  *
31021  * Since: 2.30
31022  */
31023
31024
31025 /**
31026  * g_tls_connection_set_rehandshake_mode:
31027  * @conn: a #GTlsConnection
31028  * @mode: the rehandshaking mode
31029  *
31030  * Sets how @conn behaves with respect to rehandshaking requests.
31031  *
31032  * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31033  * rehandshake after the initial handshake is complete. (For a client,
31034  * this means it will refuse rehandshake requests from the server, and
31035  * for a server, this means it will close the connection with an error
31036  * if the client attempts to rehandshake.)
31037  *
31038  * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31039  * rehandshake only if the other end of the connection supports the
31040  * TLS <literal>renegotiation_info</literal> extension. This is the
31041  * default behavior, but means that rehandshaking will not work
31042  * against older implementations that do not support that extension.
31043  *
31044  * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31045  * rehandshaking even without the
31046  * <literal>renegotiation_info</literal> extension. On the server side
31047  * in particular, this is not recommended, since it leaves the server
31048  * open to certain attacks. However, this mode is necessary if you
31049  * need to allow renegotiation with older client software.
31050  *
31051  * Since: 2.28
31052  */
31053
31054
31055 /**
31056  * g_tls_connection_set_require_close_notify:
31057  * @conn: a #GTlsConnection
31058  * @require_close_notify: whether or not to require close notification
31059  *
31060  * Sets whether or not @conn expects a proper TLS close notification
31061  * before the connection is closed. If this is %TRUE (the default),
31062  * then @conn will expect to receive a TLS close notification from its
31063  * peer before the connection is closed, and will return a
31064  * %G_TLS_ERROR_EOF error if the connection is closed without proper
31065  * notification (since this may indicate a network error, or
31066  * man-in-the-middle attack).
31067  *
31068  * In some protocols, the application will know whether or not the
31069  * connection was closed cleanly based on application-level data
31070  * (because the application-level data includes a length field, or is
31071  * somehow self-delimiting); in this case, the close notify is
31072  * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
31073  * in TLS 1.0 it is technically an error, but often done anyway.) You
31074  * can use g_tls_connection_set_require_close_notify() to tell @conn
31075  * to allow an "unannounced" connection close, in which case the close
31076  * will show up as a 0-length read, as in a non-TLS
31077  * #GSocketConnection, and it is up to the application to check that
31078  * the data has been fully received.
31079  *
31080  * Note that this only affects the behavior when the peer closes the
31081  * connection; when the application calls g_io_stream_close() itself
31082  * on @conn, this will send a close notification regardless of the
31083  * setting of this property. If you explicitly want to do an unclean
31084  * close, you can close @conn's #GTlsConnection:base-io-stream rather
31085  * than closing @conn itself.
31086  *
31087  * Since: 2.28
31088  */
31089
31090
31091 /**
31092  * g_tls_connection_set_use_system_certdb:
31093  * @conn: a #GTlsConnection
31094  * @use_system_certdb: whether to use the system certificate database
31095  *
31096  * Sets whether @conn uses the system certificate database to verify
31097  * peer certificates. This is %TRUE by default. If set to %FALSE, then
31098  * peer certificate validation will always set the
31099  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31100  * #GTlsConnection::accept-certificate will always be emitted on
31101  * client-side connections, unless that bit is not set in
31102  * #GTlsClientConnection:validation-flags).
31103  *
31104  * Deprecated: 2.30: Use g_tls_connection_set_database() instead
31105  */
31106
31107
31108 /**
31109  * g_tls_database_create_certificate_handle:
31110  * @self: a #GTlsDatabase
31111  * @certificate: certificate for which to create a handle.
31112  *
31113  * Create a handle string for the certificate. The database will only be able
31114  * to create a handle for certificates that originate from the database. In
31115  * cases where the database cannot create a handle for a certificate, %NULL
31116  * will be returned.
31117  *
31118  * This handle should be stable across various instances of the application,
31119  * and between applications. If a certificate is modified in the database,
31120  * then it is not guaranteed that this handle will continue to point to it.
31121  *
31122  * Returns: (allow-none): a newly allocated string containing the handle.
31123  * Since: 2.30
31124  */
31125
31126
31127 /**
31128  * g_tls_database_lookup_certificate_for_handle:
31129  * @self: a #GTlsDatabase
31130  * @handle: a certificate handle
31131  * @interaction: (allow-none): used to interact with the user if necessary
31132  * @flags: Flags which affect the lookup.
31133  * @cancellable: (allow-none): a #GCancellable, or %NULL
31134  * @error: (allow-none): a #GError, or %NULL
31135  *
31136  * Lookup a certificate by its handle.
31137  *
31138  * The handle should have been created by calling
31139  * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
31140  * the same TLS backend. The handle is designed to remain valid across
31141  * instantiations of the database.
31142  *
31143  * If the handle is no longer valid, or does not point to a certificate in
31144  * this database, then %NULL will be returned.
31145  *
31146  * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
31147  * the lookup operation asynchronously.
31148  *
31149  * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31150  * Since: 2.30
31151  */
31152
31153
31154 /**
31155  * g_tls_database_lookup_certificate_for_handle_async:
31156  * @self: a #GTlsDatabase
31157  * @handle: a certificate handle
31158  * @interaction: (allow-none): used to interact with the user if necessary
31159  * @flags: Flags which affect the lookup.
31160  * @cancellable: (allow-none): a #GCancellable, or %NULL
31161  * @callback: callback to call when the operation completes
31162  * @user_data: the data to pass to the callback function
31163  *
31164  * Asynchronously lookup a certificate by its handle in the database. See
31165  * g_tls_database_lookup_certificate_for_handle() for more information.
31166  *
31167  * Since: 2.30
31168  */
31169
31170
31171 /**
31172  * g_tls_database_lookup_certificate_for_handle_finish:
31173  * @self: a #GTlsDatabase
31174  * @result: a #GAsyncResult.
31175  * @error: a #GError pointer, or %NULL
31176  *
31177  * Finish an asynchronous lookup of a certificate by its handle. See
31178  * g_tls_database_lookup_certificate_handle() for more information.
31179  *
31180  * If the handle is no longer valid, or does not point to a certificate in
31181  * this database, then %NULL will be returned.
31182  *
31183  * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
31184  * Since: 2.30
31185  */
31186
31187
31188 /**
31189  * g_tls_database_lookup_certificate_issuer:
31190  * @self: a #GTlsDatabase
31191  * @certificate: a #GTlsCertificate
31192  * @interaction: (allow-none): used to interact with the user if necessary
31193  * @flags: flags which affect the lookup operation
31194  * @cancellable: (allow-none): a #GCancellable, or %NULL
31195  * @error: (allow-none): a #GError, or %NULL
31196  *
31197  * Lookup the issuer of @certificate in the database.
31198  *
31199  * The %issuer property
31200  * of @certificate is not modified, and the two certificates are not hooked
31201  * into a chain.
31202  *
31203  * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
31204  * the lookup operation asynchronously.
31205  *
31206  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31207  * Since: 2.30
31208  */
31209
31210
31211 /**
31212  * g_tls_database_lookup_certificate_issuer_async:
31213  * @self: a #GTlsDatabase
31214  * @certificate: a #GTlsCertificate
31215  * @interaction: (allow-none): used to interact with the user if necessary
31216  * @flags: flags which affect the lookup operation
31217  * @cancellable: (allow-none): a #GCancellable, or %NULL
31218  * @callback: callback to call when the operation completes
31219  * @user_data: the data to pass to the callback function
31220  *
31221  * Asynchronously lookup the issuer of @certificate in the database. See
31222  * g_tls_database_lookup_certificate_issuer() for more information.
31223  *
31224  * Since: 2.30
31225  */
31226
31227
31228 /**
31229  * g_tls_database_lookup_certificate_issuer_finish:
31230  * @self: a #GTlsDatabase
31231  * @result: a #GAsyncResult.
31232  * @error: a #GError pointer, or %NULL
31233  *
31234  * Finish an asynchronous lookup issuer operation. See
31235  * g_tls_database_lookup_certificate_issuer() for more information.
31236  *
31237  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31238  * Since: 2.30
31239  */
31240
31241
31242 /**
31243  * g_tls_database_lookup_certificates_issued_by:
31244  * @self: a #GTlsDatabase
31245  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31246  * @interaction: (allow-none): used to interact with the user if necessary
31247  * @flags: Flags which affect the lookup operation.
31248  * @cancellable: (allow-none): a #GCancellable, or %NULL
31249  * @error: (allow-none): a #GError, or %NULL
31250  *
31251  * Lookup certificates issued by this issuer in the database.
31252  *
31253  * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
31254  * the lookup operation asynchronously.
31255  *
31256  * 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.
31257  * Since: 2.30
31258  */
31259
31260
31261 /**
31262  * g_tls_database_lookup_certificates_issued_by_async:
31263  * @self: a #GTlsDatabase
31264  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31265  * @interaction: (allow-none): used to interact with the user if necessary
31266  * @flags: Flags which affect the lookup operation.
31267  * @cancellable: (allow-none): a #GCancellable, or %NULL
31268  * @callback: callback to call when the operation completes
31269  * @user_data: the data to pass to the callback function
31270  *
31271  * Asynchronously lookup certificates issued by this issuer in the database. See
31272  * g_tls_database_lookup_certificates_issued_by() for more information.
31273  *
31274  * The database may choose to hold a reference to the issuer byte array for the duration
31275  * of of this asynchronous operation. The byte array should not be modified during
31276  * this time.
31277  *
31278  * Since: 2.30
31279  */
31280
31281
31282 /**
31283  * g_tls_database_lookup_certificates_issued_by_finish:
31284  * @self: a #GTlsDatabase
31285  * @result: a #GAsyncResult.
31286  * @error: a #GError pointer, or %NULL
31287  *
31288  * Finish an asynchronous lookup of certificates. See
31289  * g_tls_database_lookup_certificates_issued_by() for more information.
31290  *
31291  * 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.
31292  * Since: 2.30
31293  */
31294
31295
31296 /**
31297  * g_tls_database_verify_chain:
31298  * @self: a #GTlsDatabase
31299  * @chain: a #GTlsCertificate chain
31300  * @purpose: the purpose that this certificate chain will be used for.
31301  * @identity: (allow-none): the expected peer identity
31302  * @interaction: (allow-none): used to interact with the user if necessary
31303  * @flags: additional verify flags
31304  * @cancellable: (allow-none): a #GCancellable, or %NULL
31305  * @error: (allow-none): a #GError, or %NULL
31306  *
31307  * Verify's a certificate chain after looking up and adding any missing
31308  * certificates to the chain.
31309  *
31310  * @chain is a chain of #GTlsCertificate objects each pointing to the next
31311  * certificate in the chain by its %issuer property. The chain may initially
31312  * consist of one or more certificates. After the verification process is
31313  * complete, @chain may be modified by adding missing certificates, or removing
31314  * extra certificates. If a certificate anchor was found, then it is added to
31315  * the @chain.
31316  *
31317  * @purpose describes the purpose (or usage) for which the certificate
31318  * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31319  * which means that the certificate is being used to authenticate a server
31320  * (and we are acting as the client).
31321  *
31322  * The @identity is used to check for pinned certificates (trust exceptions)
31323  * in the database. These will override the normal verification process on a
31324  * host by host basis.
31325  *
31326  * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31327  * used.
31328  *
31329  * This function can block, use g_tls_database_verify_chain_async() to perform
31330  * the verification operation asynchronously.
31331  *
31332  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31333  * Since: 2.30
31334  */
31335
31336
31337 /**
31338  * g_tls_database_verify_chain_async:
31339  * @self: a #GTlsDatabase
31340  * @chain: a #GTlsCertificate chain
31341  * @purpose: the purpose that this certificate chain will be used for.
31342  * @identity: (allow-none): the expected peer identity
31343  * @interaction: (allow-none): used to interact with the user if necessary
31344  * @flags: additional verify flags
31345  * @cancellable: (allow-none): a #GCancellable, or %NULL
31346  * @callback: callback to call when the operation completes
31347  * @user_data: the data to pass to the callback function
31348  *
31349  * Asynchronously verify's a certificate chain after looking up and adding
31350  * any missing certificates to the chain. See g_tls_database_verify_chain()
31351  * for more information.
31352  *
31353  * Since: 2.30
31354  */
31355
31356
31357 /**
31358  * g_tls_database_verify_chain_finish:
31359  * @self: a #GTlsDatabase
31360  * @result: a #GAsyncResult.
31361  * @error: a #GError pointer, or %NULL
31362  *
31363  * Finish an asynchronous verify chain operation. See
31364  * g_tls_database_verify_chain() for more information. *
31365  *
31366  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31367  * Since: 2.30
31368  */
31369
31370
31371 /**
31372  * g_tls_error_quark:
31373  *
31374  * Gets the TLS error quark.
31375  *
31376  * Returns: a #GQuark.
31377  * Since: 2.28
31378  */
31379
31380
31381 /**
31382  * g_tls_file_database_new:
31383  * @anchors: filename of anchor certificate authorities.
31384  * @error: #GError for error reporting, or %NULL to ignore.
31385  *
31386  * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31387  * in @anchors to verify certificate chains.
31388  *
31389  * The certificates in @anchors must be PEM encoded.
31390  *
31391  * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31392  * Since: 2.30
31393  */
31394
31395
31396 /**
31397  * g_tls_interaction_ask_password:
31398  * @interaction: a #GTlsInteraction object
31399  * @password: a #GTlsPassword object
31400  * @cancellable: an optional #GCancellable cancellation object
31401  * @error: an optional location to place an error on failure
31402  *
31403  * Run synchronous interaction to ask the user for a password. In general,
31404  * g_tls_interaction_invoke_ask_password() should be used instead of this
31405  * function.
31406  *
31407  * Derived subclasses usually implement a password prompt, although they may
31408  * also choose to provide a password from elsewhere. The @password value will
31409  * be filled in and then @callback will be called. Alternatively the user may
31410  * abort this password request, which will usually abort the TLS connection.
31411  *
31412  * If the interaction is cancelled by the cancellation object, or by the
31413  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31414  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31415  * not support immediate cancellation.
31416  *
31417  * Returns: The status of the ask password interaction.
31418  * Since: 2.30
31419  */
31420
31421
31422 /**
31423  * g_tls_interaction_ask_password_async:
31424  * @interaction: a #GTlsInteraction object
31425  * @password: a #GTlsPassword object
31426  * @cancellable: an optional #GCancellable cancellation object
31427  * @callback: (allow-none): will be called when the interaction completes
31428  * @user_data: (allow-none): data to pass to the @callback
31429  *
31430  * Run asynchronous interaction to ask the user for a password. In general,
31431  * g_tls_interaction_invoke_ask_password() should be used instead of this
31432  * function.
31433  *
31434  * Derived subclasses usually implement a password prompt, although they may
31435  * also choose to provide a password from elsewhere. The @password value will
31436  * be filled in and then @callback will be called. Alternatively the user may
31437  * abort this password request, which will usually abort the TLS connection.
31438  *
31439  * If the interaction is cancelled by the cancellation object, or by the
31440  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31441  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31442  * not support immediate cancellation.
31443  *
31444  * Certain implementations may not support immediate cancellation.
31445  *
31446  * Since: 2.30
31447  */
31448
31449
31450 /**
31451  * g_tls_interaction_ask_password_finish:
31452  * @interaction: a #GTlsInteraction object
31453  * @result: the result passed to the callback
31454  * @error: an optional location to place an error on failure
31455  *
31456  * Complete an ask password user interaction request. This should be once
31457  * the g_tls_interaction_ask_password_async() completion callback is called.
31458  *
31459  * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31460  * to g_tls_interaction_ask_password() will have its password filled in.
31461  *
31462  * If the interaction is cancelled by the cancellation object, or by the
31463  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31464  * contains a %G_IO_ERROR_CANCELLED error code.
31465  *
31466  * Returns: The status of the ask password interaction.
31467  * Since: 2.30
31468  */
31469
31470
31471 /**
31472  * g_tls_interaction_invoke_ask_password:
31473  * @interaction: a #GTlsInteraction object
31474  * @password: a #GTlsPassword object
31475  * @cancellable: an optional #GCancellable cancellation object
31476  * @error: an optional location to place an error on failure
31477  *
31478  * Invoke the interaction to ask the user for a password. It invokes this
31479  * interaction in the main loop, specifically the #GMainContext returned by
31480  * g_main_context_get_thread_default() when the interaction is created. This
31481  * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31482  * for a password.
31483  *
31484  * Derived subclasses usually implement a password prompt, although they may
31485  * also choose to provide a password from elsewhere. The @password value will
31486  * be filled in and then @callback will be called. Alternatively the user may
31487  * abort this password request, which will usually abort the TLS connection.
31488  *
31489  * The implementation can either be a synchronous (eg: modal dialog) or an
31490  * asynchronous one (eg: modeless dialog). This function will take care of
31491  * calling which ever one correctly.
31492  *
31493  * If the interaction is cancelled by the cancellation object, or by the
31494  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31495  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31496  * not support immediate cancellation.
31497  *
31498  * Returns: The status of the ask password interaction.
31499  * Since: 2.30
31500  */
31501
31502
31503 /**
31504  * g_tls_password_get_description:
31505  * @password: a #GTlsPassword object
31506  *
31507  * Get a description string about what the password will be used for.
31508  *
31509  * Returns: The description of the password.
31510  * Since: 2.30
31511  */
31512
31513
31514 /**
31515  * g_tls_password_get_flags:
31516  * @password: a #GTlsPassword object
31517  *
31518  * Get flags about the password.
31519  *
31520  * Returns: The flags about the password.
31521  * Since: 2.30
31522  */
31523
31524
31525 /**
31526  * g_tls_password_get_value:
31527  * @password: a #GTlsPassword object
31528  * @length: (allow-none): location to place the length of the password.
31529  *
31530  * Get the password value. If @length is not %NULL then it will be
31531  * filled in with the length of the password value. (Note that the
31532  * password value is not nul-terminated, so you can only pass %NULL
31533  * for @length in contexts where you know the password will have a
31534  * certain fixed length.)
31535  *
31536  * Returns: The password value (owned by the password object).
31537  * Since: 2.30
31538  */
31539
31540
31541 /**
31542  * g_tls_password_get_warning:
31543  * @password: a #GTlsPassword object
31544  *
31545  * Get a user readable translated warning. Usually this warning is a
31546  * representation of the password flags returned from
31547  * g_tls_password_get_flags().
31548  *
31549  * Returns: The warning.
31550  * Since: 2.30
31551  */
31552
31553
31554 /**
31555  * g_tls_password_new:
31556  * @flags: the password flags
31557  * @description: description of what the password is for
31558  *
31559  * Create a new #GTlsPassword object.
31560  *
31561  * Returns: (transfer full): The newly allocated password object
31562  */
31563
31564
31565 /**
31566  * g_tls_password_set_description:
31567  * @password: a #GTlsPassword object
31568  * @description: The description of the password
31569  *
31570  * Set a description string about what the password will be used for.
31571  *
31572  * Since: 2.30
31573  */
31574
31575
31576 /**
31577  * g_tls_password_set_flags:
31578  * @password: a #GTlsPassword object
31579  * @flags: The flags about the password
31580  *
31581  * Set flags about the password.
31582  *
31583  * Since: 2.30
31584  */
31585
31586
31587 /**
31588  * g_tls_password_set_value:
31589  * @password: a #GTlsPassword object
31590  * @value: the new password value
31591  * @length: the length of the password, or -1
31592  *
31593  * Set the value for this password. The @value will be copied by the password
31594  * object.
31595  *
31596  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31597  * @length if using a nul-terminated password, and @length will be
31598  * calculated automatically. (Note that the terminating nul is not
31599  * considered part of the password in this case.)
31600  *
31601  * Since: 2.30
31602  */
31603
31604
31605 /**
31606  * g_tls_password_set_value_full:
31607  * @password: a #GTlsPassword object
31608  * @value: the value for the password
31609  * @length: the length of the password, or -1
31610  * @destroy: (allow-none): a function to use to free the password.
31611  *
31612  * Provide the value for this password.
31613  *
31614  * The @value will be owned by the password object, and later freed using
31615  * the @destroy function callback.
31616  *
31617  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31618  * @length if using a nul-terminated password, and @length will be
31619  * calculated automatically. (Note that the terminating nul is not
31620  * considered part of the password in this case.)
31621  *
31622  * Virtual: set_value
31623  * Since: 2.30
31624  */
31625
31626
31627 /**
31628  * g_tls_password_set_warning:
31629  * @password: a #GTlsPassword object
31630  * @warning: The user readable warning
31631  *
31632  * Set a user readable translated warning. Usually this warning is a
31633  * representation of the password flags returned from
31634  * g_tls_password_get_flags().
31635  *
31636  * Since: 2.30
31637  */
31638
31639
31640 /**
31641  * g_tls_server_connection_new:
31642  * @base_io_stream: the #GIOStream to wrap
31643  * @certificate: (allow-none): the default server certificate, or %NULL
31644  * @error: #GError for error reporting, or %NULL to ignore.
31645  *
31646  * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31647  * must have pollable input and output streams).
31648  *
31649  * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31650  * Since: 2.28
31651  */
31652
31653
31654 /**
31655  * g_unix_connection_receive_credentials:
31656  * @connection: A #GUnixConnection.
31657  * @cancellable: (allow-none): A #GCancellable or %NULL.
31658  * @error: Return location for error or %NULL.
31659  *
31660  * Receives credentials from the sending end of the connection.  The
31661  * sending end has to call g_unix_connection_send_credentials() (or
31662  * similar) for this to work.
31663  *
31664  * As well as reading the credentials this also reads (and discards) a
31665  * single byte from the stream, as this is required for credentials
31666  * passing to work on some implementations.
31667  *
31668  * Other ways to exchange credentials with a foreign peer includes the
31669  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31670  *
31671  * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31672  * Since: 2.26
31673  */
31674
31675
31676 /**
31677  * g_unix_connection_receive_credentials_async:
31678  * @connection: A #GUnixConnection.
31679  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31680  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31681  * @user_data: (closure): the data to pass to callback function
31682  *
31683  * Asynchronously receive credentials.
31684  *
31685  * For more details, see g_unix_connection_receive_credentials() which is
31686  * the synchronous version of this call.
31687  *
31688  * When the operation is finished, @callback will be called. You can then call
31689  * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31690  *
31691  * Since: 2.32
31692  */
31693
31694
31695 /**
31696  * g_unix_connection_receive_credentials_finish:
31697  * @connection: A #GUnixConnection.
31698  * @result: a #GAsyncResult.
31699  * @error: a #GError, or %NULL
31700  *
31701  * Finishes an asynchronous receive credentials operation started with
31702  * g_unix_connection_receive_credentials_async().
31703  *
31704  * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31705  * Since: 2.32
31706  */
31707
31708
31709 /**
31710  * g_unix_connection_receive_fd:
31711  * @connection: a #GUnixConnection
31712  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31713  * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31714  *
31715  * Receives a file descriptor from the sending end of the connection.
31716  * The sending end has to call g_unix_connection_send_fd() for this
31717  * to work.
31718  *
31719  * As well as reading the fd this also reads a single byte from the
31720  * stream, as this is required for fd passing to work on some
31721  * implementations.
31722  *
31723  * Returns: a file descriptor on success, -1 on error.
31724  * Since: 2.22
31725  */
31726
31727
31728 /**
31729  * g_unix_connection_send_credentials:
31730  * @connection: A #GUnixConnection.
31731  * @cancellable: (allow-none): A #GCancellable or %NULL.
31732  * @error: Return location for error or %NULL.
31733  *
31734  * Passes the credentials of the current user the receiving side
31735  * of the connection. The receiving end has to call
31736  * g_unix_connection_receive_credentials() (or similar) to accept the
31737  * credentials.
31738  *
31739  * As well as sending the credentials this also writes a single NUL
31740  * byte to the stream, as this is required for credentials passing to
31741  * work on some implementations.
31742  *
31743  * Other ways to exchange credentials with a foreign peer includes the
31744  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31745  *
31746  * Returns: %TRUE on success, %FALSE if @error is set.
31747  * Since: 2.26
31748  */
31749
31750
31751 /**
31752  * g_unix_connection_send_credentials_async:
31753  * @connection: A #GUnixConnection.
31754  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31755  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31756  * @user_data: (closure): the data to pass to callback function
31757  *
31758  * Asynchronously send credentials.
31759  *
31760  * For more details, see g_unix_connection_send_credentials() which is
31761  * the synchronous version of this call.
31762  *
31763  * When the operation is finished, @callback will be called. You can then call
31764  * g_unix_connection_send_credentials_finish() to get the result of the operation.
31765  *
31766  * Since: 2.32
31767  */
31768
31769
31770 /**
31771  * g_unix_connection_send_credentials_finish:
31772  * @connection: A #GUnixConnection.
31773  * @result: a #GAsyncResult.
31774  * @error: a #GError, or %NULL
31775  *
31776  * Finishes an asynchronous send credentials operation started with
31777  * g_unix_connection_send_credentials_async().
31778  *
31779  * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31780  * Since: 2.32
31781  */
31782
31783
31784 /**
31785  * g_unix_connection_send_fd:
31786  * @connection: a #GUnixConnection
31787  * @fd: a file descriptor
31788  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31789  * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31790  *
31791  * Passes a file descriptor to the receiving side of the
31792  * connection. The receiving end has to call g_unix_connection_receive_fd()
31793  * to accept the file descriptor.
31794  *
31795  * As well as sending the fd this also writes a single byte to the
31796  * stream, as this is required for fd passing to work on some
31797  * implementations.
31798  *
31799  * Returns: a %TRUE on success, %NULL on error.
31800  * Since: 2.22
31801  */
31802
31803
31804 /**
31805  * g_unix_credentials_message_get_credentials:
31806  * @message: A #GUnixCredentialsMessage.
31807  *
31808  * Gets the credentials stored in @message.
31809  *
31810  * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31811  * Since: 2.26
31812  */
31813
31814
31815 /**
31816  * g_unix_credentials_message_is_supported:
31817  *
31818  * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31819  *
31820  * Returns: %TRUE if supported, %FALSE otherwise
31821  * Since: 2.26
31822  */
31823
31824
31825 /**
31826  * g_unix_credentials_message_new:
31827  *
31828  * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
31829  *
31830  * Returns: a new #GUnixCredentialsMessage
31831  * Since: 2.26
31832  */
31833
31834
31835 /**
31836  * g_unix_credentials_message_new_with_credentials:
31837  * @credentials: A #GCredentials object.
31838  *
31839  * Creates a new #GUnixCredentialsMessage holding @credentials.
31840  *
31841  * Returns: a new #GUnixCredentialsMessage
31842  * Since: 2.26
31843  */
31844
31845
31846 /**
31847  * g_unix_fd_list_append:
31848  * @list: a #GUnixFDList
31849  * @fd: a valid open file descriptor
31850  * @error: a #GError pointer
31851  *
31852  * Adds a file descriptor to @list.
31853  *
31854  * The file descriptor is duplicated using dup(). You keep your copy
31855  * of the descriptor and the copy contained in @list will be closed
31856  * when @list is finalized.
31857  *
31858  * A possible cause of failure is exceeding the per-process or
31859  * system-wide file descriptor limit.
31860  *
31861  * The index of the file descriptor in the list is returned.  If you use
31862  * this index with g_unix_fd_list_get() then you will receive back a
31863  * duplicated copy of the same file descriptor.
31864  *
31865  * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
31866  * Since: 2.24
31867  */
31868
31869
31870 /**
31871  * g_unix_fd_list_get:
31872  * @list: a #GUnixFDList
31873  * @index_: the index into the list
31874  * @error: a #GError pointer
31875  *
31876  * Gets a file descriptor out of @list.
31877  *
31878  * @index_ specifies the index of the file descriptor to get.  It is a
31879  * programmer error for @index_ to be out of range; see
31880  * g_unix_fd_list_get_length().
31881  *
31882  * The file descriptor is duplicated using dup() and set as
31883  * close-on-exec before being returned.  You must call close() on it
31884  * when you are done.
31885  *
31886  * A possible cause of failure is exceeding the per-process or
31887  * system-wide file descriptor limit.
31888  *
31889  * Returns: the file descriptor, or -1 in case of error
31890  * Since: 2.24
31891  */
31892
31893
31894 /**
31895  * g_unix_fd_list_get_length:
31896  * @list: a #GUnixFDList
31897  *
31898  * Gets the length of @list (ie: the number of file descriptors
31899  * contained within).
31900  *
31901  * Returns: the length of @list
31902  * Since: 2.24
31903  */
31904
31905
31906 /**
31907  * g_unix_fd_list_new:
31908  *
31909  * Creates a new #GUnixFDList containing no file descriptors.
31910  *
31911  * Returns: a new #GUnixFDList
31912  * Since: 2.24
31913  */
31914
31915
31916 /**
31917  * g_unix_fd_list_new_from_array:
31918  * @fds: (array length=n_fds): the initial list of file descriptors
31919  * @n_fds: the length of #fds, or -1
31920  *
31921  * Creates a new #GUnixFDList containing the file descriptors given in
31922  * @fds.  The file descriptors become the property of the new list and
31923  * may no longer be used by the caller.  The array itself is owned by
31924  * the caller.
31925  *
31926  * Each file descriptor in the array should be set to close-on-exec.
31927  *
31928  * If @n_fds is -1 then @fds must be terminated with -1.
31929  *
31930  * Returns: a new #GUnixFDList
31931  * Since: 2.24
31932  */
31933
31934
31935 /**
31936  * g_unix_fd_list_peek_fds:
31937  * @list: a #GUnixFDList
31938  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31939  *
31940  * Returns the array of file descriptors that is contained in this
31941  * object.
31942  *
31943  * After this call, the descriptors remain the property of @list.  The
31944  * caller must not close them and must not free the array.  The array is
31945  * valid only until @list is changed in any way.
31946  *
31947  * If @length is non-%NULL then it is set to the number of file
31948  * descriptors in the returned array. The returned array is also
31949  * terminated with -1.
31950  *
31951  * This function never returns %NULL. In case there are no file
31952  * descriptors contained in @list, an empty array is returned.
31953  *
31954  * Returns: (array length=length) (transfer none): an array of file descriptors
31955  * Since: 2.24
31956  */
31957
31958
31959 /**
31960  * g_unix_fd_list_steal_fds:
31961  * @list: a #GUnixFDList
31962  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31963  *
31964  * Returns the array of file descriptors that is contained in this
31965  * object.
31966  *
31967  * After this call, the descriptors are no longer contained in
31968  * @list. Further calls will return an empty list (unless more
31969  * descriptors have been added).
31970  *
31971  * The return result of this function must be freed with g_free().
31972  * The caller is also responsible for closing all of the file
31973  * descriptors.  The file descriptors in the array are set to
31974  * close-on-exec.
31975  *
31976  * If @length is non-%NULL then it is set to the number of file
31977  * descriptors in the returned array. The returned array is also
31978  * terminated with -1.
31979  *
31980  * This function never returns %NULL. In case there are no file
31981  * descriptors contained in @list, an empty array is returned.
31982  *
31983  * Returns: (array length=length) (transfer full): an array of file descriptors
31984  * Since: 2.24
31985  */
31986
31987
31988 /**
31989  * g_unix_fd_message_append_fd:
31990  * @message: a #GUnixFDMessage
31991  * @fd: a valid open file descriptor
31992  * @error: a #GError pointer
31993  *
31994  * Adds a file descriptor to @message.
31995  *
31996  * The file descriptor is duplicated using dup(). You keep your copy
31997  * of the descriptor and the copy contained in @message will be closed
31998  * when @message is finalized.
31999  *
32000  * A possible cause of failure is exceeding the per-process or
32001  * system-wide file descriptor limit.
32002  *
32003  * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32004  * Since: 2.22
32005  */
32006
32007
32008 /**
32009  * g_unix_fd_message_get_fd_list:
32010  * @message: a #GUnixFDMessage
32011  *
32012  * Gets the #GUnixFDList contained in @message.  This function does not
32013  * return a reference to the caller, but the returned list is valid for
32014  * the lifetime of @message.
32015  *
32016  * Returns: (transfer none): the #GUnixFDList from @message
32017  * Since: 2.24
32018  */
32019
32020
32021 /**
32022  * g_unix_fd_message_new:
32023  *
32024  * Creates a new #GUnixFDMessage containing an empty file descriptor
32025  * list.
32026  *
32027  * Returns: a new #GUnixFDMessage
32028  * Since: 2.22
32029  */
32030
32031
32032 /**
32033  * g_unix_fd_message_new_with_fd_list:
32034  * @fd_list: a #GUnixFDList
32035  *
32036  * Creates a new #GUnixFDMessage containing @list.
32037  *
32038  * Returns: a new #GUnixFDMessage
32039  * Since: 2.24
32040  */
32041
32042
32043 /**
32044  * g_unix_fd_message_steal_fds:
32045  * @message: a #GUnixFDMessage
32046  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32047  *
32048  * Returns the array of file descriptors that is contained in this
32049  * object.
32050  *
32051  * After this call, the descriptors are no longer contained in
32052  * @message. Further calls will return an empty list (unless more
32053  * descriptors have been added).
32054  *
32055  * The return result of this function must be freed with g_free().
32056  * The caller is also responsible for closing all of the file
32057  * descriptors.
32058  *
32059  * If @length is non-%NULL then it is set to the number of file
32060  * descriptors in the returned array. The returned array is also
32061  * terminated with -1.
32062  *
32063  * This function never returns %NULL. In case there are no file
32064  * descriptors contained in @message, an empty array is returned.
32065  *
32066  * Returns: (array length=length) (transfer full): an array of file descriptors
32067  * Since: 2.22
32068  */
32069
32070
32071 /**
32072  * g_unix_input_stream_get_close_fd:
32073  * @stream: a #GUnixInputStream
32074  *
32075  * Returns whether the file descriptor of @stream will be
32076  * closed when the stream is closed.
32077  *
32078  * Returns: %TRUE if the file descriptor is closed when done
32079  * Since: 2.20
32080  */
32081
32082
32083 /**
32084  * g_unix_input_stream_get_fd:
32085  * @stream: a #GUnixInputStream
32086  *
32087  * Return the UNIX file descriptor that the stream reads from.
32088  *
32089  * Returns: The file descriptor of @stream
32090  * Since: 2.20
32091  */
32092
32093
32094 /**
32095  * g_unix_input_stream_new:
32096  * @fd: a UNIX file descriptor
32097  * @close_fd: %TRUE to close the file descriptor when done
32098  *
32099  * Creates a new #GUnixInputStream for the given @fd.
32100  *
32101  * If @close_fd is %TRUE, the file descriptor will be closed
32102  * when the stream is closed.
32103  *
32104  * Returns: a new #GUnixInputStream
32105  */
32106
32107
32108 /**
32109  * g_unix_input_stream_set_close_fd:
32110  * @stream: a #GUnixInputStream
32111  * @close_fd: %TRUE to close the file descriptor when done
32112  *
32113  * Sets whether the file descriptor of @stream shall be closed
32114  * when the stream is closed.
32115  *
32116  * Since: 2.20
32117  */
32118
32119
32120 /**
32121  * g_unix_is_mount_path_system_internal:
32122  * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
32123  *
32124  * Determines if @mount_path is considered an implementation of the
32125  * OS. This is primarily used for hiding mountable and mounted volumes
32126  * that only are used in the OS and has little to no relevance to the
32127  * casual user.
32128  *
32129  * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
32130  */
32131
32132
32133 /**
32134  * g_unix_mount_at: (skip)
32135  * @mount_path: path for a possible unix mount.
32136  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32137  *
32138  * Gets a #GUnixMountEntry for a given mount path. If @time_read
32139  * is set, it will be filled with a unix timestamp for checking
32140  * if the mounts have changed since with g_unix_mounts_changed_since().
32141  *
32142  * Returns: (transfer full): a #GUnixMountEntry.
32143  */
32144
32145
32146 /**
32147  * g_unix_mount_compare:
32148  * @mount1: first #GUnixMountEntry to compare.
32149  * @mount2: second #GUnixMountEntry to compare.
32150  *
32151  * Compares two unix mounts.
32152  *
32153  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32154  */
32155
32156
32157 /**
32158  * g_unix_mount_free:
32159  * @mount_entry: a #GUnixMountEntry.
32160  *
32161  * Frees a unix mount.
32162  */
32163
32164
32165 /**
32166  * g_unix_mount_get_device_path:
32167  * @mount_entry: a #GUnixMount.
32168  *
32169  * Gets the device path for a unix mount.
32170  *
32171  * Returns: a string containing the device path.
32172  */
32173
32174
32175 /**
32176  * g_unix_mount_get_fs_type:
32177  * @mount_entry: a #GUnixMount.
32178  *
32179  * Gets the filesystem type for the unix mount.
32180  *
32181  * Returns: a string containing the file system type.
32182  */
32183
32184
32185 /**
32186  * g_unix_mount_get_mount_path:
32187  * @mount_entry: input #GUnixMountEntry to get the mount path for.
32188  *
32189  * Gets the mount path for a unix mount.
32190  *
32191  * Returns: the mount path for @mount_entry.
32192  */
32193
32194
32195 /**
32196  * g_unix_mount_guess_can_eject:
32197  * @mount_entry: a #GUnixMountEntry
32198  *
32199  * Guesses whether a Unix mount can be ejected.
32200  *
32201  * Returns: %TRUE if @mount_entry is deemed to be ejectable.
32202  */
32203
32204
32205 /**
32206  * g_unix_mount_guess_icon:
32207  * @mount_entry: a #GUnixMountEntry
32208  *
32209  * Guesses the icon of a Unix mount.
32210  *
32211  * Returns: (transfer full): a #GIcon
32212  */
32213
32214
32215 /**
32216  * g_unix_mount_guess_name:
32217  * @mount_entry: a #GUnixMountEntry
32218  *
32219  * Guesses the name of a Unix mount.
32220  * The result is a translated string.
32221  *
32222  * Returns: A newly allocated string that must be freed with g_free()
32223  */
32224
32225
32226 /**
32227  * g_unix_mount_guess_should_display:
32228  * @mount_entry: a #GUnixMountEntry
32229  *
32230  * Guesses whether a Unix mount should be displayed in the UI.
32231  *
32232  * Returns: %TRUE if @mount_entry is deemed to be displayable.
32233  */
32234
32235
32236 /**
32237  * g_unix_mount_guess_symbolic_icon:
32238  * @mount_entry: a #GUnixMountEntry
32239  *
32240  * Guesses the symbolic icon of a Unix mount.
32241  *
32242  * Returns: (transfer full): a #GIcon
32243  * Since: 2.34
32244  */
32245
32246
32247 /**
32248  * g_unix_mount_is_readonly:
32249  * @mount_entry: a #GUnixMount.
32250  *
32251  * Checks if a unix mount is mounted read only.
32252  *
32253  * Returns: %TRUE if @mount_entry is read only.
32254  */
32255
32256
32257 /**
32258  * g_unix_mount_is_system_internal:
32259  * @mount_entry: a #GUnixMount.
32260  *
32261  * Checks if a unix mount is a system path.
32262  *
32263  * Returns: %TRUE if the unix mount is for a system path.
32264  */
32265
32266
32267 /**
32268  * g_unix_mount_monitor_new:
32269  *
32270  * Gets a new #GUnixMountMonitor. The default rate limit for which the
32271  * monitor will report consecutive changes for the mount and mount
32272  * point entry files is the default for a #GFileMonitor. Use
32273  * g_unix_mount_monitor_set_rate_limit() to change this.
32274  *
32275  * Returns: a #GUnixMountMonitor.
32276  */
32277
32278
32279 /**
32280  * g_unix_mount_monitor_set_rate_limit:
32281  * @mount_monitor: a #GUnixMountMonitor
32282  * @limit_msec: a integer with the limit in milliseconds to poll for changes.
32283  *
32284  * Sets the rate limit to which the @mount_monitor will report
32285  * consecutive change events to the mount and mount point entry files.
32286  *
32287  * Since: 2.18
32288  */
32289
32290
32291 /**
32292  * g_unix_mount_point_compare:
32293  * @mount1: a #GUnixMount.
32294  * @mount2: a #GUnixMount.
32295  *
32296  * Compares two unix mount points.
32297  *
32298  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32299  */
32300
32301
32302 /**
32303  * g_unix_mount_point_free:
32304  * @mount_point: unix mount point to free.
32305  *
32306  * Frees a unix mount point.
32307  */
32308
32309
32310 /**
32311  * g_unix_mount_point_get_device_path:
32312  * @mount_point: a #GUnixMountPoint.
32313  *
32314  * Gets the device path for a unix mount point.
32315  *
32316  * Returns: a string containing the device path.
32317  */
32318
32319
32320 /**
32321  * g_unix_mount_point_get_fs_type:
32322  * @mount_point: a #GUnixMountPoint.
32323  *
32324  * Gets the file system type for the mount point.
32325  *
32326  * Returns: a string containing the file system type.
32327  */
32328
32329
32330 /**
32331  * g_unix_mount_point_get_mount_path:
32332  * @mount_point: a #GUnixMountPoint.
32333  *
32334  * Gets the mount path for a unix mount point.
32335  *
32336  * Returns: a string containing the mount path.
32337  */
32338
32339
32340 /**
32341  * g_unix_mount_point_get_options:
32342  * @mount_point: a #GUnixMountPoint.
32343  *
32344  * Gets the options for the mount point.
32345  *
32346  * Returns: a string containing the options.
32347  * Since: 2.32
32348  */
32349
32350
32351 /**
32352  * g_unix_mount_point_guess_can_eject:
32353  * @mount_point: a #GUnixMountPoint
32354  *
32355  * Guesses whether a Unix mount point can be ejected.
32356  *
32357  * Returns: %TRUE if @mount_point is deemed to be ejectable.
32358  */
32359
32360
32361 /**
32362  * g_unix_mount_point_guess_icon:
32363  * @mount_point: a #GUnixMountPoint
32364  *
32365  * Guesses the icon of a Unix mount point.
32366  *
32367  * Returns: (transfer full): a #GIcon
32368  */
32369
32370
32371 /**
32372  * g_unix_mount_point_guess_name:
32373  * @mount_point: a #GUnixMountPoint
32374  *
32375  * Guesses the name of a Unix mount point.
32376  * The result is a translated string.
32377  *
32378  * Returns: A newly allocated string that must be freed with g_free()
32379  */
32380
32381
32382 /**
32383  * g_unix_mount_point_guess_symbolic_icon:
32384  *
32385  * Guesses the symbolic icon of a Unix mount point.
32386  *
32387  * Returns: (transfer full): a #GIcon
32388  * Since: 2.34
32389  */
32390
32391
32392 /**
32393  * g_unix_mount_point_is_loopback:
32394  * @mount_point: a #GUnixMountPoint.
32395  *
32396  * Checks if a unix mount point is a loopback device.
32397  *
32398  * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32399  */
32400
32401
32402 /**
32403  * g_unix_mount_point_is_readonly:
32404  * @mount_point: a #GUnixMountPoint.
32405  *
32406  * Checks if a unix mount point is read only.
32407  *
32408  * Returns: %TRUE if a mount point is read only.
32409  */
32410
32411
32412 /**
32413  * g_unix_mount_point_is_user_mountable:
32414  * @mount_point: a #GUnixMountPoint.
32415  *
32416  * Checks if a unix mount point is mountable by the user.
32417  *
32418  * Returns: %TRUE if the mount point is user mountable.
32419  */
32420
32421
32422 /**
32423  * g_unix_mount_points_changed_since:
32424  * @time: guint64 to contain a timestamp.
32425  *
32426  * Checks if the unix mount points have changed since a given unix time.
32427  *
32428  * Returns: %TRUE if the mount points have changed since @time.
32429  */
32430
32431
32432 /**
32433  * g_unix_mount_points_get: (skip)
32434  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32435  *
32436  * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32437  * If @time_read is set, it will be filled with the mount timestamp,
32438  * allowing for checking if the mounts have changed with
32439  * g_unix_mount_points_changed_since().
32440  *
32441  * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32442  */
32443
32444
32445 /**
32446  * g_unix_mounts_changed_since:
32447  * @time: guint64 to contain a timestamp.
32448  *
32449  * Checks if the unix mounts have changed since a given unix time.
32450  *
32451  * Returns: %TRUE if the mounts have changed since @time.
32452  */
32453
32454
32455 /**
32456  * g_unix_mounts_get: (skip)
32457  * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32458  *
32459  * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32460  * If @time_read is set, it will be filled with the mount
32461  * timestamp, allowing for checking if the mounts have changed
32462  * with g_unix_mounts_changed_since().
32463  *
32464  * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32465  */
32466
32467
32468 /**
32469  * g_unix_output_stream_get_close_fd:
32470  * @stream: a #GUnixOutputStream
32471  *
32472  * Returns whether the file descriptor of @stream will be
32473  * closed when the stream is closed.
32474  *
32475  * Returns: %TRUE if the file descriptor is closed when done
32476  * Since: 2.20
32477  */
32478
32479
32480 /**
32481  * g_unix_output_stream_get_fd:
32482  * @stream: a #GUnixOutputStream
32483  *
32484  * Return the UNIX file descriptor that the stream writes to.
32485  *
32486  * Returns: The file descriptor of @stream
32487  * Since: 2.20
32488  */
32489
32490
32491 /**
32492  * g_unix_output_stream_new:
32493  * @fd: a UNIX file descriptor
32494  * @close_fd: %TRUE to close the file descriptor when done
32495  *
32496  * Creates a new #GUnixOutputStream for the given @fd.
32497  *
32498  * If @close_fd, is %TRUE, the file descriptor will be closed when
32499  * the output stream is destroyed.
32500  *
32501  * Returns: a new #GOutputStream
32502  */
32503
32504
32505 /**
32506  * g_unix_output_stream_set_close_fd:
32507  * @stream: a #GUnixOutputStream
32508  * @close_fd: %TRUE to close the file descriptor when done
32509  *
32510  * Sets whether the file descriptor of @stream shall be closed
32511  * when the stream is closed.
32512  *
32513  * Since: 2.20
32514  */
32515
32516
32517 /**
32518  * g_unix_socket_address_abstract_names_supported:
32519  *
32520  * Checks if abstract UNIX domain socket names are supported.
32521  *
32522  * Returns: %TRUE if supported, %FALSE otherwise
32523  * Since: 2.22
32524  */
32525
32526
32527 /**
32528  * g_unix_socket_address_get_address_type:
32529  * @address: a #GInetSocketAddress
32530  *
32531  * Gets @address's type.
32532  *
32533  * Returns: a #GUnixSocketAddressType
32534  * Since: 2.26
32535  */
32536
32537
32538 /**
32539  * g_unix_socket_address_get_is_abstract:
32540  * @address: a #GInetSocketAddress
32541  *
32542  * Tests if @address is abstract.
32543  *
32544  * Returns: %TRUE if the address is abstract, %FALSE otherwise
32545  * Since: 2.22
32546  * Deprecated: Use g_unix_socket_address_get_address_type()
32547  */
32548
32549
32550 /**
32551  * g_unix_socket_address_get_path:
32552  * @address: a #GInetSocketAddress
32553  *
32554  * Gets @address's path, or for abstract sockets the "name".
32555  *
32556  * Guaranteed to be zero-terminated, but an abstract socket
32557  * may contain embedded zeros, and thus you should use
32558  * g_unix_socket_address_get_path_len() to get the true length
32559  * of this string.
32560  *
32561  * Returns: the path for @address
32562  * Since: 2.22
32563  */
32564
32565
32566 /**
32567  * g_unix_socket_address_get_path_len:
32568  * @address: a #GInetSocketAddress
32569  *
32570  * Gets the length of @address's path.
32571  *
32572  * For details, see g_unix_socket_address_get_path().
32573  *
32574  * Returns: the length of the path
32575  * Since: 2.22
32576  */
32577
32578
32579 /**
32580  * g_unix_socket_address_new:
32581  * @path: the socket path
32582  *
32583  * Creates a new #GUnixSocketAddress for @path.
32584  *
32585  * To create abstract socket addresses, on systems that support that,
32586  * use g_unix_socket_address_new_abstract().
32587  *
32588  * Returns: a new #GUnixSocketAddress
32589  * Since: 2.22
32590  */
32591
32592
32593 /**
32594  * g_unix_socket_address_new_abstract:
32595  * @path: (array length=path_len) (element-type gchar): the abstract name
32596  * @path_len: the length of @path, or -1
32597  *
32598  * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32599  * #GUnixSocketAddress for @path.
32600  *
32601  * Returns: a new #GUnixSocketAddress
32602  * Deprecated: Use g_unix_socket_address_new_with_type().
32603  */
32604
32605
32606 /**
32607  * g_unix_socket_address_new_with_type:
32608  * @path: (array length=path_len) (element-type gchar): the name
32609  * @path_len: the length of @path, or -1
32610  * @type: a #GUnixSocketAddressType
32611  *
32612  * Creates a new #GUnixSocketAddress of type @type with name @path.
32613  *
32614  * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32615  * calling g_unix_socket_address_new().
32616  *
32617  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32618  * bytes of @path will be copied to the socket's path, and only those
32619  * bytes will be considered part of the name. (If @path_len is -1,
32620  * then @path is assumed to be NUL-terminated.) For example, if @path
32621  * was "test", then calling g_socket_address_get_native_size() on the
32622  * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32623  * abstract-socket indicator byte, and 4 bytes for the name "test").
32624  *
32625  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32626  * @path_len bytes of @path will be copied to the socket's path, the
32627  * rest of the path will be padded with 0 bytes, and the entire
32628  * zero-padded buffer will be considered the name. (As above, if
32629  * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32630  * this case, g_socket_address_get_native_size() will always return
32631  * the full size of a <literal>struct sockaddr_un</literal>, although
32632  * g_unix_socket_address_get_path_len() will still return just the
32633  * length of @path.
32634  *
32635  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32636  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32637  * when connecting to a server created by another process, you must
32638  * use the appropriate type corresponding to how that process created
32639  * its listening socket.
32640  *
32641  * Returns: a new #GUnixSocketAddress
32642  * Since: 2.26
32643  */
32644
32645
32646 /**
32647  * g_vfs_get_default:
32648  *
32649  * Gets the default #GVfs for the system.
32650  *
32651  * Returns: (transfer none): a #GVfs.
32652  */
32653
32654
32655 /**
32656  * g_vfs_get_file_for_path:
32657  * @vfs: a #GVfs.
32658  * @path: a string containing a VFS path.
32659  *
32660  * Gets a #GFile for @path.
32661  *
32662  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32663  */
32664
32665
32666 /**
32667  * g_vfs_get_file_for_uri:
32668  * @vfs: a#GVfs.
32669  * @uri: a string containing a URI
32670  *
32671  * Gets a #GFile for @uri.
32672  *
32673  * This operation never fails, but the returned object
32674  * might not support any I/O operation if the URI
32675  * is malformed or if the URI scheme is not supported.
32676  *
32677  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32678  */
32679
32680
32681 /**
32682  * g_vfs_get_local:
32683  *
32684  * Gets the local #GVfs for the system.
32685  *
32686  * Returns: (transfer none): a #GVfs.
32687  */
32688
32689
32690 /**
32691  * g_vfs_get_supported_uri_schemes:
32692  * @vfs: a #GVfs.
32693  *
32694  * Gets a list of URI schemes supported by @vfs.
32695  *
32696  * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32697  */
32698
32699
32700 /**
32701  * g_vfs_is_active:
32702  * @vfs: a #GVfs.
32703  *
32704  * Checks if the VFS is active.
32705  *
32706  * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32707  */
32708
32709
32710 /**
32711  * g_vfs_parse_name:
32712  * @vfs: a #GVfs.
32713  * @parse_name: a string to be parsed by the VFS module.
32714  *
32715  * This operation never fails, but the returned object might
32716  * not support any I/O operations if the @parse_name cannot
32717  * be parsed by the #GVfs module.
32718  *
32719  * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32720  */
32721
32722
32723 /**
32724  * g_volume_can_eject:
32725  * @volume: a #GVolume.
32726  *
32727  * Checks if a volume can be ejected.
32728  *
32729  * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32730  */
32731
32732
32733 /**
32734  * g_volume_can_mount:
32735  * @volume: a #GVolume.
32736  *
32737  * Checks if a volume can be mounted.
32738  *
32739  * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32740  */
32741
32742
32743 /**
32744  * g_volume_eject:
32745  * @volume: a #GVolume.
32746  * @flags: flags affecting the unmount if required for eject
32747  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32748  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32749  * @user_data: user data that gets passed to @callback
32750  *
32751  * Ejects a volume. This is an asynchronous operation, and is
32752  * finished by calling g_volume_eject_finish() with the @volume
32753  * and #GAsyncResult returned in the @callback.
32754  *
32755  * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32756  */
32757
32758
32759 /**
32760  * g_volume_eject_finish:
32761  * @volume: pointer to a #GVolume.
32762  * @result: a #GAsyncResult.
32763  * @error: a #GError location to store an error, or %NULL to ignore
32764  *
32765  * Finishes ejecting a volume. If any errors occurred during the operation,
32766  * @error will be set to contain the errors and %FALSE will be returned.
32767  *
32768  * Returns: %TRUE, %FALSE if operation failed.
32769  * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32770  */
32771
32772
32773 /**
32774  * g_volume_eject_with_operation:
32775  * @volume: a #GVolume.
32776  * @flags: flags affecting the unmount if required for eject
32777  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32778  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32779  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32780  * @user_data: user data passed to @callback.
32781  *
32782  * Ejects a volume. This is an asynchronous operation, and is
32783  * finished by calling g_volume_eject_with_operation_finish() with the @volume
32784  * and #GAsyncResult data returned in the @callback.
32785  *
32786  * Since: 2.22
32787  */
32788
32789
32790 /**
32791  * g_volume_eject_with_operation_finish:
32792  * @volume: a #GVolume.
32793  * @result: a #GAsyncResult.
32794  * @error: a #GError location to store the error occurring, or %NULL to ignore.
32795  *
32796  * Finishes ejecting a volume. If any errors occurred during the operation,
32797  * @error will be set to contain the errors and %FALSE will be returned.
32798  *
32799  * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32800  * Since: 2.22
32801  */
32802
32803
32804 /**
32805  * g_volume_enumerate_identifiers:
32806  * @volume: a #GVolume
32807  *
32808  * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32809  * that @volume has. Use g_volume_get_identifier() to obtain
32810  * the identifiers themselves.
32811  *
32812  * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32813  */
32814
32815
32816 /**
32817  * g_volume_get_activation_root:
32818  * @volume: a #GVolume
32819  *
32820  * Gets the activation root for a #GVolume if it is known ahead of
32821  * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32822  * is mounted, then the result of g_mount_get_root() on the
32823  * #GMount object obtained from g_volume_get_mount() will always
32824  * either be equal or a prefix of what this function returns. In
32825  * other words, in code
32826  *
32827  * <programlisting>
32828  *   GMount *mount;
32829  *   GFile *mount_root
32830  *   GFile *volume_activation_root;
32831  *
32832  *   mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
32833  *   mount_root = g_mount_get_root (mount);
32834  *   volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
32835  * </programlisting>
32836  *
32837  * then the expression
32838  *
32839  * <programlisting>
32840  *   (g_file_has_prefix (volume_activation_root, mount_root) ||
32841  *       g_file_equal (volume_activation_root, mount_root))
32842  * </programlisting>
32843  *
32844  * will always be %TRUE.
32845  *
32846  * Activation roots are typically used in #GVolumeMonitor
32847  * implementations to find the underlying mount to shadow, see
32848  * g_mount_is_shadowed() for more details.
32849  *
32850  * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
32851  * Since: 2.18
32852  */
32853
32854
32855 /**
32856  * g_volume_get_drive:
32857  * @volume: a #GVolume.
32858  *
32859  * Gets the drive for the @volume.
32860  *
32861  * 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.
32862  */
32863
32864
32865 /**
32866  * g_volume_get_icon:
32867  * @volume: a #GVolume.
32868  *
32869  * Gets the icon for @volume.
32870  *
32871  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32872  */
32873
32874
32875 /**
32876  * g_volume_get_identifier:
32877  * @volume: a #GVolume
32878  * @kind: the kind of identifier to return
32879  *
32880  * Gets the identifier of the given kind for @volume.
32881  * See the <link linkend="volume-identifier">introduction</link>
32882  * for more information about volume identifiers.
32883  *
32884  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
32885  */
32886
32887
32888 /**
32889  * g_volume_get_mount:
32890  * @volume: a #GVolume.
32891  *
32892  * Gets the mount for the @volume.
32893  *
32894  * 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.
32895  */
32896
32897
32898 /**
32899  * g_volume_get_name:
32900  * @volume: a #GVolume.
32901  *
32902  * Gets the name of @volume.
32903  *
32904  * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
32905  */
32906
32907
32908 /**
32909  * g_volume_get_sort_key:
32910  * @volume: A #GVolume.
32911  *
32912  * Gets the sort key for @volume, if any.
32913  *
32914  * Returns: Sorting key for @volume or %NULL if no such key is available.
32915  * Since: 2.32
32916  */
32917
32918
32919 /**
32920  * g_volume_get_symbolic_icon:
32921  * @volume: a #GVolume.
32922  *
32923  * Gets the symbolic icon for @volume.
32924  *
32925  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32926  * Since: 2.34
32927  */
32928
32929
32930 /**
32931  * g_volume_get_uuid:
32932  * @volume: a #GVolume.
32933  *
32934  * Gets the UUID for the @volume. The reference is typically based on
32935  * the file system UUID for the volume in question and should be
32936  * considered an opaque string. Returns %NULL if there is no UUID
32937  * available.
32938  *
32939  * 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.
32940  */
32941
32942
32943 /**
32944  * g_volume_monitor_adopt_orphan_mount:
32945  * @mount: a #GMount object to find a parent for
32946  *
32947  * This function should be called by any #GVolumeMonitor
32948  * implementation when a new #GMount object is created that is not
32949  * associated with a #GVolume object. It must be called just before
32950  * emitting the @mount_added signal.
32951  *
32952  * If the return value is not %NULL, the caller must associate the
32953  * returned #GVolume object with the #GMount. This involves returning
32954  * it in its g_mount_get_volume() implementation. The caller must
32955  * also listen for the "removed" signal on the returned object
32956  * and give up its reference when handling that signal
32957  *
32958  * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
32959  * the implementor must take a reference to @mount and return it in
32960  * its g_volume_get_mount() implemented. Also, the implementor must
32961  * listen for the "unmounted" signal on @mount and give up its
32962  * reference upon handling that signal.
32963  *
32964  * There are two main use cases for this function.
32965  *
32966  * One is when implementing a user space file system driver that reads
32967  * blocks of a block device that is already represented by the native
32968  * volume monitor (for example a CD Audio file system driver). Such
32969  * a driver will generate its own #GMount object that needs to be
32970  * associated with the #GVolume object that represents the volume.
32971  *
32972  * The other is for implementing a #GVolumeMonitor whose sole purpose
32973  * is to return #GVolume objects representing entries in the users
32974  * "favorite servers" list or similar.
32975  *
32976  * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
32977  * 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.
32978  */
32979
32980
32981 /**
32982  * g_volume_monitor_get:
32983  *
32984  * Gets the volume monitor used by gio.
32985  *
32986  * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
32987  */
32988
32989
32990 /**
32991  * g_volume_monitor_get_connected_drives:
32992  * @volume_monitor: a #GVolumeMonitor.
32993  *
32994  * Gets a list of drives connected to the system.
32995  *
32996  * The returned list should be freed with g_list_free(), after
32997  * its elements have been unreffed with g_object_unref().
32998  *
32999  * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33000  */
33001
33002
33003 /**
33004  * g_volume_monitor_get_mount_for_uuid:
33005  * @volume_monitor: a #GVolumeMonitor.
33006  * @uuid: the UUID to look for
33007  *
33008  * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33009  *
33010  * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33011  */
33012
33013
33014 /**
33015  * g_volume_monitor_get_mounts:
33016  * @volume_monitor: a #GVolumeMonitor.
33017  *
33018  * Gets a list of the mounts on the system.
33019  *
33020  * The returned list should be freed with g_list_free(), after
33021  * its elements have been unreffed with g_object_unref().
33022  *
33023  * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33024  */
33025
33026
33027 /**
33028  * g_volume_monitor_get_volume_for_uuid:
33029  * @volume_monitor: a #GVolumeMonitor.
33030  * @uuid: the UUID to look for
33031  *
33032  * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33033  *
33034  * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33035  */
33036
33037
33038 /**
33039  * g_volume_monitor_get_volumes:
33040  * @volume_monitor: a #GVolumeMonitor.
33041  *
33042  * Gets a list of the volumes on the system.
33043  *
33044  * The returned list should be freed with g_list_free(), after
33045  * its elements have been unreffed with g_object_unref().
33046  *
33047  * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33048  */
33049
33050
33051 /**
33052  * g_volume_mount:
33053  * @volume: a #GVolume.
33054  * @flags: flags affecting the operation
33055  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33056  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33057  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33058  * @user_data: user data that gets passed to @callback
33059  *
33060  * Mounts a volume. This is an asynchronous operation, and is
33061  * finished by calling g_volume_mount_finish() with the @volume
33062  * and #GAsyncResult returned in the @callback.
33063  *
33064  * Virtual: mount_fn
33065  */
33066
33067
33068 /**
33069  * g_volume_mount_finish:
33070  * @volume: a #GVolume
33071  * @result: a #GAsyncResult
33072  * @error: a #GError location to store an error, or %NULL to ignore
33073  *
33074  * Finishes mounting a volume. If any errors occurred during the operation,
33075  * @error will be set to contain the errors and %FALSE will be returned.
33076  *
33077  * If the mount operation succeeded, g_volume_get_mount() on @volume
33078  * is guaranteed to return the mount right after calling this
33079  * function; there's no need to listen for the 'mount-added' signal on
33080  * #GVolumeMonitor.
33081  *
33082  * Returns: %TRUE, %FALSE if operation failed.
33083  */
33084
33085
33086 /**
33087  * g_volume_should_automount:
33088  * @volume: a #GVolume
33089  *
33090  * Returns whether the volume should be automatically mounted.
33091  *
33092  * Returns: %TRUE if the volume should be automatically mounted.
33093  */
33094
33095
33096 /**
33097  * g_win32_input_stream_get_close_handle:
33098  * @stream: a #GWin32InputStream
33099  *
33100  * Returns whether the handle of @stream will be
33101  * closed when the stream is closed.
33102  *
33103  * Returns: %TRUE if the handle is closed when done
33104  * Since: 2.26
33105  */
33106
33107
33108 /**
33109  * g_win32_input_stream_get_handle:
33110  * @stream: a #GWin32InputStream
33111  *
33112  * Return the Windows file handle that the stream reads from.
33113  *
33114  * Returns: The file handle of @stream
33115  * Since: 2.26
33116  */
33117
33118
33119 /**
33120  * g_win32_input_stream_new:
33121  * @handle: a Win32 file handle
33122  * @close_handle: %TRUE to close the handle when done
33123  *
33124  * Creates a new #GWin32InputStream for the given @handle.
33125  *
33126  * If @close_handle is %TRUE, the handle will be closed
33127  * when the stream is closed.
33128  *
33129  * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
33130  * as used in the Windows C libraries.
33131  *
33132  * Returns: a new #GWin32InputStream
33133  */
33134
33135
33136 /**
33137  * g_win32_input_stream_set_close_handle:
33138  * @stream: a #GWin32InputStream
33139  * @close_handle: %TRUE to close the handle when done
33140  *
33141  * Sets whether the handle of @stream shall be closed
33142  * when the stream is closed.
33143  *
33144  * Since: 2.26
33145  */
33146
33147
33148 /**
33149  * g_win32_output_stream_get_close_handle:
33150  * @stream: a #GWin32OutputStream
33151  *
33152  * Returns whether the handle of @stream will be closed when the
33153  * stream is closed.
33154  *
33155  * Returns: %TRUE if the handle is closed when done
33156  * Since: 2.26
33157  */
33158
33159
33160 /**
33161  * g_win32_output_stream_get_handle:
33162  * @stream: a #GWin32OutputStream
33163  *
33164  * Return the Windows handle that the stream writes to.
33165  *
33166  * Returns: The handle descriptor of @stream
33167  * Since: 2.26
33168  */
33169
33170
33171 /**
33172  * g_win32_output_stream_new:
33173  * @handle: a Win32 file handle
33174  * @close_handle: %TRUE to close the handle when done
33175  *
33176  * Creates a new #GWin32OutputStream for the given @handle.
33177  *
33178  * If @close_handle, is %TRUE, the handle will be closed when the
33179  * output stream is destroyed.
33180  *
33181  * Returns: a new #GOutputStream
33182  * Since: 2.26
33183  */
33184
33185
33186 /**
33187  * g_win32_output_stream_set_close_handle:
33188  * @stream: a #GWin32OutputStream
33189  * @close_handle: %TRUE to close the handle when done
33190  *
33191  * Sets whether the handle of @stream shall be closed when the stream
33192  * is closed.
33193  *
33194  * Since: 2.26
33195  */
33196
33197
33198 /**
33199  * g_zlib_compressor_get_file_info:
33200  * @compressor: a #GZlibCompressor
33201  *
33202  * Returns the #GZlibCompressor:file-info property.
33203  *
33204  * Returns: (transfer none): a #GFileInfo, or %NULL
33205  * Since: 2.26
33206  */
33207
33208
33209 /**
33210  * g_zlib_compressor_new:
33211  * @format: The format to use for the compressed data
33212  * @level: compression level (0-9), -1 for default
33213  *
33214  * Creates a new #GZlibCompressor.
33215  *
33216  * Returns: a new #GZlibCompressor
33217  * Since: 2.24
33218  */
33219
33220
33221 /**
33222  * g_zlib_compressor_set_file_info:
33223  * @compressor: a #GZlibCompressor
33224  * @file_info: (allow-none): a #GFileInfo
33225  *
33226  * Sets @file_info in @compressor. If non-%NULL, and @compressor's
33227  * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33228  * it will be used to set the file name and modification time in
33229  * the GZIP header of the compressed data.
33230  *
33231  * Note: it is an error to call this function while a compression is in
33232  * progress; it may only be called immediately after creation of @compressor,
33233  * or after resetting it with g_converter_reset().
33234  *
33235  * Since: 2.26
33236  */
33237
33238
33239 /**
33240  * g_zlib_decompressor_get_file_info:
33241  * @decompressor: a #GZlibDecompressor
33242  *
33243  * Retrieves the #GFileInfo constructed from the GZIP header data
33244  * of compressed data processed by @compressor, or %NULL if @decompressor's
33245  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33246  * or the header data was not fully processed yet, or it not present in the
33247  * data stream at all.
33248  *
33249  * Returns: (transfer none): a #GFileInfo, or %NULL
33250  * Since: 2.26
33251  */
33252
33253
33254 /**
33255  * g_zlib_decompressor_new:
33256  * @format: The format to use for the compressed data
33257  *
33258  * Creates a new #GZlibDecompressor.
33259  *
33260  * Returns: a new #GZlibDecompressor
33261  * Since: 2.24
33262  */
33263
33264
33265 /**
33266  * get_all_desktop_entries_for_mime_type:
33267  * @mime_type: a mime type.
33268  * @except: NULL or a strv list
33269  *
33270  * Returns all the desktop ids for @mime_type. The desktop files
33271  * are listed in an order so that default applications are listed before
33272  * non-default ones, and handlers for inherited mimetypes are listed
33273  * after the base ones.
33274  *
33275  * Optionally doesn't list the desktop ids given in the @except
33276  *
33277  * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
33278  */
33279
33280
33281 /**
33282  * mime_info_cache_reload:
33283  * @dir: directory path which needs reloading.
33284  *
33285  * Reload the mime information for the @dir.
33286  */
33287
33288
33289
33290 /************************************************************/
33291 /* THIS FILE IS GENERATED DO NOT EDIT */
33292 /************************************************************/